Previous 199869 Revisions Next

r21621 Wednesday 6th March, 2013 at 04:33:54 UTC by Andrew Gardner
Modernized the beep and taitosnd devices. [Andrew Gardner]
[src/emu/sound]beep.c beep.h
[src/mame/audio]taitosnd.c taitosnd.h
[src/mame/drivers]asuka.c darius.c deshoros.c dlair.c exzisus.c mlanding.c ninjaw.c opwolf.c othunder.c pcxt.c rainbow.c rastan.c slapshot.c taito_b.c taito_f2.c taito_h.c taito_l.c taito_x.c taito_z.c taitoair.c topspeed.c volfied.c warriorb.c wgp.c zn.c
[src/mame/includes]darius.h ninjaw.h othunder.h slapshot.h taito_z.h warriorb.h wgp.h
[src/mess/drivers]a5105.c alphatro.c bigbord2.c bmjr.c bml3.c ex800.c fidelz80.c fm7.c glasgow.c h19.c h8.c jr100.c jr200.c lx800.c mephisto.c micronic.c mmodular.c multi8.c mz2000.c mz2500.c nc.c osi.c pb1000.c pc100.c pc2000.c pc4.c pc8801.c pc9801.c pce220.c pcw.c pcw16.c psion.c rex6000.c sc2.c smc777.c studio2.c supercon.c tmc1800.c vk100.c vt100.c x07.c xerox820.c z9001.c zrt80.c
[src/mess/includes]fidelz80.h osi.h psion.h studio2.h tmc1800.h xerox820.h
[src/mess/machine]apollo_kbd.c apollo_kbd.h electron.c kay_kbd.c osborne1.c
[src/mess/video]911_vdt.c

