Previous 199869 Revisions Next

r18186 Friday 28th September, 2012 at 08:39:43 UTC by Miodrag Milanović
Replace some *_DEVICE_HANDLER with _MEMBER calls, mostly audio (no whatsnew)
[src/mame/audio]8080bw.c asteroid.c avalnche.c blockade.c bsktball.c bzone.c canyon.c cchasm.c cinemat.c copsnrob.c crbaloon.c dkong.c firetrk.c harddriv.c llander.c m79amb.c mario.c micro3d.c mw8080bw.c orbit.c poolshrk.c qix.c redalert.c segag80r.c senjyo.c skyraid.c spiders.c sprint8.c starwars.c subs.c suna8.c turbo.c zaxxon.c
[src/mame/drivers]8080bw.c asteroid.c avalnche.c blockade.c bsktball.c bzone.c canyon.c circus.c circusc.c crbaloon.c dragrace.c firetrk.c harddriv.c m79amb.c mario.c micro3d.c mw8080bw.c orbit.c poolshrk.c skyraid.c spiders.c sprint8.c subs.c suna8.c turbo.c zaxxon.c
[src/mame/includes]8080bw.h asteroid.h avalnche.h blockade.h bsktball.h bzone.h canyon.h cchasm.h cinemat.h circus.h circusc.h copsnrob.h crbaloon.h dkong.h dragrace.h firetrk.h harddriv.h m79amb.h mario.h micro3d.h mw8080bw.h nitedrvr.h orbit.h poolshrk.h qix.h redalert.h segag80r.h senjyo.h skyraid.h spiders.h sprint8.h starwars.h subs.h suna8.h turbo.h zaxxon.h
[src/mame/machine]mw8080bw.c nitedrvr.c