trunk/src/mame/includes/taito_z.h
r21620r21621
55
66*************************************************************************/
77
8#include <audio/taitosnd.h>
89#include "machine/eeprom.h"
910
1011class taitoz_state : public driver_device
r21620r21621
3839   device_t *m_tc0150rod;
3940   device_t *m_tc0100scn;
4041   device_t *m_tc0220ioc;
41   device_t *m_tc0140syt;
42   tc0140syt_device *m_tc0140syt;
4243
4344   DECLARE_WRITE16_MEMBER(cpua_ctrl_w);
4445   DECLARE_WRITE16_MEMBER(chasehq_cpua_ctrl_w);
trunk/src/mame/includes/darius.h
r21620r21621
55*************************************************************************/
66
77#include <sound/flt_vol.h>
8#include <audio/taitosnd.h>
89
910#define DARIUS_VOL_MAX    (3*2 + 2)
1011#define DARIUS_PAN_MAX    (2 + 2 + 1)   /* FM 2port + PSG 2port + DA 1port */
r21620r21621
3940   cpu_device *m_audiocpu;
4041   device_t *m_cpub;
4142   device_t *m_adpcm;
42   device_t *m_tc0140syt;
43   tc0140syt_device *m_tc0140syt;
4344   device_t *m_pc080sn;
4445
4546   device_t *m_lscreen;
trunk/src/mame/includes/warriorb.h
r21620r21621
55*************************************************************************/
66
77#include <sound/flt_vol.h>
8#include <audio/taitosnd.h>
89
910class warriorb_state : public driver_device
1011{
r21620r21621
2324   /* devices */
2425   cpu_device *m_maincpu;
2526   cpu_device *m_audiocpu;
26   device_t *m_tc0140syt;
27   tc0140syt_device *m_tc0140syt;
2728   device_t *m_tc0100scn_1;
2829   device_t *m_tc0100scn_2;
2930   device_t *m_lscreen;
trunk/src/mame/includes/othunder.h
r21620r21621
66
77#include "machine/eeprom.h"
88#include <sound/flt_vol.h>
9#include <audio/taitosnd.h>
910
1011struct othunder_tempsprite
1112{
r21620r21621
4445   device_t *m_tc0220ioc;
4546   device_t *m_tc0100scn;
4647   device_t *m_tc0110pcr;
47   device_t *m_tc0140syt;
48   tc0140syt_device *m_tc0140syt;
4849   filter_volume_device *m_2610_0l;
4950   filter_volume_device *m_2610_0r;
5051   filter_volume_device *m_2610_1l;
trunk/src/mame/includes/slapshot.h
r21620r21621
44
55*************************************************************************/
66
7#include <audio/taitosnd.h>
8
79struct slapshot_tempsprite
810{
911   int gfx;
r21620r21621
4951   /* devices */
5052   cpu_device *m_maincpu;
5153   cpu_device *m_audiocpu;
52   device_t *m_tc0140syt;
54   tc0140syt_device *m_tc0140syt;
5355   device_t *m_tc0480scp;
5456   device_t *m_tc0360pri;
5557   device_t *m_tc0640fio;
trunk/src/mame/includes/ninjaw.h
r21620r21621
55*************************************************************************/
66
77#include <sound/flt_vol.h>
8#include <audio/taitosnd.h>
89
910class ninjaw_state : public driver_device
1011{
r21620r21621
2526   cpu_device *m_maincpu;
2627   cpu_device *m_audiocpu;
2728   cpu_device *m_subcpu;
28   device_t *m_tc0140syt;
29   tc0140syt_device *m_tc0140syt;
2930   device_t *m_tc0100scn_1;
3031   device_t *m_tc0100scn_2;
3132   device_t *m_tc0100scn_3;
trunk/src/mame/includes/wgp.h
r21620r21621
44
55*************************************************************************/
66
7#include <audio/taitosnd.h>
8
79class wgp_state : public driver_device
810{
911public:
r21620r21621
4446   cpu_device *m_audiocpu;
4547   cpu_device *m_subcpu;
4648   device_t *m_tc0100scn;
47   device_t *m_tc0140syt;
49   tc0140syt_device *m_tc0140syt;
4850   DECLARE_READ16_MEMBER(sharedram_r);
4951   DECLARE_WRITE16_MEMBER(sharedram_w);
5052   DECLARE_WRITE16_MEMBER(cpua_ctrl_w);
trunk/src/mame/drivers/taitoair.c
r21620r21621
401401   AM_RANGE(0xa00000, 0xa00007) AM_READ(stick_input_r)
402402   AM_RANGE(0xa00100, 0xa00107) AM_READ(stick2_input_r)
403403   AM_RANGE(0xa00200, 0xa0020f) AM_DEVREADWRITE8_LEGACY("tc0220ioc", tc0220ioc_r, tc0220ioc_w, 0x00ff) /* other I/O */
404   AM_RANGE(0xa80000, 0xa80001) AM_READNOP AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0x00ff)
405   AM_RANGE(0xa80002, 0xa80003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff)
404   AM_RANGE(0xa80000, 0xa80001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0x00ff)
405   AM_RANGE(0xa80002, 0xa80003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff)
406406   AM_RANGE(0xb00000, 0xb007ff) AM_RAM                     /* "power common ram" (mecha drive) */
407407ADDRESS_MAP_END
408408
r21620r21621
413413   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank1")
414414   AM_RANGE(0xc000, 0xdfff) AM_RAM
415415   AM_RANGE(0xe000, 0xe003) AM_DEVREADWRITE_LEGACY("ymsnd", ym2610_r, ym2610_w)
416   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_DEVWRITE_LEGACY("tc0140syt", tc0140syt_slave_port_w)
417   AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE_LEGACY("tc0140syt", tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
416   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_port_w)
417   AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
418418   AM_RANGE(0xe400, 0xe403) AM_WRITENOP        /* pan control */
419419   AM_RANGE(0xea00, 0xea00) AM_READNOP
420420   AM_RANGE(0xee00, 0xee00) AM_WRITENOP        /* ? */
trunk/src/mame/drivers/volfied.c
r21620r21621
7171   AM_RANGE(0x600000, 0x600001) AM_WRITE(volfied_video_mask_w)
7272   AM_RANGE(0x700000, 0x700001) AM_WRITE(volfied_sprite_ctrl_w)
7373   AM_RANGE(0xd00000, 0xd00001) AM_READWRITE(volfied_video_ctrl_r, volfied_video_ctrl_w)
74   AM_RANGE(0xe00000, 0xe00001) AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0x00ff)
75   AM_RANGE(0xe00002, 0xe00003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff)
74   AM_RANGE(0xe00000, 0xe00001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0x00ff)
75   AM_RANGE(0xe00002, 0xe00003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff)
7676   AM_RANGE(0xf00000, 0xf007ff) AM_READWRITE(volfied_cchip_ram_r, volfied_cchip_ram_w)
7777   AM_RANGE(0xf00802, 0xf00803) AM_READWRITE(volfied_cchip_ctrl_r, volfied_cchip_ctrl_w)
7878   AM_RANGE(0xf00c00, 0xf00c01) AM_WRITE(volfied_cchip_bank_w)
r21620r21621
8181static ADDRESS_MAP_START( z80_map, AS_PROGRAM, 8, volfied_state )
8282   AM_RANGE(0x0000, 0x7fff) AM_ROM
8383   AM_RANGE(0x8000, 0x87ff) AM_RAM
84   AM_RANGE(0x8800, 0x8800) AM_DEVWRITE_LEGACY("tc0140syt", tc0140syt_slave_port_w)
85   AM_RANGE(0x8801, 0x8801) AM_DEVREADWRITE_LEGACY("tc0140syt", tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
84   AM_RANGE(0x8800, 0x8800) AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_port_w)
85   AM_RANGE(0x8801, 0x8801) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
8686   AM_RANGE(0x9000, 0x9001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2203_r, ym2203_w)
8787   AM_RANGE(0x9800, 0x9800) AM_WRITENOP    /* ? */
8888ADDRESS_MAP_END
trunk/src/mame/drivers/rastan.c
r21620r21621
216216   AM_RANGE(0x390008, 0x390009) AM_READ_PORT("DSWA")
217217   AM_RANGE(0x39000a, 0x39000b) AM_READ_PORT("DSWB")
218218   AM_RANGE(0x3c0000, 0x3c0001) AM_WRITE(watchdog_reset16_w)
219   AM_RANGE(0x3e0000, 0x3e0001) AM_READNOP AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0x00ff)
220   AM_RANGE(0x3e0002, 0x3e0003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff)
219   AM_RANGE(0x3e0000, 0x3e0001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0x00ff)
220   AM_RANGE(0x3e0002, 0x3e0003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff)
221221   AM_RANGE(0xc00000, 0xc0ffff) AM_DEVREADWRITE_LEGACY("pc080sn", pc080sn_word_r, pc080sn_word_w)
222222   AM_RANGE(0xc20000, 0xc20003) AM_DEVWRITE_LEGACY("pc080sn", pc080sn_yscroll_word_w)
223223   AM_RANGE(0xc40000, 0xc40003) AM_DEVWRITE_LEGACY("pc080sn", pc080sn_xscroll_word_w)
r21620r21621
231231   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank1")
232232   AM_RANGE(0x8000, 0x8fff) AM_RAM
233233   AM_RANGE(0x9000, 0x9001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
234   AM_RANGE(0xa000, 0xa000) AM_DEVWRITE_LEGACY("tc0140syt", tc0140syt_slave_port_w)
235   AM_RANGE(0xa001, 0xa001) AM_DEVREADWRITE_LEGACY("tc0140syt", tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
234   AM_RANGE(0xa000, 0xa000) AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_port_w)
235   AM_RANGE(0xa001, 0xa001) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
236236   AM_RANGE(0xb000, 0xb000) AM_WRITE(rastan_msm5205_address_w)
237237   AM_RANGE(0xc000, 0xc000) AM_WRITE(rastan_msm5205_start_w)
238238   AM_RANGE(0xd000, 0xd000) AM_WRITE(rastan_msm5205_stop_w)
trunk/src/mame/drivers/slapshot.c
r21620r21621
252252WRITE16_MEMBER(slapshot_state::slapshot_msb_sound_w)
253253{
254254   if (offset == 0)
255      tc0140syt_port_w(m_tc0140syt, space, 0, (data >> 8) & 0xff);
255      m_tc0140syt->tc0140syt_port_w(space, 0, (data >> 8) & 0xff);
256256   else if (offset == 1)
257      tc0140syt_comm_w(m_tc0140syt, space, 0, (data >> 8) & 0xff);
257      m_tc0140syt->tc0140syt_comm_w(space, 0, (data >> 8) & 0xff);
258258
259259#ifdef MAME_DEBUG
260260   if (data & 0xff)
r21620r21621
265265READ16_MEMBER(slapshot_state::slapshot_msb_sound_r)
266266{
267267   if (offset == 1)
268      return ((tc0140syt_comm_r(m_tc0140syt, space, 0) & 0xff) << 8);
268      return ((m_tc0140syt->tc0140syt_comm_r(space, 0) & 0xff) << 8);
269269   else
270270      return 0;
271271}
r21620r21621
314314   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank10")
315315   AM_RANGE(0xc000, 0xdfff) AM_RAM
316316   AM_RANGE(0xe000, 0xe003) AM_DEVREADWRITE_LEGACY("ymsnd", ym2610_r,ym2610_w)
317   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_DEVWRITE_LEGACY("tc0140syt", tc0140syt_slave_port_w)
318   AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE_LEGACY("tc0140syt", tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
317   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_port_w)
318   AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
319319   AM_RANGE(0xe400, 0xe403) AM_WRITENOP /* pan */
320320   AM_RANGE(0xea00, 0xea00) AM_READNOP
321321   AM_RANGE(0xee00, 0xee00) AM_WRITENOP /* ? */
r21620r21621
519519
520520   m_maincpu = machine().device<cpu_device>("maincpu");
521521   m_audiocpu = machine().device<cpu_device>("audiocpu");
522   m_tc0140syt = machine().device("tc0140syt");
522   m_tc0140syt = machine().device<tc0140syt_device>("tc0140syt");
523523   m_tc0480scp = machine().device("tc0480scp");
524524   m_tc0360pri = machine().device("tc0360pri");
525525   m_tc0640fio = machine().device("tc0640fio");
trunk/src/mame/drivers/deshoros.c
r21620r21621
158158WRITE8_MEMBER(destiny_state::sound_w)
159159{
160160   // a0: sound on/off
161   beep_set_state(machine().device(BEEPER_TAG), ~offset & 1);
161   machine().device<beep_device>(BEEPER_TAG)->set_state(~offset & 1);
162162}
163163
164164static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, destiny_state )
r21620r21621
247247
248248void destiny_state::machine_start()
249249{
250   beep_set_frequency(machine().device(BEEPER_TAG),800); // TODO: determine exact frequency thru schematics
251   beep_set_state(machine().device(BEEPER_TAG),0);
250   machine().device<beep_device>(BEEPER_TAG)->set_frequency(800); // TODO: determine exact frequency thru schematics
251   machine().device<beep_device>(BEEPER_TAG)->set_state(0);
252252}
253253
254254void destiny_state::machine_reset()
trunk/src/mame/drivers/ninjaw.c
r21620r21621
364364WRITE16_MEMBER(ninjaw_state::ninjaw_sound_w)
365365{
366366   if (offset == 0)
367      tc0140syt_port_w(m_tc0140syt, space, 0, data & 0xff);
367      m_tc0140syt->tc0140syt_port_w(space, 0, data & 0xff);
368368   else if (offset == 1)
369      tc0140syt_comm_w(m_tc0140syt, space, 0, data & 0xff);
369      m_tc0140syt->tc0140syt_comm_w(space, 0, data & 0xff);
370370
371371#ifdef MAME_DEBUG
372372   if (data & 0xff00)
r21620r21621
377377READ16_MEMBER(ninjaw_state::ninjaw_sound_r)
378378{
379379   if (offset == 1)
380      return ((tc0140syt_comm_r(m_tc0140syt, space, 0) & 0xff));
380      return ((m_tc0140syt->tc0140syt_comm_r(space, 0) & 0xff));
381381   else
382382      return 0;
383383}
r21620r21621
489489   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank10")
490490   AM_RANGE(0xc000, 0xdfff) AM_RAM
491491   AM_RANGE(0xe000, 0xe003) AM_DEVREADWRITE_LEGACY("ymsnd", ym2610_r,ym2610_w)
492   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_DEVWRITE_LEGACY("tc0140syt", tc0140syt_slave_port_w)
493   AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE_LEGACY("tc0140syt", tc0140syt_slave_comm_r,tc0140syt_slave_comm_w)
492   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_port_w)
493   AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_comm_r,tc0140syt_slave_comm_w)
494494   AM_RANGE(0xe400, 0xe403) AM_WRITE(ninjaw_pancontrol) /* pan */
495495   AM_RANGE(0xea00, 0xea00) AM_READNOP
496496   AM_RANGE(0xee00, 0xee00) AM_WRITENOP /* ? */
r21620r21621
800800   m_maincpu = machine().device<cpu_device>("maincpu");
801801   m_audiocpu = machine().device<cpu_device>("audiocpu");
802802   m_subcpu = machine().device<cpu_device>("sub");
803   m_tc0140syt = machine().device("tc0140syt");
803   m_tc0140syt = machine().device<tc0140syt_device>("tc0140syt");
804804   m_tc0100scn_1 = machine().device("tc0100scn_1");
805805   m_tc0100scn_2 = machine().device("tc0100scn_2");
806806   m_tc0100scn_3 = machine().device("tc0100scn_3");
trunk/src/mame/drivers/topspeed.c
r21620r21621
419419
420420WRITE8_MEMBER(topspeed_state::topspeed_tc0140syt_comm_w)
421421{
422   device_t *device = machine().device("tc0140syt");
422   tc0140syt_device *device = machine().device<tc0140syt_device>("tc0140syt");
423423   machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
424   tc0140syt_comm_w(device, space, 0, data);
424   device->tc0140syt_comm_w(space, 0, data);
425425}
426426
427427static void topspeed_msm5205_clock( device_t *device, int chip )
r21620r21621
502502   AM_RANGE(0x400000, 0x40ffff) AM_READWRITE(sharedram_r, sharedram_w) AM_SHARE("sharedram")
503503   AM_RANGE(0x500000, 0x503fff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_word_w) AM_SHARE("paletteram")
504504   AM_RANGE(0x600002, 0x600003) AM_WRITE(cpua_ctrl_w)
505   AM_RANGE(0x7e0000, 0x7e0001) AM_READNOP AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0x00ff)
506   AM_RANGE(0x7e0002, 0x7e0003) AM_DEVREAD8_LEGACY("tc0140syt", tc0140syt_comm_r, 0x00ff) AM_WRITE8(topspeed_tc0140syt_comm_w, 0x00ff)
505   AM_RANGE(0x7e0000, 0x7e0001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0x00ff)
506   AM_RANGE(0x7e0002, 0x7e0003) AM_DEVREAD8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, 0x00ff) AM_WRITE8(topspeed_tc0140syt_comm_w, 0x00ff)
507507   AM_RANGE(0x800000, 0x8003ff) AM_RAM AM_SHARE("raster_ctrl")
508508   AM_RANGE(0x800400, 0x80ffff) AM_RAM
509509   AM_RANGE(0xa00000, 0xa0ffff) AM_DEVREADWRITE_LEGACY("pc080sn_1", pc080sn_word_r, pc080sn_word_w)
r21620r21621
534534   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank10")
535535   AM_RANGE(0x8000, 0x8fff) AM_RAM
536536   AM_RANGE(0x9000, 0x9001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
537   AM_RANGE(0xa000, 0xa000) AM_DEVWRITE_LEGACY("tc0140syt", tc0140syt_slave_port_w)
538   AM_RANGE(0xa001, 0xa001) AM_DEVREADWRITE_LEGACY("tc0140syt", tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
537   AM_RANGE(0xa000, 0xa000) AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_port_w)
538   AM_RANGE(0xa001, 0xa001) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
539539   AM_RANGE(0xb000, 0xd3ff) AM_WRITE(topspeed_msm5205_command_w)
540540   AM_RANGE(0xd400, 0xd400) AM_WRITENOP // ym2151 volume
541541   AM_RANGE(0xd600, 0xd600) AM_WRITENOP // ym2151 volume
trunk/src/mame/drivers/taito_f2.c
r21620r21621
684684   AM_RANGE(0x100000, 0x10ffff) AM_RAM
685685   AM_RANGE(0x200000, 0x200007) AM_DEVREADWRITE_LEGACY("tc0110pcr", tc0110pcr_word_r, tc0110pcr_word_w)    /* palette */
686686   AM_RANGE(0x300000, 0x30000f) AM_DEVREADWRITE8_LEGACY("tc0220ioc", tc0220ioc_r, tc0220ioc_w, 0x00ff)
687   AM_RANGE(0x320000, 0x320001) AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0x00ff)
688   AM_RANGE(0x320002, 0x320003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff)
687   AM_RANGE(0x320000, 0x320001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0x00ff)
688   AM_RANGE(0x320002, 0x320003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff)
689689   AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_word_r, tc0100scn_word_w)    /* tilemaps */
690690   AM_RANGE(0x810000, 0x81ffff) AM_WRITENOP   /* error in game init code ? */
691691   AM_RANGE(0x820000, 0x82000f) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_ctrl_word_r, tc0100scn_ctrl_word_w)
r21620r21621
698698   AM_RANGE(0x100000, 0x10ffff) AM_RAM
699699   AM_RANGE(0x200000, 0x201fff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_word_w) AM_SHARE("paletteram")
700700   AM_RANGE(0x300000, 0x30000f) AM_DEVREADWRITE8_LEGACY("tc0220ioc", tc0220ioc_r, tc0220ioc_w, 0x00ff)
701   AM_RANGE(0x320000, 0x320001) AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0xff00)
702   AM_RANGE(0x320002, 0x320003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
701   AM_RANGE(0x320000, 0x320001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
702   AM_RANGE(0x320002, 0x320003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
703703   AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_word_r, tc0100scn_word_w)    /* tilemaps */
704704   AM_RANGE(0x820000, 0x82000f) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_ctrl_word_r, tc0100scn_ctrl_word_w)
705705   AM_RANGE(0x900000, 0x90ffff) AM_RAM AM_SHARE("spriteram")
r21620r21621
710710
711711static ADDRESS_MAP_START( megab_map, AS_PROGRAM, 16, taitof2_state )
712712   AM_RANGE(0x000000, 0x07ffff) AM_ROM
713   AM_RANGE(0x100000, 0x100001) AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0xff00)
714   AM_RANGE(0x100002, 0x100003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
713   AM_RANGE(0x100000, 0x100001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
714   AM_RANGE(0x100002, 0x100003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
715715   AM_RANGE(0x120000, 0x12000f) AM_DEVREADWRITE8_LEGACY("tc0220ioc", tc0220ioc_r, tc0220ioc_w, 0x00ff)
716716   AM_RANGE(0x180000, 0x180fff) AM_READWRITE(cchip2_word_r, cchip2_word_w) AM_SHARE("cchip2_ram")
717717   AM_RANGE(0x200000, 0x20ffff) AM_RAM
r21620r21621
727727   AM_RANGE(0x000000, 0x07ffff) AM_ROM
728728   AM_RANGE(0x100000, 0x101fff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_word_w) AM_SHARE("paletteram")
729729   AM_RANGE(0x200000, 0x20000f) AM_DEVREADWRITE8_LEGACY("tc0220ioc", tc0220ioc_r, tc0220ioc_w, 0x00ff)
730   AM_RANGE(0x220000, 0x220001) AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0xff00)
731   AM_RANGE(0x220002, 0x220003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
730   AM_RANGE(0x220000, 0x220001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
731   AM_RANGE(0x220002, 0x220003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
732732   AM_RANGE(0x300000, 0x30ffff) AM_RAM
733733   AM_RANGE(0x400000, 0x40ffff) AM_DEVREADWRITE_LEGACY("tc0100scn_1", tc0100scn_word_r, tc0100scn_word_w)  /* tilemaps */
734734   AM_RANGE(0x420000, 0x42000f) AM_DEVREADWRITE_LEGACY("tc0100scn_1", tc0100scn_ctrl_word_r, tc0100scn_ctrl_word_w)
r21620r21621
744744   AM_RANGE(0x200000, 0x201fff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_word_w) AM_SHARE("paletteram")
745745   AM_RANGE(0x300000, 0x30000f) AM_DEVREADWRITE8_LEGACY("tc0220ioc", tc0220ioc_r, tc0220ioc_w, 0x00ff)
746746   AM_RANGE(0x300018, 0x30001f) AM_READ(cameltry_paddle_r)
747   AM_RANGE(0x320000, 0x320001) AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0xff00)
748   AM_RANGE(0x320002, 0x320003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
747   AM_RANGE(0x320000, 0x320001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
748   AM_RANGE(0x320002, 0x320003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
749749   AM_RANGE(0x800000, 0x813fff) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_word_r, tc0100scn_word_w)    /* tilemaps */
750750   AM_RANGE(0x820000, 0x82000f) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_ctrl_word_r, tc0100scn_ctrl_word_w)
751751   AM_RANGE(0x900000, 0x90ffff) AM_RAM AM_SHARE("spriteram")
r21620r21621
759759   AM_RANGE(0x100000, 0x10ffff) AM_RAM
760760   AM_RANGE(0x200000, 0x200007) AM_DEVREADWRITE_LEGACY("tc0110pcr", tc0110pcr_word_r, tc0110pcr_word_w)    /* palette */
761761   AM_RANGE(0x500000, 0x50000f) AM_DEVREADWRITE8_LEGACY("tc0220ioc", tc0220ioc_r, tc0220ioc_w, 0x00ff)
762   AM_RANGE(0x600000, 0x600001) AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0xff00)
763   AM_RANGE(0x600002, 0x600003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
762   AM_RANGE(0x600000, 0x600001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
763   AM_RANGE(0x600002, 0x600003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
764764   AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_word_r, tc0100scn_word_w)    /* tilemaps */
765765   AM_RANGE(0x820000, 0x82000f) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_ctrl_word_r, tc0100scn_ctrl_word_w)
766766   AM_RANGE(0x900000, 0x90ffff) AM_RAM AM_SHARE("spriteram")
r21620r21621
772772   AM_RANGE(0x100000, 0x10ffff) AM_RAM
773773   AM_RANGE(0x200000, 0x201fff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_word_w) AM_SHARE("paletteram")
774774   AM_RANGE(0x300000, 0x30000f) AM_DEVREADWRITE8_LEGACY("tc0220ioc", tc0220ioc_r, tc0220ioc_w, 0x00ff)
775   AM_RANGE(0x320000, 0x320001) AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0x00ff)
776   AM_RANGE(0x320002, 0x320003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff)
775   AM_RANGE(0x320000, 0x320001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0x00ff)
776   AM_RANGE(0x320002, 0x320003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff)
777777   AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_word_r, tc0100scn_word_w)    /* tilemaps */
778778   AM_RANGE(0x820000, 0x82000f) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_ctrl_word_r, tc0100scn_ctrl_word_w)
779779   AM_RANGE(0x900000, 0x90ffff) AM_RAM AM_SHARE("spriteram")
r21620r21621
792792   AM_RANGE(0x580000, 0x580001) AM_READ_PORT("DSWA")
793793   AM_RANGE(0x580002, 0x580003) AM_READ_PORT("IN1")
794794   AM_RANGE(0x580004, 0x580005) AM_READ_PORT("IN2")
795   AM_RANGE(0x600000, 0x600001) AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0x00ff)
796   AM_RANGE(0x600002, 0x600003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff)
795   AM_RANGE(0x600000, 0x600001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0x00ff)
796   AM_RANGE(0x600002, 0x600003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff)
797797   AM_RANGE(0x680000, 0x680001) AM_WRITENOP   /* ??? */
798798   AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_word_r, tc0100scn_word_w)    /* tilemaps */
799799   AM_RANGE(0x810000, 0x81ffff) AM_WRITENOP   /* error in init code ? */
r21620r21621
806806   AM_RANGE(0x100000, 0x10000f) AM_DEVREADWRITE_LEGACY("tc0510nio", tc0510nio_halfword_r, tc0510nio_halfword_w)
807807   AM_RANGE(0x200000, 0x20ffff) AM_RAM
808808   AM_RANGE(0x300000, 0x301fff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_word_w) AM_SHARE("paletteram")
809   AM_RANGE(0x400000, 0x400001) AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0xff00)
810   AM_RANGE(0x400002, 0x400003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
809   AM_RANGE(0x400000, 0x400001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
810   AM_RANGE(0x400002, 0x400003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
811811//  AM_RANGE(0x500000, 0x500001) AM_WRITENOP   /* ?? */
812812   AM_RANGE(0x600000, 0x60ffff) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_word_r, tc0100scn_word_w)    /* tilemaps (not used) */
813813   AM_RANGE(0x620000, 0x62000f) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_ctrl_word_r, tc0100scn_ctrl_word_w)
r21620r21621
819819   AM_RANGE(0x100000, 0x10ffff) AM_RAM
820820   AM_RANGE(0x200000, 0x201fff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_word_w) AM_SHARE("paletteram")
821821   AM_RANGE(0x300000, 0x30000f) AM_DEVREADWRITE_LEGACY("tc0510nio", tc0510nio_halfword_wordswap_r, tc0510nio_halfword_wordswap_w)
822   AM_RANGE(0x320000, 0x320001) AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0xff00)
823   AM_RANGE(0x320002, 0x320003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
822   AM_RANGE(0x320000, 0x320001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
823   AM_RANGE(0x320002, 0x320003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
824824   AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_word_r, tc0100scn_word_w)    /* tilemaps */
825825   AM_RANGE(0x820000, 0x82000f) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_ctrl_word_r, tc0100scn_ctrl_word_w)
826826   AM_RANGE(0x900000, 0x90ffff) AM_RAM AM_SHARE("spriteram")
r21620r21621
839839   AM_RANGE(0x320002, 0x320003) AM_READ_PORT("IN1")
840840   AM_RANGE(0x320004, 0x320005) AM_READ_PORT("IN2")
841841   AM_RANGE(0x340000, 0x340001) AM_WRITE(watchdog_reset16_w)
842   AM_RANGE(0x400000, 0x400001) AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0xff00)
843   AM_RANGE(0x400002, 0x400003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
842   AM_RANGE(0x400000, 0x400001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
843   AM_RANGE(0x400002, 0x400003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
844844   AM_RANGE(0x500000, 0x50000f) AM_WRITE(taitof2_spritebank_w)
845845   AM_RANGE(0x504000, 0x504001) AM_WRITENOP    /* unknown... various values */
846846   AM_RANGE(0x508000, 0x50800f) AM_READ_PORT("IN3")
r21620r21621
861861   AM_RANGE(0x320000, 0x320001) AM_WRITE(mjnquest_inputselect_w)
862862   AM_RANGE(0x330000, 0x330001) AM_WRITENOP   /* watchdog ? */
863863   AM_RANGE(0x350000, 0x350001) AM_WRITENOP   /* watchdog ? */
864   AM_RANGE(0x360000, 0x360001) AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0xff00)
865   AM_RANGE(0x360002, 0x360003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
864   AM_RANGE(0x360000, 0x360001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
865   AM_RANGE(0x360002, 0x360003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
866866   AM_RANGE(0x380000, 0x380001) AM_DEVWRITE_LEGACY("tc0100scn", tc0100scn_gfxbank_w)   /* scr gfx bank select */
867867   AM_RANGE(0x400000, 0x40ffff) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_word_r, tc0100scn_word_w)    /* tilemaps */
868868   AM_RANGE(0x420000, 0x42000f) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_ctrl_word_r, tc0100scn_ctrl_word_w)
r21620r21621
887887   AM_RANGE(0x70000e, 0x70000f) AM_READ_PORT("IN3")
888888   AM_RANGE(0x700010, 0x700011) AM_READ_PORT("IN4")
889889   AM_RANGE(0x800000, 0x800001) AM_WRITE(watchdog_reset16_w)   /* ??? */
890   AM_RANGE(0xa00000, 0xa00001) AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0x00ff)
891   AM_RANGE(0xa00002, 0xa00003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff)
890   AM_RANGE(0xa00000, 0xa00001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0x00ff)
891   AM_RANGE(0xa00002, 0xa00003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff)
892892ADDRESS_MAP_END
893893
894894static ADDRESS_MAP_START( koshien_map, AS_PROGRAM, 16, taitof2_state )
r21620r21621
896896   AM_RANGE(0x100000, 0x10ffff) AM_RAM
897897   AM_RANGE(0x200000, 0x201fff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_word_w) AM_SHARE("paletteram")
898898   AM_RANGE(0x300000, 0x30000f) AM_DEVREADWRITE_LEGACY("tc0510nio", tc0510nio_halfword_r, tc0510nio_halfword_w)
899   AM_RANGE(0x320000, 0x320001) AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0xff00)
900   AM_RANGE(0x320002, 0x320003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
899   AM_RANGE(0x320000, 0x320001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
900   AM_RANGE(0x320002, 0x320003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
901901   AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_word_r, tc0100scn_word_w)    /* tilemaps */
902902   AM_RANGE(0x820000, 0x82000f) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_ctrl_word_r, tc0100scn_ctrl_word_w)
903903   AM_RANGE(0x900000, 0x90ffff) AM_RAM AM_SHARE("spriteram")
r21620r21621
908908static ADDRESS_MAP_START( yuyugogo_map, AS_PROGRAM, 16, taitof2_state )
909909   AM_RANGE(0x000000, 0x03ffff) AM_ROM
910910   AM_RANGE(0x200000, 0x20000f) AM_DEVREADWRITE_LEGACY("tc0510nio", tc0510nio_halfword_r, tc0510nio_halfword_w)
911   AM_RANGE(0x400000, 0x400001) AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0xff00)
912   AM_RANGE(0x400002, 0x400003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
911   AM_RANGE(0x400000, 0x400001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
912   AM_RANGE(0x400002, 0x400003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
913913   AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_word_r, tc0100scn_word_w)    /* tilemaps */
914914   AM_RANGE(0x820000, 0x82000f) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_ctrl_word_r, tc0100scn_ctrl_word_w)
915915   AM_RANGE(0x900000, 0x90ffff) AM_RAM AM_SHARE("spriteram")
r21620r21621
926926   AM_RANGE(0x300000, 0x30000f) AM_READ(ninjak_input_r)
927927   AM_RANGE(0x30000e, 0x30000f) AM_WRITE(ninjak_coin_word_w)
928928   AM_RANGE(0x380000, 0x380001) AM_WRITE(watchdog_reset16_w)   /* ??? */
929   AM_RANGE(0x400000, 0x400001) AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0xff00)
930   AM_RANGE(0x400002, 0x400003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
929   AM_RANGE(0x400000, 0x400001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
930   AM_RANGE(0x400002, 0x400003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
931931   AM_RANGE(0x600000, 0x60000f) AM_WRITE(taitof2_spritebank_w)
932932   AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_word_r, tc0100scn_word_w)    /* tilemaps */
933933   AM_RANGE(0x820000, 0x82000f) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_ctrl_word_r, tc0100scn_ctrl_word_w)
r21620r21621
946946   AM_RANGE(0x320002, 0x320003) AM_READ_PORT("IN1")
947947   AM_RANGE(0x320004, 0x320005) AM_READ_PORT("IN2")
948948   AM_RANGE(0x340000, 0x340001) AM_WRITE(watchdog_reset16_w)   /* NOT VERIFIED */
949   AM_RANGE(0x400000, 0x400001) AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0xff00)
950   AM_RANGE(0x400002, 0x400003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
949   AM_RANGE(0x400000, 0x400001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
950   AM_RANGE(0x400002, 0x400003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
951951   AM_RANGE(0x500000, 0x50000f) AM_WRITE(taitof2_spritebank_w)
952952   AM_RANGE(0x504000, 0x504001) AM_WRITENOP    /* unknown... various values */
953953   AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_word_r, tc0100scn_word_w)    /* tilemaps */
r21620r21621
959959static ADDRESS_MAP_START( qzquest_map, AS_PROGRAM, 16, taitof2_state )
960960   AM_RANGE(0x000000, 0x17ffff) AM_ROM
961961   AM_RANGE(0x200000, 0x20000f) AM_DEVREADWRITE_LEGACY("tc0510nio", tc0510nio_halfword_r, tc0510nio_halfword_w)
962   AM_RANGE(0x300000, 0x300001) AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0x00ff)
963   AM_RANGE(0x300002, 0x300003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff)
962   AM_RANGE(0x300000, 0x300001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0x00ff)
963   AM_RANGE(0x300002, 0x300003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff)
964964   AM_RANGE(0x400000, 0x401fff) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_word_w) AM_SHARE("paletteram")
965965   AM_RANGE(0x500000, 0x50ffff) AM_RAM
966966   AM_RANGE(0x600000, 0x60ffff) AM_RAM AM_SHARE("spriteram")
r21620r21621
970970
971971static ADDRESS_MAP_START( pulirula_map, AS_PROGRAM, 16, taitof2_state )
972972   AM_RANGE(0x000000, 0x0bffff) AM_ROM
973   AM_RANGE(0x200000, 0x200001) AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0xff00)
974   AM_RANGE(0x200002, 0x200003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
973   AM_RANGE(0x200000, 0x200001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
974   AM_RANGE(0x200002, 0x200003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
975975   AM_RANGE(0x300000, 0x30ffff) AM_RAM
976976   AM_RANGE(0x400000, 0x401fff) AM_DEVREADWRITE_LEGACY("tc0430grw", tc0430grw_word_r, tc0430grw_word_w)    /* ROZ tilemap */
977977   AM_RANGE(0x402000, 0x40200f) AM_DEVWRITE_LEGACY("tc0430grw", tc0430grw_ctrl_word_w)
r21620r21621
995995   AM_RANGE(0x600000, 0x60001f) AM_DEVWRITE8_LEGACY("tc0360pri", tc0360pri_w, 0x00ff)
996996   AM_RANGE(0x700000, 0x703fff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_word_w) AM_SHARE("paletteram")
997997   AM_RANGE(0x800000, 0x80000f) AM_DEVREADWRITE_LEGACY("tc0510nio", tc0510nio_halfword_wordswap_r, tc0510nio_halfword_wordswap_w)
998   AM_RANGE(0x900000, 0x900001) AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0xff00)
999   AM_RANGE(0x900002, 0x900003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
998   AM_RANGE(0x900000, 0x900001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
999   AM_RANGE(0x900002, 0x900003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
10001000//  AM_RANGE(0xa00000, 0xa00001) AM_WRITENOP   /* ??? */
10011001ADDRESS_MAP_END
10021002
10031003static ADDRESS_MAP_START( qzchikyu_map, AS_PROGRAM, 16, taitof2_state )
10041004   AM_RANGE(0x000000, 0x17ffff) AM_ROM
10051005   AM_RANGE(0x200000, 0x20000f) AM_DEVREADWRITE_LEGACY("tc0510nio", tc0510nio_halfword_r, tc0510nio_halfword_w)
1006   AM_RANGE(0x300000, 0x300001) AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0x00ff)
1007   AM_RANGE(0x300002, 0x300003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff)
1006   AM_RANGE(0x300000, 0x300001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0x00ff)
1007   AM_RANGE(0x300002, 0x300003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff)
10081008   AM_RANGE(0x400000, 0x401fff) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_word_w) AM_SHARE("paletteram")
10091009   AM_RANGE(0x500000, 0x50ffff) AM_RAM
10101010   AM_RANGE(0x600000, 0x60ffff) AM_RAM AM_SHARE("spriteram")
r21620r21621
10201020   AM_RANGE(0x520000, 0x52000f) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_ctrl_word_r, tc0100scn_ctrl_word_w)
10211021   AM_RANGE(0x600000, 0x601fff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_word_w) AM_SHARE("paletteram")
10221022//  AM_RANGE(0x700000, 0x70000b) AM_READ_LEGACY(yesnoj_unknown_r)   /* what's this? */
1023   AM_RANGE(0x800000, 0x800001) AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0xff00)
1024   AM_RANGE(0x800002, 0x800003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
1023   AM_RANGE(0x800000, 0x800001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
1024   AM_RANGE(0x800002, 0x800003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
10251025   AM_RANGE(0x900002, 0x900003) AM_WRITENOP   /* lots of similar writes */
10261026   AM_RANGE(0xa00000, 0xa00001) AM_READ_PORT("IN0")
10271027   AM_RANGE(0xa00002, 0xa00003) AM_READ_PORT("IN1")
r21620r21621
10481048   AM_RANGE(0x70000a, 0x70000b) AM_READ_PORT("IN0")
10491049   AM_RANGE(0x70000c, 0x70000d) AM_READ_PORT("IN1")
10501050   AM_RANGE(0x800000, 0x800001) AM_WRITE(watchdog_reset16_w)   /* ??? */
1051   AM_RANGE(0xa00000, 0xa00001) AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0xff00)
1052   AM_RANGE(0xa00002, 0xa00003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
1051   AM_RANGE(0xa00000, 0xa00001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
1052   AM_RANGE(0xa00002, 0xa00003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
10531053ADDRESS_MAP_END
10541054
10551055static ADDRESS_MAP_START( dinorex_map, AS_PROGRAM, 16, taitof2_state )
r21620r21621
10621062   AM_RANGE(0x800000, 0x80ffff) AM_RAM AM_SHARE("spriteram")
10631063   AM_RANGE(0x900000, 0x90ffff) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_word_r, tc0100scn_word_w)    /* tilemaps */
10641064   AM_RANGE(0x920000, 0x92000f) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_ctrl_word_r, tc0100scn_ctrl_word_w)
1065   AM_RANGE(0xa00000, 0xa00001) AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0xff00)
1066   AM_RANGE(0xa00002, 0xa00003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
1065   AM_RANGE(0xa00000, 0xa00001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
1066   AM_RANGE(0xa00002, 0xa00003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
10671067   AM_RANGE(0xb00000, 0xb00001) AM_WRITENOP   /* watchdog? */
10681068ADDRESS_MAP_END
10691069
10701070static ADDRESS_MAP_START( qjinsei_map, AS_PROGRAM, 16, taitof2_state )
10711071   AM_RANGE(0x000000, 0x1fffff) AM_ROM
1072   AM_RANGE(0x200000, 0x200001) AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0xff00)
1073   AM_RANGE(0x200002, 0x200003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
1072   AM_RANGE(0x200000, 0x200001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
1073   AM_RANGE(0x200002, 0x200003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
10741074   AM_RANGE(0x300000, 0x30ffff) AM_RAM
10751075   AM_RANGE(0x500000, 0x500001) AM_WRITENOP   /* watchdog ? */
10761076   AM_RANGE(0x600000, 0x603fff) AM_WRITE(taitof2_sprite_extension_w) AM_SHARE("sprite_ext")
r21620r21621
10871087   AM_RANGE(0x100000, 0x10ffff) AM_RAM
10881088//  AM_RANGE(0x200000, 0x200001) AM_WRITENOP   /* unknown */
10891089   AM_RANGE(0x300000, 0x3fffff) AM_ROM AM_REGION("extra", 0)   /* extra data rom */
1090   AM_RANGE(0x500000, 0x500001) AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0xff00)
1091   AM_RANGE(0x500002, 0x500003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
1090   AM_RANGE(0x500000, 0x500001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
1091   AM_RANGE(0x500002, 0x500003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
10921092   AM_RANGE(0x600000, 0x603fff) AM_WRITE(taitof2_sprite_extension_w) AM_SHARE("sprite_ext")
10931093   AM_RANGE(0x700000, 0x701fff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_word_w) AM_SHARE("paletteram")
10941094   AM_RANGE(0x800000, 0x80ffff) AM_RAM AM_SHARE("spriteram")
r21620r21621
11081108   AM_RANGE(0x600000, 0x67ffff) AM_ROM AM_REGION("extra", 0)   /* extra data rom */
11091109   AM_RANGE(0x700000, 0x70000f) AM_DEVREADWRITE_LEGACY("tc0510nio", tc0510nio_halfword_r, tc0510nio_halfword_w)
11101110   AM_RANGE(0x900000, 0x90001f) AM_DEVWRITE8_LEGACY("tc0360pri", tc0360pri_w, 0x00ff)  /* ?? */
1111   AM_RANGE(0xa00000, 0xa00001) AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0xff00)
1112   AM_RANGE(0xa00002, 0xa00003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
1111   AM_RANGE(0xa00000, 0xa00001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
1112   AM_RANGE(0xa00002, 0xa00003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
11131113   AM_RANGE(0xb00000, 0xb017ff) AM_WRITE(taitof2_sprite_extension_w) AM_SHARE("sprite_ext")
11141114ADDRESS_MAP_END
11151115
11161116static ADDRESS_MAP_START( driftout_map, AS_PROGRAM, 16, taitof2_state )
11171117   AM_RANGE(0x000000, 0x0fffff) AM_ROM
1118   AM_RANGE(0x200000, 0x200001) AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0xff00)
1119   AM_RANGE(0x200002, 0x200003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
1118   AM_RANGE(0x200000, 0x200001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
1119   AM_RANGE(0x200002, 0x200003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
11201120   AM_RANGE(0x300000, 0x30ffff) AM_RAM
11211121   AM_RANGE(0x400000, 0x401fff) AM_DEVREADWRITE_LEGACY("tc0430grw", tc0430grw_word_r, tc0430grw_word_w)    /* ROZ tilemap */
11221122   AM_RANGE(0x402000, 0x40200f) AM_DEVWRITE_LEGACY("tc0430grw", tc0430grw_ctrl_word_w)
r21620r21621
11551155   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank2")
11561156   AM_RANGE(0xc000, 0xdfff) AM_RAM
11571157   AM_RANGE(0xe000, 0xe003) AM_DEVREADWRITE_LEGACY("ymsnd", ym2610_r, ym2610_w)
1158   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_DEVWRITE_LEGACY("tc0140syt", tc0140syt_slave_port_w)
1159   AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE_LEGACY("tc0140syt", tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
1158   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_port_w)
1159   AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
11601160   AM_RANGE(0xe400, 0xe403) AM_WRITENOP /* pan */
11611161   AM_RANGE(0xea00, 0xea00) AM_READNOP
11621162   AM_RANGE(0xee00, 0xee00) AM_WRITENOP /* ? */
r21620r21621
11711171   AM_RANGE(0x0000, 0x7fff) AM_ROM     // I can't see a bank control, but there ARE some bytes past 0x8000
11721172   AM_RANGE(0x8000, 0x8fff) AM_RAM
11731173   AM_RANGE(0x9000, 0x9001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2203_r, ym2203_w)
1174   AM_RANGE(0xa000, 0xa000) AM_DEVWRITE_LEGACY("tc0140syt", tc0140syt_slave_port_w)
1175   AM_RANGE(0xa001, 0xa001) AM_DEVREADWRITE_LEGACY("tc0140syt", tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
1174   AM_RANGE(0xa000, 0xa000) AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_port_w)
1175   AM_RANGE(0xa001, 0xa001) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
11761176//  AM_RANGE(0xb000, 0xb000) AM_WRITE_LEGACY(unknown_w)    // probably controlling sample player?
11771177   AM_RANGE(0xb000, 0xb001) AM_MIRROR(0x0001) AM_DEVREADWRITE("oki", okim6295_device, read, write)
11781178ADDRESS_MAP_END
trunk/src/mame/drivers/taito_x.c
r21620r21621
433433   AM_RANGE(0x400000, 0x400001) AM_WRITENOP    /* written each frame at $3aa2, mostly 0x10 */
434434   AM_RANGE(0x500000, 0x500007) AM_READ(superman_dsw_input_r)
435435   AM_RANGE(0x600000, 0x600001) AM_WRITENOP    /* written each frame at $3ab0, mostly 0x10 */
436   AM_RANGE(0x800000, 0x800001) AM_READNOP AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0x00ff)
437   AM_RANGE(0x800002, 0x800003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff)
436   AM_RANGE(0x800000, 0x800001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0x00ff)
437   AM_RANGE(0x800002, 0x800003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff)
438438   AM_RANGE(0x900000, 0x9007ff) AM_READWRITE_LEGACY(cchip1_ram_r, cchip1_ram_w)
439439   AM_RANGE(0x900802, 0x900803) AM_READWRITE_LEGACY(cchip1_ctrl_r, cchip1_ctrl_w)
440440   AM_RANGE(0x900c00, 0x900c01) AM_WRITE_LEGACY(cchip1_bank_w)
r21620r21621
450450//  AM_RANGE(0x400000, 0x400001) AM_WRITENOP    /* written each frame at $2ac, values change */
451451   AM_RANGE(0x500000, 0x50000f) AM_READ(superman_dsw_input_r)
452452//  AM_RANGE(0x600000, 0x600001) AM_WRITENOP    /* written each frame at $2a2, values change */
453   AM_RANGE(0x800000, 0x800001) AM_READNOP AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0x00ff)
454   AM_RANGE(0x800002, 0x800003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff)
453   AM_RANGE(0x800000, 0x800001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0x00ff)
454   AM_RANGE(0x800002, 0x800003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff)
455455   AM_RANGE(0x900000, 0x90000f) AM_READWRITE(daisenpu_input_r, daisenpu_input_w)
456456   AM_RANGE(0xb00000, 0xb00fff) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_word_w) AM_SHARE("paletteram")
457457   AM_RANGE(0xd00000, 0xd005ff) AM_RAM AM_DEVREADWRITE_LEGACY("spritegen", spriteylow_r16, spriteylow_w16) // Sprites Y
r21620r21621
465465   AM_RANGE(0x400000, 0x400001) AM_WRITENOP    /* 0x1 written each frame at $d42, watchdog? */
466466   AM_RANGE(0x500000, 0x500007) AM_READ(superman_dsw_input_r)
467467   AM_RANGE(0x600000, 0x600001) AM_WRITENOP    /* 0x1 written each frame at $d3c, watchdog? */
468   AM_RANGE(0x800000, 0x800001) AM_READNOP AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0x00ff)
469   AM_RANGE(0x800002, 0x800003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff)
468   AM_RANGE(0x800000, 0x800001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0x00ff)
469   AM_RANGE(0x800002, 0x800003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff)
470470   AM_RANGE(0x900000, 0x90000f) AM_READWRITE(daisenpu_input_r, daisenpu_input_w)
471471   AM_RANGE(0xb00000, 0xb00fff) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_word_w) AM_SHARE("paletteram")
472472   AM_RANGE(0xd00000, 0xd005ff) AM_RAM AM_DEVREADWRITE_LEGACY("spritegen", spriteylow_r16, spriteylow_w16) // Sprites Y
r21620r21621
480480   AM_RANGE(0x400000, 0x400001) AM_WRITENOP    /* 0x1 written each frame at $c56, watchdog? */
481481   AM_RANGE(0x500000, 0x50000f) AM_READ(superman_dsw_input_r)
482482   AM_RANGE(0x600000, 0x600001) AM_WRITENOP    /* 0x1 written each frame at $c4e, watchdog? */
483   AM_RANGE(0x800000, 0x800001) AM_READNOP AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0x00ff)
484   AM_RANGE(0x800002, 0x800003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff)
483   AM_RANGE(0x800000, 0x800001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0x00ff)
484   AM_RANGE(0x800002, 0x800003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff)
485485   AM_RANGE(0x900000, 0x90000f) AM_READWRITE(daisenpu_input_r, daisenpu_input_w)
486486   AM_RANGE(0xb00000, 0xb00fff) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_word_w) AM_SHARE("paletteram")
487487   AM_RANGE(0xd00000, 0xd005ff) AM_RAM AM_DEVREADWRITE_LEGACY("spritegen", spriteylow_r16, spriteylow_w16) // Sprites Y
r21620r21621
498498   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank2")
499499   AM_RANGE(0xc000, 0xdfff) AM_RAM
500500   AM_RANGE(0xe000, 0xe003) AM_DEVREADWRITE_LEGACY("ymsnd", ym2610_r, ym2610_w)
501   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_DEVWRITE_LEGACY("tc0140syt", tc0140syt_slave_port_w)
502   AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE_LEGACY("tc0140syt", tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
501   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_port_w)
502   AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
503503   AM_RANGE(0xe400, 0xe403) AM_WRITENOP /* pan */
504504   AM_RANGE(0xea00, 0xea00) AM_READNOP
505505   AM_RANGE(0xee00, 0xee00) AM_WRITENOP /* ? */
r21620r21621
512512   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank2")
513513   AM_RANGE(0xc000, 0xdfff) AM_RAM
514514   AM_RANGE(0xe000, 0xe001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
515   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_DEVWRITE_LEGACY("tc0140syt", tc0140syt_slave_port_w)
516   AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE_LEGACY("tc0140syt", tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
515   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_port_w)
516   AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
517517   AM_RANGE(0xe400, 0xe403) AM_WRITENOP /* pan */
518518   AM_RANGE(0xea00, 0xea00) AM_READNOP
519519   AM_RANGE(0xee00, 0xee00) AM_WRITENOP /* ? */
trunk/src/mame/drivers/exzisus.c
r21620r21621
151151   AM_RANGE(0xc000, 0xc5ff) AM_READWRITE(exzisus_objectram_0_r, exzisus_objectram_0_w) AM_SHARE("objectram0")
152152   AM_RANGE(0xc600, 0xdfff) AM_READWRITE(exzisus_videoram_0_r, exzisus_videoram_0_w) AM_SHARE("videoram0")
153153   AM_RANGE(0xe000, 0xefff) AM_RAM
154   AM_RANGE(0xf000, 0xf000) AM_READNOP AM_DEVWRITE_LEGACY("tc0140syt", tc0140syt_port_w)
155   AM_RANGE(0xf001, 0xf001) AM_DEVREADWRITE_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w)
154   AM_RANGE(0xf000, 0xf000) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_port_w)
155   AM_RANGE(0xf001, 0xf001) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w)
156156   AM_RANGE(0xf400, 0xf400) AM_READ_PORT("P1")
157157   AM_RANGE(0xf400, 0xf400) AM_WRITE(exzisus_cpub_bankswitch_w)
158158   AM_RANGE(0xf401, 0xf401) AM_READ_PORT("P2")
r21620r21621
176176   AM_RANGE(0x0000, 0x7fff) AM_ROM
177177   AM_RANGE(0x8000, 0x8fff) AM_RAM
178178   AM_RANGE(0x9000, 0x9001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
179   AM_RANGE(0xa000, 0xa000) AM_READNOP AM_DEVWRITE_LEGACY("tc0140syt", tc0140syt_slave_port_w)
180   AM_RANGE(0xa001, 0xa001) AM_DEVREADWRITE_LEGACY("tc0140syt", tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
179   AM_RANGE(0xa000, 0xa000) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_port_w)
180   AM_RANGE(0xa001, 0xa001) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
181181ADDRESS_MAP_END
182182
183183
trunk/src/mame/drivers/darius.c
r21620r21621
174174   switch (offset)
175175   {
176176      case 0x01:
177         return (tc0140syt_comm_r(m_tc0140syt, space, 0) & 0xff);    /* sound interface read */
177         return (m_tc0140syt->tc0140syt_comm_r(space, 0) & 0xff);    /* sound interface read */
178178
179179      case 0x04:
180180         return ioport("P1")->read();
r21620r21621
203203   {
204204      case 0x00:  /* sound interface write */
205205
206         tc0140syt_port_w(m_tc0140syt, space, 0, data & 0xff);
206         m_tc0140syt->tc0140syt_port_w(space, 0, data & 0xff);
207207         return;
208208
209209      case 0x01:  /* sound interface write */
210210
211         tc0140syt_comm_w(m_tc0140syt, space, 0, data & 0xff);
211         m_tc0140syt->tc0140syt_comm_w(space, 0, data & 0xff);
212212         return;
213213
214214      case 0x28:  /* unknown, written by both cpus - always 0? */
r21620r21621
466466   AM_RANGE(0x8000, 0x8fff) AM_RAM
467467   AM_RANGE(0x9000, 0x9001) AM_DEVREADWRITE_LEGACY("ym1", ym2203_r, ym2203_w)
468468   AM_RANGE(0xa000, 0xa001) AM_DEVREADWRITE_LEGACY("ym2", ym2203_r, ym2203_w)
469   AM_RANGE(0xb000, 0xb000) AM_READNOP AM_DEVWRITE_LEGACY("tc0140syt", tc0140syt_slave_port_w)
470   AM_RANGE(0xb001, 0xb001) AM_DEVREADWRITE_LEGACY("tc0140syt", tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
469   AM_RANGE(0xb000, 0xb000) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_port_w)
470   AM_RANGE(0xb001, 0xb001) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
471471   AM_RANGE(0xc000, 0xc000) AM_WRITE(darius_fm0_pan)
472472   AM_RANGE(0xc400, 0xc400) AM_WRITE(darius_fm1_pan)
473473   AM_RANGE(0xc800, 0xc800) AM_WRITE(darius_psg0_pan)
r21620r21621
830830   m_cpub = machine().device("cpub");
831831   m_adpcm = machine().device("adpcm");
832832   m_pc080sn = machine().device("pc080sn");
833   m_tc0140syt = machine().device("tc0140syt");
833   m_tc0140syt = machine().device<tc0140syt_device>("tc0140syt");
834834
835835   m_lscreen = machine().device("lscreen");
836836   m_mscreen = machine().device("mscreen");
trunk/src/mame/drivers/taito_z.c
r21620r21621
14171417WRITE16_MEMBER(taitoz_state::taitoz_sound_w)
14181418{
14191419   if (offset == 0)
1420      tc0140syt_port_w(m_tc0140syt, space, 0, data & 0xff);
1420      m_tc0140syt->tc0140syt_port_w(space, 0, data & 0xff);
14211421   else if (offset == 1)
1422      tc0140syt_comm_w(m_tc0140syt, space, 0, data & 0xff);
1422      m_tc0140syt->tc0140syt_comm_w(space, 0, data & 0xff);
14231423
14241424#ifdef MAME_DEBUG
14251425//  if (data & 0xff00)
r21620r21621
14351435READ16_MEMBER(taitoz_state::taitoz_sound_r)
14361436{
14371437   if (offset == 1)
1438      return (tc0140syt_comm_r(m_tc0140syt, space, 0) & 0xff);
1438      return (m_tc0140syt->tc0140syt_comm_r(space, 0) & 0xff);
14391439   else
14401440      return 0;
14411441}
r21620r21621
14441444WRITE16_MEMBER(taitoz_state::taitoz_msb_sound_w)
14451445{
14461446   if (offset == 0)
1447      tc0140syt_port_w(m_tc0140syt, 0, (data >> 8) & 0xff);
1447      m_tc0140syt->tc0140syt_port_w(0, (data >> 8) & 0xff);
14481448   else if (offset == 1)
1449      tc0140syt_comm_w(m_tc0140syt, 0, (data >> 8) & 0xff);
1449      m_tc0140syt->tc0140syt_comm_w(0, (data >> 8) & 0xff);
14501450
14511451#ifdef MAME_DEBUG
14521452   if (data & 0xff)
r21620r21621
14621462READ16_MEMBER(taitoz_state::taitoz_msb_sound_r)
14631463{
14641464   if (offset == 1)
1465      return ((tc0140syt_comm_r(m_tc0140syt, 0) & 0xff) << 8);
1465      return ((m_tc0140syt->tc0140syt_comm_r(0) & 0xff) << 8);
14661466   else
14671467      return 0;
14681468}
r21620r21621
17461746   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank10")
17471747   AM_RANGE(0xc000, 0xdfff) AM_RAM
17481748   AM_RANGE(0xe000, 0xe003) AM_DEVREADWRITE_LEGACY("ymsnd", ym2610_r, ym2610_w)
1749   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_DEVWRITE_LEGACY("tc0140syt", tc0140syt_slave_port_w)
1750   AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE_LEGACY("tc0140syt", tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
1749   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_port_w)
1750   AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
17511751   AM_RANGE(0xe400, 0xe403) AM_WRITE(taitoz_pancontrol) /* pan */
17521752   AM_RANGE(0xea00, 0xea00) AM_READNOP
17531753   AM_RANGE(0xee00, 0xee00) AM_WRITENOP /* ? */
r21620r21621
30393039   m_tc0150rod = machine().device("tc0150rod");
30403040   m_tc0480scp = machine().device("tc0480scp");
30413041   m_tc0220ioc = machine().device("tc0220ioc");
3042   m_tc0140syt = machine().device("tc0140syt");
3042   m_tc0140syt = machine().device<tc0140syt_device>("tc0140syt");
30433043
30443044   save_item(NAME(m_cpua_ctrl));
30453045
trunk/src/mame/drivers/wgp.c
r21620r21621
614614WRITE16_MEMBER(wgp_state::wgp_sound_w)
615615{
616616   if (offset == 0)
617      tc0140syt_port_w(m_tc0140syt, space, 0, data & 0xff);
617      m_tc0140syt->tc0140syt_port_w(space, 0, data & 0xff);
618618   else if (offset == 1)
619      tc0140syt_comm_w(m_tc0140syt, space, 0, data & 0xff);
619      m_tc0140syt->tc0140syt_comm_w(space, 0, data & 0xff);
620620}
621621
622622READ16_MEMBER(wgp_state::wgp_sound_r)
623623{
624624   if (offset == 1)
625      return ((tc0140syt_comm_r(m_tc0140syt, space, 0) & 0xff));
625      return ((m_tc0140syt->tc0140syt_comm_r(space, 0) & 0xff));
626626   else
627627      return 0;
628628}
r21620r21621
671671   AM_RANGE(0x0000, 0x7fff) AM_ROM
672672   AM_RANGE(0xc000, 0xdfff) AM_RAM
673673   AM_RANGE(0xe000, 0xe003) AM_DEVREADWRITE_LEGACY("ymsnd", ym2610_r, ym2610_w)
674   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_DEVWRITE_LEGACY("tc0140syt", tc0140syt_slave_port_w)
675   AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE_LEGACY("tc0140syt", tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
674   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_port_w)
675   AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
676676   AM_RANGE(0xe400, 0xe403) AM_WRITENOP /* pan */
677677   AM_RANGE(0xea00, 0xea00) AM_READNOP
678678   AM_RANGE(0xee00, 0xee00) AM_WRITENOP /* ? */
r21620r21621
940940   m_maincpu = machine().device<cpu_device>("maincpu");
941941   m_audiocpu = machine().device<cpu_device>("audiocpu");
942942   m_subcpu = machine().device<cpu_device>("sub");
943   m_tc0140syt = machine().device("tc0140syt");
943   m_tc0140syt = machine().device<tc0140syt_device>("tc0140syt");
944944   m_tc0100scn = machine().device("tc0100scn");
945945
946946   save_item(NAME(m_cpua_ctrl));
trunk/src/mame/drivers/mlanding.c
r21620r21621
346346
347347WRITE16_MEMBER(mlanding_state::ml_to_sound_w)
348348{
349   device_t *tc0140syt = machine().device("tc0140syt");
349   tc0140syt_device *tc0140syt = machine().device<tc0140syt_device>("tc0140syt");
350350   if (offset == 0)
351      tc0140syt_port_w(tc0140syt, space, 0, data & 0xff);
351      tc0140syt->tc0140syt_port_w(space, 0, data & 0xff);
352352   else if (offset == 1)
353353   {
354354      //machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
355      tc0140syt_comm_w(tc0140syt, space, 0, data & 0xff);
355      tc0140syt->tc0140syt_comm_w(space, 0, data & 0xff);
356356   }
357357}
358358
359359WRITE8_MEMBER(mlanding_state::ml_sound_to_main_w)
360360{
361   device_t *tc0140syt = machine().device("tc0140syt");
361   tc0140syt_device *tc0140syt = machine().device<tc0140syt_device>("tc0140syt");
362362   if (offset == 0)
363      tc0140syt_slave_port_w(tc0140syt, space, 0, data & 0xff);
363      tc0140syt->tc0140syt_slave_port_w(space, 0, data & 0xff);
364364   else if (offset == 1)
365365   {
366366      //machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_NMI, CLEAR_LINE);
367      tc0140syt_slave_comm_w(tc0140syt, space, 0, data & 0xff);
367      tc0140syt->tc0140syt_slave_comm_w(space, 0, data & 0xff);
368368   }
369369}
370370
r21620r21621
489489
490490   AM_RANGE(0x2d0000, 0x2d0003) AM_WRITE(ml_to_sound_w)
491491   AM_RANGE(0x2d0000, 0x2d0001) AM_READNOP
492   AM_RANGE(0x2d0002, 0x2d0003) AM_DEVREAD8_LEGACY("tc0140syt", tc0140syt_comm_r, 0x00ff)
492   AM_RANGE(0x2d0002, 0x2d0003) AM_DEVREAD8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, 0x00ff)
493493
494494   AM_RANGE(0x200000, 0x20ffff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_word_w) AM_SHARE("paletteram")
495495   AM_RANGE(0x280000, 0x2807ff) AM_READWRITE(ml_mecha_ram_r,ml_mecha_ram_w)
r21620r21621
542542   AM_RANGE(0x8000, 0x8fff) AM_RAM
543543   AM_RANGE(0x9000, 0x9001) AM_MIRROR(0x00fe) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
544544   AM_RANGE(0xa000, 0xa001) AM_WRITE(ml_sound_to_main_w)
545   AM_RANGE(0xa001, 0xa001) AM_DEVREAD_LEGACY("tc0140syt", tc0140syt_slave_comm_r)
545   AM_RANGE(0xa001, 0xa001) AM_DEVREAD("tc0140syt", tc0140syt_device, tc0140syt_slave_comm_r)
546546
547547//  AM_RANGE(0xb000, 0xb000) AM_WRITE_LEGACY(ml_msm5205_address_w) //guess
548548//  AM_RANGE(0xc000, 0xc000) AM_DEVWRITE_LEGACY("msm", ml_msm5205_start_w)
trunk/src/mame/drivers/warriorb.c
r21620r21621
178178WRITE16_MEMBER(warriorb_state::warriorb_sound_w)
179179{
180180   if (offset == 0)
181      tc0140syt_port_w(m_tc0140syt, space, 0, data & 0xff);
181      m_tc0140syt->tc0140syt_port_w(space, 0, data & 0xff);
182182   else if (offset == 1)
183      tc0140syt_comm_w(m_tc0140syt, space, 0, data & 0xff);
183      m_tc0140syt->tc0140syt_comm_w(space, 0, data & 0xff);
184184}
185185
186186READ16_MEMBER(warriorb_state::warriorb_sound_r)
187187{
188188   if (offset == 1)
189      return ((tc0140syt_comm_r(m_tc0140syt, space, 0) & 0xff));
189      return ((m_tc0140syt->tc0140syt_comm_r(space, 0) & 0xff));
190190   else
191191      return 0;
192192}
r21620r21621
259259   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank10")
260260   AM_RANGE(0xc000, 0xdfff) AM_RAM
261261   AM_RANGE(0xe000, 0xe003) AM_DEVREADWRITE_LEGACY("ymsnd", ym2610_r, ym2610_w)
262   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_DEVWRITE_LEGACY("tc0140syt", tc0140syt_slave_port_w)
263   AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE_LEGACY("tc0140syt", tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
262   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_port_w)
263   AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
264264   AM_RANGE(0xe400, 0xe403) AM_WRITE(warriorb_pancontrol) /* pan */
265265   AM_RANGE(0xea00, 0xea00) AM_READNOP
266266   AM_RANGE(0xee00, 0xee00) AM_WRITENOP /* ? */
r21620r21621
509509
510510   m_maincpu = machine().device<cpu_device>("maincpu");
511511   m_audiocpu = machine().device<cpu_device>("audiocpu");
512   m_tc0140syt = machine().device("tc0140syt");
512   m_tc0140syt = machine().device<tc0140syt_device>("tc0140syt");
513513   m_tc0100scn_1 = machine().device("tc0100scn_1");
514514   m_tc0100scn_2 = machine().device("tc0100scn_2");
515515
trunk/src/mame/drivers/taito_b.c
r21620r21621
504504   AM_RANGE(0x200000, 0x201fff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_word_w) AM_SHARE("paletteram")
505505   AM_RANGE(0x600000, 0x607fff) AM_RAM /* Main RAM */ /*ashura up to 603fff only*/
506506   TC0180VCU_MEMRW( 0x400000 )
507   AM_RANGE(0x800000, 0x800001) AM_READNOP AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0xff00)
508   AM_RANGE(0x800002, 0x800003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
507   AM_RANGE(0x800000, 0x800001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
508   AM_RANGE(0x800002, 0x800003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
509509   AM_RANGE(0xa00000, 0xa0000f) AM_DEVREADWRITE8_LEGACY("tc0220ioc", tc0220ioc_r, tc0220ioc_w, 0xff00)
510510ADDRESS_MAP_END
511511
r21620r21621
514514   AM_RANGE(0x000000, 0x07ffff) AM_ROM
515515   AM_RANGE(0x200000, 0x20000f) AM_DEVREADWRITE8_LEGACY("tc0220ioc", tc0220ioc_r, tc0220ioc_w, 0xff00)
516516   TC0180VCU_MEMRW( 0x400000 )
517   AM_RANGE(0x600000, 0x600001) AM_READNOP AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0xff00)
518   AM_RANGE(0x600002, 0x600003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
517   AM_RANGE(0x600000, 0x600001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
518   AM_RANGE(0x600002, 0x600003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
519519   AM_RANGE(0x800000, 0x801fff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_word_w) AM_SHARE("paletteram")
520520   AM_RANGE(0xa00000, 0xa0ffff) AM_RAM /* Main RAM */
521521ADDRESS_MAP_END
r21620r21621
523523
524524static ADDRESS_MAP_START( tetrist_map, AS_PROGRAM, 16, taitob_state )
525525   AM_RANGE(0x000000, 0x07ffff) AM_ROM
526   AM_RANGE(0x200000, 0x200001) AM_READNOP AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0xff00)
527   AM_RANGE(0x200002, 0x200003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
526   AM_RANGE(0x200000, 0x200001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
527   AM_RANGE(0x200002, 0x200003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
528528   TC0180VCU_MEMRW( 0x400000 )
529529   AM_RANGE(0x600000, 0x60000f) AM_DEVREADWRITE8_LEGACY("tc0220ioc", tc0220ioc_r, tc0220ioc_w, 0xff00)
530530   AM_RANGE(0x800000, 0x807fff) AM_RAM /* Main RAM */
r21620r21621
538538   AM_RANGE(0x600000, 0x600001) AM_DEVREADWRITE8_LEGACY("tc0220ioc", tc0220ioc_portreg_r, tc0220ioc_portreg_w, 0xff00)
539539   AM_RANGE(0x600002, 0x600003) AM_DEVREADWRITE8_LEGACY("tc0220ioc", tc0220ioc_port_r, tc0220ioc_port_w, 0xff00)
540540   AM_RANGE(0x800000, 0x803fff) AM_RAM /* Main RAM */
541   AM_RANGE(0xa00000, 0xa00001) AM_READNOP AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0xff00)
542   AM_RANGE(0xa00002, 0xa00003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
541   AM_RANGE(0xa00000, 0xa00001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
542   AM_RANGE(0xa00002, 0xa00003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
543543ADDRESS_MAP_END
544544
545545
r21620r21621
548548   TC0180VCU_MEMRW( 0x400000 )
549549   AM_RANGE(0x600000, 0x60000f) AM_DEVREADWRITE8_LEGACY("tc0220ioc", tc0220ioc_r, tc0220ioc_w, 0xff00)
550550   AM_RANGE(0x610000, 0x610001) AM_READ_PORT("P3_P4")
551   AM_RANGE(0x700000, 0x700001) AM_READNOP AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0xff00)
552   AM_RANGE(0x700002, 0x700003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
551   AM_RANGE(0x700000, 0x700001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
552   AM_RANGE(0x700002, 0x700003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
553553   AM_RANGE(0x800000, 0x803fff) AM_RAM /* Main RAM */
554554   AM_RANGE(0xa00000, 0xa01fff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_word_w) AM_SHARE("paletteram")
555555   AM_RANGE(0xb00000, 0xb7ffff) AM_RAM_WRITE(hitice_pixelram_w) AM_SHARE("pixelram")
r21620r21621
561561
562562static ADDRESS_MAP_START( rambo3_map, AS_PROGRAM, 16, taitob_state )
563563   AM_RANGE(0x000000, 0x07ffff) AM_ROM
564   AM_RANGE(0x200000, 0x200001) AM_READNOP AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0xff00)
565   AM_RANGE(0x200002, 0x200003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
564   AM_RANGE(0x200000, 0x200001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
565   AM_RANGE(0x200002, 0x200003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
566566   TC0180VCU_MEMRW( 0x400000 )
567567   AM_RANGE(0x600000, 0x60000f) AM_DEVREADWRITE8_LEGACY("tc0220ioc", tc0220ioc_r, tc0220ioc_w, 0xff00)
568568   AM_RANGE(0x600010, 0x600011) AM_READ(tracky1_lo_r) /*player 1*/
r21620r21621
587587   AM_RANGE(0x500028, 0x500029) AM_WRITE(player_34_coin_ctrl_w)    /* simply locks coins 3&4 out */
588588   AM_RANGE(0x50002e, 0x50002f) AM_READ_PORT("P3_P4_B")        /* shown in service mode, game omits to read it */
589589   AM_RANGE(0x600000, 0x600003) AM_WRITE(gain_control_w)
590   AM_RANGE(0x700000, 0x700001) AM_READNOP AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0xff00)
591   AM_RANGE(0x700002, 0x700003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
590   AM_RANGE(0x700000, 0x700001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
591   AM_RANGE(0x700002, 0x700003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
592592   AM_RANGE(0x800000, 0x801fff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBRGBx_word_w) AM_SHARE("paletteram")
593593   AM_RANGE(0x900000, 0x90ffff) AM_RAM /* Main RAM */
594594ADDRESS_MAP_END
r21620r21621
603603   AM_RANGE(0x500028, 0x500029) AM_WRITE(player_34_coin_ctrl_w)    /* simply locks coins 3&4 out */
604604   AM_RANGE(0x50002e, 0x50002f) AM_READ_PORT("P3_P4_B")
605605   AM_RANGE(0x600000, 0x600003) AM_WRITE(gain_control_w)
606   AM_RANGE(0x700000, 0x700001) AM_READNOP AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0xff00)
607   AM_RANGE(0x700002, 0x700003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
606   AM_RANGE(0x700000, 0x700001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
607   AM_RANGE(0x700002, 0x700003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
608608   AM_RANGE(0x800000, 0x801fff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBRGBx_word_w) AM_SHARE("paletteram")
609609   AM_RANGE(0x900000, 0x90ffff) AM_RAM /* Main RAM */
610610ADDRESS_MAP_END
611611
612612static ADDRESS_MAP_START( spacedxo_map, AS_PROGRAM, 16, taitob_state )
613613   AM_RANGE(0x000000, 0x07ffff) AM_ROM
614   AM_RANGE(0x100000, 0x100001) AM_READNOP AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0xff00)
615   AM_RANGE(0x100002, 0x100003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
614   AM_RANGE(0x100000, 0x100001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
615   AM_RANGE(0x100002, 0x100003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
616616   AM_RANGE(0x200000, 0x20000f) AM_DEVREAD8_LEGACY("tc0220ioc", tc0220ioc_r, 0x00ff) AM_WRITE(spacedxo_tc0220ioc_w)
617617   AM_RANGE(0x210000, 0x210001) AM_READ_PORT("IN3")
618618   AM_RANGE(0x220000, 0x220001) AM_READ_PORT("IN4")
r21620r21621
632632   AM_RANGE(0x200028, 0x200029) AM_READWRITE(player_34_coin_ctrl_r, player_34_coin_ctrl_w)
633633   AM_RANGE(0x20002e, 0x20002f) AM_READ_PORT("P3_P4_B")    /* player 3,4 buttons */
634634   TC0180VCU_MEMRW( 0x400000 )
635   AM_RANGE(0x600000, 0x600001) AM_READNOP AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0xff00)
636   AM_RANGE(0x600002, 0x600003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
635   AM_RANGE(0x600000, 0x600001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
636   AM_RANGE(0x600002, 0x600003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
637637   AM_RANGE(0x700000, 0x700003) AM_WRITE(gain_control_w)
638638   AM_RANGE(0x800000, 0x801fff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBRGBx_word_w) AM_SHARE("paletteram")
639639   AM_RANGE(0x900000, 0x90ffff) AM_RAM /* Main RAM */
r21620r21621
642642
643643static ADDRESS_MAP_START( viofight_map, AS_PROGRAM, 16, taitob_state )
644644   AM_RANGE(0x000000, 0x07ffff) AM_ROM
645   AM_RANGE(0x200000, 0x200001) AM_READNOP AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0xff00)
646   AM_RANGE(0x200002, 0x200003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
645   AM_RANGE(0x200000, 0x200001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
646   AM_RANGE(0x200002, 0x200003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
647647   TC0180VCU_MEMRW( 0x400000 )
648648   AM_RANGE(0x600000, 0x601fff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_word_w) AM_SHARE("paletteram")
649649   AM_RANGE(0x800000, 0x80000f) AM_DEVREADWRITE8_LEGACY("tc0220ioc", tc0220ioc_r, tc0220ioc_w, 0xff00)
r21620r21621
658658   AM_RANGE(0x600000, 0x601fff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_word_w) AM_SHARE("paletteram")
659659   AM_RANGE(0x800000, 0x800001) AM_DEVREADWRITE8_LEGACY("tc0220ioc", tc0220ioc_portreg_r, tc0220ioc_portreg_w, 0xff00)
660660   AM_RANGE(0x800002, 0x800003) AM_DEVREADWRITE8_LEGACY("tc0220ioc", tc0220ioc_port_r, tc0220ioc_port_w, 0xff00)
661   AM_RANGE(0xa00000, 0xa00001) AM_READNOP AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0xff00)
662   AM_RANGE(0xa00002, 0xa00003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
661   AM_RANGE(0xa00000, 0xa00001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
662   AM_RANGE(0xa00002, 0xa00003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
663663ADDRESS_MAP_END
664664
665665
666666static ADDRESS_MAP_START( silentd_map, AS_PROGRAM, 16, taitob_state )
667667   AM_RANGE(0x000000, 0x07ffff) AM_ROM
668   AM_RANGE(0x100000, 0x100001) AM_READNOP AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0xff00)
669   AM_RANGE(0x100002, 0x100003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
668   AM_RANGE(0x100000, 0x100001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
669   AM_RANGE(0x100002, 0x100003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
670670//  AM_RANGE(0x10001a, 0x10001b) AM_READNOP // ??? read at $1e344
671671//  AM_RANGE(0x10001c, 0x10001d) AM_READNOP // ??? read at $1e356
672672   AM_RANGE(0x200000, 0x20000f) AM_DEVREADWRITE8_LEGACY("tc0220ioc", tc0220ioc_r, tc0220ioc_w, 0x00ff)
r21620r21621
688688   AM_RANGE(0x300000, 0x301fff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBRGBx_word_w) AM_SHARE("paletteram")
689689   AM_RANGE(0x400000, 0x40000f) AM_DEVREADWRITE8_LEGACY("tc0220ioc", tc0220ioc_r, tc0220ioc_w, 0xff00)
690690   AM_RANGE(0x410000, 0x41000f) AM_DEVREADWRITE8_LEGACY("tc0220ioc", tc0220ioc_r, tc0220ioc_w, 0xff00) /* mirror address - seems to be only used for coin control */
691   AM_RANGE(0x500000, 0x500001) AM_READNOP AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0xff00)
692   AM_RANGE(0x500002, 0x500003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
691   AM_RANGE(0x500000, 0x500001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
692   AM_RANGE(0x500002, 0x500003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
693693ADDRESS_MAP_END
694694
695695
r21620r21621
698698   AM_RANGE(0x100000, 0x10ffff) AM_RAM /* Main RAM */
699699   AM_RANGE(0x200000, 0x201fff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_word_w) AM_SHARE("paletteram")
700700   AM_RANGE(0x300000, 0x30000f) AM_DEVREADWRITE_LEGACY("tc0510nio", tc0510nio_halfword_wordswap_r, tc0510nio_halfword_wordswap_w)
701   AM_RANGE(0x320000, 0x320001) AM_READNOP AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0xff00)
702   AM_RANGE(0x320002, 0x320003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
701   AM_RANGE(0x320000, 0x320001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
702   AM_RANGE(0x320002, 0x320003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
703703   TC0180VCU_MEMRW( 0x900000 )
704704ADDRESS_MAP_END
705705
r21620r21621
710710   AM_RANGE(0x130000, 0x13ffff) AM_RAM // Check me
711711   AM_RANGE(0x180000, 0x18000f) AM_DEVREADWRITE_LEGACY("tc0510nio", tc0510nio_halfword_wordswap_r, tc0510nio_halfword_wordswap_w)
712712   AM_RANGE(0x184000, 0x184001) AM_WRITE(realpunc_video_ctrl_w)
713   AM_RANGE(0x188000, 0x188001) AM_READNOP AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0xff00)
714   AM_RANGE(0x188002, 0x188003) AM_READNOP AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_comm_w, 0xff00)
713   AM_RANGE(0x188000, 0x188001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
714   AM_RANGE(0x188002, 0x188003) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_w, 0xff00)
715715   AM_RANGE(0x18c000, 0x18c001) AM_WRITE(realpunc_output_w)
716716   TC0180VCU_MEMRW( 0x200000 )
717717   AM_RANGE(0x280000, 0x281fff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_word_w) AM_SHARE("paletteram")
718718   AM_RANGE(0x300000, 0x300001) AM_DEVREADWRITE_LEGACY("hd63484", hd63484_status_r, hd63484_address_w)
719719   AM_RANGE(0x300002, 0x300003) AM_DEVREADWRITE_LEGACY("hd63484", hd63484_data_r, hd63484_data_w)
720720//  AM_RANGE(0x320000, 0x320001) AM_READ_LEGACY(SMH_NOP) // ?
721   AM_RANGE(0x320002, 0x320003) AM_READNOP AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_comm_w, 0xff00)
721   AM_RANGE(0x320002, 0x320003) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_w, 0xff00)
722722ADDRESS_MAP_END
723723
724724static ADDRESS_MAP_START( masterw_sound_map, AS_PROGRAM, 8, taitob_state )
r21620r21621
726726   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank1")
727727   AM_RANGE(0x8000, 0x8fff) AM_RAM
728728   AM_RANGE(0x9000, 0x9001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2203_r, ym2203_w)
729   AM_RANGE(0xa000, 0xa000) AM_DEVWRITE_LEGACY("tc0140syt", tc0140syt_slave_port_w)
730   AM_RANGE(0xa001, 0xa001) AM_DEVREADWRITE_LEGACY("tc0140syt", tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
729   AM_RANGE(0xa000, 0xa000) AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_port_w)
730   AM_RANGE(0xa001, 0xa001) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
731731ADDRESS_MAP_END
732732
733733static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, taitob_state )
r21620r21621
735735   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank1")
736736   AM_RANGE(0xc000, 0xdfff) AM_RAM
737737   AM_RANGE(0xe000, 0xe003) AM_DEVREADWRITE_LEGACY("ymsnd", ym2610_r, ym2610_w)
738   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_DEVWRITE_LEGACY("tc0140syt", tc0140syt_slave_port_w)
739   AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE_LEGACY("tc0140syt", tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
738   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_port_w)
739   AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
740740   AM_RANGE(0xe400, 0xe403) AM_WRITENOP /* pan */
741741   AM_RANGE(0xe600, 0xe600) AM_WRITENOP /* ? */
742742   AM_RANGE(0xea00, 0xea00) AM_READNOP
r21620r21621
751751   AM_RANGE(0x8000, 0x8fff) AM_RAM
752752   AM_RANGE(0x9000, 0x9001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2203_r, ym2203_w)
753753   AM_RANGE(0xb000, 0xb001) AM_DEVREADWRITE("oki", okim6295_device, read, write)       /* yes, both addresses for the same chip */
754   AM_RANGE(0xa000, 0xa000) AM_DEVWRITE_LEGACY("tc0140syt", tc0140syt_slave_port_w)
755   AM_RANGE(0xa001, 0xa001) AM_DEVREADWRITE_LEGACY("tc0140syt", tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
754   AM_RANGE(0xa000, 0xa000) AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_port_w)
755   AM_RANGE(0xa001, 0xa001) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
756756ADDRESS_MAP_END
757757
758758
trunk/src/mame/drivers/othunder.c
r21620r21621
397397WRITE16_MEMBER(othunder_state::othunder_sound_w)
398398{
399399   if (offset == 0)
400      tc0140syt_port_w(m_tc0140syt, space, 0, data & 0xff);
400      m_tc0140syt->tc0140syt_port_w(space, 0, data & 0xff);
401401   else if (offset == 1)
402      tc0140syt_comm_w(m_tc0140syt, space, 0, data & 0xff);
402      m_tc0140syt->tc0140syt_comm_w(space, 0, data & 0xff);
403403}
404404
405405READ16_MEMBER(othunder_state::othunder_sound_r)
406406{
407407   if (offset == 1)
408      return ((tc0140syt_comm_r(m_tc0140syt, space, 0) & 0xff));
408      return ((m_tc0140syt->tc0140syt_comm_r(space, 0) & 0xff));
409409   else
410410      return 0;
411411}
r21620r21621
466466   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank10")
467467   AM_RANGE(0xc000, 0xdfff) AM_RAM
468468   AM_RANGE(0xe000, 0xe003) AM_DEVREADWRITE_LEGACY("ymsnd", ym2610_r, ym2610_w)
469   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_DEVWRITE_LEGACY("tc0140syt", tc0140syt_slave_port_w)
470   AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE_LEGACY("tc0140syt", tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
469   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_port_w)
470   AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
471471   AM_RANGE(0xe400, 0xe403) AM_WRITE(othunder_TC0310FAM_w) /* pan */
472472   AM_RANGE(0xe600, 0xe600) AM_WRITENOP /* ? */
473473   AM_RANGE(0xea00, 0xea00) AM_READ_PORT(ROTARY_PORT_TAG)  /* rotary input */
r21620r21621
671671   m_tc0220ioc = machine().device("tc0220ioc");
672672   m_tc0100scn = machine().device("tc0100scn");
673673   m_tc0110pcr = machine().device("tc0110pcr");
674   m_tc0140syt = machine().device("tc0140syt");
674   m_tc0140syt = machine().device<tc0140syt_device>("tc0140syt");
675675   m_2610_0l = machine().device<filter_volume_device>("2610.0l");
676676   m_2610_0r = machine().device<filter_volume_device>("2610.0r");
677677   m_2610_1l = machine().device<filter_volume_device>("2610.1l");
trunk/src/mame/drivers/pcxt.c
r21620r21621
332332   pit8253_gate2_w(m_pit8253, BIT(data, 0));
333333   pcxt_speaker_set_spkrdata( data & 0x02 );
334334   m_port_b_data = data;
335// device_t *beep = machine().device("beep");
335// device_t *beep = machine().device<beep_device>("beep");
336336// device_t *cvsd = machine().device("cvsd");
337337//  hc55516_digit_w(cvsd, data);
338338//  popmessage("%02x\n",data);
339//  beep_set_state(beep, 0);
340//  beep_set_state(beep, 1);
341//  beep_set_frequency(beep, m_port_b_data);
339//  beep->beep_set_state(0);
340//  beep->beep_set_state(1);
341//  beep->beep_set_frequency(m_port_b_data);
342342}
343343
344344WRITE8_MEMBER(pcxt_state::wss_1_w)
trunk/src/mame/drivers/dlair.c
r21620r21621
286286   if (beep != NULL)
287287   {
288288      z80ctc_device *ctc = machine().device<z80ctc_device>("ctc");
289      beep_set_state(beep, 1);
290      beep_set_frequency(beep, ATTOSECONDS_TO_HZ(ctc->period(0).attoseconds));
289      beep->set_state(1);
290      beep->set_frequency(ATTOSECONDS_TO_HZ(ctc->period(0).attoseconds));
291291   }
292292}
293293
trunk/src/mame/drivers/taito_h.c
r21620r21621
251251   AM_RANGE(0x100000, 0x10ffff) AM_MIRROR(0x010000) AM_RAM AM_SHARE("m68000_mainram")
252252   AM_RANGE(0x200000, 0x200001) AM_READ8(syvalion_input_bypass_r, 0x00ff) AM_DEVWRITE8_LEGACY("tc0220ioc", tc0220ioc_portreg_w, 0x00ff)
253253   AM_RANGE(0x200002, 0x200003) AM_DEVREADWRITE8_LEGACY("tc0220ioc", tc0220ioc_port_r, tc0220ioc_port_w, 0x00ff)
254   AM_RANGE(0x300000, 0x300001) AM_READNOP AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0x00ff)
255   AM_RANGE(0x300002, 0x300003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff)
254   AM_RANGE(0x300000, 0x300001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0x00ff)
255   AM_RANGE(0x300002, 0x300003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff)
256256   AM_RANGE(0x400000, 0x420fff) AM_DEVREADWRITE_LEGACY("tc0080vco", tc0080vco_word_r, tc0080vco_word_w)
257257   AM_RANGE(0x500800, 0x500fff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_word_w) AM_SHARE("paletteram")
258258ADDRESS_MAP_END
r21620r21621
262262   AM_RANGE(0x100000, 0x10ffff) AM_MIRROR(0x010000) AM_RAM AM_SHARE("m68000_mainram")
263263   AM_RANGE(0x200000, 0x200001) AM_DEVREADWRITE8_LEGACY("tc0220ioc", tc0220ioc_portreg_r, tc0220ioc_portreg_w, 0x00ff)
264264   AM_RANGE(0x200002, 0x200003) AM_DEVREADWRITE8_LEGACY("tc0220ioc", tc0220ioc_port_r, tc0220ioc_port_w, 0x00ff)
265   AM_RANGE(0x300000, 0x300001) AM_READNOP AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0x00ff)
266   AM_RANGE(0x300002, 0x300003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff)
265   AM_RANGE(0x300000, 0x300001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0x00ff)
266   AM_RANGE(0x300002, 0x300003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff)
267267   AM_RANGE(0x400000, 0x420fff) AM_DEVREADWRITE_LEGACY("tc0080vco", tc0080vco_word_r, tc0080vco_word_w)
268268   AM_RANGE(0x500800, 0x500fff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_word_w) AM_SHARE("paletteram")
269269ADDRESS_MAP_END
r21620r21621
272272   AM_RANGE(0x000000, 0x05ffff) AM_ROM
273273   AM_RANGE(0x100000, 0x10ffff) AM_MIRROR(0x010000) AM_RAM AM_SHARE("m68000_mainram")
274274   AM_RANGE(0x200000, 0x20000f) AM_DEVREADWRITE8_LEGACY("tc0220ioc", tc0220ioc_r, tc0220ioc_w, 0x00ff)
275   AM_RANGE(0x300000, 0x300001) AM_READNOP AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0x00ff)
276   AM_RANGE(0x300002, 0x300003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff)
275   AM_RANGE(0x300000, 0x300001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0x00ff)
276   AM_RANGE(0x300002, 0x300003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff)
277277   AM_RANGE(0x400000, 0x420fff) AM_DEVREADWRITE_LEGACY("tc0080vco", tc0080vco_word_r, tc0080vco_word_w)
278278   AM_RANGE(0x500800, 0x500fff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_word_w) AM_SHARE("paletteram")
279279   AM_RANGE(0x600000, 0x600001) AM_WRITENOP    /* ?? writes zero once per frame */
r21620r21621
285285   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank1")
286286   AM_RANGE(0xc000, 0xdfff) AM_RAM
287287   AM_RANGE(0xe000, 0xe003) AM_DEVREADWRITE_LEGACY("ymsnd", ym2610_r, ym2610_w)
288   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_DEVWRITE_LEGACY("tc0140syt", tc0140syt_slave_port_w)
289   AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE_LEGACY("tc0140syt", tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
288   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_port_w)
289   AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
290290   AM_RANGE(0xe400, 0xe403) AM_WRITENOP        /* pan control */
291291   AM_RANGE(0xea00, 0xea00) AM_READNOP
292292   AM_RANGE(0xee00, 0xee00) AM_WRITENOP        /* ? */
trunk/src/mame/drivers/asuka.c
r21620r21621
318318   AM_RANGE(0x3b0000, 0x3b0001) AM_READ_PORT("DSWB")
319319   AM_RANGE(0x3c0000, 0x3c0001) AM_WRITE(watchdog_reset16_w)
320320   AM_RANGE(0x3d0000, 0x3d0001) AM_READNOP
321   AM_RANGE(0x3e0000, 0x3e0001) AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0x00ff)
322   AM_RANGE(0x3e0002, 0x3e0003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff)
321   AM_RANGE(0x3e0000, 0x3e0001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0x00ff)
322   AM_RANGE(0x3e0002, 0x3e0003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff)
323323   AM_RANGE(0x800000, 0x8007ff) AM_READWRITE(bonzeadv_cchip_ram_r, bonzeadv_cchip_ram_w)
324324   AM_RANGE(0x800802, 0x800803) AM_READWRITE(bonzeadv_cchip_ctrl_r, bonzeadv_cchip_ctrl_w)
325325   AM_RANGE(0x800c00, 0x800c01) AM_WRITE(bonzeadv_cchip_bank_w)
r21620r21621
334334   AM_RANGE(0x1076f0, 0x1076f1) AM_READNOP /* Mofflott init does dummy reads here */
335335   AM_RANGE(0x200000, 0x20000f) AM_DEVREADWRITE_LEGACY("tc0110pcr", tc0110pcr_word_r, tc0110pcr_step1_word_w)
336336   AM_RANGE(0x3a0000, 0x3a0003) AM_WRITE(asuka_spritectrl_w)
337   AM_RANGE(0x3e0000, 0x3e0001) AM_READNOP AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0x00ff)
338   AM_RANGE(0x3e0002, 0x3e0003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff)
337   AM_RANGE(0x3e0000, 0x3e0001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0x00ff)
338   AM_RANGE(0x3e0002, 0x3e0003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff)
339339   AM_RANGE(0x400000, 0x40000f) AM_DEVREADWRITE8_LEGACY("tc0220ioc", tc0220ioc_r, tc0220ioc_w, 0x00ff)
340340   AM_RANGE(0xc00000, 0xc0ffff) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_word_r, tc0100scn_word_w)    /* tilemaps */
341341   AM_RANGE(0xc10000, 0xc103ff) AM_WRITENOP    /* error in Asuka init code */
r21620r21621
346346static ADDRESS_MAP_START( cadash_map, AS_PROGRAM, 16, asuka_state )
347347   AM_RANGE(0x000000, 0x07ffff) AM_ROM
348348   AM_RANGE(0x080000, 0x080003) AM_WRITE(asuka_spritectrl_w)
349   AM_RANGE(0x0c0000, 0x0c0001) AM_READNOP AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0x00ff)
350   AM_RANGE(0x0c0002, 0x0c0003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff)
349   AM_RANGE(0x0c0000, 0x0c0001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0x00ff)
350   AM_RANGE(0x0c0002, 0x0c0003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff)
351351   AM_RANGE(0x100000, 0x107fff) AM_RAM
352352   AM_RANGE(0x800000, 0x800fff) AM_READWRITE(cadash_share_r,cadash_share_w)    /* network ram */
353353   AM_RANGE(0x900000, 0x90000f) AM_DEVREADWRITE8_LEGACY("tc0220ioc", tc0220ioc_r, tc0220ioc_w, 0x00ff)
r21620r21621
364364   AM_RANGE(0x300000, 0x30000f) AM_DEVREADWRITE8_LEGACY("tc0220ioc", tc0220ioc_r, tc0220ioc_w, 0x00ff)
365365   AM_RANGE(0x400000, 0x40000f) AM_DEVREAD8_LEGACY("tc0220ioc", tc0220ioc_r, 0x00ff)   /* service mode mirror */
366366   AM_RANGE(0x4a0000, 0x4a0003) AM_WRITE(asuka_spritectrl_w)
367   AM_RANGE(0x4e0000, 0x4e0001) AM_READNOP AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0x00ff)
368   AM_RANGE(0x4e0002, 0x4e0003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff)
367   AM_RANGE(0x4e0000, 0x4e0001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0x00ff)
368   AM_RANGE(0x4e0002, 0x4e0003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff)
369369   AM_RANGE(0xc00000, 0xc03fff) AM_DEVREADWRITE_LEGACY("pc090oj", pc090oj_word_r, pc090oj_word_w)  /* sprite ram */
370370   AM_RANGE(0xc00000, 0xc0ffff) AM_DEVWRITE_LEGACY("tc0100scn", tc0100scn_word_w)
371371   AM_RANGE(0xd00000, 0xd0ffff) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_word_r, tc0100scn_word_w)    /* tilemaps */
r21620r21621
380380   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank1")
381381   AM_RANGE(0xc000, 0xdfff) AM_RAM
382382   AM_RANGE(0xe000, 0xe003) AM_DEVREADWRITE_LEGACY("ymsnd", ym2610_r, ym2610_w)
383   AM_RANGE(0xe200, 0xe200) AM_DEVWRITE_LEGACY("tc0140syt", tc0140syt_slave_port_w)
384   AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE_LEGACY("tc0140syt", tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
383   AM_RANGE(0xe200, 0xe200) AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_port_w)
384   AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
385385   AM_RANGE(0xe400, 0xe403) AM_WRITENOP /* pan */
386386   AM_RANGE(0xe600, 0xe600) AM_WRITENOP
387387   AM_RANGE(0xee00, 0xee00) AM_WRITENOP
r21620r21621
395395   AM_RANGE(0x8000, 0x8fff) AM_RAM
396396   AM_RANGE(0x9000, 0x9001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
397397//  AM_RANGE(0x9002, 0x9100) AM_READNOP
398   AM_RANGE(0xa000, 0xa000) AM_DEVWRITE_LEGACY("tc0140syt", tc0140syt_slave_port_w)
399   AM_RANGE(0xa001, 0xa001) AM_DEVREADWRITE_LEGACY("tc0140syt", tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
398   AM_RANGE(0xa000, 0xa000) AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_port_w)
399   AM_RANGE(0xa001, 0xa001) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
400400   AM_RANGE(0xb000, 0xb000) AM_WRITE(asuka_msm5205_address_w)
401401   AM_RANGE(0xc000, 0xc000) AM_WRITE(asuka_msm5205_start_w)
402402   AM_RANGE(0xd000, 0xd000) AM_WRITE(asuka_msm5205_stop_w)
r21620r21621
408408   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank1")
409409   AM_RANGE(0x8000, 0x8fff) AM_RAM
410410   AM_RANGE(0x9000, 0x9001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
411   AM_RANGE(0xa000, 0xa000) AM_DEVWRITE_LEGACY("tc0140syt", tc0140syt_slave_port_w)
412   AM_RANGE(0xa001, 0xa001) AM_DEVREADWRITE_LEGACY("tc0140syt", tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
411   AM_RANGE(0xa000, 0xa000) AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_port_w)
412   AM_RANGE(0xa001, 0xa001) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
413413ADDRESS_MAP_END
414414
415415/*
trunk/src/mame/drivers/opwolf.c
r21620r21621
367367   AM_RANGE(0x380000, 0x380003) AM_WRITE(opwolf_spritectrl_w)  // usually 0x4, changes when you fire
368368   AM_RANGE(0x3a0000, 0x3a0003) AM_READ(opwolf_lightgun_r)     /* lightgun, read at $11e0/6 */
369369   AM_RANGE(0x3c0000, 0x3c0001) AM_WRITENOP                    /* watchdog ?? */
370   AM_RANGE(0x3e0000, 0x3e0001) AM_READNOP AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0xff00)
371   AM_RANGE(0x3e0002, 0x3e0003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
370   AM_RANGE(0x3e0000, 0x3e0001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
371   AM_RANGE(0x3e0002, 0x3e0003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
372372   AM_RANGE(0xc00000, 0xc0ffff) AM_DEVREADWRITE_LEGACY("pc080sn", pc080sn_word_r, pc080sn_word_w)
373373   AM_RANGE(0xc10000, 0xc1ffff) AM_WRITEONLY                   /* error in init code (?) */
374374   AM_RANGE(0xc20000, 0xc20003) AM_DEVWRITE_LEGACY("pc080sn", pc080sn_yscroll_word_w)
r21620r21621
388388   AM_RANGE(0x380000, 0x380003) AM_WRITE(opwolf_spritectrl_w)  // usually 0x4, changes when you fire
389389   AM_RANGE(0x3a0000, 0x3a0003) AM_READ(opwolf_lightgun_r)     /* lightgun, read at $11e0/6 */
390390   AM_RANGE(0x3c0000, 0x3c0001) AM_WRITENOP                    /* watchdog ?? */
391   AM_RANGE(0x3e0000, 0x3e0001) AM_READNOP AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0xff00)
392   AM_RANGE(0x3e0002, 0x3e0003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
391   AM_RANGE(0x3e0000, 0x3e0001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
392   AM_RANGE(0x3e0002, 0x3e0003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
393393   AM_RANGE(0xc00000, 0xc0ffff) AM_DEVREADWRITE_LEGACY("pc080sn", pc080sn_word_r, pc080sn_word_w)
394394   AM_RANGE(0xc10000, 0xc1ffff) AM_WRITEONLY                   /* error in init code (?) */
395395   AM_RANGE(0xc20000, 0xc20003) AM_DEVWRITE_LEGACY("pc080sn", pc080sn_yscroll_word_w)
r21620r21621
540540   AM_RANGE(0x8000, 0x8fff) AM_RAM
541541   AM_RANGE(0x9000, 0x9001) AM_DEVREADWRITE("ymsnd", ym2151_device,read,write)
542542   AM_RANGE(0x9002, 0x9100) AM_READNOP
543   AM_RANGE(0xa000, 0xa000) AM_DEVWRITE_LEGACY("tc0140syt", tc0140syt_slave_port_w)
544   AM_RANGE(0xa001, 0xa001) AM_DEVREADWRITE_LEGACY("tc0140syt", tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
543   AM_RANGE(0xa000, 0xa000) AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_port_w)
544   AM_RANGE(0xa001, 0xa001) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
545545   AM_RANGE(0xb000, 0xb006) AM_WRITE(opwolf_adpcm_b_w)
546546   AM_RANGE(0xc000, 0xc006) AM_WRITE(opwolf_adpcm_c_w)
547547   AM_RANGE(0xd000, 0xd000) AM_WRITE(opwolf_adpcm_d_w)
trunk/src/mame/drivers/taito_l.c
r21620r21621
672672   AM_RANGE(0x0000, 0x7fff) AM_ROM
673673   AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank6")
674674   AM_RANGE(0xc000, 0xc000) AM_WRITE(rombank2switch_w)
675   AM_RANGE(0xc800, 0xc800) AM_READNOP AM_DEVWRITE_LEGACY("tc0140syt", tc0140syt_port_w)
676   AM_RANGE(0xc801, 0xc801) AM_DEVREADWRITE_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w)
675   AM_RANGE(0xc800, 0xc800) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_port_w)
676   AM_RANGE(0xc801, 0xc801) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w)
677677   AM_RANGE(0xd000, 0xd000) AM_READ_PORT("DSWA") AM_WRITENOP   // Direct copy of input port 0
678678   AM_RANGE(0xd001, 0xd001) AM_READ_PORT("DSWB")
679679   AM_RANGE(0xd002, 0xd002) AM_READ_PORT("IN0")
r21620r21621
688688   AM_RANGE(0x0000, 0x3fff) AM_ROM
689689   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank7")
690690   AM_RANGE(0x8000, 0x9fff) AM_RAM
691   AM_RANGE(0xe000, 0xe000) AM_READNOP AM_DEVWRITE_LEGACY("tc0140syt", tc0140syt_slave_port_w)
692   AM_RANGE(0xe001, 0xe001) AM_DEVREADWRITE_LEGACY("tc0140syt", tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
691   AM_RANGE(0xe000, 0xe000) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_port_w)
692   AM_RANGE(0xe001, 0xe001) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
693693   AM_RANGE(0xf000, 0xf001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2203_r, ym2203_w)
694694ADDRESS_MAP_END
695695
r21620r21621
699699   AM_RANGE(0x8000, 0x87ff) AM_RAM AM_SHARE("share1")
700700   AM_RANGE(0x8800, 0x8800) AM_READWRITE(mux_r, mux_w)
701701   AM_RANGE(0x8801, 0x8801) AM_WRITE(mux_ctrl_w) AM_READNOP    // Watchdog or interrupt ack (value ignored)
702   AM_RANGE(0x8c00, 0x8c00) AM_READNOP AM_DEVWRITE_LEGACY("tc0140syt", tc0140syt_port_w)
703   AM_RANGE(0x8c01, 0x8c01) AM_DEVREADWRITE_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w)
702   AM_RANGE(0x8c00, 0x8c00) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_port_w)
703   AM_RANGE(0x8c01, 0x8c01) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w)
704704   AM_RANGE(0xa000, 0xbfff) AM_RAM
705705ADDRESS_MAP_END
706706
r21620r21621
724724   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank7")
725725   AM_RANGE(0xc000, 0xdfff) AM_RAM
726726   AM_RANGE(0xe000, 0xe003) AM_DEVREADWRITE_LEGACY("ymsnd", ym2610_r, ym2610_w)
727   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_DEVWRITE_LEGACY("tc0140syt", tc0140syt_slave_port_w)
728   AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE_LEGACY("tc0140syt", tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
727   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_port_w)
728   AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
729729   AM_RANGE(0xe400, 0xe403) AM_WRITENOP /* pan */
730730   AM_RANGE(0xe600, 0xe600) AM_WRITENOP /* ? */
731731   AM_RANGE(0xee00, 0xee00) AM_WRITENOP /* ? */
r21620r21621
751751   AM_RANGE(0xe004, 0xe004) AM_WRITE(control2_w)
752752   AM_RANGE(0xe007, 0xe007) AM_READ_PORT("IN2")
753753   AM_RANGE(0xe008, 0xe00f) AM_READNOP
754   AM_RANGE(0xe800, 0xe800) AM_READNOP AM_DEVWRITE_LEGACY("tc0140syt", tc0140syt_port_w)
755   AM_RANGE(0xe801, 0xe801) AM_DEVREADWRITE_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w)
754   AM_RANGE(0xe800, 0xe800) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_port_w)
755   AM_RANGE(0xe801, 0xe801) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w)
756756   AM_RANGE(0xf000, 0xf000) AM_READWRITE(rombank2switch_r, rombank2switch_w)
757757ADDRESS_MAP_END
758758
r21620r21621
761761   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank7")
762762   AM_RANGE(0x8000, 0x8fff) AM_RAM
763763   AM_RANGE(0x9000, 0x9001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2203_r, ym2203_w)
764   AM_RANGE(0xa000, 0xa000) AM_READNOP AM_DEVWRITE_LEGACY("tc0140syt", tc0140syt_slave_port_w)
765   AM_RANGE(0xa001, 0xa001) AM_DEVREADWRITE_LEGACY("tc0140syt", tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
764   AM_RANGE(0xa000, 0xa000) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_port_w)
765   AM_RANGE(0xa001, 0xa001) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
766766   AM_RANGE(0xb000, 0xb000) AM_WRITE(champwr_msm5205_hi_w)
767767   AM_RANGE(0xc000, 0xc000) AM_WRITE(champwr_msm5205_lo_w)
768768   AM_RANGE(0xd000, 0xd000) AM_WRITE(champwr_msm5205_start_w)
trunk/src/mame/drivers/zn.c
r21620r21621
11051105
11061106READ32_MEMBER(zn_state::taitofx1a_ymsound_r)
11071107{
1108   device_t *tc0140syt = machine().device("tc0140syt");
1109   return tc0140syt_comm_r(tc0140syt, space, 0) << 16;
1108   tc0140syt_device *tc0140syt = machine().device<tc0140syt_device>("tc0140syt");
1109   return tc0140syt->tc0140syt_comm_r(space, 0) << 16;
11101110}
11111111
11121112WRITE32_MEMBER(zn_state::taitofx1a_ymsound_w)
11131113{
1114   device_t *tc0140syt = machine().device("tc0140syt");
1114   tc0140syt_device *tc0140syt = machine().device<tc0140syt_device>("tc0140syt");
11151115
11161116   if (mem_mask == 0x0000ffff)
11171117   {
1118      tc0140syt_port_w(tc0140syt, space, 0, data & 0xff);
1118      tc0140syt->tc0140syt_port_w(space, 0, data & 0xff);
11191119   }
11201120   else
11211121   {
1122      tc0140syt_comm_w(tc0140syt, space, 0, (data >> 16) & 0xff);
1122      tc0140syt->tc0140syt_comm_w(space, 0, (data >> 16) & 0xff);
11231123   }
11241124}
11251125
r21620r21621
11471147   AM_RANGE(0x0000, 0x7fff) AM_ROM
11481148   AM_RANGE(0xc000, 0xdfff) AM_RAM
11491149   AM_RANGE(0xe000, 0xe003) AM_DEVREADWRITE_LEGACY("ymsnd", ym2610_r, ym2610_w)
1150   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_DEVWRITE_LEGACY("tc0140syt", tc0140syt_slave_port_w)
1151   AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE_LEGACY("tc0140syt", tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
1150   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_port_w)
1151   AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
11521152   AM_RANGE(0xe400, 0xe403) AM_WRITENOP /* pan */
11531153   AM_RANGE(0xee00, 0xee00) AM_NOP /* ? */
11541154   AM_RANGE(0xf000, 0xf000) AM_WRITENOP /* ? */
trunk/src/mame/drivers/rainbow.c
r21620r21621
352352   AM_RANGE(0x3a0000, 0x3a0001) AM_WRITE(rbisland_spritectrl_w)
353353   AM_RANGE(0x3b0000, 0x3b0003) AM_READ_PORT("DSWB")
354354   AM_RANGE(0x3c0000, 0x3c0003) AM_WRITENOP        /* written very often, watchdog? */
355   AM_RANGE(0x3e0000, 0x3e0001) AM_READNOP AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0x00ff)
356   AM_RANGE(0x3e0002, 0x3e0003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r,tc0140syt_comm_w, 0x00ff)
355   AM_RANGE(0x3e0000, 0x3e0001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0x00ff)
356   AM_RANGE(0x3e0002, 0x3e0003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r,tc0140syt_comm_w, 0x00ff)
357357   AM_RANGE(0x800000, 0x8007ff) AM_READWRITE(rbisland_cchip_ram_r,rbisland_cchip_ram_w)
358358   AM_RANGE(0x800802, 0x800803) AM_READWRITE(rbisland_cchip_ctrl_r,rbisland_cchip_ctrl_w)
359359   AM_RANGE(0x800c00, 0x800c01) AM_WRITE(rbisland_cchip_bank_w)
r21620r21621
411411   AM_RANGE(0x8000, 0x8fff) AM_RAM
412412   AM_RANGE(0x9000, 0x9001) AM_DEVREADWRITE("ymsnd", ym2151_device,read,write)
413413   AM_RANGE(0x9002, 0x9100) AM_READNOP
414   AM_RANGE(0xa000, 0xa000) AM_DEVWRITE_LEGACY("tc0140syt", tc0140syt_slave_port_w)
415   AM_RANGE(0xa001, 0xa001) AM_DEVREADWRITE_LEGACY("tc0140syt", tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
414   AM_RANGE(0xa000, 0xa000) AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_port_w)
415   AM_RANGE(0xa001, 0xa001) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
416416ADDRESS_MAP_END
417417
418418static ADDRESS_MAP_START( jumping_sound_map, AS_PROGRAM, 8, rbisland_state )
trunk/src/mame/audio/taitosnd.c
r21620r21621
1515#define TC0140SYT_PORT01_FULL_MASTER  (0x04)
1616#define TC0140SYT_PORT23_FULL_MASTER  (0x08)
1717
18struct tc0140syt_state
18
19// device type definition
20const device_type TC0140SYT = &device_creator<tc0140syt_device>;
21
22
23//**************************************************************************
24//  LIVE DEVICE
25//**************************************************************************
26
27//-------------------------------------------------
28//  tc0140syt_device - constructor
29//-------------------------------------------------
30
31tc0140syt_device::tc0140syt_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
32   : device_t(mconfig, TC0140SYT, "Taito TC0140SYT", tag, owner, clock),
33     m_mainmode(0),
34     m_submode(0),
35     m_status(0),
36     m_nmi_enabled(0),
37     m_nmi_req(0),
38     m_mastercpu(NULL),
39     m_slavecpu(NULL)
1940{
20   UINT8     slavedata[4];  /* Data on master->slave port (4 nibbles) */
21   UINT8     masterdata[4]; /* Data on slave->master port (4 nibbles) */
22   UINT8     mainmode;      /* Access mode on master cpu side */
23   UINT8     submode;       /* Access mode on slave cpu side */
24   UINT8     status;        /* Status data */
25   UINT8     nmi_enabled;   /* 1 if slave cpu has nmi's enabled */
26   UINT8     nmi_req;       /* 1 if slave cpu has a pending nmi */
41   memset(m_slavedata, 0, sizeof(UINT8)*4);
42   memset(m_masterdata, 0, sizeof(UINT8)*4);
43}
2744
28   device_t *mastercpu;    /* this is the maincpu */
29   device_t *slavecpu; /* this is the audiocpu */
30};
3145
32/*****************************************************************************
33    INLINE FUNCTIONS
34*****************************************************************************/
46//-------------------------------------------------
47//  device_start - device-specific startup
48//-------------------------------------------------
3549
36INLINE tc0140syt_state *get_safe_token( device_t *device )
50void tc0140syt_device::device_start()
3751{
38   assert(device != NULL);
39   assert(device->type() == TC0140SYT);
52   const tc0140syt_interface *intf = reinterpret_cast<const tc0140syt_interface*>(static_config());
4053
41   return (tc0140syt_state *)downcast<tc0140syt_device *>(device)->token();
54   /* use the given gfx set */
55   m_mastercpu = machine().device(intf->master);
56   m_slavecpu = machine().device(intf->slave);
57
58   save_item(NAME(m_mainmode));
59   save_item(NAME(m_submode));
60   save_item(NAME(m_status));
61   save_item(NAME(m_nmi_enabled));
62   save_item(NAME(m_nmi_req));
63   save_item(NAME(m_slavedata));
64   save_item(NAME(m_masterdata));
4265}
4366
44INLINE const tc0140syt_interface *get_interface( device_t *device )
67
68//-------------------------------------------------
69//  device_reset - device-specific reset
70//-------------------------------------------------
71
72void tc0140syt_device::device_reset()
4573{
46   assert(device != NULL);
47   assert((device->type() == TC0140SYT));
48   return (const tc0140syt_interface *) device->static_config();
74   int i;
75
76   m_mainmode = 0;
77   m_submode = 0;
78   m_status = 0;
79   m_nmi_enabled = 0;
80   m_nmi_req = 0;
81
82   for (i = 0; i < 4; i++)
83   {
84      m_slavedata[i] = 0;
85      m_masterdata[i] = 0;
86   }
4987}
5088
51/*****************************************************************************
52    DEVICE HANDLERS
53*****************************************************************************/
5489
55static void interrupt_controller( device_t *device )
56{
57   tc0140syt_state *tc0140syt = get_safe_token(device);
90//-------------------------------------------------
91//  DEVICE HANDLERS
92//-------------------------------------------------
5893
59   if (tc0140syt->nmi_req && tc0140syt->nmi_enabled)
94void tc0140syt_device::interrupt_controller( )
95{
96   if (m_nmi_req && m_nmi_enabled)
6097   {
61      tc0140syt->slavecpu->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
62      tc0140syt->nmi_req = 0;
98      m_slavecpu->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
99      m_nmi_req = 0;
63100   }
64101}
65102
66WRITE8_DEVICE_HANDLER( tc0140syt_port_w )
103
104//-------------------------------------------------
105//  MASTER SIDE
106//-------------------------------------------------
107
108WRITE8_MEMBER( tc0140syt_device::tc0140syt_port_w )
67109{
68   tc0140syt_state *tc0140syt = get_safe_token(device);
69110   data &= 0x0f;
70111
71   tc0140syt->mainmode = data;
112   m_mainmode = data;
72113   //logerror("taitosnd: Master cpu mode [%02x]\n", data);
73114   if (data > 4)
74115   {
r21620r21621
76117   }
77118}
78119
79WRITE8_DEVICE_HANDLER( tc0140syt_comm_w )
80{
81   tc0140syt_state *tc0140syt = get_safe_token(device);
82120
121WRITE8_MEMBER( tc0140syt_device::tc0140syt_comm_w )
122{
83123   data &= 0x0f;   /*this is important, otherwise ballbros won't work*/
84124
85   switch (tc0140syt->mainmode)
125   switch (m_mainmode)
86126   {
87127      case 0x00:      // mode #0
88         tc0140syt->slavedata[tc0140syt->mainmode ++] = data;
128         m_slavedata[m_mainmode ++] = data;
89129         //logerror("taitosnd: Master cpu written port 0, data %01x\n", data);
90130         break;
91131
92132      case 0x01:      // mode #1
93         tc0140syt->slavedata[tc0140syt->mainmode ++] = data;
94         tc0140syt->status |= TC0140SYT_PORT01_FULL;
95         tc0140syt->nmi_req = 1;
96         //logerror("taitosnd: Master cpu sends 0/1 : %01x%01x\n", tc0140syt->slavedata[1], tc0140syt->slavedata[0]);
133         m_slavedata[m_mainmode ++] = data;
134         m_status |= TC0140SYT_PORT01_FULL;
135         m_nmi_req = 1;
136         //logerror("taitosnd: Master cpu sends 0/1 : %01x%01x\n", m_slavedata[1], m_slavedata[0]);
97137         break;
98138
99139      case 0x02:      // mode #2
100         tc0140syt->slavedata[tc0140syt->mainmode ++] = data;
140         m_slavedata[m_mainmode ++] = data;
101141         //logerror("taitosnd: Master cpu written port 2, data %01\n", data);
102142         break;
103143
104144      case 0x03:      // mode #3
105         tc0140syt->slavedata[tc0140syt->mainmode ++] = data;
106         tc0140syt->status |= TC0140SYT_PORT23_FULL;
107         tc0140syt->nmi_req = 1;
108         //logerror("taitosnd: Master cpu sends 2/3 : %01x%01x\n", tc0140syt->slavedata[3], tc0140syt->slavedata[2]);
145         m_slavedata[m_mainmode ++] = data;
146         m_status |= TC0140SYT_PORT23_FULL;
147         m_nmi_req = 1;
148         //logerror("taitosnd: Master cpu sends 2/3 : %01x%01x\n", m_slavedata[3], m_slavedata[2]);
109149         break;
110150
111151      case 0x04:      // port status
112152         //logerror("taitosnd: Master issued control value %02x (PC = %08x) \n",data, space.device().safe_pc() );
113153         /* this does a hi-lo transition to reset the sound cpu */
114154         if (data)
115            tc0140syt->slavecpu->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
155            m_slavecpu->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
116156         else
117157         {
118            tc0140syt->slavecpu->execute().set_input_line(INPUT_LINE_RESET, CLEAR_LINE);
119            tc0140syt->mastercpu->execute().spin(); /* otherwise no sound in driftout */
158            m_slavecpu->execute().set_input_line(INPUT_LINE_RESET, CLEAR_LINE);
159            m_mastercpu->execute().spin(); /* otherwise no sound in driftout */
120160         }
121161         break;
122162
123163      default:
124         //logerror("taitosnd: Master cpu written in mode [%02x] data[%02x]\n", tc0140syt->mainmode, data);
164         //logerror("taitosnd: Master cpu written in mode [%02x] data[%02x]\n", m_mainmode, data);
125165         break;
126166   }
127167
128168}
129169
130READ8_DEVICE_HANDLER( tc0140syt_comm_r )
131{
132   tc0140syt_state *tc0140syt = get_safe_token(device);
133170
134   switch( tc0140syt->mainmode )
171READ8_MEMBER( tc0140syt_device::tc0140syt_comm_r )
172{
173   switch( m_mainmode )
135174   {
136175      case 0x00:      // mode #0
137         //logerror("taitosnd: Master cpu read portdata %01x\n", tc0140syt->masterdata[0]);
138         return tc0140syt->masterdata[tc0140syt->mainmode ++];
176         //logerror("taitosnd: Master cpu read portdata %01x\n", m_masterdata[0]);
177         return m_masterdata[m_mainmode ++];
139178
140179      case 0x01:      // mode #1
141         //logerror("taitosnd: Master cpu receives 0/1 : %01x%01x\n", tc0140syt->masterdata[1], tc0140syt->masterdata[0]);
142         tc0140syt->status &= ~TC0140SYT_PORT01_FULL_MASTER;
143         return tc0140syt->masterdata[tc0140syt->mainmode ++];
180         //logerror("taitosnd: Master cpu receives 0/1 : %01x%01x\n", m_masterdata[1], m_masterdata[0]);
181         m_status &= ~TC0140SYT_PORT01_FULL_MASTER;
182         return m_masterdata[m_mainmode ++];
144183
145184      case 0x02:      // mode #2
146         //logerror("taitosnd: Master cpu read masterdata %01x\n", tc0140syt->masterdata[2]);
147         return tc0140syt->masterdata[tc0140syt->mainmode ++];
185         //logerror("taitosnd: Master cpu read masterdata %01x\n", m_masterdata[2]);
186         return m_masterdata[m_mainmode ++];
148187
149188      case 0x03:      // mode #3
150         //logerror("taitosnd: Master cpu receives 2/3 : %01x%01x\n", tc0140syt->masterdata[3], tc0140syt->masterdata[2]);
151         tc0140syt->status &= ~TC0140SYT_PORT23_FULL_MASTER;
152         return tc0140syt->masterdata[tc0140syt->mainmode ++];
189         //logerror("taitosnd: Master cpu receives 2/3 : %01x%01x\n", m_masterdata[3], m_masterdata[2]);
190         m_status &= ~TC0140SYT_PORT23_FULL_MASTER;
191         return m_masterdata[m_mainmode ++];
153192
154193      case 0x04:      // port status
155         //logerror("tc0140syt : Master cpu read status : %02x\n", tc0140syt->status);
156         return tc0140syt->status;
194         //logerror("tc0140syt : Master cpu read status : %02x\n", m_status);
195         return m_status;
157196
158197      default:
159         //logerror("tc0140syt : Master cpu read in mode [%02x]\n", tc0140syt->mainmode);
198         //logerror("tc0140syt : Master cpu read in mode [%02x]\n", m_mainmode);
160199         return 0;
161200   }
162201}
163202
203//-------------------------------------------------
164204//SLAVE SIDE
205//-------------------------------------------------
165206
166WRITE8_DEVICE_HANDLER( tc0140syt_slave_port_w )
207WRITE8_MEMBER( tc0140syt_device::tc0140syt_slave_port_w )
167208{
168   tc0140syt_state *tc0140syt = get_safe_token(device);
169
170209   data &= 0x0f;
171   tc0140syt->submode = data;
210   m_submode = data;
172211   //logerror("taitosnd: Slave cpu mode [%02x]\n", data);
173212   if (data > 6)
174213      logerror("tc0140syt error : Slave cpu unknown mode[%02x]\n", data);
175214}
176215
177WRITE8_DEVICE_HANDLER( tc0140syt_slave_comm_w )
216WRITE8_MEMBER( tc0140syt_device::tc0140syt_slave_comm_w )
178217{
179   tc0140syt_state *tc0140syt = get_safe_token(device);
180
181218   data &= 0x0f;
182   switch (tc0140syt->submode)
219   switch (m_submode)
183220   {
184221      case 0x00:      // mode #0
185         tc0140syt->masterdata[tc0140syt->submode ++] = data;
222         m_masterdata[m_submode ++] = data;
186223         //logerror("taitosnd: Slave cpu written port 0, data %01x\n", data);
187224         break;
188225
189226      case 0x01:      // mode #1
190         tc0140syt->masterdata[tc0140syt->submode ++] = data;
191         tc0140syt->status |= TC0140SYT_PORT01_FULL_MASTER;
192         //logerror("taitosnd: Slave cpu sends 0/1 : %01x%01x\n" , tc0140syt->masterdata[1] , tc0140syt->masterdata[0]);
193         tc0140syt->slavecpu->execute().spin(); /* writing should take longer than emulated, so spin */
227         m_masterdata[m_submode ++] = data;
228         m_status |= TC0140SYT_PORT01_FULL_MASTER;
229         //logerror("taitosnd: Slave cpu sends 0/1 : %01x%01x\n" , m_masterdata[1] , m_masterdata[0]);
230         m_slavecpu->execute().spin(); /* writing should take longer than emulated, so spin */
194231         break;
195232
196233      case 0x02:      // mode #2
197234         //logerror("taitosnd: Slave cpu written port 2, data %01x\n", data);
198         tc0140syt->masterdata[tc0140syt->submode ++] = data;
235         m_masterdata[m_submode ++] = data;
199236         break;
200237
201238      case 0x03:      // mode #3
202         tc0140syt->masterdata[tc0140syt->submode ++] = data;
203         tc0140syt->status |= TC0140SYT_PORT23_FULL_MASTER;
204         //logerror("taitosnd: Slave cpu sends 2/3 : %01x%01x\n" , tc0140syt->masterdata[3] , tc0140syt->masterdata[2]);
205         tc0140syt->slavecpu->execute().spin(); /* writing should take longer than emulated, so spin */
239         m_masterdata[m_submode ++] = data;
240         m_status |= TC0140SYT_PORT23_FULL_MASTER;
241         //logerror("taitosnd: Slave cpu sends 2/3 : %01x%01x\n" , m_masterdata[3] , m_masterdata[2]);
242         m_slavecpu->execute().spin(); /* writing should take longer than emulated, so spin */
206243         break;
207244
208245      case 0x04:      // port status
209         //tc0140syt->status = TC0140SYT_SET_OK;
246         //m_status = TC0140SYT_SET_OK;
210247         //logerror("tc0140syt : Slave cpu status ok.\n");
211248         break;
212249
213250      case 0x05:      // nmi disable
214         tc0140syt->nmi_enabled = 0;
251         m_nmi_enabled = 0;
215252         break;
216253
217254      case 0x06:      // nmi enable
218         tc0140syt->nmi_enabled = 1;
255         m_nmi_enabled = 1;
219256         break;
220257
221258      default:
222         //logerror("tc0140syt: Slave cpu written in mode [%02x] data[%02x]\n" , tc0140syt->submode, data & 0xff);
259         //logerror("tc0140syt: Slave cpu written in mode [%02x] data[%02x]\n" , m_submode, data & 0xff);
223260         break;
224261   }
225262
226   interrupt_controller(device);
263   interrupt_controller();
227264
228265}
229266
230READ8_DEVICE_HANDLER( tc0140syt_slave_comm_r )
267READ8_MEMBER( tc0140syt_device::tc0140syt_slave_comm_r )
231268{
232   tc0140syt_state *tc0140syt = get_safe_token(device);
233269   UINT8 res = 0;
234270
235   switch ( tc0140syt->submode )
271   switch ( m_submode )
236272   {
237273      case 0x00:      // mode #0
238         //logerror("taitosnd: Slave cpu read slavedata %01x\n", tc0140syt->slavedata[0]);
239         res = tc0140syt->slavedata[tc0140syt->submode ++];
274         //logerror("taitosnd: Slave cpu read slavedata %01x\n", m_slavedata[0]);
275         res = m_slavedata[m_submode ++];
240276         break;
241277
242278      case 0x01:      // mode #1
243         //logerror("taitosnd: Slave cpu receives 0/1 : %01x%01x PC=%4x\n", tc0140syt->slavedata[1] , tc0140syt->slavedata[0],space.device().safe_pc());
244         tc0140syt->status &= ~TC0140SYT_PORT01_FULL;
245         res = tc0140syt->slavedata[tc0140syt->submode ++];
279         //logerror("taitosnd: Slave cpu receives 0/1 : %01x%01x PC=%4x\n", m_slavedata[1] , m_slavedata[0],space.device().safe_pc());
280         m_status &= ~TC0140SYT_PORT01_FULL;
281         res = m_slavedata[m_submode ++];
246282         break;
247283
248284      case 0x02:      // mode #2
249         //logerror("taitosnd: Slave cpu read slavedata %01x\n", tc0140syt->slavedata[2]);
250         res = tc0140syt->slavedata[tc0140syt->submode ++];
285         //logerror("taitosnd: Slave cpu read slavedata %01x\n", m_slavedata[2]);
286         res = m_slavedata[m_submode ++];
251287         break;
252288
253289      case 0x03:      // mode #3
254         //logerror("taitosnd: Slave cpu receives 2/3 : %01x%01x\n", tc0140syt->slavedata[3] , tc0140syt->slavedata[2]);
255         tc0140syt->status &= ~TC0140SYT_PORT23_FULL;
256         res = tc0140syt->slavedata[tc0140syt->submode ++];
290         //logerror("taitosnd: Slave cpu receives 2/3 : %01x%01x\n", m_slavedata[3] , m_slavedata[2]);
291         m_status &= ~TC0140SYT_PORT23_FULL;
292         res = m_slavedata[m_submode ++];
257293         break;
258294
259295      case 0x04:      // port status
260         //logerror("tc0140syt : Slave cpu read status : %02x\n", tc0140syt->status);
261         res = tc0140syt->status;
296         //logerror("tc0140syt : Slave cpu read status : %02x\n", m_status);
297         res = m_status;
262298         break;
263299
264300      default:
265         //logerror("tc0140syt : Slave cpu read in mode [%02x]\n", tc0140syt->submode);
301         //logerror("tc0140syt : Slave cpu read in mode [%02x]\n", m_submode);
266302         res = 0;
267303         break;
268304   }
269305
270   interrupt_controller(device);
306   interrupt_controller();
271307
272308   return res;
273309}
274310
275/*****************************************************************************
276    DEVICE INTERFACE
277*****************************************************************************/
278311
279static DEVICE_START( tc0140syt )
280{
281   tc0140syt_state *tc0140syt = get_safe_token(device);
282   const tc0140syt_interface *intf = get_interface(device);
283
284   /* use the given gfx set */
285   tc0140syt->mastercpu = device->machine().device(intf->master);
286   tc0140syt->slavecpu = device->machine().device(intf->slave);
287
288   device->save_item(NAME(tc0140syt->mainmode));
289   device->save_item(NAME(tc0140syt->submode));
290   device->save_item(NAME(tc0140syt->status));
291   device->save_item(NAME(tc0140syt->nmi_enabled));
292   device->save_item(NAME(tc0140syt->nmi_req));
293   device->save_item(NAME(tc0140syt->slavedata));
294   device->save_item(NAME(tc0140syt->masterdata));
295}
296
297static DEVICE_RESET( tc0140syt )
298{
299   tc0140syt_state *tc0140syt = get_safe_token(device);
300   int i;
301
302   tc0140syt->mainmode = 0;
303   tc0140syt->submode = 0;
304   tc0140syt->status = 0;
305   tc0140syt->nmi_enabled = 0;
306   tc0140syt->nmi_req = 0;
307
308   for (i = 0; i < 4; i++)
309   {
310      tc0140syt->slavedata[i] = 0;
311      tc0140syt->masterdata[i] = 0;
312   }
313}
314
315const device_type TC0140SYT = &device_creator<tc0140syt_device>;
316
317tc0140syt_device::tc0140syt_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
318   : device_t(mconfig, TC0140SYT, "Taito TC0140SYT", tag, owner, clock)
319{
320   m_token = global_alloc_clear(tc0140syt_state);
321}
322
323//-------------------------------------------------
324//  device_config_complete - perform any
325//  operations now that the configuration is
326//  complete
327//-------------------------------------------------
328
329void tc0140syt_device::device_config_complete()
330{
331}
332
333//-------------------------------------------------
334//  device_start - device-specific startup
335//-------------------------------------------------
336
337void tc0140syt_device::device_start()
338{
339   DEVICE_START_NAME( tc0140syt )(this);
340}
341
342//-------------------------------------------------
343//  device_reset - device-specific reset
344//-------------------------------------------------
345
346void tc0140syt_device::device_reset()
347{
348   DEVICE_RESET_NAME( tc0140syt )(this);
349}
trunk/src/mame/audio/taitosnd.h
r21620r21621
11#ifndef __TAITOSND_H__
22#define __TAITOSND_H__
33
4#include "devlegcy.h"
54#include "devcb.h"
65
7/***************************************************************************
8    TYPE DEFINITIONS
9***************************************************************************/
6//**************************************************************************
7//  INTERFACE CONFIGURATION MACROS
8//**************************************************************************
109
10#define MCFG_TC0140SYT_ADD(_tag, _interface) \
11   MCFG_DEVICE_ADD(_tag, TC0140SYT, 0) \
12   MCFG_DEVICE_CONFIG(_interface)
13
14
15//**************************************************************************
16//  TYPE DEFINITIONS
17//**************************************************************************
18
1119struct tc0140syt_interface
1220{
1321   const char         *master;
1422   const char         *slave;
1523};
1624
25
26// ======================> tc0140syt_device
27
1728class tc0140syt_device : public device_t
1829{
1930public:
2031   tc0140syt_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
21   ~tc0140syt_device() { global_free(m_token); }
32   ~tc0140syt_device() { }
2233
23   // access to legacy token
24   void *token() const { assert(m_token != NULL); return m_token; }
2534protected:
2635   // device-level overrides
27   virtual void device_config_complete();
2836   virtual void device_start();
2937   virtual void device_reset();
30private:
31   // internal state
32   void *m_token;
33};
3438
35extern const device_type TC0140SYT;
39public:
40    // MASTER (8bit bus) control functions
41    DECLARE_WRITE8_MEMBER( tc0140syt_port_w );
42    DECLARE_WRITE8_MEMBER( tc0140syt_comm_w );
43    DECLARE_READ8_MEMBER( tc0140syt_comm_r );
3644
45    // SLAVE (8bit bus) control functions ONLY
46    DECLARE_WRITE8_MEMBER( tc0140syt_slave_port_w );
47    DECLARE_READ8_MEMBER( tc0140syt_slave_comm_r );
48    DECLARE_WRITE8_MEMBER( tc0140syt_slave_comm_w );
3749
38/***************************************************************************
39    DEVICE CONFIGURATION MACROS
40***************************************************************************/
50private:
51    void interrupt_controller();
4152
42#define MCFG_TC0140SYT_ADD(_tag, _interface) \
43   MCFG_DEVICE_ADD(_tag, TC0140SYT, 0) \
44   MCFG_DEVICE_CONFIG(_interface)
53private:
54   UINT8     m_slavedata[4];  /* Data on master->slave port (4 nibbles) */
55   UINT8     m_masterdata[4]; /* Data on slave->master port (4 nibbles) */
56   UINT8     m_mainmode;      /* Access mode on master cpu side */
57   UINT8     m_submode;       /* Access mode on slave cpu side */
58   UINT8     m_status;        /* Status data */
59   UINT8     m_nmi_enabled;   /* 1 if slave cpu has nmi's enabled */
60   UINT8     m_nmi_req;       /* 1 if slave cpu has a pending nmi */
4561
46/***************************************************************************
47    DEVICE I/O FUNCTIONS
48***************************************************************************/
62   device_t *m_mastercpu;     /* this is the maincpu */
63   device_t *m_slavecpu;      /* this is the audiocpu */
64};
4965
50/* MASTER (8bit bus) control functions */
51DECLARE_WRITE8_DEVICE_HANDLER( tc0140syt_port_w );
52DECLARE_WRITE8_DEVICE_HANDLER( tc0140syt_comm_w );
53DECLARE_READ8_DEVICE_HANDLER( tc0140syt_comm_r );
66extern const device_type TC0140SYT;
5467
5568
56/* SLAVE (8bit bus) control functions ONLY */
57DECLARE_WRITE8_DEVICE_HANDLER( tc0140syt_slave_port_w );
58DECLARE_READ8_DEVICE_HANDLER( tc0140syt_slave_comm_r );
59DECLARE_WRITE8_DEVICE_HANDLER( tc0140syt_slave_comm_w );
60
61
6269#endif /*__TAITOSND_H__*/
trunk/src/emu/sound/beep.c
r21620r21621
1414#include "emu.h"
1515#include "sound/beep.h"
1616
17#define BEEP_RATE (48000)
1718
18#define BEEP_RATE           48000
1919
20struct beep_state
21{
22   sound_stream *stream;   /* stream number */
23   int enable;             /* enable beep */
24   int frequency;          /* set frequency - this can be changed using the appropiate function */
25   int incr;               /* initial wave state */
26   INT16 signal;           /* current signal */
27};
20// device type definition
21const device_type BEEP = &device_creator<beep_device>;
2822
2923
30INLINE beep_state *get_safe_token(device_t *device)
24//**************************************************************************
25//  LIVE DEVICE
26//**************************************************************************
27
28//-------------------------------------------------
29//  beep_device - constructor
30//-------------------------------------------------
31
32beep_device::beep_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
33   : device_t(mconfig, BEEP, "Beep", tag, owner, clock),
34     device_sound_interface(mconfig, *this),
35     m_stream(NULL),
36     m_enable(0),
37     m_frequency(0),
38     m_incr(0),
39     m_signal(0)
3140{
32   assert(device != NULL);
33   assert(device->type() == BEEP);
34   return (beep_state *)downcast<beep_device *>(device)->token();
3541}
3642
3743
44//-------------------------------------------------
45//  device_start - device-specific startup
46//-------------------------------------------------
3847
39/*************************************
40 *
41 *  Stream updater
42 *
43 *************************************/
48void beep_device::device_start()
49{
50   m_stream = stream_alloc(0, 1, BEEP_RATE);
51   m_enable = 0;
52   m_frequency = 3250;
53   m_incr = 0;
54   m_signal = 0x07fff;
55}
4456
45static STREAM_UPDATE( beep_sound_update )
57
58//-------------------------------------------------
59//  sound_stream_update - handle a stream update
60//-------------------------------------------------
61
62void beep_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
4663{
47   beep_state *bs = (beep_state *) param;
4864   stream_sample_t *buffer = outputs[0];
49   INT16 signal = bs->signal;
65   INT16 signal = m_signal;
5066   int clock = 0, rate = BEEP_RATE / 2;
5167
5268   /* get progress through wave */
53   int incr = bs->incr;
69   int incr = m_incr;
5470
55   if (bs->frequency > 0)
56      clock = bs->frequency;
71   if (m_frequency > 0)
72      clock = m_frequency;
5773
5874   /* if we're not enabled, just fill with 0 */
59   if ( !bs->enable || clock == 0 )
75   if ( !m_enable || clock == 0 )
6076   {
6177      memset( buffer, 0, samples * sizeof(*buffer) );
6278      return;
r21620r21621
7591   }
7692
7793   /* store progress through wave */
78   bs->incr = incr;
79   bs->signal = signal;
94   m_incr = incr;
95   m_signal = signal;
8096}
8197
8298
99//-------------------------------------------------
100//  changing state to on from off will restart tone
101//-------------------------------------------------
83102
84/*************************************
85 *
86 *  Sound handler start
87 *
88 *************************************/
89
90static DEVICE_START( beep )
103void beep_device::set_state(int on)
91104{
92   beep_state *pBeep = get_safe_token(device);
93
94   pBeep->stream = device->machine().sound().stream_alloc(*device, 0, 1, BEEP_RATE, pBeep, beep_sound_update );
95   pBeep->enable = 0;
96   pBeep->frequency = 3250;
97   pBeep->incr = 0;
98   pBeep->signal = 0x07fff;
99}
100
101
102
103/*************************************
104 *
105 *  changing state to on from off will restart tone
106 *
107 *************************************/
108
109void beep_set_state(device_t *device, int on)
110{
111   beep_state *info = get_safe_token(device);
112
113105   /* only update if new state is not the same as old state */
114   if (info->enable == on)
106   if (m_enable == on)
115107      return;
116108
117   info->stream->update();
109   m_stream->update();
110   m_enable = on;
118111
119   info->enable = on;
120112   /* restart wave from beginning */
121   info->incr = 0;
122   info->signal = 0x07fff;
113   m_incr = 0;
114   m_signal = 0x07fff;
123115}
124116
125117
126118
127/*************************************
128 *
129 *  setting new frequency starts from beginning
130 *
131 *************************************/
119//-------------------------------------------------
120//  setting new frequency starts from beginning
121//-------------------------------------------------
132122
133void beep_set_frequency(device_t *device,int frequency)
123void beep_device::set_frequency(int frequency)
134124{
135   beep_state *info = get_safe_token(device);
136
137   if (info->frequency == frequency)
125   if (m_frequency == frequency)
138126      return;
139127
140   info->stream->update();
141   info->frequency = frequency;
142   info->signal = 0x07fff;
143   info->incr = 0;
128   m_stream->update();
129   m_frequency = frequency;
130   m_signal = 0x07fff;
131   m_incr = 0;
144132}
145133
146134
147135
148/*************************************
149 *
150 *  change a channel volume
151 *
152 *************************************/
153
154void beep_set_volume(device_t *device, int volume)
155{
156   beep_state *info = get_safe_token(device);
157
158   info->stream->update();
159
160   volume = 100 * volume / 7;
161
162   downcast<beep_device *>(device)->set_output_gain(0, volume);
163}
164
165const device_type BEEP = &device_creator<beep_device>;
166
167beep_device::beep_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
168   : device_t(mconfig, BEEP, "Beep", tag, owner, clock),
169      device_sound_interface(mconfig, *this)
170{
171   m_token = global_alloc_clear(beep_state);
172}
173
174136//-------------------------------------------------
175//  device_config_complete - perform any
176//  operations now that the configuration is
177//  complete
137//  change a channel volume
178138//-------------------------------------------------
179139
180void beep_device::device_config_complete()
140void beep_device::set_volume(int volume)
181141{
142   m_stream->update();
143   volume = 100 * volume / 7;
144   set_output_gain(0, volume);
182145}
183
184//-------------------------------------------------
185//  device_start - device-specific startup
186//-------------------------------------------------
187
188void beep_device::device_start()
189{
190   DEVICE_START_NAME( beep )(this);
191}
192
193//-------------------------------------------------
194//  sound_stream_update - handle a stream update
195//-------------------------------------------------
196
197void beep_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
198{
199   // should never get here
200   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
201}
trunk/src/emu/sound/beep.h
r21620r21621
33#ifndef __BEEP_H__
44#define __BEEP_H__
55
6#include "devlegcy.h"
7
86#define BEEPER_TAG      "beeper"
97
10void beep_set_state(device_t *device, int on);
11void beep_set_frequency(device_t *device, int frequency);
12void beep_set_volume(device_t *device, int volume);
138
9//**************************************************************************
10//  TYPE DEFINITIONS
11//**************************************************************************
12
13// ======================> beep_device
14
1415class beep_device : public device_t,
15                           public device_sound_interface
16               public device_sound_interface
1617{
1718public:
1819   beep_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
19   ~beep_device() { global_free(m_token); }
20   ~beep_device() { }
2021
21   // access to legacy token
22   void *token() const { assert(m_token != NULL); return m_token; }
2322protected:
2423   // device-level overrides
25   virtual void device_config_complete();
2624   virtual void device_start();
2725
2826   // sound stream update overrides
2927   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
28
29public:
30    void set_state(int on);
31    void set_frequency(int frequency);
32    void set_volume(int volume);
33
3034private:
31   // internal state
32   void *m_token;
35   sound_stream *m_stream;   /* stream number */
36   int m_enable;             /* enable beep */
37   int m_frequency;          /* set frequency - this can be changed using the appropiate function */
38   int m_incr;               /* initial wave state */
39   INT16 m_signal;           /* current signal */
3340};
3441
3542extern const device_type BEEP;
trunk/src/mess/drivers/vk100.c
r21620r21621
500500#ifdef LED_VERBOSE
501501   if (BIT(data, 6)) logerror("kb keyclick bit 6 set: not emulated yet (multivibrator)!\n");
502502#endif
503   beep_set_state( m_speaker, BIT(data, 7));
503   m_speaker->set_state(BIT(data, 7));
504504#ifdef LED_VERBOSE
505505   logerror("LED state: %02X: %s %s %s %s %s %s\n", data&0xFF, (data&0x20)?"------- LOCAL ":"ON LINE ----- ", (data&0x10)?"--------- ":"NO SCROLL ", (data&0x8)?"----- ":"BASIC ", (data&0x4)?"--------- ":"HARD-COPY ", (data&0x2)?"-- ":"L1 ", (data&0x1)?"-- ":"L2 ");
506506#endif
r21620r21621
865865
866866void vk100_state::machine_start()
867867{
868   beep_set_frequency( m_speaker, 116 ); //116 hz (page 172 of TM), but duty cycle is wrong here!
868   m_speaker->set_frequency(116); //116 hz (page 172 of TM), but duty cycle is wrong here!
869869   output_set_value("online_led",1);
870870   output_set_value("local_led", 0);
871871   output_set_value("noscroll_led",1);
trunk/src/mess/drivers/pc2000.c
r21620r21621
122122
123123WRITE8_MEMBER( pc2000_state::beep_w )
124124{
125   beep_set_state(m_beep, BIT(data, 3));
125   m_beep->set_state(BIT(data, 3));
126126   m_beep_state = data;
127127}
128128
trunk/src/mess/drivers/pc8801.c
r21620r21621
11841184   m_rtc->clk_w((data & 4) >> 2);
11851185
11861186   if(((m_device_ctrl_data & 0x20) == 0x00) && ((data & 0x20) == 0x20))
1187      beep_set_state(machine().device(BEEPER_TAG),1);
1187      machine().device<beep_device>(BEEPER_TAG)->set_state(1);
11881188
11891189   if(((m_device_ctrl_data & 0x20) == 0x20) && ((data & 0x20) == 0x00))
1190      beep_set_state(machine().device(BEEPER_TAG),0);
1190      machine().device<beep_device>(BEEPER_TAG)->set_state(0);
11911191
11921192   if((m_device_ctrl_data & 0x40) != (data & 0x40))
11931193   {
r21620r21621
12141214
12151215   /* TODO: is SING a buzzer mask? Bastard Special relies on this ... */
12161216   if(m_device_ctrl_data & 0x80)
1217      beep_set_state(machine().device(BEEPER_TAG),0);
1217      machine().device<beep_device>(BEEPER_TAG)->set_state(0);
12181218
12191219   m_device_ctrl_data = data;
12201220}
r21620r21621
24752475      m_crtc.status = 0;
24762476   }
24772477
2478   beep_set_frequency(machine().device(BEEPER_TAG),2400);
2479   beep_set_state(machine().device(BEEPER_TAG),0);
2478   machine().device<beep_device>(BEEPER_TAG)->set_frequency(2400);
2479   machine().device<beep_device>(BEEPER_TAG)->set_state(0);
24802480
24812481   #ifdef USE_PROPER_I8214
24822482   {
trunk/src/mess/drivers/lx800.c
r21620r21621
108108   logerror("--> err: %d, ack: %d, fire: %d, buzzer: %d\n", BIT(data, 4), BIT(data, 5), BIT(data, 6), BIT(data, 7));
109109
110110   output_set_value("online_led", !BIT(data, 2));
111   beep_set_state(m_beep, !BIT(data, 7));
111   m_beep->set_state(!BIT(data, 7));
112112}
113113
114114
r21620r21621
146146
147147void lx800_state::machine_start()
148148{
149   beep_set_state(m_beep, 0);
150   beep_set_frequency(m_beep, 4000); /* ? */
149   m_beep->set_state(0);
150   m_beep->set_frequency(4000); /* ? */
151151}
152152
153153
trunk/src/mess/drivers/zrt80.c
r21620r21621
5858
5959TIMER_CALLBACK_MEMBER(zrt80_state::zrt80_beepoff)
6060{
61   beep_set_state(m_beep, 0);
61   m_beep->set_state(0);
6262}
6363
6464WRITE8_MEMBER(zrt80_state::zrt80_30_w)
6565{
6666   machine().scheduler().timer_set(attotime::from_msec(100), timer_expired_delegate(FUNC(zrt80_state::zrt80_beepoff),this));
67   beep_set_state(m_beep, 1);
67   m_beep->set_state(1);
6868}
6969
7070WRITE8_MEMBER(zrt80_state::zrt80_38_w)
7171{
7272   machine().scheduler().timer_set(attotime::from_msec(400), timer_expired_delegate(FUNC(zrt80_state::zrt80_beepoff),this));
73   beep_set_state(m_beep, 1);
73   m_beep->set_state(1);
7474}
7575
7676static ADDRESS_MAP_START(zrt80_mem, AS_PROGRAM, 8, zrt80_state)
r21620r21621
181181
182182void zrt80_state::machine_reset()
183183{
184   beep_set_frequency(m_beep, 800);
184   m_beep->set_frequency(800);
185185   m_term_data = 0;
186186}
187187
trunk/src/mess/drivers/sc2.c
r21620r21621
4545   {
4646      m_beep_state = ~m_beep_state;
4747
48      beep_set_state(m_beep, m_beep_state);
48      m_beep->set_state(m_beep_state);
4949   }
5050
5151   return 0xff;
trunk/src/mess/drivers/psion.c
r21620r21621
153153      m_kb_counter = 0;
154154      break;
155155   case 0x180:
156      beep_set_state(m_beep, 1);
156      m_beep->set_state(1);
157157      break;
158158   case 0x1c0:
159      beep_set_state(m_beep, 0);
159      m_beep->set_state(0);
160160      break;
161161   case 0x240:
162162      if (offset == 0x260 && (m_rom_bank_count || m_ram_bank_count))
trunk/src/mess/drivers/pcw.c
r21620r21621
407407WRITE8_MEMBER(pcw_state::pcw_system_control_w)
408408{
409409   upd765a_device *fdc = machine().device<upd765a_device>("upd765");
410   device_t *speaker = machine().device(BEEPER_TAG);
410   beep_device *speaker = machine().device<beep_device>(BEEPER_TAG);
411411   LOG(("SYSTEM CONTROL: %d\n",data));
412412
413413   switch (data)
r21620r21621
545545      /* beep on */
546546      case 11:
547547      {
548         beep_set_state(speaker,1);
548         speaker->set_state(1);
549549      }
550550      break;
551551
552552      /* beep off */
553553      case 12:
554554      {
555         beep_set_state(speaker,0);
555         speaker->set_state(0);
556556      }
557557      break;
558558
r21620r21621
996996
997997TIMER_CALLBACK_MEMBER(pcw_state::setup_beep)
998998{
999   device_t *speaker = machine().device(BEEPER_TAG);
1000   beep_set_state(speaker, 0);
1001   beep_set_frequency(speaker, 3750);
999   beep_device *speaker = machine().device<beep_device>(BEEPER_TAG);
1000   speaker->set_state(0);
1001   speaker->set_frequency(3750);
10021002}
10031003
10041004
trunk/src/mess/drivers/mmodular.c
r21620r21621
243243      m_lcdc->write(space, BIT(data,0), lcd_char);
244244   }
245245
246   if (BIT(data,2) || BIT(data,3)) beep_set_state(machine().device("beep"),1); else beep_set_state(machine().device("beep"),0);
246   if (BIT(data,2) || BIT(data,3))
247            machine().device<beep_device>("beep")->set_state(1);
248        else
249            machine().device<beep_device>("beep")->set_state(0);
247250
248251   if (BIT(data,7) && BIT(data, 4)) {
249252      for (i = 0;i < 8;i++)
r21620r21621
408411
409412WRITE8_MEMBER(polgar_state::megaiv_write_LED)
410413{
411if (BIT(data,7)) beep_set_state(machine().device("beep"),1); else beep_set_state(machine().device("beep"),0);
412output_set_led_value(102,BIT(data,1)?1:0);
413output_set_led_value(107,BIT(data,6)?1:0);
414    if (BIT(data,7))
415        machine().device<beep_device>("beep")->set_state(1);
416    else
417        machine().device<beep_device>("beep")->set_state(0);
418    output_set_led_value(102,BIT(data,1)?1:0);
419    output_set_led_value(107,BIT(data,6)?1:0);
414420
415421//  logerror("LEDs  FUNC = %02x found = %d\n",data,found);
416422   logerror("LED mask %d\n",data);
r21620r21621
468474   found = 1;
469475}
470476
471if (BIT(data,7)) beep_set_state(machine().device("beep"),1); else beep_set_state(machine().device("beep"),0);
472if (BIT(data,1)) beep_set_state(machine().device("beep"),1); else beep_set_state(machine().device("beep"),0);
477if (BIT(data,7))
478    machine().device<beep_device>("beep")->set_state(1);
479else
480    machine().device<beep_device>("beep")->set_state(0);
481if (BIT(data,1))
482    machine().device<beep_device>("beep")->set_state(1);
483else
484    machine().device<beep_device>("beep")->set_state(0);
473485//  logerror("LEDs  FUNC = %02x found = %d\n",data,found);
474486   if (!found) {
475487      logerror("unknown LED mask %d\n",data);
r21620r21621
711723
712724WRITE8_MEMBER(polgar_state::beep_academy)
713725{
714   if (!BIT(data,7)) beep_set_state(machine().device("beep"),1); else beep_set_state(machine().device("beep"),0);
726   if (!BIT(data,7))
727            machine().device<beep_device>("beep")->set_state(1);
728        else
729            machine().device<beep_device>("beep")->set_state(0);
715730}
716731
717732WRITE8_MEMBER(polgar_state::megaiv_IO)
r21620r21621
863878void polgar_state::write_IOenable(unsigned char data,address_space &space)
864879{
865880   hd44780_device * hd44780 = space.machine().device<hd44780_device>("hd44780");
866   device_t *speaker = space.machine().device("beep");
881   beep_device *speaker = machine().device<beep_device>("beep");
867882
868883   if (BIT(data,5) && BIT(data,4)) {
869884      if (BIT(data,1)) {
r21620r21621
888903
889904   logerror("Write to IOENBL data: %08x\n",data);
890905
891      if (BIT(data,2) || BIT(data,3)) beep_set_state(speaker,1); else beep_set_state(speaker,0);
906      if (BIT(data,2) || BIT(data,3))
907                    speaker->set_state(1);
908                else
909                    speaker->set_state(0);
892910   }
893911
894912}
trunk/src/mess/drivers/pc9801.c
r21620r21621
31093109
31103110WRITE8_MEMBER(pc9801_state::ppi_sys_portc_w)
31113111{
3112   beep_set_state(machine().device(BEEPER_TAG),!(data & 0x08));
3112   machine().device<beep_device>(BEEPER_TAG)->set_state(!(data & 0x08));
31133113}
31143114
31153115static I8255A_INTERFACE( ppi_system_intf )
r21620r21621
34263426         m_tvram[(0x3fe0)+i*2] = default_memsw_data[i];
34273427   }
34283428
3429   beep_set_frequency(machine().device(BEEPER_TAG),2400);
3430   beep_set_state(machine().device(BEEPER_TAG),0);
3429   machine().device<beep_device>(BEEPER_TAG)->set_frequency(2400);
3430   machine().device<beep_device>(BEEPER_TAG)->set_state(0);
34313431
34323432   m_nmi_ff = 0;
34333433   m_mouse.control = 0xff;
trunk/src/mess/drivers/x07.c
r21620r21621
11851185#if(1)
11861186      if((data & 0x0e) == 0x0e)
11871187      {
1188         beep_set_state(m_beep, 1);
1189         beep_set_frequency(m_beep, 192000 / ((m_regs_w[2] | (m_regs_w[3] << 8)) & 0x0fff));
1188         m_beep->set_state(1);
1189         m_beep->set_frequency(192000 / ((m_regs_w[2] | (m_regs_w[3] << 8)) & 0x0fff));
11901190
11911191         m_beep_stop->adjust(attotime::from_msec(m_ram->pointer()[0x450] * 0x20));
11921192      }
11931193      else
1194         beep_set_state(m_beep, 0);
1194         m_beep->set_state(0);
11951195#endif
11961196      break;
11971197
r21620r21621
13741374
13751375TIMER_CALLBACK_MEMBER(x07_state::beep_stop)
13761376{
1377   beep_set_state(m_beep, 0);
1377   m_beep->set_state(0);
13781378}
13791379
13801380static const gfx_layout x07_charlayout =
trunk/src/mess/drivers/fidelz80.c
r21620r21621
667667
668668WRITE8_MEMBER( fidelz80_state::cc10_porta_w )
669669{
670   beep_set_state(m_beep, (data & 0x80) ? 0 : 1);
670   m_beep->set_state((data & 0x80) ? 0 : 1);
671671
672672   m_digit_data = data;
673673
trunk/src/mess/drivers/smc777.c
r21620r21621
528528         m_raminh_prefetch = (UINT8)(space.device().state().state_int(Z80_R)) & 0x7f;
529529         break;
530530      case 0x02: printf("Interlace %s\n",data & 0x10 ? "on" : "off"); break;
531      case 0x05: beep_set_state(machine().device(BEEPER_TAG),data & 0x10); break;
531      case 0x05: machine().device<beep_device>(BEEPER_TAG)->set_state(data & 0x10); break;
532532      default: printf("System FF W %02x\n",data); break;
533533   }
534534}
r21620r21621
990990   m_raminh_prefetch = 0xff;
991991   m_pal_mode = 0x10;
992992
993   beep_set_frequency(machine().device(BEEPER_TAG),300); //TODO: correct frequency
994   beep_set_state(machine().device(BEEPER_TAG),0);
993   machine().device<beep_device>(BEEPER_TAG)->set_frequency(300); //TODO: correct frequency
994   machine().device<beep_device>(BEEPER_TAG)->set_state(0);
995995}
996996
997997
trunk/src/mess/drivers/xerox820.c
r21620r21621
199199
200200TIMER_CALLBACK_MEMBER( bigboard_state::bigboard_beepoff )
201201{
202   beep_set_state(m_beeper, 0);
202   m_beeper->set_state(0);
203203}
204204
205205/* Z80 PIO */
r21620r21621
291291   if (BIT(data, 5) & (!m_bit5))
292292   {
293293      machine().scheduler().timer_set(attotime::from_msec(40), timer_expired_delegate(FUNC(bigboard_state::bigboard_beepoff),this));
294      beep_set_state(m_beeper, 1);
294      m_beeper->set_state(1);
295295   }
296296   m_bit5 = BIT(data, 5);
297297}
r21620r21621
599599   bankswitch(1);
600600
601601   /* bigboard has a one-pulse output to drive a user-supplied beeper */
602   beep_set_state(m_beeper, 0);
603   beep_set_frequency(m_beeper, 950);
602   m_beeper->set_state(0);
603   m_beeper->set_frequency(950);
604604
605605   m_fdc->reset();
606606}
trunk/src/mess/drivers/micronic.c
r21620r21621
157157      500,  444,  400,  364,  333, 308, 286, 267
158158   };
159159
160   beep_set_frequency(m_beep, frequency[data & 0x0f]);
161   beep_set_state(m_beep, (data & 0x0f) ? 1 : 0);
160   m_beep->set_frequency(frequency[data & 0x0f]);
161   m_beep->set_state((data & 0x0f) ? 1 : 0);
162162}
163163
164164READ8_MEMBER( micronic_state::irq_flag_r )
trunk/src/mess/drivers/glasgow.c
r21620r21621
106106{
107107   UINT16 lcd_flag = data & 0x8100;
108108
109   beep_set_state(m_beep, BIT(lcd_flag, 8));
109   m_beep->set_state(BIT(lcd_flag, 8));
110110
111111   if (lcd_flag)
112112      m_led7 = 255;
r21620r21621
153153//  UINT8 lcd_flag;
154154   mboard_lcd_invert = 0;
155155//  lcd_flag=data >> 8;
156   //beep_set_state(0, (data >> 8) & 1 ? 1 : 0);
156   //m_beep->set_state((data >> 8) & 1 ? 1 : 0);
157157   if ((data >> 8) == 0)
158158   {
159159      mboard_key_selector = 1;
r21620r21621
175175
176176WRITE16_MEMBER( glasgow_state::write_irq_flag )
177177{
178   beep_set_state(m_beep, data & 0x100);
178   m_beep->set_state(data & 0x100);
179179   logerror("Write 0x800004 = %x \n", data);
180180   m_irq_flag = 1;
181181   m_beeper = data;
r21620r21621
236236
237237
238238   //logerror("LCD Flag 32 = %x \n", data >> 24);
239   //beep_set_state(0, (data >> 24) & 1 ? 1 : 0);
239   //m_beep->set_state((data >> 24) & 1 ? 1 : 0);
240240
241241//  if (lcd_flag != 0)
242242//      m_led7 = 255;
r21620r21621
269269
270270WRITE32_MEMBER( glasgow_state::write_beeper32 )
271271{
272   beep_set_state(m_beep, data & 0x01000000);
272   m_beep->set_state(data & 0x01000000);
273273   logerror("Write 0x8000004 = %x \n", data);
274274   m_irq_flag = 1;
275275   m_beeper = data;
r21620r21621
290290   mboard_key_selector = 0;
291291   m_irq_flag = 0;
292292   m_lcd_shift_counter = 3;
293   beep_set_frequency(m_beep, 44);
293   m_beep->set_frequency(44);
294294
295295   mboard_savestate_register();
296296}
r21620r21621
299299MACHINE_START_MEMBER(glasgow_state,dallas32)
300300{
301301   m_lcd_shift_counter = 3;
302   beep_set_frequency(m_beep, 44);
302   m_beep->set_frequency(44);
303303
304304   mboard_savestate_register();
305305}
trunk/src/mess/drivers/mz2500.c
r21620r21621
18061806
18071807   m_cg_clear_flag = 0;
18081808
1809   beep_set_frequency(machine().device(BEEPER_TAG),4096);
1810   beep_set_state(machine().device(BEEPER_TAG),0);
1809   machine().device<beep_device>(BEEPER_TAG)->set_frequency(4096);
1810   machine().device<beep_device>(BEEPER_TAG)->set_state(0);
18111811
18121812//  m_monitor_type = machine().root_device().ioport("DSW1")->read() & 0x40 ? 1 : 0;
18131813}
r21620r21621
19211921
19221922   m_old_portc = data;
19231923
1924   beep_set_state(machine().device(BEEPER_TAG),data & 0x04);
1924   machine().device<beep_device>(BEEPER_TAG)->set_state(data & 0x04);
19251925
19261926   m_screen_enable = data & 1;
19271927
trunk/src/mess/drivers/multi8.c
r21620r21621
629629
630630WRITE8_MEMBER( multi8_state::ym2203_porta_w )
631631{
632   beep_set_state(m_beep, (data & 0x08));
632   m_beep->set_state((data & 0x08));
633633}
634634
635635static const ym2203_interface ym2203_config =
r21620r21621
655655
656656void multi8_state::machine_reset()
657657{
658   beep_set_frequency(machine().device(BEEPER_TAG),1200); //guesswork
659   beep_set_state(machine().device(BEEPER_TAG),0);
658   machine().device<beep_device>(BEEPER_TAG)->set_frequency(1200); //guesswork
659   machine().device<beep_device>(BEEPER_TAG)->set_state(0);
660660   m_mcu_init = 0;
661661}
662662
trunk/src/mess/drivers/studio2.c
r21620r21621
446446
447447WRITE_LINE_MEMBER( studio2_state::q_w )
448448{
449   beep_set_state(m_speaker, state);
449   m_speaker->set_state(state);
450450}
451451
452452static COSMAC_INTERFACE( studio2_cosmac_intf )
r21620r21621
629629
630630TIMER_CALLBACK_MEMBER(studio2_state::setup_beep)
631631{
632   device_t *speaker = machine().device(BEEPER_TAG);
633   beep_set_state(speaker, 0);
634   beep_set_frequency(speaker, 300);
632   beep_device *speaker = machine().device<beep_device>(BEEPER_TAG);
633   speaker->set_state(0);
634   speaker->set_frequency(300);
635635}
636636
637637DRIVER_INIT_MEMBER(studio2_state,studio2)
trunk/src/mess/drivers/tmc1800.c
r21620r21621
112112*/
113113
114114#include "includes/tmc1800.h"
115#include "sound/beep.h"
115116
116117/* Read/Write Handlers */
117118
r21620r21621
907908
908909TIMER_CALLBACK_MEMBER(tmc1800_state::setup_beep)
909910{
910   device_t *speaker = machine().device(BEEPER_TAG);
911   beep_set_state(speaker, 0);
912   beep_set_frequency( speaker, 0 );
911   beep_device *speaker = machine().device<beep_device>(BEEPER_TAG);
912   speaker->set_state(0);
913   speaker->set_frequency(0);
913914}
914915
915916DRIVER_INIT_MEMBER(tmc1800_state,tmc1800)
trunk/src/mess/drivers/h8.c
r21620r21621
102102   if (m_digit) output_set_digit_value(m_digit, m_segment);
103103
104104   output_set_value("mon_led",(data & 0x20) ? 0 : 1);
105   beep_set_state(m_beep, (data & 0x80) ? 0 : 1);
105   m_beep->set_state((data & 0x80) ? 0 : 1);
106106
107107   machine().device("maincpu")->execute().set_input_line(INPUT_LINE_IRQ0, CLEAR_LINE);
108108   m_irq_ctl &= 0xf0;
r21620r21621
167167
168168void h8_state::machine_reset()
169169{
170   beep_set_frequency(m_beep, H8_BEEP_FRQ);
170   m_beep->set_frequency(H8_BEEP_FRQ);
171171   output_set_value("pwr_led", 0);
172172   m_irq_ctl = 1;
173173}
trunk/src/mess/drivers/h19.c
r21620r21621
7373
7474TIMER_CALLBACK_MEMBER(h19_state::h19_beepoff)
7575{
76   beep_set_state(m_beep, 0);
76   m_beep->set_state(0);
7777}
7878
7979READ8_MEMBER( h19_state::h19_80_r )
r21620r21621
9999    offset 20-3F = terminal bell */
100100
101101   UINT8 length = (offset & 0x20) ? 200 : 4;
102   beep_set_state(m_beep, 1);
102   m_beep->set_state(1);
103103   machine().scheduler().timer_set(attotime::from_msec(length), timer_expired_delegate(FUNC(h19_state::h19_beepoff),this));
104104}
105105
r21620r21621
291291
292292void h19_state::machine_reset()
293293{
294   beep_set_frequency(m_beep, H19_BEEP_FRQ);
294   m_beep->set_frequency(H19_BEEP_FRQ);
295295}
296296
297297void h19_state::video_start()
trunk/src/mess/drivers/vt100.c
r21620r21621
145145
146146WRITE8_MEMBER( vt100_state::vt100_keyboard_w )
147147{
148   beep_set_frequency( m_speaker, 786 ); // 7.945us per serial clock = ~125865.324hz, / 160 clocks per char = ~ 786 hz
148   m_speaker->set_frequency(786); // 7.945us per serial clock = ~125865.324hz, / 160 clocks per char = ~ 786 hz
149149   output_set_value("online_led",BIT(data, 5) ? 0 : 1);
150150   output_set_value("local_led", BIT(data, 5));
151151   output_set_value("locked_led",BIT(data, 4) ? 0 : 1);
r21620r21621
154154   output_set_value("l3_led", BIT(data, 1) ? 0 : 1);
155155   output_set_value("l4_led", BIT(data, 0) ? 0 : 1);
156156   m_key_scan = BIT(data, 6);
157   beep_set_state( m_speaker, BIT(data, 7));
157   m_speaker->set_state(BIT(data, 7));
158158}
159159
160160READ8_MEMBER( vt100_state::vt100_keyboard_r )
r21620r21621
353353   m_keyboard_int = 0;
354354   m_receiver_int = 0;
355355   m_vertical_int = 0;
356   beep_set_frequency( m_speaker, 786 ); // 7.945us per serial clock = ~125865.324hz, / 160 clocks per char = ~ 786 hz
356   m_speaker->set_frequency(786); // 7.945us per serial clock = ~125865.324hz, / 160 clocks per char = ~ 786 hz
357357   output_set_value("online_led",1);
358358   output_set_value("local_led", 0);
359359   output_set_value("locked_led",1);
trunk/src/mess/drivers/pce220.c
r21620r21621
376376
377377WRITE8_MEMBER( pce220_state::port18_w )
378378{
379   beep_set_state(m_beep, BIT(data, 7));
379   m_beep->set_state(BIT(data, 7));
380380
381381   m_serial->out_busy(BIT(data, 0));
382382   m_serial->out_dout(BIT(data, 1));
trunk/src/mess/drivers/bmjr.c
r21620r21621
133133{
134134   if(!m_tape_switch)
135135   {
136      beep_set_state(m_beep, !BIT(data, 7));
136      m_beep->set_state(!BIT(data, 7));
137137   }
138138   else
139139   {
r21620r21621
333333
334334void bmjr_state::machine_start()
335335{
336   beep_set_frequency(m_beep, 1200); //guesswork
337   beep_set_state(m_beep, 0);
336   m_beep->set_frequency(1200); //guesswork
337   m_beep->set_state(0);
338338}
339339
340340void bmjr_state::machine_reset()
trunk/src/mess/drivers/osi.c
r21620r21621
339339
340340   */
341341
342   beep_set_state(m_beep, BIT(data, 1));
342   m_beep->set_state(BIT(data, 1));
343343}
344344
345345WRITE8_MEMBER( c1p_state::osi630_sound_w )
346346{
347   if (data) beep_set_frequency(m_beep, 49152 / data);
347   if (data) m_beep->set_frequency(49152 / data);
348348}
349349
350350/* Disk Drive */
r21620r21621
933933
934934TIMER_CALLBACK_MEMBER(sb2m600_state::setup_beep)
935935{
936   device_t *speaker = machine().device(BEEPER_TAG);
937   beep_set_state(speaker, 0);
938   beep_set_frequency(speaker, 300);
936   beep_device *speaker = machine().device<beep_device>(BEEPER_TAG);
937   speaker->set_state(0);
938   speaker->set_frequency(300);
939939}
940940
941941DRIVER_INIT_MEMBER(c1p_state,c1p)
trunk/src/mess/drivers/pc100.c
r21620r21621
217217   if(offset == 0)
218218   {
219219      m_timer_mode = (data & 0x18) >> 3;
220      beep_set_state(machine().device(BEEPER_TAG),((data & 0x40) >> 6) ^ 1);
220      machine().device<beep_device>(BEEPER_TAG)->set_state(((data & 0x40) >> 6) ^ 1);
221221      printf("%02x\n",data & 0xc0);
222222   }
223223}
r21620r21621
427427
428428void pc100_state::machine_reset()
429429{
430   beep_set_frequency(machine().device(BEEPER_TAG),2400);
431   beep_set_state(machine().device(BEEPER_TAG),0);
430   machine().device<beep_device>(BEEPER_TAG)->set_frequency(2400);
431   machine().device<beep_device>(BEEPER_TAG)->set_state(0);
432432}
433433
434434INTERRUPT_GEN_MEMBER(pc100_state::pc100_vblank_irq)
trunk/src/mess/drivers/pb1000.c
r21620r21621
443443
444444static void port_w(hd61700_cpu_device &device, UINT8 data)
445445{
446   beep_set_state(device.machine().device(BEEPER_TAG), (BIT(data,7) ^ BIT(data,6)));
446   device.machine().device<beep_device>(BEEPER_TAG)->set_state((BIT(data,7) ^ BIT(data,6)));
447447   //printf("%x\n", data);
448448}
449449
trunk/src/mess/drivers/mz2000.c
r21620r21621
120120   required_device<cpu_device> m_maincpu;
121121   required_device<device_t> m_mb8877a;
122122   required_device<device_t> m_pit8253;
123   required_device<device_t> m_beeper;
123   required_device<beep_device> m_beeper;
124124   required_memory_region m_region_tvram;
125125   required_memory_region m_region_gvram;
126126   required_memory_region m_region_chargen;
r21620r21621
555555   m_tvram_enable = 0;
556556   m_gvram_enable = 0;
557557
558   beep_set_frequency(m_beeper,4096);
559   beep_set_state(m_beeper,0);
558   m_beeper->set_frequency(4096);
559   m_beeper->set_state(0);
560560
561561   m_color_mode = m_io_config->read() & 1;
562562   m_has_fdc = (m_io_config->read() & 2) >> 1;
r21620r21621
732732      m_maincpu->set_input_line(INPUT_LINE_RESET, PULSE_LINE);
733733   }
734734
735   beep_set_state(m_beeper,data & 0x04);
735   m_beeper->set_state(data & 0x04);
736736
737737   m_old_portc = data;
738738}
trunk/src/mess/drivers/nc.c
r21620r21621
672672   int on;
673673   int frequency;
674674   int period;
675   const char *beep_device = NULL;
675   const char *beeper_device = NULL;
676676
677677   switch(channel)
678678   {
679679      case 0:
680         beep_device = "beep.1";
680         beeper_device = "beep.1";
681681         break;
682682      case 1:
683         beep_device = "beep.2";
683         beeper_device = "beep.2";
684684         break;
685685   }
686686
r21620r21621
693693   frequency = (int)(1000000.0f/((float)((period & 0x07fff)<<1) * 1.6276f));
694694
695695   /* set state */
696   beep_set_state(machine.device(beep_device), on);
696   machine.device<beep_device>(beeper_device)->set_state(on);
697697   /* set frequency */
698   beep_set_frequency(machine.device(beep_device), frequency);
698   machine.device<beep_device>(beeper_device)->set_frequency(frequency);
699699}
700700
701701WRITE8_MEMBER(nc_state::nc_sound_w)
trunk/src/mess/drivers/mephisto.c
r21620r21621
393393      m_allowNMI = 0;
394394      m_maincpu->set_input_line(INPUT_LINE_NMI,PULSE_LINE);
395395   }
396   beep_set_state(m_beep, m_led_status&64?1:0);
396   m_beep->set_state(m_led_status&64?1:0);
397397}
398398
399399TIMER_DEVICE_CALLBACK_MEMBER(mephisto_state::update_nmi_r5)
400400{
401401   m_maincpu->set_input_line(INPUT_LINE_NMI,PULSE_LINE);
402   beep_set_state(m_beep, m_led_status&64?1:0);
402   m_beep->set_state(m_led_status&64?1:0);
403403}
404404
405405TIMER_DEVICE_CALLBACK_MEMBER(mephisto_state::update_irq)//only mm2
406406{
407407   m_maincpu->set_input_line(M65C02_IRQ_LINE, HOLD_LINE);
408408
409   beep_set_state(m_beep, m_led_status&64?1:0);
409   m_beep->set_state(m_led_status&64?1:0);
410410}
411411
412412void mephisto_state::machine_start()
trunk/src/mess/drivers/fm7.c
r21620r21621
236236
237237TIMER_CALLBACK_MEMBER(fm7_state::fm7_beeper_off)
238238{
239   beep_set_state(machine().device(BEEPER_TAG),0);
239   machine().device<beep_device>(BEEPER_TAG)->set_state(0);
240240   logerror("timed beeper off\n");
241241}
242242
r21620r21621
246246
247247   if(!m_speaker_active)  // speaker not active, disable all beeper sound
248248   {
249      beep_set_state(machine().device(BEEPER_TAG),0);
249      machine().device<beep_device>(BEEPER_TAG)->set_state(0);
250250      return;
251251   }
252252
253253   if(data & 0x80)
254254   {
255255      if(m_speaker_active)
256         beep_set_state(machine().device(BEEPER_TAG),1);
256         machine().device<beep_device>(BEEPER_TAG)->set_state(1);
257257   }
258258   else
259      beep_set_state(machine().device(BEEPER_TAG),0);
259      machine().device<beep_device>(BEEPER_TAG)->set_state(0);
260260
261261   if(data & 0x40)
262262   {
263263      if(m_speaker_active)
264264      {
265         beep_set_state(machine().device(BEEPER_TAG),1);
265         machine().device<beep_device>(BEEPER_TAG)->set_state(1);
266266         logerror("timed beeper on\n");
267267         machine().scheduler().timer_set(attotime::from_msec(205), timer_expired_delegate(FUNC(fm7_state::fm7_beeper_off),this));
268268      }
r21620r21621
279279{
280280   if(m_speaker_active)
281281   {
282      beep_set_state(machine().device(BEEPER_TAG),1);
282      machine().device<beep_device>(BEEPER_TAG)->set_state(1);
283283      logerror("timed beeper on\n");
284284      machine().scheduler().timer_set(attotime::from_msec(205), timer_expired_delegate(FUNC(fm7_state::fm7_beeper_off),this));
285285   }
r21620r21621
18481848   memset(m_shared_ram,0xff,0x80);
18491849   m_type = SYS_FM7;
18501850
1851   beep_set_frequency(machine().device(BEEPER_TAG),1200);
1852   beep_set_state(machine().device(BEEPER_TAG),0);
1851   machine().device<beep_device>(BEEPER_TAG)->set_frequency(1200);
1852   machine().device<beep_device>(BEEPER_TAG)->set_state(0);
18531853}
18541854
18551855MACHINE_START_MEMBER(fm7_state,fm77av)
r21620r21621
18691869   membank("bank21")->set_base(RAM+0x800);
18701870
18711871   m_type = SYS_FM77AV;
1872   beep_set_frequency(machine().device(BEEPER_TAG),1200);
1873   beep_set_state(machine().device(BEEPER_TAG),0);
1872   machine().device<beep_device>(BEEPER_TAG)->set_frequency(1200);
1873   machine().device<beep_device>(BEEPER_TAG)->set_state(0);
18741874}
18751875
18761876MACHINE_START_MEMBER(fm7_state,fm11)
r21620r21621
18801880
18811881   memset(m_shared_ram,0xff,0x80);
18821882   m_type = SYS_FM11;
1883   beep_set_frequency(machine().device(BEEPER_TAG),1200);
1884   beep_set_state(machine().device(BEEPER_TAG),0);
1883   machine().device<beep_device>(BEEPER_TAG)->set_frequency(1200);
1884   machine().device<beep_device>(BEEPER_TAG)->set_state(0);
18851885   // last part of Initiate ROM is visible at the end of RAM too (interrupt vectors)
18861886   memcpy(RAM+0x3fff0,ROM+0x0ff0,16);
18871887}
r21620r21621
18891889MACHINE_START_MEMBER(fm7_state,fm16)
18901890{
18911891   m_type = SYS_FM16;
1892   beep_set_frequency(machine().device(BEEPER_TAG),1200);
1893   beep_set_state(machine().device(BEEPER_TAG),0);
1892   machine().device<beep_device>(BEEPER_TAG)->set_frequency(1200);
1893   machine().device<beep_device>(BEEPER_TAG)->set_state(0);
18941894}
18951895
18961896void fm7_state::machine_reset()
trunk/src/mess/drivers/bml3.c
r21620r21621
364364
365365WRITE8_MEMBER( bml3_state::bml3_beep_w)
366366{
367   beep_set_state(m_beep,!BIT(data, 7));
367   m_beep->set_state(!BIT(data, 7));
368368}
369369
370370READ8_MEMBER( bml3_state::bml3_a000_r) { return m_extram[offset + 0xa000]; }
r21620r21621
632632
633633void bml3_state::machine_start()
634634{
635   beep_set_frequency(machine().device(BEEPER_TAG),1200); //guesswork
636   beep_set_state(machine().device(BEEPER_TAG),0);
635   m_beep->set_frequency(1200); //guesswork
636   m_beep->set_state(0);
637637   m_extram = auto_alloc_array(machine(),UINT8,0x10000);
638638}
639639
trunk/src/mess/drivers/supercon.c
r21620r21621
566566
567567   if ( m_data_1F00 & 0x80 )
568568   {
569      beep_set_state(m_beep, 1);
569      m_beep->set_state(1);
570570      m_emu_started=TRUE;
571571   }
572572   else
573      beep_set_state(m_beep ,0);
573      m_beep->set_state(0);
574574}
575575
576576TIMER_CALLBACK_MEMBER(supercon_state::mouse_click)
trunk/src/mess/drivers/ex800.c
r21620r21621
206206void ex800_state::machine_start()
207207{
208208   m_irq_state = ASSERT_LINE;
209   device_t *speaker = machine().device(BEEPER_TAG);
209   beep_device *speaker = machine().device<beep_device>(BEEPER_TAG);
210210   /* Setup beep */
211   beep_set_state(speaker, 0);
212   beep_set_frequency(speaker, 4000); /* measured at 4000 Hz */
211   speaker->set_state(0);
212   speaker->set_frequency(4000); /* measured at 4000 Hz */
213213}
214214
215215
r21620r21621
265265
266266WRITE8_MEMBER(ex800_state::ex800_portc_w)
267267{
268   device_t *speaker = machine().device(BEEPER_TAG);
268   beep_device *speaker = machine().device<beep_device>(BEEPER_TAG);
269269   if (data & 0x80)
270      beep_set_state(speaker, 0);
270      speaker->set_state(0);
271271   else
272      beep_set_state(speaker, 1);
272      speaker->set_state(1);
273273
274274   logerror("PC W %x @%x\n", data, space.device().safe_pc());
275275}
trunk/src/mess/drivers/alphatro.c
r21620r21621
7676
7777TIMER_CALLBACK_MEMBER(alphatro_state::alphatro_beepoff)
7878{
79   beep_set_state(m_beep, 0);
79   m_beep->set_state(0);
8080}
8181
8282READ8_MEMBER( alphatro_state::port10_r )
r21620r21621
102102   if (length)
103103   {
104104      machine().scheduler().timer_set(attotime::from_msec(length), timer_expired_delegate(FUNC(alphatro_state::alphatro_beepoff),this));
105      beep_set_state(m_beep, 1);
105      m_beep->set_state(1);
106106   }
107107
108108   m_cass->change_state( BIT(data, 3) ? CASSETTE_MOTOR_ENABLED : CASSETTE_MOTOR_DISABLED, CASSETTE_MASK_MOTOR);
r21620r21621
360360   m_sys_timer->adjust(attotime::from_usec(10),0,attotime::from_usec(10));
361361   m_serial_timer->adjust(attotime::from_hz(500),0,attotime::from_hz(500));  // USART clock - this is a guesstimate
362362   m_timer_bit = 0;
363   beep_set_state(m_beep, 0);
364   beep_set_frequency(m_beep, 950);    /* piezo-device needs to be measured */
363   m_beep->set_state(0);
364   m_beep->set_frequency(950);    /* piezo-device needs to be measured */
365365}
366366
367367void alphatro_state::palette_init()
trunk/src/mess/drivers/z9001.c
r21620r21621
129129//Bits0,1 not connected; 2,3,4,5 go to a connector; 6 goes to 'graphics' LED; 7 goes to speaker.
130130WRITE8_MEMBER( z9001_state::port88_w )
131131{
132   beep_set_state(m_beeper, BIT(data, 7));
132   m_beeper->set_state(BIT(data, 7));
133133}
134134
135135WRITE_LINE_MEMBER( z9001_state::cass_w )
r21620r21621
150150
151151void z9001_state::machine_reset()
152152{
153   beep_set_frequency(m_beeper, 800);
153   m_beeper->set_frequency(800);
154154   m_maincpu->set_state_int(Z80_PC, 0xf000);
155155}
156156
trunk/src/mess/drivers/pc4.c
r21620r21621
5252
5353WRITE8_MEMBER( pc4_state::beep_w )
5454{
55   beep_set_state(m_beep, data&0x40);
55   m_beep->set_state(data&0x40);
5656}
5757
5858static ADDRESS_MAP_START(pc4_mem, AS_PROGRAM, 8, pc4_state)
trunk/src/mess/drivers/jr100.c
r21620r21621
6868protected:
6969   required_device<via6522_device> m_via;
7070   required_device<cassette_image_device> m_cassette;
71   required_device<device_t> m_beeper;
71   required_device<beep_device> m_beeper;
7272   required_device<device_t> m_speaker;
7373   required_memory_region m_region_maincpu;
7474   required_ioport m_line0;
r21620r21621
9494      m_beep_en = ((data & 0xe0) == 0xe0);
9595
9696      if(!m_beep_en)
97         beep_set_state(m_beeper,0);
97         m_beeper->set_state(0);
9898   }
9999
100100   /* T1L-L */
r21620r21621
113113      /* writing here actually enables the beeper, if above masking condition is satisfied */
114114      if(m_beep_en)
115115      {
116         beep_set_state(m_beeper,1);
117         beep_set_frequency(m_beeper,894886.25 / (double)(m_t1latch) / 2.0);
116         m_beeper->set_state(1);
117         m_beeper->set_frequency(894886.25 / (double)(m_t1latch) / 2.0);
118118      }
119119   }
120120   m_via->write(space,offset,data);
r21620r21621
198198
199199void jr100_state::machine_start()
200200{
201   beep_set_frequency(m_beeper,0);
202   beep_set_state(m_beeper,0);
201   m_beeper->set_frequency(0);
202   m_beeper->set_state(0);
203203}
204204
205205void jr100_state::machine_reset()
trunk/src/mess/drivers/rex6000.c
r21620r21621
233233      case 1:     //tone mode control
234234         if (m_beep_mode)
235235         {
236            beep_set_state(m_beep, BIT(data, 0));
236            m_beep->set_state(BIT(data, 0));
237237
238238            //the beeper frequency is update only if the bit 1 is set
239239            if (BIT(data, 1))
240               beep_set_frequency(m_beep, 16384 / (((m_beep_io[2] | (m_beep_io[3]<<8)) & 0x0fff) + 2));
240               m_beep->set_frequency(16384 / (((m_beep_io[2] | (m_beep_io[3]<<8)) & 0x0fff) + 2));
241241         }
242242         break;
243243      case 4:     //select alarm/tone mode
244244         if (m_beep_mode != BIT(data, 0))
245            beep_set_state(m_beep, 0);      //turned off when mode changes
245            m_beep->set_state(0);      //turned off when mode changes
246246
247247         m_beep_mode = BIT(data, 0);
248248         break;
trunk/src/mess/drivers/a5105.c
r21620r21621
222222      break;
223223
224224   case 6:
225      beep_set_state(m_beep, BIT(data, 0));
225      m_beep->set_state(BIT(data, 0));
226226      break;
227227   }
228228}
r21620r21621
482482{
483483   address_space &space = m_maincpu->space(AS_PROGRAM);
484484   a5105_ab_w(space, 0, 9); // turn motor off
485   beep_set_frequency(m_beep, 500);
485   m_beep->set_frequency(500);
486486
487487   m_ram_base = (UINT8*)machine().device<ram_device>(RAM_TAG)->pointer();
488488   m_rom_base = (UINT8*)machine().root_device().memregion("maincpu")->base();
trunk/src/mess/drivers/pcw16.c
r21620r21621
842842      /* bleeper on */
843843      case 0x0b:
844844      {
845         beep_set_state(m_speaker,1);
845         m_speaker->set_state(1);
846846      }
847847      break;
848848
849849      /* bleeper off */
850850      case 0x0c:
851851      {
852         beep_set_state(m_speaker,0);
852         m_speaker->set_state(0);
853853      }
854854      break;
855855
r21620r21621
10051005
10061006void pcw16_state::machine_start()
10071007{
1008   device_t *speaker = machine().device(BEEPER_TAG);
1008   beep_device *speaker = machine().device<beep_device>(BEEPER_TAG);
10091009   m_system_status = 0;
10101010   m_interrupt_counter = 0;
10111011
r21620r21621
10151015   at_keyboard_init(machine(), AT_KEYBOARD_TYPE_AT);
10161016   at_keyboard_set_scan_code_set(3);
10171017
1018   beep_set_state(speaker,0);
1019   beep_set_frequency(speaker,3750);
1018   speaker->set_state(0);
1019   speaker->set_frequency(3750);
10201020}
10211021
10221022static INPUT_PORTS_START(pcw16)
trunk/src/mess/drivers/bigbord2.c
r21620r21621
285285         break;
286286      case 7:
287287         // beeper
288         beep_set_state(m_beeper, m_c8[7]);
288         m_beeper->set_state(m_c8[7]);
289289         break;
290290   }
291291}
r21620r21621
556556   UINT8 i;
557557   for (i = 0; i < 8; i++)
558558      m_c8[i] = 0;
559   beep_set_state(m_beeper, 0);
560   beep_set_frequency(m_beeper, 950); // actual frequency is unknown
559   m_beeper->set_state(0);
560   m_beeper->set_frequency(950); // actual frequency is unknown
561561   membank("bankr")->set_entry(0);
562562   membank("bankv")->set_entry(0);
563563   membank("banka")->set_entry(0);
trunk/src/mess/drivers/jr200.c
r21620r21621
7373
7474protected:
7575   required_device<cpu_device> m_maincpu;
76   required_device<device_t> m_beeper;
76   required_device<beep_device> m_beeper;
7777   required_memory_region m_pcg;
7878   required_memory_region m_gfx_rom;
7979   required_memory_region m_gfx_ram;
r21620r21621
297297WRITE8_MEMBER(jr200_state::jr200_beep_w)
298298{
299299   /* writing 0x0e enables the beeper, writing anything else disables it */
300   beep_set_state(m_beeper,((data & 0xf) == 0x0e) ? 1 : 0);
300   m_beeper->set_state(((data & 0xf) == 0x0e) ? 1 : 0);
301301}
302302
303303WRITE8_MEMBER(jr200_state::jr200_beep_freq_w)
r21620r21621
308308
309309   beep_freq = ((m_freq_reg[0]<<8) | (m_freq_reg[1] & 0xff)) + 1;
310310
311   beep_set_frequency(m_beeper,84000 / beep_freq);
311   m_beeper->set_frequency(84000 / beep_freq);
312312}
313313
314314WRITE8_MEMBER(jr200_state::jr200_border_col_w)
r21620r21621
516516
517517void jr200_state::machine_start()
518518{
519   beep_set_frequency(m_beeper,0);
520   beep_set_state(m_beeper,0);
519   m_beeper->set_frequency(0);
520   m_beeper->set_state(0);
521521   m_timer_d = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(jr200_state::timer_d_callback),this));
522522}
523523
trunk/src/mess/machine/kay_kbd.c
r21620r21621
6666
6767struct kay_kbd_t
6868{
69   device_t *beeper;
69   beep_device *beeper;
7070   UINT8 buff[16];
7171   UINT8 head;
7272   UINT8 tail;
r21620r21621
287287   /* disable CapsLock LED initially */
288288   set_led_status(machine(), 1, 1);
289289   set_led_status(machine(), 1, 0);
290   kbd->beeper = machine().device(BEEPER_TAG);
290   kbd->beeper = machine().device<beep_device>(BEEPER_TAG);
291291   kbd->beep_on = 1;
292292   kbd->control_status = 0x14;
293   beep_set_state(kbd->beeper, 0);
294   beep_set_frequency(kbd->beeper, 950);   /* piezo-device needs to be measured */
293   kbd->beeper->set_state(0);
294   kbd->beeper->set_frequency(950);   /* piezo-device needs to be measured */
295295   kbd->head = kbd->tail = 0;          /* init buffer */
296296}
297297
r21620r21621
471471{
472472   kaypro_state *state = machine.driver_data<kaypro_state>();
473473   kay_kbd_t *kbd = state->m_kbd;
474   beep_set_state(kbd->beeper, 0);
474   kbd->beeper->set_state(0);
475475   kbd->control_status |= 4;
476476}
477477
r21620r21621
509509      {
510510         kbd->control_status &= 0xfb;
511511         machine.scheduler().timer_set(attotime::from_msec(length), FUNC(kay_kbd_beepoff));
512         beep_set_state(kbd->beeper, 1);
512         kbd->beeper->set_state(1);
513513      }
514514   }
515515}
trunk/src/mess/machine/osborne1.c
r21620r21621
389389
390390   if ( (ra==2) || (ra== 6) )
391391   {
392      beep_set_state( m_beep, m_beep_state );
392      m_beep->set_state( m_beep_state );
393393   }
394394   else
395395   {
396      beep_set_state( m_beep, 0 );
396      m_beep->set_state( 0 );
397397   }
398398
399399   m_video_timer->adjust(machine().primary_screen->time_until_pos(y + 1, 0 ));
r21620r21621
401401
402402TIMER_CALLBACK_MEMBER(osborne1_state::setup_osborne1)
403403{
404   beep_set_state( m_beep, 0 );
405   beep_set_frequency( m_beep, 300 /* 60 * 240 / 2 */ );
404   m_beep->set_state( 0 );
405   m_beep->set_frequency( 300 /* 60 * 240 / 2 */ );
406406   m_pia1->ca1_w(0);
407407}
408408
trunk/src/mess/machine/apollo_kbd.c
r21620r21621
185185{
186186   m_device = device;
187187   LOG2(("start apollo_kbd::beeper"));
188   m_beeper = m_device->machine().device("beep");
188   m_beeper = m_device->machine().device<beep_device>("beep");
189189   m_timer = m_device->machine().scheduler().timer_alloc(FUNC(static_beeper_callback), this);
190190}
191191
r21620r21621
197197
198198void apollo_kbd_device::beeper::off()
199199{
200   beep_set_state(m_beeper, 0);
200   m_beeper->set_state(0);
201201}
202202
203203void apollo_kbd_device::beeper::on()
204204{
205205   if (keyboard_has_beeper())
206206   {
207      beep_set_frequency(m_beeper, 1000);
208      beep_set_state(m_beeper, 1);
207      m_beeper->set_frequency(1000);
208      m_beeper->set_state(1);
209209      m_timer->adjust( attotime::from_msec(10), 0, attotime::zero);
210210   }
211211}
r21620r21621
223223
224224TIMER_CALLBACK( apollo_kbd_device::beeper::static_beeper_callback )
225225{
226   reinterpret_cast<beeper *> (ptr)->beeper_callback();
226   reinterpret_cast<beeper*>(ptr)->beeper_callback();
227227}
228228
229229//**************************************************************************
trunk/src/mess/machine/apollo_kbd.h
r21620r21621
1515#define __APOLLO_KBD_H__
1616
1717#include "emu.h"
18#include "sound/beep.h"
1819
1920// BSD-derived systems get very sad when you party with system reserved names.
2021#ifdef getchar
r21620r21621
105106      static TIMER_CALLBACK( static_beeper_callback );
106107
107108      apollo_kbd_device *m_device; // pointer back to our device
108      device_t *m_beeper; // the keyboard beeper device
109      beep_device *m_beeper; // the keyboard beeper device
109110      emu_timer * m_timer; // timer to clock data in
110111   };
111112
trunk/src/mess/machine/electron.c
r21620r21621
177177
178178WRITE8_MEMBER(electron_state::electron_ula_w)
179179{
180   device_t *speaker = machine().device(BEEPER_TAG);
180   beep_device *speaker = machine().device<beep_device>(BEEPER_TAG);
181181   int i = electron_palette_offset[(( offset >> 1 ) & 0x03)];
182182   logerror( "ULA: write offset %02x <- %02x\n", offset & 0x0f, data );
183183   switch( offset & 0x0f )
r21620r21621
237237   case 0x06:  /* Counter divider */
238238      if ( m_ula.communication_mode == 0x01)
239239      {
240         beep_set_frequency( speaker, 1000000 / ( 16 * ( data + 1 ) ) );
240         speaker->set_frequency( 1000000 / ( 16 * ( data + 1 ) ) );
241241      }
242242      break;
243243   case 0x07:  /* Misc. */
r21620r21621
245245      switch( m_ula.communication_mode )
246246      {
247247      case 0x00:  /* cassette input */
248         beep_set_state( speaker, 0 );
248         speaker->set_state( 0 );
249249         electron_tape_start();
250250         break;
251251      case 0x01:  /* sound generation */
252         beep_set_state( speaker, 1 );
252         speaker->set_state( 1 );
253253         electron_tape_stop();
254254         break;
255255      case 0x02:  /* cassette output */
256         beep_set_state( speaker, 0 );
256         speaker->set_state( 0 );
257257         electron_tape_stop();
258258         break;
259259      case 0x03:  /* not used */
260         beep_set_state( speaker, 0 );
260         speaker->set_state( 0 );
261261         electron_tape_stop();
262262         break;
263263      }
r21620r21621
316316
317317TIMER_CALLBACK_MEMBER(electron_state::setup_beep)
318318{
319   device_t *speaker = machine().device(BEEPER_TAG);
320   beep_set_state( speaker, 0 );
321   beep_set_frequency( speaker, 300 );
319   beep_device *speaker = machine().device<beep_device>(BEEPER_TAG);
320   speaker->set_state( 0 );
321   speaker->set_frequency( 300 );
322322}
323323
324324void electron_state::machine_reset()
trunk/src/mess/video/911_vdt.c
r21620r21621
9191   unsigned int cursor_address;        /* current cursor address (controlled by the computer, affects both display and I/O protocol) */
9292   unsigned int cursor_address_mask;   /* 1023 for 960-char model, 2047 for 1920-char model */
9393
94   emu_timer *beep_timer;                  /* beep clock (beeps ends when timer times out) */
94   emu_timer *beep_timer;              /* beep clock (beeps ends when timer times out) */
9595   /*void *blink_clock;*/              /* cursor blink clock */
9696
9797   UINT8 keyboard_data;                /* last code pressed on keyboard */
r21620r21621
230230
231231static TIMER_CALLBACK(setup_beep)
232232{
233   beep_set_frequency(machine.device(BEEPER_TAG), 2000);
233   machine.device<beep_device>(BEEPER_TAG)->set_frequency(2000);
234234}
235235
236236
r21620r21621
311311*/
312312static TIMER_CALLBACK(beep_callback)
313313{
314   beep_set_state(machine.device(BEEPER_TAG), 0);
314   machine.device<beep_device>(BEEPER_TAG)->set_state(0);
315315}
316316
317317/*
r21620r21621
485485
486486      case 0xe:
487487         /* beep enable strobe - not tested */
488         beep_set_state(space.machine().device(BEEPER_TAG), 1);
488         space.machine().device<beep_device>(BEEPER_TAG)->set_state(1);
489489
490490         vdt->beep_timer->adjust(attotime::from_usec(300));
491491         break;
trunk/src/mess/includes/tmc1800.h
r21620r21621
1010#include "imagedev/snapquik.h"
1111#include "machine/ram.h"
1212#include "machine/rescap.h"
13#include "sound/beep.h"
1413#include "sound/cdp1864.h"
1514#include "video/cdp1861.h"
1615
trunk/src/mess/includes/xerox820.h
r21620r21621
114114public:
115115   bigboard_state(const machine_config &mconfig, device_type type, const char *tag)
116116      : xerox820_state(mconfig, type, tag),
117         m_beeper(*this, BEEPER_TAG)
117        m_beeper(*this, BEEPER_TAG)
118118   { }
119119
120120   required_device<beep_device> m_beeper;
trunk/src/mess/includes/osi.h
r21620r21621
9393public:
9494   c1p_state(const machine_config &mconfig, device_type type, const char *tag)
9595      : sb2m600_state(mconfig, type, tag),
96         m_beep(*this, BEEPER_TAG)
96        m_beep(*this, BEEPER_TAG)
9797   { }
9898
9999   required_device<beep_device> m_beep;
trunk/src/mess/includes/psion.h
r21620r21621
2222public:
2323   psion_state(const machine_config &mconfig, device_type type, const char *tag)
2424      : driver_device(mconfig, type, tag),
25         m_maincpu(*this, "maincpu"),
26         m_lcdc(*this, "hd44780"),
27         m_beep(*this, BEEPER_TAG),
28         m_pack1(*this, "pack1"),
29         m_pack2(*this, "pack2"),
30      m_sys_register(*this, "sys_register"),
31      m_ram(*this, "ram"){ }
25        m_maincpu(*this, "maincpu"),
26        m_lcdc(*this, "hd44780"),
27        m_beep(*this, BEEPER_TAG),
28        m_pack1(*this, "pack1"),
29        m_pack2(*this, "pack2"),
30        m_sys_register(*this, "sys_register"),
31        m_ram(*this, "ram"){ }
3232
3333   required_device<cpu_device> m_maincpu;
3434   required_device<hd44780_device> m_lcdc;
trunk/src/mess/includes/studio2.h
r21620r21621
2222public:
2323   studio2_state(const machine_config &mconfig, device_type type, const char *tag)
2424      : driver_device(mconfig, type, tag),
25         m_maincpu(*this, CDP1802_TAG),
26         m_speaker(*this, BEEPER_TAG),
27         m_vdc(*this, CDP1861_TAG),
28         m_clear(*this, "CLEAR"),
29         m_a(*this, "A"),
30         m_b(*this, "B")
25        m_maincpu(*this, CDP1802_TAG),
26        m_speaker(*this, BEEPER_TAG),
27        m_vdc(*this, CDP1861_TAG),
28        m_clear(*this, "CLEAR"),
29        m_a(*this, "A"),
30        m_b(*this, "B")
3131   { }
3232
3333   required_device<cosmac_device> m_maincpu;
trunk/src/mess/includes/fidelz80.h
r21620r21621
1717public:
1818   fidelz80_state(const machine_config &mconfig, device_type type, const char *tag)
1919      : driver_device(mconfig, type, tag),
20         m_maincpu(*this, "maincpu"),
21         m_speech(*this, "speech"),
22         m_beep(*this, BEEPER_TAG),
23         m_i8041(*this, "mcu"),
24         m_i8243(*this, "i8243")
20        m_maincpu(*this, "maincpu"),
21        m_speech(*this, "speech"),
22        m_beep(*this, BEEPER_TAG),
23        m_i8041(*this, "mcu"),
24        m_i8243(*this, "i8243")
2525      { }
2626
2727   required_device<cpu_device> m_maincpu;

Previous 199869 Revisions Next


© 1997-2024 The MAME Team