trunk/src/mame/includes/dkong.h
r18185r18186
8282      : driver_device(mconfig, type, tag),
8383      m_video_ram(*this,"video_ram"),
8484      m_sprite_ram(*this,"sprite_ram"),
85      m_vidhw(DKONG_BOARD) { }
85      m_vidhw(DKONG_BOARD),
86      m_discrete(*this, "discrete") { }
8687
8788   /* memory pointers */
8889   required_shared_ptr<UINT8> m_video_ram;
r18185r18186
108109   const UINT8 *     m_color_codes;
109110   emu_timer *       m_scanline_timer;
110111   INT8              m_vidhw;         /* Selected video hardware RS Conversion / TKG04 */
111
112   
113   required_device<discrete_device> m_discrete;
112114   /* radar scope */
113115
114116   UINT8 *           m_gfx4;
r18185r18186
218220   INTERRUPT_GEN_MEMBER(s2650_interrupt);
219221   INTERRUPT_GEN_MEMBER(vblank_irq);
220222   TIMER_CALLBACK_MEMBER(scanline_callback);
223   DECLARE_WRITE8_MEMBER(M58817_command_w);
224   DECLARE_READ8_MEMBER(dkong_voice_status_r);
225   DECLARE_READ8_MEMBER(dkong_tune_r);
226   DECLARE_WRITE8_MEMBER(dkong_p1_w);
221227};
222228
223229/*----------- defined in audio/dkong.c -----------*/
trunk/src/mame/includes/firetrk.h
r18185r18186
4343      m_blink(*this, "blink"),
4444      m_drone_x(*this, "drone_x"),
4545      m_drone_y(*this, "drone_y"),
46      m_drone_rot(*this, "drone_rot"){ }
46      m_drone_rot(*this, "drone_rot"),
47      m_discrete(*this, "discrete"){ }
4748
4849   UINT8 m_in_service_mode;
4950   UINT32 m_dial[2];
r18185r18186
5960   optional_shared_ptr<UINT8> m_drone_x;
6061   optional_shared_ptr<UINT8> m_drone_y;
6162   optional_shared_ptr<UINT8> m_drone_rot;
63   required_device<discrete_device> m_discrete;
6264   UINT8 m_flash;
6365   UINT8 m_crash[2];
6466   UINT8 m_skid[2];
r18185r18186
106108   UINT32 screen_update_montecar(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
107109   INTERRUPT_GEN_MEMBER(firetrk_interrupt);
108110   TIMER_CALLBACK_MEMBER(periodic_callback);
111   DECLARE_WRITE8_MEMBER(firetrk_skid_reset_w);
112   DECLARE_WRITE8_MEMBER(montecar_skid_reset_w);
113   DECLARE_WRITE8_MEMBER(firetrk_crash_snd_w);
114   DECLARE_WRITE8_MEMBER(firetrk_skid_snd_w);
115   DECLARE_WRITE8_MEMBER(firetrk_motor_snd_w);
116   DECLARE_WRITE8_MEMBER(superbug_motor_snd_w);
117   DECLARE_WRITE8_MEMBER(firetrk_xtndply_w);
109118};
110119
111120
112121/*----------- defined in audio/firetrk.c -----------*/
113122
114DECLARE_WRITE8_DEVICE_HANDLER( firetrk_skid_reset_w );
115DECLARE_WRITE8_DEVICE_HANDLER( montecar_skid_reset_w );
116DECLARE_WRITE8_DEVICE_HANDLER( firetrk_crash_snd_w );
117DECLARE_WRITE8_DEVICE_HANDLER( firetrk_skid_snd_w );
118DECLARE_WRITE8_DEVICE_HANDLER( firetrk_motor_snd_w );
119DECLARE_WRITE8_DEVICE_HANDLER( superbug_motor_snd_w );
120DECLARE_WRITE8_DEVICE_HANDLER( firetrk_xtndply_w );
121123
122124DISCRETE_SOUND_EXTERN( firetrk );
123125DISCRETE_SOUND_EXTERN( superbug );
trunk/src/mame/includes/senjyo.h
r18185r18186
8383   virtual void video_start();
8484   UINT32 screen_update_senjyo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
8585   INTERRUPT_GEN_MEMBER(senjyo_interrupt);
86   DECLARE_READ8_MEMBER(pio_pa_r);
8687};
8788
8889/*----------- defined in audio/senjyo.c -----------*/
trunk/src/mame/includes/suna8.h
r18185r18186
106106   UINT32 screen_update_suna8(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
107107   TIMER_DEVICE_CALLBACK_MEMBER(brickzn_interrupt);
108108   TIMER_DEVICE_CALLBACK_MEMBER(hardhea2_interrupt);
109   DECLARE_WRITE8_MEMBER(suna8_play_samples_w);
110   DECLARE_WRITE8_MEMBER(rranger_play_samples_w);
111   DECLARE_WRITE8_MEMBER(suna8_samples_number_w);
109112};
110113
111114/*----------- defined in audio/suna8.c -----------*/
112115
113DECLARE_WRITE8_DEVICE_HANDLER( suna8_play_samples_w );
114DECLARE_WRITE8_DEVICE_HANDLER( rranger_play_samples_w );
115DECLARE_WRITE8_DEVICE_HANDLER( suna8_samples_number_w );
116116SAMPLES_START( suna8_sh_start );
trunk/src/mame/includes/harddriv.h
r18185r18186
220220   INTERRUPT_GEN_MEMBER(hd68k_irq_gen);
221221   TIMER_CALLBACK_MEMBER(deferred_adsp_bank_switch);
222222   TIMER_CALLBACK_MEMBER(rddsp32_sync_cb);
223   DECLARE_WRITE16_MEMBER(hdsnddsp_dac_w);
223224};
224225
225226
r18185r18186
342343/*----------- defined in audio/harddriv.c -----------*/
343344
344345void hdsnd_init(running_machine &machine);
345DECLARE_WRITE16_DEVICE_HANDLER( hdsnddsp_dac_w );
346346
347
348347/*----------- defined in video/harddriv.c -----------*/
349348
350349
trunk/src/mame/includes/zaxxon.h
r18185r18186
7373   UINT32 screen_update_razmataz(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
7474   UINT32 screen_update_congo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
7575   INTERRUPT_GEN_MEMBER(vblank_int);
76   DECLARE_WRITE8_MEMBER(zaxxon_sound_a_w);
77   DECLARE_WRITE8_MEMBER(zaxxon_sound_b_w);
78   DECLARE_WRITE8_MEMBER(zaxxon_sound_c_w);
79   DECLARE_WRITE8_MEMBER(congo_sound_b_w);
80   DECLARE_WRITE8_MEMBER(congo_sound_c_w);
7681};
7782
7883
7984/*----------- defined in audio/zaxxon.c -----------*/
80
81DECLARE_WRITE8_DEVICE_HANDLER( zaxxon_sound_a_w );
82DECLARE_WRITE8_DEVICE_HANDLER( zaxxon_sound_b_w );
83DECLARE_WRITE8_DEVICE_HANDLER( zaxxon_sound_c_w );
84
85DECLARE_WRITE8_DEVICE_HANDLER( congo_sound_b_w );
86DECLARE_WRITE8_DEVICE_HANDLER( congo_sound_c_w );
87
8885MACHINE_CONFIG_EXTERN( zaxxon_samples );
8986MACHINE_CONFIG_EXTERN( congo_samples );
trunk/src/mame/includes/turbo.h
r18185r18186
132132   UINT32 screen_update_subroc3d(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
133133   UINT32 screen_update_buckrog(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
134134   TIMER_CALLBACK_MEMBER(delayed_i8255_w);
135   DECLARE_WRITE8_MEMBER(turbo_sound_a_w);
136   DECLARE_WRITE8_MEMBER(turbo_sound_b_w);
137   DECLARE_WRITE8_MEMBER(turbo_sound_c_w);
138   DECLARE_WRITE8_MEMBER(subroc3d_sound_a_w);
139   DECLARE_WRITE8_MEMBER(subroc3d_sound_b_w);
140   DECLARE_WRITE8_MEMBER(subroc3d_sound_c_w);
141   DECLARE_WRITE8_MEMBER(buckrog_sound_a_w);
142   DECLARE_WRITE8_MEMBER(buckrog_sound_b_w);
135143};
136144
137145
r18185r18186
139147MACHINE_CONFIG_EXTERN( turbo_samples );
140148MACHINE_CONFIG_EXTERN( subroc3d_samples );
141149MACHINE_CONFIG_EXTERN( buckrog_samples );
142
143DECLARE_WRITE8_DEVICE_HANDLER( turbo_sound_a_w );
144DECLARE_WRITE8_DEVICE_HANDLER( turbo_sound_b_w );
145DECLARE_WRITE8_DEVICE_HANDLER( turbo_sound_c_w );
146
147DECLARE_WRITE8_DEVICE_HANDLER( subroc3d_sound_a_w );
148DECLARE_WRITE8_DEVICE_HANDLER( subroc3d_sound_b_w );
149DECLARE_WRITE8_DEVICE_HANDLER( subroc3d_sound_c_w );
150
151DECLARE_WRITE8_DEVICE_HANDLER( buckrog_sound_a_w );
152DECLARE_WRITE8_DEVICE_HANDLER( buckrog_sound_b_w );
trunk/src/mame/includes/starwars.h
r18185r18186
6363   DECLARE_DRIVER_INIT(starwars);
6464   virtual void machine_reset();
6565   TIMER_CALLBACK_MEMBER(math_run_clear);
66   DECLARE_READ8_MEMBER(r6532_porta_r);
67   DECLARE_WRITE8_MEMBER(r6532_porta_w);
68   DECLARE_WRITE_LINE_MEMBER(snd_interrupt);
6669};
6770
6871
trunk/src/mame/includes/nitedrvr.h
r18185r18186
2121   nitedrvr_state(const machine_config &mconfig, device_type type, const char *tag)
2222      : driver_device(mconfig, type, tag) ,
2323      m_videoram(*this, "videoram"),
24      m_hvc(*this, "hvc"){ }
24      m_hvc(*this, "hvc"),
25      m_discrete(*this, "discrete"){ }
2526
2627   /* memory pointers */
2728   required_shared_ptr<UINT8> m_videoram;
r18185r18186
4344
4445   /* devices */
4546   cpu_device *m_maincpu;
46   device_t *m_discrete;
47   required_device<discrete_device> m_discrete;
4748   DECLARE_READ8_MEMBER(nitedrvr_steering_reset_r);
4849   DECLARE_WRITE8_MEMBER(nitedrvr_steering_reset_w);
4950   DECLARE_READ8_MEMBER(nitedrvr_in0_r);
trunk/src/mame/includes/cchasm.h
r18185r18186
3333   DECLARE_WRITE_LINE_MEMBER(cchasm_6840_irq);
3434   virtual void video_start();
3535   TIMER_CALLBACK_MEMBER(cchasm_refresh_end);
36   DECLARE_WRITE_LINE_MEMBER(ctc_timer_1_w);
37   DECLARE_WRITE_LINE_MEMBER(ctc_timer_2_w);
3638};
3739
3840/*----------- defined in audio/cchasm.c -----------*/
trunk/src/mame/includes/skyraid.h
r18185r18186
77      : driver_device(mconfig, type, tag) ,
88      m_pos_ram(*this, "pos_ram"),
99      m_alpha_num_ram(*this, "alpha_num_ram"),
10      m_obj_ram(*this, "obj_ram"){ }
10      m_obj_ram(*this, "obj_ram"),
11      m_discrete(*this, "discrete"){ }
1112
1213   int m_analog_range;
1314   int m_analog_offset;
r18185r18186
1718   required_shared_ptr<UINT8> m_pos_ram;
1819   required_shared_ptr<UINT8> m_alpha_num_ram;
1920   required_shared_ptr<UINT8> m_obj_ram;
20
21   required_device<discrete_device> m_discrete;
2122   bitmap_ind16 m_helper;
2223   DECLARE_READ8_MEMBER(skyraid_port_0_r);
2324   DECLARE_WRITE8_MEMBER(skyraid_range_w);
r18185r18186
2627   virtual void video_start();
2728   virtual void palette_init();
2829   UINT32 screen_update_skyraid(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
30   DECLARE_WRITE8_MEMBER(skyraid_sound_w);
2931};
3032
3133/*----------- defined in audio/skyraid.c -----------*/
3234DISCRETE_SOUND_EXTERN( skyraid );
33DECLARE_WRITE8_DEVICE_HANDLER( skyraid_sound_w );
34
trunk/src/mame/includes/copsnrob.h
r18185r18186
1717      m_bulletsram(*this, "bulletsram"),
1818      m_carimage(*this, "carimage"),
1919      m_cary(*this, "cary"),
20      m_videoram(*this, "videoram"){ }
20      m_videoram(*this, "videoram"),
21      m_discrete(*this, "discrete"){ }
2122
2223   /* memory pointers */
2324   required_shared_ptr<UINT8> m_trucky;
r18185r18186
2627   required_shared_ptr<UINT8> m_carimage;
2728   required_shared_ptr<UINT8> m_cary;
2829   required_shared_ptr<UINT8> m_videoram;
29
30   required_device<discrete_device> m_discrete;
3031   /* misc */
3132   UINT8          m_misc;
3233   UINT8          m_ic_h3_data;
trunk/src/mame/includes/dragrace.h
r18185r18186
2828   dragrace_state(const machine_config &mconfig, device_type type, const char *tag)
2929      : driver_device(mconfig, type, tag) ,
3030      m_playfield_ram(*this, "playfield_ram"),
31      m_position_ram(*this, "position_ram"){ }
31      m_position_ram(*this, "position_ram"),
32      m_discrete(*this, "discrete"){ }
3233
3334   /* memory pointers */
3435   required_shared_ptr<UINT8> m_playfield_ram;
r18185r18186
4243   int       m_gear[2];
4344
4445   /* devices */
45   device_t *m_discrete;
46   required_device<discrete_device> m_discrete;
4647   DECLARE_WRITE8_MEMBER(dragrace_misc_w);
4748   DECLARE_WRITE8_MEMBER(dragrace_misc_clear_w);
4849   DECLARE_READ8_MEMBER(dragrace_input_r);
trunk/src/mame/includes/mario.h
r18185r18186
11#ifndef MARIO_H_
22#define MARIO_H_
33
4#include "sound/discrete.h"
5
46/*
57 * From the schematics:
68 *
r18185r18186
3638   mario_state(const machine_config &mconfig, device_type type, const char *tag)
3739      : driver_device(mconfig, type, tag) ,
3840      m_spriteram(*this, "spriteram"),
39      m_videoram(*this, "videoram"){ }
41      m_videoram(*this, "videoram"),
42      m_discrete(*this, "discrete"){ }
4043
4144   /* memory pointers */
4245
r18185r18186
5760
5861   required_shared_ptr<UINT8> m_spriteram;
5962   required_shared_ptr<UINT8> m_videoram;
63   required_device<discrete_device> m_discrete;
6064   tilemap_t *m_bg_tilemap;
6165   int m_monitor;
6266
r18185r18186
8387   virtual void palette_init();
8488   UINT32 screen_update_mario(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
8589   INTERRUPT_GEN_MEMBER(vblank_irq);
90   DECLARE_WRITE8_MEMBER(mario_sh_sound_w);
91   DECLARE_WRITE8_MEMBER(mario_sh1_w);
92   DECLARE_WRITE8_MEMBER(mario_sh2_w);
8693};
8794
8895/*----------- defined in audio/mario.c -----------*/
8996
90DECLARE_WRITE8_DEVICE_HANDLER( mario_sh1_w );
91DECLARE_WRITE8_DEVICE_HANDLER( mario_sh2_w );
92
93
9497MACHINE_CONFIG_EXTERN( mario_audio );
9598MACHINE_CONFIG_EXTERN( masao_audio );
9699
trunk/src/mame/includes/bsktball.h
r18185r18186
1919   bsktball_state(const machine_config &mconfig, device_type type, const char *tag)
2020      : driver_device(mconfig, type, tag) ,
2121      m_videoram(*this, "videoram"),
22      m_motion(*this, "motion"){ }
22      m_motion(*this, "motion"),
23      m_discrete(*this, "discrete"){ }
2324
2425   /* memory pointers */
2526   required_shared_ptr<UINT8> m_videoram;
2627   required_shared_ptr<UINT8> m_motion;
28   required_device<discrete_device> m_discrete;
2729
2830   /* video-related */
2931   tilemap_t  *m_bg_tilemap;
r18185r18186
5759   virtual void palette_init();
5860   UINT32 screen_update_bsktball(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
5961   TIMER_DEVICE_CALLBACK_MEMBER(bsktball_scanline);
62   DECLARE_WRITE8_MEMBER(bsktball_bounce_w);
63   DECLARE_WRITE8_MEMBER(bsktball_note_w);
64   DECLARE_WRITE8_MEMBER(bsktball_noise_reset_w);
6065};
6166
6267/*----------- defined in audio/bsktball.c -----------*/
6368
64DECLARE_WRITE8_DEVICE_HANDLER( bsktball_bounce_w );
65DECLARE_WRITE8_DEVICE_HANDLER( bsktball_note_w );
66DECLARE_WRITE8_DEVICE_HANDLER( bsktball_noise_reset_w );
67
6869DISCRETE_SOUND_EXTERN( bsktball );
trunk/src/mame/includes/spiders.h
r18185r18186
33    Sigma Spiders hardware
44
55***************************************************************************/
6#include "sound/discrete.h"
67
7
88#define NUM_PENS   (8)
99
1010class spiders_state : public driver_device
r18185r18186
1212public:
1313   spiders_state(const machine_config &mconfig, device_type type, const char *tag)
1414      : driver_device(mconfig, type, tag) ,
15      m_ram(*this, "ram"){ }
15      m_ram(*this, "ram"),
16      m_discrete(*this, "discrete"){ }
1617
1718   required_shared_ptr<UINT8> m_ram;
19   required_device<discrete_device> m_discrete;
1820   UINT8 m_flipscreen;
1921   UINT16 m_gfx_rom_address;
2022   UINT8 m_gfx_rom_ctrl_mode;
r18185r18186
3133   virtual void machine_start();
3234   INTERRUPT_GEN_MEMBER(update_pia_1);
3335   DECLARE_WRITE8_MEMBER(ic60_74123_output_changed);
36   DECLARE_WRITE8_MEMBER(spiders_audio_command_w);
37   DECLARE_WRITE8_MEMBER(spiders_audio_a_w);
38   DECLARE_WRITE8_MEMBER(spiders_audio_b_w);
39   DECLARE_WRITE8_MEMBER(spiders_audio_ctrl_w);
3440};
3541
3642/*----------- defined in audio/spiders.c -----------*/
37DECLARE_WRITE8_DEVICE_HANDLER( spiders_audio_command_w );
38DECLARE_WRITE8_DEVICE_HANDLER( spiders_audio_a_w );
39DECLARE_WRITE8_DEVICE_HANDLER( spiders_audio_b_w );
40DECLARE_WRITE8_DEVICE_HANDLER( spiders_audio_ctrl_w );
41
4243MACHINE_CONFIG_EXTERN( spiders_audio );
trunk/src/mame/includes/cinemat.h
r18185r18186
6666   DECLARE_VIDEO_START(cinemat_qb3color);
6767   UINT32 screen_update_cinemat(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
6868   UINT32 screen_update_spacewar(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
69   DECLARE_READ8_MEMBER(sound_porta_r);
70   DECLARE_READ8_MEMBER(sound_portb_r);
71   DECLARE_WRITE8_MEMBER(sound_portb_w);
72   DECLARE_WRITE8_MEMBER(sound_output_w);
6973};
7074
7175/*----------- defined in audio/cinemat.c -----------*/
trunk/src/mame/includes/redalert.h
r18185r18186
4141   UINT32 screen_update_demoneye(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
4242   UINT32 screen_update_panther(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
4343   INTERRUPT_GEN_MEMBER(redalert_vblank_interrupt);
44   DECLARE_WRITE8_MEMBER(redalert_analog_w);
45   DECLARE_WRITE8_MEMBER(redalert_AY8910_w);
46   DECLARE_WRITE_LINE_MEMBER(sod_callback);
47   DECLARE_READ_LINE_MEMBER(sid_callback);
48   DECLARE_WRITE8_MEMBER(demoneye_ay8910_latch_1_w);
49   DECLARE_READ8_MEMBER(demoneye_ay8910_latch_2_r);
50   DECLARE_WRITE8_MEMBER(demoneye_ay8910_data_w);
4451};
4552/*----------- defined in audio/redalert.c -----------*/
4653
trunk/src/mame/includes/subs.h
r18185r18186
2222   subs_state(const machine_config &mconfig, device_type type, const char *tag)
2323      : driver_device(mconfig, type, tag) ,
2424      m_spriteram(*this, "spriteram"),
25      m_videoram(*this, "videoram"){ }
25      m_videoram(*this, "videoram"),
26      m_discrete(*this, "discrete"){ }
2627
2728   required_shared_ptr<UINT8> m_spriteram;
2829   required_shared_ptr<UINT8> m_videoram;
30   required_device<discrete_device> m_discrete;
2931   int m_steering_buf1;
3032   int m_steering_buf2;
3133   int m_steering_val1;
r18185r18186
4547   UINT32 screen_update_subs_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
4648   UINT32 screen_update_subs_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
4749   INTERRUPT_GEN_MEMBER(subs_interrupt);
50   DECLARE_WRITE8_MEMBER(subs_sonar1_w);
51   DECLARE_WRITE8_MEMBER(subs_sonar2_w);
52   DECLARE_WRITE8_MEMBER(subs_crash_w);
53   DECLARE_WRITE8_MEMBER(subs_explode_w);
54   DECLARE_WRITE8_MEMBER(subs_noise_reset_w);
4855};
4956
5057/*----------- defined in audio/subs.c -----------*/
5158
52DECLARE_WRITE8_DEVICE_HANDLER( subs_noise_reset_w );
53DECLARE_WRITE8_DEVICE_HANDLER( subs_sonar2_w );
54DECLARE_WRITE8_DEVICE_HANDLER( subs_sonar1_w );
55DECLARE_WRITE8_DEVICE_HANDLER( subs_crash_w );
56DECLARE_WRITE8_DEVICE_HANDLER( subs_explode_w );
57
5859DISCRETE_SOUND_EXTERN( subs );
trunk/src/mame/includes/8080bw.h
r18185r18186
1616   _8080bw_state(const machine_config &mconfig, device_type type, const char *tag)
1717      : mw8080bw_state(mconfig, type, tag),
1818      m_schaser_effect_555_timer(*this, "schaser_sh_555"),
19      m_claybust_gun_on(*this, "claybust_gun")
19      m_claybust_gun_on(*this, "claybust_gun"),
20      m_discrete(*this, "discrete")
2021   { }
2122
2223   /* devices/memory pointers */
2324   optional_device<timer_device> m_schaser_effect_555_timer;
2425   optional_device<timer_device> m_claybust_gun_on;
25
26   required_device<discrete_device> m_discrete;
2627   device_t *m_speaker;
2728
2829
r18185r18186
108109   INTERRUPT_GEN_MEMBER(polaris_interrupt);
109110   TIMER_DEVICE_CALLBACK_MEMBER(claybust_gun_callback);
110111   TIMER_DEVICE_CALLBACK_MEMBER(schaser_effect_555_cb);
112   DECLARE_WRITE8_MEMBER(indianbt_sh_port_3_w);
113   DECLARE_WRITE8_MEMBER(polaris_sh_port_1_w);
114   DECLARE_WRITE8_MEMBER(polaris_sh_port_2_w);
115   DECLARE_WRITE8_MEMBER(polaris_sh_port_3_w);
111116};
112117
113118
114119/*----------- defined in audio/8080bw.c -----------*/
115120extern const samples_interface lrescue_samples_interface;
116121
117DECLARE_WRITE8_DEVICE_HANDLER( indianbt_sh_port_3_w );
118122DISCRETE_SOUND_EXTERN( indianbt );
119
120DECLARE_WRITE8_DEVICE_HANDLER( polaris_sh_port_1_w );
121DECLARE_WRITE8_DEVICE_HANDLER( polaris_sh_port_2_w );
122DECLARE_WRITE8_DEVICE_HANDLER( polaris_sh_port_3_w );
123123DISCRETE_SOUND_EXTERN( polaris );
124124
125125extern const sn76477_interface schaser_sn76477_interface;
trunk/src/mame/includes/m79amb.h
r18185r18186
11#include "sound/discrete.h"
22
3class m79amb_state : public driver_device
4{
5public:
6   m79amb_state(const machine_config &mconfig, device_type type, const char *tag)
7      : driver_device(mconfig, type, tag) ,
8      m_videoram(*this, "videoram"),
9      m_mask(*this, "mask"),
10      m_discrete(*this, "discrete"){ }
311
12   /* memory pointers */
13   required_shared_ptr<UINT8> m_videoram;
14   required_shared_ptr<UINT8> m_mask;
15
16   required_device<discrete_device> m_discrete;
17   
18   /* misc */
19   UINT8 m_lut_gun1[0x100];
20   UINT8 m_lut_gun2[0x100];
21   DECLARE_WRITE8_MEMBER(ramtek_videoram_w);
22   DECLARE_READ8_MEMBER(gray5bit_controller0_r);
23   DECLARE_READ8_MEMBER(gray5bit_controller1_r);
24   DECLARE_WRITE8_MEMBER(m79amb_8002_w);
25   DECLARE_DRIVER_INIT(m79amb);
26   UINT32 screen_update_ramtek(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
27   INTERRUPT_GEN_MEMBER(m79amb_interrupt);
28   DECLARE_WRITE8_MEMBER(m79amb_8000_w);
29   DECLARE_WRITE8_MEMBER(m79amb_8003_w);
30};
31
432/*----------- defined in audio/m79amb.c -----------*/
533
634DISCRETE_SOUND_EXTERN( m79amb );
735
8DECLARE_WRITE8_DEVICE_HANDLER( m79amb_8000_w );
9DECLARE_WRITE8_DEVICE_HANDLER( m79amb_8003_w );
trunk/src/mame/includes/mw8080bw.h
r18185r18186
3838      : driver_device(mconfig, type, tag),
3939      m_maincpu(*this,"maincpu"),
4040      m_main_ram(*this, "main_ram"),
41      m_colorram(*this, "colorram")
41      m_colorram(*this, "colorram"),
42      m_discrete(*this, "discrete")
4243   { }
4344
4445   /* device/memory pointers */
4546   required_device<cpu_device> m_maincpu;
4647   required_shared_ptr<UINT8> m_main_ram;
4748   optional_shared_ptr<UINT8> m_colorram;
48
49   required_device<discrete_device> m_discrete;
50   
4951   /* sound-related */
5052   UINT8       m_port_1_last;
5153   UINT8       m_port_2_last;
r18185r18186
7678   samples_device *m_samples2;
7779   device_t *m_sn1;
7880   device_t *m_sn2;
79   device_t *m_sn;
80   device_t *m_discrete;
81   device_t *m_sn;   
8182
8283   DECLARE_READ8_MEMBER(mw8080bw_shift_result_rev_r);
8384   DECLARE_READ8_MEMBER(mw8080bw_reversable_shift_result_r);
r18185r18186
147148   TIMER_CALLBACK_MEMBER(maze_tone_timing_timer_callback);
148149   TIMER_CALLBACK_MEMBER(mw8080bw_interrupt_callback);
149150   TIMER_DEVICE_CALLBACK_MEMBER(spcenctr_strobe_timer_callback);
151   DECLARE_WRITE8_MEMBER(midway_tone_generator_lo_w);
152   DECLARE_WRITE8_MEMBER(midway_tone_generator_hi_w);
153   DECLARE_WRITE8_MEMBER(tornbase_audio_w);
154   DECLARE_WRITE8_MEMBER(boothill_audio_w);
155   DECLARE_WRITE8_MEMBER(checkmat_audio_w);
156   DECLARE_WRITE8_MEMBER(desertgu_audio_1_w);
157   DECLARE_WRITE8_MEMBER(desertgu_audio_2_w);
158   DECLARE_WRITE8_MEMBER(dplay_audio_w);
159   DECLARE_WRITE8_MEMBER(clowns_audio_2_w);
160   DECLARE_WRITE8_MEMBER(spacwalk_audio_1_w);
161   DECLARE_WRITE8_MEMBER(spacwalk_audio_2_w);
162   DECLARE_WRITE8_MEMBER(shuffle_audio_1_w);
163   DECLARE_WRITE8_MEMBER(shuffle_audio_2_w);
164   DECLARE_WRITE8_MEMBER(dogpatch_audio_w);
165   DECLARE_WRITE8_MEMBER(spcenctr_audio_1_w);
166   DECLARE_WRITE8_MEMBER(spcenctr_audio_2_w);
167   DECLARE_WRITE8_MEMBER(spcenctr_audio_3_w);
168   DECLARE_WRITE8_MEMBER(bowler_audio_1_w);
169   DECLARE_WRITE8_MEMBER(invaders_audio_1_w);
170   DECLARE_WRITE8_MEMBER(invaders_audio_2_w);
171   DECLARE_WRITE8_MEMBER(blueshrk_audio_w);
172   DECLARE_WRITE8_MEMBER(invad2ct_audio_1_w);
173   DECLARE_WRITE8_MEMBER(invad2ct_audio_2_w);
174   DECLARE_WRITE8_MEMBER(invad2ct_audio_3_w);
175   DECLARE_WRITE8_MEMBER(invad2ct_audio_4_w);
150176};
151177
152178
r18185r18186
200226
201227/*----------- defined in audio/mw8080bw.c -----------*/
202228
203DECLARE_WRITE8_DEVICE_HANDLER( midway_tone_generator_lo_w );
204DECLARE_WRITE8_DEVICE_HANDLER( midway_tone_generator_hi_w );
205229
206230MACHINE_CONFIG_EXTERN( seawolf_audio );
207231
208232MACHINE_CONFIG_EXTERN( gunfight_audio );
209233
210234MACHINE_CONFIG_EXTERN( tornbase_audio );
211DECLARE_WRITE8_DEVICE_HANDLER( tornbase_audio_w );
212235
213236MACHINE_CONFIG_EXTERN( zzzap_audio );
214237
r18185r18186
216239void maze_write_discrete(device_t *device, UINT8 maze_tone_timing_state);
217240
218241MACHINE_CONFIG_EXTERN( boothill_audio );
219DECLARE_WRITE8_DEVICE_HANDLER( boothill_audio_w );
220242
221243MACHINE_CONFIG_EXTERN( checkmat_audio );
222DECLARE_WRITE8_DEVICE_HANDLER( checkmat_audio_w );
223244
224245MACHINE_CONFIG_EXTERN( desertgu_audio );
225DECLARE_WRITE8_DEVICE_HANDLER( desertgu_audio_1_w );
226DECLARE_WRITE8_DEVICE_HANDLER( desertgu_audio_2_w );
227246
228247MACHINE_CONFIG_EXTERN( dplay_audio );
229DECLARE_WRITE8_DEVICE_HANDLER( dplay_audio_w );
230248
231249MACHINE_CONFIG_EXTERN( gmissile_audio );
232250
233251MACHINE_CONFIG_EXTERN( m4_audio );
234252
235253MACHINE_CONFIG_EXTERN( clowns_audio );
236DECLARE_WRITE8_DEVICE_HANDLER( clowns_audio_2_w );
237254
238255MACHINE_CONFIG_EXTERN( spacwalk_audio );
239DECLARE_WRITE8_DEVICE_HANDLER( spacwalk_audio_1_w );
240DECLARE_WRITE8_DEVICE_HANDLER( spacwalk_audio_2_w );
241256
242257MACHINE_CONFIG_EXTERN( shuffle_audio );
243DECLARE_WRITE8_DEVICE_HANDLER( shuffle_audio_1_w );
244DECLARE_WRITE8_DEVICE_HANDLER( shuffle_audio_2_w );
245258
246259MACHINE_CONFIG_EXTERN( dogpatch_audio );
247DECLARE_WRITE8_DEVICE_HANDLER( dogpatch_audio_w );
248260
249261MACHINE_CONFIG_EXTERN( spcenctr_audio );
250DECLARE_WRITE8_DEVICE_HANDLER( spcenctr_audio_1_w );
251DECLARE_WRITE8_DEVICE_HANDLER( spcenctr_audio_2_w );
252DECLARE_WRITE8_DEVICE_HANDLER( spcenctr_audio_3_w );
253262
254263MACHINE_CONFIG_EXTERN( phantom2_audio );
255264
256265MACHINE_CONFIG_EXTERN( bowler_audio );
257DECLARE_WRITE8_DEVICE_HANDLER( bowler_audio_1_w );
258266
259267MACHINE_CONFIG_EXTERN( invaders_samples_audio );
260268MACHINE_CONFIG_EXTERN( invaders_audio );
261DECLARE_WRITE8_DEVICE_HANDLER( invaders_audio_1_w );
262DECLARE_WRITE8_DEVICE_HANDLER( invaders_audio_2_w );
263269
264270MACHINE_CONFIG_EXTERN( blueshrk_audio );
265DECLARE_WRITE8_DEVICE_HANDLER( blueshrk_audio_w );
266271
267272MACHINE_CONFIG_EXTERN( invad2ct_audio );
268DECLARE_WRITE8_DEVICE_HANDLER( invad2ct_audio_1_w );
269DECLARE_WRITE8_DEVICE_HANDLER( invad2ct_audio_2_w );
270DECLARE_WRITE8_DEVICE_HANDLER( invad2ct_audio_3_w );
271DECLARE_WRITE8_DEVICE_HANDLER( invad2ct_audio_4_w );
trunk/src/mame/includes/sprint8.h
r18185r18186
99      m_pos_h_ram(*this, "pos_h_ram"),
1010      m_pos_v_ram(*this, "pos_v_ram"),
1111      m_pos_d_ram(*this, "pos_d_ram"),
12      m_team(*this, "team"){ }
12      m_team(*this, "team"),
13      m_discrete(*this, "discrete"){ }
1314
1415   int m_steer_dir[8];
1516   int m_steer_flag[8];
r18185r18186
2122   required_shared_ptr<UINT8> m_pos_v_ram;
2223   required_shared_ptr<UINT8> m_pos_d_ram;
2324   required_shared_ptr<UINT8> m_team;
25   required_device<discrete_device> m_discrete;
2426   tilemap_t* m_tilemap1;
2527   tilemap_t* m_tilemap2;
2628   bitmap_ind16 m_helper1;
r18185r18186
3941   void screen_eof_sprint8(screen_device &screen, bool state);
4042   TIMER_CALLBACK_MEMBER(sprint8_collision_callback);
4143   TIMER_DEVICE_CALLBACK_MEMBER(input_callback);
44   DECLARE_WRITE8_MEMBER(sprint8_crash_w);
45   DECLARE_WRITE8_MEMBER(sprint8_screech_w);
46   DECLARE_WRITE8_MEMBER(sprint8_attract_w);
47   DECLARE_WRITE8_MEMBER(sprint8_motor_w);
4248};
4349
4450/*----------- defined in drivers/sprint8.c -----------*/
r18185r18186
4753/*----------- defined in audio/sprint8.c -----------*/
4854
4955DISCRETE_SOUND_EXTERN( sprint8 );
50
51DECLARE_WRITE8_DEVICE_HANDLER( sprint8_crash_w );
52DECLARE_WRITE8_DEVICE_HANDLER( sprint8_screech_w );
53DECLARE_WRITE8_DEVICE_HANDLER( sprint8_attract_w );
54DECLARE_WRITE8_DEVICE_HANDLER( sprint8_motor_w );
trunk/src/mame/includes/avalnche.h
r18185r18186
1212public:
1313   avalnche_state(const machine_config &mconfig, device_type type, const char *tag)
1414      : driver_device(mconfig, type, tag) ,
15      m_videoram(*this, "videoram"){ }
15      m_videoram(*this, "videoram"),
16      m_discrete(*this, "discrete") { }
1617
1718   /* video-related */
1819   required_shared_ptr<UINT8> m_videoram;
20   required_device<discrete_device> m_discrete;
1921
2022   UINT8    m_avalance_video_inverted;
2123   DECLARE_WRITE8_MEMBER(avalance_video_invert_w);
r18185r18186
2628   virtual void machine_start();
2729   virtual void machine_reset();
2830   UINT32 screen_update_avalnche(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
31   DECLARE_WRITE8_MEMBER(avalnche_noise_amplitude_w);
32   DECLARE_WRITE8_MEMBER(avalnche_attract_enable_w);
33   DECLARE_WRITE8_MEMBER(avalnche_audio_w);
34   DECLARE_WRITE8_MEMBER(catch_audio_w);
2935};
3036
3137/*----------- defined in audio/avalnche.c -----------*/
32
3338DISCRETE_SOUND_EXTERN( avalnche );
34DECLARE_WRITE8_DEVICE_HANDLER( avalnche_noise_amplitude_w );
35DECLARE_WRITE8_DEVICE_HANDLER( avalnche_attract_enable_w );
36DECLARE_WRITE8_DEVICE_HANDLER( avalnche_audio_w );
3739
38DECLARE_WRITE8_HANDLER( catch_audio_w );
trunk/src/mame/includes/canyon.h
r18185r18186
2222public:
2323   canyon_state(const machine_config &mconfig, device_type type, const char *tag)
2424      : driver_device(mconfig, type, tag) ,
25      m_videoram(*this, "videoram"){ }
25      m_videoram(*this, "videoram"),
26      m_discrete(*this, "discrete"){ }
2627
2728   /* memory pointers */
2829   required_shared_ptr<UINT8> m_videoram;
2930
31   required_device<discrete_device> m_discrete;
32
3033   /* video-related */
3134   tilemap_t  *m_bg_tilemap;
3235   DECLARE_READ8_MEMBER(canyon_switches_r);
r18185r18186
3740   virtual void video_start();
3841   virtual void palette_init();
3942   UINT32 screen_update_canyon(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
43   DECLARE_WRITE8_MEMBER(canyon_motor_w);
44   DECLARE_WRITE8_MEMBER(canyon_explode_w);
45   DECLARE_WRITE8_MEMBER(canyon_attract_w);
46   DECLARE_WRITE8_MEMBER(canyon_whistle_w);
4047};
4148
4249
4350/*----------- defined in audio/canyon.c -----------*/
44
45DECLARE_WRITE8_DEVICE_HANDLER( canyon_motor_w );
46DECLARE_WRITE8_DEVICE_HANDLER( canyon_explode_w );
47DECLARE_WRITE8_DEVICE_HANDLER( canyon_attract_w );
48DECLARE_WRITE8_DEVICE_HANDLER( canyon_whistle_w );
49
5051DISCRETE_SOUND_EXTERN( canyon );
trunk/src/mame/includes/circusc.h
r18185r18186
66
77#include "sound/dac.h"
88#include "sound/sn76496.h"
9
9#include "sound/discrete.h"
1010class circusc_state : public driver_device
1111{
1212public:
r18185r18186
1919      m_spriteram_2(*this, "spriteram_2"),
2020      m_spriteram(*this, "spriteram"),
2121      m_sn_1(*this, "sn1"),
22      m_sn_2(*this, "sn2"){ }
22      m_sn_2(*this, "sn2"),
23      m_discrete(*this, "discrete"){ }
2324
2425   /* memory pointers */
2526   required_shared_ptr<UINT8> m_spritebank;
r18185r18186
4041   required_device<sn76496_new_device> m_sn_1;
4142   required_device<sn76496_new_device> m_sn_2;
4243   dac_device *m_dac;
43   device_t *m_discrete;
44   required_device<discrete_device> m_discrete;
4445
4546   UINT8          m_irq_mask;
4647   DECLARE_READ8_MEMBER(circusc_sh_timer_r);
trunk/src/mame/includes/blockade.h
r18185r18186
66public:
77   blockade_state(const machine_config &mconfig, device_type type, const char *tag)
88      : driver_device(mconfig, type, tag) ,
9      m_videoram(*this, "videoram"){ }
9      m_videoram(*this, "videoram"),
10      m_discrete(*this, "discrete"){ }
1011
1112   required_shared_ptr<UINT8> m_videoram;
12
13   required_device<discrete_device> m_discrete;
1314   /* video-related */
1415   tilemap_t  *m_bg_tilemap;
1516
r18185r18186
2829   virtual void palette_init();
2930   UINT32 screen_update_blockade(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
3031   INTERRUPT_GEN_MEMBER(blockade_interrupt);
32   DECLARE_WRITE8_MEMBER(blockade_sound_freq_w);
3133};
3234
3335/*----------- defined in audio/blockade.c -----------*/
3436
3537extern const samples_interface blockade_samples_interface;
3638DISCRETE_SOUND_EXTERN( blockade );
37
38DECLARE_WRITE8_DEVICE_HANDLER( blockade_sound_freq_w );
trunk/src/mame/includes/segag80r.h
r18185r18186
102102   INTERRUPT_GEN_MEMBER(segag80r_vblank_start);
103103   INTERRUPT_GEN_MEMBER(sindbadm_vblank_start);
104104   TIMER_CALLBACK_MEMBER(vblank_latch_clear);
105   DECLARE_WRITE8_MEMBER(sega005_sound_a_w);
106   DECLARE_WRITE8_MEMBER(sega005_sound_b_w);
107   DECLARE_WRITE8_MEMBER(monsterb_sound_a_w);
108   DECLARE_WRITE8_MEMBER(monsterb_sound_b_w);
109   DECLARE_READ8_MEMBER(n7751_status_r);
110   DECLARE_WRITE8_MEMBER(n7751_command_w);
111   DECLARE_WRITE8_MEMBER(n7751_rom_control_w);
112   DECLARE_WRITE8_MEMBER(n7751_p2_w);
105113};
106114
107115
trunk/src/mame/includes/crbaloon.h
r18185r18186
44
55*************************************************************************/
66
7#include "sound/discrete.h"
78
89#define CRBALOON_MASTER_XTAL   (XTAL_9_987MHz)
910
r18185r18186
1617      m_videoram(*this, "videoram"),
1718      m_colorram(*this, "colorram"),
1819      m_spriteram(*this, "spriteram"),
19      m_pc3092_data(*this, "pc3092_data"){ }
20      m_pc3092_data(*this, "pc3092_data"),
21      m_discrete(*this, "discrete"){ }
2022
2123   required_shared_ptr<UINT8> m_videoram;
2224   required_shared_ptr<UINT8> m_colorram;
2325   required_shared_ptr<UINT8> m_spriteram;
2426   required_shared_ptr<UINT8> m_pc3092_data;
27   required_device<discrete_device> m_discrete;   
2528   UINT16 m_collision_address;
2629   UINT8 m_collision_address_clear;
2730   tilemap_t *m_bg_tilemap;
r18185r18186
3841   virtual void palette_init();
3942   UINT32 screen_update_crbaloon(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
4043   INTERRUPT_GEN_MEMBER(vblank_irq);
44   DECLARE_WRITE8_MEMBER(crbaloon_audio_set_music_freq);
45   DECLARE_WRITE8_MEMBER(crbaloon_audio_set_music_enable);
46   DECLARE_WRITE8_MEMBER(crbaloon_audio_set_laugh_enable);
4147};
4248
4349
4450/*----------- defined in audio/crbaloon.c -----------*/
4551
46DECLARE_WRITE8_DEVICE_HANDLER( crbaloon_audio_set_music_freq );
47DECLARE_WRITE8_DEVICE_HANDLER( crbaloon_audio_set_music_enable );
4852void crbaloon_audio_set_explosion_enable(device_t *sn, int enabled);
4953void crbaloon_audio_set_breath_enable(device_t *sn, int enabled);
5054void crbaloon_audio_set_appear_enable(device_t *sn, int enabled);
51DECLARE_WRITE8_DEVICE_HANDLER( crbaloon_audio_set_laugh_enable );
5255MACHINE_CONFIG_EXTERN( crbaloon_audio );
5356
5457/*----------- defined in video/crbaloon.c -----------*/
trunk/src/mame/includes/qix.h
r18185r18186
99#include "video/mc6845.h"
1010#include "machine/6821pia.h"
1111#include "sound/sn76496.h"
12#include "sound/discrete.h"
1213
13
1414#define MAIN_CLOCK_OSC         20000000   /* 20 MHz */
1515#define SLITHER_CLOCK_OSC      21300000   /* 21.3 MHz */
1616#define SOUND_CLOCK_OSC         7372800      /* 7.3728 MHz */
r18185r18186
3333      m_videoram_address(*this, "videoram_addr"),
3434      m_videoram_mask(*this, "videoram_mask"),
3535      m_paletteram(*this, "paletteram"),
36      m_scanline_latch(*this, "scanline_latch") { }
36      m_scanline_latch(*this, "scanline_latch"),
37      m_discrete(*this, "discrete") { }
3738
3839   /* devices */
3940   optional_device<sn76489_new_device> m_sn1;
r18185r18186
5455   UINT8  m_palette_bank;
5556   UINT8  m_leds;
5657   required_shared_ptr<UINT8> m_scanline_latch;
58   required_device<discrete_device> m_discrete;
5759   pen_t m_pens[NUM_PENS];
5860   DECLARE_WRITE8_MEMBER(zookeep_bankswitch_w);
5961   DECLARE_WRITE8_MEMBER(qix_data_firq_w);
r18185r18186
9799   DECLARE_READ8_MEMBER(slither_trak_ud_r);
98100   DECLARE_WRITE_LINE_MEMBER(display_enable_changed);
99101   DECLARE_WRITE8_MEMBER(qix_flip_screen_w);
102   DECLARE_WRITE8_MEMBER(qix_dac_w);
103   DECLARE_WRITE8_MEMBER(qix_vol_w);
104   DECLARE_WRITE8_MEMBER(sndpia_2_warning_w);
105   DECLARE_WRITE8_MEMBER(sync_sndpia1_porta_w);
106   DECLARE_WRITE8_MEMBER(slither_coinctl_w);
107   DECLARE_WRITE_LINE_MEMBER(qix_pia_dint);
108   DECLARE_WRITE_LINE_MEMBER(qix_pia_sint);
100109};
101110
102111
trunk/src/mame/includes/bzone.h
r18185r18186
55*************************************************************************/
66
77#include "devlegcy.h"
8#include "sound/discrete.h"
89
910#define BZONE_MASTER_CLOCK (XTAL_12_096MHz)
1011#define BZONE_CLOCK_3KHZ  (MASTER_CLOCK / 4096)
r18185r18186
1314{
1415public:
1516   bzone_state(const machine_config &mconfig, device_type type, const char *tag)
16      : driver_device(mconfig, type, tag) { }
17      : driver_device(mconfig, type, tag),
18        m_discrete(*this, "discrete") { }
1719
20   required_device<discrete_device> m_discrete;
21   
1822   UINT8 m_analog_data;
1923   UINT8 m_rb_input_select;
2024   DECLARE_WRITE8_MEMBER(bzone_coin_counter_w);
r18185r18186
2731   virtual void machine_start();
2832   DECLARE_MACHINE_START(redbaron);
2933   INTERRUPT_GEN_MEMBER(bzone_interrupt);
34   DECLARE_WRITE8_MEMBER(bzone_sounds_w);
3035};
3136
3237
3338/*----------- defined in audio/bzone.c -----------*/
34
35DECLARE_WRITE8_DEVICE_HANDLER( bzone_sounds_w );
36
3739MACHINE_CONFIG_EXTERN( bzone_audio );
3840
3941/*----------- defined in audio/redbaron.c -----------*/
trunk/src/mame/includes/orbit.h
r18185r18186
2121   orbit_state(const machine_config &mconfig, device_type type, const char *tag)
2222      : driver_device(mconfig, type, tag) ,
2323      m_playfield_ram(*this, "playfield_ram"),
24      m_sprite_ram(*this, "sprite_ram"){ }
24      m_sprite_ram(*this, "sprite_ram"),
25      m_discrete(*this, "discrete"){ }
2526
2627   /* memory pointers */
2728   required_shared_ptr<UINT8> m_playfield_ram;
2829   required_shared_ptr<UINT8> m_sprite_ram;
30   
31   required_device<discrete_device> m_discrete;
2932
3033   /* video-related */
3134   tilemap_t  *m_bg_tilemap;
r18185r18186
3639
3740   /* devices */
3841   cpu_device *m_maincpu;
39   device_t *m_discrete;
4042   DECLARE_WRITE8_MEMBER(orbit_misc_w);
4143   DECLARE_WRITE8_MEMBER(orbit_playfield_w);
4244   TILE_GET_INFO_MEMBER(get_tile_info);
r18185r18186
4749   INTERRUPT_GEN_MEMBER(orbit_interrupt);
4850   TIMER_CALLBACK_MEMBER(irq_off);
4951   TIMER_DEVICE_CALLBACK_MEMBER(nmi_32v);
52   DECLARE_WRITE8_MEMBER(orbit_note_w);
53   DECLARE_WRITE8_MEMBER(orbit_note_amp_w);
54   DECLARE_WRITE8_MEMBER(orbit_noise_amp_w);
55   DECLARE_WRITE8_MEMBER(orbit_noise_rst_w);
5056};
5157/*----------- defined in audio/orbit.c -----------*/
52DECLARE_WRITE8_DEVICE_HANDLER( orbit_note_w );
53DECLARE_WRITE8_DEVICE_HANDLER( orbit_note_amp_w );
54DECLARE_WRITE8_DEVICE_HANDLER( orbit_noise_amp_w );
55DECLARE_WRITE8_DEVICE_HANDLER( orbit_noise_rst_w );
58
5659DISCRETE_SOUND_EXTERN( orbit );
trunk/src/mame/includes/circus.h
r18185r18186
55public:
66   circus_state(const machine_config &mconfig, device_type type, const char *tag)
77      : driver_device(mconfig, type, tag) ,
8      m_videoram(*this, "videoram"){ }
8      m_videoram(*this, "videoram"),
9      m_discrete(*this, "discrete"){ }
910
1011   /* memory pointers */
1112   required_shared_ptr<UINT8> m_videoram;
r18185r18186
1920   /* devices */
2021   cpu_device *m_maincpu;
2122   samples_device *m_samples;
22   device_t *m_discrete;
23   required_device<discrete_device> m_discrete;
2324
2425   /* game id */
2526   int m_game_id;
trunk/src/mame/includes/asteroid.h
r18185r18186
1212   asteroid_state(const machine_config &mconfig, device_type type, const char *tag)
1313      : driver_device(mconfig, type, tag) ,
1414      m_ram1(*this, "ram1"),
15      m_ram2(*this, "ram2"){ }
15      m_ram2(*this, "ram2"),
16      m_discrete(*this, "discrete") { }
1617
1718   optional_shared_ptr<UINT8> m_ram1;
1819   optional_shared_ptr<UINT8> m_ram2;
20   required_device<discrete_device> m_discrete;
1921   DECLARE_WRITE8_MEMBER(astdelux_coin_counter_w);
2022   DECLARE_WRITE8_MEMBER(llander_led_w);
2123   DECLARE_READ8_MEMBER(asteroid_IN0_r);
r18185r18186
3234   INTERRUPT_GEN_MEMBER(asteroid_interrupt);
3335   INTERRUPT_GEN_MEMBER(asterock_interrupt);
3436   INTERRUPT_GEN_MEMBER(llander_interrupt);
37   DECLARE_WRITE8_MEMBER(asteroid_explode_w);
38   DECLARE_WRITE8_MEMBER(asteroid_thump_w);
39   DECLARE_WRITE8_MEMBER(asteroid_sounds_w);
40   DECLARE_WRITE8_MEMBER(astdelux_sounds_w);
41   DECLARE_WRITE8_MEMBER(asteroid_noise_reset_w);
42   DECLARE_WRITE8_MEMBER(llander_snd_reset_w);
43   DECLARE_WRITE8_MEMBER(llander_sounds_w);
3544};
3645
3746/*----------- defined in audio/asteroid.c -----------*/
r18185r18186
3948DISCRETE_SOUND_EXTERN( asteroid );
4049DISCRETE_SOUND_EXTERN( astdelux );
4150
42DECLARE_WRITE8_DEVICE_HANDLER( asteroid_explode_w );
43DECLARE_WRITE8_DEVICE_HANDLER( asteroid_thump_w );
44DECLARE_WRITE8_DEVICE_HANDLER( asteroid_sounds_w );
45DECLARE_WRITE8_DEVICE_HANDLER( asteroid_noise_reset_w );
46DECLARE_WRITE8_DEVICE_HANDLER( astdelux_sounds_w );
47
48
4951/*----------- defined in audio/llander.c -----------*/
5052
5153DISCRETE_SOUND_EXTERN( llander );
52
53DECLARE_WRITE8_DEVICE_HANDLER( llander_snd_reset_w );
54DECLARE_WRITE8_DEVICE_HANDLER( llander_sounds_w );
trunk/src/mame/includes/micro3d.h
r18185r18186
117117   INTERRUPT_GEN_MEMBER(micro3d_vblank);
118118   TIMER_CALLBACK_MEMBER(mac_done_callback);
119119   TIMER_CALLBACK_MEMBER(adc_done_callback);
120   DECLARE_WRITE8_MEMBER(micro3d_upd7759_w);
120121};
121122
122123struct micro3d_vtx
r18185r18186
134135
135136/*----------- defined in audio/micro3d.c -----------*/
136137
137DECLARE_WRITE8_DEVICE_HANDLER( micro3d_upd7759_w );
138
139138void micro3d_noise_sh_w(running_machine &machine, UINT8 data);
140139
141140class micro3d_sound_device : public device_t,
trunk/src/mame/includes/poolshrk.h
r18185r18186
1515      : driver_device(mconfig, type, tag) ,
1616      m_playfield_ram(*this, "playfield_ram"),
1717      m_hpos_ram(*this, "hpos_ram"),
18      m_vpos_ram(*this, "vpos_ram"){ }
18      m_vpos_ram(*this, "vpos_ram"),
19      m_discrete(*this, "discrete"){ }
1920
2021   int m_da_latch;
2122   required_shared_ptr<UINT8> m_playfield_ram;
2223   required_shared_ptr<UINT8> m_hpos_ram;
2324   required_shared_ptr<UINT8> m_vpos_ram;
25   required_device<discrete_device> m_discrete;
2426   tilemap_t* m_bg_tilemap;
2527   DECLARE_WRITE8_MEMBER(poolshrk_da_latch_w);
2628   DECLARE_WRITE8_MEMBER(poolshrk_led_w);
r18185r18186
3234   virtual void video_start();
3335   virtual void palette_init();
3436   UINT32 screen_update_poolshrk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
37   DECLARE_WRITE8_MEMBER(poolshrk_scratch_sound_w);
38   DECLARE_WRITE8_MEMBER(poolshrk_score_sound_w);
39   DECLARE_WRITE8_MEMBER(poolshrk_click_sound_w);
40   DECLARE_WRITE8_MEMBER(poolshrk_bump_sound_w);
3541};
3642
3743
3844/*----------- defined in audio/poolshrk.c -----------*/
39
40DECLARE_WRITE8_DEVICE_HANDLER( poolshrk_scratch_sound_w );
41DECLARE_WRITE8_DEVICE_HANDLER( poolshrk_score_sound_w );
42DECLARE_WRITE8_DEVICE_HANDLER( poolshrk_click_sound_w );
43DECLARE_WRITE8_DEVICE_HANDLER( poolshrk_bump_sound_w );
4445DISCRETE_SOUND_EXTERN( poolshrk );
trunk/src/mame/drivers/micro3d.c
r18185r18186
274274static ADDRESS_MAP_START( soundmem_io, AS_IO, 8, micro3d_state )
275275   AM_RANGE(0x0000, 0x07ff) AM_RAM
276276   AM_RANGE(0xfd00, 0xfd01) AM_DEVREADWRITE_LEGACY("ym2151", ym2151_r, ym2151_w)
277   AM_RANGE(0xfe00, 0xfe00) AM_DEVWRITE_LEGACY("upd7759", micro3d_upd7759_w)
277   AM_RANGE(0xfe00, 0xfe00) AM_WRITE(micro3d_upd7759_w)
278278   AM_RANGE(0xff00, 0xff00) AM_WRITE(micro3d_snd_dac_a)
279279   AM_RANGE(0xff01, 0xff01) AM_WRITE(micro3d_snd_dac_b)
280280   AM_RANGE(MCS51_PORT_P0, MCS51_PORT_P3) AM_READWRITE(micro3d_sound_io_r, micro3d_sound_io_w)
trunk/src/mame/drivers/harddriv.c
r18185r18186
679679
680680
681681static ADDRESS_MAP_START( driversnd_dsp_io_map, AS_IO, 16, harddriv_state )
682   AM_RANGE(0, 0) AM_READ(hdsnddsp_rom_r) AM_DEVWRITE_LEGACY("dac", hdsnddsp_dac_w)
682   AM_RANGE(0, 0) AM_READWRITE(hdsnddsp_rom_r, hdsnddsp_dac_w)
683683   AM_RANGE(1, 1) AM_READ(hdsnddsp_comram_r)
684684   AM_RANGE(2, 2) AM_READ(hdsnddsp_compare_r)
685685   AM_RANGE(1, 2) AM_WRITENOP
trunk/src/mame/drivers/8080bw.c
r18185r18186
470470   AM_RANGE(0x01, 0x01) AM_MIRROR(0x04) AM_READ_PORT("IN1")
471471   AM_RANGE(0x03, 0x03) AM_MIRROR(0x04) AM_READ_PORT("IN3")
472472
473   AM_RANGE(0x03, 0x03) AM_DEVWRITE_LEGACY("discrete", invaders_audio_1_w)
474   AM_RANGE(0x05, 0x05) AM_DEVWRITE_LEGACY("discrete", invaders_audio_2_w)
473   AM_RANGE(0x03, 0x03) AM_WRITE(invaders_audio_1_w)
474   AM_RANGE(0x05, 0x05) AM_WRITE(invaders_audio_2_w)
475475   AM_RANGE(0x06, 0x06) AM_WRITE(watchdog_reset_w)
476476ADDRESS_MAP_END
477477
r18185r18186
13931393static ADDRESS_MAP_START( polaris_io_map, AS_IO, 8, _8080bw_state )
13941394   AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0") AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_count_w)
13951395   AM_RANGE(0x01, 0x01) AM_READ_PORT("IN1")
1396   AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2") AM_DEVWRITE_LEGACY("discrete", polaris_sh_port_1_w)
1396   AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2") AM_WRITE(polaris_sh_port_1_w)
13971397   AM_RANGE(0x03, 0x03) AM_DEVREADWRITE_LEGACY("mb14241", mb14241_shift_result_r, mb14241_shift_data_w)
1398   AM_RANGE(0x04, 0x04) AM_DEVWRITE_LEGACY("discrete", polaris_sh_port_2_w)
1398   AM_RANGE(0x04, 0x04) AM_WRITE(polaris_sh_port_2_w)
13991399   AM_RANGE(0x05, 0x05) AM_WRITE(watchdog_reset_w)
1400   AM_RANGE(0x06, 0x06) AM_DEVWRITE_LEGACY("discrete", polaris_sh_port_3_w)
1400   AM_RANGE(0x06, 0x06) AM_WRITE(polaris_sh_port_3_w)
14011401ADDRESS_MAP_END
14021402
14031403
r18185r18186
17481748   AM_RANGE(0x04, 0x04) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_data_w)
17491749   AM_RANGE(0x05, 0x05) AM_WRITE(indianbt_sh_port_2_w)
17501750   AM_RANGE(0x06, 0x06) AM_WRITENOP /* sound ? */
1751   AM_RANGE(0x07, 0x07) AM_DEVWRITE_LEGACY("discrete", indianbt_sh_port_3_w)
1751   AM_RANGE(0x07, 0x07) AM_WRITE(indianbt_sh_port_3_w)
17521752ADDRESS_MAP_END
17531753
17541754
r18185r18186
21032103   AM_RANGE(0x01, 0x01) AM_MIRROR(0x04) AM_DEVREAD_LEGACY("mb14241", mb14241_shift_result_r)
21042104
21052105   AM_RANGE(0x00, 0x00) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_count_w)
2106   AM_RANGE(0x01, 0x01) AM_DEVWRITE_LEGACY("discrete", invaders_audio_1_w)
2106   AM_RANGE(0x01, 0x01) AM_WRITE(invaders_audio_1_w)
21072107   AM_RANGE(0x06, 0x06) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_data_w)
2108   AM_RANGE(0x07, 0x07) AM_DEVWRITE_LEGACY("discrete", invaders_audio_2_w)
2108   AM_RANGE(0x07, 0x07) AM_WRITE(invaders_audio_2_w)
21092109   AM_RANGE(0x04, 0x04) AM_WRITE(watchdog_reset_w)
21102110ADDRESS_MAP_END
21112111
trunk/src/mame/drivers/bzone.c
r18185r18186
311311   AM_RANGE(0x1810, 0x1810) AM_DEVREAD_LEGACY("mathbox", mathbox_lo_r)
312312   AM_RANGE(0x1818, 0x1818) AM_DEVREAD_LEGACY("mathbox", mathbox_hi_r)
313313   AM_RANGE(0x1820, 0x182f) AM_DEVREADWRITE("pokey", pokey_device, read, write)
314   AM_RANGE(0x1840, 0x1840) AM_DEVWRITE_LEGACY("discrete", bzone_sounds_w)
314   AM_RANGE(0x1840, 0x1840) AM_WRITE(bzone_sounds_w)
315315   AM_RANGE(0x1860, 0x187f) AM_DEVWRITE_LEGACY("mathbox", mathbox_go_w)
316316   AM_RANGE(0x2000, 0x2fff) AM_RAM AM_SHARE("vectorram") AM_REGION("maincpu", 0x2000)
317317   AM_RANGE(0x3000, 0x7fff) AM_ROM
trunk/src/mame/drivers/spiders.c
r18185r18186
326326   DEVCB_NULL,      /* line CB1 in */
327327   DEVCB_NULL,      /* line CA2 in */
328328   DEVCB_NULL,      /* line CB2 in */
329   DEVCB_DEVICE_HANDLER("discrete", spiders_audio_ctrl_w),      /* port A out */
330   DEVCB_DEVICE_HANDLER("pia4", spiders_audio_command_w),      /* port B out */
329   DEVCB_DRIVER_MEMBER(spiders_state, spiders_audio_ctrl_w),      /* port A out */
330   DEVCB_DRIVER_MEMBER(spiders_state, spiders_audio_command_w),      /* port B out */
331331   DEVCB_NULL,      /* line CA2 out */
332332   DEVCB_NULL,      /* port CB2 out */
333333   DEVCB_DRIVER_LINE_MEMBER(spiders_state,main_cpu_irq),      /* IRQA */
r18185r18186
350350   DEVCB_NULL,      /* line CB1 in */
351351   DEVCB_NULL,      /* line CA2 in */
352352   DEVCB_NULL,      /* line CB2 in */
353   DEVCB_DEVICE_HANDLER("discrete", spiders_audio_a_w),      /* port A out */
354   DEVCB_DEVICE_HANDLER("discrete", spiders_audio_b_w),      /* port B out */
353   DEVCB_DRIVER_MEMBER(spiders_state, spiders_audio_a_w),      /* port A out */
354   DEVCB_DRIVER_MEMBER(spiders_state, spiders_audio_b_w),      /* port B out */
355355   DEVCB_NULL,      /* line CA2 out */
356356   DEVCB_NULL,      /* port CB2 out */
357357   DEVCB_DRIVER_LINE_MEMBER(spiders_state,audio_cpu_irq),      /* IRQA */
trunk/src/mame/drivers/sprint8.c
r18185r18186
110110   AM_RANGE(0x1c20, 0x1c2f) AM_WRITEONLY AM_SHARE("pos_d_ram")
111111   AM_RANGE(0x1c30, 0x1c37) AM_WRITE(sprint8_lockout_w)
112112   AM_RANGE(0x1d00, 0x1d00) AM_WRITE(sprint8_int_reset_w)
113   AM_RANGE(0x1d01, 0x1d01) AM_DEVWRITE_LEGACY("discrete", sprint8_crash_w)
114   AM_RANGE(0x1d02, 0x1d02) AM_DEVWRITE_LEGACY("discrete", sprint8_screech_w)
113   AM_RANGE(0x1d01, 0x1d01) AM_WRITE(sprint8_crash_w)
114   AM_RANGE(0x1d02, 0x1d02) AM_WRITE(sprint8_screech_w)
115115   AM_RANGE(0x1d03, 0x1d03) AM_WRITENOP
116116   AM_RANGE(0x1d04, 0x1d04) AM_WRITENOP
117117   AM_RANGE(0x1d05, 0x1d05) AM_WRITEONLY AM_SHARE("team")
118   AM_RANGE(0x1d06, 0x1d06) AM_DEVWRITE_LEGACY("discrete", sprint8_attract_w)
119   AM_RANGE(0x1e00, 0x1e07) AM_DEVWRITE_LEGACY("discrete", sprint8_motor_w)
118   AM_RANGE(0x1d06, 0x1d06) AM_WRITE(sprint8_attract_w)
119   AM_RANGE(0x1e00, 0x1e07) AM_WRITE(sprint8_motor_w)
120120   AM_RANGE(0x1f00, 0x1f00) AM_WRITENOP /* probably a watchdog, disabled in service mode */
121121   AM_RANGE(0x2000, 0x3fff) AM_ROM
122122   AM_RANGE(0xf800, 0xffff) AM_ROM
trunk/src/mame/drivers/circusc.c
r18185r18186
6161
6262   m_audiocpu = machine().device<cpu_device>("audiocpu");
6363   m_dac = machine().device<dac_device>("dac");
64   m_discrete = machine().device("fltdisc");
6564
6665   save_item(NAME(m_sn_latch));
6766}
trunk/src/mame/drivers/circus.c
r18185r18186
266266
267267   m_maincpu = machine().device<cpu_device>("maincpu");
268268   m_samples = machine().device<samples_device>("samples");
269   m_discrete = machine().device("discrete");
270269
271270   save_item(NAME(m_clown_x));
272271   save_item(NAME(m_clown_y));
trunk/src/mame/drivers/mw8080bw.c
r18185r18186
618618{
619619
620620   if (offset & 0x01)
621      tornbase_audio_w(machine().device("discrete"), space, 0, data);
621      tornbase_audio_w(space, 0, data);
622622
623623   if (offset & 0x02)
624624      mb14241_shift_count_w(m_mb14241, space, 0, data);
r18185r18186
991991
992992   AM_RANGE(0x01, 0x01) AM_WRITE(mw8080bw_reversable_shift_count_w)
993993   AM_RANGE(0x02, 0x02) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_data_w)
994   AM_RANGE(0x03, 0x03) AM_DEVWRITE_LEGACY("discrete", boothill_audio_w)
994   AM_RANGE(0x03, 0x03) AM_WRITE(boothill_audio_w)
995995   AM_RANGE(0x04, 0x04) AM_WRITE(watchdog_reset_w)
996   AM_RANGE(0x05, 0x05) AM_DEVWRITE_LEGACY("discrete", midway_tone_generator_lo_w)
997   AM_RANGE(0x06, 0x06) AM_DEVWRITE_LEGACY("discrete", midway_tone_generator_hi_w)
996   AM_RANGE(0x05, 0x05) AM_WRITE(midway_tone_generator_lo_w)
997   AM_RANGE(0x06, 0x06) AM_WRITE(midway_tone_generator_hi_w)
998998ADDRESS_MAP_END
999999
10001000
r18185r18186
10691069WRITE8_MEMBER(mw8080bw_state::checkmat_io_w)
10701070{
10711071
1072   if (offset & 0x01)  checkmat_audio_w(m_discrete, space, 0, data);
1072   if (offset & 0x01)  checkmat_audio_w(space, 0, data);
10731073
10741074   if (offset & 0x02)  watchdog_reset_w(space, 0, data);
10751075}
r18185r18186
12171217
12181218   AM_RANGE(0x01, 0x01) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_count_w)
12191219   AM_RANGE(0x02, 0x02) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_data_w)
1220   AM_RANGE(0x03, 0x03) AM_DEVWRITE_LEGACY("discrete", desertgu_audio_1_w)
1220   AM_RANGE(0x03, 0x03) AM_WRITE(desertgu_audio_1_w)
12211221   AM_RANGE(0x04, 0x04) AM_WRITE(watchdog_reset_w)
1222   AM_RANGE(0x05, 0x05) AM_DEVWRITE_LEGACY("discrete", midway_tone_generator_lo_w)
1223   AM_RANGE(0x06, 0x06) AM_DEVWRITE_LEGACY("discrete", midway_tone_generator_hi_w)
1224   AM_RANGE(0x07, 0x07) AM_DEVWRITE_LEGACY("discrete", desertgu_audio_2_w)
1222   AM_RANGE(0x05, 0x05) AM_WRITE(midway_tone_generator_lo_w)
1223   AM_RANGE(0x06, 0x06) AM_WRITE(midway_tone_generator_hi_w)
1224   AM_RANGE(0x07, 0x07) AM_WRITE(desertgu_audio_2_w)
12251225ADDRESS_MAP_END
12261226
12271227
r18185r18186
13391339
13401340   AM_RANGE(0x01, 0x01) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_count_w)
13411341   AM_RANGE(0x02, 0x02) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_data_w)
1342   AM_RANGE(0x03, 0x03) AM_DEVWRITE_LEGACY("discrete", dplay_audio_w)
1342   AM_RANGE(0x03, 0x03) AM_WRITE(dplay_audio_w)
13431343   AM_RANGE(0x04, 0x04) AM_WRITE(watchdog_reset_w)
1344   AM_RANGE(0x05, 0x05) AM_DEVWRITE_LEGACY("discrete", midway_tone_generator_lo_w)
1345   AM_RANGE(0x06, 0x06) AM_DEVWRITE_LEGACY("discrete", midway_tone_generator_hi_w)
1344   AM_RANGE(0x05, 0x05) AM_WRITE(midway_tone_generator_lo_w)
1345   AM_RANGE(0x06, 0x06) AM_WRITE(midway_tone_generator_hi_w)
13461346ADDRESS_MAP_END
13471347
13481348
r18185r18186
17271727   AM_RANGE(0x02, 0x02) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_data_w)
17281728   AM_RANGE(0x03, 0x03) AM_WRITE(clowns_audio_1_w)
17291729   AM_RANGE(0x04, 0x04) AM_WRITE(watchdog_reset_w)
1730   AM_RANGE(0x05, 0x05) AM_DEVWRITE_LEGACY("discrete", midway_tone_generator_lo_w)
1731   AM_RANGE(0x06, 0x06) AM_DEVWRITE_LEGACY("discrete", midway_tone_generator_hi_w)
1732   AM_RANGE(0x07, 0x07) AM_DEVWRITE_LEGACY("discrete", clowns_audio_2_w)
1730   AM_RANGE(0x05, 0x05) AM_WRITE(midway_tone_generator_lo_w)
1731   AM_RANGE(0x06, 0x06) AM_WRITE(midway_tone_generator_hi_w)
1732   AM_RANGE(0x07, 0x07) AM_WRITE(clowns_audio_2_w)
17331733ADDRESS_MAP_END
17341734
17351735
r18185r18186
18631863
18641864   AM_RANGE(0x01, 0x01) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_count_w)
18651865   AM_RANGE(0x02, 0x02) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_data_w)
1866   AM_RANGE(0x03, 0x03) AM_DEVWRITE_LEGACY("discrete", spacwalk_audio_1_w)
1866   AM_RANGE(0x03, 0x03) AM_WRITE(spacwalk_audio_1_w)
18671867   AM_RANGE(0x04, 0x04) AM_WRITE(watchdog_reset_w)
1868   AM_RANGE(0x05, 0x05) AM_DEVWRITE_LEGACY("discrete", midway_tone_generator_lo_w)
1869   AM_RANGE(0x06, 0x06) AM_DEVWRITE_LEGACY("discrete", midway_tone_generator_hi_w)
1870   AM_RANGE(0x07, 0x07) AM_DEVWRITE_LEGACY("discrete", spacwalk_audio_2_w)
1868   AM_RANGE(0x05, 0x05) AM_WRITE(midway_tone_generator_lo_w)
1869   AM_RANGE(0x06, 0x06) AM_WRITE(midway_tone_generator_hi_w)
1870   AM_RANGE(0x07, 0x07) AM_WRITE(spacwalk_audio_2_w)
18711871ADDRESS_MAP_END
18721872
18731873static INPUT_PORTS_START( spacwalk )
r18185r18186
19591959   AM_RANGE(0x01, 0x01) AM_MIRROR(0x08) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_count_w)
19601960   AM_RANGE(0x02, 0x02) AM_MIRROR(0x08) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_data_w)
19611961   AM_RANGE(0x04, 0x04) AM_MIRROR(0x08) AM_WRITE(watchdog_reset_w)
1962   AM_RANGE(0x05, 0x05) AM_MIRROR(0x08) AM_DEVWRITE_LEGACY("discrete", shuffle_audio_1_w)
1963   AM_RANGE(0x06, 0x06) AM_MIRROR(0x08) AM_DEVWRITE_LEGACY("discrete", shuffle_audio_2_w)
1962   AM_RANGE(0x05, 0x05) AM_MIRROR(0x08) AM_WRITE(shuffle_audio_1_w)
1963   AM_RANGE(0x06, 0x06) AM_MIRROR(0x08) AM_WRITE(shuffle_audio_2_w)
19641964ADDRESS_MAP_END
19651965
19661966
r18185r18186
20362036
20372037   AM_RANGE(0x01, 0x01) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_count_w)
20382038   AM_RANGE(0x02, 0x02) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_data_w)
2039   AM_RANGE(0x03, 0x03) AM_DEVWRITE_LEGACY("discrete", dogpatch_audio_w)
2039   AM_RANGE(0x03, 0x03) AM_WRITE(dogpatch_audio_w)
20402040   AM_RANGE(0x04, 0x04) AM_WRITE(watchdog_reset_w)
2041   AM_RANGE(0x05, 0x05) AM_DEVWRITE_LEGACY("discrete", midway_tone_generator_lo_w)
2042   AM_RANGE(0x06, 0x06) AM_DEVWRITE_LEGACY("discrete", midway_tone_generator_hi_w)
2041   AM_RANGE(0x05, 0x05) AM_WRITE(midway_tone_generator_lo_w)
2042   AM_RANGE(0x06, 0x06) AM_WRITE(midway_tone_generator_hi_w)
20432043ADDRESS_MAP_END
20442044
20452045
r18185r18186
21632163      watchdog_reset_w(space, 0, data);      /*  -  -  -  -  -  0  1  0 */
21642164
21652165   else if ((offset & 0x5f) == 0x01)
2166      spcenctr_audio_1_w(m_discrete, space, 0, data);   /*  -  0  -  0  0  0  0  1 */
2166      spcenctr_audio_1_w(space, 0, data);   /*  -  0  -  0  0  0  0  1 */
21672167
21682168   else if ((offset & 0x5f) == 0x09)
2169      spcenctr_audio_2_w(m_discrete, space, 0, data);   /*  -  0  -  0  1  0  0  1 */
2169      spcenctr_audio_2_w(space, 0, data);   /*  -  0  -  0  1  0  0  1 */
21702170
21712171   else if ((offset & 0x5f) == 0x11)
2172      spcenctr_audio_3_w(m_discrete, space, 0, data);   /*  -  0  -  1  0  0  0  1 */
2172      spcenctr_audio_3_w(space, 0, data);   /*  -  0  -  1  0  0  0  1 */
21732173
21742174   else if ((offset & 0x07) == 0x03)
21752175   {                                 /*  -  -  -  -  -  0  1  1 */
r18185r18186
24302430   AM_RANGE(0x01, 0x01) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_count_w)
24312431   AM_RANGE(0x02, 0x02) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_data_w)
24322432   AM_RANGE(0x04, 0x04) AM_WRITE(watchdog_reset_w)
2433   AM_RANGE(0x05, 0x05) AM_DEVWRITE_LEGACY("discrete", bowler_audio_1_w)
2433   AM_RANGE(0x05, 0x05) AM_WRITE(bowler_audio_1_w)
24342434   AM_RANGE(0x06, 0x06) AM_WRITE(bowler_audio_2_w)
24352435   AM_RANGE(0x07, 0x07) AM_WRITE(bowler_lights_1_w)
24362436   AM_RANGE(0x08, 0x08) AM_WRITE(bowler_audio_3_w)
r18185r18186
26112611   AM_RANGE(0x03, 0x03) AM_MIRROR(0x04) AM_DEVREAD_LEGACY("mb14241", mb14241_shift_result_r)
26122612
26132613   AM_RANGE(0x02, 0x02) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_count_w)
2614   AM_RANGE(0x03, 0x03) AM_DEVWRITE_LEGACY("discrete", invaders_audio_1_w)
2614   AM_RANGE(0x03, 0x03) AM_WRITE(invaders_audio_1_w)
26152615   AM_RANGE(0x04, 0x04) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_data_w)
2616   AM_RANGE(0x05, 0x05) AM_DEVWRITE_LEGACY("discrete", invaders_audio_2_w)
2616   AM_RANGE(0x05, 0x05) AM_WRITE(invaders_audio_2_w)
26172617   AM_RANGE(0x06, 0x06) AM_WRITE(watchdog_reset_w)
26182618ADDRESS_MAP_END
26192619
r18185r18186
27432743
27442744   AM_RANGE(0x01, 0x01) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_count_w)
27452745   AM_RANGE(0x02, 0x02) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_data_w)
2746   AM_RANGE(0x03, 0x03) AM_DEVWRITE_LEGACY("discrete", blueshrk_audio_w)
2746   AM_RANGE(0x03, 0x03) AM_WRITE(blueshrk_audio_w)
27472747   AM_RANGE(0x04, 0x04) AM_WRITE(watchdog_reset_w)
27482748ADDRESS_MAP_END
27492749
r18185r18186
28212821   AM_RANGE(0x02, 0x02) AM_MIRROR(0x04) AM_READ_PORT("IN2")
28222822   AM_RANGE(0x03, 0x03) AM_MIRROR(0x04) AM_DEVREAD_LEGACY("mb14241", mb14241_shift_result_r)
28232823
2824   AM_RANGE(0x01, 0x01) AM_DEVWRITE_LEGACY("discrete", invad2ct_audio_3_w)
2824   AM_RANGE(0x01, 0x01) AM_WRITE(invad2ct_audio_3_w)
28252825   AM_RANGE(0x02, 0x02) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_count_w)
2826   AM_RANGE(0x03, 0x03) AM_DEVWRITE_LEGACY("discrete", invad2ct_audio_1_w)
2826   AM_RANGE(0x03, 0x03) AM_WRITE(invad2ct_audio_1_w)
28272827   AM_RANGE(0x04, 0x04) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_data_w)
2828   AM_RANGE(0x05, 0x05) AM_DEVWRITE_LEGACY("discrete", invad2ct_audio_2_w)
2828   AM_RANGE(0x05, 0x05) AM_WRITE(invad2ct_audio_2_w)
28292829   AM_RANGE(0x06, 0x06) AM_WRITE(watchdog_reset_w)
2830   AM_RANGE(0x07, 0x07) AM_DEVWRITE_LEGACY("discrete", invad2ct_audio_4_w)
2830   AM_RANGE(0x07, 0x07) AM_WRITE(invad2ct_audio_4_w)
28312831ADDRESS_MAP_END
28322832
28332833
trunk/src/mame/drivers/avalnche.c
r18185r18186
117117   AM_RANGE(0x2003, 0x2003) AM_MIRROR(0x0ffc) AM_READNOP
118118   AM_RANGE(0x3000, 0x3000) AM_MIRROR(0x0fff) AM_WRITE(watchdog_reset_w)
119119   AM_RANGE(0x4000, 0x4000) AM_MIRROR(0x0ff8) AM_WRITE(avalance_credit_1_lamp_w)
120   AM_RANGE(0x4001, 0x4001) AM_MIRROR(0x0ff8) AM_DEVWRITE_LEGACY("discrete", avalnche_attract_enable_w)
120   AM_RANGE(0x4001, 0x4001) AM_MIRROR(0x0ff8) AM_WRITE(avalnche_attract_enable_w)
121121   AM_RANGE(0x4002, 0x4002) AM_MIRROR(0x0ff8) AM_WRITE(avalance_video_invert_w)
122122   AM_RANGE(0x4003, 0x4003) AM_MIRROR(0x0ff8) AM_WRITE(avalance_credit_2_lamp_w)
123   AM_RANGE(0x4004, 0x4006) AM_MIRROR(0x0ff8) AM_DEVWRITE_LEGACY("discrete", avalnche_audio_w)
123   AM_RANGE(0x4004, 0x4006) AM_MIRROR(0x0ff8) AM_WRITE(avalnche_audio_w)
124124   AM_RANGE(0x4007, 0x4007) AM_MIRROR(0x0ff8) AM_WRITE(avalance_start_lamp_w)
125   AM_RANGE(0x5000, 0x5000) AM_MIRROR(0x0fff) AM_DEVWRITE_LEGACY("discrete", avalnche_noise_amplitude_w)
125   AM_RANGE(0x5000, 0x5000) AM_MIRROR(0x0fff) AM_WRITE(avalnche_noise_amplitude_w)
126126   AM_RANGE(0x6000, 0x7fff) AM_ROM
127127ADDRESS_MAP_END
128128
r18185r18186
135135   AM_RANGE(0x2003, 0x2003) AM_MIRROR(0x0ffc) AM_READNOP
136136   AM_RANGE(0x3000, 0x3000) AM_MIRROR(0x0fff) AM_WRITE(watchdog_reset_w)
137137   AM_RANGE(0x4000, 0x4000) AM_MIRROR(0x0ff8) AM_WRITE(avalance_credit_1_lamp_w)
138//  AM_RANGE(0x4001, 0x4001) AM_MIRROR(0x0ff8) AM_DEVWRITE_LEGACY("discrete", avalnche_attract_enable_w) /* It is attract_enable just like avalnche, but not hooked up yet. */
138//  AM_RANGE(0x4001, 0x4001) AM_MIRROR(0x0ff8) AM_WRITE(avalnche_attract_enable_w) /* It is attract_enable just like avalnche, but not hooked up yet. */
139139   AM_RANGE(0x4002, 0x4002) AM_MIRROR(0x0ff8) AM_WRITE(avalance_video_invert_w)
140140   AM_RANGE(0x4003, 0x4003) AM_MIRROR(0x0ff8) AM_WRITE(avalance_credit_2_lamp_w)
141   AM_RANGE(0x4004, 0x4006) AM_MIRROR(0x0ff8) AM_WRITE_LEGACY(catch_audio_w)
141   AM_RANGE(0x4004, 0x4006) AM_MIRROR(0x0ff8) AM_WRITE(catch_audio_w)
142142   AM_RANGE(0x4007, 0x4007) AM_MIRROR(0x0ff8) AM_WRITE(avalance_start_lamp_w)
143143   AM_RANGE(0x6000, 0x6000) AM_MIRROR(0x0fff) AM_WRITE(catch_coin_counter_w)
144144   AM_RANGE(0x7000, 0x7fff) AM_ROM
trunk/src/mame/drivers/crbaloon.c
r18185r18186
156156
157157WRITE8_MEMBER(crbaloon_state::port_sound_w)
158158{
159   device_t *discrete = machine().device("discrete");
160159   device_t *sn = machine().device("snsnd");
161160
162161   /* D0 - interrupt enable - also goes to PC3259 as /HTCTRL */
r18185r18186
167166   machine().sound().system_enable((data & 0x02) ? TRUE : FALSE);
168167
169168   /* D2 - unlabeled - music enable */
170   crbaloon_audio_set_music_enable(discrete, space, 0, (data & 0x04) ? TRUE : FALSE);
169   crbaloon_audio_set_music_enable(space, 0, (data & 0x04) ? TRUE : FALSE);
171170
172171   /* D3 - EXPLOSION */
173172   crbaloon_audio_set_explosion_enable(sn, (data & 0x08) ? TRUE : FALSE);
r18185r18186
179178   crbaloon_audio_set_appear_enable(sn, (data & 0x20) ? TRUE : FALSE);
180179
181180   /* D6 - unlabeled - laugh enable */
182   crbaloon_audio_set_laugh_enable(discrete, space, 0, (data & 0x40) ? TRUE : FALSE);
181   crbaloon_audio_set_laugh_enable(space, 0, (data & 0x40) ? TRUE : FALSE);
183182
184183   /* D7 - unlabeled - goes to PC3259 pin 16 */
185184
r18185r18186
221220   AM_RANGE(0x00, 0x00) AM_WRITENOP   /* not connected */
222221   AM_RANGE(0x01, 0x01) AM_WRITENOP /* watchdog */
223222   AM_RANGE(0x02, 0x04) AM_WRITEONLY AM_SHARE("spriteram")
224   AM_RANGE(0x05, 0x05) AM_DEVWRITE_LEGACY("discrete", crbaloon_audio_set_music_freq)
223   AM_RANGE(0x05, 0x05) AM_WRITE(crbaloon_audio_set_music_freq)
225224   AM_RANGE(0x06, 0x06) AM_WRITE(port_sound_w)
226225   AM_RANGE(0x07, 0x0b) AM_WRITE(pc3092_w) AM_SHARE("pc3092_data")
227226   AM_RANGE(0x0c, 0x0c) AM_WRITENOP /* MSK - to PC3259 */
r18185r18186
340339void crbaloon_state::machine_reset()
341340{
342341   address_space &space = machine().device("maincpu")->memory().space(AS_IO);
343   device_t *discrete = machine().device("discrete");
344342
345343   pc3092_reset();
346344   port_sound_w(space, 0, 0);
347   crbaloon_audio_set_music_freq(discrete, space, 0, 0);
345   crbaloon_audio_set_music_freq(space, 0, 0);
348346}
349347
350348
trunk/src/mame/drivers/zaxxon.c
r18185r18186
884884static I8255A_INTERFACE( zaxxon_ppi_intf )
885885{
886886   DEVCB_NULL,                     /* Port A read */
887   DEVCB_HANDLER(zaxxon_sound_a_w),   /* Port A write */
887   DEVCB_DRIVER_MEMBER(zaxxon_state, zaxxon_sound_a_w),   /* Port A write */
888888   DEVCB_NULL,                     /* Port B read */
889   DEVCB_HANDLER(zaxxon_sound_b_w),   /* Port B write */
889   DEVCB_DRIVER_MEMBER(zaxxon_state, zaxxon_sound_b_w),   /* Port B write */
890890   DEVCB_NULL,                     /* Port C read */
891   DEVCB_HANDLER(zaxxon_sound_c_w)      /* Port C write */
891   DEVCB_DRIVER_MEMBER(zaxxon_state, zaxxon_sound_c_w)      /* Port C write */
892892};
893893
894894static I8255A_INTERFACE( congo_ppi_intf )
r18185r18186
896896   DEVCB_DRIVER_MEMBER(driver_device, soundlatch_byte_r),   /* Port A read */
897897   DEVCB_NULL,                  /* Port A write */
898898   DEVCB_NULL,                  /* Port B read */
899   DEVCB_HANDLER(congo_sound_b_w),   /* Port B write */
899   DEVCB_DRIVER_MEMBER(zaxxon_state, congo_sound_b_w),   /* Port B write */
900900   DEVCB_NULL,                  /* Port C read */
901   DEVCB_HANDLER(congo_sound_c_w)   /* Port C write */
901   DEVCB_DRIVER_MEMBER(zaxxon_state, congo_sound_c_w)   /* Port C write */
902902};
903903
904904
trunk/src/mame/drivers/firetrk.c
r18185r18186
320320   AM_RANGE(0x1000, 0x1000) AM_MIRROR(0x001f) AM_WRITEONLY AM_SHARE("scroll_y")
321321   AM_RANGE(0x1020, 0x1020) AM_MIRROR(0x001f) AM_WRITEONLY AM_SHARE("scroll_x")
322322   AM_RANGE(0x1040, 0x1040) AM_MIRROR(0x001f) AM_WRITE(crash_reset_w)
323   AM_RANGE(0x1060, 0x1060) AM_MIRROR(0x001f) AM_DEVWRITE_LEGACY("discrete", firetrk_skid_reset_w)
323   AM_RANGE(0x1060, 0x1060) AM_MIRROR(0x001f) AM_WRITE(firetrk_skid_reset_w)
324324   AM_RANGE(0x1080, 0x1080) AM_MIRROR(0x001f) AM_WRITEONLY AM_SHARE("car_rot")
325325   AM_RANGE(0x10a0, 0x10a0) AM_MIRROR(0x001f) AM_WRITE(steer_reset_w)
326326   AM_RANGE(0x10c0, 0x10c0) AM_MIRROR(0x001f) AM_WRITE(watchdog_reset_w)
327327   AM_RANGE(0x10e0, 0x10e0) AM_MIRROR(0x001f) AM_WRITE(blink_on_w) AM_SHARE("blink")
328   AM_RANGE(0x1400, 0x1400) AM_MIRROR(0x001f) AM_DEVWRITE_LEGACY("discrete", firetrk_motor_snd_w)
329   AM_RANGE(0x1420, 0x1420) AM_MIRROR(0x001f) AM_DEVWRITE_LEGACY("discrete", firetrk_crash_snd_w)
330   AM_RANGE(0x1440, 0x1440) AM_MIRROR(0x001f) AM_DEVWRITE_LEGACY("discrete", firetrk_skid_snd_w)
328   AM_RANGE(0x1400, 0x1400) AM_MIRROR(0x001f) AM_WRITE(firetrk_motor_snd_w)
329   AM_RANGE(0x1420, 0x1420) AM_MIRROR(0x001f) AM_WRITE(firetrk_crash_snd_w)
330   AM_RANGE(0x1440, 0x1440) AM_MIRROR(0x001f) AM_WRITE(firetrk_skid_snd_w)
331331   AM_RANGE(0x1460, 0x1460) AM_MIRROR(0x001f) AM_WRITEONLY AM_SHARE("drone_x")
332332   AM_RANGE(0x1480, 0x1480) AM_MIRROR(0x001f) AM_WRITEONLY AM_SHARE("drone_y")
333333   AM_RANGE(0x14a0, 0x14a0) AM_MIRROR(0x001f) AM_WRITEONLY AM_SHARE("drone_rot")
334334   AM_RANGE(0x14c0, 0x14c0) AM_MIRROR(0x001f) AM_WRITE(firetrk_output_w)
335   AM_RANGE(0x14e0, 0x14e0) AM_MIRROR(0x001f) AM_DEVWRITE_LEGACY("discrete", firetrk_xtndply_w)
335   AM_RANGE(0x14e0, 0x14e0) AM_MIRROR(0x001f) AM_WRITE(firetrk_xtndply_w)
336336   AM_RANGE(0x1800, 0x1807) AM_MIRROR(0x03f8) AM_READ(firetrk_input_r) AM_WRITENOP
337337   AM_RANGE(0x1c00, 0x1c03) AM_MIRROR(0x03fc) AM_READ(firetrk_dip_r)
338338   AM_RANGE(0x2000, 0x3fff) AM_ROM
r18185r18186
345345   AM_RANGE(0x0100, 0x0100) AM_MIRROR(0x001f) AM_WRITEONLY AM_SHARE("scroll_y")
346346   AM_RANGE(0x0120, 0x0120) AM_MIRROR(0x001f) AM_WRITEONLY AM_SHARE("scroll_x")
347347   AM_RANGE(0x0140, 0x0140) AM_MIRROR(0x001f) AM_WRITE(crash_reset_w)
348   AM_RANGE(0x0160, 0x0160) AM_MIRROR(0x001f) AM_DEVWRITE_LEGACY("discrete", firetrk_skid_reset_w)
348   AM_RANGE(0x0160, 0x0160) AM_MIRROR(0x001f) AM_WRITE(firetrk_skid_reset_w)
349349   AM_RANGE(0x0180, 0x0180) AM_MIRROR(0x001f) AM_WRITEONLY AM_SHARE("car_rot")
350350   AM_RANGE(0x01a0, 0x01a0) AM_MIRROR(0x001f) AM_WRITE(steer_reset_w)
351351   AM_RANGE(0x01c0, 0x01c0) AM_MIRROR(0x001f) AM_WRITE(watchdog_reset_w)
352352   AM_RANGE(0x01e0, 0x01e0) AM_MIRROR(0x001f) AM_WRITE(blink_on_w) AM_SHARE("blink")
353353   AM_RANGE(0x0200, 0x0207) AM_MIRROR(0x0018) AM_READ(firetrk_input_r)
354   AM_RANGE(0x0220, 0x0220) AM_MIRROR(0x001f) AM_DEVWRITE_LEGACY("discrete", firetrk_xtndply_w)
354   AM_RANGE(0x0220, 0x0220) AM_MIRROR(0x001f) AM_WRITE(firetrk_xtndply_w)
355355   AM_RANGE(0x0240, 0x0243) AM_MIRROR(0x001c) AM_READ(firetrk_dip_r)
356356   AM_RANGE(0x0260, 0x026f) AM_MIRROR(0x0010) AM_WRITE(superbug_output_w)
357   AM_RANGE(0x0280, 0x0280) AM_MIRROR(0x001f) AM_DEVWRITE_LEGACY("discrete", superbug_motor_snd_w)
358   AM_RANGE(0x02a0, 0x02a0) AM_MIRROR(0x001f) AM_DEVWRITE_LEGACY("discrete", firetrk_crash_snd_w)
359   AM_RANGE(0x02c0, 0x02c0) AM_MIRROR(0x001f) AM_DEVWRITE_LEGACY("discrete", firetrk_skid_snd_w)
357   AM_RANGE(0x0280, 0x0280) AM_MIRROR(0x001f) AM_WRITE(superbug_motor_snd_w)
358   AM_RANGE(0x02a0, 0x02a0) AM_MIRROR(0x001f) AM_WRITE(firetrk_crash_snd_w)
359   AM_RANGE(0x02c0, 0x02c0) AM_MIRROR(0x001f) AM_WRITE(firetrk_skid_snd_w)
360360   AM_RANGE(0x0400, 0x041f) AM_RAM AM_SHARE("alpha_num_ram")
361361   AM_RANGE(0x0500, 0x05ff) AM_RAM AM_SHARE("playfield_ram")
362362   AM_RANGE(0x0800, 0x1fff) AM_ROM
r18185r18186
374374   AM_RANGE(0x1080, 0x1080) AM_MIRROR(0x001f) AM_WRITEONLY AM_SHARE("car_rot")
375375   AM_RANGE(0x10a0, 0x10a0) AM_MIRROR(0x001f) AM_WRITE(steer_reset_w)
376376   AM_RANGE(0x10c0, 0x10c0) AM_MIRROR(0x001f) AM_WRITE(watchdog_reset_w)
377   AM_RANGE(0x10e0, 0x10e0) AM_MIRROR(0x001f) AM_DEVWRITE_LEGACY("discrete", montecar_skid_reset_w)
378   AM_RANGE(0x1400, 0x1400) AM_MIRROR(0x001f) AM_DEVWRITE_LEGACY("discrete", firetrk_motor_snd_w)
379   AM_RANGE(0x1420, 0x1420) AM_MIRROR(0x001f) AM_DEVWRITE_LEGACY("discrete", firetrk_crash_snd_w)
380   AM_RANGE(0x1440, 0x1440) AM_MIRROR(0x001f) AM_DEVWRITE_LEGACY("discrete", firetrk_skid_snd_w)
377   AM_RANGE(0x10e0, 0x10e0) AM_MIRROR(0x001f) AM_WRITE(montecar_skid_reset_w)
378   AM_RANGE(0x1400, 0x1400) AM_MIRROR(0x001f) AM_WRITE(firetrk_motor_snd_w)
379   AM_RANGE(0x1420, 0x1420) AM_MIRROR(0x001f) AM_WRITE(firetrk_crash_snd_w)
380   AM_RANGE(0x1440, 0x1440) AM_MIRROR(0x001f) AM_WRITE(firetrk_skid_snd_w)
381381   AM_RANGE(0x1460, 0x1460) AM_MIRROR(0x001f) AM_WRITEONLY AM_SHARE("drone_x")
382382   AM_RANGE(0x1480, 0x1480) AM_MIRROR(0x001f) AM_WRITEONLY AM_SHARE("drone_y")
383383   AM_RANGE(0x14a0, 0x14a0) AM_MIRROR(0x001f) AM_WRITEONLY AM_SHARE("drone_rot")
trunk/src/mame/drivers/turbo.c
r18185r18186
282282static I8255_INTERFACE(turbo_8255_intf_2)
283283{
284284   DEVCB_NULL,
285   DEVCB_HANDLER(turbo_sound_a_w),
285   DEVCB_DRIVER_MEMBER(turbo_state,turbo_sound_a_w),
286286   DEVCB_NULL,
287   DEVCB_HANDLER(turbo_sound_b_w),
287   DEVCB_DRIVER_MEMBER(turbo_state,turbo_sound_b_w),
288288   DEVCB_NULL,
289   DEVCB_HANDLER(turbo_sound_c_w)
289   DEVCB_DRIVER_MEMBER(turbo_state,turbo_sound_c_w)
290290};
291291
292292static I8255_INTERFACE(turbo_8255_intf_3)
r18185r18186
355355static I8255_INTERFACE(subroc3d_8255_intf_1)
356356{
357357   DEVCB_NULL,
358   DEVCB_HANDLER(subroc3d_sound_a_w),
358   DEVCB_DRIVER_MEMBER(turbo_state,subroc3d_sound_a_w),
359359   DEVCB_NULL,
360   DEVCB_HANDLER(subroc3d_sound_b_w),
360   DEVCB_DRIVER_MEMBER(turbo_state,subroc3d_sound_b_w),
361361   DEVCB_NULL,
362   DEVCB_HANDLER(subroc3d_sound_c_w)
362   DEVCB_DRIVER_MEMBER(turbo_state,subroc3d_sound_c_w)
363363};
364364
365365
r18185r18186
424424static I8255_INTERFACE(buckrog_8255_intf_1)
425425{
426426   DEVCB_NULL,
427   DEVCB_HANDLER(buckrog_sound_a_w),
427   DEVCB_DRIVER_MEMBER(turbo_state,buckrog_sound_a_w),
428428   DEVCB_NULL,
429   DEVCB_HANDLER(buckrog_sound_b_w),
429   DEVCB_DRIVER_MEMBER(turbo_state,buckrog_sound_b_w),
430430   DEVCB_NULL,
431431   DEVCB_DRIVER_MEMBER(turbo_state,buckrog_ppi1c_w)
432432};
trunk/src/mame/drivers/asteroid.c
r18185r18186
245245   AM_RANGE(0x3000, 0x3000) AM_WRITE_LEGACY(avgdvg_go_w)
246246   AM_RANGE(0x3200, 0x3200) AM_WRITE(asteroid_bank_switch_w)
247247   AM_RANGE(0x3400, 0x3400) AM_WRITE(watchdog_reset_w)
248   AM_RANGE(0x3600, 0x3600) AM_DEVWRITE_LEGACY("discrete", asteroid_explode_w)
249   AM_RANGE(0x3a00, 0x3a00) AM_DEVWRITE_LEGACY("discrete", asteroid_thump_w)
250   AM_RANGE(0x3c00, 0x3c05) AM_DEVWRITE_LEGACY("discrete", asteroid_sounds_w)
251   AM_RANGE(0x3e00, 0x3e00) AM_DEVWRITE_LEGACY("discrete", asteroid_noise_reset_w)
248   AM_RANGE(0x3600, 0x3600) AM_WRITE(asteroid_explode_w)
249   AM_RANGE(0x3a00, 0x3a00) AM_WRITE(asteroid_thump_w)
250   AM_RANGE(0x3c00, 0x3c05) AM_WRITE(asteroid_sounds_w)
251   AM_RANGE(0x3e00, 0x3e00) AM_WRITE(asteroid_noise_reset_w)
252252   AM_RANGE(0x4000, 0x47ff) AM_RAM AM_SHARE("vectorram") AM_REGION("maincpu", 0x4000)
253253   AM_RANGE(0x5000, 0x57ff) AM_ROM                  /* vector rom */
254254   AM_RANGE(0x6800, 0x7fff) AM_ROM
r18185r18186
268268   AM_RANGE(0x3000, 0x3000) AM_WRITE_LEGACY(avgdvg_go_w)
269269   AM_RANGE(0x3200, 0x323f) AM_DEVWRITE("earom", atari_vg_earom_device, write)
270270   AM_RANGE(0x3400, 0x3400) AM_WRITE(watchdog_reset_w)
271   AM_RANGE(0x3600, 0x3600) AM_DEVWRITE_LEGACY("discrete", asteroid_explode_w)
271   AM_RANGE(0x3600, 0x3600) AM_WRITE(asteroid_explode_w)
272272   AM_RANGE(0x3a00, 0x3a00) AM_DEVWRITE("earom", atari_vg_earom_device, ctrl_w)
273273   AM_RANGE(0x3c00, 0x3c01) AM_WRITE(astdelux_led_w)
274   AM_RANGE(0x3c03, 0x3c03) AM_DEVWRITE_LEGACY("discrete", astdelux_sounds_w)
274   AM_RANGE(0x3c03, 0x3c03) AM_WRITE(astdelux_sounds_w)
275275   AM_RANGE(0x3c04, 0x3c04) AM_WRITE(astdelux_bank_switch_w)
276276   AM_RANGE(0x3c05, 0x3c07) AM_WRITE(astdelux_coin_counter_w)
277   AM_RANGE(0x3e00, 0x3e00) AM_DEVWRITE_LEGACY("discrete", asteroid_noise_reset_w)
277   AM_RANGE(0x3e00, 0x3e00) AM_WRITE(asteroid_noise_reset_w)
278278   AM_RANGE(0x4000, 0x47ff) AM_RAM AM_SHARE("vectorram") AM_REGION("maincpu", 0x4000)
279279   AM_RANGE(0x4800, 0x57ff) AM_ROM                  /* vector rom */
280280   AM_RANGE(0x6000, 0x7fff) AM_ROM
r18185r18186
291291   AM_RANGE(0x3000, 0x3000) AM_WRITE_LEGACY(avgdvg_go_w)
292292   AM_RANGE(0x3200, 0x3200) AM_WRITE(llander_led_w)
293293   AM_RANGE(0x3400, 0x3400) AM_WRITE(watchdog_reset_w)
294   AM_RANGE(0x3c00, 0x3c00) AM_DEVWRITE_LEGACY("discrete", llander_sounds_w)
295   AM_RANGE(0x3e00, 0x3e00) AM_DEVWRITE_LEGACY("discrete", llander_snd_reset_w)
294   AM_RANGE(0x3c00, 0x3c00) AM_WRITE(llander_sounds_w)
295   AM_RANGE(0x3e00, 0x3e00) AM_WRITE(llander_snd_reset_w)
296296   AM_RANGE(0x4000, 0x47ff) AM_RAM AM_SHARE("vectorram") AM_REGION("maincpu", 0x4000)
297297   AM_RANGE(0x4800, 0x5fff) AM_ROM                  /* vector rom */
298298   AM_RANGE(0x6000, 0x7fff) AM_ROM
trunk/src/mame/drivers/poolshrk.c
r18185r18186
104104   AM_RANGE(0x0800, 0x080f) AM_MIRROR(0x23f0) AM_WRITEONLY AM_SHARE("hpos_ram")
105105   AM_RANGE(0x0c00, 0x0c0f) AM_MIRROR(0x23f0) AM_WRITEONLY AM_SHARE("vpos_ram")
106106   AM_RANGE(0x1000, 0x13ff) AM_MIRROR(0x2000) AM_READWRITE(poolshrk_input_r, poolshrk_watchdog_w)
107   AM_RANGE(0x1400, 0x17ff) AM_MIRROR(0x2000) AM_DEVWRITE_LEGACY("discrete", poolshrk_scratch_sound_w)
108   AM_RANGE(0x1800, 0x1bff) AM_MIRROR(0x2000) AM_DEVWRITE_LEGACY("discrete", poolshrk_score_sound_w)
109   AM_RANGE(0x1c00, 0x1fff) AM_MIRROR(0x2000) AM_DEVWRITE_LEGACY("discrete", poolshrk_click_sound_w)
107   AM_RANGE(0x1400, 0x17ff) AM_MIRROR(0x2000) AM_WRITE(poolshrk_scratch_sound_w)
108   AM_RANGE(0x1800, 0x1bff) AM_MIRROR(0x2000) AM_WRITE(poolshrk_score_sound_w)
109   AM_RANGE(0x1c00, 0x1fff) AM_MIRROR(0x2000) AM_WRITE(poolshrk_click_sound_w)
110110   AM_RANGE(0x4000, 0x4000) AM_NOP /* diagnostic ROM location */
111111   AM_RANGE(0x6000, 0x63ff) AM_WRITE(poolshrk_da_latch_w)
112   AM_RANGE(0x6400, 0x67ff) AM_DEVWRITE_LEGACY("discrete", poolshrk_bump_sound_w)
112   AM_RANGE(0x6400, 0x67ff) AM_WRITE(poolshrk_bump_sound_w)
113113   AM_RANGE(0x6800, 0x6bff) AM_READ(poolshrk_irq_reset_r)
114114   AM_RANGE(0x6c00, 0x6fff) AM_WRITE(poolshrk_led_w)
115115   AM_RANGE(0x7000, 0x7fff) AM_ROM
trunk/src/mame/drivers/subs.c
r18185r18186
4747
4848static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, subs_state )
4949   ADDRESS_MAP_GLOBAL_MASK(0x3fff)
50   AM_RANGE(0x0000, 0x0000) AM_DEVWRITE_LEGACY("discrete", subs_noise_reset_w)
50   AM_RANGE(0x0000, 0x0000) AM_WRITE(subs_noise_reset_w)
5151   AM_RANGE(0x0000, 0x0007) AM_READ(subs_control_r)
5252   AM_RANGE(0x0020, 0x0020) AM_WRITE(subs_steer_reset_w)
5353   AM_RANGE(0x0020, 0x0027) AM_READ(subs_coin_r)
r18185r18186
5555   AM_RANGE(0x0060, 0x0063) AM_READ(subs_options_r)
5656   AM_RANGE(0x0060, 0x0061) AM_WRITE(subs_lamp1_w)
5757   AM_RANGE(0x0062, 0x0063) AM_WRITE(subs_lamp2_w)
58   AM_RANGE(0x0064, 0x0065) AM_DEVWRITE_LEGACY("discrete", subs_sonar2_w)
59   AM_RANGE(0x0066, 0x0067) AM_DEVWRITE_LEGACY("discrete", subs_sonar1_w)
58   AM_RANGE(0x0064, 0x0065) AM_WRITE(subs_sonar2_w)
59   AM_RANGE(0x0066, 0x0067) AM_WRITE(subs_sonar1_w)
6060// Schematics show crash and explode reversed.  But this is proper.
61   AM_RANGE(0x0068, 0x0069) AM_DEVWRITE_LEGACY("discrete", subs_explode_w)
62   AM_RANGE(0x006a, 0x006b) AM_DEVWRITE_LEGACY("discrete", subs_crash_w)
61   AM_RANGE(0x0068, 0x0069) AM_WRITE(subs_explode_w)
62   AM_RANGE(0x006a, 0x006b) AM_WRITE(subs_crash_w)
6363   AM_RANGE(0x006c, 0x006d) AM_WRITE(subs_invert1_w)
6464   AM_RANGE(0x006e, 0x006f) AM_WRITE(subs_invert2_w)
6565   AM_RANGE(0x0090, 0x009f) AM_SHARE("spriteram")
trunk/src/mame/drivers/mario.c
r18185r18186
138138   AM_RANGE(0x6000, 0x6fff) AM_RAM
139139   AM_RANGE(0x7000, 0x73ff) AM_RAM   AM_SHARE("spriteram") /* physical sprite ram */
140140   AM_RANGE(0x7400, 0x77ff) AM_RAM_WRITE(mario_videoram_w) AM_SHARE("videoram")
141   AM_RANGE(0x7c00, 0x7c00) AM_READ_PORT("IN0") AM_DEVWRITE_LEGACY("discrete", mario_sh1_w) /* Mario run sample */
142   AM_RANGE(0x7c80, 0x7c80) AM_READ_PORT("IN1") AM_DEVWRITE_LEGACY("discrete", mario_sh2_w) /* Luigi run sample */
141   AM_RANGE(0x7c00, 0x7c00) AM_READ_PORT("IN0") AM_WRITE(mario_sh1_w) /* Mario run sample */
142   AM_RANGE(0x7c80, 0x7c80) AM_READ_PORT("IN1") AM_WRITE(mario_sh2_w) /* Luigi run sample */
143143   AM_RANGE(0x7d00, 0x7d00) AM_WRITE(mario_scroll_w)
144144   AM_RANGE(0x7e80, 0x7e80) AM_WRITE(mario_gfxbank_w)
145145   AM_RANGE(0x7e82, 0x7e82) AM_WRITE(mario_flip_w)
trunk/src/mame/drivers/skyraid.c
r18185r18186
7878   AM_RANGE(0x1400, 0x1401) AM_READ_PORT("SYSTEM")
7979   AM_RANGE(0x1c00, 0x1c0f) AM_WRITEONLY AM_SHARE("obj_ram")
8080   AM_RANGE(0x4000, 0x4000) AM_WRITE(skyraid_scroll_w)
81   AM_RANGE(0x4400, 0x4400) AM_DEVWRITE_LEGACY("discrete", skyraid_sound_w)
81   AM_RANGE(0x4400, 0x4400) AM_WRITE(skyraid_sound_w)
8282   AM_RANGE(0x4800, 0x4800) AM_WRITE(skyraid_range_w)
8383   AM_RANGE(0x5000, 0x5000) AM_WRITE(watchdog_reset_w)
8484   AM_RANGE(0x5800, 0x5800) AM_WRITE(skyraid_offset_w)
trunk/src/mame/drivers/m79amb.c
r18185r18186
5858#include "includes/m79amb.h"
5959#include "cpu/i8085/i8085.h"
6060
61class m79amb_state : public driver_device
62{
63public:
64   m79amb_state(const machine_config &mconfig, device_type type, const char *tag)
65      : driver_device(mconfig, type, tag) ,
66      m_videoram(*this, "videoram"),
67      m_mask(*this, "mask"){ }
68
69   /* memory pointers */
70   required_shared_ptr<UINT8> m_videoram;
71   required_shared_ptr<UINT8> m_mask;
72
73   /* misc */
74   UINT8 m_lut_gun1[0x100];
75   UINT8 m_lut_gun2[0x100];
76   DECLARE_WRITE8_MEMBER(ramtek_videoram_w);
77   DECLARE_READ8_MEMBER(gray5bit_controller0_r);
78   DECLARE_READ8_MEMBER(gray5bit_controller1_r);
79   DECLARE_WRITE8_MEMBER(m79amb_8002_w);
80   DECLARE_DRIVER_INIT(m79amb);
81   UINT32 screen_update_ramtek(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
82   INTERRUPT_GEN_MEMBER(m79amb_interrupt);
83};
84
85
8661WRITE8_MEMBER(m79amb_state::ramtek_videoram_w)
8762{
8863   m_videoram[offset] = data & ~*m_mask;
r18185r18186
141116   AM_RANGE(0x0000, 0x1fff) AM_ROM
142117   AM_RANGE(0x4000, 0x5fff) AM_RAM_WRITE(ramtek_videoram_w) AM_SHARE("videoram")
143118   AM_RANGE(0x6000, 0x63ff) AM_RAM               /* ?? */
144   AM_RANGE(0x8000, 0x8000) AM_READ_PORT("8000") AM_DEVWRITE_LEGACY("discrete", m79amb_8000_w)
119   AM_RANGE(0x8000, 0x8000) AM_READ_PORT("8000") AM_WRITE(m79amb_8000_w)
145120   AM_RANGE(0x8001, 0x8001) AM_WRITEONLY AM_SHARE("mask")
146121   AM_RANGE(0x8002, 0x8002) AM_READ_PORT("8002") AM_WRITE(m79amb_8002_w)
147   AM_RANGE(0x8003, 0x8003) AM_DEVWRITE_LEGACY("discrete", m79amb_8003_w)
122   AM_RANGE(0x8003, 0x8003) AM_WRITE(m79amb_8003_w)
148123   AM_RANGE(0x8004, 0x8004) AM_READ(gray5bit_controller0_r)
149124   AM_RANGE(0x8005, 0x8005) AM_READ(gray5bit_controller1_r)
150125   AM_RANGE(0xc000, 0xc07f) AM_RAM               /* ?? */
trunk/src/mame/drivers/canyon.c
r18185r18186
108108static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, canyon_state )
109109   ADDRESS_MAP_GLOBAL_MASK(0x3fff)
110110   AM_RANGE(0x0000, 0x00ff) AM_MIRROR(0x100) AM_RAM
111   AM_RANGE(0x0400, 0x0401) AM_DEVWRITE_LEGACY("discrete", canyon_motor_w)
112   AM_RANGE(0x0500, 0x0500) AM_DEVWRITE_LEGACY("discrete", canyon_explode_w)
111   AM_RANGE(0x0400, 0x0401) AM_WRITE(canyon_motor_w)
112   AM_RANGE(0x0500, 0x0500) AM_WRITE(canyon_explode_w)
113113   AM_RANGE(0x0501, 0x0501) AM_WRITE(watchdog_reset_w) /* watchdog, disabled in service mode */
114   AM_RANGE(0x0600, 0x0603) AM_DEVWRITE_LEGACY("discrete", canyon_whistle_w)
114   AM_RANGE(0x0600, 0x0603) AM_WRITE(canyon_whistle_w)
115115   AM_RANGE(0x0680, 0x0683) AM_WRITE(canyon_led_w)
116   AM_RANGE(0x0700, 0x0703) AM_DEVWRITE_LEGACY("discrete", canyon_attract_w)
116   AM_RANGE(0x0700, 0x0703) AM_WRITE(canyon_attract_w)
117117   AM_RANGE(0x0800, 0x0bff) AM_RAM_WRITE(canyon_videoram_w) AM_SHARE("videoram")
118118   AM_RANGE(0x1000, 0x17ff) AM_READ(canyon_switches_r) AM_WRITENOP  /* sloppy code writes here */
119119   AM_RANGE(0x1800, 0x1fff) AM_READ(canyon_options_r)
trunk/src/mame/drivers/orbit.c
r18185r18186
112112   AM_RANGE(0x2800, 0x2800) AM_MIRROR(0x07ff) AM_READ_PORT("BUTTONS")
113113   AM_RANGE(0x3000, 0x33bf) AM_MIRROR(0x0400) AM_RAM_WRITE(orbit_playfield_w) AM_SHARE("playfield_ram")
114114   AM_RANGE(0x33c0, 0x33ff) AM_MIRROR(0x0400) AM_RAM AM_SHARE("sprite_ram")
115   AM_RANGE(0x3800, 0x3800) AM_MIRROR(0x00ff) AM_DEVWRITE_LEGACY("discrete", orbit_note_w)
116   AM_RANGE(0x3900, 0x3900) AM_MIRROR(0x00ff) AM_DEVWRITE_LEGACY("discrete", orbit_noise_amp_w)
117   AM_RANGE(0x3a00, 0x3a00) AM_MIRROR(0x00ff) AM_DEVWRITE_LEGACY("discrete", orbit_note_amp_w)
115   AM_RANGE(0x3800, 0x3800) AM_MIRROR(0x00ff) AM_WRITE(orbit_note_w)
116   AM_RANGE(0x3900, 0x3900) AM_MIRROR(0x00ff) AM_WRITE(orbit_noise_amp_w)
117   AM_RANGE(0x3a00, 0x3a00) AM_MIRROR(0x00ff) AM_WRITE(orbit_note_amp_w)
118118   AM_RANGE(0x3c00, 0x3c0f) AM_MIRROR(0x00f0) AM_WRITE(orbit_misc_w)
119   AM_RANGE(0x3e00, 0x3e00) AM_MIRROR(0x00ff) AM_DEVWRITE_LEGACY("discrete", orbit_noise_rst_w)
119   AM_RANGE(0x3e00, 0x3e00) AM_MIRROR(0x00ff) AM_WRITE(orbit_noise_rst_w)
120120   AM_RANGE(0x3f00, 0x3f00) AM_MIRROR(0x00ff) AM_WRITE(watchdog_reset_w)
121121   AM_RANGE(0x6000, 0x7fff) AM_ROM
122122ADDRESS_MAP_END
r18185r18186
273273{
274274
275275   m_maincpu = machine().device<cpu_device>("maincpu");
276   m_discrete = machine().device("discrete");
277276
278277   save_item(NAME(m_misc_flags));
279278   save_item(NAME(m_flip_screen));
trunk/src/mame/drivers/dragrace.c
r18185r18186
311311
312312void dragrace_state::machine_start()
313313{
314
315   m_discrete = machine().device("discrete");
316
317314   save_item(NAME(m_misc_flags));
318315   save_item(NAME(m_gear));
319316}
trunk/src/mame/drivers/bsktball.c
r18185r18186
8080   AM_RANGE(0x0802, 0x0802) AM_READ_PORT("IN1")
8181   AM_RANGE(0x0803, 0x0803) AM_READ_PORT("DSW")
8282   AM_RANGE(0x1000, 0x1000) AM_WRITENOP /* Timer Reset */
83   AM_RANGE(0x1010, 0x1010) AM_DEVWRITE_LEGACY("discrete", bsktball_bounce_w) /* Crowd Amp / Bounce */
83   AM_RANGE(0x1010, 0x1010) AM_WRITE(bsktball_bounce_w) /* Crowd Amp / Bounce */
8484   AM_RANGE(0x1022, 0x1023) AM_WRITENOP /* Coin Counter */
8585   AM_RANGE(0x1024, 0x1025) AM_WRITE(bsktball_led1_w) /* LED 1 */
8686   AM_RANGE(0x1026, 0x1027) AM_WRITE(bsktball_led2_w) /* LED 2 */
8787   AM_RANGE(0x1028, 0x1029) AM_WRITE(bsktball_ld1_w) /* LD 1 */
8888   AM_RANGE(0x102a, 0x102b) AM_WRITE(bsktball_ld2_w) /* LD 2 */
89   AM_RANGE(0x102c, 0x102d) AM_DEVWRITE_LEGACY("discrete", bsktball_noise_reset_w) /* Noise Reset */
89   AM_RANGE(0x102c, 0x102d) AM_WRITE(bsktball_noise_reset_w) /* Noise Reset */
9090   AM_RANGE(0x102e, 0x102f) AM_WRITE(bsktball_nmion_w) /* NMI On */
91   AM_RANGE(0x1030, 0x1030) AM_DEVWRITE_LEGACY("discrete", bsktball_note_w) /* Music Ckt Note Dvsr */
91   AM_RANGE(0x1030, 0x1030) AM_WRITE(bsktball_note_w) /* Music Ckt Note Dvsr */
9292   AM_RANGE(0x1800, 0x1bbf) AM_RAM_WRITE(bsktball_videoram_w) AM_SHARE("videoram") /* DISPLAY */
9393   AM_RANGE(0x1bc0, 0x1bff) AM_RAM AM_SHARE("motion")
9494   AM_RANGE(0x1c00, 0x1cff) AM_RAM
trunk/src/mame/drivers/suna8.c
r18185r18186
16071607   AY8910_DEFAULT_LOADS,
16081608   DEVCB_NULL,
16091609   DEVCB_NULL,
1610   DEVCB_DEVICE_HANDLER("samples", suna8_play_samples_w),
1611   DEVCB_DEVICE_HANDLER("samples", suna8_samples_number_w)
1610   DEVCB_DRIVER_MEMBER(suna8_state, suna8_play_samples_w),
1611   DEVCB_DRIVER_MEMBER(suna8_state, suna8_samples_number_w)
16121612};
16131613
16141614static const samples_interface suna8_samples_interface =
r18185r18186
16761676   AY8910_DEFAULT_LOADS,
16771677   DEVCB_NULL,
16781678   DEVCB_NULL,
1679   DEVCB_DEVICE_HANDLER("samples", rranger_play_samples_w),
1680   DEVCB_DEVICE_HANDLER("samples", suna8_samples_number_w),
1679   DEVCB_DRIVER_MEMBER(suna8_state, rranger_play_samples_w),
1680   DEVCB_DRIVER_MEMBER(suna8_state, suna8_samples_number_w),
16811681   },
16821682   DEVCB_NULL
16831683};
r18185r18186
18561856   AY8910_DEFAULT_LOADS,
18571857   DEVCB_NULL,
18581858   DEVCB_NULL,
1859   DEVCB_DEVICE_HANDLER("samples", suna8_play_samples_w),
1860   DEVCB_DEVICE_HANDLER("samples", suna8_samples_number_w)
1859   DEVCB_DRIVER_MEMBER(suna8_state, suna8_play_samples_w),
1860   DEVCB_DRIVER_MEMBER(suna8_state, suna8_samples_number_w)
18611861};
18621862
18631863static MACHINE_CONFIG_START( starfigh, suna8_state )
trunk/src/mame/drivers/blockade.c
r18185r18186
126126static ADDRESS_MAP_START( main_io_map, AS_IO, 8, blockade_state )
127127    AM_RANGE(0x01, 0x01) AM_READWRITE(blockade_input_port_0_r, blockade_coin_latch_w)
128128    AM_RANGE(0x02, 0x02) AM_READ_PORT("IN1")
129    AM_RANGE(0x02, 0x02) AM_DEVWRITE_LEGACY("discrete", blockade_sound_freq_w)
129    AM_RANGE(0x02, 0x02) AM_WRITE(blockade_sound_freq_w)
130130    AM_RANGE(0x04, 0x04) AM_READ_PORT("IN2")
131131    AM_RANGE(0x04, 0x04) AM_WRITE(blockade_env_on_w)
132132    AM_RANGE(0x08, 0x08) AM_WRITE(blockade_env_off_w)
trunk/src/mame/audio/redalert.c
r18185r18186
4040 *
4141 *************************************/
4242
43static WRITE8_DEVICE_HANDLER( redalert_analog_w )
43WRITE8_MEMBER(redalert_state::redalert_analog_w)
4444{
4545   /* this port triggers analog sounds
4646       D0 = Formation Aircraft?
r18185r18186
7474}
7575
7676
77static WRITE8_DEVICE_HANDLER( redalert_AY8910_w )
77WRITE8_MEMBER(redalert_state::redalert_AY8910_w)
7878{
79   redalert_state *state = space.machine().driver_data<redalert_state>();
79   device_t *device = machine().device("aysnd");
8080   /* BC2 is connected to a pull-up resistor, so BC2=1 always */
8181   switch (data & 0x03)
8282   {
r18185r18186
8686
8787      /* BC1=1, BDIR=0 : read from PSG */
8888      case 0x01:
89         state->m_ay8910_latch_1 = ay8910_r(device, space, 0);
89         m_ay8910_latch_1 = ay8910_r(device, space, 0);
9090         break;
9191
9292      /* BC1=0, BDIR=1 : write to PSG */
r18185r18186
9494      case 0x02:
9595      case 0x03:
9696      default:
97         ay8910_data_address_w(device, space, data, state->m_ay8910_latch_2);
97         ay8910_data_address_w(device, space, data, m_ay8910_latch_2);
9898         break;
9999   }
100100}
r18185r18186
119119   DEVCB_DRIVER_MEMBER(driver_device, soundlatch_byte_r),
120120   DEVCB_NULL,      /* port A/B read */
121121   DEVCB_NULL,
122   DEVCB_HANDLER(redalert_analog_w)   /* port A/B write */
122   DEVCB_DRIVER_MEMBER(redalert_state,redalert_analog_w)   /* port A/B write */
123123};
124124
125125
126126static ADDRESS_MAP_START( redalert_audio_map, AS_PROGRAM, 8, redalert_state )
127127   ADDRESS_MAP_GLOBAL_MASK(0x7fff)
128128   AM_RANGE(0x0000, 0x03ff) AM_MIRROR(0x0c00) AM_RAM
129   AM_RANGE(0x1000, 0x1000) AM_MIRROR(0x0ffe) AM_READNOP AM_DEVWRITE_LEGACY("aysnd", redalert_AY8910_w)
129   AM_RANGE(0x1000, 0x1000) AM_MIRROR(0x0ffe) AM_READNOP AM_WRITE(redalert_AY8910_w)
130130   AM_RANGE(0x1001, 0x1001) AM_MIRROR(0x0ffe) AM_READWRITE(redalert_ay8910_latch_1_r, redalert_ay8910_latch_2_w)
131131   AM_RANGE(0x2000, 0x6fff) AM_NOP
132132   AM_RANGE(0x7000, 0x77ff) AM_MIRROR(0x0800) AM_ROM
r18185r18186
159159}
160160
161161
162static WRITE_LINE_DEVICE_HANDLER( sod_callback )
162WRITE_LINE_MEMBER(redalert_state::sod_callback)
163163{
164   hc55516_digit_w(device->machine().device("cvsd"), state);
164   hc55516_digit_w(machine().device("cvsd"), state);
165165}
166166
167167
168static READ_LINE_DEVICE_HANDLER( sid_callback )
168READ_LINE_MEMBER(redalert_state::sid_callback)
169169{
170   return hc55516_clock_state_r(device->machine().device("cvsd"));
170   return hc55516_clock_state_r(machine().device("cvsd"));
171171}
172172
173173
r18185r18186
175175{
176176   DEVCB_NULL,               /* STATUS changed callback */
177177   DEVCB_NULL,               /* INTE changed callback */
178   DEVCB_LINE(sid_callback),   /* SID changed callback (8085A only) */
179   DEVCB_LINE(sod_callback)   /* SOD changed callback (8085A only) */
178   DEVCB_DRIVER_LINE_MEMBER(redalert_state,sid_callback),   /* SID changed callback (8085A only) */
179   DEVCB_DRIVER_LINE_MEMBER(redalert_state,sod_callback)   /* SOD changed callback (8085A only) */
180180};
181181
182182
r18185r18186
286286}
287287
288288
289static WRITE8_DEVICE_HANDLER( demoneye_ay8910_latch_1_w )
289WRITE8_MEMBER(redalert_state::demoneye_ay8910_latch_1_w)
290290{
291   redalert_state *state = space.machine().driver_data<redalert_state>();
292   state->m_ay8910_latch_1 = data;
291   m_ay8910_latch_1 = data;
293292}
294293
295294
296static READ8_DEVICE_HANDLER( demoneye_ay8910_latch_2_r )
295READ8_MEMBER(redalert_state::demoneye_ay8910_latch_2_r)
297296{
298   redalert_state *state = space.machine().driver_data<redalert_state>();
299   return state->m_ay8910_latch_2;
297   return m_ay8910_latch_2;
300298}
301299
302300
303static WRITE8_DEVICE_HANDLER( demoneye_ay8910_data_w )
301WRITE8_MEMBER(redalert_state::demoneye_ay8910_data_w)
304302{
305   redalert_state *state = space.machine().driver_data<redalert_state>();
306   device_t *ay1 = space.machine().device("ay1");
307   device_t *ay2 = space.machine().device("ay2");
303   device_t *ay1 = machine().device("ay1");
304   device_t *ay2 = machine().device("ay2");
308305
309   switch (state->m_ay8910_latch_1 & 0x03)
306   switch (m_ay8910_latch_1 & 0x03)
310307   {
311308      case 0x00:
312         if (state->m_ay8910_latch_1 & 0x10)
309         if (m_ay8910_latch_1 & 0x10)
313310            ay8910_data_w(ay1, space, 0, data);
314311
315         if (state->m_ay8910_latch_1 & 0x20)
312         if (m_ay8910_latch_1 & 0x20)
316313            ay8910_data_w(ay2, space, 0, data);
317314
318315         break;
319316
320317      case 0x01:
321         if (state->m_ay8910_latch_1 & 0x10)
322            state->m_ay8910_latch_2 = ay8910_r(ay1, space, 0);
318         if (m_ay8910_latch_1 & 0x10)
319            m_ay8910_latch_2 = ay8910_r(ay1, space, 0);
323320
324         if (state->m_ay8910_latch_1 & 0x20)
325            state->m_ay8910_latch_2 = ay8910_r(ay2, space, 0);
321         if (m_ay8910_latch_1 & 0x20)
322            m_ay8910_latch_2 = ay8910_r(ay2, space, 0);
326323
327324         break;
328325
329326      case 0x03:
330         if (state->m_ay8910_latch_1 & 0x10)
327         if (m_ay8910_latch_1 & 0x10)
331328            ay8910_address_w(ay1, space, 0, data);
332329
333         if (state->m_ay8910_latch_1 & 0x20)
330         if (m_ay8910_latch_1 & 0x20)
334331            ay8910_address_w(ay2, space, 0, data);
335332
336333         break;
337334
338335      default:
339         logerror("demoneye_ay8910_data_w called with latch %02X  data %02X\n", state->m_ay8910_latch_1, data);
336         logerror("demoneye_ay8910_data_w called with latch %02X  data %02X\n", m_ay8910_latch_1, data);
340337         break;
341338   }
342339}
r18185r18186
363360
364361static const pia6821_interface demoneye_pia_intf =
365362{
366   DEVCB_HANDLER(demoneye_ay8910_latch_2_r),      /* port A in */
363   DEVCB_DRIVER_MEMBER(redalert_state,demoneye_ay8910_latch_2_r),      /* port A in */
367364   DEVCB_NULL,      /* port B in */
368365   DEVCB_NULL,      /* line CA1 in */
369366   DEVCB_NULL,      /* line CB1 in */
370367   DEVCB_NULL,      /* line CA2 in */
371368   DEVCB_NULL,      /* line CB2 in */
372   DEVCB_HANDLER(demoneye_ay8910_data_w),         /* port A out */
373   DEVCB_HANDLER(demoneye_ay8910_latch_1_w),      /* port B out */
369   DEVCB_DRIVER_MEMBER(redalert_state,demoneye_ay8910_data_w),         /* port A out */
370   DEVCB_DRIVER_MEMBER(redalert_state,demoneye_ay8910_latch_1_w),      /* port B out */
374371   DEVCB_NULL,      /* line CA2 out */
375372   DEVCB_NULL,      /* port CB2 out */
376373   DEVCB_NULL,      /* IRQA */
trunk/src/mame/audio/starwars.c
r18185r18186
2929 *
3030 *************************************/
3131
32static READ8_DEVICE_HANDLER( r6532_porta_r )
32READ8_MEMBER(starwars_state::r6532_porta_r)
3333{
3434   /* Configured as follows:           */
3535   /* d7 (in)  Main Ready Flag         */
r18185r18186
4242   /* d1 (out) TMS5220 Not Read        */
4343   /* d0 (out) TMS5220 Not Write       */
4444   /* Note: bit 4 is always set to avoid sound self test */
45   UINT8 olddata = riot6532_porta_in_get(device);
45   UINT8 olddata = riot6532_porta_in_get(machine().device("riot"));
4646
47   return (olddata & 0xc0) | 0x10 | (tms5220_readyq_r(space.machine().device("tms")) << 2);
47   return (olddata & 0xc0) | 0x10 | (tms5220_readyq_r(machine().device("tms")) << 2);
4848}
4949
5050
51static WRITE8_DEVICE_HANDLER( r6532_porta_w )
51WRITE8_MEMBER(starwars_state::r6532_porta_w)
5252{
53   device_t *device = machine().device("tms");
5354   /* handle 5220 read */
5455   tms5220_rsq_w(device, (data & 2)>>1);
5556   /* handle 5220 write */
r18185r18186
5758}
5859
5960
60static WRITE_LINE_DEVICE_HANDLER( snd_interrupt )
61WRITE_LINE_MEMBER(starwars_state::snd_interrupt)
6162{
62   device->machine().device("audiocpu")->execute().set_input_line(M6809_IRQ_LINE, state);
63   machine().device("audiocpu")->execute().set_input_line(M6809_IRQ_LINE, state);
6364}
6465
6566
6667const riot6532_interface starwars_riot6532_intf =
6768{
68   DEVCB_HANDLER(r6532_porta_r),
69   DEVCB_DRIVER_MEMBER(starwars_state,r6532_porta_r),
6970   DEVCB_DEVICE_HANDLER("tms", tms5220_status_r),
70   DEVCB_DEVICE_HANDLER("tms", r6532_porta_w),
71   DEVCB_DRIVER_MEMBER(starwars_state,r6532_porta_w),
7172   DEVCB_DEVICE_HANDLER("tms", tms5220_data_w),
72   DEVCB_LINE(snd_interrupt)
73   DEVCB_DRIVER_LINE_MEMBER(starwars_state,snd_interrupt)
7374};
7475
7576
trunk/src/mame/audio/subs.c
r18185r18186
1212sub sound functions
1313***************************************************************************/
1414
15WRITE8_DEVICE_HANDLER( subs_sonar1_w )
15WRITE8_MEMBER(subs_state::subs_sonar1_w)
1616{
17   discrete_sound_w(device, space, SUBS_SONAR1_EN, offset & 0x01);
17   discrete_sound_w(m_discrete, space, SUBS_SONAR1_EN, offset & 0x01);
1818}
1919
20WRITE8_DEVICE_HANDLER( subs_sonar2_w )
20WRITE8_MEMBER(subs_state::subs_sonar2_w)
2121{
22   discrete_sound_w(device, space, SUBS_SONAR2_EN, offset & 0x01);
22   discrete_sound_w(m_discrete, space, SUBS_SONAR2_EN, offset & 0x01);
2323}
2424
25WRITE8_DEVICE_HANDLER( subs_crash_w )
25WRITE8_MEMBER(subs_state::subs_crash_w)
2626{
27   discrete_sound_w(device, space, SUBS_CRASH_EN, offset & 0x01);
27   discrete_sound_w(m_discrete, space, SUBS_CRASH_EN, offset & 0x01);
2828}
2929
30WRITE8_DEVICE_HANDLER( subs_explode_w )
30WRITE8_MEMBER(subs_state::subs_explode_w)
3131{
32   discrete_sound_w(device, space, SUBS_EXPLODE_EN, offset & 0x01);
32   discrete_sound_w(m_discrete, space, SUBS_EXPLODE_EN, offset & 0x01);
3333}
3434
35WRITE8_DEVICE_HANDLER( subs_noise_reset_w )
35WRITE8_MEMBER(subs_state::subs_noise_reset_w)
3636{
3737   /* Pulse noise reset */
38   discrete_sound_w(device, space, SUBS_NOISE_RESET, 0);
38   discrete_sound_w(m_discrete, space, SUBS_NOISE_RESET, 0);
3939}
4040
4141
trunk/src/mame/audio/8080bw.c
r18185r18186
279279   m_port_2_last_extra = data;
280280}
281281
282WRITE8_DEVICE_HANDLER( indianbt_sh_port_3_w )
282WRITE8_MEMBER(_8080bw_state::indianbt_sh_port_3_w)
283283{
284   discrete_sound_w(device, space, INDIANBT_MUSIC_DATA, data);
284   discrete_sound_w(m_discrete, space, INDIANBT_MUSIC_DATA, data);
285285}
286286
287287
r18185r18186
597597
598598DISCRETE_SOUND_END
599599
600WRITE8_DEVICE_HANDLER( polaris_sh_port_1_w )
600WRITE8_MEMBER(_8080bw_state::polaris_sh_port_1_w)
601601{
602   discrete_sound_w(device, space, POLARIS_MUSIC_DATA, data);
602   discrete_sound_w(m_discrete, space, POLARIS_MUSIC_DATA, data);
603603}
604604
605WRITE8_DEVICE_HANDLER( polaris_sh_port_2_w )
605WRITE8_MEMBER(_8080bw_state::polaris_sh_port_2_w)
606606{
607607   /* 0x01 - SX0 - Shot */
608   discrete_sound_w(device, space, POLARIS_SX0_EN, data & 0x01);
608   discrete_sound_w(m_discrete, space, POLARIS_SX0_EN, data & 0x01);
609609
610610   /* 0x02 - SX1 - Ship Hit (Sub) */
611   discrete_sound_w(device, space, POLARIS_SX1_EN, data & 0x02);
611   discrete_sound_w(m_discrete, space, POLARIS_SX1_EN, data & 0x02);
612612
613613   /* 0x04 - SX2 - Ship */
614   discrete_sound_w(device, space, POLARIS_SX2_EN, data & 0x04);
614   discrete_sound_w(m_discrete, space, POLARIS_SX2_EN, data & 0x04);
615615
616616   /* 0x08 - SX3 - Explosion */
617   discrete_sound_w(device, space, POLARIS_SX3_EN, data & 0x08);
617   discrete_sound_w(m_discrete, space, POLARIS_SX3_EN, data & 0x08);
618618
619619   /* 0x10 - SX4 */
620620
621621   /* 0x20 - SX5 - Sound Enable */
622   discrete_sound_w(device, space, POLARIS_SX5_EN, data & 0x20);
622   discrete_sound_w(m_discrete, space, POLARIS_SX5_EN, data & 0x20);
623623}
624624
625WRITE8_DEVICE_HANDLER( polaris_sh_port_3_w )
625WRITE8_MEMBER(_8080bw_state::polaris_sh_port_3_w)
626626{
627   _8080bw_state *state = space.machine().driver_data<_8080bw_state>();
628627
629   coin_lockout_global_w(space.machine(), data & 0x04);  /* SX8 */
628   coin_lockout_global_w(machine(), data & 0x04);  /* SX8 */
630629
631   state->m_c8080bw_flip_screen = data & 0x20;      /* SX11 */
630   m_c8080bw_flip_screen = data & 0x20;      /* SX11 */
632631
633632   /* 0x01 - SX6 - Plane Down */
634   discrete_sound_w(device, space, POLARIS_SX6_EN, data & 0x01);
633   discrete_sound_w(m_discrete, space, POLARIS_SX6_EN, data & 0x01);
635634
636635   /* 0x02 - SX7 - Plane Up */
637   discrete_sound_w(device, space, POLARIS_SX7_EN, data & 0x02);
636   discrete_sound_w(m_discrete, space, POLARIS_SX7_EN, data & 0x02);
638637
639638   /* 0x08 - SX9 - Hit */
640   discrete_sound_w(device, space, POLARIS_SX9_EN, data & 0x08);
639   discrete_sound_w(m_discrete, space, POLARIS_SX9_EN, data & 0x08);
641640
642641   /* 0x10 - SX10 - Hit */
643   discrete_sound_w(device, space, POLARIS_SX10_EN, data & 0x10);
642   discrete_sound_w(m_discrete, space, POLARIS_SX10_EN, data & 0x10);
644643}
645644
646645
trunk/src/mame/audio/m79amb.c
r18185r18186
320320/* the ports are guessed from operation */
321321/* the schematics do not show the actual hookup */
322322
323WRITE8_DEVICE_HANDLER( m79amb_8000_w )
323WRITE8_MEMBER(m79amb_state::m79amb_8000_w)
324324{
325325   /* these values are not latched */
326326   /* they are pulsed when the port is addressed */
327327   /* the discrete system will just trigger from them */
328   discrete_sound_w(device, space, M79AMB_SHOT_EN, data & 0x01);
329   discrete_sound_w(device, space, M79AMB_BOOM_EN, data & 0x02);
330   discrete_sound_w(device, space, M79AMB_THUD_EN, data & 0x04);
328   discrete_sound_w(m_discrete, space, M79AMB_SHOT_EN, data & 0x01);
329   discrete_sound_w(m_discrete, space, M79AMB_BOOM_EN, data & 0x02);
330   discrete_sound_w(m_discrete, space, M79AMB_THUD_EN, data & 0x04);
331331};
332332
333WRITE8_DEVICE_HANDLER( m79amb_8003_w )
333WRITE8_MEMBER(m79amb_state::m79amb_8003_w)
334334{
335335   /* Self Test goes low on reset and lights LED */
336336   /* LED goes off on pass */
337337   output_set_value("SELF_TEST", data & 0x01);
338   discrete_sound_w(device, space, M79AMB_MC_REV_EN, data & 0x02);
339   discrete_sound_w(device, space, M79AMB_MC_CONTROL_EN, data & 0x04);
340   discrete_sound_w(device, space, M79AMB_TANK_TRUCK_JEEP_EN, data & 0x08);
341   discrete_sound_w(device, space, M79AMB_WHISTLE_B_EN, data & 0x10);
342   discrete_sound_w(device, space, M79AMB_WHISTLE_A_EN, data & 0x20);
338   discrete_sound_w(m_discrete, space, M79AMB_MC_REV_EN, data & 0x02);
339   discrete_sound_w(m_discrete, space, M79AMB_MC_CONTROL_EN, data & 0x04);
340   discrete_sound_w(m_discrete, space, M79AMB_TANK_TRUCK_JEEP_EN, data & 0x08);
341   discrete_sound_w(m_discrete, space, M79AMB_WHISTLE_B_EN, data & 0x10);
342   discrete_sound_w(m_discrete, space, M79AMB_WHISTLE_A_EN, data & 0x20);
343343}
trunk/src/mame/audio/mw8080bw.c
r18185r18186
8383};
8484
8585
86WRITE8_DEVICE_HANDLER( midway_tone_generator_lo_w )
86WRITE8_MEMBER(mw8080bw_state::midway_tone_generator_lo_w)
8787{
88   discrete_sound_w(device, space, MIDWAY_TONE_EN, (data >> 0) & 0x01);
88   discrete_sound_w(m_discrete, space, MIDWAY_TONE_EN, (data >> 0) & 0x01);
8989
90   discrete_sound_w(device, space, MIDWAY_TONE_DATA_L, (data >> 1) & 0x1f);
90   discrete_sound_w(m_discrete, space, MIDWAY_TONE_DATA_L, (data >> 1) & 0x1f);
9191
9292   /* D6 and D7 are not connected */
9393}
9494
9595
96WRITE8_DEVICE_HANDLER( midway_tone_generator_hi_w )
96WRITE8_MEMBER(mw8080bw_state::midway_tone_generator_hi_w)
9797{
98   discrete_sound_w(device, space, MIDWAY_TONE_DATA_H, data & 0x3f);
98   discrete_sound_w(m_discrete, space, MIDWAY_TONE_DATA_H, data & 0x3f);
9999
100100   /* D6 and D7 are not connected */
101101}
r18185r18186
326326MACHINE_CONFIG_END
327327
328328
329WRITE8_DEVICE_HANDLER( tornbase_audio_w )
329WRITE8_MEMBER(mw8080bw_state::tornbase_audio_w)
330330{
331   discrete_sound_w(device, space, TORNBASE_TONE_240_EN, (data >> 0) & 0x01);
331   discrete_sound_w(m_discrete, space, TORNBASE_TONE_240_EN, (data >> 0) & 0x01);
332332
333   discrete_sound_w(device, space, TORNBASE_TONE_960_EN, (data >> 1) & 0x01);
333   discrete_sound_w(m_discrete, space, TORNBASE_TONE_960_EN, (data >> 1) & 0x01);
334334
335   discrete_sound_w(device, space, TORNBASE_TONE_120_EN, (data >> 2) & 0x01);
335   discrete_sound_w(m_discrete, space, TORNBASE_TONE_120_EN, (data >> 2) & 0x01);
336336
337337   /* if (data & 0x08)  enable SIREN sound */
338338
339339   /* if (data & 0x10)  enable CHEER sound */
340340
341   if (tornbase_get_cabinet_type(space.machine()) == TORNBASE_CAB_TYPE_UPRIGHT_OLD)
341   if (tornbase_get_cabinet_type(machine()) == TORNBASE_CAB_TYPE_UPRIGHT_OLD)
342342   {
343343      /* if (data & 0x20)  enable WHISTLE sound */
344344
r18185r18186
351351      /* if (data & 0x40)  enable WHISTLE sound */
352352   }
353353
354   coin_counter_w(space.machine(), 0, (data >> 7) & 0x01);
354   coin_counter_w(machine(), 0, (data >> 7) & 0x01);
355355}
356356
357357
r18185r18186
820820MACHINE_CONFIG_END
821821
822822
823WRITE8_DEVICE_HANDLER( boothill_audio_w )
823WRITE8_MEMBER(mw8080bw_state::boothill_audio_w)
824824{
825825   /* D0 and D1 are not connected */
826826
827   coin_counter_w(space.machine(), 0, (data >> 2) & 0x01);
827   coin_counter_w(machine(), 0, (data >> 2) & 0x01);
828828
829   discrete_sound_w(device, space, BOOTHILL_GAME_ON_EN, (data >> 3) & 0x01);
829   discrete_sound_w(m_discrete, space, BOOTHILL_GAME_ON_EN, (data >> 3) & 0x01);
830830
831   discrete_sound_w(device, space, BOOTHILL_LEFT_SHOT_EN, (data >> 4) & 0x01);
831   discrete_sound_w(m_discrete, space, BOOTHILL_LEFT_SHOT_EN, (data >> 4) & 0x01);
832832
833   discrete_sound_w(device, space, BOOTHILL_RIGHT_SHOT_EN, (data >> 5) & 0x01);
833   discrete_sound_w(m_discrete, space, BOOTHILL_RIGHT_SHOT_EN, (data >> 5) & 0x01);
834834
835   discrete_sound_w(device, space, BOOTHILL_LEFT_HIT_EN, (data >> 6) & 0x01);
835   discrete_sound_w(m_discrete, space, BOOTHILL_LEFT_HIT_EN, (data >> 6) & 0x01);
836836
837   discrete_sound_w(device, space, BOOTHILL_RIGHT_HIT_EN, (data >> 7) & 0x01);
837   discrete_sound_w(m_discrete, space, BOOTHILL_RIGHT_HIT_EN, (data >> 7) & 0x01);
838838}
839839
840840
r18185r18186
10491049MACHINE_CONFIG_END
10501050
10511051
1052WRITE8_DEVICE_HANDLER( checkmat_audio_w )
1052WRITE8_MEMBER(mw8080bw_state::checkmat_audio_w)
10531053{
1054   discrete_sound_w(device, space, CHECKMAT_TONE_EN, data & 0x01);
1054   discrete_sound_w(m_discrete, space, CHECKMAT_TONE_EN, data & 0x01);
10551055
1056   discrete_sound_w(device, space, CHECKMAT_BOOM_EN, (data >> 1) & 0x01);
1056   discrete_sound_w(m_discrete, space, CHECKMAT_BOOM_EN, (data >> 1) & 0x01);
10571057
1058   coin_counter_w(space.machine(), 0, (data >> 2) & 0x01);
1058   coin_counter_w(machine(), 0, (data >> 2) & 0x01);
10591059
1060   space.machine().sound().system_enable((data >> 3) & 0x01);
1060   machine().sound().system_enable((data >> 3) & 0x01);
10611061
1062   discrete_sound_w(device, space, CHECKMAT_TONE_DATA_45, (data >> 4) & 0x03);
1063   discrete_sound_w(device, space, CHECKMAT_TONE_DATA_67, (data >> 6) & 0x03);
1062   discrete_sound_w(m_discrete, space, CHECKMAT_TONE_DATA_45, (data >> 4) & 0x03);
1063   discrete_sound_w(m_discrete, space, CHECKMAT_TONE_DATA_67, (data >> 6) & 0x03);
10641064}
10651065
10661066
r18185r18186
12601260MACHINE_CONFIG_END
12611261
12621262
1263WRITE8_DEVICE_HANDLER( desertgu_audio_1_w )
1263WRITE8_MEMBER(mw8080bw_state::desertgu_audio_1_w)
12641264{
12651265   /* D0 and D1 are not connected */
12661266
1267   coin_counter_w(space.machine(), 0, (data >> 2) & 0x01);
1267   coin_counter_w(machine(), 0, (data >> 2) & 0x01);
12681268
1269   discrete_sound_w(device, space, DESERTGU_GAME_ON_EN, (data >> 3) & 0x01);
1269   discrete_sound_w(m_discrete, space, DESERTGU_GAME_ON_EN, (data >> 3) & 0x01);
12701270
1271   discrete_sound_w(device, space, DESERTGU_RIFLE_SHOT_EN, (data >> 4) & 0x01);
1271   discrete_sound_w(m_discrete, space, DESERTGU_RIFLE_SHOT_EN, (data >> 4) & 0x01);
12721272
1273   discrete_sound_w(device, space, DESERTGU_BOTTLE_HIT_EN, (data >> 5) & 0x01);
1273   discrete_sound_w(m_discrete, space, DESERTGU_BOTTLE_HIT_EN, (data >> 5) & 0x01);
12741274
1275   discrete_sound_w(device, space, DESERTGU_ROAD_RUNNER_HIT_EN, (data >> 6) & 0x01);
1275   discrete_sound_w(m_discrete, space, DESERTGU_ROAD_RUNNER_HIT_EN, (data >> 6) & 0x01);
12761276
1277   discrete_sound_w(device, space, DESERTGU_CREATURE_HIT_EN, (data >> 7) & 0x01);
1277   discrete_sound_w(m_discrete, space, DESERTGU_CREATURE_HIT_EN, (data >> 7) & 0x01);
12781278}
12791279
12801280
1281WRITE8_DEVICE_HANDLER( desertgu_audio_2_w )
1281WRITE8_MEMBER(mw8080bw_state::desertgu_audio_2_w)
12821282{
1283   mw8080bw_state *state = space.machine().driver_data<mw8080bw_state>();
12841283
1285   discrete_sound_w(device, space, DESERTGU_ROADRUNNER_BEEP_BEEP_EN, (data >> 0) & 0x01);
1284   discrete_sound_w(m_discrete, space, DESERTGU_ROADRUNNER_BEEP_BEEP_EN, (data >> 0) & 0x01);
12861285
1287   discrete_sound_w(device, space, DESERTGU_TRIGGER_CLICK_EN, (data >> 1) & 0x01);
1286   discrete_sound_w(m_discrete, space, DESERTGU_TRIGGER_CLICK_EN, (data >> 1) & 0x01);
12881287
12891288   output_set_value("Player1_Gun_Recoil", (data >> 2) & 0x01);
12901289
1291   state->m_desertgun_controller_select = (data >> 3) & 0x01;
1290   m_desertgun_controller_select = (data >> 3) & 0x01;
12921291
12931292   /* D4-D7 are not connected */
12941293}
r18185r18186
15271526MACHINE_CONFIG_END
15281527
15291528
1530WRITE8_DEVICE_HANDLER( dplay_audio_w )
1529WRITE8_MEMBER(mw8080bw_state::dplay_audio_w)
15311530{
1532   discrete_sound_w(device, space, DPLAY_TONE_ON_EN, (data >> 0) & 0x01);
1531   discrete_sound_w(m_discrete, space, DPLAY_TONE_ON_EN, (data >> 0) & 0x01);
15331532
1534   discrete_sound_w(device, space, DPLAY_CHEER_EN, (data >> 1) & 0x01);
1533   discrete_sound_w(m_discrete, space, DPLAY_CHEER_EN, (data >> 1) & 0x01);
15351534
1536   discrete_sound_w(device, space, DPLAY_SIREN_EN, (data >> 2) & 0x01);
1535   discrete_sound_w(m_discrete, space, DPLAY_SIREN_EN, (data >> 2) & 0x01);
15371536
1538   discrete_sound_w(device, space, DPLAY_WHISTLE_EN, (data >> 3) & 0x01);
1537   discrete_sound_w(m_discrete, space, DPLAY_WHISTLE_EN, (data >> 3) & 0x01);
15391538
1540   discrete_sound_w(device, space, DPLAY_GAME_ON_EN, (data >> 4) & 0x01);
1539   discrete_sound_w(m_discrete, space, DPLAY_GAME_ON_EN, (data >> 4) & 0x01);
15411540
1542   coin_counter_w(space.machine(), 0, (data >> 5) & 0x01);
1541   coin_counter_w(machine(), 0, (data >> 5) & 0x01);
15431542
15441543   /* D6 and D7 are not connected */
15451544}
r18185r18186
19461945}
19471946
19481947
1949WRITE8_DEVICE_HANDLER( clowns_audio_2_w )
1948WRITE8_MEMBER(mw8080bw_state::clowns_audio_2_w)
19501949{
1951   mw8080bw_state *state = space.machine().driver_data<mw8080bw_state>();
1952   UINT8 rising_bits = data & ~state->m_port_2_last;
1950   UINT8 rising_bits = data & ~m_port_2_last;
19531951
1954   discrete_sound_w(device, space, CLOWNS_POP_BOTTOM_EN, (data >> 0) & 0x01);
1952   discrete_sound_w(m_discrete, space, CLOWNS_POP_BOTTOM_EN, (data >> 0) & 0x01);
19551953
1956   discrete_sound_w(device, space, CLOWNS_POP_MIDDLE_EN, (data >> 1) & 0x01);
1954   discrete_sound_w(m_discrete, space, CLOWNS_POP_MIDDLE_EN, (data >> 1) & 0x01);
19571955
1958   discrete_sound_w(device, space, CLOWNS_POP_TOP_EN, (data >> 2) & 0x01);
1956   discrete_sound_w(m_discrete, space, CLOWNS_POP_TOP_EN, (data >> 2) & 0x01);
19591957
1960   space.machine().sound().system_enable((data >> 3) & 0x01);
1958   machine().sound().system_enable((data >> 3) & 0x01);
19611959
1962   discrete_sound_w(device, space, CLOWNS_SPRINGBOARD_HIT_EN, (data >> 4) & 0x01);
1960   discrete_sound_w(m_discrete, space, CLOWNS_SPRINGBOARD_HIT_EN, (data >> 4) & 0x01);
19631961
1964   if (rising_bits & 0x20) state->m_samples->start(0, 0);  /* springboard miss */
1962   if (rising_bits & 0x20) m_samples->start(0, 0);  /* springboard miss */
19651963
19661964   /* D6 and D7 are not connected */
19671965
1968   state->m_port_2_last = data;
1966   m_port_2_last = data;
19691967}
19701968
19711969
r18185r18186
23022300   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
23032301MACHINE_CONFIG_END
23042302
2305WRITE8_DEVICE_HANDLER( spacwalk_audio_1_w )
2303WRITE8_MEMBER(mw8080bw_state::spacwalk_audio_1_w)
23062304{
2307   mw8080bw_state *state = space.machine().driver_data<mw8080bw_state>();
23082305
2309   coin_counter_w(space.machine(), 0, (data >> 0) & 0x01);
2306   coin_counter_w(machine(), 0, (data >> 0) & 0x01);
23102307
2311   state->m_clowns_controller_select = (data >> 1) & 0x01;
2308   m_clowns_controller_select = (data >> 1) & 0x01;
23122309
2313   space.machine().sound().system_enable((data >> 2) & 0x01);
2310   machine().sound().system_enable((data >> 2) & 0x01);
23142311
2315   discrete_sound_w(device, space, SPACWALK_SPACE_SHIP_EN, (data >> 3) & 0x01);
2312   discrete_sound_w(m_discrete, space, SPACWALK_SPACE_SHIP_EN, (data >> 3) & 0x01);
23162313}
23172314
2318WRITE8_DEVICE_HANDLER( spacwalk_audio_2_w )
2315WRITE8_MEMBER(mw8080bw_state::spacwalk_audio_2_w)
23192316{
2320   discrete_sound_w(device, space, SPACWALK_TARGET_HIT_BOTTOM_EN, (data >> 0) & 0x01);
2317   discrete_sound_w(m_discrete, space, SPACWALK_TARGET_HIT_BOTTOM_EN, (data >> 0) & 0x01);
23212318
2322   discrete_sound_w(device, space, SPACWALK_TARGET_HIT_MIDDLE_EN, (data >> 1) & 0x01);
2319   discrete_sound_w(m_discrete, space, SPACWALK_TARGET_HIT_MIDDLE_EN, (data >> 1) & 0x01);
23232320
2324   discrete_sound_w(device, space, SPACWALK_TARGET_HIT_TOP_EN, (data >> 2) & 0x01);
2321   discrete_sound_w(m_discrete, space, SPACWALK_TARGET_HIT_TOP_EN, (data >> 2) & 0x01);
23252322
2326   discrete_sound_w(device, space, SPACWALK_SPRINGBOARD_HIT1_EN, (data >> 3) & 0x01);
2323   discrete_sound_w(m_discrete, space, SPACWALK_SPRINGBOARD_HIT1_EN, (data >> 3) & 0x01);
23272324
2328   discrete_sound_w(device, space, SPACWALK_SPRINGBOARD_HIT2_EN, (data >> 4) & 0x01);
2325   discrete_sound_w(m_discrete, space, SPACWALK_SPRINGBOARD_HIT2_EN, (data >> 4) & 0x01);
23292326
2330   discrete_sound_w(device, space, SPACWALK_SPRINGBOARD_MISS_EN, (data >> 5) & 0x01);
2327   discrete_sound_w(m_discrete, space, SPACWALK_SPRINGBOARD_MISS_EN, (data >> 5) & 0x01);
23312328}
23322329
23332330
r18185r18186
25342531MACHINE_CONFIG_END
25352532
25362533
2537WRITE8_DEVICE_HANDLER( shuffle_audio_1_w )
2534WRITE8_MEMBER(mw8080bw_state::shuffle_audio_1_w)
25382535{
2539   discrete_sound_w(device, space, SHUFFLE_CLICK_EN, (data >> 0) & 0x01);
2536   discrete_sound_w(m_discrete, space, SHUFFLE_CLICK_EN, (data >> 0) & 0x01);
25402537
2541   discrete_sound_w(device, space, SHUFFLE_ROLLOVER_EN, (data >> 1) & 0x01);
2538   discrete_sound_w(m_discrete, space, SHUFFLE_ROLLOVER_EN, (data >> 1) & 0x01);
25422539
2543   space.machine().sound().system_enable((data >> 2) & 0x01);
2540   machine().sound().system_enable((data >> 2) & 0x01);
25442541
2545   discrete_sound_w(device, space, NODE_29, (data >> 3) & 0x07);
2542   discrete_sound_w(m_discrete, space, NODE_29, (data >> 3) & 0x07);
25462543
2547   discrete_sound_w(device, space, SHUFFLE_ROLLING_3_EN, (data >> 3) & 0x01);
2548   discrete_sound_w(device, space, SHUFFLE_ROLLING_2_EN, (data >> 4) & 0x01);
2549   discrete_sound_w(device, space, SHUFFLE_ROLLING_1_EN, (data >> 5) & 0x01);
2544   discrete_sound_w(m_discrete, space, SHUFFLE_ROLLING_3_EN, (data >> 3) & 0x01);
2545   discrete_sound_w(m_discrete, space, SHUFFLE_ROLLING_2_EN, (data >> 4) & 0x01);
2546   discrete_sound_w(m_discrete, space, SHUFFLE_ROLLING_1_EN, (data >> 5) & 0x01);
25502547
25512548   /* D6 and D7 are not connected */
25522549}
25532550
25542551
2555WRITE8_DEVICE_HANDLER( shuffle_audio_2_w )
2552WRITE8_MEMBER(mw8080bw_state::shuffle_audio_2_w)
25562553{
2557   discrete_sound_w(device, space, SHUFFLE_FOUL_EN, (data >> 0) & 0x01);
2554   discrete_sound_w(m_discrete, space, SHUFFLE_FOUL_EN, (data >> 0) & 0x01);
25582555
2559   coin_counter_w(space.machine(), 0, (data >> 1) & 0x01);
2556   coin_counter_w(machine(), 0, (data >> 1) & 0x01);
25602557
25612558   /* D2-D7 are not connected */
25622559}
r18185r18186
27142711MACHINE_CONFIG_END
27152712
27162713
2717WRITE8_DEVICE_HANDLER( dogpatch_audio_w )
2714WRITE8_MEMBER(mw8080bw_state::dogpatch_audio_w)
27182715{
27192716   /* D0, D1 and D7 are not used */
27202717
2721   coin_counter_w(space.machine(), 0, (data >> 2) & 0x01);
2718   coin_counter_w(machine(), 0, (data >> 2) & 0x01);
27222719
2723   space.machine().sound().system_enable((data >> 3) & 0x01);
2724   discrete_sound_w(device, space, DOGPATCH_GAME_ON_EN, (data >> 3) & 0x01);
2720   machine().sound().system_enable((data >> 3) & 0x01);
2721   discrete_sound_w(m_discrete, space, DOGPATCH_GAME_ON_EN, (data >> 3) & 0x01);
27252722
2726   discrete_sound_w(device, space, DOGPATCH_LEFT_SHOT_EN, (data >> 4) & 0x01);
2723   discrete_sound_w(m_discrete, space, DOGPATCH_LEFT_SHOT_EN, (data >> 4) & 0x01);
27272724
2728   discrete_sound_w(device, space, DOGPATCH_RIGHT_SHOT_EN, (data >> 5) & 0x01);
2725   discrete_sound_w(m_discrete, space, DOGPATCH_RIGHT_SHOT_EN, (data >> 5) & 0x01);
27292726
2730   discrete_sound_w(device, space, DOGPATCH_HIT_EN, (data >> 6) & 0x01);
2727   discrete_sound_w(m_discrete, space, DOGPATCH_HIT_EN, (data >> 6) & 0x01);
27312728}
27322729
27332730
r18185r18186
32523249
32533250
32543251
3255WRITE8_DEVICE_HANDLER( spcenctr_audio_1_w )
3252WRITE8_MEMBER(mw8080bw_state::spcenctr_audio_1_w)
32563253{
3257   space.machine().sound().system_enable((data >> 0) & 0x01);
3254   machine().sound().system_enable((data >> 0) & 0x01);
32583255
32593256   /* D1 is marked as 'OPTIONAL SWITCH VIDEO FOR COCKTAIL',
32603257       but it is never set by the software */
32613258
3262   discrete_sound_w(device, space, SPCENCTR_CRASH_EN, (data >> 2) & 0x01);
3259   discrete_sound_w(m_discrete, space, SPCENCTR_CRASH_EN, (data >> 2) & 0x01);
32633260
32643261   /* D3-D7 are not connected */
32653262}
32663263
32673264
3268WRITE8_DEVICE_HANDLER( spcenctr_audio_2_w )
3265WRITE8_MEMBER(mw8080bw_state::spcenctr_audio_2_w)
32693266{
3270   mw8080bw_state *state = space.machine().driver_data<mw8080bw_state>();
32713267
32723268   /* set WIND SOUND FREQ(data & 0x0f)  0, if no wind */
32733269
3274   discrete_sound_w(device, space, SPCENCTR_EXPLOSION_EN, (data >> 4) & 0x01);
3270   discrete_sound_w(m_discrete, space, SPCENCTR_EXPLOSION_EN, (data >> 4) & 0x01);
32753271
3276   discrete_sound_w(device, space, SPCENCTR_PLAYER_SHOT_EN, (data >> 5) & 0x01);
3272   discrete_sound_w(m_discrete, space, SPCENCTR_PLAYER_SHOT_EN, (data >> 5) & 0x01);
32773273
32783274   /* D6 and D7 are not connected */
32793275
3280   state->m_port_2_last = data;
3276   m_port_2_last = data;
32813277}
32823278
32833279
3284WRITE8_DEVICE_HANDLER( spcenctr_audio_3_w )
3280WRITE8_MEMBER(mw8080bw_state::spcenctr_audio_3_w)
32853281{
3286   mw8080bw_state *state = space.machine().driver_data<mw8080bw_state>();
32873282
32883283   /* if (data & 0x01)  enable SCREECH (hit the sides) sound */
32893284
3290   discrete_sound_w(device, space, SPCENCTR_ENEMY_SHIP_SHOT_EN, (data >> 1) & 0x01);
3285   discrete_sound_w(m_discrete, space, SPCENCTR_ENEMY_SHIP_SHOT_EN, (data >> 1) & 0x01);
32913286
3292   state->m_spcenctr_strobe_state = (data >> 2) & 0x01;
3287   m_spcenctr_strobe_state = (data >> 2) & 0x01;
32933288
32943289   output_set_value("LAMP", (data >> 3) & 0x01);
32953290
3296   discrete_sound_w(device, space, SPCENCTR_BONUS_EN, (data >> 4) & 0x01);
3291   discrete_sound_w(m_discrete, space, SPCENCTR_BONUS_EN, (data >> 4) & 0x01);
32973292
3298   sn76477_enable_w(state->m_sn, (data >> 5) & 0x01);   /* saucer sound */
3293   sn76477_enable_w(m_sn, (data >> 5) & 0x01);   /* saucer sound */
32993294
33003295   /* D6 and D7 are not connected */
33013296}
r18185r18186
34613456MACHINE_CONFIG_END
34623457
34633458
3464WRITE8_DEVICE_HANDLER( bowler_audio_1_w )
3459WRITE8_MEMBER(mw8080bw_state::bowler_audio_1_w)
34653460{
34663461   /* D0 - selects controller on the cocktail PCB */
34673462
3468   coin_counter_w(space.machine(), 0, (data >> 1) & 0x01);
3463   coin_counter_w(machine(), 0, (data >> 1) & 0x01);
34693464
3470   space.machine().sound().system_enable((data >> 2) & 0x01);
3465   machine().sound().system_enable((data >> 2) & 0x01);
34713466
3472   discrete_sound_w(device, space, BOWLER_FOWL_EN, (data >> 3) & 0x01);
3467   discrete_sound_w(m_discrete, space, BOWLER_FOWL_EN, (data >> 3) & 0x01);
34733468
34743469   /* D4 - appears to be a screen flip, but it's
34753470            shown unconnected on the schematics for both the
r18185r18186
41844179MACHINE_CONFIG_END
41854180
41864181
4187WRITE8_DEVICE_HANDLER( invaders_audio_1_w )
4182WRITE8_MEMBER(mw8080bw_state::invaders_audio_1_w)
41884183{
4189   mw8080bw_state *state = space.machine().driver_data<mw8080bw_state>();
41904184
4191   sn76477_enable_w(state->m_sn, (~data >> 0) & 0x01);   /* saucer sound */
4185   sn76477_enable_w(m_sn, (~data >> 0) & 0x01);   /* saucer sound */
41924186
4193   discrete_sound_w(device, space, INVADERS_NODE(INVADERS_MISSILE_EN, 1), data & 0x02);
4194   discrete_sound_w(device, space, INVADERS_NODE(INVADERS_EXPLOSION_EN, 1), data & 0x04);
4195   discrete_sound_w(device, space, INVADERS_NODE(INVADERS_INVADER_HIT_EN, 1), data & 0x08);
4196   discrete_sound_w(device, space, INVADERS_NODE(INVADERS_BONUS_MISSLE_BASE_EN, 1), data & 0x10);
4187   discrete_sound_w(m_discrete, space, INVADERS_NODE(INVADERS_MISSILE_EN, 1), data & 0x02);
4188   discrete_sound_w(m_discrete, space, INVADERS_NODE(INVADERS_EXPLOSION_EN, 1), data & 0x04);
4189   discrete_sound_w(m_discrete, space, INVADERS_NODE(INVADERS_INVADER_HIT_EN, 1), data & 0x08);
4190   discrete_sound_w(m_discrete, space, INVADERS_NODE(INVADERS_BONUS_MISSLE_BASE_EN, 1), data & 0x10);
41974191
4198   space.machine().sound().system_enable(data & 0x20);
4192   machine().sound().system_enable(data & 0x20);
41994193
42004194   /* D6 and D7 are not connected */
42014195}
42024196
42034197
4204WRITE8_DEVICE_HANDLER( invaders_audio_2_w )
4198WRITE8_MEMBER(mw8080bw_state::invaders_audio_2_w)
42054199{
4206   mw8080bw_state *state = space.machine().driver_data<mw8080bw_state>();
42074200
4208   discrete_sound_w(device, space, INVADERS_NODE(INVADERS_FLEET_DATA, 1), data & 0x0f);
4209   discrete_sound_w(device, space, INVADERS_NODE(INVADERS_SAUCER_HIT_EN, 1), data & 0x10);
4201   discrete_sound_w(m_discrete, space, INVADERS_NODE(INVADERS_FLEET_DATA, 1), data & 0x0f);
4202   discrete_sound_w(m_discrete, space, INVADERS_NODE(INVADERS_SAUCER_HIT_EN, 1), data & 0x10);
42104203
42114204   /* the flip screen line is only connected on the cocktail PCB */
4212   if (invaders_is_cabinet_cocktail(space.machine()))
4205   if (invaders_is_cabinet_cocktail(machine()))
42134206   {
4214      state->m_invaders_flip_screen = (data >> 5) & 0x01;
4207      m_invaders_flip_screen = (data >> 5) & 0x01;
42154208   }
42164209
42174210   /* D6 and D7 are not connected */
r18185r18186
45894582MACHINE_CONFIG_END
45904583
45914584
4592WRITE8_DEVICE_HANDLER( blueshrk_audio_w )
4585WRITE8_MEMBER(mw8080bw_state::blueshrk_audio_w)
45934586{
4594   discrete_sound_w(device, space, BLUESHRK_GAME_ON_EN, (data >> 0) & 0x01);
4587   discrete_sound_w(m_discrete, space, BLUESHRK_GAME_ON_EN, (data >> 0) & 0x01);
45954588
4596   discrete_sound_w(device, space, BLUESHRK_SHOT_EN, (data >> 1) & 0x01);
4589   discrete_sound_w(m_discrete, space, BLUESHRK_SHOT_EN, (data >> 1) & 0x01);
45974590
4598   discrete_sound_w(device, space, BLUESHRK_HIT_EN, (data >> 2) & 0x01);
4591   discrete_sound_w(m_discrete, space, BLUESHRK_HIT_EN, (data >> 2) & 0x01);
45994592
4600   discrete_sound_w(device, space, BLUESHRK_SHARK_EN, (data >> 3) & 0x01);
4593   discrete_sound_w(m_discrete, space, BLUESHRK_SHARK_EN, (data >> 3) & 0x01);
46014594
46024595   /* if (data & 0x10)  enable KILLED DIVER sound, this circuit
46034596       doesn't appear to be on the schematics */
46044597
4605   discrete_sound_w(device, space, BLUESHRK_OCTOPUS_EN, (data >> 5) & 0x01);
4598   discrete_sound_w(m_discrete, space, BLUESHRK_OCTOPUS_EN, (data >> 5) & 0x01);
46064599
46074600   /* D6 and D7 are not connected */
46084601}
r18185r18186
48174810MACHINE_CONFIG_END
48184811
48194812
4820WRITE8_DEVICE_HANDLER( invad2ct_audio_1_w )
4813WRITE8_MEMBER(mw8080bw_state::invad2ct_audio_1_w)
48214814{
4822   mw8080bw_state *state = space.machine().driver_data<mw8080bw_state>();
48234815
4824   sn76477_enable_w(state->m_sn1, (~data >> 0) & 0x01);   /* saucer sound */
4816   sn76477_enable_w(m_sn1, (~data >> 0) & 0x01);   /* saucer sound */
48254817
4826   discrete_sound_w(device, space, INVADERS_NODE(INVADERS_MISSILE_EN, 1), data & 0x02);
4827   discrete_sound_w(device, space, INVADERS_NODE(INVADERS_EXPLOSION_EN, 1), data & 0x04);
4828   discrete_sound_w(device, space, INVADERS_NODE(INVADERS_INVADER_HIT_EN, 1), data & 0x08);
4829   discrete_sound_w(device, space, INVADERS_NODE(INVADERS_BONUS_MISSLE_BASE_EN, 1), data & 0x10);
4818   discrete_sound_w(m_discrete, space, INVADERS_NODE(INVADERS_MISSILE_EN, 1), data & 0x02);
4819   discrete_sound_w(m_discrete, space, INVADERS_NODE(INVADERS_EXPLOSION_EN, 1), data & 0x04);
4820   discrete_sound_w(m_discrete, space, INVADERS_NODE(INVADERS_INVADER_HIT_EN, 1), data & 0x08);
4821   discrete_sound_w(m_discrete, space, INVADERS_NODE(INVADERS_BONUS_MISSLE_BASE_EN, 1), data & 0x10);
48304822
4831   space.machine().sound().system_enable(data & 0x20);
4823   machine().sound().system_enable(data & 0x20);
48324824
48334825   /* D6 and D7 are not connected */
48344826}
48354827
48364828
4837WRITE8_DEVICE_HANDLER( invad2ct_audio_2_w )
4829WRITE8_MEMBER(mw8080bw_state::invad2ct_audio_2_w)
48384830{
4839   discrete_sound_w(device, space, INVADERS_NODE(INVADERS_FLEET_DATA, 1), data & 0x0f);
4840   discrete_sound_w(device, space, INVADERS_NODE(INVADERS_SAUCER_HIT_EN, 1), data & 0x10);
4831   discrete_sound_w(m_discrete, space, INVADERS_NODE(INVADERS_FLEET_DATA, 1), data & 0x0f);
4832   discrete_sound_w(m_discrete, space, INVADERS_NODE(INVADERS_SAUCER_HIT_EN, 1), data & 0x10);
48414833
48424834   /* D5-D7 are not connected */
48434835}
48444836
48454837
4846WRITE8_DEVICE_HANDLER( invad2ct_audio_3_w )
4838WRITE8_MEMBER(mw8080bw_state::invad2ct_audio_3_w)
48474839{
4848   mw8080bw_state *state = space.machine().driver_data<mw8080bw_state>();
48494840
4850   sn76477_enable_w(state->m_sn2, (~data >> 0) & 0x01);   /* saucer sound */
4841   sn76477_enable_w(m_sn2, (~data >> 0) & 0x01);   /* saucer sound */
48514842
4852   discrete_sound_w(device, space, INVADERS_NODE(INVADERS_MISSILE_EN, 2), data & 0x02);
4853   discrete_sound_w(device, space, INVADERS_NODE(INVADERS_EXPLOSION_EN, 2), data & 0x04);
4854   discrete_sound_w(device, space, INVADERS_NODE(INVADERS_INVADER_HIT_EN, 2), data & 0x08);
4855   discrete_sound_w(device, space, INVADERS_NODE(INVADERS_BONUS_MISSLE_BASE_EN, 2), data & 0x10);
4843   discrete_sound_w(m_discrete, space, INVADERS_NODE(INVADERS_MISSILE_EN, 2), data & 0x02);
4844   discrete_sound_w(m_discrete, space, INVADERS_NODE(INVADERS_EXPLOSION_EN, 2), data & 0x04);
4845   discrete_sound_w(m_discrete, space, INVADERS_NODE(INVADERS_INVADER_HIT_EN, 2), data & 0x08);
4846   discrete_sound_w(m_discrete, space, INVADERS_NODE(INVADERS_BONUS_MISSLE_BASE_EN, 2), data & 0x10);
48564847
48574848   /* D5-D7 are not connected */
48584849}
48594850
48604851
4861WRITE8_DEVICE_HANDLER( invad2ct_audio_4_w )
4852WRITE8_MEMBER(mw8080bw_state::invad2ct_audio_4_w)
48624853{
4863   discrete_sound_w(device, space, INVADERS_NODE(INVADERS_FLEET_DATA, 2), data & 0x0f);
4864   discrete_sound_w(device, space, INVADERS_NODE(INVADERS_SAUCER_HIT_EN, 2), data & 0x10);
4854   discrete_sound_w(m_discrete, space, INVADERS_NODE(INVADERS_FLEET_DATA, 2), data & 0x0f);
4855   discrete_sound_w(m_discrete, space, INVADERS_NODE(INVADERS_SAUCER_HIT_EN, 2), data & 0x10);
48654856
48664857   /* D5-D7 are not connected */
48674858}
trunk/src/mame/audio/cchasm.c
r18185r18186
9696}
9797
9898
99static WRITE_LINE_DEVICE_HANDLER( ctc_timer_1_w )
99WRITE_LINE_MEMBER(cchasm_state::ctc_timer_1_w)
100100{
101   cchasm_state *drvstate = device->machine().driver_data<cchasm_state>();
102101   if (state) /* rising edge */
103102   {
104      drvstate->m_output[0] ^= 0x7f;
105      drvstate->m_channel_active[0] = 1;
106      device->machine().device<dac_device>("dac1")->write_unsigned8(drvstate->m_output[0]);
103      m_output[0] ^= 0x7f;
104      m_channel_active[0] = 1;
105      machine().device<dac_device>("dac1")->write_unsigned8(m_output[0]);
107106   }
108107}
109108
110static WRITE_LINE_DEVICE_HANDLER( ctc_timer_2_w )
109WRITE_LINE_MEMBER(cchasm_state::ctc_timer_2_w)
111110{
112   cchasm_state *drvstate = device->machine().driver_data<cchasm_state>();
113111   if (state) /* rising edge */
114112   {
115      drvstate->m_output[1] ^= 0x7f;
116      drvstate->m_channel_active[1] = 1;
117      device->machine().device<dac_device>("dac2")->write_unsigned8(drvstate->m_output[0]);
113      m_output[1] ^= 0x7f;
114      m_channel_active[1] = 1;
115      machine().device<dac_device>("dac2")->write_unsigned8(m_output[0]);
118116   }
119117}
120118
r18185r18186
122120{
123121   DEVCB_CPU_INPUT_LINE("audiocpu", INPUT_LINE_IRQ0),   /* interrupt handler */
124122   DEVCB_NULL,               /* ZC/TO0 callback */
125   DEVCB_LINE(ctc_timer_1_w),   /* ZC/TO1 callback */
126   DEVCB_LINE(ctc_timer_2_w)   /* ZC/TO2 callback */
123   DEVCB_DRIVER_LINE_MEMBER(cchasm_state,ctc_timer_1_w),   /* ZC/TO1 callback */
124   DEVCB_DRIVER_LINE_MEMBER(cchasm_state,ctc_timer_2_w)   /* ZC/TO2 callback */
127125};
128126
129127SOUND_START( cchasm )
trunk/src/mame/audio/dkong.c
r18185r18186
12121212
12131213*/
12141214
1215static WRITE8_DEVICE_HANDLER( M58817_command_w )
1215WRITE8_MEMBER(dkong_state::M58817_command_w)
12161216{
1217   device_t *device = machine().device("tms");
12171218   tms5110_ctl_w(device, space, 0, data & 0x0f);
12181219   tms5110_pdc_w(device, (data>>4) & 0x01);
12191220   /* FIXME 0x20 is CS */
r18185r18186
12341235   logerror("dkong_speech_w: 0x%02x\n", data);
12351236}
12361237
1237static DECLARE_READ8_DEVICE_HANDLER( dkong_voice_status_r );
1238static READ8_DEVICE_HANDLER( dkong_voice_status_r )
1238READ8_MEMBER(dkong_state::dkong_voice_status_r)
12391239{
12401240   /* only provided for documentation purposes
12411241     * not actually used
r18185r18186
12431243   return 0;
12441244}
12451245
1246static READ8_DEVICE_HANDLER( dkong_tune_r )
1246READ8_MEMBER(dkong_state::dkong_tune_r)
12471247{
1248   dkong_state *state = space.machine().driver_data<dkong_state>();
1249   UINT8 page = latch8_r(state->m_dev_vp2, space, 0) & 0x47;
1248   device_t *device = machine().device("ls175.3d");
1249   UINT8 page = latch8_r(m_dev_vp2, space, 0) & 0x47;
12501250
12511251   if ( page & 0x40 )
12521252   {
1253      return (latch8_r(device, space, 0) & 0x0F) | (dkong_voice_status_r(device, space, 0) << 4);
1253      return (latch8_r(device, space, 0) & 0x0F) | (dkong_voice_status_r(space, 0) << 4);
12541254   }
12551255   else
12561256   {
1257      /* printf("%s:rom access\n",space.machine().describe_context()); */
1258      return (state->m_snd_rom[0x1000 + (page & 7) * 256 + offset]);
1257      /* printf("%s:rom access\n",machine().describe_context()); */
1258      return (m_snd_rom[0x1000 + (page & 7) * 256 + offset]);
12591259   }
12601260}
12611261
1262static WRITE8_DEVICE_HANDLER( dkong_p1_w )
1262WRITE8_MEMBER(dkong_state::dkong_p1_w)
12631263{
1264   discrete_sound_w(device,space,DS_DAC,data);
1264   discrete_sound_w(m_discrete,space,DS_DAC,data);
12651265}
12661266
12671267
r18185r18186
12911291ADDRESS_MAP_END
12921292
12931293static ADDRESS_MAP_START( dkong_sound_io_map, AS_IO, 8, dkong_state )
1294   AM_RANGE(0x00, 0xFF) AM_DEVREAD_LEGACY("ls175.3d", dkong_tune_r)
1294   AM_RANGE(0x00, 0xFF) AM_READ(dkong_tune_r)
12951295                   AM_WRITE(dkong_voice_w)
1296   AM_RANGE(MCS48_PORT_BUS, MCS48_PORT_BUS) AM_DEVREAD_LEGACY("ls175.3d", dkong_tune_r)
1296   AM_RANGE(MCS48_PORT_BUS, MCS48_PORT_BUS) AM_READ(dkong_tune_r)
12971297                           AM_WRITE(dkong_voice_w)
1298   AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_DEVWRITE_LEGACY("discrete", dkong_p1_w) /* only write to dac */
1298   AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_WRITE(dkong_p1_w) /* only write to dac */
12991299   AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_LATCH8_READWRITE("virtual_p2")
13001300   AM_RANGE(MCS48_PORT_T0, MCS48_PORT_T0) AM_LATCH8_READBIT("ls259.6h", 5)
13011301   AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_LATCH8_READBIT("ls259.6h", 4)
r18185r18186
13031303
13041304static ADDRESS_MAP_START( dkongjr_sound_io_map, AS_IO, 8, dkong_state )
13051305   AM_RANGE(0x00, 0x00) AM_MIRROR(0xff) AM_LATCH8_READ("ls174.3d")
1306   AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_DEVWRITE_LEGACY("discrete", dkong_p1_w) /* only write to dac */
1306   AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_WRITE(dkong_p1_w) /* only write to dac */
13071307   AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_LATCH8_READWRITE("virtual_p2")
13081308   AM_RANGE(MCS48_PORT_T0, MCS48_PORT_T0) AM_LATCH8_READBIT("ls259.6h", 5)
13091309   AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_LATCH8_READBIT("ls259.6h", 4)
r18185r18186
13111311
13121312static ADDRESS_MAP_START( radarscp1_sound_io_map, AS_IO, 8, dkong_state )
13131313   AM_RANGE(0x00, 0x00) AM_MIRROR(0xff) AM_DEVREAD_LEGACY("ls175.3d", latch8_r)
1314   AM_RANGE(0x00, 0xff) AM_DEVWRITE_LEGACY("discrete", dkong_p1_w) /* DAC here */
1314   AM_RANGE(0x00, 0xff) AM_WRITE(dkong_p1_w) /* DAC here */
13151315   AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_LATCH8_READ("virtual_p1")
1316                         AM_DEVWRITE_LEGACY("tms", M58817_command_w)
1316                         AM_WRITE(M58817_command_w)
13171317   AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_LATCH8_WRITE("virtual_p2")
13181318   AM_RANGE(MCS48_PORT_T0, MCS48_PORT_T0) AM_LATCH8_READBIT("ls259.6h", 5)
13191319   AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_LATCH8_READBIT("ls259.6h", 4)
trunk/src/mame/audio/firetrk.c
r18185r18186
99#include "sound/discrete.h"
1010
1111
12WRITE8_DEVICE_HANDLER( firetrk_skid_reset_w )
12WRITE8_MEMBER(firetrk_state::firetrk_skid_reset_w)
1313{
14   firetrk_state *state = space.machine().driver_data<firetrk_state>();
15   state->m_skid[0] = 0;
16   state->m_skid[1] = 0;
14   m_skid[0] = 0;
15   m_skid[1] = 0;
1716
1817   // also SUPERBUG_SKID_EN
19   discrete_sound_w(device, space, FIRETRUCK_SKID_EN, 1);
18   discrete_sound_w(m_discrete, space, FIRETRUCK_SKID_EN, 1);
2019}
2120
2221
23WRITE8_DEVICE_HANDLER( montecar_skid_reset_w )
22WRITE8_MEMBER(firetrk_state::montecar_skid_reset_w)
2423{
25   discrete_sound_w(device, space, MONTECAR_SKID_EN, 1);
24   discrete_sound_w(m_discrete, space, MONTECAR_SKID_EN, 1);
2625}
2726
2827
29WRITE8_DEVICE_HANDLER( firetrk_crash_snd_w )
28WRITE8_MEMBER(firetrk_state::firetrk_crash_snd_w)
3029{
3130   // also SUPERBUG_CRASH_DATA and MONTECAR_CRASH_DATA
32   discrete_sound_w(device, space, FIRETRUCK_CRASH_DATA, data >> 4);
31   discrete_sound_w(m_discrete, space, FIRETRUCK_CRASH_DATA, data >> 4);
3332}
3433
3534
36WRITE8_DEVICE_HANDLER( firetrk_skid_snd_w )
35WRITE8_MEMBER(firetrk_state::firetrk_skid_snd_w)
3736{
3837   // also SUPERBUG_SKID_EN and MONTECAR_SKID_EN
39   discrete_sound_w(device, space, FIRETRUCK_SKID_EN, 0);
38   discrete_sound_w(m_discrete, space, FIRETRUCK_SKID_EN, 0);
4039}
4140
4241
43WRITE8_DEVICE_HANDLER( firetrk_motor_snd_w )
42WRITE8_MEMBER(firetrk_state::firetrk_motor_snd_w)
4443{
4544   // also MONTECAR_DRONE_MOTOR_DATA
46   discrete_sound_w(device, space, FIRETRUCK_SIREN_DATA, data >> 4);
45   discrete_sound_w(m_discrete, space, FIRETRUCK_SIREN_DATA, data >> 4);
4746
4847   // also MONTECAR_MOTOR_DATA
49   discrete_sound_w(device, space, FIRETRUCK_MOTOR_DATA, data & 0x0f);
48   discrete_sound_w(m_discrete, space, FIRETRUCK_MOTOR_DATA, data & 0x0f);
5049}
5150
5251
53WRITE8_DEVICE_HANDLER( superbug_motor_snd_w )
52WRITE8_MEMBER(firetrk_state::superbug_motor_snd_w)
5453{
55   discrete_sound_w(device, space, SUPERBUG_SPEED_DATA, data & 0x0f);
54   discrete_sound_w(m_discrete, space, SUPERBUG_SPEED_DATA, data & 0x0f);
5655}
5756
5857
59WRITE8_DEVICE_HANDLER( firetrk_xtndply_w )
58WRITE8_MEMBER(firetrk_state::firetrk_xtndply_w)
6059{
6160   // also SUPERBUG_ASR_EN (extended play)
62   discrete_sound_w(device, space, FIRETRUCK_XTNDPLY_EN, data);
61   discrete_sound_w(m_discrete, space, FIRETRUCK_XTNDPLY_EN, data);
6362}
6463
6564
trunk/src/mame/audio/avalnche.c
r18185r18186
2020  Avalanche memory audio output handlers
2121***************************************************************************/
2222
23WRITE8_DEVICE_HANDLER( avalnche_noise_amplitude_w )
23WRITE8_MEMBER(avalnche_state::avalnche_noise_amplitude_w)
2424{
25   discrete_sound_w(device, space, AVALNCHE_SOUNDLVL_DATA, data & 0x3f);
25   discrete_sound_w(m_discrete, space, AVALNCHE_SOUNDLVL_DATA, data & 0x3f);
2626}
2727
28WRITE8_DEVICE_HANDLER( avalnche_attract_enable_w )
28WRITE8_MEMBER(avalnche_state::avalnche_attract_enable_w)
2929{
30   discrete_sound_w(device, space, AVALNCHE_ATTRACT_EN, data & 0x01);
30   discrete_sound_w(m_discrete, space, AVALNCHE_ATTRACT_EN, data & 0x01);
3131}
3232
33WRITE8_DEVICE_HANDLER( avalnche_audio_w )
33WRITE8_MEMBER(avalnche_state::avalnche_audio_w)
3434{
3535   int bit = data & 0x01;
3636
3737   switch (offset & 0x07)
3838   {
3939   case 0x00:      /* AUD0 */
40      discrete_sound_w(device, space, AVALNCHE_AUD0_EN, bit);
40      discrete_sound_w(m_discrete, space, AVALNCHE_AUD0_EN, bit);
4141      break;
4242
4343   case 0x01:      /* AUD1 */
44      discrete_sound_w(device, space, AVALNCHE_AUD1_EN, bit);
44      discrete_sound_w(m_discrete, space, AVALNCHE_AUD1_EN, bit);
4545      break;
4646
4747   case 0x02:      /* AUD2 */
4848   default:
49      discrete_sound_w(device, space, AVALNCHE_AUD2_EN, bit);
49      discrete_sound_w(m_discrete, space, AVALNCHE_AUD2_EN, bit);
5050      break;
5151   }
5252}
r18185r18186
128128  Catch memory audio output handlers
129129***************************************************************************/
130130
131WRITE8_HANDLER( catch_audio_w )
131WRITE8_MEMBER(avalnche_state::catch_audio_w)
132132{
133133   /* Different from avalnche, it plays a sound (offset 0/1/2) on data bit 0 rising edge.
134134    There's no indication that the game silences sound, it's probably done automatically. */
trunk/src/mame/audio/canyon.c
r18185r18186
1414 *
1515 *************************************/
1616
17WRITE8_DEVICE_HANDLER( canyon_motor_w )
17WRITE8_MEMBER(canyon_state::canyon_motor_w)
1818{
19   discrete_sound_w(device, space, NODE_RELATIVE(CANYON_MOTOR1_DATA, (offset & 0x01)), data & 0x0f);
19   discrete_sound_w(m_discrete, space, NODE_RELATIVE(CANYON_MOTOR1_DATA, (offset & 0x01)), data & 0x0f);
2020}
2121
2222
23WRITE8_DEVICE_HANDLER( canyon_explode_w )
23WRITE8_MEMBER(canyon_state::canyon_explode_w)
2424{
25   discrete_sound_w(device, space, CANYON_EXPLODE_DATA, data >> 4);
25   discrete_sound_w(m_discrete, space, CANYON_EXPLODE_DATA, data >> 4);
2626}
2727
2828
29WRITE8_DEVICE_HANDLER( canyon_attract_w )
29WRITE8_MEMBER(canyon_state::canyon_attract_w)
3030{
31   discrete_sound_w(device, space, NODE_RELATIVE(CANYON_ATTRACT1_EN, (offset & 0x01)), offset & 0x02);
31   discrete_sound_w(m_discrete, space, NODE_RELATIVE(CANYON_ATTRACT1_EN, (offset & 0x01)), offset & 0x02);
3232}
3333
3434
35WRITE8_DEVICE_HANDLER( canyon_whistle_w )
35WRITE8_MEMBER(canyon_state::canyon_whistle_w)
3636{
37   discrete_sound_w(device, space, NODE_RELATIVE(CANYON_WHISTLE1_EN, (offset & 0x01)), offset & 0x02);
37   discrete_sound_w(m_discrete, space, NODE_RELATIVE(CANYON_WHISTLE1_EN, (offset & 0x01)), offset & 0x02);
3838}
3939
4040
trunk/src/mame/audio/zaxxon.c
r18185r18186
110110 *
111111 *************************************/
112112
113WRITE8_DEVICE_HANDLER( zaxxon_sound_a_w )
113WRITE8_MEMBER(zaxxon_state::zaxxon_sound_a_w)
114114{
115   zaxxon_state *state = space.machine().driver_data<zaxxon_state>();
116   samples_device *samples = space.machine().device<samples_device>("samples");
117   UINT8 diff = data ^ state->m_sound_state[0];
118   state->m_sound_state[0] = data;
115   samples_device *samples = machine().device<samples_device>("samples");
116   UINT8 diff = data ^ m_sound_state[0];
117   m_sound_state[0] = data;
119118
120119   /* PLAYER SHIP A/B: volume */
121120   samples->set_volume(10, 0.5 + 0.157 * (data & 0x03));
r18185r18186
146145}
147146
148147
149WRITE8_DEVICE_HANDLER( zaxxon_sound_b_w )
148WRITE8_MEMBER(zaxxon_state::zaxxon_sound_b_w)
150149{
151   zaxxon_state *state = space.machine().driver_data<zaxxon_state>();
152   samples_device *samples = space.machine().device<samples_device>("samples");
153   UINT8 diff = data ^ state->m_sound_state[1];
154   state->m_sound_state[1] = data;
150   samples_device *samples = machine().device<samples_device>("samples");
151   UINT8 diff = data ^ m_sound_state[1];
152   m_sound_state[1] = data;
155153
156154   /* S-EXP: channel 4 */
157155   if ((diff & 0x10) && !(data & 0x10)) samples->start(4, 4);
r18185r18186
164162}
165163
166164
167WRITE8_DEVICE_HANDLER( zaxxon_sound_c_w )
165WRITE8_MEMBER(zaxxon_state::zaxxon_sound_c_w)
168166{
169   zaxxon_state *state = space.machine().driver_data<zaxxon_state>();
170   samples_device *samples = space.machine().device<samples_device>("samples");
171   UINT8 diff = data ^ state->m_sound_state[2];
172   state->m_sound_state[2] = data;
167   samples_device *samples = machine().device<samples_device>("samples");
168   UINT8 diff = data ^ m_sound_state[2];
169   m_sound_state[2] = data;
173170
174171   /* SHOT: channel 7 */
175172   if ((diff & 0x01) && !(data & 0x01)) samples->start(7, 7);
r18185r18186
221218 *
222219 *************************************/
223220
224WRITE8_DEVICE_HANDLER( congo_sound_b_w )
221WRITE8_MEMBER(zaxxon_state::congo_sound_b_w)
225222{
226   zaxxon_state *state = space.machine().driver_data<zaxxon_state>();
227   samples_device *samples = space.machine().device<samples_device>("samples");
228   UINT8 diff = data ^ state->m_sound_state[1];
229   state->m_sound_state[1] = data;
223   samples_device *samples = machine().device<samples_device>("samples");
224   UINT8 diff = data ^ m_sound_state[1];
225   m_sound_state[1] = data;
230226
231227   /* bit 7 = mute */
232228
r18185r18186
235231}
236232
237233
238WRITE8_DEVICE_HANDLER( congo_sound_c_w )
234WRITE8_MEMBER(zaxxon_state::congo_sound_c_w)
239235{
240   zaxxon_state *state = space.machine().driver_data<zaxxon_state>();
241   samples_device *samples = space.machine().device<samples_device>("samples");
242   UINT8 diff = data ^ state->m_sound_state[2];
243   state->m_sound_state[2] = data;
236   samples_device *samples = machine().device<samples_device>("samples");
237   UINT8 diff = data ^ m_sound_state[2];
238   m_sound_state[2] = data;
244239
245240   /* BASS DRUM: channel 1 */
246241   if ((diff & 0x01) && !(data & 0x01)) samples->start(1, 1);
trunk/src/mame/audio/mario.c
r18185r18186
492492      return (SND[(0x1000 + (p2 & 0x0f) * 256 + offset) & mask]);
493493}
494494
495static WRITE8_DEVICE_HANDLER( mario_sh_sound_w )
495WRITE8_MEMBER(mario_state::mario_sh_sound_w)
496496{
497   discrete_sound_w(device, space, DS_DAC, data);
497   discrete_sound_w(m_discrete, space, DS_DAC, data);
498498}
499499
500500WRITE8_MEMBER(mario_state::mario_sh_p1_w)
r18185r18186
534534/* Sound 0 and 1 are pulsed !*/
535535
536536/* Mario running sample */
537WRITE8_DEVICE_HANDLER( mario_sh1_w )
537WRITE8_MEMBER(mario_state::mario_sh1_w)
538538{
539   discrete_sound_w(device, space, DS_SOUND0_INP, 0);
539   discrete_sound_w(m_discrete, space, DS_SOUND0_INP, 0);
540540}
541541
542542/* Luigi running sample */
543WRITE8_DEVICE_HANDLER( mario_sh2_w )
543WRITE8_MEMBER(mario_state::mario_sh2_w)
544544{
545   discrete_sound_w(device, space, DS_SOUND1_INP, 0);
545   discrete_sound_w(m_discrete, space, DS_SOUND1_INP, 0);
546546}
547547
548548/* Misc samples */
r18185r18186
593593ADDRESS_MAP_END
594594
595595static ADDRESS_MAP_START( mario_sound_io_map, AS_IO, 8, mario_state )
596   AM_RANGE(0x00, 0xff) AM_READ(mario_sh_tune_r) AM_DEVWRITE_LEGACY("discrete", mario_sh_sound_w)
596   AM_RANGE(0x00, 0xff) AM_READ(mario_sh_tune_r) AM_WRITE(mario_sh_sound_w)
597597   AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_READWRITE(mario_sh_p1_r, mario_sh_p1_w)
598598   AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_READWRITE(mario_sh_p2_r, mario_sh_p2_w)
599599   AM_RANGE(MCS48_PORT_T0, MCS48_PORT_T0) AM_READ(mario_sh_t0_r)
trunk/src/mame/audio/asteroid.c
r18185r18186
278278DISCRETE_SOUND_END
279279
280280
281WRITE8_DEVICE_HANDLER( asteroid_explode_w )
281WRITE8_MEMBER(asteroid_state::asteroid_explode_w)
282282{
283   discrete_sound_w(device,space,ASTEROID_EXPLODE_DATA,(data&0x3c)>>2);            // Volume
283   discrete_sound_w(m_discrete,space,ASTEROID_EXPLODE_DATA,(data&0x3c)>>2);            // Volume
284284   /* We will modify the pitch data to send the divider value. */
285285   switch ((data&0xc0))
286286   {
r18185r18186
297297         data = 5;
298298         break;
299299   }
300   discrete_sound_w(device, space, ASTEROID_EXPLODE_PITCH, data);
300   discrete_sound_w(m_discrete, space, ASTEROID_EXPLODE_PITCH, data);
301301}
302302
303WRITE8_DEVICE_HANDLER( asteroid_thump_w )
303WRITE8_MEMBER(asteroid_state::asteroid_thump_w)
304304{
305   discrete_sound_w(device, space, ASTEROID_THUMP_EN,   data & 0x10);
306   discrete_sound_w(device, space, ASTEROID_THUMP_DATA, data & 0x0f);
305   discrete_sound_w(m_discrete, space, ASTEROID_THUMP_EN,   data & 0x10);
306   discrete_sound_w(m_discrete, space, ASTEROID_THUMP_DATA, data & 0x0f);
307307}
308308
309WRITE8_DEVICE_HANDLER( asteroid_sounds_w )
309WRITE8_MEMBER(asteroid_state::asteroid_sounds_w)
310310{
311   discrete_sound_w(device, space, NODE_RELATIVE(ASTEROID_SAUCER_SND_EN, offset), data & 0x80);
311   discrete_sound_w(m_discrete, space, NODE_RELATIVE(ASTEROID_SAUCER_SND_EN, offset), data & 0x80);
312312}
313313
314WRITE8_DEVICE_HANDLER( astdelux_sounds_w )
314WRITE8_MEMBER(asteroid_state::astdelux_sounds_w)
315315{
316316   /* Only ever activates the thrusters in Astdelux */
317   discrete_sound_w(device, space, ASTEROID_THRUST_EN, data & 0x80);
317   discrete_sound_w(m_discrete, space, ASTEROID_THRUST_EN, data & 0x80);
318318}
319319
320WRITE8_DEVICE_HANDLER( asteroid_noise_reset_w )
320WRITE8_MEMBER(asteroid_state::asteroid_noise_reset_w)
321321{
322   discrete_sound_w(device, space, ASTEROID_NOISE_RESET, 0);
322   discrete_sound_w(m_discrete, space, ASTEROID_NOISE_RESET, 0);
323323}
trunk/src/mame/audio/copsnrob.c
r18185r18186
688688
689689WRITE8_MEMBER(copsnrob_state::copsnrob_misc_w)
690690{
691   device_t *device = machine().device("discrete");
692691   UINT8 latched_data = m_ic_h3_data;
693692   UINT8 special_data = data & 0x01;
694693
r18185r18186
704703   switch (offset)
705704   {
706705      case 0x00:
707         discrete_sound_w(device, space, COPSNROB_MOTOR3_INV, special_data);
706         discrete_sound_w(m_discrete, space, COPSNROB_MOTOR3_INV, special_data);
708707         break;
709708
710709      case 0x01:
711         discrete_sound_w(device, space, COPSNROB_MOTOR2_INV, special_data);
710         discrete_sound_w(m_discrete, space, COPSNROB_MOTOR2_INV, special_data);
712711         break;
713712
714713      case 0x02:
715         discrete_sound_w(device, space, COPSNROB_MOTOR1_INV, special_data);
714         discrete_sound_w(m_discrete, space, COPSNROB_MOTOR1_INV, special_data);
716715         break;
717716
718717      case 0x03:
719         discrete_sound_w(device, space, COPSNROB_MOTOR0_INV, special_data);
718         discrete_sound_w(m_discrete, space, COPSNROB_MOTOR0_INV, special_data);
720719         break;
721720
722721      case 0x04:
723         discrete_sound_w(device, space, COPSNROB_SCREECH_INV, special_data);
722         discrete_sound_w(m_discrete, space, COPSNROB_SCREECH_INV, special_data);
724723         break;
725724
726725      case 0x05:
727         discrete_sound_w(device, space, COPSNROB_CRASH_INV, special_data);
726         discrete_sound_w(m_discrete, space, COPSNROB_CRASH_INV, special_data);
728727         break;
729728
730729      case 0x06:
r18185r18186
733732         break;
734733
735734      case 0x07:
736         discrete_sound_w(device, space, COPSNROB_AUDIO_ENABLE, special_data);
735         discrete_sound_w(m_discrete, space, COPSNROB_AUDIO_ENABLE, special_data);
737736         //machine().sound().system_mute(special_data);
738737         break;
739738
trunk/src/mame/audio/suna8.c
r18185r18186
1111#include "includes/suna8.h"
1212
1313
14WRITE8_DEVICE_HANDLER( suna8_play_samples_w )
14WRITE8_MEMBER(suna8_state::suna8_play_samples_w)
1515{
16   suna8_state *state = space.machine().driver_data<suna8_state>();
1716   if( data )
1817   {
19      samples_device *samples = downcast<samples_device *>(device);
18      samples_device *samples = downcast<samples_device *>(machine().device("samples"));
2019      if( ~data & 0x10 )
2120      {
22         samples->start_raw(0, &state->m_samplebuf[0x800*state->m_sample], 0x0800, 4000);
21         samples->start_raw(0, &m_samplebuf[0x800*m_sample], 0x0800, 4000);
2322      }
2423      else if( ~data & 0x08 )
2524      {
26         state->m_sample &= 3;
27         samples->start_raw(0, &state->m_samplebuf[0x800*(state->m_sample+7)], 0x0800, 4000);
25         m_sample &= 3;
26         samples->start_raw(0, &m_samplebuf[0x800*(m_sample+7)], 0x0800, 4000);
2827      }
2928   }
3029}
3130
32WRITE8_DEVICE_HANDLER( rranger_play_samples_w )
31WRITE8_MEMBER(suna8_state::rranger_play_samples_w)
3332{
34   suna8_state *state = space.machine().driver_data<suna8_state>();
3533   if( data )
3634   {
37      if(( state->m_sample != 0 ) && ( ~data & 0x30 ))   // don't play state->m_sample zero when the bit is active
35      if(( m_sample != 0 ) && ( ~data & 0x30 ))   // don't play m_sample zero when the bit is active
3836      {
39         samples_device *samples = downcast<samples_device *>(device);
40         samples->start_raw(0, &state->m_samplebuf[0x800*state->m_sample], 0x0800, 4000);
37         samples_device *samples = downcast<samples_device *>(machine().device("samples"));
38         samples->start_raw(0, &m_samplebuf[0x800*m_sample], 0x0800, 4000);
4139      }
4240   }
4341}
4442
45WRITE8_DEVICE_HANDLER( suna8_samples_number_w )
43WRITE8_MEMBER(suna8_state::suna8_samples_number_w)
4644{
47   suna8_state *state = space.machine().driver_data<suna8_state>();
48   state->m_sample = data & 0xf;
45   m_sample = data & 0xf;
4946}
5047
5148SAMPLES_START( suna8_sh_start )
trunk/src/mame/audio/poolshrk.c
r18185r18186
155155 *
156156 *************************************/
157157
158WRITE8_DEVICE_HANDLER( poolshrk_scratch_sound_w )
158WRITE8_MEMBER(poolshrk_state::poolshrk_scratch_sound_w)
159159{
160   discrete_sound_w(device, space, POOLSHRK_SCRATCH_SND, offset & 1);
160   discrete_sound_w(m_discrete, space, POOLSHRK_SCRATCH_SND, offset & 1);
161161}
162162
163WRITE8_DEVICE_HANDLER( poolshrk_score_sound_w )
163WRITE8_MEMBER(poolshrk_state::poolshrk_score_sound_w)
164164{
165   discrete_sound_w(device, space, POOLSHRK_SCORE_EN, 1); /* this will trigger the sound code for 1 sample */
165   discrete_sound_w(m_discrete, space, POOLSHRK_SCORE_EN, 1); /* this will trigger the sound code for 1 sample */
166166}
167167
168WRITE8_DEVICE_HANDLER( poolshrk_click_sound_w )
168WRITE8_MEMBER(poolshrk_state::poolshrk_click_sound_w)
169169{
170   discrete_sound_w(device, space, POOLSHRK_CLICK_EN, 1); /* this will trigger the sound code for 1 sample */
170   discrete_sound_w(m_discrete, space, POOLSHRK_CLICK_EN, 1); /* this will trigger the sound code for 1 sample */
171171}
172172
173WRITE8_DEVICE_HANDLER( poolshrk_bump_sound_w )
173WRITE8_MEMBER(poolshrk_state::poolshrk_bump_sound_w)
174174{
175   discrete_sound_w(device, space, POOLSHRK_BUMP_EN, offset & 1);
175   discrete_sound_w(m_discrete, space, POOLSHRK_BUMP_EN, offset & 1);
176176}
trunk/src/mame/audio/qix.c
r18185r18186
1818#define QIX_VOL_DATA_R      NODE_04
1919
2020
21static WRITE_LINE_DEVICE_HANDLER( qix_pia_dint );
22static WRITE_LINE_DEVICE_HANDLER( qix_pia_sint );
2321
2422
23
24
2525/***************************************************************************
2626Audio handlers
2727***************************************************************************/
2828
29static WRITE8_DEVICE_HANDLER( qix_dac_w )
29WRITE8_MEMBER(qix_state::qix_dac_w)
3030{
31   discrete_sound_w(device, space, QIX_DAC_DATA, data);
31   discrete_sound_w(m_discrete, space, QIX_DAC_DATA, data);
3232}
3333
34static WRITE8_DEVICE_HANDLER( qix_vol_w )
34WRITE8_MEMBER(qix_state::qix_vol_w)
3535{
36   discrete_sound_w(device, space, QIX_VOL_DATA, data);
36   discrete_sound_w(m_discrete, space, QIX_VOL_DATA, data);
3737}
3838
3939
r18185r18186
9393 *
9494 *************************************/
9595
96static WRITE8_DEVICE_HANDLER( sndpia_2_warning_w )
96WRITE8_MEMBER(qix_state::sndpia_2_warning_w)
9797{
9898   popmessage("PIA 5 write!!");
9999}
r18185r18186
106106}
107107
108108
109static WRITE8_DEVICE_HANDLER( sync_sndpia1_porta_w )
109WRITE8_MEMBER(qix_state::sync_sndpia1_porta_w)
110110{
111   device_t *device = machine().device("sndpia1");
111112   /* we need to synchronize this so the sound CPU doesn't drop anything important */
112   space.machine().scheduler().synchronize(FUNC(deferred_sndpia1_porta_w), data, (void *)downcast<pia6821_device *>(device));
113   machine().scheduler().synchronize(FUNC(deferred_sndpia1_porta_w), data, (void *)downcast<pia6821_device *>(device));
113114}
114115
115116
116static WRITE8_DEVICE_HANDLER( slither_coinctl_w )
117WRITE8_MEMBER(qix_state::slither_coinctl_w)
117118{
118   coin_lockout_w(space.machine(), 0, (~data >> 6) & 1);
119   coin_counter_w(space.machine(), 0, (data >> 5) & 1);
119   coin_lockout_w(machine(), 0, (~data >> 6) & 1);
120   coin_counter_w(machine(), 0, (data >> 5) & 1);
120121}
121122
122123
r18185r18186
127128 *
128129 *************************************/
129130
130static WRITE_LINE_DEVICE_HANDLER( qix_pia_dint )
131WRITE_LINE_MEMBER(qix_state::qix_pia_dint)
131132{
132   pia6821_device *pia = downcast<pia6821_device *>(device);
133   pia6821_device *pia = downcast<pia6821_device *>(machine().device("sndpia0"));
133134   int combined_state = pia->irq_a_state() | pia->irq_b_state();
134135
135136   /* DINT is connected to the data CPU's IRQ line */
136   device->machine().device("maincpu")->execute().set_input_line(M6809_IRQ_LINE, combined_state ? ASSERT_LINE : CLEAR_LINE);
137   machine().device("maincpu")->execute().set_input_line(M6809_IRQ_LINE, combined_state ? ASSERT_LINE : CLEAR_LINE);
137138}
138139
139140
140static WRITE_LINE_DEVICE_HANDLER( qix_pia_sint )
141WRITE_LINE_MEMBER(qix_state::qix_pia_sint)
141142{
142   pia6821_device *pia = downcast<pia6821_device *>(device);
143   pia6821_device *pia = downcast<pia6821_device *>(machine().device("sndpia1"));
143144   int combined_state = pia->irq_a_state() | pia->irq_b_state();
144145
145146   /* SINT is connected to the sound CPU's IRQ line */
146   device->machine().device("audiocpu")->execute().set_input_line(M6800_IRQ_LINE, combined_state ? ASSERT_LINE : CLEAR_LINE);
147   machine().device("audiocpu")->execute().set_input_line(M6800_IRQ_LINE, combined_state ? ASSERT_LINE : CLEAR_LINE);
147148}
148149
149150
r18185r18186
177178   DEVCB_NULL,      /* line CB1 in */
178179   DEVCB_NULL,      /* line CA2 in */
179180   DEVCB_NULL,      /* line CB2 in */
180   DEVCB_DEVICE_HANDLER("sndpia1", sync_sndpia1_porta_w),         /* port A out */
181   DEVCB_DEVICE_HANDLER("discrete", qix_vol_w),               /* port B out */
181   DEVCB_DRIVER_MEMBER(qix_state,sync_sndpia1_porta_w),         /* port A out */
182   DEVCB_DRIVER_MEMBER(qix_state,qix_vol_w),               /* port B out */
182183   DEVCB_DEVICE_LINE_MEMBER("sndpia1", pia6821_device, ca1_w),      /* line CA2 out */
183184   DEVCB_DRIVER_MEMBER(qix_state,qix_flip_screen_w),                        /* port CB2 out */
184   DEVCB_LINE(qix_pia_dint),                              /* IRQA */
185   DEVCB_LINE(qix_pia_dint)                              /* IRQB */
185   DEVCB_DRIVER_LINE_MEMBER(qix_state,qix_pia_dint),                              /* IRQA */
186   DEVCB_DRIVER_LINE_MEMBER(qix_state,qix_pia_dint)                              /* IRQB */
186187};
187188
188189static const pia6821_interface qixsnd_pia_1_intf =
r18185r18186
194195   DEVCB_NULL,      /* line CA2 in */
195196   DEVCB_NULL,      /* line CB2 in */
196197   DEVCB_DEVICE_MEMBER("sndpia0", pia6821_device, porta_w),         /* port A out */
197   DEVCB_DEVICE_HANDLER("discrete", qix_dac_w),            /* port B out */
198   DEVCB_DRIVER_MEMBER(qix_state,qix_dac_w),            /* port B out */
198199   DEVCB_DEVICE_LINE_MEMBER("sndpia0", pia6821_device, ca1_w),   /* line CA2 out */
199200   DEVCB_NULL,      /* line CB2 out */
200   DEVCB_LINE(qix_pia_sint),                        /* IRQA */
201   DEVCB_LINE(qix_pia_sint)                        /* IRQB */
201   DEVCB_DRIVER_LINE_MEMBER(qix_state,qix_pia_sint),                        /* IRQA */
202   DEVCB_DRIVER_LINE_MEMBER(qix_state,qix_pia_sint)                        /* IRQB */
202203};
203204
204205static const pia6821_interface qixsnd_pia_2_intf =
r18185r18186
209210   DEVCB_NULL,      /* line CB1 in */
210211   DEVCB_NULL,      /* line CA2 in */
211212   DEVCB_NULL,      /* line CB2 in */
212   DEVCB_HANDLER(sndpia_2_warning_w),   /* port A out */
213   DEVCB_HANDLER(sndpia_2_warning_w),   /* port B out */
214   DEVCB_HANDLER(sndpia_2_warning_w),   /* line CA2 out */
215   DEVCB_HANDLER(sndpia_2_warning_w),   /* line CB2 out */
213   DEVCB_DRIVER_MEMBER(qix_state,sndpia_2_warning_w),   /* port A out */
214   DEVCB_DRIVER_MEMBER(qix_state,sndpia_2_warning_w),   /* port B out */
215   DEVCB_DRIVER_MEMBER(qix_state,sndpia_2_warning_w),   /* line CA2 out */
216   DEVCB_DRIVER_MEMBER(qix_state,sndpia_2_warning_w),   /* line CB2 out */
216217   DEVCB_NULL,
217218   DEVCB_NULL
218219};
r18185r18186
226227   DEVCB_NULL,      /* line CA2 in */
227228   DEVCB_NULL,      /* line CB2 in */
228229   DEVCB_NULL,      /* port A out */
229   DEVCB_HANDLER(slither_coinctl_w),   /* port B out */
230   DEVCB_DRIVER_MEMBER(qix_state,slither_coinctl_w),   /* port B out */
230231   DEVCB_NULL,      /* line CA2 out */
231232   DEVCB_DRIVER_MEMBER(qix_state,qix_flip_screen_w),   /* port CB2 out */
232   DEVCB_LINE(qix_pia_dint),         /* IRQA */
233   DEVCB_LINE(qix_pia_dint)         /* IRQB */
233   DEVCB_DRIVER_LINE_MEMBER(qix_state,qix_pia_dint),         /* IRQA */
234   DEVCB_DRIVER_LINE_MEMBER(qix_state,qix_pia_dint)         /* IRQB */
234235};
235236
236237
trunk/src/mame/audio/blockade.c
r18185r18186
3636   DISCRETE_OUTPUT(NODE_10, 7500)
3737DISCRETE_SOUND_END
3838
39WRITE8_DEVICE_HANDLER( blockade_sound_freq_w )
39WRITE8_MEMBER(blockade_state::blockade_sound_freq_w)
4040{
41   discrete_sound_w(device,space,BLOCKADE_NOTE_DATA, data);
41   discrete_sound_w(m_discrete,space,BLOCKADE_NOTE_DATA, data);
4242   return;
4343}
4444
trunk/src/mame/audio/spiders.c
r18185r18186
172172
173173
174174
175WRITE8_DEVICE_HANDLER( spiders_audio_command_w )
175WRITE8_MEMBER(spiders_state::spiders_audio_command_w)
176176{
177   pia6821_device *pia = downcast<pia6821_device *>(device);
177   pia6821_device *pia = downcast<pia6821_device *>(machine().device("pia4"));
178178   pia->set_a_input(data & 0xf8, 0);
179179   pia->ca1_w(data & 0x80 ? 1 : 0);
180180}
181181
182182
183WRITE8_DEVICE_HANDLER( spiders_audio_a_w )
183WRITE8_MEMBER(spiders_state::spiders_audio_a_w)
184184{
185   discrete_sound_w(device, space, SPIDER_WEB_SOUND_MOD_DATA, 1 + (data & 4) * 8 + (data & 2) * 4 + (data & 1) * 2);
185   discrete_sound_w(m_discrete, space, SPIDER_WEB_SOUND_MOD_DATA, 1 + (data & 4) * 8 + (data & 2) * 4 + (data & 1) * 2);
186186}
187187
188WRITE8_DEVICE_HANDLER( spiders_audio_b_w )
188WRITE8_MEMBER(spiders_state::spiders_audio_b_w)
189189{
190   discrete_sound_w(device, space, SPIDERS_WEB_SOUND_DATA, data);
190   discrete_sound_w(m_discrete, space, SPIDERS_WEB_SOUND_DATA, data);
191191}
192192
193193
194WRITE8_DEVICE_HANDLER( spiders_audio_ctrl_w )
194WRITE8_MEMBER(spiders_state::spiders_audio_ctrl_w)
195195{
196   discrete_sound_w(device, space, SPIDERS_FIRE_EN, data & 0x10 ? 1 : 0);
197   discrete_sound_w(device, space, SPIDERS_EXP_EN, data & 0x08 ? 1 : 0);
198   discrete_sound_w(device, space, SPIDERS_SUPER_WEB_EXPL_EN, data & 0x04 ? 1 : 0);
199   discrete_sound_w(device, space, SPIDERS_SUPER_WEB_EN, data & 0x02 ? 1 : 0);
200   discrete_sound_w(device, space, SPIDERS_X_EN, data & 0x01 ? 1 : 0);
196   discrete_sound_w(m_discrete, space, SPIDERS_FIRE_EN, data & 0x10 ? 1 : 0);
197   discrete_sound_w(m_discrete, space, SPIDERS_EXP_EN, data & 0x08 ? 1 : 0);
198   discrete_sound_w(m_discrete, space, SPIDERS_SUPER_WEB_EXPL_EN, data & 0x04 ? 1 : 0);
199   discrete_sound_w(m_discrete, space, SPIDERS_SUPER_WEB_EN, data & 0x02 ? 1 : 0);
200   discrete_sound_w(m_discrete, space, SPIDERS_X_EN, data & 0x01 ? 1 : 0);
201201}
202202
203203
trunk/src/mame/audio/segag80r.c
r18185r18186
376376static SOUND_START( sega005 );
377377static STREAM_UPDATE( sega005_stream_update );
378378static TIMER_CALLBACK( sega005_auto_timer );
379static DECLARE_WRITE8_DEVICE_HANDLER( sega005_sound_a_w );
380static DECLARE_WRITE8_DEVICE_HANDLER( sega005_sound_b_w );
381379
382380/*
383381    005
r18185r18186
458456static I8255A_INTERFACE( ppi8255_005_intf )
459457{
460458   DEVCB_NULL,                     /* Port A read */
461   DEVCB_HANDLER(sega005_sound_a_w),   /* Port A write */
459   DEVCB_DRIVER_MEMBER(segag80r_state,sega005_sound_a_w),   /* Port A write */
462460   DEVCB_NULL,                     /* Port B read */
463   DEVCB_HANDLER(sega005_sound_b_w),   /* Port B write */
461   DEVCB_DRIVER_MEMBER(segag80r_state,sega005_sound_b_w),   /* Port B write */
464462   DEVCB_NULL,                     /* Port C read */
465463   DEVCB_NULL                     /* Port C write */
466464};
r18185r18186
506504 *
507505 *************************************/
508506
509static WRITE8_DEVICE_HANDLER( sega005_sound_a_w )
507WRITE8_MEMBER(segag80r_state::sega005_sound_a_w)
510508{
511   segag80r_state *state = space.machine().driver_data<segag80r_state>();
512   samples_device *samples = space.machine().device<samples_device>("samples");
513   UINT8 diff = data ^ state->m_sound_state[0];
514   state->m_sound_state[0] = data;
509   samples_device *samples = machine().device<samples_device>("samples");
510   UINT8 diff = data ^ m_sound_state[0];
511   m_sound_state[0] = data;
515512
516513   /* LARGE EXPL: channel 0 */
517514   if ((diff & 0x01) && !(data & 0x01)) samples->start(0, 0);
r18185r18186
565562}
566563
567564
568static WRITE8_DEVICE_HANDLER( sega005_sound_b_w )
565WRITE8_MEMBER(segag80r_state::sega005_sound_b_w)
569566{
570   segag80r_state *state = space.machine().driver_data<segag80r_state>();
571567   /*
572568           D6: manual timer clock (0->1)
573569           D5: 0 = manual timer, 1 = auto timer
574570           D4: 1 = hold/reset address counter to 0
575571        D3-D0: upper 4 bits of ROM address
576572    */
577   UINT8 diff = data ^ state->m_sound_state[1];
578   state->m_sound_state[1] = data;
573   UINT8 diff = data ^ m_sound_state[1];
574   m_sound_state[1] = data;
579575
580576   //mame_printf_debug("sound[%d] = %02X\n", 1, data);
581577
582578   /* force a stream update */
583   state->m_sega005_stream->update();
579   m_sega005_stream->update();
584580
585581   /* ROM address */
586   state->m_sound_addr = ((data & 0x0f) << 7) | (state->m_sound_addr & 0x7f);
582   m_sound_addr = ((data & 0x0f) << 7) | (m_sound_addr & 0x7f);
587583
588584   /* reset both sound address and square wave counters */
589585   if (data & 0x10)
590586   {
591      state->m_sound_addr &= 0x780;
592      state->m_square_state = 0;
587      m_sound_addr &= 0x780;
588      m_square_state = 0;
593589   }
594590
595591   /* manual clock */
596592   if ((diff & 0x40) && (data & 0x40) && !(data & 0x20) && !(data & 0x10))
597      state->m_sound_addr = (state->m_sound_addr & 0x780) | ((state->m_sound_addr + 1) & 0x07f);
593      m_sound_addr = (m_sound_addr & 0x780) | ((m_sound_addr + 1) & 0x07f);
598594
599595   /* update the sound data */
600   sega005_update_sound_data(space.machine());
596   sega005_update_sound_data(machine());
601597}
602598
603599
r18185r18186
783779 *************************************/
784780
785781static SOUND_START( monsterb );
786static DECLARE_WRITE8_DEVICE_HANDLER( monsterb_sound_a_w );
787static DECLARE_WRITE8_DEVICE_HANDLER( monsterb_sound_b_w );
788static DECLARE_READ8_DEVICE_HANDLER( n7751_status_r );
789static DECLARE_WRITE8_DEVICE_HANDLER( n7751_command_w );
782
790783static DECLARE_WRITE8_DEVICE_HANDLER( n7751_rom_control_w );
791784
792
793static DECLARE_WRITE8_DEVICE_HANDLER( n7751_p2_w );
794
795
796785/*
797786    Monster Bash
798787
r18185r18186
839828   AM_RANGE(MCS48_PORT_P2,   MCS48_PORT_P2) AM_READ(n7751_command_r)
840829   AM_RANGE(MCS48_PORT_BUS,  MCS48_PORT_BUS) AM_READ(n7751_rom_r)
841830   AM_RANGE(MCS48_PORT_P1,   MCS48_PORT_P1) AM_DEVWRITE("dac", dac_device, write_unsigned8)
842   AM_RANGE(MCS48_PORT_P2,   MCS48_PORT_P2) AM_DEVWRITE_LEGACY("audio_8243", n7751_p2_w)
831   AM_RANGE(MCS48_PORT_P2,   MCS48_PORT_P2) AM_WRITE(n7751_p2_w)
843832   AM_RANGE(MCS48_PORT_PROG, MCS48_PORT_PROG) AM_DEVWRITE_LEGACY("audio_8243", i8243_prog_w)
844833ADDRESS_MAP_END
845834
r18185r18186
854843static I8255A_INTERFACE( monsterb_ppi_intf )
855844{
856845   DEVCB_NULL,                     /* Port A read */
857   DEVCB_HANDLER(monsterb_sound_a_w),   /* Port A write */
846   DEVCB_DRIVER_MEMBER(segag80r_state,monsterb_sound_a_w),   /* Port A write */
858847   DEVCB_NULL,                     /* Port B read */
859   DEVCB_HANDLER(monsterb_sound_b_w),   /* Port B write */
860   DEVCB_HANDLER(n7751_status_r),      /* Port C read */
861   DEVCB_HANDLER(n7751_command_w)      /* Port C write */
848   DEVCB_DRIVER_MEMBER(segag80r_state,monsterb_sound_b_w),   /* Port B write */
849   DEVCB_DRIVER_MEMBER(segag80r_state,n7751_status_r),      /* Port C read */
850   DEVCB_DRIVER_MEMBER(segag80r_state,n7751_command_w)      /* Port C write */
862851};
863852
864853
r18185r18186
911900 *
912901 *************************************/
913902
914static WRITE8_DEVICE_HANDLER( monsterb_sound_a_w )
903WRITE8_MEMBER(segag80r_state::monsterb_sound_a_w)
915904{
916   device_t *tms = space.machine().device("music");
905   device_t *tms = machine().device("music");
917906   int enable_val;
918907
919908   /* Lower four data lines get decoded into 13 control lines */
920909   tms36xx_note_w(tms, 0, data & 15);
921910
922911   /* Top four data lines address an 82S123 ROM that enables/disables voices */
923   enable_val = space.machine().root_device().memregion("prom")->base()[(data & 0xF0) >> 4];
912   enable_val = machine().root_device().memregion("prom")->base()[(data & 0xF0) >> 4];
924913   tms3617_enable_w(tms, enable_val >> 2);
925914}
926915
r18185r18186
932921 *
933922 *************************************/
934923
935static WRITE8_DEVICE_HANDLER( monsterb_sound_b_w )
924WRITE8_MEMBER(segag80r_state::monsterb_sound_b_w)
936925{
937   segag80r_state *state = space.machine().driver_data<segag80r_state>();
938   samples_device *samples = space.machine().device<samples_device>("samples");
939   UINT8 diff = data ^ state->m_sound_state[1];
940   state->m_sound_state[1] = data;
926   samples_device *samples = machine().device<samples_device>("samples");
927   UINT8 diff = data ^ m_sound_state[1];
928   m_sound_state[1] = data;
941929
942930   /* SHOT: channel 0 */
943931   if ((diff & 0x01) && !(data & 0x01)) samples->start(0, 0);
r18185r18186
956944 *
957945 *************************************/
958946
959static READ8_DEVICE_HANDLER( n7751_status_r )
947READ8_MEMBER(segag80r_state::n7751_status_r)
960948{
961   segag80r_state *state = space.machine().driver_data<segag80r_state>();
962   return state->m_n7751_busy << 4;
949   return m_n7751_busy << 4;
963950}
964951
965952
966static WRITE8_DEVICE_HANDLER( n7751_command_w )
953WRITE8_MEMBER(segag80r_state::n7751_command_w)
967954{
968   segag80r_state *state = space.machine().driver_data<segag80r_state>();
969955   /*
970956        Z80 7751 control port
971957
972958        D0-D2 = connected to 7751 port C
973959        D3    = /INT line
974960    */
975   state->m_n7751_command = data & 0x07;
976   space.machine().device("audiocpu")->execute().set_input_line(0, ((data & 0x08) == 0) ? ASSERT_LINE : CLEAR_LINE);
977   space.machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(100));
961   m_n7751_command = data & 0x07;
962   machine().device("audiocpu")->execute().set_input_line(0, ((data & 0x08) == 0) ? ASSERT_LINE : CLEAR_LINE);
963   machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(100));
978964}
979965
980966
r18185r18186
10281014}
10291015
10301016
1031static WRITE8_DEVICE_HANDLER( n7751_p2_w )
1017WRITE8_MEMBER(segag80r_state::n7751_p2_w)
10321018{
1033   segag80r_state *state = space.machine().driver_data<segag80r_state>();
1019   device_t *device = machine().device("audio_8243");
10341020   /* write to P2; low 4 bits go to 8243 */
10351021   i8243_p2_w(device, space, offset, data & 0x0f);
10361022
10371023   /* output of bit $80 indicates we are ready (1) or busy (0) */
10381024   /* no other outputs are used */
1039   state->m_n7751_busy = data >> 7;
1025   m_n7751_busy = data >> 7;
10401026}
10411027
10421028
trunk/src/mame/audio/cinemat.c
r18185r18186
13311331}
13321332
13331333
1334static READ8_DEVICE_HANDLER( sound_porta_r )
1334READ8_MEMBER(cinemat_state::sound_porta_r)
13351335{
1336   cinemat_state *state = space.machine().driver_data<cinemat_state>();
13371336   /* bits 0-3 are the sound data; bit 4 is the data ready */
1338   return state->m_sound_fifo[state->m_sound_fifo_out] | ((state->m_sound_fifo_in != state->m_sound_fifo_out) << 4);
1337   return m_sound_fifo[m_sound_fifo_out] | ((m_sound_fifo_in != m_sound_fifo_out) << 4);
13391338}
13401339
13411340
1342static READ8_DEVICE_HANDLER( sound_portb_r )
1341READ8_MEMBER(cinemat_state::sound_portb_r)
13431342{
1344   cinemat_state *state = space.machine().driver_data<cinemat_state>();
1345   return state->m_last_portb_write;
1343   return m_last_portb_write;
13461344}
13471345
13481346
1349static WRITE8_DEVICE_HANDLER( sound_portb_w )
1347WRITE8_MEMBER(cinemat_state::sound_portb_w)
13501348{
1351   cinemat_state *state = space.machine().driver_data<cinemat_state>();
13521349   /* watch for a 0->1 edge on bit 0 ("shift out") to advance the data pointer */
1353   if ((data & 1) != (state->m_last_portb_write & 1) && (data & 1) != 0)
1354      state->m_sound_fifo_out = (state->m_sound_fifo_out + 1) % 16;
1350   if ((data & 1) != (m_last_portb_write & 1) && (data & 1) != 0)
1351      m_sound_fifo_out = (m_sound_fifo_out + 1) % 16;
13551352
13561353   /* watch for a 0->1 edge of bit 1 ("hard reset") to reset the FIFO */
1357   if ((data & 2) != (state->m_last_portb_write & 2) && (data & 2) != 0)
1358      state->m_sound_fifo_in = state->m_sound_fifo_out = 0;
1354   if ((data & 2) != (m_last_portb_write & 2) && (data & 2) != 0)
1355      m_sound_fifo_in = m_sound_fifo_out = 0;
13591356
13601357   /* bit 2 controls the global mute */
1361   if ((data & 4) != (state->m_last_portb_write & 4))
1362      space.machine().sound().system_mute(data & 4);
1358   if ((data & 4) != (m_last_portb_write & 4))
1359      machine().sound().system_mute(data & 4);
13631360
13641361   /* remember the last value written */
1365   state->m_last_portb_write = data;
1362   m_last_portb_write = data;
13661363}
13671364
13681365
1369static WRITE8_DEVICE_HANDLER( sound_output_w )
1366WRITE8_MEMBER(cinemat_state::sound_output_w)
13701367{
13711368   logerror("sound_output = %02X\n", data);
13721369}
r18185r18186
13761373{
13771374   AY8910_LEGACY_OUTPUT,
13781375   AY8910_DEFAULT_LOADS,
1379   DEVCB_HANDLER(sound_porta_r),
1380   DEVCB_HANDLER(sound_portb_r),
1376   DEVCB_DRIVER_MEMBER(cinemat_state,sound_porta_r),
1377   DEVCB_DRIVER_MEMBER(cinemat_state,sound_portb_r),
13811378   DEVCB_NULL,
1382   DEVCB_HANDLER(sound_portb_w)
1379   DEVCB_DRIVER_MEMBER(cinemat_state,sound_portb_w)
13831380};
13841381
13851382static const ay8910_interface demon_ay8910_interface_3 =
r18185r18186
13891386   DEVCB_NULL,
13901387   DEVCB_NULL,
13911388   DEVCB_NULL,
1392   DEVCB_HANDLER(sound_output_w)
1389   DEVCB_DRIVER_MEMBER(cinemat_state,sound_output_w)
13931390};
13941391
13951392
trunk/src/mame/audio/llander.c
r18185r18186
8080   DISCRETE_OUTPUT(NODE_90, 65534.0/(9.2+9.2+600+1000))      // Take the output from the mixer
8181DISCRETE_SOUND_END
8282
83WRITE8_DEVICE_HANDLER( llander_snd_reset_w )
83WRITE8_MEMBER(asteroid_state::llander_snd_reset_w)
8484{
8585   /* Resets the LFSR that is used for the white noise generator       */
86   discrete_sound_w(device, space, LLANDER_NOISE_RESET, 0);            /* Reset */
86   discrete_sound_w(m_discrete, space, LLANDER_NOISE_RESET, 0);            /* Reset */
8787}
8888
89WRITE8_DEVICE_HANDLER( llander_sounds_w )
89WRITE8_MEMBER(asteroid_state::llander_sounds_w)
9090{
91   discrete_sound_w(device, space, LLANDER_THRUST_DATA, data & 0x07);      /* Thrust volume */
92   discrete_sound_w(device, space, LLANDER_TONE3K_EN, data & 0x10);      /* Tone 3KHz enable */
93   discrete_sound_w(device, space, LLANDER_TONE6K_EN, data & 0x20);      /* Tone 6KHz enable */
94   discrete_sound_w(device, space, LLANDER_EXPLOD_EN, data & 0x08);      /* Explosion */
91   discrete_sound_w(m_discrete, space, LLANDER_THRUST_DATA, data & 0x07);      /* Thrust volume */
92   discrete_sound_w(m_discrete, space, LLANDER_TONE3K_EN, data & 0x10);      /* Tone 3KHz enable */
93   discrete_sound_w(m_discrete, space, LLANDER_TONE6K_EN, data & 0x20);      /* Tone 6KHz enable */
94   discrete_sound_w(m_discrete, space, LLANDER_EXPLOD_EN, data & 0x08);      /* Explosion */
9595}
9696
trunk/src/mame/audio/turbo.c
r18185r18186
6969 *
7070 *************************************/
7171
72WRITE8_DEVICE_HANDLER( turbo_sound_a_w )
72WRITE8_MEMBER(turbo_state::turbo_sound_a_w)
7373{
7474#if (!DISCRETE_TEST)
75   samples_device *samples = space.machine().device<samples_device>("samples");
75   samples_device *samples = machine().device<samples_device>("samples");
7676#endif
77   turbo_state *state = space.machine().driver_data<turbo_state>();
7877#if (!DISCRETE_TEST)
79   UINT8 diff = data ^ state->m_sound_state[0];
78   UINT8 diff = data ^ m_sound_state[0];
8079#endif
81   state->m_sound_state[0] = data;
80   m_sound_state[0] = data;
8281
8382#if (!DISCRETE_TEST)
8483
r18185r18186
9897   if ((diff & 0x10) && !(data & 0x10)) samples->start(1, 3);
9998
10099   /* OSEL0 */
101   state->m_turbo_osel = (state->m_turbo_osel & 6) | ((data >> 5) & 1);
100   m_turbo_osel = (m_turbo_osel & 6) | ((data >> 5) & 1);
102101
103102   /* /SLIP: channel 2 */
104103   if ((diff & 0x40) && !(data & 0x40)) samples->start(2, 4);
r18185r18186
107106   if ((diff & 0x80) && !(data & 0x80)) samples->start(3, 5);
108107
109108   /* update any samples */
110   turbo_update_samples(state, samples);
109   turbo_update_samples(this, samples);
111110
112111#else
113112
114   if (((data ^ state->m_last_sound_a) & 0x1e) && (state->m_last_sound_a & 0x1e) != 0x1e)
115      space.machine().scheduler().timer_set(attotime::from_hz(20000), FUNC(update_sound_a), data);
113   if (((data ^ m_last_sound_a) & 0x1e) && (m_last_sound_a & 0x1e) != 0x1e)
114      machine().scheduler().timer_set(attotime::from_hz(20000), FUNC(update_sound_a), data);
116115   else
117116      update_sound_a(data);
118117
119   state->m_last_sound_a = data;
118   m_last_sound_a = data;
120119
121120#endif
122121}
123122
124123
125WRITE8_DEVICE_HANDLER( turbo_sound_b_w )
124WRITE8_MEMBER(turbo_state::turbo_sound_b_w)
126125{
127   samples_device *samples = space.machine().device<samples_device>("samples");
128   turbo_state *state = space.machine().driver_data<turbo_state>();
129   UINT8 diff = data ^ state->m_sound_state[1];
130   state->m_sound_state[1] = data;
126   samples_device *samples = machine().device<samples_device>("samples");
127   UINT8 diff = data ^ m_sound_state[1];
128   m_sound_state[1] = data;
131129
132130   /* ACC0-ACC5 */
133   state->m_turbo_accel = data & 0x3f;
134   output_set_value("tachometer", state->m_turbo_accel);
131   m_turbo_accel = data & 0x3f;
132   output_set_value("tachometer", m_turbo_accel);
135133
136134   /* /AMBU: channel 4 */
137135   if ((diff & 0x40) && !(data & 0x40) && !samples->playing(4)) samples->start(4, 8, true);
r18185r18186
141139   if ((diff & 0x80) && !(data & 0x80)) samples->start(2, 6);
142140
143141   /* update any samples */
144   turbo_update_samples(state, samples);
142   turbo_update_samples(this, samples);
145143}
146144
147145
148WRITE8_DEVICE_HANDLER( turbo_sound_c_w )
146WRITE8_MEMBER(turbo_state::turbo_sound_c_w)
149147{
150   samples_device *samples = space.machine().device<samples_device>("samples");
151   turbo_state *state = space.machine().driver_data<turbo_state>();
148   samples_device *samples = machine().device<samples_device>("samples");
152149
153150   /* OSEL1-2 */
154   state->m_turbo_osel = (state->m_turbo_osel & 1) | ((data & 3) << 1);
151   m_turbo_osel = (m_turbo_osel & 1) | ((data & 3) << 1);
155152
156153   /* BSEL0-1 */
157   state->m_turbo_bsel = (data >> 2) & 3;
154   m_turbo_bsel = (data >> 2) & 3;
158155
159156   /* SPEED0-3 */
160157   output_set_value("speed", (data >> 4) & 0x0f);
161158
162159   /* update any samples */
163   turbo_update_samples(state, samples);
160   turbo_update_samples(this, samples);
164161}
165162
166163
r18185r18186
295292 *
296293 *************************************/
297294
298WRITE8_DEVICE_HANDLER( subroc3d_sound_a_w )
295WRITE8_MEMBER(turbo_state::subroc3d_sound_a_w)
299296{
300   turbo_state *state = space.machine().driver_data<turbo_state>();
301   state->m_sound_state[0] = data;
297   m_sound_state[0] = data;
302298
303299   /* DIS0-3 contained in bits 0-3 */
304300   /* DIR0-2 contained in bits 4-6 */
r18185r18186
325321}
326322
327323
328WRITE8_DEVICE_HANDLER( subroc3d_sound_b_w )
324WRITE8_MEMBER(turbo_state::subroc3d_sound_b_w)
329325{
330   samples_device *samples = space.machine().device<samples_device>("samples");
331   turbo_state *state = space.machine().driver_data<turbo_state>();
332   UINT8 diff = data ^ state->m_sound_state[1];
333   state->m_sound_state[1] = data;
326   samples_device *samples = machine().device<samples_device>("samples");
327   UINT8 diff = data ^ m_sound_state[1];
328   m_sound_state[1] = data;
334329
335330   /* bit 0 latches direction/volume for missile */
336331   if ((diff & 0x01) && (data & 0x01))
337332   {
338      state->m_subroc3d_mdis = state->m_sound_state[0] & 0x0f;
339      state->m_subroc3d_mdir = (state->m_sound_state[0] >> 4) & 0x07;
333      m_subroc3d_mdis = m_sound_state[0] & 0x0f;
334      m_subroc3d_mdir = (m_sound_state[0] >> 4) & 0x07;
340335      if (!samples->playing(0))
341336      {
342337         samples->start(0, 0, true);
343338         samples->start(1, 0, true);
344339      }
345      subroc3d_update_volume(samples, 0, state->m_subroc3d_mdis, state->m_subroc3d_mdir);
340      subroc3d_update_volume(samples, 0, m_subroc3d_mdis, m_subroc3d_mdir);
346341   }
347342
348343   /* bit 1 latches direction/volume for torpedo */
349344   if ((diff & 0x02) && (data & 0x02))
350345   {
351      state->m_subroc3d_tdis = state->m_sound_state[0] & 0x0f;
352      state->m_subroc3d_tdir = (state->m_sound_state[0] >> 4) & 0x07;
346      m_subroc3d_tdis = m_sound_state[0] & 0x0f;
347      m_subroc3d_tdir = (m_sound_state[0] >> 4) & 0x07;
353348      if (!samples->playing(2))
354349      {
355350         samples->start(2, 1, true);
356351         samples->start(3, 1, true);
357352      }
358      subroc3d_update_volume(samples, 2, state->m_subroc3d_tdis, state->m_subroc3d_tdir);
353      subroc3d_update_volume(samples, 2, m_subroc3d_tdis, m_subroc3d_tdir);
359354   }
360355
361356   /* bit 2 latches direction/volume for fighter */
362357   if ((diff & 0x04) && (data & 0x04))
363358   {
364      state->m_subroc3d_fdis = state->m_sound_state[0] & 0x0f;
365      state->m_subroc3d_fdir = (state->m_sound_state[0] >> 4) & 0x07;
359      m_subroc3d_fdis = m_sound_state[0] & 0x0f;
360      m_subroc3d_fdir = (m_sound_state[0] >> 4) & 0x07;
366361      if (!samples->playing(4))
367362      {
368363         samples->start(4, 2, true);
369364         samples->start(5, 2, true);
370365      }
371      subroc3d_update_volume(samples, 4, state->m_subroc3d_fdis, state->m_subroc3d_fdir);
366      subroc3d_update_volume(samples, 4, m_subroc3d_fdis, m_subroc3d_fdir);
372367   }
373368
374369   /* bit 3 latches direction/volume for hit */
375370   if ((diff & 0x08) && (data & 0x08))
376371   {
377      state->m_subroc3d_hdis = state->m_sound_state[0] & 0x0f;
378      state->m_subroc3d_hdir = (state->m_sound_state[0] >> 4) & 0x07;
379      subroc3d_update_volume(samples, 6, state->m_subroc3d_hdis, state->m_subroc3d_hdir);
372      m_subroc3d_hdis = m_sound_state[0] & 0x0f;
373      m_subroc3d_hdir = (m_sound_state[0] >> 4) & 0x07;
374      subroc3d_update_volume(samples, 6, m_subroc3d_hdis, m_subroc3d_hdir);
380375   }
381376}
382377
383378
384WRITE8_DEVICE_HANDLER( subroc3d_sound_c_w )
379WRITE8_MEMBER(turbo_state::subroc3d_sound_c_w)
385380{
386   samples_device *samples = space.machine().device<samples_device>("samples");
387   turbo_state *state = space.machine().driver_data<turbo_state>();
388   UINT8 diff = data ^ state->m_sound_state[2];
389   state->m_sound_state[2] = data;
381   samples_device *samples = machine().device<samples_device>("samples");
382   UINT8 diff = data ^ m_sound_state[2];
383   m_sound_state[2] = data;
390384
391385   /* /FIRE TRIG */
392386   /* FIRE SELECT */
r18185r18186
400394   /* /HIT TRIG -> HIT.L/R: channels 6+7 */
401395   if ((diff & 0x08) && (data & 0x08))
402396   {
403      samples->start(6, (state->m_sound_state[0] & 0x80) ? 4 : 3);
404      samples->start(7, (state->m_sound_state[0] & 0x80) ? 4 : 3);
397      samples->start(6, (m_sound_state[0] & 0x80) ? 4 : 3);
398      samples->start(7, (m_sound_state[0] & 0x80) ? 4 : 3);
405399   }
406400
407401   /* /ALARM TRIG -> ALARM.M: channel 10 */
r18185r18186
415409   samples->set_volume(11, (data & 0x40) ? 0 : 1.0);
416410
417411   /* /GAME START */
418   space.machine().sound().system_mute(data & 0x80);
412   machine().sound().system_mute(data & 0x80);
419413}
420414
421415
r18185r18186
505499}
506500
507501
508WRITE8_DEVICE_HANDLER( buckrog_sound_a_w )
502WRITE8_MEMBER(turbo_state::buckrog_sound_a_w)
509503{
510   samples_device *samples = space.machine().device<samples_device>("samples");
511   turbo_state *state = space.machine().driver_data<turbo_state>();
512   UINT8 diff = data ^ state->m_sound_state[0];
513   state->m_sound_state[0] = data;
504   samples_device *samples = machine().device<samples_device>("samples");
505   UINT8 diff = data ^ m_sound_state[0];
506   m_sound_state[0] = data;
514507
515508   /* clock HIT DIS from bits 0-2 */
516509   if ((diff & 0x10) && (data & 0x10))
r18185r18186
519512   /* clock ACC from bits 0-3 */
520513   if ((diff & 0x20) && (data & 0x20))
521514   {
522      state->m_buckrog_myship = data & 0x0f;
523      buckrog_update_samples(state, samples);
515      m_buckrog_myship = data & 0x0f;
516      buckrog_update_samples(this, samples);
524517   }
525518
526519   /* /ALARM0: channel 0 */
r18185r18186
531524}
532525
533526
534WRITE8_DEVICE_HANDLER( buckrog_sound_b_w )
527WRITE8_MEMBER(turbo_state::buckrog_sound_b_w)
535528{
536   samples_device *samples = space.machine().device<samples_device>("samples");
537   turbo_state *state = space.machine().driver_data<turbo_state>();
538   UINT8 diff = data ^ state->m_sound_state[1];
539   state->m_sound_state[1] = data;
529   samples_device *samples = machine().device<samples_device>("samples");
530   UINT8 diff = data ^ m_sound_state[1];
531   m_sound_state[1] = data;
540532
541533   /* /ALARM3: channel 0 */
542534   if ((diff & 0x01) && !(data & 0x01)) samples->start(0, 2);
r18185r18186
554546   if ((diff & 0x10) && !(data & 0x10))
555547   {
556548      samples->start(3, 7);
557      buckrog_update_samples(state, samples);
549      buckrog_update_samples(this, samples);
558550   }
559551
560552   /* /REBOUND: channel 4 */
r18185r18186
564556   if ((diff & 0x40) &&  (data & 0x40) && !samples->playing(5))
565557   {
566558      samples->start(5, 8, true);
567      buckrog_update_samples(state, samples);
559      buckrog_update_samples(this, samples);
568560   }
569561   if ((diff & 0x40) && !(data & 0x40) &&  samples->playing(5)) samples->stop(5);
570562
571563   /* GAME ON */
572   space.machine().sound().system_enable(data & 0x80);
564   machine().sound().system_enable(data & 0x80);
573565}
574566
575567
trunk/src/mame/audio/bzone.c
r18185r18186
387387   DEVCB_INPUT_PORT("IN3")
388388};
389389
390WRITE8_DEVICE_HANDLER( bzone_sounds_w )
390WRITE8_MEMBER(bzone_state::bzone_sounds_w)
391391{
392   discrete_sound_w(device, space, BZ_INPUT, data);
392   discrete_sound_w(m_discrete, space, BZ_INPUT, data);
393393
394394   output_set_value("startled", (data >> 6) & 1);
395   space.machine().sound().system_enable(data & 0x20);
395   machine().sound().system_enable(data & 0x20);
396396}
397397
398398
trunk/src/mame/audio/skyraid.c
r18185r18186
283283DISCRETE_SOUND_END
284284
285285
286WRITE8_DEVICE_HANDLER( skyraid_sound_w )
286WRITE8_MEMBER(skyraid_state::skyraid_sound_w)
287287{
288288   /* BIT0 => PLANE SWEEP */
289289   /* BIT1 => MISSILE     */
r18185r18186
292292   /* BIT4 => PLANE ON    */
293293   /* BIT5 => ATTRACT     */
294294
295   discrete_sound_w(device, space, SKYRAID_PLANE_SWEEP_EN, data & 0x01);
296   discrete_sound_w(device, space, SKYRAID_MISSILE_EN, data & 0x02);
297   discrete_sound_w(device, space, SKYRAID_EXPLOSION_EN, data & 0x04);
298   set_led_status(space.machine(), 0, !(data & 0x08));
299   discrete_sound_w(device, space, SKYRAID_PLANE_ON_EN, data & 0x10);
300   discrete_sound_w(device, space, SKYRAID_ATTRACT_EN, data & 0x20);
295   discrete_sound_w(m_discrete, space, SKYRAID_PLANE_SWEEP_EN, data & 0x01);
296   discrete_sound_w(m_discrete, space, SKYRAID_MISSILE_EN, data & 0x02);
297   discrete_sound_w(m_discrete, space, SKYRAID_EXPLOSION_EN, data & 0x04);
298   set_led_status(machine(), 0, !(data & 0x08));
299   discrete_sound_w(m_discrete, space, SKYRAID_PLANE_ON_EN, data & 0x10);
300   discrete_sound_w(m_discrete, space, SKYRAID_ATTRACT_EN, data & 0x20);
301301}
trunk/src/mame/audio/sprint8.c
r18185r18186
293293DISCRETE_SOUND_END
294294
295295
296WRITE8_DEVICE_HANDLER( sprint8_crash_w )
296WRITE8_MEMBER(sprint8_state::sprint8_crash_w)
297297{
298   discrete_sound_w(device, space, SPRINT8_CRASH_EN, data & 0x01);
298   discrete_sound_w(m_discrete, space, SPRINT8_CRASH_EN, data & 0x01);
299299}
300300
301WRITE8_DEVICE_HANDLER( sprint8_screech_w )
301WRITE8_MEMBER(sprint8_state::sprint8_screech_w)
302302{
303   discrete_sound_w(device, space, SPRINT8_SCREECH_EN, data & 0x01);
303   discrete_sound_w(m_discrete, space, SPRINT8_SCREECH_EN, data & 0x01);
304304}
305305
306WRITE8_DEVICE_HANDLER( sprint8_attract_w )
306WRITE8_MEMBER(sprint8_state::sprint8_attract_w)
307307{
308   discrete_sound_w(device, space, SPRINT8_ATTRACT_EN, data & 0x01);
308   discrete_sound_w(m_discrete, space, SPRINT8_ATTRACT_EN, data & 0x01);
309309}
310310
311WRITE8_DEVICE_HANDLER( sprint8_motor_w )
311WRITE8_MEMBER(sprint8_state::sprint8_motor_w)
312312{
313   discrete_sound_w(device, space, NODE_RELATIVE(SPRINT8_MOTOR1_EN, offset & 0x07), data & 0x01);
313   discrete_sound_w(m_discrete, space, NODE_RELATIVE(SPRINT8_MOTOR1_EN, offset & 0x07), data & 0x01);
314314}
trunk/src/mame/audio/orbit.c
r18185r18186
1313 *
1414 *************************************/
1515
16WRITE8_DEVICE_HANDLER( orbit_note_w )
16WRITE8_MEMBER(orbit_state::orbit_note_w)
1717{
18   discrete_sound_w(device, space, ORBIT_NOTE_FREQ, (~data) & 0xff);
18   discrete_sound_w(m_discrete, space, ORBIT_NOTE_FREQ, (~data) & 0xff);
1919}
2020
21WRITE8_DEVICE_HANDLER( orbit_note_amp_w )
21WRITE8_MEMBER(orbit_state::orbit_note_amp_w)
2222{
23   discrete_sound_w(device, space, ORBIT_ANOTE1_AMP, data & 0x0f);
24   discrete_sound_w(device, space, ORBIT_ANOTE2_AMP, data >> 4);
23   discrete_sound_w(m_discrete, space, ORBIT_ANOTE1_AMP, data & 0x0f);
24   discrete_sound_w(m_discrete, space, ORBIT_ANOTE2_AMP, data >> 4);
2525}
2626
27WRITE8_DEVICE_HANDLER( orbit_noise_amp_w )
27WRITE8_MEMBER(orbit_state::orbit_noise_amp_w)
2828{
29   discrete_sound_w(device, space, ORBIT_NOISE1_AMP, data & 0x0f);
30   discrete_sound_w(device, space, ORBIT_NOISE2_AMP, data >> 4);
29   discrete_sound_w(m_discrete, space, ORBIT_NOISE1_AMP, data & 0x0f);
30   discrete_sound_w(m_discrete, space, ORBIT_NOISE2_AMP, data >> 4);
3131}
3232
33WRITE8_DEVICE_HANDLER( orbit_noise_rst_w )
33WRITE8_MEMBER(orbit_state::orbit_noise_rst_w)
3434{
35   discrete_sound_w(device, space, ORBIT_NOISE_EN, 0);
35   discrete_sound_w(m_discrete, space, ORBIT_NOISE_EN, 0);
3636}
3737
3838
trunk/src/mame/audio/crbaloon.c
r18185r18186
3030
3131
3232
33WRITE8_DEVICE_HANDLER( crbaloon_audio_set_music_freq )
33WRITE8_MEMBER(crbaloon_state::crbaloon_audio_set_music_freq)
3434{
35   discrete_sound_w(device, space, CRBALOON_MUSIC_DATA, data);
35   discrete_sound_w(m_discrete, space, CRBALOON_MUSIC_DATA, data);
3636}
3737
3838
39WRITE8_DEVICE_HANDLER( crbaloon_audio_set_music_enable )
39WRITE8_MEMBER(crbaloon_state::crbaloon_audio_set_music_enable)
4040{
41   discrete_sound_w(device, space, CRBALOON_MUSIC_EN, data);
41   discrete_sound_w(m_discrete, space, CRBALOON_MUSIC_EN, data);
4242}
4343
4444
r18185r18186
6464}
6565
6666
67WRITE8_DEVICE_HANDLER( crbaloon_audio_set_laugh_enable )
67WRITE8_MEMBER(crbaloon_state::crbaloon_audio_set_laugh_enable)
6868{
69   discrete_sound_w(device, space, CRBALOON_LAUGH_EN, data);
69   discrete_sound_w(m_discrete, space, CRBALOON_LAUGH_EN, data);
7070}
7171
7272
trunk/src/mame/audio/senjyo.c
r18185r18186
1212
1313/* z80 pio */
1414
15static READ8_DEVICE_HANDLER( pio_pa_r )
15READ8_MEMBER(senjyo_state::pio_pa_r)
1616{
17   senjyo_state *state = space.machine().driver_data<senjyo_state>();
1817
19   return state->m_sound_cmd;
18   return m_sound_cmd;
2019}
2120
2221Z80PIO_INTERFACE( senjyo_pio_intf )
2322{
2423   DEVCB_CPU_INPUT_LINE("sub", INPUT_LINE_IRQ0),
25   DEVCB_HANDLER(pio_pa_r),
24   DEVCB_DRIVER_MEMBER(senjyo_state,pio_pa_r),
2625   DEVCB_NULL,
2726   DEVCB_NULL,
2827   DEVCB_NULL,
trunk/src/mame/audio/bsktball.c
r18185r18186
1010/***************************************************************************
1111Sound handlers
1212***************************************************************************/
13WRITE8_DEVICE_HANDLER( bsktball_bounce_w )
13WRITE8_MEMBER(bsktball_state::bsktball_bounce_w)
1414{
15   discrete_sound_w(device, space, BSKTBALL_CROWD_DATA, data & 0x0f);   // Crowd
16   discrete_sound_w(device, space, BSKTBALL_BOUNCE_EN, data & 0x10);   // Bounce
15   discrete_sound_w(m_discrete, space, BSKTBALL_CROWD_DATA, data & 0x0f);   // Crowd
16   discrete_sound_w(m_discrete, space, BSKTBALL_BOUNCE_EN, data & 0x10);   // Bounce
1717}
1818
19WRITE8_DEVICE_HANDLER( bsktball_note_w )
19WRITE8_MEMBER(bsktball_state::bsktball_note_w)
2020{
21   discrete_sound_w(device, space, BSKTBALL_NOTE_DATA, data);   // Note
21   discrete_sound_w(m_discrete, space, BSKTBALL_NOTE_DATA, data);   // Note
2222}
2323
24WRITE8_DEVICE_HANDLER( bsktball_noise_reset_w )
24WRITE8_MEMBER(bsktball_state::bsktball_noise_reset_w)
2525{
26   discrete_sound_w(device, space, BSKTBALL_NOISE_EN, offset & 0x01);
26   discrete_sound_w(m_discrete, space, BSKTBALL_NOISE_EN, offset & 0x01);
2727}
2828
2929
trunk/src/mame/audio/micro3d.c
r18185r18186
393393   }
394394}
395395
396WRITE8_DEVICE_HANDLER( micro3d_upd7759_w )
396WRITE8_MEMBER(micro3d_state::micro3d_upd7759_w)
397397{
398   device_t *device = machine().device("upd7759");
398399   upd7759_port_w(device, space, 0, data);
399400   upd7759_start_w(device, 0);
400401   upd7759_start_w(device, 1);
trunk/src/mame/audio/harddriv.c
r18185r18186
293293 *
294294 *************************************/
295295
296WRITE16_DEVICE_HANDLER( hdsnddsp_dac_w )
296WRITE16_MEMBER(harddriv_state::hdsnddsp_dac_w)
297297{
298   harddriv_state *state = space.machine().driver_data<harddriv_state>();
299298
300299   /* DAC L */
301   if (!state->m_dacmute)
302      downcast<dac_device *>(device)->write_signed16(data ^ 0x8000);
300   if (!m_dacmute)
301      downcast<dac_device *>(machine().device("dac"))->write_signed16(data ^ 0x8000);
303302}
304303
305304
trunk/src/mame/machine/nitedrvr.c
r18185r18186
277277{
278278
279279   m_maincpu = machine().device<cpu_device>("maincpu");
280   m_discrete = machine().device("discrete");
281280
282281   save_item(NAME(m_gear));
283282   save_item(NAME(m_track));
trunk/src/mame/machine/mw8080bw.c
r18185r18186
104104   m_sn = machine().device("snsnd");
105105   m_sn1 = machine().device("sn1");
106106   m_sn2 = machine().device("sn2");
107   m_discrete = machine().device("discrete");
108107   m_mb14241 = machine().device("mb14241");
109108}
110109

Previous 199869 Revisions Next


© 1997-2024 The MAME Team