Previous 199869 Revisions Next

r22782 Sunday 12th May, 2013 at 11:17:58 UTC by smf
modernised the AY8910 [smf]
[src/emu/sound]ay8910.c ay8910.h
[src/mame/audio]carnival.c cinemat.c gottlieb.c irem.c mario.c midway.c redalert.c scramble.c timeplt.c
[src/mame/drivers]1942.c 40love.c 4enraya.c 5clown.c aces1.c adp.c aeroboto.c albazc.c albazg.c alpha68k.c ambush.c ampoker2.c arabian.c aristmk4.c arkanoid.c astrocde.c avt.c aztarac.c bagman.c battlex.c bfcobra.c bfm_sc1.c bfmsys85.c big10.c bigevglf.c bking.c blueprnt.c bmcbowl.c bogeyman.c bombjack.c btime.c buggychl.c bwing.c calomega.c calorie.c carjmbre.c carrera.c caswin.c cb2001.c cchance.c cchasm.c cclimber.c centiped.c chaknpop.c champbas.c changela.c cidelsa.c citycon.c cntsteer.c coinmstr.c cop01.c corona.c crgolf.c dacholer.c dblcrown.c dday.c ddayjlc.c ddenlovr.c deco_ld.c decocass.c dlair.c dmndrby.c dogfgt.c dominob.c drw80pkr.c dunhuang.c dwarfd.c dynadice.c dynax.c enigma2.c epos.c equites.c espial.c ettrivia.c exedexes.c exerion.c fastfred.c fcombat.c flipjack.c flstory.c forte2.c fortecar.c fromance.c funkybee.c funworld.c galaxian.c galaxold.c gameplan.c ginganin.c gluck2.c goldngam.c goldnpkr.c goldstar.c grchamp.c gsword.c gyruss.c halleys.c hanaawas.c higemaru.c hitpoker.c holeland.c hotblock.c hyhoo.c icecold.c imolagp.c jack.c jangou.c jollyjgr.c jongkyo.c junofrst.c kaneko16.c kangaroo.c kas89.c kchamp.c kingdrby.c kingobox.c kingpin.c kncljoe.c koikoi.c ksayakyu.c kurukuru.c kyugo.c ladyfrog.c laserbat.c lasso.c liberate.c looping.c lsasquad.c ltcasino.c lucky74.c lvcards.c m63.c madalien.c magmax.c mainsnk.c marineb.c matmania.c maygay1b.c mazerbla.c megazone.c meijinsn.c merit.c meritm.c mermaid.c miniboy7.c mirax.c mjsister.c mole.c mouser.c mpu12wbk.c mpu4hw.c mrflea.c msisaac.c multfish.c munchmo.c mystston.c nbmj8688.c nbmj8891.c nbmj8991.c nemesis.c nightgal.c nova2001.c nsm.c nycaptor.c nyny.c ojankohs.c olibochu.c omegrace.c othello.c pacman.c pandoras.c pastelg.c pbaction.c pengadvb.c peplus.c peyper.c phoenix.c pitnrun.c poker72.c popeye.c popper.c proconn.c progolf.c pturn.c quizo.c r2dtank.c re900.c rgum.c rmhaihai.c rollrace.c roul.c route16.c royalmah.c sanremo.c sbowling.c scobra.c scramble.c scregg.c segag80v.c seicross.c shangha3.c shangkid.c shougi.c skeetsht.c skyarmy.c skylncr.c slapfght.c slotcarn.c sms.c snk.c solomon.c sonson.c speedatk.c splus.c srmp2.c ssingles.c ssozumo.c ssrj.c statriv2.c sub.c suna16.c suna8.c supdrapo.c superqix.c supertnk.c superwng.c suprridr.c tagteam.c taitosj.c tankbust.c taxidriv.c tehkanwc.c thepit.c thief.c tickee.c timelimt.c tonton.c trvmadns.c trvquest.c tsamurai.c tubep.c tugboat.c twins.c tx1.c usgames.c vastar.c vd.c vega.c videopkr.c vlc.c vroulet.c vulgus.c wallc.c wink.c wiz.c zaccaria.c zodiack.c
[src/mame/includes]laserbat.h mermaid.h vectrex.h
[src/mame/machine]leland.c vectrex.c
[src/mame/video]vectrex.c
[src/mess/drivers]ace.c aquarius.c atarist.c atm.c cgc7900.c cgenie.c einstein.c fm7.c galaxy.c intv.c mc1000.c microtan.c msx.c multi8.c pc6001.c pentagon.c phc25.c sbc6510.c scorpion.c spc1000.c spec128.c specpls3.c svi318.c tiki100.c timex.c x1.c
[src/mess/includes]cgenie.h fm7.h msx.h oric.h orion.h rmnimbus.h
[src/mess/machine]a2arcadebd.c a2mockingboard.c amstrad.c cgenie.c dgnalpha.c microtan.c nes_sunsoft.c oric.c orion.c rmnimbus.c spec_snqk.c

trunk/src/mame/drivers/changela.c
r22781r22782
215215   AM_RANGE(0xca00, 0xca00) AM_WRITE(changela_slope_rom_addr_hi_w)
216216   AM_RANGE(0xcb00, 0xcb00) AM_WRITE(changela_slope_rom_addr_lo_w)
217217
218   AM_RANGE(0xd000, 0xd001) AM_DEVREADWRITE_LEGACY("ay1", ay8910_r, ay8910_address_data_w)
219   AM_RANGE(0xd010, 0xd011) AM_DEVREADWRITE_LEGACY("ay2", ay8910_r, ay8910_address_data_w)
218   AM_RANGE(0xd000, 0xd001) AM_DEVREADWRITE("ay1", ay8910_device, data_r, address_data_w)
219   AM_RANGE(0xd010, 0xd011) AM_DEVREADWRITE("ay2", ay8910_device, data_r, address_data_w)
220220
221221   /* LS259 - U44 */
222222   AM_RANGE(0xd020, 0xd020) AM_WRITE(changela_collision_reset_0)
trunk/src/mame/drivers/srmp2.c
r22781r22782
396396   AM_RANGE(0xc00000, 0xc00001) AM_WRITE8(srmp2_irq2_ack_w,0x00ff)         /* irq ack lv 2 */
397397   AM_RANGE(0xd00000, 0xd00001) AM_WRITE8(srmp2_irq4_ack_w,0x00ff)         /* irq ack lv 4 */
398398   AM_RANGE(0xe00000, 0xe00001) AM_WRITENOP                        /* watchdog */
399   AM_RANGE(0xf00000, 0xf00001) AM_DEVREAD8_LEGACY("aysnd", ay8910_r, 0x00ff)
400   AM_RANGE(0xf00000, 0xf00003) AM_DEVWRITE8_LEGACY("aysnd", ay8910_address_data_w, 0x00ff)
399   AM_RANGE(0xf00000, 0xf00001) AM_DEVREAD8("aysnd", ay8910_device, data_r, 0x00ff)
400   AM_RANGE(0xf00000, 0xf00003) AM_DEVWRITE8("aysnd", ay8910_device, address_data_w, 0x00ff)
401401ADDRESS_MAP_END
402402
403403READ8_MEMBER(srmp2_state::mjyuugi_irq2_ack_r)
r22781r22782
428428   AM_RANGE(0x900002, 0x900003) AM_READWRITE8(iox_status_r,iox_data_w,0x00ff)
429429   AM_RANGE(0xa00000, 0xa00001) AM_WRITE(srmp2_adpcm_code_w)           /* ADPCM number */
430430   AM_RANGE(0xb00002, 0xb00003) AM_READ8(vox_status_r,0x00ff)      /* ADPCM voice status */
431   AM_RANGE(0xb00000, 0xb00001) AM_DEVREAD8_LEGACY("aysnd", ay8910_r, 0x00ff)
432   AM_RANGE(0xb00000, 0xb00003) AM_DEVWRITE8_LEGACY("aysnd", ay8910_address_data_w, 0x00ff)
431   AM_RANGE(0xb00000, 0xb00001) AM_DEVREAD8("aysnd", ay8910_device, data_r, 0x00ff)
432   AM_RANGE(0xb00000, 0xb00003) AM_DEVWRITE8("aysnd", ay8910_device, address_data_w, 0x00ff)
433433   AM_RANGE(0xc00000, 0xc00001) AM_WRITENOP                    /* ??? */
434434   AM_RANGE(0xd00000, 0xd005ff) AM_RAM AM_DEVREADWRITE_LEGACY("spritegen", spriteylow_r16, spriteylow_w16) /* Sprites Y */
435435   AM_RANGE(0xd00600, 0xd00607) AM_RAM AM_DEVREADWRITE_LEGACY("spritegen", spritectrl_r16, spritectrl_w16)
r22781r22782
479479   AM_RANGE(0xa1, 0xa1) AM_READ(vox_status_r)                                  /* ADPCM voice status */
480480   AM_RANGE(0xc0, 0xc0) AM_READWRITE(iox_mux_r, iox_command_w)                 /* key matrix | I/O */
481481   AM_RANGE(0xc1, 0xc1) AM_READWRITE(iox_status_r,iox_data_w)
482   AM_RANGE(0xe0, 0xe1) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
483   AM_RANGE(0xe2, 0xe2) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
482   AM_RANGE(0xe0, 0xe1) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
483   AM_RANGE(0xe2, 0xe2) AM_DEVREAD("aysnd", ay8910_device, data_r)
484484ADDRESS_MAP_END
485485
486486static ADDRESS_MAP_START( rmgoldyh_map, AS_PROGRAM, 8, srmp2_state )
trunk/src/mame/drivers/fcombat.c
r22781r22782
131131   AM_RANGE(0x0000, 0x3fff) AM_ROM
132132   AM_RANGE(0x4000, 0x47ff) AM_RAM
133133   AM_RANGE(0x6000, 0x6000) AM_READ(soundlatch_byte_r)
134   AM_RANGE(0x8001, 0x8001) AM_DEVREAD_LEGACY("ay1", ay8910_r)
135   AM_RANGE(0x8002, 0x8003) AM_DEVWRITE_LEGACY("ay1", ay8910_data_address_w)
136   AM_RANGE(0xa001, 0xa001) AM_DEVREAD_LEGACY("ay2", ay8910_r)
137   AM_RANGE(0xa002, 0xa003) AM_DEVWRITE_LEGACY("ay2", ay8910_data_address_w)
138   AM_RANGE(0xc001, 0xc001) AM_DEVREAD_LEGACY("ay3", ay8910_r)
139   AM_RANGE(0xc002, 0xc003) AM_DEVWRITE_LEGACY("ay3", ay8910_data_address_w)
134   AM_RANGE(0x8001, 0x8001) AM_DEVREAD("ay1", ay8910_device, data_r)
135   AM_RANGE(0x8002, 0x8003) AM_DEVWRITE("ay1", ay8910_device, data_address_w)
136   AM_RANGE(0xa001, 0xa001) AM_DEVREAD("ay2", ay8910_device, data_r)
137   AM_RANGE(0xa002, 0xa003) AM_DEVWRITE("ay2", ay8910_device, data_address_w)
138   AM_RANGE(0xc001, 0xc001) AM_DEVREAD("ay3", ay8910_device, data_r)
139   AM_RANGE(0xc002, 0xc003) AM_DEVWRITE("ay3", ay8910_device, data_address_w)
140140ADDRESS_MAP_END
141141
142142
trunk/src/mame/drivers/meijinsn.c
r22781r22782
195195
196196static ADDRESS_MAP_START( meijinsn_sound_io_map, AS_IO, 8, meijinsn_state )
197197   ADDRESS_MAP_GLOBAL_MASK(0xff)
198   AM_RANGE(0x00, 0x01) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
199   AM_RANGE(0x01, 0x01) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
198   AM_RANGE(0x00, 0x01) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
199   AM_RANGE(0x01, 0x01) AM_DEVREAD("aysnd", ay8910_device, data_r)
200200   AM_RANGE(0x02, 0x02) AM_WRITE(soundlatch_clear_byte_w)
201201   AM_RANGE(0x06, 0x06) AM_WRITENOP
202202ADDRESS_MAP_END
trunk/src/mame/drivers/ltcasino.c
r22781r22782
8888   AM_RANGE(0xec10, 0xec10) AM_READ_PORT("IN4")
8989   AM_RANGE(0xec12, 0xec12) AM_READ_PORT("IN5")
9090
91   AM_RANGE(0xec20, 0xec20) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
91   AM_RANGE(0xec20, 0xec20) AM_DEVREAD("aysnd", ay8910_device, data_r)
9292   AM_RANGE(0xec21, 0xec21) AM_READ_PORT("BUTTONS") //ltcasino -> pc: F3F3 (A in service) and F3FD (B in service)
93   AM_RANGE(0xec20, 0xec21) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_address_w)
93   AM_RANGE(0xec20, 0xec21) AM_DEVWRITE("aysnd", ay8910_device, data_address_w)
9494   AM_RANGE(0xec3e, 0xec3e) AM_READNOP //not used
9595   AM_RANGE(0xec30, 0xec3f) AM_RAM
9696   AM_RANGE(0xf000, 0xffff) AM_ROM
trunk/src/mame/drivers/re900.c
r22781r22782
238238   AM_RANGE(0xc000, 0xdfff) AM_RAM AM_SHARE("nvram")
239239   AM_RANGE(0xe000, 0xe000) AM_DEVWRITE("tms9128", tms9928a_device, vram_write)
240240   AM_RANGE(0xe001, 0xe001) AM_DEVWRITE("tms9128", tms9928a_device, register_write)
241   AM_RANGE(0xe800, 0xe801) AM_DEVWRITE_LEGACY("ay_re900", ay8910_address_data_w)
242   AM_RANGE(0xe802, 0xe802) AM_DEVREAD_LEGACY("ay_re900", ay8910_r)
241   AM_RANGE(0xe800, 0xe801) AM_DEVWRITE("ay_re900", ay8910_device, address_data_w)
242   AM_RANGE(0xe802, 0xe802) AM_DEVREAD("ay_re900", ay8910_device, data_r)
243243   AM_RANGE(0xe000, 0xefff) AM_WRITE(re900_watchdog_reset_w)
244244   AM_RANGE(MCS51_PORT_P0, MCS51_PORT_P0) AM_WRITE(cpu_port_0_w)
245245   AM_RANGE(MCS51_PORT_P2, MCS51_PORT_P2) AM_NOP
trunk/src/mame/drivers/peplus.c
r22781r22782
10511051   AM_RANGE(0x3000, 0x3fff) AM_READWRITE(peplus_s3000_r, peplus_s3000_w) AM_SHARE("s3000_ram")
10521052
10531053   // Sound and Dipswitches
1054   AM_RANGE(0x4000, 0x4000) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w)
1055   AM_RANGE(0x4004, 0x4004) AM_READ_PORT("SW1")/* likely ay8910 input port, not direct */ AM_DEVWRITE_LEGACY("aysnd", ay8910_data_w)
1054   AM_RANGE(0x4000, 0x4000) AM_DEVWRITE("aysnd", ay8910_device, address_w)
1055   AM_RANGE(0x4004, 0x4004) AM_READ_PORT("SW1")/* likely ay8910 input port, not direct */ AM_DEVWRITE("aysnd", ay8910_device, data_w)
10561056
10571057   // Superboard Data
10581058   AM_RANGE(0x5000, 0x5fff) AM_READWRITE(peplus_s5000_r, peplus_s5000_w) AM_SHARE("s5000_ram")
trunk/src/mame/drivers/jack.c
r22781r22782
228228
229229static ADDRESS_MAP_START( sound_io_map, AS_IO, 8, jack_state )
230230   ADDRESS_MAP_GLOBAL_MASK(0xff)
231   AM_RANGE(0x40, 0x40) AM_DEVREADWRITE_LEGACY("aysnd", ay8910_r, ay8910_data_w)
232   AM_RANGE(0x80, 0x80) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w)
231   AM_RANGE(0x40, 0x40) AM_DEVREADWRITE("aysnd", ay8910_device, data_r, data_w)
232   AM_RANGE(0x80, 0x80) AM_DEVWRITE("aysnd", ay8910_device, address_w)
233233ADDRESS_MAP_END
234234
235235
trunk/src/mame/drivers/maygay1b.c
r22781r22782
813813
814814   AM_RANGE(0x2070, 0x207f) AM_DEVREADWRITE_LEGACY("duart68681", duart68681_r, duart68681_w )
815815
816   AM_RANGE(0x2090, 0x2091) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
816   AM_RANGE(0x2090, 0x2091) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
817817   AM_RANGE(0x20B0, 0x20B0) AM_READ(m1_meter_r)
818818
819819   AM_RANGE(0x20A0, 0x20A3) AM_DEVWRITE("pia", pia6821_device, write)
trunk/src/mame/drivers/multfish.c
r22781r22782
10211021   AM_RANGE(0x35, 0x35) AM_WRITE(multfish_lamps3_w)
10221022//  AM_RANGE(0x36, 0x36) AM_WRITE(multfish_port36_w)
10231023   AM_RANGE(0x37, 0x37) AM_WRITE(watchdog_reset_w)
1024   AM_RANGE(0x38, 0x38) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w)
1025   AM_RANGE(0x39, 0x39) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_w)
1026   AM_RANGE(0x3a, 0x3a) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
1024   AM_RANGE(0x38, 0x38) AM_DEVWRITE("aysnd", ay8910_device, address_w)
1025   AM_RANGE(0x39, 0x39) AM_DEVWRITE("aysnd", ay8910_device, data_w)
1026   AM_RANGE(0x3a, 0x3a) AM_DEVREAD("aysnd", ay8910_device, data_r)
10271027
10281028   AM_RANGE(0x60, 0x60) AM_WRITE(multfish_dispenable_w) // display enable mirror for lottery sets
10291029
trunk/src/mame/drivers/gyruss.c
r22781r22782
202202
203203static ADDRESS_MAP_START( audio_cpu1_io_map, AS_IO, 8, gyruss_state )
204204   ADDRESS_MAP_GLOBAL_MASK(0xff)
205   AM_RANGE(0x00, 0x00) AM_DEVWRITE_LEGACY("ay1", ay8910_address_w)
206   AM_RANGE(0x01, 0x01) AM_DEVREAD_LEGACY("ay1", ay8910_r)
207   AM_RANGE(0x02, 0x02) AM_DEVWRITE_LEGACY("ay1", ay8910_data_w)
208   AM_RANGE(0x04, 0x04) AM_DEVWRITE_LEGACY("ay2", ay8910_address_w)
209   AM_RANGE(0x05, 0x05) AM_DEVREAD_LEGACY("ay2", ay8910_r)
210   AM_RANGE(0x06, 0x06) AM_DEVWRITE_LEGACY("ay2", ay8910_data_w)
211   AM_RANGE(0x08, 0x08) AM_DEVWRITE_LEGACY("ay3", ay8910_address_w)
212   AM_RANGE(0x09, 0x09) AM_DEVREAD_LEGACY("ay3", ay8910_r)
213   AM_RANGE(0x0a, 0x0a) AM_DEVWRITE_LEGACY("ay3", ay8910_data_w)
214   AM_RANGE(0x0c, 0x0c) AM_DEVWRITE_LEGACY("ay4", ay8910_address_w)
215   AM_RANGE(0x0d, 0x0d) AM_DEVREAD_LEGACY("ay4", ay8910_r)
216   AM_RANGE(0x0e, 0x0e) AM_DEVWRITE_LEGACY("ay4", ay8910_data_w)
217   AM_RANGE(0x10, 0x10) AM_DEVWRITE_LEGACY("ay5", ay8910_address_w)
218   AM_RANGE(0x11, 0x11) AM_DEVREAD_LEGACY("ay5", ay8910_r)
219   AM_RANGE(0x12, 0x12) AM_DEVWRITE_LEGACY("ay5", ay8910_data_w)
205   AM_RANGE(0x00, 0x00) AM_DEVWRITE("ay1", ay8910_device, address_w)
206   AM_RANGE(0x01, 0x01) AM_DEVREAD("ay1", ay8910_device, data_r)
207   AM_RANGE(0x02, 0x02) AM_DEVWRITE("ay1", ay8910_device, data_w)
208   AM_RANGE(0x04, 0x04) AM_DEVWRITE("ay2", ay8910_device, address_w)
209   AM_RANGE(0x05, 0x05) AM_DEVREAD("ay2", ay8910_device, data_r)
210   AM_RANGE(0x06, 0x06) AM_DEVWRITE("ay2", ay8910_device, data_w)
211   AM_RANGE(0x08, 0x08) AM_DEVWRITE("ay3", ay8910_device, address_w)
212   AM_RANGE(0x09, 0x09) AM_DEVREAD("ay3", ay8910_device, data_r)
213   AM_RANGE(0x0a, 0x0a) AM_DEVWRITE("ay3", ay8910_device, data_w)
214   AM_RANGE(0x0c, 0x0c) AM_DEVWRITE("ay4", ay8910_device, address_w)
215   AM_RANGE(0x0d, 0x0d) AM_DEVREAD("ay4", ay8910_device, data_r)
216   AM_RANGE(0x0e, 0x0e) AM_DEVWRITE("ay4", ay8910_device, data_w)
217   AM_RANGE(0x10, 0x10) AM_DEVWRITE("ay5", ay8910_device, address_w)
218   AM_RANGE(0x11, 0x11) AM_DEVREAD("ay5", ay8910_device, data_r)
219   AM_RANGE(0x12, 0x12) AM_DEVWRITE("ay5", ay8910_device, data_w)
220220   AM_RANGE(0x14, 0x14) AM_WRITE(gyruss_i8039_irq_w)
221221   AM_RANGE(0x18, 0x18) AM_WRITE(soundlatch2_byte_w)
222222ADDRESS_MAP_END
trunk/src/mame/drivers/exerion.c
r22781r22782
198198   AM_RANGE(0xb000, 0xb000) AM_READ_PORT("DSW1")
199199   AM_RANGE(0xc000, 0xc000) AM_WRITE(exerion_videoreg_w)
200200   AM_RANGE(0xc800, 0xc800) AM_WRITE(soundlatch_byte_w)
201   AM_RANGE(0xd000, 0xd001) AM_DEVWRITE_LEGACY("ay1", ay8910_address_data_w)
202   AM_RANGE(0xd800, 0xd801) AM_DEVWRITE_LEGACY("ay2", ay8910_address_data_w)
203   AM_RANGE(0xd802, 0xd802) AM_DEVREAD_LEGACY("ay2", ay8910_r)
201   AM_RANGE(0xd000, 0xd001) AM_DEVWRITE("ay1", ay8910_device, address_data_w)
202   AM_RANGE(0xd800, 0xd801) AM_DEVWRITE("ay2", ay8910_device, address_data_w)
203   AM_RANGE(0xd802, 0xd802) AM_DEVREAD("ay2", ay8910_device, data_r)
204204ADDRESS_MAP_END
205205
206206
trunk/src/mame/drivers/mirax.c
r22781r22782
247247
248248WRITE8_MEMBER(mirax_state::ay1_sel)
249249{
250   device_t *device = machine().device("ay1");
251   ay8910_address_w(device,space,0,m_nAyCtrl);
252   ay8910_data_w(device,space,0,data);
250   ay8910_device *ay8910 = machine().device<ay8910_device>("ay1");
251   ay8910->address_w(space,0,m_nAyCtrl);
252   ay8910->data_w(space,0,data);
253253}
254254
255255WRITE8_MEMBER(mirax_state::ay2_sel)
256256{
257   device_t *device = machine().device("ay2");
258   ay8910_address_w(device,space,0,m_nAyCtrl);
259   ay8910_data_w(device,space,0,data);
257   ay8910_device *ay8910 = machine().device<ay8910_device>("ay2");
258   ay8910->address_w(space,0,m_nAyCtrl);
259   ay8910->data_w(space,0,data);
260260}
261261
262262WRITE8_MEMBER(mirax_state::nmi_mask_w)
trunk/src/mame/drivers/dlair.c
r22781r22782
408408static ADDRESS_MAP_START( dlus_map, AS_PROGRAM, 8, dlair_state )
409409   AM_RANGE(0x0000, 0x9fff) AM_ROM
410410   AM_RANGE(0xa000, 0xa7ff) AM_MIRROR(0x1800) AM_RAM
411   AM_RANGE(0xc000, 0xc000) AM_MIRROR(0x1fc7) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
411   AM_RANGE(0xc000, 0xc000) AM_MIRROR(0x1fc7) AM_DEVREAD("aysnd", ay8910_device, data_r)
412412   AM_RANGE(0xc008, 0xc008) AM_MIRROR(0x1fc7) AM_READ_PORT("CONTROLS")
413413   AM_RANGE(0xc010, 0xc010) AM_MIRROR(0x1fc7) AM_READ_PORT("SERVICE")
414414   AM_RANGE(0xc020, 0xc020) AM_MIRROR(0x1fc7) AM_READ(laserdisc_r)
415   AM_RANGE(0xe000, 0xe000) AM_MIRROR(0x1fc7) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_w)
415   AM_RANGE(0xe000, 0xe000) AM_MIRROR(0x1fc7) AM_DEVWRITE("aysnd", ay8910_device, data_w)
416416   AM_RANGE(0xe008, 0xe008) AM_MIRROR(0x1fc7) AM_WRITE(misc_w)
417   AM_RANGE(0xe010, 0xe010) AM_MIRROR(0x1fc7) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w)
417   AM_RANGE(0xe010, 0xe010) AM_MIRROR(0x1fc7) AM_DEVWRITE("aysnd", ay8910_device, address_w)
418418   AM_RANGE(0xe020, 0xe020) AM_MIRROR(0x1fc7) AM_WRITE(laserdisc_w)
419419   AM_RANGE(0xe030, 0xe037) AM_MIRROR(0x1fc0) AM_WRITE(led_den2_w)
420420   AM_RANGE(0xe038, 0xe03f) AM_MIRROR(0x1fc0) AM_WRITE(led_den1_w)
trunk/src/mame/drivers/pacman.c
r22781r22782
13371337
13381338static ADDRESS_MAP_START( dremshpr_portmap, AS_IO, 8, pacman_state )
13391339   ADDRESS_MAP_GLOBAL_MASK(0xff)
1340   AM_RANGE(0x06, 0x07) AM_DEVWRITE_LEGACY("namco", ay8910_data_address_w)
1340   AM_RANGE(0x06, 0x07) AM_DEVWRITE("namco", ay8910_device, data_address_w)
13411341ADDRESS_MAP_END
13421342
13431343static ADDRESS_MAP_START( piranha_portmap, AS_IO, 8, pacman_state )
r22781r22782
13961396
13971397static ADDRESS_MAP_START( crushs_portmap, AS_IO, 8, pacman_state )
13981398   ADDRESS_MAP_GLOBAL_MASK(0xff)
1399   AM_RANGE(0x00, 0x01) AM_DEVWRITE_LEGACY("namco", ay8910_data_address_w)
1399   AM_RANGE(0x00, 0x01) AM_DEVWRITE("namco", ay8910_device, data_address_w)
14001400   AM_RANGE(0x01, 0x01) AM_READ_PORT("DSW2")
14011401   AM_RANGE(0x02, 0x02) AM_READ_PORT("DSW1")
14021402ADDRESS_MAP_END
trunk/src/mame/drivers/chaknpop.c
r22781r22782
146146   AM_RANGE(0x8800, 0x8800) AM_READWRITE(chaknpop_mcu_port_a_r, chaknpop_mcu_port_a_w)
147147   AM_RANGE(0x8801, 0x8801) AM_READWRITE(chaknpop_mcu_port_b_r, chaknpop_mcu_port_b_w)
148148   AM_RANGE(0x8802, 0x8802) AM_READWRITE(chaknpop_mcu_port_c_r, chaknpop_mcu_port_c_w)
149   AM_RANGE(0x8804, 0x8805) AM_DEVREADWRITE_LEGACY("ay1", ay8910_r, ay8910_address_data_w)
150   AM_RANGE(0x8806, 0x8807) AM_DEVREADWRITE_LEGACY("ay2", ay8910_r, ay8910_address_data_w)
149   AM_RANGE(0x8804, 0x8805) AM_DEVREADWRITE("ay1", ay8910_device, data_r, address_data_w)
150   AM_RANGE(0x8806, 0x8807) AM_DEVREADWRITE("ay2", ay8910_device, data_r, address_data_w)
151151   AM_RANGE(0x8808, 0x8808) AM_READ_PORT("DSWC")
152152   AM_RANGE(0x8809, 0x8809) AM_READ_PORT("P1")
153153   AM_RANGE(0x880a, 0x880a) AM_READ_PORT("SYSTEM")
trunk/src/mame/drivers/m63.c
r22781r22782
133133      m_colorram(*this, "colorram"),
134134      m_soundcpu(*this, "soundcpu"),
135135      m_samples(*this, "samples"),
136      m_maincpu(*this, "maincpu") { }
136      m_maincpu(*this, "maincpu"),
137      m_ay1(*this, "ay1"),
138      m_ay2(*this, "ay2")
139   {
140   }
137141
138142   required_shared_ptr<UINT8> m_spriteram;
139143   required_shared_ptr<UINT8> m_scrollram;
r22781r22782
159163
160164   /* sound devices */
161165   required_device<cpu_device> m_soundcpu;
162   device_t *m_ay1;
163   device_t *m_ay2;
164166   optional_device<samples_device> m_samples;
165167   DECLARE_WRITE8_MEMBER(m63_videoram_w);
166168   DECLARE_WRITE8_MEMBER(m63_colorram_w);
r22781r22782
191193   INTERRUPT_GEN_MEMBER(vblank_irq);
192194   void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect );
193195   required_device<cpu_device> m_maincpu;
196   required_device<ay8910_device> m_ay1;
197   optional_device<ay8910_device> m_ay2;
194198};
195199
196200
r22781r22782
386390WRITE8_MEMBER(m63_state::snddata_w)
387391{
388392   if ((m_p2 & 0xf0) == 0xe0)
389      ay8910_address_w(m_ay1, space, 0, offset);
393      m_ay1->address_w(space, 0, offset);
390394   else if ((m_p2 & 0xf0) == 0xa0)
391      ay8910_data_w(m_ay1, space, 0, offset);
395      m_ay1->data_w(space, 0, offset);
392396   else if (m_ay2 != NULL && (m_p1 & 0xe0) == 0x60)
393      ay8910_address_w(m_ay2, space, 0, offset);
397      m_ay2->address_w(space, 0, offset);
394398   else if (m_ay2 != NULL && (m_p1 & 0xe0) == 0x40)
395         ay8910_data_w(m_ay2, space, 0, offset);
399         m_ay2->data_w(space, 0, offset);
396400   else if ((m_p2 & 0xf0) == 0x70 )
397401      m_sound_status = offset;
398402}
r22781r22782
717721
718722MACHINE_START_MEMBER(m63_state,m63)
719723{
720   m_ay1 = machine().device("ay1");
721   m_ay2 = machine().device("ay2");
722
723724   save_item(NAME(m_pal_bank));
724725   save_item(NAME(m_fg_flag));
725726   save_item(NAME(m_sy_offset));
trunk/src/mame/drivers/splus.c
r22781r22782
602602   AM_RANGE(0x3000, 0x300f) AM_READWRITE(splus_duart_r, splus_duart_w)
603603
604604   // Dip Switches, Sound
605   AM_RANGE(0x4000, 0x4000) AM_READ_PORT("SW1") AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w)
606   AM_RANGE(0x4001, 0x4001) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_w)
605   AM_RANGE(0x4000, 0x4000) AM_READ_PORT("SW1") AM_DEVWRITE("aysnd", ay8910_device, address_w)
606   AM_RANGE(0x4001, 0x4001) AM_DEVWRITE("aysnd", ay8910_device, data_w)
607607
608608   // Reel Optics, EEPROM
609609   AM_RANGE(0x5000, 0x5000) AM_READ(splus_reel_optics_r) AM_WRITE(i2c_nvram_w)
trunk/src/mame/drivers/tubep.c
r22781r22782
246246
247247static ADDRESS_MAP_START( tubep_sound_portmap, AS_IO, 8, tubep_state )
248248   ADDRESS_MAP_GLOBAL_MASK(0xff)
249   AM_RANGE(0x00, 0x01) AM_DEVWRITE_LEGACY("ay1", ay8910_address_data_w)
250   AM_RANGE(0x02, 0x03) AM_DEVWRITE_LEGACY("ay2", ay8910_address_data_w)
251   AM_RANGE(0x04, 0x05) AM_DEVWRITE_LEGACY("ay3", ay8910_address_data_w)
249   AM_RANGE(0x00, 0x01) AM_DEVWRITE("ay1", ay8910_device, address_data_w)
250   AM_RANGE(0x02, 0x03) AM_DEVWRITE("ay2", ay8910_device, address_data_w)
251   AM_RANGE(0x04, 0x05) AM_DEVWRITE("ay3", ay8910_device, address_data_w)
252252   AM_RANGE(0x06, 0x06) AM_READ(tubep_soundlatch_r)
253253   AM_RANGE(0x07, 0x07) AM_WRITE(tubep_sound_unknown)
254254ADDRESS_MAP_END
r22781r22782
601601   AM_RANGE(0x10, 0x10) AM_WRITE(rjammer_voice_startstop_w)
602602   AM_RANGE(0x18, 0x18) AM_WRITE(rjammer_voice_frequency_select_w)
603603   AM_RANGE(0x80, 0x80) AM_WRITE(rjammer_voice_input_w)
604   AM_RANGE(0x90, 0x91) AM_DEVWRITE_LEGACY("ay1", ay8910_address_data_w)
605   AM_RANGE(0x92, 0x93) AM_DEVWRITE_LEGACY("ay2", ay8910_address_data_w)
606   AM_RANGE(0x94, 0x95) AM_DEVWRITE_LEGACY("ay3", ay8910_address_data_w)
604   AM_RANGE(0x90, 0x91) AM_DEVWRITE("ay1", ay8910_device, address_data_w)
605   AM_RANGE(0x92, 0x93) AM_DEVWRITE("ay2", ay8910_device, address_data_w)
606   AM_RANGE(0x94, 0x95) AM_DEVWRITE("ay3", ay8910_device, address_data_w)
607607   AM_RANGE(0x96, 0x96) AM_WRITE(rjammer_voice_intensity_control_w)
608608ADDRESS_MAP_END
609609
trunk/src/mame/drivers/dday.c
r22781r22782
6363   AM_RANGE(0x5800, 0x5bff) AM_RAM_WRITE(dday_bgvideoram_w) AM_SHARE("bgvideoram")
6464   AM_RANGE(0x5c00, 0x5fff) AM_READWRITE(dday_colorram_r, dday_colorram_w) AM_SHARE("colorram")
6565   AM_RANGE(0x6000, 0x63ff) AM_RAM
66   AM_RANGE(0x6400, 0x6401) AM_MIRROR(0x000e) AM_DEVWRITE_LEGACY("ay1", ay8910_address_data_w)
67   AM_RANGE(0x6800, 0x6801) AM_DEVWRITE_LEGACY("ay2", ay8910_address_data_w)
66   AM_RANGE(0x6400, 0x6401) AM_MIRROR(0x000e) AM_DEVWRITE("ay1", ay8910_device, address_data_w)
67   AM_RANGE(0x6800, 0x6801) AM_DEVWRITE("ay2", ay8910_device, address_data_w)
6868   AM_RANGE(0x6c00, 0x6c00) AM_READ_PORT("BUTTONS")
6969   AM_RANGE(0x7000, 0x7000) AM_READ_PORT("DSW0")
7070   AM_RANGE(0x7400, 0x7400) AM_READ_PORT("DSW1")
trunk/src/mame/drivers/vega.c
r22781r22782
175175      case 1: /* 04-07 */
176176      {
177177         /* AY 3-8910 */
178         ay8910_address_w(m_ay8910, space, 0, offset);
178         m_ay8910->address_w(space, 0, offset);
179179      }
180180      break;
181181
r22781r22782
304304      case 1: /* 04-07 */
305305      {
306306         /* AY 3-8910 */
307         ay8910_data_w(m_ay8910, space, 0, offset);
307         m_ay8910->data_w(space, 0, offset);
308308         return 0xff;//mame_rand(space.machine);
309309
310310      }
trunk/src/mame/drivers/videopkr.c
r22781r22782
905905
906906WRITE8_MEMBER(videopkr_state::baby_sound_p3_w)
907907{
908   device_t *device = machine().device("aysnd");
908   ay8910_device *ay8910 = machine().device<ay8910_device>("aysnd");
909909   UINT8 lmp_ports, ay_intf;
910910   m_sbp3 = data;
911911   lmp_ports = m_sbp3 >> 1 & 0x07;
r22781r22782
927927      case 0x00:  break;
928928      case 0x01:  break;
929929      case 0x02:  break;
930      case 0x03:  ay8910_data_w(device, space, 1, m_sbp0); break;
930      case 0x03:  ay8910->data_w(space, 1, m_sbp0); break;
931931      case 0x04:  break;
932      case 0x05:  m_sbp0 = ay8910_r(device, space, m_sbp0); break;
932      case 0x05:  m_sbp0 = ay8910->data_r(space, m_sbp0); break;
933933      case 0x06:  break;
934      case 0x07:  ay8910_address_w(device, space, 0, m_sbp0); break;
934      case 0x07:  ay8910->address_w(space, 0, m_sbp0); break;
935935   }
936936}
937937
trunk/src/mame/drivers/mazerbla.c
r22781r22782
10611061static ADDRESS_MAP_START( greatgun_sound_map, AS_PROGRAM, 8, mazerbla_state )
10621062   AM_RANGE(0x0000, 0x1fff) AM_ROM
10631063   AM_RANGE(0x2000, 0x27ff) AM_RAM
1064   AM_RANGE(0x4000, 0x4000) AM_DEVREAD_LEGACY("ay1", ay8910_r)
1065   AM_RANGE(0x4000, 0x4001) AM_DEVWRITE_LEGACY("ay1", ay8910_address_data_w)
1066   AM_RANGE(0x6000, 0x6001) AM_DEVWRITE_LEGACY("ay2", ay8910_address_data_w)
1064   AM_RANGE(0x4000, 0x4000) AM_DEVREAD("ay1", ay8910_device, data_r)
1065   AM_RANGE(0x4000, 0x4001) AM_DEVWRITE("ay1", ay8910_device, address_data_w)
1066   AM_RANGE(0x6000, 0x6001) AM_DEVWRITE("ay2", ay8910_device, address_data_w)
10671067   AM_RANGE(0x8000, 0x8000) AM_WRITE(sound_int_clear_w)
10681068   AM_RANGE(0xa000, 0xa000) AM_WRITE(sound_nmi_clear_w)
10691069ADDRESS_MAP_END
trunk/src/mame/drivers/goldstar.c
r22781r22782
158158   AM_RANGE(0xf810, 0xf810) AM_READ_PORT("UNK1")
159159   AM_RANGE(0xf811, 0xf811) AM_READ_PORT("UNK2")
160160   AM_RANGE(0xf820, 0xf820) AM_READ_PORT("DSW2")
161   AM_RANGE(0xf830, 0xf830) AM_DEVREADWRITE_LEGACY("aysnd", ay8910_r, ay8910_data_w)
162   AM_RANGE(0xf840, 0xf840) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w)
161   AM_RANGE(0xf830, 0xf830) AM_DEVREADWRITE("aysnd", ay8910_device, data_r, data_w)
162   AM_RANGE(0xf840, 0xf840) AM_DEVWRITE("aysnd", ay8910_device, address_w)
163163   AM_RANGE(0xfa00, 0xfa00) AM_WRITE(goldstar_fa00_w)
164164   AM_RANGE(0xfb00, 0xfb00) AM_DEVREADWRITE("oki", okim6295_device, read, write)
165165   AM_RANGE(0xfd00, 0xfdff) AM_RAM_WRITE(paletteram_BBGGGRRR_byte_w) AM_SHARE("paletteram")
r22781r22782
196196   AM_RANGE(0xf822, 0xf822) AM_WRITE(goldstar_fa00_w) // hack (connected to ppi output port?, needed for colour banking)
197197   AM_RANGE(0xf820, 0xf823) AM_DEVREADWRITE("ppi8255_2", i8255_device, read, write)    /* Input/Output Ports */
198198
199   AM_RANGE(0xf830, 0xf830) AM_DEVREADWRITE_LEGACY("aysnd", ay8910_r, ay8910_data_w)
200   AM_RANGE(0xf840, 0xf840) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w)
199   AM_RANGE(0xf830, 0xf830) AM_DEVREADWRITE("aysnd", ay8910_device, data_r, data_w)
200   AM_RANGE(0xf840, 0xf840) AM_DEVWRITE("aysnd", ay8910_device, address_w)
201201//  AM_RANGE(0xf850, 0xf850) AM_WRITE(ncb3_p1_flip_w)   // need flip?
202202//  AM_RANGE(0xf860, 0xf860) AM_WRITE(ncb3_p2_flip_w)   // need flip?
203203   AM_RANGE(0xf870, 0xf870) AM_DEVWRITE("snsnd", sn76489_device, write)    /* guess... device is initialized, but doesn't seems to be used.*/
r22781r22782
298298
299299static ADDRESS_MAP_START( cm_portmap, AS_IO, 8, goldstar_state )
300300   ADDRESS_MAP_GLOBAL_MASK(0xff)
301   AM_RANGE(0x01, 0x01) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
302   AM_RANGE(0x02, 0x03) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_address_w)
301   AM_RANGE(0x01, 0x01) AM_DEVREAD("aysnd", ay8910_device, data_r)
302   AM_RANGE(0x02, 0x03) AM_DEVWRITE("aysnd", ay8910_device, data_address_w)
303303   AM_RANGE(0x04, 0x07) AM_DEVREADWRITE("ppi8255_0", i8255_device, read, write)    /* Inputs */
304304   AM_RANGE(0x08, 0x0b) AM_DEVREADWRITE("ppi8255_1", i8255_device, read, write)    /* DIP switches */
305305   AM_RANGE(0x10, 0x10) AM_WRITE(cm_outport0_w)    /* output port */
r22781r22782
314314   ADDRESS_MAP_GLOBAL_MASK(0xff)
315315   AM_RANGE(0x00, 0x03) AM_DEVREADWRITE("ppi8255_0", i8255_device, read, write)    /* Input Ports */
316316   AM_RANGE(0x10, 0x13) AM_DEVREADWRITE("ppi8255_1", i8255_device, read, write)    /* DIP switches */
317   AM_RANGE(0x21, 0x21) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
318   AM_RANGE(0x22, 0x23) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_address_w)
317   AM_RANGE(0x21, 0x21) AM_DEVREAD("aysnd", ay8910_device, data_r)
318   AM_RANGE(0x22, 0x23) AM_DEVWRITE("aysnd", ay8910_device, data_address_w)
319319ADDRESS_MAP_END
320320
321321
322322static ADDRESS_MAP_START( amcoe1_portmap, AS_IO, 8, goldstar_state )
323323   ADDRESS_MAP_GLOBAL_MASK(0xff)
324   AM_RANGE(0x01, 0x01) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
325   AM_RANGE(0x02, 0x03) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_address_w)
324   AM_RANGE(0x01, 0x01) AM_DEVREAD("aysnd", ay8910_device, data_r)
325   AM_RANGE(0x02, 0x03) AM_DEVWRITE("aysnd", ay8910_device, data_address_w)
326326   AM_RANGE(0x04, 0x07) AM_DEVREADWRITE("ppi8255_0", i8255_device, read, write)    /* Input Ports */
327327   AM_RANGE(0x08, 0x0b) AM_DEVREADWRITE("ppi8255_1", i8255_device, read, write)    /* DIP switches */
328328   AM_RANGE(0x10, 0x10) AM_WRITE(cm_outport0_w)    /* output port */
r22781r22782
334334
335335static ADDRESS_MAP_START( amcoe2_portmap, AS_IO, 8, goldstar_state )
336336   ADDRESS_MAP_GLOBAL_MASK(0xff)
337   AM_RANGE(0x01, 0x01) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
338   AM_RANGE(0x02, 0x03) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_address_w)
337   AM_RANGE(0x01, 0x01) AM_DEVREAD("aysnd", ay8910_device, data_r)
338   AM_RANGE(0x02, 0x03) AM_DEVWRITE("aysnd", ay8910_device, data_address_w)
339339   AM_RANGE(0x04, 0x07) AM_DEVREADWRITE("ppi8255_0", i8255_device, read, write)    /* Input Ports */
340340   AM_RANGE(0x08, 0x0b) AM_DEVREADWRITE("ppi8255_1", i8255_device, read, write)    /* DIP switches */
341341   AM_RANGE(0x10, 0x10) AM_WRITE(cm_outport0_w)    /* output port */
r22781r22782
373373   AM_RANGE(0xb800, 0xb803) AM_DEVREADWRITE("ppi8255_0", i8255_device, read, write)    /* Input Ports */
374374   AM_RANGE(0xb810, 0xb813) AM_DEVREADWRITE("ppi8255_1", i8255_device, read, write)    /* Input Ports */
375375   AM_RANGE(0xb820, 0xb823) AM_DEVREADWRITE("ppi8255_2", i8255_device, read, write)    /* Input/Output Ports */
376   AM_RANGE(0xb830, 0xb830) AM_DEVREADWRITE_LEGACY("aysnd", ay8910_r, ay8910_data_w)
377   AM_RANGE(0xb840, 0xb840) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w)  /* no sound... only use both ports for DSWs */
376   AM_RANGE(0xb830, 0xb830) AM_DEVREADWRITE("aysnd", ay8910_device, data_r, data_w)
377   AM_RANGE(0xb840, 0xb840) AM_DEVWRITE("aysnd", ay8910_device, address_w)  /* no sound... only use both ports for DSWs */
378378   AM_RANGE(0xb850, 0xb850) AM_WRITE(lucky8_outport_w)
379379   AM_RANGE(0xb870, 0xb870) AM_DEVWRITE("snsnd", sn76489_device, write)    /* sound */
380380   AM_RANGE(0xf800, 0xffff) AM_RAM
r22781r22782
417417   AM_RANGE(0xb800, 0xb803) AM_DEVREADWRITE("ppi8255_0", i8255_device, read, write)    /* Input Ports */
418418   AM_RANGE(0xb810, 0xb813) AM_DEVREADWRITE("ppi8255_1", i8255_device, read, write)    /* Input Ports */
419419   AM_RANGE(0xb820, 0xb823) AM_DEVREADWRITE("ppi8255_2", i8255_device, read, write)    /* Input/Output Ports */
420   AM_RANGE(0xb830, 0xb830) AM_DEVREADWRITE_LEGACY("aysnd", ay8910_r, ay8910_data_w)
421   AM_RANGE(0xb840, 0xb840) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w)  /* no sound... only use both ports for DSWs */
420   AM_RANGE(0xb830, 0xb830) AM_DEVREADWRITE("aysnd", ay8910_device, data_r, data_w)
421   AM_RANGE(0xb840, 0xb840) AM_DEVWRITE("aysnd", ay8910_device, address_w)  /* no sound... only use both ports for DSWs */
422422   AM_RANGE(0xb850, 0xb850) AM_WRITE(magodds_outb850_w) //lamps
423423   AM_RANGE(0xb860, 0xb860) AM_WRITE(magodds_outb860_w) //watchdog
424424   AM_RANGE(0xb870, 0xb870) AM_DEVWRITE("snsnd", sn76489_device, write)    /* sound */
r22781r22782
478478
479479   AM_RANGE(0xb800, 0xb803) AM_DEVREADWRITE("ppi8255_0", i8255_device, read, write)    /* Input Ports */
480480   AM_RANGE(0xb810, 0xb813) AM_DEVREADWRITE("ppi8255_1", i8255_device, read, write)    /* DSW bank */
481   AM_RANGE(0xb830, 0xb830) AM_DEVREADWRITE_LEGACY("aysnd", ay8910_r, ay8910_data_w)
482   AM_RANGE(0xb840, 0xb840) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w)  /* no sound... only use ports */
481   AM_RANGE(0xb830, 0xb830) AM_DEVREADWRITE("aysnd", ay8910_device, data_r, data_w)
482   AM_RANGE(0xb840, 0xb840) AM_DEVWRITE("aysnd", ay8910_device, address_w)  /* no sound... only use ports */
483483   AM_RANGE(0xb850, 0xb850) AM_WRITENOP    /* just turn off the lamps, if exist */
484484   AM_RANGE(0xb870, 0xb870) AM_DEVWRITE("snsnd", sn76489_device, write)    /* sound */
485485   AM_RANGE(0xf800, 0xffff) AM_RAM
r22781r22782
500500   AM_RANGE(0xb800, 0xb803) AM_DEVREADWRITE("ppi8255_0", i8255_device, read, write)    /* Input Ports */
501501   AM_RANGE(0xb810, 0xb813) AM_DEVREADWRITE("ppi8255_1", i8255_device, read, write)    /* Input Ports */
502502   AM_RANGE(0xb820, 0xb823) AM_DEVREADWRITE("ppi8255_2", i8255_device, read, write)    /* Input/Output Ports */
503   AM_RANGE(0xb830, 0xb830) AM_DEVREADWRITE_LEGACY("aysnd", ay8910_r, ay8910_data_w)
504   AM_RANGE(0xb840, 0xb840) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w)  /* no sound... only use both ports for DSWs */
503   AM_RANGE(0xb830, 0xb830) AM_DEVREADWRITE("aysnd", ay8910_device, data_r, data_w)
504   AM_RANGE(0xb840, 0xb840) AM_DEVWRITE("aysnd", ay8910_device, address_w)  /* no sound... only use both ports for DSWs */
505505   AM_RANGE(0xb850, 0xb850) AM_WRITE(lucky8_outport_w)
506506   AM_RANGE(0xb870, 0xb870) AM_DEVWRITE("snsnd", sn76489_device, write)    /* sound */
507507//  AM_RANGE(0xc000, 0xc003) AM_DEVREADWRITE("ppi8255_3", i8255_device, read, write) /* Other PPI initialized? */
r22781r22782
572572
573573static ADDRESS_MAP_START( unkch_portmap, AS_IO, 8, goldstar_state )
574574   ADDRESS_MAP_GLOBAL_MASK(0xff)
575//  AM_RANGE(0x01, 0x01) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
575//  AM_RANGE(0x01, 0x01) AM_DEVREAD("aysnd", ay8910_device, data_r)
576576   AM_RANGE(0x02, 0x02) AM_WRITE(unkcm_0x02_w)
577577   AM_RANGE(0x03, 0x03) AM_WRITE(unkcm_0x03_w)
578578   AM_RANGE(0x11, 0x11) AM_WRITE(unkcm_0x11_w)
r22781r22782
631631   AM_RANGE(0xa0, 0xa0) AM_DEVWRITE("sn1", sn76489_device, write)                      /* SN76489 #1 */
632632   AM_RANGE(0xc0, 0xc0) AM_DEVWRITE("sn2", sn76489_device, write)                      /* SN76489 #2 */
633633   AM_RANGE(0xe0, 0xe0) AM_DEVWRITE("sn3", sn76489_device, write)                      /* SN76489 #3 */
634   AM_RANGE(0x60, 0x60) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w)                  /* AY8910 control? */
635   AM_RANGE(0x80, 0x80) AM_DEVREADWRITE_LEGACY("aysnd", ay8910_r, ay8910_data_w)       /* AY8910 Input? */
636//  AM_RANGE(0x01, 0x01) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
637//  AM_RANGE(0x02, 0x03) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_address_w)
634   AM_RANGE(0x60, 0x60) AM_DEVWRITE("aysnd", ay8910_device, address_w)                  /* AY8910 control? */
635   AM_RANGE(0x80, 0x80) AM_DEVREADWRITE("aysnd", ay8910_device, data_r, data_w)       /* AY8910 Input? */
636//  AM_RANGE(0x01, 0x01) AM_DEVREAD("aysnd", ay8910_device, data_r)
637//  AM_RANGE(0x02, 0x03) AM_DEVWRITE("aysnd", ay8910_device, data_address_w)
638638ADDRESS_MAP_END
639639
640640
trunk/src/mame/drivers/seicross.c
r22781r22782
123123
124124static ADDRESS_MAP_START( main_portmap, AS_IO, 8, seicross_state )
125125   ADDRESS_MAP_GLOBAL_MASK(0xff)
126   AM_RANGE(0x00, 0x01) AM_MIRROR(0x08) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
127   AM_RANGE(0x04, 0x04) AM_MIRROR(0x08) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
126   AM_RANGE(0x00, 0x01) AM_MIRROR(0x08) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
127   AM_RANGE(0x04, 0x04) AM_MIRROR(0x08) AM_DEVREAD("aysnd", ay8910_device, data_r)
128128ADDRESS_MAP_END
129129
130130
trunk/src/mame/drivers/bwing.c
r22781r22782
170170   AM_RANGE(0x0000, 0x01ff) AM_RAM
171171   AM_RANGE(0x0200, 0x0200) AM_DEVWRITE("dac", dac_device, write_signed8)
172172   AM_RANGE(0x1000, 0x1000) AM_WRITE(bwp3_nmiack_w)
173   AM_RANGE(0x2000, 0x2000) AM_DEVWRITE_LEGACY("ay1", ay8910_data_w)
174   AM_RANGE(0x4000, 0x4000) AM_DEVWRITE_LEGACY("ay1", ay8910_address_w)
175   AM_RANGE(0x6000, 0x6000) AM_DEVWRITE_LEGACY("ay2", ay8910_data_w)
176   AM_RANGE(0x8000, 0x8000) AM_DEVWRITE_LEGACY("ay2", ay8910_address_w)
173   AM_RANGE(0x2000, 0x2000) AM_DEVWRITE("ay1", ay8910_device, data_w)
174   AM_RANGE(0x4000, 0x4000) AM_DEVWRITE("ay1", ay8910_device, address_w)
175   AM_RANGE(0x6000, 0x6000) AM_DEVWRITE("ay2", ay8910_device, data_w)
176   AM_RANGE(0x8000, 0x8000) AM_DEVWRITE("ay2", ay8910_device, address_w)
177177   AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r)
178178   AM_RANGE(0xd000, 0xd000) AM_WRITE(bwp3_nmimask_w)
179179   AM_RANGE(0xe000, 0xffff) AM_ROM AM_SHARE("bwp3_rombase")
trunk/src/mame/drivers/sonson.c
r22781r22782
9999
100100static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, sonson_state )
101101   AM_RANGE(0x0000, 0x07ff) AM_RAM
102   AM_RANGE(0x2000, 0x2001) AM_DEVWRITE_LEGACY("ay1", ay8910_address_data_w)
103   AM_RANGE(0x4000, 0x4001) AM_DEVWRITE_LEGACY("ay2", ay8910_address_data_w)
102   AM_RANGE(0x2000, 0x2001) AM_DEVWRITE("ay1", ay8910_device, address_data_w)
103   AM_RANGE(0x4000, 0x4001) AM_DEVWRITE("ay2", ay8910_device, address_data_w)
104104   AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r)
105105   AM_RANGE(0xe000, 0xffff) AM_ROM
106106ADDRESS_MAP_END
trunk/src/mame/drivers/grchamp.c
r22781r22782
551551static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, grchamp_state )
552552   AM_RANGE(0x0000, 0x1fff) AM_ROM
553553   AM_RANGE(0x4000, 0x43ff) AM_RAM
554   AM_RANGE(0x4800, 0x4801) AM_MIRROR(0x07f8) AM_DEVWRITE_LEGACY("ay1", ay8910_address_data_w)
555   AM_RANGE(0x4801, 0x4801) AM_MIRROR(0x07f8) AM_DEVREAD_LEGACY("ay1", ay8910_r)
556   AM_RANGE(0x4802, 0x4803) AM_MIRROR(0x07f8) AM_DEVWRITE_LEGACY("ay2", ay8910_address_data_w)
557   AM_RANGE(0x4803, 0x4803) AM_MIRROR(0x07f8) AM_DEVREAD_LEGACY("ay2", ay8910_r)
558   AM_RANGE(0x4804, 0x4805) AM_MIRROR(0x07fa) AM_DEVWRITE_LEGACY("ay3", ay8910_address_data_w)
559   AM_RANGE(0x4805, 0x4805) AM_MIRROR(0x07fa) AM_DEVREAD_LEGACY("ay3", ay8910_r)
554   AM_RANGE(0x4800, 0x4801) AM_MIRROR(0x07f8) AM_DEVWRITE("ay1", ay8910_device, address_data_w)
555   AM_RANGE(0x4801, 0x4801) AM_MIRROR(0x07f8) AM_DEVREAD("ay1", ay8910_device, data_r)
556   AM_RANGE(0x4802, 0x4803) AM_MIRROR(0x07f8) AM_DEVWRITE("ay2", ay8910_device, address_data_w)
557   AM_RANGE(0x4803, 0x4803) AM_MIRROR(0x07f8) AM_DEVREAD("ay2", ay8910_device, data_r)
558   AM_RANGE(0x4804, 0x4805) AM_MIRROR(0x07fa) AM_DEVWRITE("ay3", ay8910_device, address_data_w)
559   AM_RANGE(0x4805, 0x4805) AM_MIRROR(0x07fa) AM_DEVREAD("ay3", ay8910_device, data_r)
560560   AM_RANGE(0x5000, 0x5000) AM_READ(soundlatch_byte_r)
561561ADDRESS_MAP_END
562562
trunk/src/mame/drivers/shougi.c
r22781r22782
309309
310310   AM_RANGE(0x5000, 0x5000) AM_READ_PORT("P1")
311311   AM_RANGE(0x5800, 0x5800) AM_READ_PORT("P2") AM_WRITE(shougi_watchdog_reset_w)   /* game won't boot if watchdog doesn't work */
312   AM_RANGE(0x6000, 0x6000) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w)
313   AM_RANGE(0x6800, 0x6800) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_w)
312   AM_RANGE(0x6000, 0x6000) AM_DEVWRITE("aysnd", ay8910_device, address_w)
313   AM_RANGE(0x6800, 0x6800) AM_DEVWRITE("aysnd", ay8910_device, data_w)
314314   AM_RANGE(0x7000, 0x73ff) AM_RAM AM_SHARE("share1") /* 2114 x 2 (0x400 x 4bit each) */
315315   AM_RANGE(0x7800, 0x7bff) AM_RAM AM_SHARE("share2") /* 2114 x 2 (0x400 x 4bit each) */
316316
trunk/src/mame/drivers/ambush.c
r22781r22782
8181
8282static ADDRESS_MAP_START( main_portmap, AS_IO, 8, ambush_state )
8383   ADDRESS_MAP_GLOBAL_MASK(0xff)
84   AM_RANGE(0x00, 0x00) AM_DEVREADWRITE_LEGACY("ay1", ay8910_r, ay8910_address_w)
85   AM_RANGE(0x01, 0x01) AM_DEVWRITE_LEGACY("ay1", ay8910_data_w)
86   AM_RANGE(0x80, 0x80) AM_DEVREADWRITE_LEGACY("ay2", ay8910_r, ay8910_address_w)
87   AM_RANGE(0x81, 0x81) AM_DEVWRITE_LEGACY("ay2", ay8910_data_w)
84   AM_RANGE(0x00, 0x00) AM_DEVREADWRITE("ay1", ay8910_device, data_r, address_w)
85   AM_RANGE(0x01, 0x01) AM_DEVWRITE("ay1", ay8910_device, data_w)
86   AM_RANGE(0x80, 0x80) AM_DEVREADWRITE("ay2", ay8910_device, data_r, address_w)
87   AM_RANGE(0x81, 0x81) AM_DEVWRITE("ay2", ay8910_device, data_w)
8888ADDRESS_MAP_END
8989
9090
trunk/src/mame/drivers/enigma2.c
r22781r22782
490490   AM_RANGE(0x0000, 0x0fff) AM_MIRROR(0x1000) AM_ROM AM_WRITENOP
491491   AM_RANGE(0x2000, 0x7fff) AM_NOP
492492   AM_RANGE(0x8000, 0x83ff) AM_MIRROR(0x1c00) AM_RAM
493   AM_RANGE(0xa000, 0xa001) AM_MIRROR(0x1ffc) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
494   AM_RANGE(0xa002, 0xa002) AM_MIRROR(0x1ffc) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
493   AM_RANGE(0xa000, 0xa001) AM_MIRROR(0x1ffc) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
494   AM_RANGE(0xa002, 0xa002) AM_MIRROR(0x1ffc) AM_DEVREAD("aysnd", ay8910_device, data_r)
495495   AM_RANGE(0xa003, 0xa003) AM_MIRROR(0x1ffc) AM_NOP
496496   AM_RANGE(0xc000, 0xffff) AM_NOP
497497ADDRESS_MAP_END
trunk/src/mame/drivers/galaxian.c
r22781r22782
505505{
506506   /* the decoding here is very simplistic, and you can address both simultaneously */
507507   UINT8 result = 0xff;
508   if (offset & 0x20) result &= ay8910_r(machine().device("8910.1"), space, 0);
509   if (offset & 0x80) result &= ay8910_r(machine().device("8910.0"), space, 0);
508   if (offset & 0x20) result &= machine().device<ay8910_device>("8910.1")->data_r(space, 0);
509   if (offset & 0x80) result &= machine().device<ay8910_device>("8910.0")->data_r(space, 0);
510510   return result;
511511}
512512
r22781r22782
516516   /* AV 4,5 ==> AY8910 #2 */
517517   /* the decoding here is very simplistic, and you can address two simultaneously */
518518   if (offset & 0x10)
519      ay8910_address_w(machine().device("8910.1"), space, 0, data);
519      machine().device<ay8910_device>("8910.1")->address_w(space, 0, data);
520520   else if (offset & 0x20)
521      ay8910_data_w(machine().device("8910.1"), space, 0, data);
521      machine().device<ay8910_device>("8910.1")->data_w(space, 0, data);
522522   /* AV6,7 ==> AY8910 #1 */
523523   if (offset & 0x40)
524      ay8910_address_w(machine().device("8910.0"), space, 0, data);
524      machine().device<ay8910_device>("8910.0")->address_w(space, 0, data);
525525   else if (offset & 0x80)
526      ay8910_data_w(machine().device("8910.0"), space, 0, data);
526      machine().device<ay8910_device>("8910.0")->data_w(space, 0, data);
527527}
528528
529529
r22781r22782
893893{
894894   /* the decoding here is very simplistic */
895895   UINT8 result = 0xff;
896   if (offset & 0x40) result &= ay8910_r(machine().device("8910.0"), space, 0);
896   if (offset & 0x40) result &= machine().device<ay8910_device>("8910.0")->data_r(space, 0);
897897   return result;
898898}
899899
r22781r22782
903903   /* the decoding here is very simplistic */
904904   /* AV6,7 ==> AY8910 #1 */
905905   if (offset & 0x40)
906      ay8910_data_w(machine().device("8910.0"), space, 0, data);
906      machine().device<ay8910_device>("8910.0")->data_w(space, 0, data);
907907   else if (offset & 0x80)
908      ay8910_address_w(machine().device("8910.0"), space, 0, data);
908      machine().device<ay8910_device>("8910.0")->address_w(space, 0, data);
909909}
910910
911911
r22781r22782
972972{
973973   /* the decoding here is very simplistic, and you can address both simultaneously */
974974   UINT8 result = 0xff;
975   if (offset & 0x08) result &= ay8910_r(machine().device("8910.2"), space, 0);
976   if (offset & 0x20) result &= ay8910_r(machine().device("8910.1"), space, 0);
977   if (offset & 0x80) result &= ay8910_r(machine().device("8910.0"), space, 0);
975   if (offset & 0x08) result &= machine().device<ay8910_device>("8910.2")->data_r(space, 0);
976   if (offset & 0x20) result &= machine().device<ay8910_device>("8910.1")->data_r(space, 0);
977   if (offset & 0x80) result &= machine().device<ay8910_device>("8910.0")->data_r(space, 0);
978978   return result;
979979}
980980
r22781r22782
982982WRITE8_MEMBER(galaxian_state::scorpion_ay8910_w)
983983{
984984   /* the decoding here is very simplistic, and you can address all six simultaneously */
985   if (offset & 0x04) ay8910_address_w(machine().device("8910.2"), space, 0, data);
986   if (offset & 0x08) ay8910_data_w(machine().device("8910.2"), space, 0, data);
987   if (offset & 0x10) ay8910_address_w(machine().device("8910.1"), space, 0, data);
988   if (offset & 0x20) ay8910_data_w(machine().device("8910.1"), space, 0, data);
989   if (offset & 0x40) ay8910_address_w(machine().device("8910.0"), space, 0, data);
990   if (offset & 0x80) ay8910_data_w(machine().device("8910.0"), space, 0, data);
985   if (offset & 0x04) machine().device<ay8910_device>("8910.2")->address_w(space, 0, data);
986   if (offset & 0x08) machine().device<ay8910_device>("8910.2")->data_w(space, 0, data);
987   if (offset & 0x10) machine().device<ay8910_device>("8910.1")->address_w(space, 0, data);
988   if (offset & 0x20) machine().device<ay8910_device>("8910.1")->data_w(space, 0, data);
989   if (offset & 0x40) machine().device<ay8910_device>("8910.0")->address_w(space, 0, data);
990   if (offset & 0x80) machine().device<ay8910_device>("8910.0")->data_w(space, 0, data);
991991}
992992
993993
r22781r22782
11021102         /* bit 0 = WRITE */
11031103         /* bit 1 = C/D */
11041104         if ((offset & 1) != 0)
1105            ay8910_data_address_w(machine().device("aysnd"), space, offset >> 1, m_zigzag_ay8910_latch);
1105            machine().device<ay8910_device>("aysnd")->data_address_w(space, offset >> 1, m_zigzag_ay8910_latch);
11061106         break;
11071107
11081108      case 0x100:
r22781r22782
11941194WRITE8_MEMBER(galaxian_state::mshuttle_ay8910_control_w)
11951195{
11961196   if (!m_mshuttle_ay8910_cs)
1197      ay8910_address_w(machine().device("aysnd"), space, offset, data);
1197      machine().device<ay8910_device>("aysnd")->address_w(space, offset, data);
11981198}
11991199
12001200
12011201WRITE8_MEMBER(galaxian_state::mshuttle_ay8910_data_w)
12021202{
12031203   if (!m_mshuttle_ay8910_cs)
1204      ay8910_data_w(machine().device("aysnd"), space, offset, data);
1204      machine().device<ay8910_device>("aysnd")->data_w(space, offset, data);
12051205}
12061206
12071207
12081208READ8_MEMBER(galaxian_state::mshuttle_ay8910_data_r)
12091209{
12101210   if (!m_mshuttle_ay8910_cs)
1211      return ay8910_r(machine().device("aysnd"), space, offset);
1211      return machine().device<ay8910_device>("aysnd")->data_r(space, offset);
12121212   return 0xff;
12131213}
12141214
r22781r22782
14551455   ADDRESS_MAP_UNMAP_HIGH
14561456   AM_RANGE(0x0000, 0x7fff) AM_ROM
14571457   AM_RANGE(0x8000, 0x87ff) AM_RAM
1458   AM_RANGE(0x8803, 0x8803) AM_DEVWRITE_LEGACY("8910.0", ay8910_address_w)
1459   AM_RANGE(0x880b, 0x880b) AM_DEVWRITE_LEGACY("8910.0", ay8910_data_w)
1460   AM_RANGE(0x880c, 0x880c) AM_DEVWRITE_LEGACY("8910.1", ay8910_address_w)
1461   AM_RANGE(0x880e, 0x880e) AM_DEVWRITE_LEGACY("8910.1", ay8910_data_w)
1458   AM_RANGE(0x8803, 0x8803) AM_DEVWRITE("8910.0", ay8910_device, address_w)
1459   AM_RANGE(0x880b, 0x880b) AM_DEVWRITE("8910.0", ay8910_device, data_w)
1460   AM_RANGE(0x880c, 0x880c) AM_DEVWRITE("8910.1", ay8910_device, address_w)
1461   AM_RANGE(0x880e, 0x880e) AM_DEVWRITE("8910.1", ay8910_device, data_w)
14621462   AM_RANGE(0x9000, 0x93ff) AM_MIRROR(0x0400) AM_RAM_WRITE(galaxian_videoram_w) AM_SHARE("videoram")
14631463   AM_RANGE(0x9800, 0x98ff) AM_MIRROR(0x0700) AM_RAM_WRITE(galaxian_objram_w) AM_SHARE("spriteram")
14641464   AM_RANGE(0xa000, 0xa000) AM_MIRROR(0x07ff) AM_READ_PORT("IN0")
r22781r22782
14731473   ADDRESS_MAP_UNMAP_HIGH
14741474   AM_RANGE(0x0000, 0x7fff) AM_ROM
14751475   AM_RANGE(0x8000, 0x87ff) AM_RAM
1476   AM_RANGE(0x8803, 0x8803) AM_DEVWRITE_LEGACY("8910.0", ay8910_address_w)
1477   AM_RANGE(0x880b, 0x880b) AM_DEVWRITE_LEGACY("8910.0", ay8910_data_w)
1478   AM_RANGE(0x880c, 0x880c) AM_DEVWRITE_LEGACY("8910.1", ay8910_address_w)
1479   AM_RANGE(0x880e, 0x880e) AM_DEVWRITE_LEGACY("8910.1", ay8910_data_w)
1476   AM_RANGE(0x8803, 0x8803) AM_DEVWRITE("8910.0", ay8910_device, address_w)
1477   AM_RANGE(0x880b, 0x880b) AM_DEVWRITE("8910.0", ay8910_device, data_w)
1478   AM_RANGE(0x880c, 0x880c) AM_DEVWRITE("8910.1", ay8910_device, address_w)
1479   AM_RANGE(0x880e, 0x880e) AM_DEVWRITE("8910.1", ay8910_device, data_w)
14801480   AM_RANGE(0x9000, 0x93ff) AM_MIRROR(0x0400) AM_RAM_WRITE(galaxian_videoram_w) AM_SHARE("videoram")
14811481   AM_RANGE(0x9800, 0x9bff) AM_MIRROR(0x0400) AM_RAM_WRITE(galaxian_objram_w) AM_SHARE("spriteram")
14821482   AM_RANGE(0xa000, 0xa000) AM_MIRROR(0x07ff) AM_READ_PORT("IN0")
r22781r22782
16891689   AM_RANGE(0x4000, 0x47ff) AM_RAM
16901690   AM_RANGE(0x4800, 0x4bff) AM_MIRROR(0x0400) AM_RAM_WRITE(galaxian_videoram_w) AM_SHARE("videoram")
16911691   AM_RANGE(0x5000, 0x50ff) AM_MIRROR(0x0700) AM_RAM_WRITE(galaxian_objram_w) AM_SHARE("spriteram")
1692   AM_RANGE(0x5800, 0x5800) AM_MIRROR(0x00ff) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_w)
1693   AM_RANGE(0x5900, 0x5900) AM_MIRROR(0x00ff) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w)
1692   AM_RANGE(0x5800, 0x5800) AM_MIRROR(0x00ff) AM_DEVWRITE("aysnd", ay8910_device, data_w)
1693   AM_RANGE(0x5900, 0x5900) AM_MIRROR(0x00ff) AM_DEVWRITE("aysnd", ay8910_device, address_w)
16941694   AM_RANGE(0x6000, 0x6000) AM_MIRROR(0x07ff) AM_READ_PORT("IN0")
16951695   AM_RANGE(0x6002, 0x6006) AM_MIRROR(0x07f8) AM_WRITE(galaxian_gfxbank_w)
16961696   AM_RANGE(0x6800, 0x6800) AM_MIRROR(0x07ff) AM_READ_PORT("IN1")
r22781r22782
18211821   ADDRESS_MAP_UNMAP_HIGH
18221822   ADDRESS_MAP_GLOBAL_MASK(0xff)
18231823   AM_RANGE(0x03, 0x03) AM_READ(soundlatch_byte_r)
1824   AM_RANGE(0x04, 0x05) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
1825   AM_RANGE(0x06, 0x06) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
1824   AM_RANGE(0x04, 0x05) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
1825   AM_RANGE(0x06, 0x06) AM_DEVREAD("aysnd", ay8910_device, data_r)
18261826ADDRESS_MAP_END
18271827
18281828
r22781r22782
18311831   ADDRESS_MAP_UNMAP_HIGH
18321832   AM_RANGE(0x0000, 0x0fff) AM_ROM
18331833   AM_RANGE(0x8000, 0x83ff) AM_RAM
1834   AM_RANGE(0xa000, 0xa001) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
1835   AM_RANGE(0xa002, 0xa002) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
1834   AM_RANGE(0xa000, 0xa001) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
1835   AM_RANGE(0xa002, 0xa002) AM_DEVREAD("aysnd", ay8910_device, data_r)
18361836ADDRESS_MAP_END
18371837
18381838
trunk/src/mame/drivers/5clown.c
r22781r22782
459459      m_videoram(*this, "videoram"),
460460      m_colorram(*this, "colorram"),
461461      m_maincpu(*this, "maincpu"),
462      m_audiocpu(*this, "audiocpu") { }
462      m_audiocpu(*this, "audiocpu"),
463      m_ay8910(*this, "ay8910")
464   {
465   }
463466
464467   UINT8 m_main_latch_d800;
465468   UINT8 m_snd_latch_0800;
466469   UINT8 m_snd_latch_0a02;
467470   UINT8 m_ay8910_addr;
468   device_t *m_ay8910;
469471   required_shared_ptr<UINT8> m_videoram;
470472   required_shared_ptr<UINT8> m_colorram;
471473   tilemap_t *m_bg_tilemap;
r22781r22782
491493   UINT32 screen_update_fclown(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
492494   required_device<cpu_device> m_maincpu;
493495   required_device<cpu_device> m_audiocpu;
496   required_device<ay8910_device> m_ay8910;
494497};
495498
496499
r22781r22782
689692
690693WRITE8_MEMBER(_5clown_state::fclown_ay8910_w)
691694{
692   ay8910_address_w(m_ay8910, space, 0, offset);
693   ay8910_data_w(m_ay8910, space, 0, data);
695   m_ay8910->address_w(space, 0, offset);
696   m_ay8910->data_w(space, 0, data);
694697}
695698
696699
r22781r22782
12581261         samples_src[x] = samples_src[x] ^ 0x12;     /* Otherwise bit 1 & 5 XOR'ed */
12591262      }
12601263   }
1261
1262
1263   /* Assigning AY-3-8910 sound device */
1264
1265   m_ay8910 = machine().device("ay8910");
12661264}
12671265
12681266
trunk/src/mame/drivers/calomega.c
r22781r22782
835835static ADDRESS_MAP_START( sys903_map, AS_PROGRAM, 8, calomega_state )
836836   ADDRESS_MAP_GLOBAL_MASK(0x3fff)
837837   AM_RANGE(0x0000, 0x07ff) AM_RAM AM_SHARE("nvram")
838   AM_RANGE(0x0840, 0x0841) AM_DEVWRITE_LEGACY("ay8912", ay8910_address_data_w)
838   AM_RANGE(0x0840, 0x0841) AM_DEVWRITE("ay8912", ay8910_device, address_data_w)
839839   AM_RANGE(0x0880, 0x0880) AM_DEVWRITE("crtc", mc6845_device, address_w)
840840   AM_RANGE(0x0881, 0x0881) AM_DEVREADWRITE("crtc", mc6845_device, register_r, register_w)
841841   AM_RANGE(0x08c4, 0x08c7) AM_DEVREADWRITE("pia0", pia6821_device, read, write)
r22781r22782
850850static ADDRESS_MAP_START( s903mod_map, AS_PROGRAM, 8, calomega_state )
851851   ADDRESS_MAP_GLOBAL_MASK(0x3fff)
852852   AM_RANGE(0x0000, 0x07ff) AM_RAM AM_SHARE("nvram")
853   AM_RANGE(0x0840, 0x0841) AM_DEVWRITE_LEGACY("ay8912", ay8910_address_data_w)
853   AM_RANGE(0x0840, 0x0841) AM_DEVWRITE("ay8912", ay8910_device, address_data_w)
854854   AM_RANGE(0x0880, 0x0880) AM_DEVWRITE("crtc", mc6845_device, address_w)
855855   AM_RANGE(0x0881, 0x0881) AM_DEVREADWRITE("crtc", mc6845_device, register_r, register_w)
856856   AM_RANGE(0x08c4, 0x08c7) AM_DEVREADWRITE("pia0", pia6821_device, read, write)
r22781r22782
863863static ADDRESS_MAP_START( sys905_map, AS_PROGRAM, 8, calomega_state )
864864   ADDRESS_MAP_GLOBAL_MASK(0x7fff)
865865   AM_RANGE(0x0000, 0x07ff) AM_RAM AM_SHARE("nvram")
866   AM_RANGE(0x1040, 0x1041) AM_DEVWRITE_LEGACY("ay8912", ay8910_address_data_w)
866   AM_RANGE(0x1040, 0x1041) AM_DEVWRITE("ay8912", ay8910_device, address_data_w)
867867   AM_RANGE(0x1080, 0x1080) AM_DEVWRITE("crtc", mc6845_device, address_w)
868868   AM_RANGE(0x1081, 0x1081) AM_DEVREADWRITE("crtc", mc6845_device, register_r, register_w)
869869   AM_RANGE(0x10c4, 0x10c7) AM_DEVREADWRITE("pia0", pia6821_device, read, write)
r22781r22782
879879   AM_RANGE(0x2824, 0x2827) AM_DEVREADWRITE("pia1", pia6821_device, read, write)
880880   AM_RANGE(0x2c04, 0x2c04) AM_DEVWRITE("crtc", mc6845_device, address_w)
881881   AM_RANGE(0x2c05, 0x2c05) AM_DEVREADWRITE("crtc", mc6845_device, register_r, register_w)
882   AM_RANGE(0x2c08, 0x2c09) AM_DEVREADWRITE_LEGACY("ay8912", ay8910_r, ay8910_address_data_w)
882   AM_RANGE(0x2c08, 0x2c09) AM_DEVREADWRITE("ay8912", ay8910_device, data_r, address_data_w)
883883   AM_RANGE(0x2000, 0x23ff) AM_RAM_WRITE(calomega_videoram_w) AM_SHARE("videoram")
884884   AM_RANGE(0x2400, 0x27ff) AM_RAM_WRITE(calomega_colorram_w) AM_SHARE("colorram")
885885   AM_RANGE(0x6000, 0xffff) AM_ROM
trunk/src/mame/drivers/skylncr.c
r22781r22782
426426
427427   AM_RANGE(0x20, 0x20) AM_WRITE(skylncr_coin_w )
428428
429   AM_RANGE(0x30, 0x31) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w )
430   AM_RANGE(0x31, 0x31) AM_DEVREAD_LEGACY("aysnd", ay8910_r )
429   AM_RANGE(0x30, 0x31) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
430   AM_RANGE(0x31, 0x31) AM_DEVREAD("aysnd", ay8910_device, data_r)
431431
432432   AM_RANGE(0x40, 0x41) AM_WRITE(skylncr_paletteram_w )
433433   AM_RANGE(0x50, 0x51) AM_WRITE(skylncr_paletteram2_w )
trunk/src/mame/drivers/mpu12wbk.c
r22781r22782
306306static ADDRESS_MAP_START( mpu12wbk_map, AS_PROGRAM, 8, mpu12wbk_state )
307307   AM_RANGE(0x1400, 0x1400) AM_DEVWRITE("crtc", mc6845_device, address_w)                      // OK
308308   AM_RANGE(0x1401, 0x1401) AM_DEVREADWRITE("crtc", mc6845_device, register_r, register_w)     // OK
309   AM_RANGE(0x1e00, 0x1e01) AM_DEVREADWRITE_LEGACY("ay8910", ay8910_r, ay8910_address_data_w)  // hmmmmm....
309   AM_RANGE(0x1e00, 0x1e01) AM_DEVREADWRITE("ay8910", ay8910_device, data_r, address_data_w)  // hmmmmm....
310310   AM_RANGE(0x2000, 0x23ff) AM_RAM_WRITE(mpu12wbk_videoram_w) AM_SHARE("videoram")             // FIXME
311311   AM_RANGE(0x2400, 0x27ff) AM_RAM_WRITE(mpu12wbk_colorram_w) AM_SHARE("colorram")             // FIXME
312312   AM_RANGE(0x2800, 0x3fff) AM_RAM                                                             // RAM (from 2000-3fff)
trunk/src/mame/drivers/bking.c
r22781r22782
129129   AM_RANGE(0x0000, 0x1fff) AM_ROM
130130   AM_RANGE(0x2000, 0x2fff) AM_ROM //only bking3
131131   AM_RANGE(0x4000, 0x43ff) AM_RAM
132   AM_RANGE(0x4400, 0x4401) AM_DEVWRITE_LEGACY("ay1", ay8910_address_data_w)
133   AM_RANGE(0x4401, 0x4401) AM_DEVREAD_LEGACY("ay1", ay8910_r)
134   AM_RANGE(0x4402, 0x4403) AM_DEVWRITE_LEGACY("ay2", ay8910_address_data_w)
135   AM_RANGE(0x4403, 0x4403) AM_DEVREAD_LEGACY("ay2", ay8910_r)
132   AM_RANGE(0x4400, 0x4401) AM_DEVWRITE("ay1", ay8910_device, address_data_w)
133   AM_RANGE(0x4401, 0x4401) AM_DEVREAD("ay1", ay8910_device, data_r)
134   AM_RANGE(0x4402, 0x4403) AM_DEVWRITE("ay2", ay8910_device, address_data_w)
135   AM_RANGE(0x4403, 0x4403) AM_DEVREAD("ay2", ay8910_device, data_r)
136136   AM_RANGE(0x4800, 0x4800) AM_READ(soundlatch_byte_r)
137137   AM_RANGE(0x4802, 0x4802) AM_READWRITE(bking_sndnmi_disable_r, bking_sndnmi_enable_w)
138138   AM_RANGE(0xe000, 0xefff) AM_ROM   /* Space for diagnostic ROM */
trunk/src/mame/drivers/thief.c
r22781r22782
175175   AM_RANGE(0x30, 0x30) AM_WRITE(thief_input_select_w) /* 8255 */
176176   AM_RANGE(0x31, 0x31) AM_READ(thief_io_r)    /* 8255 */
177177   AM_RANGE(0x33, 0x33) AM_WRITE(tape_control_w)
178   AM_RANGE(0x40, 0x41) AM_DEVWRITE_LEGACY("ay1", ay8910_address_data_w)
179   AM_RANGE(0x41, 0x41) AM_DEVREAD_LEGACY("ay1", ay8910_r)
180   AM_RANGE(0x42, 0x43) AM_DEVWRITE_LEGACY("ay2", ay8910_address_data_w)
181   AM_RANGE(0x43, 0x43) AM_DEVREAD_LEGACY("ay2", ay8910_r)
178   AM_RANGE(0x40, 0x41) AM_DEVWRITE("ay1", ay8910_device, address_data_w)
179   AM_RANGE(0x41, 0x41) AM_DEVREAD("ay1", ay8910_device, data_r)
180   AM_RANGE(0x42, 0x43) AM_DEVWRITE("ay2", ay8910_device, address_data_w)
181   AM_RANGE(0x43, 0x43) AM_DEVREAD("ay2", ay8910_device, data_r)
182182   AM_RANGE(0x50, 0x50) AM_WRITE(thief_color_plane_w)
183183   AM_RANGE(0x60, 0x6f) AM_DEVREADWRITE_LEGACY("tms", tms9927_r, tms9927_w)
184184   AM_RANGE(0x70, 0x7f) AM_WRITE(thief_color_map_w)
trunk/src/mame/drivers/suprridr.c
r22781r22782
203203static ADDRESS_MAP_START( sound_portmap, AS_IO, 8, suprridr_state )
204204   ADDRESS_MAP_GLOBAL_MASK(0xff)
205205   AM_RANGE(0x00, 0x00) AM_WRITE(sound_irq_ack_w)
206   AM_RANGE(0x8c, 0x8d) AM_DEVWRITE_LEGACY("ay1", ay8910_address_data_w)
207   AM_RANGE(0x8d, 0x8d) AM_DEVREAD_LEGACY("ay1", ay8910_r)
208   AM_RANGE(0x8e, 0x8f) AM_DEVWRITE_LEGACY("ay2", ay8910_address_data_w)
209   AM_RANGE(0x8f, 0x8f) AM_DEVREAD_LEGACY("ay2", ay8910_r)
206   AM_RANGE(0x8c, 0x8d) AM_DEVWRITE("ay1", ay8910_device, address_data_w)
207   AM_RANGE(0x8d, 0x8d) AM_DEVREAD("ay1", ay8910_device, data_r)
208   AM_RANGE(0x8e, 0x8f) AM_DEVWRITE("ay2", ay8910_device, address_data_w)
209   AM_RANGE(0x8f, 0x8f) AM_DEVREAD("ay2", ay8910_device, data_r)
210210ADDRESS_MAP_END
211211
212212
trunk/src/mame/drivers/calorie.c
r22781r22782
272272
273273static ADDRESS_MAP_START( calorie_sound_io_map, AS_IO, 8, calorie_state )
274274   ADDRESS_MAP_GLOBAL_MASK(0xff)
275   AM_RANGE(0x00, 0x01) AM_DEVWRITE_LEGACY("ay1", ay8910_address_data_w)
276   AM_RANGE(0x01, 0x01) AM_DEVREAD_LEGACY("ay1", ay8910_r)
277   AM_RANGE(0x10, 0x11) AM_DEVWRITE_LEGACY("ay2", ay8910_address_data_w)
278   AM_RANGE(0x11, 0x11) AM_DEVREAD_LEGACY("ay2", ay8910_r)
275   AM_RANGE(0x00, 0x01) AM_DEVWRITE("ay1", ay8910_device, address_data_w)
276   AM_RANGE(0x01, 0x01) AM_DEVREAD("ay1", ay8910_device, data_r)
277   AM_RANGE(0x10, 0x11) AM_DEVWRITE("ay2", ay8910_device, address_data_w)
278   AM_RANGE(0x11, 0x11) AM_DEVREAD("ay2", ay8910_device, data_r)
279279   // 3rd ?
280280   AM_RANGE(0x00, 0xff) AM_WRITE(bogus_w)
281281ADDRESS_MAP_END
trunk/src/mame/drivers/dacholer.c
r22781r22782
297297   AM_RANGE(0x08, 0x08) AM_WRITE(snd_irq_w)
298298   AM_RANGE(0x0c, 0x0c) AM_WRITE(snd_ack_w)
299299   AM_RANGE(0x80, 0x80) AM_WRITE(adpcm_w)
300   AM_RANGE(0x86, 0x87) AM_DEVWRITE_LEGACY("ay1", ay8910_data_address_w)
301   AM_RANGE(0x8a, 0x8b) AM_DEVWRITE_LEGACY("ay2", ay8910_data_address_w)
302   AM_RANGE(0x8e, 0x8f) AM_DEVWRITE_LEGACY("ay3", ay8910_data_address_w)
300   AM_RANGE(0x86, 0x87) AM_DEVWRITE("ay1", ay8910_device, data_address_w)
301   AM_RANGE(0x8a, 0x8b) AM_DEVWRITE("ay2", ay8910_device, data_address_w)
302   AM_RANGE(0x8e, 0x8f) AM_DEVWRITE("ay3", ay8910_device, data_address_w)
303303ADDRESS_MAP_END
304304
305305static ADDRESS_MAP_START( itaten_snd_io_map, AS_IO, 8, dacholer_state )
306306   ADDRESS_MAP_GLOBAL_MASK(0xff)
307307   AM_RANGE(0x00, 0x00) AM_READWRITE(soundlatch_byte_r, soundlatch_clear_byte_w )
308   AM_RANGE(0x86, 0x87) AM_DEVWRITE_LEGACY("ay1", ay8910_data_address_w)
309   AM_RANGE(0x8a, 0x8b) AM_DEVWRITE_LEGACY("ay2", ay8910_data_address_w)
310   AM_RANGE(0x8e, 0x8f) AM_DEVWRITE_LEGACY("ay3", ay8910_data_address_w)
308   AM_RANGE(0x86, 0x87) AM_DEVWRITE("ay1", ay8910_device, data_address_w)
309   AM_RANGE(0x8a, 0x8b) AM_DEVWRITE("ay2", ay8910_device, data_address_w)
310   AM_RANGE(0x8e, 0x8f) AM_DEVWRITE("ay3", ay8910_device, data_address_w)
311311ADDRESS_MAP_END
312312
313313
trunk/src/mame/drivers/forte2.c
r22781r22782
5555   ADDRESS_MAP_GLOBAL_MASK(0xff)
5656   AM_RANGE(0x98, 0x98) AM_DEVREADWRITE( "tms9928a", tms9928a_device, vram_read, vram_write )
5757   AM_RANGE(0x99, 0x99) AM_DEVREADWRITE( "tms9928a", tms9928a_device, register_read, register_write )
58   AM_RANGE(0xa0, 0xa1) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
59   AM_RANGE(0xa2, 0xa2) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
58   AM_RANGE(0xa0, 0xa1) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
59   AM_RANGE(0xa2, 0xa2) AM_DEVREAD("aysnd", ay8910_device, data_r)
6060
6161/* Ports a8-ab are originally for communicating with the i8255 PPI on MSX.
6262Since this arcade board doesn't have one, those ports should be unmapped. */
trunk/src/mame/drivers/flstory.c
r22781r22782
428428static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, flstory_state )
429429   AM_RANGE(0x0000, 0xbfff) AM_ROM
430430   AM_RANGE(0xc000, 0xc7ff) AM_RAM
431   AM_RANGE(0xc800, 0xc801) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
431   AM_RANGE(0xc800, 0xc801) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
432432   AM_RANGE(0xca00, 0xca0d) AM_DEVWRITE_LEGACY("msm", msm5232_w)
433433   AM_RANGE(0xcc00, 0xcc00) AM_WRITE(sound_control_0_w)
434434   AM_RANGE(0xce00, 0xce00) AM_WRITE(sound_control_1_w)
trunk/src/mame/drivers/twins.c
r22781r22782
108108ADDRESS_MAP_END
109109
110110static ADDRESS_MAP_START( twins_io, AS_IO, 16, twins_state )
111   AM_RANGE(0x0000, 0x0003) AM_DEVWRITE8_LEGACY("aysnd", ay8910_address_data_w, 0x00ff)
112   AM_RANGE(0x0002, 0x0003) AM_DEVREAD8_LEGACY("aysnd", ay8910_r, 0x00ff)
111   AM_RANGE(0x0000, 0x0003) AM_DEVWRITE8("aysnd", ay8910_device, address_data_w, 0x00ff)
112   AM_RANGE(0x0002, 0x0003) AM_DEVREAD8("aysnd", ay8910_device, data_r, 0x00ff)
113113   AM_RANGE(0x0004, 0x0005) AM_READWRITE(twins_port4_r, twins_port4_w)
114114   AM_RANGE(0x0006, 0x0007) AM_WRITE(port6_pal0_w)
115115   AM_RANGE(0x000e, 0x000f) AM_WRITE(porte_paloff0_w)
r22781r22782
272272   AM_RANGE(0x0000, 0x0001) AM_READWRITE(twinsa_unk_r, porte_paloff0_w)
273273   AM_RANGE(0x0002, 0x0003) AM_WRITE(porte_paloff0_w)
274274   AM_RANGE(0x0004, 0x0005) AM_WRITE(twinsa_port4_w) // palette on this set
275   AM_RANGE(0x0008, 0x0009) AM_DEVWRITE8_LEGACY("aysnd", ay8910_address_w, 0x00ff)
276   AM_RANGE(0x0010, 0x0011) AM_DEVREADWRITE8_LEGACY("aysnd", ay8910_r, ay8910_data_w, 0x00ff)
275   AM_RANGE(0x0008, 0x0009) AM_DEVWRITE8("aysnd", ay8910_device, address_w, 0x00ff)
276   AM_RANGE(0x0010, 0x0011) AM_DEVREADWRITE8("aysnd", ay8910_device, data_r, data_w, 0x00ff)
277277   AM_RANGE(0x0018, 0x0019) AM_READ(twins_port4_r) AM_WRITE(twins_port4_w)
278278ADDRESS_MAP_END
279279
trunk/src/mame/drivers/bmcbowl.c
r22781r22782
340340   AM_RANGE(0x092000, 0x09201f) AM_DEVREADWRITE8("via6522_0", via6522_device, read, write, 0x00ff)
341341
342342   AM_RANGE(0x093000, 0x093003) AM_WRITENOP  // related to music
343   AM_RANGE(0x092800, 0x092803) AM_DEVWRITE8_LEGACY("aysnd", ay8910_data_address_w, 0xff00)
344   AM_RANGE(0x092802, 0x092803) AM_DEVREAD8_LEGACY("aysnd", ay8910_r, 0xff00)
343   AM_RANGE(0x092800, 0x092803) AM_DEVWRITE8("aysnd", ay8910_device, data_address_w, 0xff00)
344   AM_RANGE(0x092802, 0x092803) AM_DEVREAD8("aysnd", ay8910_device, data_r, 0xff00)
345345   AM_RANGE(0x093802, 0x093803) AM_READ_PORT("IN0")
346346   AM_RANGE(0x095000, 0x095fff) AM_RAM AM_SHARE("nvram") /* 8 bit */
347347   AM_RANGE(0x097000, 0x097001) AM_READNOP
trunk/src/mame/drivers/tankbust.c
r22781r22782
193193
194194static ADDRESS_MAP_START( port_map_cpu2, AS_IO, 8, tankbust_state )
195195   ADDRESS_MAP_GLOBAL_MASK(0xff)
196   AM_RANGE(0x10, 0x10) AM_DEVWRITE_LEGACY("ay2", ay8910_data_w)
197   AM_RANGE(0x30, 0x30) AM_DEVREADWRITE_LEGACY("ay2", ay8910_r, ay8910_address_w)
198   AM_RANGE(0x40, 0x40) AM_DEVWRITE_LEGACY("ay1", ay8910_data_w)
199   AM_RANGE(0xc0, 0xc0) AM_DEVREADWRITE_LEGACY("ay1", ay8910_r, ay8910_address_w)
196   AM_RANGE(0x10, 0x10) AM_DEVWRITE("ay2", ay8910_device, data_w)
197   AM_RANGE(0x30, 0x30) AM_DEVREADWRITE("ay2", ay8910_device, data_r, address_w)
198   AM_RANGE(0x40, 0x40) AM_DEVWRITE("ay1", ay8910_device, data_w)
199   AM_RANGE(0xc0, 0xc0) AM_DEVREADWRITE("ay1", ay8910_device, data_r, address_w)
200200ADDRESS_MAP_END
201201
202202
trunk/src/mame/drivers/alpha68k.c
r22781r22782
807807
808808static ADDRESS_MAP_START( jongbou_sound_portmap, AS_IO, 8, alpha68k_state )
809809   ADDRESS_MAP_GLOBAL_MASK(0xff)
810   AM_RANGE(0x00, 0x00) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w)
811   AM_RANGE(0x01, 0x01) AM_DEVREADWRITE_LEGACY("aysnd", ay8910_r, ay8910_data_w)
810   AM_RANGE(0x00, 0x00) AM_DEVWRITE("aysnd", ay8910_device, address_w)
811   AM_RANGE(0x01, 0x01) AM_DEVREADWRITE("aysnd", ay8910_device, data_r, data_w)
812812   AM_RANGE(0x02, 0x02) AM_WRITE(soundlatch_clear_byte_w)
813813   AM_RANGE(0x06, 0x06) AM_WRITENOP
814814ADDRESS_MAP_END
trunk/src/mame/drivers/zodiack.c
r22781r22782
169169
170170static ADDRESS_MAP_START( io_map, AS_IO, 8, zodiack_state  )
171171   ADDRESS_MAP_GLOBAL_MASK(0xff)
172   AM_RANGE(0x00, 0x01) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
172   AM_RANGE(0x00, 0x01) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
173173ADDRESS_MAP_END
174174
175175
trunk/src/mame/drivers/galaxold.c
r22781r22782
734734
735735static ADDRESS_MAP_START( bongo_io, AS_IO, 8, galaxold_state )
736736   ADDRESS_MAP_GLOBAL_MASK(0xff)
737   AM_RANGE(0x00, 0x01) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
738   AM_RANGE(0x02, 0x02) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
737   AM_RANGE(0x00, 0x01) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
738   AM_RANGE(0x02, 0x02) AM_DEVREAD("aysnd", ay8910_device, data_r)
739739ADDRESS_MAP_END
740740
741741
r22781r22782
759759
760760static ADDRESS_MAP_START( ozon1_io_map, AS_IO, 8, galaxold_state )
761761   ADDRESS_MAP_GLOBAL_MASK(0xff)
762   AM_RANGE(0x00, 0x01) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_address_w)
762   AM_RANGE(0x00, 0x01) AM_DEVWRITE("aysnd", ay8910_device, data_address_w)
763763ADDRESS_MAP_END
764764
765765
trunk/src/mame/drivers/hanaawas.c
r22781r22782
8282   ADDRESS_MAP_GLOBAL_MASK(0xff)
8383   AM_RANGE(0x00, 0x00) AM_READWRITE(hanaawas_input_port_0_r, hanaawas_inputs_mux_w)
8484   AM_RANGE(0x01, 0x01) AM_READNOP /* it must return 0 */
85   AM_RANGE(0x10, 0x10) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
86   AM_RANGE(0x10, 0x11) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
85   AM_RANGE(0x10, 0x10) AM_DEVREAD("aysnd", ay8910_device, data_r)
86   AM_RANGE(0x10, 0x11) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
8787ADDRESS_MAP_END
8888
8989static INPUT_PORTS_START( hanaawas )
trunk/src/mame/drivers/goldngam.c
r22781r22782
307307   AM_RANGE(0x400002, 0x400003) AM_NOP // hopper status read ?
308308   AM_RANGE(0x40000c, 0x40000d) AM_READ(unk_r)
309309   AM_RANGE(0x40000e, 0x40000f) AM_READ_PORT("DSW2")   // not sure...
310   AM_RANGE(0x402000, 0x402001) AM_DEVREAD8_LEGACY("aysnd", ay8910_r, 0x00ff)
311   AM_RANGE(0x402000, 0x402003) AM_DEVWRITE8_LEGACY("aysnd", ay8910_address_data_w, 0x00ff) //wrong
310   AM_RANGE(0x402000, 0x402001) AM_DEVREAD8("aysnd", ay8910_device, data_r, 0x00ff)
311   AM_RANGE(0x402000, 0x402003) AM_DEVWRITE8("aysnd", ay8910_device, address_data_w, 0x00ff) //wrong
312312
313313   AM_RANGE(0xc00000, 0xc3ffff) AM_RAM AM_SHARE("videoram")
314314   AM_RANGE(0x500200, 0x50020f) AM_RAM //?
trunk/src/mame/drivers/bigevglf.c
r22781r22782
363363static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, bigevglf_state )
364364   AM_RANGE(0x0000, 0xbfff) AM_ROM
365365   AM_RANGE(0xc000, 0xc7ff) AM_RAM
366   AM_RANGE(0xc800, 0xc801) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
366   AM_RANGE(0xc800, 0xc801) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
367367   AM_RANGE(0xca00, 0xca0d) AM_DEVWRITE_LEGACY("msm", msm5232_w)
368368   AM_RANGE(0xcc00, 0xcc00) AM_WRITENOP
369369   AM_RANGE(0xce00, 0xce00) AM_WRITENOP
trunk/src/mame/drivers/pastelg.c
r22781r22782
6565   ADDRESS_MAP_GLOBAL_MASK(0xff)
6666//  AM_RANGE(0x00, 0x00) AM_WRITENOP
6767   AM_RANGE(0x00, 0x7f) AM_READ_LEGACY(nb1413m3_sndrom_r)
68   AM_RANGE(0x81, 0x81) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
69   AM_RANGE(0x82, 0x83) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_address_w)
68   AM_RANGE(0x81, 0x81) AM_DEVREAD("aysnd", ay8910_device, data_r)
69   AM_RANGE(0x82, 0x83) AM_DEVWRITE("aysnd", ay8910_device, data_address_w)
7070   AM_RANGE(0x90, 0x90) AM_READ_PORT("SYSTEM")
7171   AM_RANGE(0x90, 0x96) AM_WRITE(pastelg_blitter_w)
7272   AM_RANGE(0xa0, 0xa0) AM_READWRITE_LEGACY(nb1413m3_inputport1_r, nb1413m3_inputportsel_w)
r22781r22782
113113
114114static ADDRESS_MAP_START( threeds_io_map, AS_IO, 8, pastelg_state )
115115   ADDRESS_MAP_GLOBAL_MASK(0xff)
116   AM_RANGE(0x81, 0x81) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
117   AM_RANGE(0x82, 0x83) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_address_w)
116   AM_RANGE(0x81, 0x81) AM_DEVREAD("aysnd", ay8910_device, data_r)
117   AM_RANGE(0x82, 0x83) AM_DEVWRITE("aysnd", ay8910_device, data_address_w)
118118   AM_RANGE(0x90, 0x90) AM_READ_PORT("SYSTEM") AM_WRITE(threeds_romsel_w )
119119   AM_RANGE(0xf0, 0xf6) AM_WRITE(pastelg_blitter_w)
120120   AM_RANGE(0xa0, 0xa0) AM_READWRITE(threeds_inputport1_r, threeds_inputportsel_w)
trunk/src/mame/drivers/popeye.c
r22781r22782
104104
105105static ADDRESS_MAP_START( popeye_io_map, AS_IO, 8, popeye_state )
106106   ADDRESS_MAP_GLOBAL_MASK(0xff)
107   AM_RANGE(0x00, 0x01) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
107   AM_RANGE(0x00, 0x01) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
108108   AM_RANGE(0x00, 0x00) AM_READ_PORT("P1")
109109   AM_RANGE(0x01, 0x01) AM_READ_PORT("P2")
110110   AM_RANGE(0x02, 0x02) AM_READ_PORT("IN0")
111   AM_RANGE(0x03, 0x03) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
111   AM_RANGE(0x03, 0x03) AM_DEVREAD("aysnd", ay8910_device, data_r)
112112ADDRESS_MAP_END
113113
114114
trunk/src/mame/drivers/big10.c
r22781r22782
147147   AM_RANGE(0x00, 0x00) AM_READ(mux_r)         /* present in test mode */
148148   AM_RANGE(0x02, 0x02) AM_READ_PORT("SYSTEM") /* coins and service */
149149   AM_RANGE(0x98, 0x9b) AM_DEVREADWRITE("v9938", v9938_device, read, write)
150   AM_RANGE(0xa0, 0xa1) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
151   AM_RANGE(0xa2, 0xa2) AM_DEVREAD_LEGACY("aysnd", ay8910_r) /* Dip-Switches routes here. */
150   AM_RANGE(0xa0, 0xa1) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
151   AM_RANGE(0xa2, 0xa2) AM_DEVREAD("aysnd", ay8910_device, data_r) /* Dip-Switches routes here. */
152152ADDRESS_MAP_END
153153
154154
trunk/src/mame/drivers/dunhuang.c
r22781r22782
522522   AM_RANGE( 0x0086, 0x0086 ) AM_WRITE(dunhuang_rombank_w )
523523   AM_RANGE( 0x0087, 0x0087 ) AM_WRITE(dunhuang_layers_w )
524524
525   AM_RANGE( 0x0088, 0x0088 ) AM_DEVREAD_LEGACY("ay8910", ay8910_r )
526   AM_RANGE( 0x0090, 0x0090 ) AM_DEVWRITE_LEGACY("ay8910", ay8910_data_w )
527   AM_RANGE( 0x0098, 0x0098 ) AM_DEVWRITE_LEGACY("ay8910", ay8910_address_w )
525   AM_RANGE( 0x0088, 0x0088 ) AM_DEVREAD("ay8910", ay8910_device, data_r )
526   AM_RANGE( 0x0090, 0x0090 ) AM_DEVWRITE("ay8910", ay8910_device, data_w )
527   AM_RANGE( 0x0098, 0x0098 ) AM_DEVWRITE("ay8910", ay8910_device, address_w )
528528ADDRESS_MAP_END
529529
530530
trunk/src/mame/drivers/ojankohs.c
r22781r22782
221221   AM_RANGE(0x03, 0x03) AM_WRITE(ojankohs_adpcm_reset_w)
222222   AM_RANGE(0x04, 0x04) AM_WRITE(ojankohs_flipscreen_w)
223223   AM_RANGE(0x05, 0x05) AM_WRITE(ojankohs_msm5205_w)
224   AM_RANGE(0x06, 0x06) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
225   AM_RANGE(0x06, 0x07) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_address_w)
224   AM_RANGE(0x06, 0x06) AM_DEVREAD("aysnd", ay8910_device, data_r)
225   AM_RANGE(0x06, 0x07) AM_DEVWRITE("aysnd", ay8910_device, data_address_w)
226226   AM_RANGE(0x10, 0x10) AM_WRITENOP                // unknown
227227   AM_RANGE(0x11, 0x11) AM_WRITENOP                // unknown
228228ADDRESS_MAP_END
r22781r22782
234234   AM_RANGE(0x02, 0x02) AM_READ_PORT("IN1") AM_WRITE(ojankoy_coinctr_w)
235235   AM_RANGE(0x04, 0x04) AM_WRITE(ojankohs_flipscreen_w)
236236   AM_RANGE(0x05, 0x05) AM_WRITE(ojankohs_msm5205_w)
237   AM_RANGE(0x06, 0x06) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
238   AM_RANGE(0x06, 0x07) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_address_w)
237   AM_RANGE(0x06, 0x06) AM_DEVREAD("aysnd", ay8910_device, data_r)
238   AM_RANGE(0x06, 0x07) AM_DEVWRITE("aysnd", ay8910_device, data_address_w)
239239ADDRESS_MAP_END
240240
241241static ADDRESS_MAP_START( ccasino_io_map, AS_IO, 8, ojankohs_state )
r22781r22782
246246   AM_RANGE(0x03, 0x03) AM_READ(ccasino_dipsw3_r) AM_WRITE(ojankohs_adpcm_reset_w)
247247   AM_RANGE(0x04, 0x04) AM_READ(ccasino_dipsw4_r) AM_WRITE(ojankohs_flipscreen_w)
248248   AM_RANGE(0x05, 0x05) AM_WRITE(ojankohs_msm5205_w)
249   AM_RANGE(0x06, 0x06) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
250   AM_RANGE(0x06, 0x07) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_address_w)
249   AM_RANGE(0x06, 0x06) AM_DEVREAD("aysnd", ay8910_device, data_r)
250   AM_RANGE(0x06, 0x07) AM_DEVWRITE("aysnd", ay8910_device, data_address_w)
251251   AM_RANGE(0x08, 0x0f) AM_WRITE(ccasino_palette_w) AM_SHARE("paletteram")     // 16bit address access
252252   AM_RANGE(0x10, 0x10) AM_WRITENOP
253253   AM_RANGE(0x11, 0x11) AM_WRITENOP
r22781r22782
260260   AM_RANGE(0xfb, 0xfb) AM_WRITE(ojankoc_ctrl_w)
261261   AM_RANGE(0xfc, 0xfd) AM_READ(ojankoc_keymatrix_r)
262262   AM_RANGE(0xfd, 0xfd) AM_WRITE(ojankohs_portselect_w)
263   AM_RANGE(0xfe, 0xff) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_address_w)
264   AM_RANGE(0xff, 0xff) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
263   AM_RANGE(0xfe, 0xff) AM_DEVWRITE("aysnd", ay8910_device, data_address_w)
264   AM_RANGE(0xff, 0xff) AM_DEVREAD("aysnd", ay8910_device, data_r)
265265ADDRESS_MAP_END
266266
267267
trunk/src/mame/drivers/trvquest.c
r22781r22782
6262   AM_RANGE(0x3800, 0x380f) AM_DEVREADWRITE("via6522_1", via6522_device, read, write)
6363   AM_RANGE(0x3810, 0x381f) AM_DEVREADWRITE("via6522_2", via6522_device, read, write)
6464   AM_RANGE(0x3820, 0x382f) AM_DEVREADWRITE("via6522_0", via6522_device, read, write)
65   AM_RANGE(0x3830, 0x3831) AM_DEVWRITE_LEGACY("ay1", ay8910_address_data_w)
66   AM_RANGE(0x3840, 0x3841) AM_DEVWRITE_LEGACY("ay2", ay8910_address_data_w)
65   AM_RANGE(0x3830, 0x3831) AM_DEVWRITE("ay1", ay8910_device, address_data_w)
66   AM_RANGE(0x3840, 0x3841) AM_DEVWRITE("ay2", ay8910_device, address_data_w)
6767   AM_RANGE(0x3850, 0x3850) AM_READNOP //watchdog_reset_r ?
6868   AM_RANGE(0x8000, 0x9fff) AM_READ(trvquest_question_r)
6969   AM_RANGE(0xa000, 0xa000) AM_WRITEONLY AM_SHARE("trvquest_q")
trunk/src/mame/drivers/suna8.c
r22781r22782
11771177static ADDRESS_MAP_START( hardhead_sound_map, AS_PROGRAM, 8, suna8_state )
11781178   AM_RANGE(0x0000, 0x7fff) AM_ROM // ROM
11791179   AM_RANGE(0xa000, 0xa001) AM_DEVREADWRITE_LEGACY("ymsnd", ym3812_r, ym3812_w)
1180   AM_RANGE(0xa002, 0xa003) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w      )
1180   AM_RANGE(0xa002, 0xa003) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
11811181   AM_RANGE(0xc000, 0xc7ff) AM_RAM // RAM
11821182   AM_RANGE(0xc800, 0xc800) AM_DEVREAD_LEGACY("ymsnd", ym3812_status_port_r)   // ? unsure
11831183   AM_RANGE(0xd000, 0xd000) AM_WRITE(soundlatch2_byte_w                )   //
r22781r22782
12121212static ADDRESS_MAP_START( brickzn_sound_map, AS_PROGRAM, 8, suna8_state )
12131213   AM_RANGE(0x0000, 0xbfff) AM_ROM // ROM
12141214   AM_RANGE(0xc000, 0xc001) AM_DEVWRITE_LEGACY("ymsnd", ym3812_w   )
1215   AM_RANGE(0xc002, 0xc003) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w      )
1215   AM_RANGE(0xc002, 0xc003) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
12161216   AM_RANGE(0xe000, 0xe7ff) AM_RAM // RAM
12171217   AM_RANGE(0xf000, 0xf000) AM_WRITE(soundlatch2_byte_w                )   // To PCM CPU
12181218   AM_RANGE(0xf800, 0xf800) AM_READ(soundlatch_byte_r                  )   // From Main CPU
trunk/src/mame/drivers/btime.c
r22781r22782
325325
326326static ADDRESS_MAP_START( audio_map, AS_PROGRAM, 8, btime_state )
327327   AM_RANGE(0x0000, 0x03ff) AM_MIRROR(0x1c00) AM_RAM AM_SHARE("audio_rambase")
328   AM_RANGE(0x2000, 0x3fff) AM_DEVWRITE_LEGACY("ay1", ay8910_data_w)
329   AM_RANGE(0x4000, 0x5fff) AM_DEVWRITE_LEGACY("ay1", ay8910_address_w)
330   AM_RANGE(0x6000, 0x7fff) AM_DEVWRITE_LEGACY("ay2", ay8910_data_w)
331   AM_RANGE(0x8000, 0x9fff) AM_DEVWRITE_LEGACY("ay2", ay8910_address_w)
328   AM_RANGE(0x2000, 0x3fff) AM_DEVWRITE("ay1", ay8910_device, data_w)
329   AM_RANGE(0x4000, 0x5fff) AM_DEVWRITE("ay1", ay8910_device, address_w)
330   AM_RANGE(0x6000, 0x7fff) AM_DEVWRITE("ay2", ay8910_device, data_w)
331   AM_RANGE(0x8000, 0x9fff) AM_DEVWRITE("ay2", ay8910_device, address_w)
332332   AM_RANGE(0xa000, 0xbfff) AM_READ(audio_command_r)
333333   AM_RANGE(0xc000, 0xdfff) AM_WRITE(audio_nmi_enable_w)
334334   AM_RANGE(0xe000, 0xefff) AM_MIRROR(0x1000) AM_ROM
r22781r22782
336336
337337static ADDRESS_MAP_START( disco_audio_map, AS_PROGRAM, 8, btime_state )
338338   AM_RANGE(0x0000, 0x03ff) AM_RAM
339   AM_RANGE(0x4000, 0x4fff) AM_DEVWRITE_LEGACY("ay1", ay8910_data_w)
340   AM_RANGE(0x5000, 0x5fff) AM_DEVWRITE_LEGACY("ay1", ay8910_address_w)
341   AM_RANGE(0x6000, 0x6fff) AM_DEVWRITE_LEGACY("ay2", ay8910_data_w)
342   AM_RANGE(0x7000, 0x7fff) AM_DEVWRITE_LEGACY("ay2", ay8910_address_w)
339   AM_RANGE(0x4000, 0x4fff) AM_DEVWRITE("ay1", ay8910_device, data_w)
340   AM_RANGE(0x5000, 0x5fff) AM_DEVWRITE("ay1", ay8910_device, address_w)
341   AM_RANGE(0x6000, 0x6fff) AM_DEVWRITE("ay2", ay8910_device, data_w)
342   AM_RANGE(0x7000, 0x7fff) AM_DEVWRITE("ay2", ay8910_device, address_w)
343343   AM_RANGE(0x8000, 0x8fff) AM_READ(soundlatch_byte_r) AM_WRITENOP /* ack ? */
344344   AM_RANGE(0xf000, 0xffff) AM_ROM
345345ADDRESS_MAP_END
trunk/src/mame/drivers/higemaru.c
r22781r22782
3636   AM_RANGE(0xc003, 0xc003) AM_READ_PORT("DSW1")
3737   AM_RANGE(0xc004, 0xc004) AM_READ_PORT("DSW2")
3838   AM_RANGE(0xc800, 0xc800) AM_WRITE(higemaru_c800_w)
39   AM_RANGE(0xc801, 0xc802) AM_DEVWRITE_LEGACY("ay1", ay8910_address_data_w)
40   AM_RANGE(0xc803, 0xc804) AM_DEVWRITE_LEGACY("ay2", ay8910_address_data_w)
39   AM_RANGE(0xc801, 0xc802) AM_DEVWRITE("ay1", ay8910_device, address_data_w)
40   AM_RANGE(0xc803, 0xc804) AM_DEVWRITE("ay2", ay8910_device, address_data_w)
4141   AM_RANGE(0xd000, 0xd3ff) AM_RAM_WRITE(higemaru_videoram_w) AM_SHARE("videoram")
4242   AM_RANGE(0xd400, 0xd7ff) AM_RAM_WRITE(higemaru_colorram_w) AM_SHARE("colorram")
4343   AM_RANGE(0xd880, 0xd9ff) AM_RAM AM_SHARE("spriteram")
trunk/src/mame/drivers/jangou.c
r22781r22782
406406
407407static ADDRESS_MAP_START( cpu0_io, AS_IO, 8, jangou_state )
408408   ADDRESS_MAP_GLOBAL_MASK(0xff)
409   AM_RANGE(0x01,0x01) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
410   AM_RANGE(0x02,0x03) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_address_w)
409   AM_RANGE(0x01,0x01) AM_DEVREAD("aysnd", ay8910_device, data_r)
410   AM_RANGE(0x02,0x03) AM_DEVWRITE("aysnd", ay8910_device, data_address_w)
411411   AM_RANGE(0x10,0x10) AM_READ_PORT("DSW") //dsw + blitter busy flag
412412   AM_RANGE(0x10,0x10) AM_WRITE(output_w)
413413   AM_RANGE(0x11,0x11) AM_WRITE(mux_w)
r22781r22782
477477
478478static ADDRESS_MAP_START( cntrygrl_cpu0_io, AS_IO, 8, jangou_state )
479479   ADDRESS_MAP_GLOBAL_MASK(0xff)
480   AM_RANGE(0x01,0x01) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
481   AM_RANGE(0x02,0x03) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_address_w)
480   AM_RANGE(0x01,0x01) AM_DEVREAD("aysnd", ay8910_device, data_r)
481   AM_RANGE(0x02,0x03) AM_DEVWRITE("aysnd", ay8910_device, data_address_w)
482482   AM_RANGE(0x10,0x10) AM_READ_PORT("DSW") //dsw + blitter busy flag
483483   AM_RANGE(0x10,0x10) AM_WRITE(output_w)
484484   AM_RANGE(0x11,0x11) AM_WRITE(mux_w)
r22781r22782
501501
502502static ADDRESS_MAP_START( roylcrdn_cpu0_io, AS_IO, 8, jangou_state )
503503   ADDRESS_MAP_GLOBAL_MASK(0xff)
504   AM_RANGE(0x01,0x01) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
505   AM_RANGE(0x02,0x03) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_address_w)
504   AM_RANGE(0x01,0x01) AM_DEVREAD("aysnd", ay8910_device, data_r)
505   AM_RANGE(0x02,0x03) AM_DEVWRITE("aysnd", ay8910_device, data_address_w)
506506   AM_RANGE(0x10,0x10) AM_READ_PORT("DSW")         /* DSW + blitter busy flag */
507507   AM_RANGE(0x10,0x10) AM_WRITENOP                 /* Writes continuosly 0's in attract mode, and 1's in game */
508508   AM_RANGE(0x11,0x11) AM_WRITE(mux_w)
trunk/src/mame/drivers/cchasm.c
r22781r22782
5151   AM_RANGE(0x0000, 0x0fff) AM_ROM
5252   AM_RANGE(0x4000, 0x43ff) AM_RAM
5353   AM_RANGE(0x5000, 0x53ff) AM_RAM
54   AM_RANGE(0x6000, 0x6001) AM_MIRROR(0xf9e) AM_DEVWRITE_LEGACY("ay1", ay8910_address_data_w)
54   AM_RANGE(0x6000, 0x6001) AM_MIRROR(0xf9e) AM_DEVWRITE("ay1", ay8910_device, address_data_w)
5555   AM_RANGE(0x6000, 0x6000) AM_MIRROR(0xf9e) AM_READ(cchasm_coin_sound_r)
56   AM_RANGE(0x6001, 0x6001) AM_MIRROR(0xf9e) AM_DEVREAD_LEGACY("ay1", ay8910_r)
57   AM_RANGE(0x6020, 0x6021) AM_MIRROR(0xf9e) AM_DEVWRITE_LEGACY("ay2", ay8910_address_data_w)
58   AM_RANGE(0x6021, 0x6021) AM_MIRROR(0xf9e) AM_DEVREAD_LEGACY("ay2", ay8910_r)
56   AM_RANGE(0x6001, 0x6001) AM_MIRROR(0xf9e) AM_DEVREAD("ay1", ay8910_device, data_r)
57   AM_RANGE(0x6020, 0x6021) AM_MIRROR(0xf9e) AM_DEVWRITE("ay2", ay8910_device, address_data_w)
58   AM_RANGE(0x6021, 0x6021) AM_MIRROR(0xf9e) AM_DEVREAD("ay2", ay8910_device, data_r)
5959   AM_RANGE(0x6040, 0x6040) AM_MIRROR(0xf9e) AM_READWRITE(soundlatch_byte_r, soundlatch3_byte_w)
6060   AM_RANGE(0x6041, 0x6041) AM_MIRROR(0xf9e) AM_READWRITE(cchasm_soundlatch2_r, cchasm_soundlatch4_w)
6161   AM_RANGE(0x6061, 0x6061) AM_MIRROR(0xf9e) AM_WRITE(cchasm_reset_coin_flag_w)
trunk/src/mame/drivers/kingpin.c
r22781r22782
7979
8080static ADDRESS_MAP_START( kingpin_sound_map, AS_PROGRAM, 8, kingpin_state )
8181   AM_RANGE(0x0000, 0x1fff) AM_ROM
82   AM_RANGE(0x8000, 0x8001) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
82   AM_RANGE(0x8000, 0x8001) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
8383   //AM_RANGE(0x8400, 0x8400) AM_READNOP // ?
8484   //AM_RANGE(0x8401, 0x8401) AM_WRITENOP // ?
8585   AM_RANGE(0x8800, 0x8fff) AM_RAM
r22781r22782
154154   DEVCB_DRIVER_LINE_MEMBER(kingpin_state, vdp_interrupt)
155155};
156156
157static AY8910_INTERFACE( ay8912_interface )
157static const ay8910_interface ay8912_interface =
158158{
159159   AY8910_LEGACY_OUTPUT,
160160   AY8910_DEFAULT_LOADS,
trunk/src/mame/drivers/usgames.c
r22781r22782
7171   AM_RANGE(0x2041, 0x2041) AM_DEVWRITE("crtc", mc6845_device, register_w)
7272   AM_RANGE(0x2060, 0x2060) AM_WRITE(usgames_rombank_w)
7373   AM_RANGE(0x2070, 0x2070) AM_READ_PORT("UNK2")
74   AM_RANGE(0x2400, 0x2401) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
74   AM_RANGE(0x2400, 0x2401) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
7575   AM_RANGE(0x2800, 0x2fff) AM_RAM_WRITE(usgames_charram_w) AM_SHARE("charram")
7676   AM_RANGE(0x3000, 0x3fff) AM_RAM_WRITE(usgames_videoram_w) AM_SHARE("videoram")
7777   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank1")
r22781r22782
8181
8282static ADDRESS_MAP_START( usg185_map, AS_PROGRAM, 8, usgames_state )
8383   AM_RANGE(0x0000, 0x1fff) AM_RAM AM_SHARE("nvram")
84   AM_RANGE(0x2000, 0x2001) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
84   AM_RANGE(0x2000, 0x2001) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
8585   AM_RANGE(0x2400, 0x2400) AM_READ_PORT("DSW")
8686   AM_RANGE(0x2410, 0x2410) AM_READ_PORT("INPUTS")
8787   AM_RANGE(0x2420, 0x2420) AM_WRITE(lamps1_w)
trunk/src/mame/drivers/bombjack.c
r22781r22782
162162
163163static ADDRESS_MAP_START( audio_io_map, AS_IO, 8, bombjack_state )
164164   ADDRESS_MAP_GLOBAL_MASK(0xff)
165   AM_RANGE(0x00, 0x01) AM_DEVWRITE_LEGACY("ay1", ay8910_address_data_w)
166   AM_RANGE(0x10, 0x11) AM_DEVWRITE_LEGACY("ay2", ay8910_address_data_w)
167   AM_RANGE(0x80, 0x81) AM_DEVWRITE_LEGACY("ay3", ay8910_address_data_w)
165   AM_RANGE(0x00, 0x01) AM_DEVWRITE("ay1", ay8910_device, address_data_w)
166   AM_RANGE(0x10, 0x11) AM_DEVWRITE("ay2", ay8910_device, address_data_w)
167   AM_RANGE(0x80, 0x81) AM_DEVWRITE("ay3", ay8910_device, address_data_w)
168168ADDRESS_MAP_END
169169
170170
trunk/src/mame/drivers/segag80v.c
r22781r22782
13341334DRIVER_INIT_MEMBER(segag80v_state,zektor)
13351335{
13361336   address_space &iospace = m_maincpu->space(AS_IO);
1337   device_t *ay = machine().device("aysnd");
1337   ay8910_device *ay8910 = machine().device<ay8910_device>("aysnd");
13381338
13391339   /* configure security */
13401340   m_decrypt = segag80_security(82);
r22781r22782
13431343   m_usb = NULL;
13441344   iospace.install_legacy_write_handler(*machine().device("segaspeech"), 0x38, 0x38, FUNC(sega_speech_data_w));
13451345   iospace.install_legacy_write_handler(*machine().device("segaspeech"), 0x3b, 0x3b, FUNC(sega_speech_control_w));
1346   iospace.install_legacy_write_handler(*ay, 0x3c, 0x3d, FUNC(ay8910_address_data_w));
1346   iospace.install_write_handler(0x3c, 0x3d, write8_delegate(FUNC(ay8910_device::address_data_w), ay8910));
13471347   iospace.install_write_handler(0x3e, 0x3e, write8_delegate(FUNC(segag80v_state::zektor1_sh_w),this));
13481348   iospace.install_write_handler(0x3f, 0x3f, write8_delegate(FUNC(segag80v_state::zektor2_sh_w),this));
13491349
trunk/src/mame/drivers/nyny.c
r22781r22782
557557   AM_RANGE(0x0080, 0x0fff) AM_NOP
558558   AM_RANGE(0x1000, 0x1000) AM_MIRROR(0x0fff) AM_READ(soundlatch_byte_r) AM_WRITE(audio_1_answer_w)
559559   AM_RANGE(0x2000, 0x2000) AM_MIRROR(0x0fff) AM_READ_PORT("SW3")
560   AM_RANGE(0x3000, 0x3000) AM_MIRROR(0x0ffc) AM_DEVREAD_LEGACY("ay1", ay8910_r)
561   AM_RANGE(0x3000, 0x3001) AM_MIRROR(0x0ffc) AM_DEVWRITE_LEGACY("ay1", ay8910_data_address_w)
562   AM_RANGE(0x3002, 0x3002) AM_MIRROR(0x0ffc) AM_DEVREAD_LEGACY("ay2", ay8910_r)
563   AM_RANGE(0x3002, 0x3003) AM_MIRROR(0x0ffc) AM_DEVWRITE_LEGACY("ay2", ay8910_data_address_w)
560   AM_RANGE(0x3000, 0x3000) AM_MIRROR(0x0ffc) AM_DEVREAD("ay1", ay8910_device, data_r)
561   AM_RANGE(0x3000, 0x3001) AM_MIRROR(0x0ffc) AM_DEVWRITE("ay1", ay8910_device, data_address_w)
562   AM_RANGE(0x3002, 0x3002) AM_MIRROR(0x0ffc) AM_DEVREAD("ay2", ay8910_device, data_r)
563   AM_RANGE(0x3002, 0x3003) AM_MIRROR(0x0ffc) AM_DEVWRITE("ay2", ay8910_device, data_address_w)
564564   AM_RANGE(0x4000, 0x4fff) AM_NOP
565565   AM_RANGE(0x5000, 0x57ff) AM_MIRROR(0x0800) AM_ROM
566566   AM_RANGE(0x6000, 0x67ff) AM_MIRROR(0x0800) AM_ROM
r22781r22782
573573   AM_RANGE(0x0000, 0x007f) AM_RAM     /* internal RAM */
574574   AM_RANGE(0x0080, 0x0fff) AM_NOP
575575   AM_RANGE(0x1000, 0x1000) AM_MIRROR(0x0fff) AM_READ(soundlatch2_byte_r)
576   AM_RANGE(0x2000, 0x2000) AM_MIRROR(0x0ffe) AM_DEVREAD_LEGACY("ay3", ay8910_r)
577   AM_RANGE(0x2000, 0x2001) AM_MIRROR(0x0ffe) AM_DEVWRITE_LEGACY("ay3", ay8910_data_address_w)
576   AM_RANGE(0x2000, 0x2000) AM_MIRROR(0x0ffe) AM_DEVREAD("ay3", ay8910_device, data_r)
577   AM_RANGE(0x2000, 0x2001) AM_MIRROR(0x0ffe) AM_DEVWRITE("ay3", ay8910_device, data_address_w)
578578   AM_RANGE(0x3000, 0x6fff) AM_NOP
579579   AM_RANGE(0x7000, 0x77ff) AM_MIRROR(0x0800) AM_ROM
580580ADDRESS_MAP_END
trunk/src/mame/drivers/sanremo.c
r22781r22782
227227   AM_RANGE(0x04, 0x04) AM_DEVWRITE("crtc", mc6845_device, address_w)
228228   AM_RANGE(0x05, 0x05) AM_WRITE(lamps_w)
229229   AM_RANGE(0x14, 0x14) AM_DEVREADWRITE("crtc", mc6845_device, register_r, register_w)
230   AM_RANGE(0x17, 0x17) AM_DEVWRITE_LEGACY("ay8910", ay8910_data_w)
230   AM_RANGE(0x17, 0x17) AM_DEVWRITE("ay8910", ay8910_device, data_w)
231231   AM_RANGE(0x24, 0x24) AM_WRITE(banksel_w)
232   AM_RANGE(0x27, 0x27) AM_DEVREAD_LEGACY("ay8910", ay8910_r)
233   AM_RANGE(0x37, 0x37) AM_DEVWRITE_LEGACY("ay8910", ay8910_address_w)
232   AM_RANGE(0x27, 0x27) AM_DEVREAD("ay8910", ay8910_device, data_r)
233   AM_RANGE(0x37, 0x37) AM_DEVWRITE("ay8910", ay8910_device, address_w)
234234ADDRESS_MAP_END
235235
236236/*
trunk/src/mame/drivers/astrocde.c
r22781r22782
686686   ADDRESS_MAP_GLOBAL_MASK(0xff)
687687   AM_RANGE(0x90, 0x93) AM_DEVREADWRITE("ctc", z80ctc_device, read, write)
688688   AM_RANGE(0x97, 0x97) AM_READ(soundlatch_byte_r)
689   AM_RANGE(0x98, 0x98) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w)
690   AM_RANGE(0x98, 0x98) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
691   AM_RANGE(0x9a, 0x9a) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_w)
689   AM_RANGE(0x98, 0x98) AM_DEVWRITE("aysnd", ay8910_device, address_w)
690   AM_RANGE(0x98, 0x98) AM_DEVREAD("aysnd", ay8910_device, data_r)
691   AM_RANGE(0x9a, 0x9a) AM_DEVWRITE("aysnd", ay8910_device, data_w)
692692ADDRESS_MAP_END
693693
694694
trunk/src/mame/drivers/megazone.c
r22781r22782
111111
112112static ADDRESS_MAP_START( megazone_sound_io_map, AS_IO, 8, megazone_state )
113113   ADDRESS_MAP_GLOBAL_MASK(0xff)
114   AM_RANGE(0x00, 0x00) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w)
115   AM_RANGE(0x00, 0x02) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
116   AM_RANGE(0x02, 0x02) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_w)
114   AM_RANGE(0x00, 0x00) AM_DEVWRITE("aysnd", ay8910_device, address_w)
115   AM_RANGE(0x00, 0x02) AM_DEVREAD("aysnd", ay8910_device, data_r)
116   AM_RANGE(0x02, 0x02) AM_DEVWRITE("aysnd", ay8910_device, data_w)
117117ADDRESS_MAP_END
118118
119119static ADDRESS_MAP_START( megazone_i8039_map, AS_PROGRAM, 8, megazone_state )
trunk/src/mame/drivers/sbowling.c
r22781r22782
220220static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, sbowling_state )
221221   AM_RANGE(0x0000, 0x2fff) AM_ROM
222222   AM_RANGE(0x8000, 0xbfff) AM_RAM_WRITE(sbw_videoram_w) AM_SHARE("videoram")
223   AM_RANGE(0xf800, 0xf801) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
224   AM_RANGE(0xf801, 0xf801) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
223   AM_RANGE(0xf800, 0xf801) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
224   AM_RANGE(0xf801, 0xf801) AM_DEVREAD("aysnd", ay8910_device, data_r)
225225   AM_RANGE(0xfc00, 0xffff) AM_RAM
226226ADDRESS_MAP_END
227227
trunk/src/mame/drivers/kncljoe.c
r22781r22782
6868
6969WRITE8_MEMBER(kncljoe_state::m6803_port2_w)
7070{
71   device_t *device = machine().device("aysnd");
71   ay8910_device *ay8910 = machine().device<ay8910_device>("aysnd");
7272
7373   /* write latch */
7474   if ((m_port2 & 0x01) && !(data & 0x01))
7575   {
7676      /* control or data port? */
7777      if (m_port2 & 0x08)
78         ay8910_data_address_w(device, space, m_port2 >> 2, m_port1);
78         ay8910->data_address_w(space, m_port2 >> 2, m_port1);
7979   }
8080   m_port2 = data;
8181}
8282
8383READ8_MEMBER(kncljoe_state::m6803_port1_r)
8484{
85   device_t *device = machine().device("aysnd");
85   ay8910_device *ay8910 = machine().device<ay8910_device>("aysnd");
8686
8787   if (m_port2 & 0x08)
88      return ay8910_r(device, space, 0);
88      return ay8910->data_r(space, 0);
8989   return 0xff;
9090}
9191
trunk/src/mame/drivers/deco_ld.c
r22781r22782
305305
306306static ADDRESS_MAP_START( rblaster_sound_map, AS_PROGRAM, 8, deco_ld_state )
307307   AM_RANGE(0x0000, 0x01ff) AM_RAM
308   AM_RANGE(0x2000, 0x2000) AM_DEVWRITE_LEGACY("ay1", ay8910_data_w)
309   AM_RANGE(0x4000, 0x4000) AM_DEVWRITE_LEGACY("ay1", ay8910_address_w)
310   AM_RANGE(0x6000, 0x6000) AM_DEVWRITE_LEGACY("ay2", ay8910_data_w)
311   AM_RANGE(0x8000, 0x8000) AM_DEVWRITE_LEGACY("ay2", ay8910_address_w)
308   AM_RANGE(0x2000, 0x2000) AM_DEVWRITE("ay1", ay8910_device, data_w)
309   AM_RANGE(0x4000, 0x4000) AM_DEVWRITE("ay1", ay8910_device, address_w)
310   AM_RANGE(0x6000, 0x6000) AM_DEVWRITE("ay2", ay8910_device, data_w)
311   AM_RANGE(0x8000, 0x8000) AM_DEVWRITE("ay2", ay8910_device, address_w)
312312   AM_RANGE(0xa000, 0xa000) AM_READWRITE(soundlatch_byte_r,soundlatch2_byte_w)
313313   AM_RANGE(0xe000, 0xffff) AM_ROM
314314ADDRESS_MAP_END
trunk/src/mame/drivers/nemesis.c
r22781r22782
396396   AM_RANGE(0xe001, 0xe001) AM_READ(soundlatch_byte_r)
397397   AM_RANGE(0xe003, 0xe003) AM_DEVWRITE("k005289", k005289_device, k005289_keylatch_A_w)
398398   AM_RANGE(0xe004, 0xe004) AM_DEVWRITE("k005289", k005289_device, k005289_keylatch_B_w)
399   AM_RANGE(0xe005, 0xe005) AM_DEVWRITE_LEGACY("ay2", ay8910_address_w)
400   AM_RANGE(0xe006, 0xe006) AM_DEVWRITE_LEGACY("ay1", ay8910_address_w)
401   AM_RANGE(0xe086, 0xe086) AM_DEVREAD_LEGACY("ay1", ay8910_r)
402   AM_RANGE(0xe106, 0xe106) AM_DEVWRITE_LEGACY("ay1", ay8910_data_w)
403   AM_RANGE(0xe205, 0xe205) AM_DEVREAD_LEGACY("ay2", ay8910_r)
404   AM_RANGE(0xe405, 0xe405) AM_DEVWRITE_LEGACY("ay2", ay8910_data_w)
399   AM_RANGE(0xe005, 0xe005) AM_DEVWRITE("ay2", ay8910_device, address_w)
400   AM_RANGE(0xe006, 0xe006) AM_DEVWRITE("ay1", ay8910_device, address_w)
401   AM_RANGE(0xe086, 0xe086) AM_DEVREAD("ay1", ay8910_device, data_r)
402   AM_RANGE(0xe106, 0xe106) AM_DEVWRITE("ay1", ay8910_device, data_w)
403   AM_RANGE(0xe205, 0xe205) AM_DEVREAD("ay2", ay8910_device, data_r)
404   AM_RANGE(0xe405, 0xe405) AM_DEVWRITE("ay2", ay8910_device, data_w)
405405ADDRESS_MAP_END
406406
407407static ADDRESS_MAP_START( gx400_sound_map, AS_PROGRAM, 8, nemesis_state )
r22781r22782
413413   AM_RANGE(0xe001, 0xe001) AM_READ(soundlatch_byte_r)
414414   AM_RANGE(0xe003, 0xe003) AM_DEVWRITE("k005289", k005289_device, k005289_keylatch_A_w)
415415   AM_RANGE(0xe004, 0xe004) AM_DEVWRITE("k005289", k005289_device, k005289_keylatch_B_w)
416   AM_RANGE(0xe005, 0xe005) AM_DEVWRITE_LEGACY("ay2", ay8910_address_w)
417   AM_RANGE(0xe006, 0xe006) AM_DEVWRITE_LEGACY("ay1", ay8910_address_w)
416   AM_RANGE(0xe005, 0xe005) AM_DEVWRITE("ay2", ay8910_device, address_w)
417   AM_RANGE(0xe006, 0xe006) AM_DEVWRITE("ay1", ay8910_device, address_w)
418418   AM_RANGE(0xe030, 0xe030) AM_WRITE(gx400_speech_start_w)
419   AM_RANGE(0xe086, 0xe086) AM_DEVREAD_LEGACY("ay1", ay8910_r)
420   AM_RANGE(0xe106, 0xe106) AM_DEVWRITE_LEGACY("ay1", ay8910_data_w)
421   AM_RANGE(0xe205, 0xe205) AM_DEVREAD_LEGACY("ay2", ay8910_r)
422   AM_RANGE(0xe405, 0xe405) AM_DEVWRITE_LEGACY("ay2", ay8910_data_w)
419   AM_RANGE(0xe086, 0xe086) AM_DEVREAD("ay1", ay8910_device, data_r)
420   AM_RANGE(0xe106, 0xe106) AM_DEVWRITE("ay1", ay8910_device, data_w)
421   AM_RANGE(0xe205, 0xe205) AM_DEVREAD("ay2", ay8910_device, data_r)
422   AM_RANGE(0xe405, 0xe405) AM_DEVWRITE("ay2", ay8910_device, data_w)
423423ADDRESS_MAP_END
424424
425425/******************************************************************************/
trunk/src/mame/drivers/rollrace.c
r22781r22782
6363   AM_RANGE(0x0000, 0x0fff) AM_ROM
6464   AM_RANGE(0x2000, 0x2fff) AM_RAM
6565   AM_RANGE(0x3000, 0x3000) AM_READ(soundlatch_byte_r) AM_WRITE(sound_nmi_mask_w)
66   AM_RANGE(0x4000, 0x4001) AM_DEVWRITE_LEGACY("ay1", ay8910_address_data_w)
67   AM_RANGE(0x5000, 0x5001) AM_DEVWRITE_LEGACY("ay2", ay8910_address_data_w)
68   AM_RANGE(0x6000, 0x6001) AM_DEVWRITE_LEGACY("ay3", ay8910_address_data_w)
66   AM_RANGE(0x4000, 0x4001) AM_DEVWRITE("ay1", ay8910_device, address_data_w)
67   AM_RANGE(0x5000, 0x5001) AM_DEVWRITE("ay2", ay8910_device, address_data_w)
68   AM_RANGE(0x6000, 0x6001) AM_DEVWRITE("ay3", ay8910_device, address_data_w)
6969ADDRESS_MAP_END
7070
7171
trunk/src/mame/drivers/ladyfrog.c
r22781r22782
149149   AM_RANGE(0x0000, 0xbfff) AM_ROM
150150   AM_RANGE(0xc000, 0xc7ff) AM_RAM
151151   AM_RANGE(0xc800, 0xc801) AM_WRITENOP
152   AM_RANGE(0xc802, 0xc803) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
152   AM_RANGE(0xc802, 0xc803) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
153153   AM_RANGE(0xc900, 0xc90d) AM_DEVWRITE_LEGACY("msm", msm5232_w)
154154   AM_RANGE(0xca00, 0xca00) AM_WRITENOP
155155   AM_RANGE(0xcb00, 0xcb00) AM_WRITENOP
trunk/src/mame/drivers/progolf.c
r22781r22782
267267
268268static ADDRESS_MAP_START( sound_cpu, AS_PROGRAM, 8, progolf_state )
269269   AM_RANGE(0x0000, 0x0fff) AM_RAM
270   AM_RANGE(0x4000, 0x4fff) AM_DEVREADWRITE_LEGACY("ay1", ay8910_r, ay8910_data_w)
271   AM_RANGE(0x5000, 0x5fff) AM_DEVWRITE_LEGACY("ay1", ay8910_address_w)
272   AM_RANGE(0x6000, 0x6fff) AM_DEVREADWRITE_LEGACY("ay2", ay8910_r, ay8910_data_w)
273   AM_RANGE(0x7000, 0x7fff) AM_DEVWRITE_LEGACY("ay2", ay8910_address_w)
270   AM_RANGE(0x4000, 0x4fff) AM_DEVREADWRITE("ay1", ay8910_device, data_r, data_w)
271   AM_RANGE(0x5000, 0x5fff) AM_DEVWRITE("ay1", ay8910_device, address_w)
272   AM_RANGE(0x6000, 0x6fff) AM_DEVREADWRITE("ay2", ay8910_device, data_r, data_w)
273   AM_RANGE(0x7000, 0x7fff) AM_DEVWRITE("ay2", ay8910_device, address_w)
274274   AM_RANGE(0x8000, 0x8fff) AM_READ(audio_command_r) AM_WRITENOP //volume control?
275275   AM_RANGE(0xf000, 0xffff) AM_ROM
276276ADDRESS_MAP_END
trunk/src/mame/drivers/scregg.c
r22781r22782
9898   AM_RANGE(0x4001, 0x4001) AM_READ_PORT("DSW2") AM_WRITE(btime_video_control_w)
9999   AM_RANGE(0x4002, 0x4002) AM_READ_PORT("P1")
100100   AM_RANGE(0x4003, 0x4003) AM_READ_PORT("P2")
101   AM_RANGE(0x4004, 0x4005) AM_DEVWRITE_LEGACY("ay1", ay8910_address_data_w) AM_READ(scregg_irqack_r)
102   AM_RANGE(0x4006, 0x4007) AM_DEVWRITE_LEGACY("ay2", ay8910_address_data_w)
101   AM_RANGE(0x4004, 0x4005) AM_DEVWRITE("ay1", ay8910_device, address_data_w) AM_READ(scregg_irqack_r)
102   AM_RANGE(0x4006, 0x4007) AM_DEVWRITE("ay2", ay8910_device, address_data_w)
103103   AM_RANGE(0xa000, 0xffff) AM_ROM
104104ADDRESS_MAP_END
105105
r22781r22782
114114   AM_RANGE(0x2001, 0x2001) AM_READ_PORT("DSW2") AM_WRITE(scregg_irqack_w)
115115   AM_RANGE(0x2002, 0x2002) AM_READ_PORT("P1")
116116   AM_RANGE(0x2003, 0x2003) AM_READ_PORT("P2")
117   AM_RANGE(0x2004, 0x2005) AM_DEVWRITE_LEGACY("ay1", ay8910_address_data_w) AM_READ(scregg_irqack_r)
118   AM_RANGE(0x2006, 0x2007) AM_DEVWRITE_LEGACY("ay2", ay8910_address_data_w)
117   AM_RANGE(0x2004, 0x2005) AM_DEVWRITE("ay1", ay8910_device, address_data_w) AM_READ(scregg_irqack_r)
118   AM_RANGE(0x2006, 0x2007) AM_DEVWRITE("ay2", ay8910_device, address_data_w)
119119   AM_RANGE(0x3000, 0x7fff) AM_ROM
120120   AM_RANGE(0xf000, 0xffff) AM_ROM    /* reset/interrupt vectors */
121121ADDRESS_MAP_END
trunk/src/mame/drivers/bfmsys85.c
r22781r22782
394394   AM_RANGE(0x2A01, 0x2A01) AM_READWRITE(mux_ctrl_r,mux_ctrl_w)// mux status register
395395   AM_RANGE(0x2E00, 0x2E00) AM_READ(irqlatch_r)        // irq latch ( MC6850 / timer )
396396
397   AM_RANGE(0x3000, 0x3000) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_w)
397   AM_RANGE(0x3000, 0x3000) AM_DEVWRITE("aysnd", ay8910_device, data_w)
398398   AM_RANGE(0x3001, 0x3001) AM_READNOP //sound latch
399   AM_RANGE(0x3200, 0x3200) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w)
399   AM_RANGE(0x3200, 0x3200) AM_DEVWRITE("aysnd", ay8910_device, address_w)
400400
401401   AM_RANGE(0x3402, 0x3402) AM_DEVWRITE("acia6850_0", acia6850_device, control_write)
402402   AM_RANGE(0x3403, 0x3403) AM_DEVWRITE("acia6850_0", acia6850_device, data_write)
trunk/src/mame/drivers/kingobox.c
r22781r22782
9191static ADDRESS_MAP_START( kingobox_sound_io_map, AS_IO, 8, kingofb_state )
9292   ADDRESS_MAP_GLOBAL_MASK(0xff)
9393   AM_RANGE(0x00, 0x00) AM_DEVWRITE("dac", dac_device, write_unsigned8)
94   AM_RANGE(0x08, 0x08) AM_DEVREADWRITE_LEGACY("aysnd", ay8910_r, ay8910_data_w)
95   AM_RANGE(0x0c, 0x0c) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w)
94   AM_RANGE(0x08, 0x08) AM_DEVREADWRITE("aysnd", ay8910_device, data_r, data_w)
95   AM_RANGE(0x0c, 0x0c) AM_DEVWRITE("aysnd", ay8910_device, address_w)
9696ADDRESS_MAP_END
9797
9898/* Ring King */
r22781r22782
136136static ADDRESS_MAP_START( ringking_sound_io_map, AS_IO, 8, kingofb_state )
137137   ADDRESS_MAP_GLOBAL_MASK(0xff)
138138   AM_RANGE(0x00, 0x00) AM_DEVWRITE("dac", dac_device, write_unsigned8)
139   AM_RANGE(0x02, 0x02) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
140   AM_RANGE(0x02, 0x03) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_address_w)
139   AM_RANGE(0x02, 0x02) AM_DEVREAD("aysnd", ay8910_device, data_r)
140   AM_RANGE(0x02, 0x03) AM_DEVWRITE("aysnd", ay8910_device, data_address_w)
141141ADDRESS_MAP_END
142142
143143
trunk/src/mame/drivers/tsamurai.c
r22781r22782
175175
176176static ADDRESS_MAP_START( z80_io_map, AS_IO, 8, tsamurai_state )
177177   ADDRESS_MAP_GLOBAL_MASK(0xff)
178   AM_RANGE(0x00, 0x01) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
178   AM_RANGE(0x00, 0x01) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
179179ADDRESS_MAP_END
180180
181181static ADDRESS_MAP_START( z80_m660_io_map, AS_IO, 8, tsamurai_state )
r22781r22782
187187
188188static ADDRESS_MAP_START( vsgongf_audio_io_map, AS_IO, 8, tsamurai_state )
189189   ADDRESS_MAP_GLOBAL_MASK(0xff)
190   AM_RANGE(0x00, 0x01) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
190   AM_RANGE(0x00, 0x01) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
191191ADDRESS_MAP_END
192192
193193READ8_MEMBER(tsamurai_state::sound_command1_r)
r22781r22782
256256
257257static ADDRESS_MAP_START( sound3_m660_io_map, AS_IO, 8, tsamurai_state )
258258   ADDRESS_MAP_GLOBAL_MASK(0xff)
259   AM_RANGE(0x00, 0x01) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
259   AM_RANGE(0x00, 0x01) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
260260ADDRESS_MAP_END
261261
262262/*******************************************************************************/
trunk/src/mame/drivers/ettrivia.c
r22781r22782
120120      /* special case to return the value written to 0xb000 */
121121      /* does it reset the chips too ? */
122122      case 0: break;
123      case 0xc4: m_b000_ret = ay8910_r(machine().device("ay1"), space, 0);    break;
124      case 0x94: m_b000_ret = ay8910_r(machine().device("ay2"), space, 0);    break;
125      case 0x86: m_b000_ret = ay8910_r(machine().device("ay3"), space, 0);    break;
123      case 0xc4: m_b000_ret = machine().device<ay8910_device>("ay1")->data_r(space, 0);    break;
124      case 0x94: m_b000_ret = machine().device<ay8910_device>("ay2")->data_r(space, 0);    break;
125      case 0x86: m_b000_ret = machine().device<ay8910_device>("ay3")->data_r(space, 0);    break;
126126
127127      case 0x80:
128128         switch(m_b800_prev)
129129         {
130            case 0xe0: ay8910_address_w(machine().device("ay1"),space,0,m_b000_val);    break;
131            case 0x98: ay8910_address_w(machine().device("ay2"),space,0,m_b000_val);    break;
132            case 0x83: ay8910_address_w(machine().device("ay3"),space,0,m_b000_val);    break;
130            case 0xe0: machine().device<ay8910_device>("ay1")->address_w(space,0,m_b000_val);    break;
131            case 0x98: machine().device<ay8910_device>("ay2")->address_w(space,0,m_b000_val);    break;
132            case 0x83: machine().device<ay8910_device>("ay3")->address_w(space,0,m_b000_val);    break;
133133
134            case 0xa0: ay8910_data_w(machine().device("ay1"),space,0,m_b000_val);   break;
135            case 0x88: ay8910_data_w(machine().device("ay2"),space,0,m_b000_val);   break;
136            case 0x81: ay8910_data_w(machine().device("ay3"),space,0,m_b000_val);   break;
134            case 0xa0: machine().device<ay8910_device>("ay1")->data_w(space,0,m_b000_val);   break;
135            case 0x88: machine().device<ay8910_device>("ay2")->data_w(space,0,m_b000_val);   break;
136            case 0x81: machine().device<ay8910_device>("ay3")->data_w(space,0,m_b000_val);   break;
137137
138138         }
139139      break;
trunk/src/mame/drivers/supdrapo.c
r22781r22782
277277   AM_RANGE(0x8006, 0x8006) AM_READ_PORT("SW2")
278278   AM_RANGE(0x9000, 0x90ff) AM_RAM AM_SHARE("nvram")
279279   AM_RANGE(0x9400, 0x9400) AM_READ(sdpoker_rng_r)
280   AM_RANGE(0x9800, 0x9801) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_address_w)
280   AM_RANGE(0x9800, 0x9801) AM_DEVWRITE("aysnd", ay8910_device, data_address_w)
281281ADDRESS_MAP_END
282282
283283
trunk/src/mame/drivers/kas89.c
r22781r22782
575575   ADDRESS_MAP_GLOBAL_MASK(0xff)
576576   AM_RANGE(0x00, 0x00) AM_WRITE(int_ack_w)    // comm out (1st Z80). seems to write here the value previously read through soundlatch (port 0x02).
577577   AM_RANGE(0x02, 0x02) AM_READ(soundlatch_byte_r)
578   AM_RANGE(0x04, 0x04) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
579   AM_RANGE(0x04, 0x05) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_address_w)
578   AM_RANGE(0x04, 0x04) AM_DEVREAD("aysnd", ay8910_device, data_r)
579   AM_RANGE(0x04, 0x05) AM_DEVWRITE("aysnd", ay8910_device, data_address_w)
580580ADDRESS_MAP_END
581581
582582
trunk/src/mame/drivers/aeroboto.c
r22781r22782
9191
9292static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, aeroboto_state )
9393   AM_RANGE(0x0000, 0x0fff) AM_RAM
94   AM_RANGE(0x9000, 0x9001) AM_DEVWRITE_LEGACY("ay1", ay8910_address_data_w)
95   AM_RANGE(0x9002, 0x9002) AM_DEVREAD_LEGACY("ay1", ay8910_r)
96   AM_RANGE(0xa000, 0xa001) AM_DEVWRITE_LEGACY("ay2", ay8910_address_data_w)
97   AM_RANGE(0xa002, 0xa002) AM_DEVREAD_LEGACY("ay2", ay8910_r)
94   AM_RANGE(0x9000, 0x9001) AM_DEVWRITE("ay1", ay8910_device, address_data_w)
95   AM_RANGE(0x9002, 0x9002) AM_DEVREAD("ay1", ay8910_device, data_r)
96   AM_RANGE(0xa000, 0xa001) AM_DEVWRITE("ay2", ay8910_device, address_data_w)
97   AM_RANGE(0xa002, 0xa002) AM_DEVREAD("ay2", ay8910_device, data_r)
9898   AM_RANGE(0xf000, 0xffff) AM_ROM
9999ADDRESS_MAP_END
100100
trunk/src/mame/drivers/madalien.c
r22781r22782
108108   AM_RANGE(0x0000, 0x03ff) AM_MIRROR(0x1c00) AM_RAM
109109   AM_RANGE(0x6000, 0x6003) AM_MIRROR(0x1ffc) AM_RAM /* unknown device in an epoxy block, might be tilt detection */
110110   AM_RANGE(0x8000, 0x8000) AM_MIRROR(0x1ffc) AM_READ(madalien_sound_command_r)
111   AM_RANGE(0x8000, 0x8001) AM_MIRROR(0x1ffc) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
111   AM_RANGE(0x8000, 0x8001) AM_MIRROR(0x1ffc) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
112112   AM_RANGE(0x8002, 0x8002) AM_MIRROR(0x1ffc) AM_WRITE(soundlatch2_byte_w)
113113   AM_RANGE(0xf800, 0xffff) AM_ROM
114114ADDRESS_MAP_END
trunk/src/mame/drivers/proconn.c
r22781r22782
3737
3838   optional_device<roc10937_t> m_vfd;
3939
40   DECLARE_WRITE8_MEMBER( ay_w0 ) { ay8910_address_data_w(m_ay, space, 0, data); }
41   DECLARE_WRITE8_MEMBER( ay_w1 ) { ay8910_address_data_w(m_ay, space, 1, data); }
40   DECLARE_WRITE8_MEMBER( ay_w0 ) { m_ay->address_data_w(space, 0, data); }
41   DECLARE_WRITE8_MEMBER( ay_w1 ) { m_ay->address_data_w(space, 1, data); }
4242
4343   DECLARE_WRITE8_MEMBER( ctc_w0 ) { m_z80ctc->write(space, 0, data); }
4444   DECLARE_WRITE8_MEMBER( ctc_w1 ) { m_z80ctc->write(space, 1, data); }
r22781r22782
7575   DECLARE_WRITE8_MEMBER( pio5_w2 ) { m_z80pio_5->write(space, 2, data); }
7676   DECLARE_WRITE8_MEMBER( pio5_w3 ) { m_z80pio_5->write(space, 3, data); }
7777
78   DECLARE_READ8_MEMBER( ay_r0 ) { return ay8910_r(m_ay, space, 0); }
78   DECLARE_READ8_MEMBER( ay_r0 ) { return m_ay->data_r(space, 0); }
7979
8080   DECLARE_READ8_MEMBER( ctc_r0 ) { return m_z80ctc->read(space, 0); }
8181   DECLARE_READ8_MEMBER( ctc_r1 ) { return m_z80ctc->read(space, 1); }
trunk/src/mame/drivers/flipjack.c
r22781r22782
315315static ADDRESS_MAP_START( flipjack_sound_map, AS_PROGRAM, 8, flipjack_state )
316316   AM_RANGE(0x0000, 0x1fff) AM_ROM
317317   AM_RANGE(0x2000, 0x27ff) AM_RAM
318   AM_RANGE(0x4000, 0x4000) AM_DEVREADWRITE_LEGACY("ay2", ay8910_r, ay8910_data_w)
319   AM_RANGE(0x6000, 0x6000) AM_DEVWRITE_LEGACY("ay2", ay8910_address_w)
320   AM_RANGE(0x8000, 0x8000) AM_DEVREADWRITE_LEGACY("ay1", ay8910_r, ay8910_data_w)
321   AM_RANGE(0xa000, 0xa000) AM_DEVWRITE_LEGACY("ay1", ay8910_address_w)
318   AM_RANGE(0x4000, 0x4000) AM_DEVREADWRITE("ay2", ay8910_device, data_r, data_w)
319   AM_RANGE(0x6000, 0x6000) AM_DEVWRITE("ay2", ay8910_device, address_w)
320   AM_RANGE(0x8000, 0x8000) AM_DEVREADWRITE("ay1", ay8910_device, data_r, data_w)
321   AM_RANGE(0xa000, 0xa000) AM_DEVWRITE("ay1", ay8910_device, address_w)
322322ADDRESS_MAP_END
323323
324324static ADDRESS_MAP_START( flipjack_sound_io_map, AS_IO, 8, flipjack_state )
r22781r22782
407407};
408408
409409
410static AY8910_INTERFACE( ay8910_config_1 )
410static const ay8910_interface ay8910_config_1 =
411411{
412412   AY8910_LEGACY_OUTPUT,                   /* Flags */
413413   AY8910_DEFAULT_LOADS,                   /* Load on channel in ohms */
r22781r22782
417417   DEVCB_NULL                              /* Port B write */
418418};
419419
420static AY8910_INTERFACE( ay8910_config_2 )
420static const ay8910_interface ay8910_config_2 =
421421{
422422   AY8910_LEGACY_OUTPUT,                   /* Flags */
423423   AY8910_DEFAULT_LOADS,                   /* Load on channel in ohms */
trunk/src/mame/drivers/nsm.c
r22781r22782
4949   AM_RANGE(0x0000, 0x7fff) AM_ROM
5050   AM_RANGE(0xe000, 0xefff) AM_RAM
5151   AM_RANGE(0xf000, 0xf0fb) AM_READ_LEGACY(tms9995_internal1_r)
52   AM_RANGE(0xffec, 0xffed) AM_DEVWRITE_LEGACY("ay1", ay8910_address_data_w)
53   AM_RANGE(0xffee, 0xffef) AM_DEVWRITE_LEGACY("ay2", ay8910_address_data_w)
52   AM_RANGE(0xffec, 0xffed) AM_DEVWRITE("ay1", ay8910_device, address_data_w)
53   AM_RANGE(0xffee, 0xffef) AM_DEVWRITE("ay2", ay8910_device, address_data_w)
5454   AM_RANGE(0xfffc, 0xffff) AM_READ_LEGACY(tms9995_internal2_r)
5555ADDRESS_MAP_END
5656
trunk/src/mame/drivers/pbaction.c
r22781r22782
110110
111111static ADDRESS_MAP_START( pbaction_sound_io_map, AS_IO, 8, pbaction_state )
112112   ADDRESS_MAP_GLOBAL_MASK(0xff)
113   AM_RANGE(0x10, 0x11) AM_DEVWRITE_LEGACY("ay1", ay8910_address_data_w)
114   AM_RANGE(0x20, 0x21) AM_DEVWRITE_LEGACY("ay2", ay8910_address_data_w)
115   AM_RANGE(0x30, 0x31) AM_DEVWRITE_LEGACY("ay3", ay8910_address_data_w)
113   AM_RANGE(0x10, 0x11) AM_DEVWRITE("ay1", ay8910_device, address_data_w)
114   AM_RANGE(0x20, 0x21) AM_DEVWRITE("ay2", ay8910_device, address_data_w)
115   AM_RANGE(0x30, 0x31) AM_DEVWRITE("ay3", ay8910_device, address_data_w)
116116ADDRESS_MAP_END
117117
118118
trunk/src/mame/drivers/funworld.c
r22781r22782
925925   AM_RANGE(0x0000, 0x07ff) AM_RAM AM_SHARE("nvram")
926926   AM_RANGE(0x0800, 0x0803) AM_DEVREADWRITE("pia0", pia6821_device, read, write)
927927   AM_RANGE(0x0a00, 0x0a03) AM_DEVREADWRITE("pia1", pia6821_device, read, write)
928   AM_RANGE(0x0c00, 0x0c00) AM_DEVREAD_LEGACY("ay8910", ay8910_r)
929   AM_RANGE(0x0c00, 0x0c01) AM_DEVWRITE_LEGACY("ay8910", ay8910_address_data_w)
928   AM_RANGE(0x0c00, 0x0c00) AM_DEVREAD("ay8910", ay8910_device, data_r)
929   AM_RANGE(0x0c00, 0x0c01) AM_DEVWRITE("ay8910", ay8910_device, address_data_w)
930930   AM_RANGE(0x0e00, 0x0e00) AM_DEVWRITE("crtc", mc6845_device, address_w)
931931   AM_RANGE(0x0e01, 0x0e01) AM_DEVREADWRITE("crtc", mc6845_device, register_r, register_w)
932932   AM_RANGE(0x2000, 0x2fff) AM_RAM_WRITE(funworld_videoram_w) AM_SHARE("videoram")
r22781r22782
959959   AM_RANGE(0x0000, 0x07ff) AM_RAM AM_SHARE("nvram")
960960   AM_RANGE(0x0800, 0x0803) AM_DEVREADWRITE("pia0", pia6821_device, read, write)
961961   AM_RANGE(0x0a00, 0x0a03) AM_DEVREADWRITE("pia1", pia6821_device, read, write)
962   AM_RANGE(0x0c00, 0x0c00) AM_DEVREAD_LEGACY("ay8910", ay8910_r)
963   AM_RANGE(0x0c00, 0x0c01) AM_DEVWRITE_LEGACY("ay8910", ay8910_address_data_w)
962   AM_RANGE(0x0c00, 0x0c00) AM_DEVREAD("ay8910", ay8910_device, data_r)
963   AM_RANGE(0x0c00, 0x0c01) AM_DEVWRITE("ay8910", ay8910_device, address_data_w)
964964   AM_RANGE(0x0e00, 0x0e00) AM_DEVWRITE("crtc", mc6845_device, address_w)
965965   AM_RANGE(0x0e01, 0x0e01) AM_DEVREADWRITE("crtc", mc6845_device, register_r, register_w)
966966
r22781r22782
977977   AM_RANGE(0x0000, 0x07ff) AM_RAM AM_SHARE("nvram")
978978   AM_RANGE(0x0800, 0x0803) AM_DEVREADWRITE("pia0", pia6821_device, read, write)
979979   AM_RANGE(0x0a00, 0x0a03) AM_DEVREADWRITE("pia1", pia6821_device, read, write)
980   AM_RANGE(0x0c00, 0x0c00) AM_DEVREAD_LEGACY("ay8910", ay8910_r)
981   AM_RANGE(0x0c00, 0x0c01) AM_DEVWRITE_LEGACY("ay8910", ay8910_address_data_w)
980   AM_RANGE(0x0c00, 0x0c00) AM_DEVREAD("ay8910", ay8910_device, data_r)
981   AM_RANGE(0x0c00, 0x0c01) AM_DEVWRITE("ay8910", ay8910_device, address_data_w)
982982   AM_RANGE(0x0e00, 0x0e00) AM_DEVWRITE("crtc", mc6845_device, address_w)
983983   AM_RANGE(0x0e01, 0x0e01) AM_DEVREADWRITE("crtc", mc6845_device, register_r, register_w)
984984   AM_RANGE(0x2c00, 0x2cff) AM_RAM /* range for protection */
r22781r22782
993993   AM_RANGE(0x0000, 0x07ff) AM_RAM AM_SHARE("nvram")
994994   AM_RANGE(0x0800, 0x0803) AM_DEVREADWRITE("pia0", pia6821_device, read, write)
995995   AM_RANGE(0x0a00, 0x0a03) AM_DEVREADWRITE("pia1", pia6821_device, read, write)
996   AM_RANGE(0x0c00, 0x0c00) AM_DEVREAD_LEGACY("ay8910", ay8910_r)
997   AM_RANGE(0x0c00, 0x0c01) AM_DEVWRITE_LEGACY("ay8910", ay8910_address_data_w)
996   AM_RANGE(0x0c00, 0x0c00) AM_DEVREAD("ay8910", ay8910_device, data_r)
997   AM_RANGE(0x0c00, 0x0c01) AM_DEVWRITE("ay8910", ay8910_device, address_data_w)
998998   AM_RANGE(0x0e00, 0x0e00) AM_DEVWRITE("crtc", mc6845_device, address_w)
999999   AM_RANGE(0x0e01, 0x0e01) AM_DEVREADWRITE("crtc", mc6845_device, register_r, register_w)
10001000   AM_RANGE(0x2000, 0x2000) AM_READNOP /* some unknown reads */
r22781r22782
10111011   AM_RANGE(0x081c, 0x081c) AM_DEVWRITE("crtc", mc6845_device, address_w)
10121012   AM_RANGE(0x081d, 0x081d) AM_DEVREADWRITE("crtc", mc6845_device, register_r, register_w)
10131013   AM_RANGE(0x1000, 0x1000) AM_READ_PORT("IN2")
1014   AM_RANGE(0x1800, 0x1800) AM_DEVREAD_LEGACY("ay8910", ay8910_r)
1015   AM_RANGE(0x1800, 0x1801) AM_DEVWRITE_LEGACY("ay8910", ay8910_address_data_w)
1014   AM_RANGE(0x1800, 0x1800) AM_DEVREAD("ay8910", ay8910_device, data_r)
1015   AM_RANGE(0x1800, 0x1801) AM_DEVWRITE("ay8910", ay8910_device, address_data_w)
10161016//  AM_RANGE(0x2000, 0x2000) AM_READNOP /* some unknown reads... maybe a DSW */
10171017   AM_RANGE(0x6000, 0x6fff) AM_RAM_WRITE(funworld_videoram_w) AM_SHARE("videoram")
10181018   AM_RANGE(0x7000, 0x7fff) AM_RAM_WRITE(funworld_colorram_w) AM_SHARE("colorram")
r22781r22782
10361036   AM_RANGE(0x0000, 0x07ff) AM_RAM AM_SHARE("nvram")
10371037   AM_RANGE(0x0800, 0x0803) AM_DEVREADWRITE("pia0", pia6821_device, read, write)
10381038   AM_RANGE(0x0a00, 0x0a03) AM_DEVREADWRITE("pia1", pia6821_device, read, write)
1039   AM_RANGE(0x0c00, 0x0c00) AM_DEVREAD_LEGACY("ay8910", ay8910_r)
1040   AM_RANGE(0x0c00, 0x0c01) AM_DEVWRITE_LEGACY("ay8910", ay8910_address_data_w)
1039   AM_RANGE(0x0c00, 0x0c00) AM_DEVREAD("ay8910", ay8910_device, data_r)
1040   AM_RANGE(0x0c00, 0x0c01) AM_DEVWRITE("ay8910", ay8910_device, address_data_w)
10411041   AM_RANGE(0x0e00, 0x0e00) AM_DEVWRITE("crtc", mc6845_device, address_w)
10421042   AM_RANGE(0x0e01, 0x0e01) AM_DEVREADWRITE("crtc", mc6845_device, register_r, register_w)
10431043   AM_RANGE(0x4000, 0x4fff) AM_RAM_WRITE(funworld_videoram_w) AM_SHARE("videoram")
trunk/src/mame/drivers/wiz.c
r22781r22782
258258   AM_RANGE(0x0000, 0x1fff) AM_ROM
259259   AM_RANGE(0x2000, 0x23ff) AM_RAM
260260   AM_RANGE(0x3000, 0x3000) AM_READ(soundlatch_byte_r) AM_WRITE(wiz_sound_nmi_mask_w)  /* Stinger/Scion */
261   AM_RANGE(0x4000, 0x4001) AM_DEVWRITE_LEGACY("8910.3", ay8910_address_data_w)
262   AM_RANGE(0x5000, 0x5001) AM_DEVWRITE_LEGACY("8910.1", ay8910_address_data_w)
263   AM_RANGE(0x6000, 0x6001) AM_DEVWRITE_LEGACY("8910.2", ay8910_address_data_w)        /* Wiz only */
261   AM_RANGE(0x4000, 0x4001) AM_DEVWRITE("8910.3", ay8910_device, address_data_w)
262   AM_RANGE(0x5000, 0x5001) AM_DEVWRITE("8910.1", ay8910_device, address_data_w)
263   AM_RANGE(0x6000, 0x6001) AM_DEVWRITE("8910.2", ay8910_device, address_data_w)        /* Wiz only */
264264   AM_RANGE(0x7000, 0x7000) AM_READ(soundlatch_byte_r) AM_WRITE(wiz_sound_nmi_mask_w)  /* Wiz */
265265ADDRESS_MAP_END
266266
r22781r22782
268268   AM_RANGE(0x0000, 0x1fff) AM_ROM
269269   AM_RANGE(0x2000, 0x23ff) AM_RAM
270270   AM_RANGE(0x3000, 0x3000) AM_READ(soundlatch_byte_r) AM_WRITE(wiz_sound_nmi_mask_w)  /* Stinger/Scion */
271   AM_RANGE(0x5000, 0x5001) AM_DEVWRITE_LEGACY("8910.1", ay8910_address_data_w)
272   AM_RANGE(0x6000, 0x6001) AM_DEVWRITE_LEGACY("8910.2", ay8910_address_data_w)        /* Wiz only */
271   AM_RANGE(0x5000, 0x5001) AM_DEVWRITE("8910.1", ay8910_device, address_data_w)
272   AM_RANGE(0x6000, 0x6001) AM_DEVWRITE("8910.2", ay8910_device, address_data_w)        /* Wiz only */
273273   AM_RANGE(0x7000, 0x7000) AM_READ(soundlatch_byte_r) AM_WRITE(wiz_sound_nmi_mask_w)  /* Wiz */
274274ADDRESS_MAP_END
275275
trunk/src/mame/drivers/lvcards.c
r22781r22782
168168
169169static ADDRESS_MAP_START( lvcards_io_map, AS_IO, 8, lvcards_state )
170170   ADDRESS_MAP_GLOBAL_MASK(0xff)
171   AM_RANGE(0x00, 0x00) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
172   AM_RANGE(0x00, 0x01) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_address_w)
171   AM_RANGE(0x00, 0x00) AM_DEVREAD("aysnd", ay8910_device, data_r)
172   AM_RANGE(0x00, 0x01) AM_DEVWRITE("aysnd", ay8910_device, data_address_w)
173173ADDRESS_MAP_END
174174
175175static ADDRESS_MAP_START( lvpoker_map, AS_PROGRAM, 8, lvcards_state )
trunk/src/mame/drivers/epos.c
r22781r22782
7979   ADDRESS_MAP_GLOBAL_MASK(0xff)
8080   AM_RANGE(0x00, 0x00) AM_READ_PORT("DSW") AM_WRITE(watchdog_reset_w)
8181   AM_RANGE(0x01, 0x01) AM_READ_PORT("SYSTEM") AM_WRITE(epos_port_1_w)
82   AM_RANGE(0x02, 0x02) AM_READ_PORT("INPUTS") AM_DEVWRITE_LEGACY("aysnd", ay8910_data_w)
82   AM_RANGE(0x02, 0x02) AM_READ_PORT("INPUTS") AM_DEVWRITE("aysnd", ay8910_device, data_w)
8383   AM_RANGE(0x03, 0x03) AM_READ_PORT("UNK")
84   AM_RANGE(0x06, 0x06) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w)
84   AM_RANGE(0x06, 0x06) AM_DEVWRITE("aysnd", ay8910_device, address_w)
8585ADDRESS_MAP_END
8686
8787static ADDRESS_MAP_START( dealer_io_map, AS_IO, 8, epos_state )
8888   ADDRESS_MAP_GLOBAL_MASK(0xff)
8989   AM_RANGE(0x10, 0x13) AM_DEVREADWRITE("ppi8255", i8255_device, read, write)
9090   AM_RANGE(0x20, 0x24) AM_WRITE(dealer_decrypt_rom)
91   AM_RANGE(0x34, 0x34) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_w)
91   AM_RANGE(0x34, 0x34) AM_DEVWRITE("aysnd", ay8910_device, data_w)
9292   AM_RANGE(0x38, 0x38) AM_READ_PORT("DSW")
93   AM_RANGE(0x3C, 0x3C) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w)
93   AM_RANGE(0x3C, 0x3C) AM_DEVWRITE("aysnd", ay8910_device, address_w)
9494   AM_RANGE(0x40, 0x40) AM_WRITE(watchdog_reset_w)
9595ADDRESS_MAP_END
9696
trunk/src/mame/drivers/cchance.c
r22781r22782
8989   AM_RANGE(0xf000, 0xf000) AM_READNOP AM_WRITENOP //???
9090   AM_RANGE(0xf001, 0xf001) AM_READ(input_1_r) AM_WRITE(output_0_w)
9191   AM_RANGE(0xf002, 0xf002) AM_READ_PORT("IN0") AM_WRITE(output_1_w)
92   AM_RANGE(0xf800, 0xf801) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
93   AM_RANGE(0xf801, 0xf801) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
92   AM_RANGE(0xf800, 0xf801) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
93   AM_RANGE(0xf801, 0xf801) AM_DEVREAD("aysnd", ay8910_device, data_r)
9494ADDRESS_MAP_END
9595
9696
trunk/src/mame/drivers/aztarac.c
r22781r22782
100100   AM_RANGE(0x0000, 0x1fff) AM_ROM
101101   AM_RANGE(0x8000, 0x87ff) AM_RAM
102102   AM_RANGE(0x8800, 0x8800) AM_READ(aztarac_snd_command_r)
103   AM_RANGE(0x8c00, 0x8c01) AM_DEVREADWRITE_LEGACY("ay1", ay8910_r, ay8910_data_address_w)
104   AM_RANGE(0x8c02, 0x8c03) AM_DEVREADWRITE_LEGACY("ay2", ay8910_r, ay8910_data_address_w)
105   AM_RANGE(0x8c04, 0x8c05) AM_DEVREADWRITE_LEGACY("ay3", ay8910_r, ay8910_data_address_w)
106   AM_RANGE(0x8c06, 0x8c07) AM_DEVREADWRITE_LEGACY("ay4", ay8910_r, ay8910_data_address_w)
103   AM_RANGE(0x8c00, 0x8c01) AM_DEVREADWRITE("ay1", ay8910_device, data_r, data_address_w)
104   AM_RANGE(0x8c02, 0x8c03) AM_DEVREADWRITE("ay2", ay8910_device, data_r, data_address_w)
105   AM_RANGE(0x8c04, 0x8c05) AM_DEVREADWRITE("ay3", ay8910_device, data_r, data_address_w)
106   AM_RANGE(0x8c06, 0x8c07) AM_DEVREADWRITE("ay4", ay8910_device, data_r, data_address_w)
107107   AM_RANGE(0x9000, 0x9000) AM_READWRITE(aztarac_snd_status_r, aztarac_snd_status_w)
108108ADDRESS_MAP_END
109109
trunk/src/mame/drivers/dwarfd.c
r22781r22782
614614
615615static ADDRESS_MAP_START( io_map, AS_IO, 8, dwarfd_state )
616616   ADDRESS_MAP_GLOBAL_MASK(0xff)
617   AM_RANGE(0x01, 0x01) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
618   AM_RANGE(0x02, 0x03) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_address_w)
617   AM_RANGE(0x01, 0x01) AM_DEVREAD("aysnd", ay8910_device, data_r)
618   AM_RANGE(0x02, 0x03) AM_DEVWRITE("aysnd", ay8910_device, data_address_w)
619619
620620   AM_RANGE(0x20, 0x20) AM_READWRITE(i8275_preg_r, i8275_preg_w)
621621   AM_RANGE(0x21, 0x21) AM_READWRITE(i8275_sreg_r, i8275_creg_w)
trunk/src/mame/drivers/omegrace.c
r22781r22782
385385static ADDRESS_MAP_START( sound_port, AS_IO, 8, omegrace_state )
386386   ADDRESS_MAP_GLOBAL_MASK(0xff)
387387   AM_RANGE(0x00, 0x00) AM_READ(soundlatch_byte_r) /* likely ay8910 input port, not direct */
388   AM_RANGE(0x00, 0x01) AM_DEVWRITE_LEGACY("ay1", ay8910_address_data_w)
389   AM_RANGE(0x02, 0x03) AM_DEVWRITE_LEGACY("ay2", ay8910_address_data_w)
388   AM_RANGE(0x00, 0x01) AM_DEVWRITE("ay1", ay8910_device, address_data_w)
389   AM_RANGE(0x02, 0x03) AM_DEVWRITE("ay2", ay8910_device, address_data_w)
390390ADDRESS_MAP_END
391391
392392
trunk/src/mame/drivers/caswin.c
r22781r22782
193193
194194static ADDRESS_MAP_START( vvillage_io, AS_IO, 8, caswin_state )
195195   ADDRESS_MAP_GLOBAL_MASK(0xff)
196   AM_RANGE(0x01,0x01) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
197   AM_RANGE(0x02,0x03) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_address_w)
196   AM_RANGE(0x01,0x01) AM_DEVREAD("aysnd", ay8910_device, data_r)
197   AM_RANGE(0x02,0x03) AM_DEVWRITE("aysnd", ay8910_device, data_address_w)
198198   AM_RANGE(0x10,0x10) AM_READ_PORT("IN0")
199199   AM_RANGE(0x11,0x11) AM_READ_PORT("IN1")
200200   AM_RANGE(0x10,0x10) AM_WRITE(vvillage_scroll_w)
trunk/src/mame/drivers/decocass.c
r22781r22782
113113   AM_RANGE(0x0000, 0x0fff) AM_RAM
114114   AM_RANGE(0x1000, 0x17ff) AM_READWRITE(decocass_sound_nmi_enable_r, decocass_sound_nmi_enable_w)
115115   AM_RANGE(0x1800, 0x1fff) AM_READWRITE(decocass_sound_data_ack_reset_r, decocass_sound_data_ack_reset_w)
116   AM_RANGE(0x2000, 0x2fff) AM_DEVWRITE_LEGACY("ay1", ay8910_data_w)
117   AM_RANGE(0x4000, 0x4fff) AM_DEVWRITE_LEGACY("ay1", ay8910_address_w)
118   AM_RANGE(0x6000, 0x6fff) AM_DEVWRITE_LEGACY("ay2", ay8910_data_w)
119   AM_RANGE(0x8000, 0x8fff) AM_DEVWRITE_LEGACY("ay2", ay8910_address_w)
116   AM_RANGE(0x2000, 0x2fff) AM_DEVWRITE("ay1", ay8910_device, data_w)
117   AM_RANGE(0x4000, 0x4fff) AM_DEVWRITE("ay1", ay8910_device, address_w)
118   AM_RANGE(0x6000, 0x6fff) AM_DEVWRITE("ay2", ay8910_device, data_w)
119   AM_RANGE(0x8000, 0x8fff) AM_DEVWRITE("ay2", ay8910_device, address_w)
120120   AM_RANGE(0xa000, 0xafff) AM_READ(decocass_sound_command_r)
121121   AM_RANGE(0xc000, 0xcfff) AM_WRITE(decocass_sound_data_w)
122122   AM_RANGE(0xf800, 0xffff) AM_ROM
trunk/src/mame/drivers/dominob.c
r22781r22782
175175   AM_RANGE(0x0000, 0xbfff) AM_ROM AM_WRITENOP // there are some garbage writes to ROM
176176   AM_RANGE(0xc000, 0xc7ff) AM_RAM
177177
178   AM_RANGE(0xd000, 0xd001) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
179   AM_RANGE(0xd001, 0xd001) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
178   AM_RANGE(0xd000, 0xd001) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
179   AM_RANGE(0xd001, 0xd001) AM_DEVREAD("aysnd", ay8910_device, data_r)
180180   AM_RANGE(0xd008, 0xd008) AM_WRITE(dominob_d008_w)
181181   AM_RANGE(0xd00c, 0xd00c) AM_READ_PORT("IN0")
182182   AM_RANGE(0xd010, 0xd010) AM_READ_PORT("IN1") AM_WRITENOP
trunk/src/mame/drivers/jollyjgr.c
r22781r22782
213213   AM_RANGE(0x8000, 0x87ff) AM_RAM
214214   AM_RANGE(0x8ff8, 0x8ff8) AM_READ_PORT("DSW1")
215215   AM_RANGE(0x8ff9, 0x8ff9) AM_READ_PORT("INPUTS")
216   AM_RANGE(0x8ff8, 0x8ff8) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w)
217   AM_RANGE(0x8ffa, 0x8ffa) AM_READ_PORT("SYSTEM") AM_DEVWRITE_LEGACY("aysnd", ay8910_data_w)
216   AM_RANGE(0x8ff8, 0x8ff8) AM_DEVWRITE("aysnd", ay8910_device, address_w)
217   AM_RANGE(0x8ffa, 0x8ffa) AM_READ_PORT("SYSTEM") AM_DEVWRITE("aysnd", ay8910_device, data_w)
218218   AM_RANGE(0x8ffc, 0x8ffc) AM_WRITE(jollyjgr_misc_w)
219219   AM_RANGE(0x8ffd, 0x8ffd) AM_WRITE(jollyjgr_coin_lookout_w)
220220   AM_RANGE(0x8fff, 0x8fff) AM_READ_PORT("DSW2")
r22781r22782
230230   AM_RANGE(0x8000, 0x87ff) AM_RAM
231231   AM_RANGE(0x8ff8, 0x8ff8) AM_READ_PORT("DSW1")
232232   AM_RANGE(0x8ff9, 0x8ff9) AM_READ_PORT("INPUTS")
233   AM_RANGE(0x8ff8, 0x8ff8) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w)
234   AM_RANGE(0x8ffa, 0x8ffa) AM_READ_PORT("SYSTEM") AM_DEVWRITE_LEGACY("aysnd", ay8910_data_w)
233   AM_RANGE(0x8ff8, 0x8ff8) AM_DEVWRITE("aysnd", ay8910_device, address_w)
234   AM_RANGE(0x8ffa, 0x8ffa) AM_READ_PORT("SYSTEM") AM_DEVWRITE("aysnd", ay8910_device, data_w)
235235   AM_RANGE(0x8ffc, 0x8ffc) AM_WRITE(jollyjgr_misc_w)
236236   AM_RANGE(0x8ffd, 0x8ffd) AM_WRITE(jollyjgr_coin_lookout_w)
237237   AM_RANGE(0x8fff, 0x8fff) AM_READ_PORT("DSW2")
trunk/src/mame/drivers/meritm.c
r22781r22782
686686   AM_RANGE(0x30, 0x33) AM_DEVREADWRITE("ppi8255", i8255_device, read, write)
687687   AM_RANGE(0x40, 0x43) AM_DEVREADWRITE("z80pio_0", z80pio_device, read, write)
688688   AM_RANGE(0x50, 0x53) AM_DEVREADWRITE("z80pio_1", z80pio_device, read, write)
689   AM_RANGE(0x80, 0x80) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
690   AM_RANGE(0x80, 0x81) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
689   AM_RANGE(0x80, 0x80) AM_DEVREAD("aysnd", ay8910_device, data_r)
690   AM_RANGE(0x80, 0x81) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
691691   AM_RANGE(0xff, 0xff) AM_WRITE(meritm_crt250_bank_w)
692692ADDRESS_MAP_END
693693
r22781r22782
699699   AM_RANGE(0x40, 0x43) AM_DEVREADWRITE("z80pio_0", z80pio_device, read, write)
700700   AM_RANGE(0x50, 0x53) AM_DEVREADWRITE("z80pio_1", z80pio_device, read, write)
701701   AM_RANGE(0x60, 0x67) AM_READWRITE_LEGACY(pc16552d_0_r,pc16552d_0_w)
702   AM_RANGE(0x80, 0x80) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
703   AM_RANGE(0x80, 0x81) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
702   AM_RANGE(0x80, 0x80) AM_DEVREAD("aysnd", ay8910_device, data_r)
703   AM_RANGE(0x80, 0x81) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
704704   AM_RANGE(0xff, 0xff) AM_WRITE(meritm_crt250_bank_w)
705705ADDRESS_MAP_END
706706
r22781r22782
720720   AM_RANGE(0x40, 0x43) AM_DEVREADWRITE("z80pio_0", z80pio_device, read, write)
721721   AM_RANGE(0x50, 0x53) AM_DEVREADWRITE("z80pio_1", z80pio_device, read, write)
722722   AM_RANGE(0x60, 0x67) AM_READWRITE_LEGACY(pc16552d_0_r,pc16552d_0_w)
723   AM_RANGE(0x80, 0x80) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
724   AM_RANGE(0x80, 0x81) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
723   AM_RANGE(0x80, 0x80) AM_DEVREAD("aysnd", ay8910_device, data_r)
724   AM_RANGE(0x80, 0x81) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
725725   AM_RANGE(0xff, 0xff) AM_WRITE(meritm_bank_w)
726726ADDRESS_MAP_END
727727
trunk/src/mame/drivers/dogfgt.c
r22781r22782
4545{
4646   /* bit 5 goes to 8910 #0 BDIR pin  */
4747   if ((m_last_snd_ctrl & 0x20) == 0x20 && (data & 0x20) == 0x00)
48      ay8910_data_address_w(machine().device("ay1"), space, m_last_snd_ctrl >> 4, m_soundlatch);
48      machine().device<ay8910_device>("ay1")->data_address_w(space, m_last_snd_ctrl >> 4, m_soundlatch);
4949
5050   /* bit 7 goes to 8910 #1 BDIR pin  */
5151   if ((m_last_snd_ctrl & 0x80) == 0x80 && (data & 0x80) == 0x00)
52      ay8910_data_address_w(machine().device("ay2"), space, m_last_snd_ctrl >> 6, m_soundlatch);
52      machine().device<ay8910_device>("ay2")->data_address_w(space, m_last_snd_ctrl >> 6, m_soundlatch);
5353
5454   m_last_snd_ctrl = data;
5555}
trunk/src/mame/drivers/msisaac.c
r22781r22782
257257static ADDRESS_MAP_START( msisaac_sound_map, AS_PROGRAM, 8, msisaac_state )
258258   AM_RANGE(0x0000, 0x3fff) AM_ROM
259259   AM_RANGE(0x4000, 0x47ff) AM_RAM
260   AM_RANGE(0x8000, 0x8001) AM_DEVWRITE_LEGACY("ay1", ay8910_address_data_w)
261   AM_RANGE(0x8002, 0x8003) AM_DEVWRITE_LEGACY("ay2", ay8910_address_data_w)
260   AM_RANGE(0x8000, 0x8001) AM_DEVWRITE("ay1", ay8910_device, address_data_w)
261   AM_RANGE(0x8002, 0x8003) AM_DEVWRITE("ay2", ay8910_device, address_data_w)
262262   AM_RANGE(0x8010, 0x801d) AM_DEVWRITE_LEGACY("msm", msm5232_w)
263263   AM_RANGE(0x8020, 0x8020) AM_WRITE(sound_control_0_w)
264264   AM_RANGE(0x8030, 0x8030) AM_WRITE(sound_control_1_w)
trunk/src/mame/drivers/kangaroo.c
r22781r22782
271271   AM_RANGE(0x0000, 0x0fff) AM_ROM
272272   AM_RANGE(0x4000, 0x43ff) AM_MIRROR(0x0c00) AM_RAM
273273   AM_RANGE(0x6000, 0x6000) AM_MIRROR(0x0fff) AM_READ(soundlatch_byte_r)
274   AM_RANGE(0x7000, 0x7000) AM_MIRROR(0x0fff) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_w)
275   AM_RANGE(0x8000, 0x8000) AM_MIRROR(0x0fff) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w)
274   AM_RANGE(0x7000, 0x7000) AM_MIRROR(0x0fff) AM_DEVWRITE("aysnd", ay8910_device, data_w)
275   AM_RANGE(0x8000, 0x8000) AM_MIRROR(0x0fff) AM_DEVWRITE("aysnd", ay8910_device, address_w)
276276ADDRESS_MAP_END
277277
278278
r22781r22782
281281   AM_RANGE(0x0000, 0x0fff) AM_ROM
282282   AM_RANGE(0x4000, 0x43ff) AM_MIRROR(0x0c00) AM_RAM
283283   AM_RANGE(0x6000, 0x6000) AM_MIRROR(0x0fff) AM_READ(soundlatch_byte_r)
284   AM_RANGE(0x7000, 0x7000) AM_MIRROR(0x0fff) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_w)
285   AM_RANGE(0x8000, 0x8000) AM_MIRROR(0x0fff) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w)
284   AM_RANGE(0x7000, 0x7000) AM_MIRROR(0x0fff) AM_DEVWRITE("aysnd", ay8910_device, data_w)
285   AM_RANGE(0x8000, 0x8000) AM_MIRROR(0x0fff) AM_DEVWRITE("aysnd", ay8910_device, address_w)
286286ADDRESS_MAP_END
287287
288288
trunk/src/mame/drivers/hotblock.c
r22781r22782
135135static ADDRESS_MAP_START( hotblock_io, AS_IO, 8, hotblock_state )
136136   AM_RANGE(0x0000, 0x0000) AM_WRITE(hotblock_port0_w)
137137   AM_RANGE(0x0004, 0x0004) AM_READWRITE(hotblock_port4_r, hotblock_port4_w)
138   AM_RANGE(0x8000, 0x8001) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
139   AM_RANGE(0x8001, 0x8001) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
138   AM_RANGE(0x8000, 0x8001) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
139   AM_RANGE(0x8001, 0x8001) AM_DEVREAD("aysnd", ay8910_device, data_r)
140140ADDRESS_MAP_END
141141
142142
trunk/src/mame/drivers/crgolf.c
r22781r22782
278278static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, crgolf_state )
279279   AM_RANGE(0x0000, 0x7fff) AM_ROM
280280   AM_RANGE(0x8000, 0x87ff) AM_RAM
281   AM_RANGE(0xc000, 0xc001) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
281   AM_RANGE(0xc000, 0xc001) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
282282   AM_RANGE(0xc002, 0xc002) AM_WRITENOP
283283   AM_RANGE(0xe000, 0xe000) AM_READWRITE(switch_input_r, switch_input_select_w)
284284   AM_RANGE(0xe001, 0xe001) AM_READWRITE(analog_input_r, unknown_w)
trunk/src/mame/drivers/equites.c
r22781r22782
741741   AM_RANGE(0x0000, 0xbfff) AM_ROM
742742   AM_RANGE(0xc000, 0xc000) AM_READ(soundlatch_byte_r)
743743   AM_RANGE(0xc080, 0xc08d) AM_DEVWRITE_LEGACY("msm", msm5232_w)
744   AM_RANGE(0xc0a0, 0xc0a1) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_address_w)
744   AM_RANGE(0xc0a0, 0xc0a1) AM_DEVWRITE("aysnd", ay8910_device, data_address_w)
745745   AM_RANGE(0xc0b0, 0xc0b0) AM_WRITENOP // n.c.
746746   AM_RANGE(0xc0c0, 0xc0c0) AM_WRITE(equites_cymbal_ctrl_w)
747747   AM_RANGE(0xc0d0, 0xc0d0) AM_WRITE(equites_dac_latch_w)  // followed by 1 (and usually 0) on 8155 port B
trunk/src/mame/drivers/albazc.c
r22781r22782
170170   AM_RANGE(0xb000, 0xb000) AM_WRITENOP    // ??? always 0x40
171171   AM_RANGE(0xc000, 0xc3ff) AM_RAM         // main ram
172172   AM_RANGE(0xc400, 0xc4ff) AM_RAM         // ???
173   AM_RANGE(0xd000, 0xd000) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
174   AM_RANGE(0xd000, 0xd001) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
173   AM_RANGE(0xd000, 0xd000) AM_DEVREAD("aysnd", ay8910_device, data_r)
174   AM_RANGE(0xd000, 0xd001) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
175175   AM_RANGE(0xe000, 0xe000) AM_READ_PORT("IN0") AM_WRITE(hanaroku_out_0_w)
176176   AM_RANGE(0xe001, 0xe001) AM_READ_PORT("IN1")
177177   AM_RANGE(0xe002, 0xe002) AM_READ_PORT("IN2") AM_WRITE(hanaroku_out_1_w)
trunk/src/mame/drivers/ddayjlc.c
r22781r22782
280280static ADDRESS_MAP_START( sound_cpu, AS_PROGRAM, 8, ddayjlc_state )
281281   AM_RANGE(0x0000, 0x1fff) AM_ROM
282282   AM_RANGE(0x2000, 0x23ff) AM_RAM
283   AM_RANGE(0x3000, 0x3000) AM_DEVREADWRITE_LEGACY("ay1", ay8910_r, ay8910_data_w)
284   AM_RANGE(0x4000, 0x4000) AM_DEVWRITE_LEGACY("ay1", ay8910_address_w)
285   AM_RANGE(0x5000, 0x5000) AM_DEVREADWRITE_LEGACY("ay2", ay8910_r, ay8910_data_w)
286   AM_RANGE(0x6000, 0x6000) AM_DEVWRITE_LEGACY("ay2", ay8910_address_w)
283   AM_RANGE(0x3000, 0x3000) AM_DEVREADWRITE("ay1", ay8910_device, data_r, data_w)
284   AM_RANGE(0x4000, 0x4000) AM_DEVWRITE("ay1", ay8910_device, address_w)
285   AM_RANGE(0x5000, 0x5000) AM_DEVREADWRITE("ay2", ay8910_device, data_r, data_w)
286   AM_RANGE(0x6000, 0x6000) AM_DEVWRITE("ay2", ay8910_device, address_w)
287287   AM_RANGE(0x7000, 0x7000) AM_WRITE(sound_nmi_w)
288288ADDRESS_MAP_END
289289
trunk/src/mame/drivers/champbas.c
r22781r22782
221221static ADDRESS_MAP_START( talbot_map, AS_PROGRAM, 8, champbas_state )
222222   AM_RANGE(0x0000, 0x5fff) AM_ROM
223223   AM_RANGE(0x6000, 0x63ff) AM_RAM AM_SHARE("share1") /* MCU shared RAM */
224   AM_RANGE(0x7000, 0x7001) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_address_w)
224   AM_RANGE(0x7000, 0x7001) AM_DEVWRITE("aysnd", ay8910_device, data_address_w)
225225   AM_RANGE(0x8000, 0x87ff) AM_RAM_WRITE(champbas_bg_videoram_w) AM_SHARE("bg_videoram")
226226   AM_RANGE(0x8800, 0x8fef) AM_RAM
227227   AM_RANGE(0x8ff0, 0x8fff) AM_RAM AM_SHARE("spriteram")
r22781r22782
248248static ADDRESS_MAP_START( champbas_main_map, AS_PROGRAM, 8, champbas_state )
249249   AM_RANGE(0x0000, 0x5fff) AM_ROM
250250   AM_RANGE(0x6000, 0x63ff) AM_RAM AM_SHARE("share1")
251   AM_RANGE(0x7000, 0x7001) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_address_w)
251   AM_RANGE(0x7000, 0x7001) AM_DEVWRITE("aysnd", ay8910_device, data_address_w)
252252   AM_RANGE(0x7800, 0x7fff) AM_ROM // champbb2 only
253253   AM_RANGE(0x8000, 0x87ff) AM_RAM_WRITE(champbas_bg_videoram_w) AM_SHARE("bg_videoram")
254254   AM_RANGE(0x8800, 0x8fef) AM_RAM
r22781r22782
280280static ADDRESS_MAP_START( exctsccrb_main_map, AS_PROGRAM, 8, champbas_state )
281281   AM_RANGE(0x0000, 0x5fff) AM_ROM
282282//  AM_RANGE(0x6000, 0x63ff) AM_RAM AM_SHARE("share1") // MCU not used (though it's present on the board)
283   AM_RANGE(0x7000, 0x7001) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_address_w)
283   AM_RANGE(0x7000, 0x7001) AM_DEVWRITE("aysnd", ay8910_device, data_address_w)
284284//  AM_RANGE(0x7800, 0x7fff) AM_ROM // champbb2 only
285285   AM_RANGE(0x8000, 0x87ff) AM_RAM_WRITE(champbas_bg_videoram_w) AM_SHARE("bg_videoram")
286286   AM_RANGE(0x8800, 0x8fff) AM_RAM AM_SHARE("spriteram_2") /* ??? */
r22781r22782
351351
352352static ADDRESS_MAP_START( exctsccr_sound_io_map, AS_IO, 8, champbas_state )
353353   ADDRESS_MAP_GLOBAL_MASK( 0x00ff )
354   AM_RANGE(0x82, 0x83) AM_DEVWRITE_LEGACY("ay1", ay8910_data_address_w)
355   AM_RANGE(0x86, 0x87) AM_DEVWRITE_LEGACY("ay2", ay8910_data_address_w)
356   AM_RANGE(0x8a, 0x8b) AM_DEVWRITE_LEGACY("ay3", ay8910_data_address_w)
357   AM_RANGE(0x8e, 0x8f) AM_DEVWRITE_LEGACY("ay4", ay8910_data_address_w)
354   AM_RANGE(0x82, 0x83) AM_DEVWRITE("ay1", ay8910_device, data_address_w)
355   AM_RANGE(0x86, 0x87) AM_DEVWRITE("ay2", ay8910_device, data_address_w)
356   AM_RANGE(0x8a, 0x8b) AM_DEVWRITE("ay3", ay8910_device, data_address_w)
357   AM_RANGE(0x8e, 0x8f) AM_DEVWRITE("ay4", ay8910_device, data_address_w)
358358ADDRESS_MAP_END
359359
360360
trunk/src/mame/drivers/gluck2.c
r22781r22782
346346   AM_RANGE(0x3500, 0x3500) AM_READ_PORT("IN1")
347347   AM_RANGE(0x3600, 0x3600) AM_READ_PORT("IN2")
348348   AM_RANGE(0x3700, 0x3700) AM_WRITE(counters_w )
349   AM_RANGE(0x3d00, 0x3d01) AM_DEVREADWRITE_LEGACY("ay8910", ay8910_r, ay8910_address_data_w)
349   AM_RANGE(0x3d00, 0x3d01) AM_DEVREADWRITE("ay8910", ay8910_device, data_r, address_data_w)
350350   AM_RANGE(0x4000, 0xffff) AM_ROM
351351ADDRESS_MAP_END
352352
trunk/src/mame/drivers/arkanoid.c
r22781r22782
557557static ADDRESS_MAP_START( arkanoid_map, AS_PROGRAM, 8, arkanoid_state )
558558   AM_RANGE(0x0000, 0xbfff) AM_ROM
559559   AM_RANGE(0xc000, 0xc7ff) AM_RAM
560   AM_RANGE(0xd000, 0xd001) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
561   AM_RANGE(0xd001, 0xd001) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
560   AM_RANGE(0xd000, 0xd001) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
561   AM_RANGE(0xd001, 0xd001) AM_DEVREAD("aysnd", ay8910_device, data_r)
562562   AM_RANGE(0xd008, 0xd008) AM_WRITE(arkanoid_d008_w)  /* gfx bank, flip screen etc. */
563563   AM_RANGE(0xd00c, 0xd00c) AM_READ_PORT("SYSTEM")     /* 2 bits from the 68705 */
564564   AM_RANGE(0xd010, 0xd010) AM_READ_PORT("BUTTONS") AM_WRITE(watchdog_reset_w)
r22781r22782
572572static ADDRESS_MAP_START( bootleg_map, AS_PROGRAM, 8, arkanoid_state )
573573   AM_RANGE(0x0000, 0xbfff) AM_ROM
574574   AM_RANGE(0xc000, 0xc7ff) AM_RAM
575   AM_RANGE(0xd000, 0xd000) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w)
576   AM_RANGE(0xd001, 0xd001) AM_DEVREADWRITE_LEGACY("aysnd", ay8910_r, ay8910_data_w)
575   AM_RANGE(0xd000, 0xd000) AM_DEVWRITE("aysnd", ay8910_device, address_w)
576   AM_RANGE(0xd001, 0xd001) AM_DEVREADWRITE("aysnd", ay8910_device, data_r, data_w)
577577   AM_RANGE(0xd008, 0xd008) AM_WRITE(arkanoid_d008_w)  /* gfx bank, flip screen etc. */
578578   AM_RANGE(0xd00c, 0xd00c) AM_READ_PORT("SYSTEM")
579579   AM_RANGE(0xd010, 0xd010) AM_READ_PORT("BUTTONS") AM_WRITE(watchdog_reset_w)
r22781r22782
588588   AM_RANGE(0x0000, 0x7fff) AM_ROM
589589   AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1")
590590   AM_RANGE(0xc000, 0xc7ff) AM_RAM
591   AM_RANGE(0xd001, 0xd001) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
592   AM_RANGE(0xd000, 0xd001) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
591   AM_RANGE(0xd001, 0xd001) AM_DEVREAD("aysnd", ay8910_device, data_r)
592   AM_RANGE(0xd000, 0xd001) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
593593   AM_RANGE(0xd008, 0xd008) AM_WRITE(hexa_d008_w)
594594   AM_RANGE(0xd010, 0xd010) AM_WRITE(watchdog_reset_w) /* or IRQ acknowledge, or both */
595595   AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(arkanoid_videoram_w) AM_SHARE("videoram")
r22781r22782
598598static ADDRESS_MAP_START( brixian_map, AS_PROGRAM, 8, arkanoid_state )
599599   AM_RANGE(0x0000, 0xbfff) AM_ROM
600600   AM_RANGE(0xc000, 0xc7ff) AM_RAM AM_SHARE("protram")
601   AM_RANGE(0xd000, 0xd000) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w)
602   AM_RANGE(0xd001, 0xd001) AM_DEVREADWRITE_LEGACY("aysnd", ay8910_r, ay8910_data_w)
601   AM_RANGE(0xd000, 0xd000) AM_DEVWRITE("aysnd", ay8910_device, address_w)
602   AM_RANGE(0xd001, 0xd001) AM_DEVREADWRITE("aysnd", ay8910_device, data_r, data_w)
603603   AM_RANGE(0xd008, 0xd008) AM_WRITE(brixian_d008_w)  /* gfx bank, flip screen etc. */
604604   AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(arkanoid_videoram_w) AM_SHARE("videoram")
605605   AM_RANGE(0xe800, 0xe83f) AM_RAM AM_SHARE("spriteram")
trunk/src/mame/drivers/kchamp.c
r22781r22782
130130
131131static ADDRESS_MAP_START( kchampvs_sound_io_map, AS_IO, 8, kchamp_state )
132132   ADDRESS_MAP_GLOBAL_MASK(0xff)
133   AM_RANGE(0x00, 0x01) AM_DEVWRITE_LEGACY("ay1", ay8910_data_address_w)
133   AM_RANGE(0x00, 0x01) AM_DEVWRITE("ay1", ay8910_device, data_address_w)
134134   AM_RANGE(0x01, 0x01) AM_READ(soundlatch_byte_r)
135   AM_RANGE(0x02, 0x03) AM_DEVWRITE_LEGACY("ay2", ay8910_data_address_w)
135   AM_RANGE(0x02, 0x03) AM_DEVWRITE("ay2", ay8910_device, data_address_w)
136136   AM_RANGE(0x04, 0x04) AM_WRITE(sound_msm_w)
137137   AM_RANGE(0x05, 0x05) AM_WRITE(sound_control_w)
138138ADDRESS_MAP_END
r22781r22782
181181
182182static ADDRESS_MAP_START( kchamp_sound_io_map, AS_IO, 8, kchamp_state )
183183   ADDRESS_MAP_GLOBAL_MASK(0xff)
184   AM_RANGE(0x00, 0x01) AM_DEVWRITE_LEGACY("ay1", ay8910_data_address_w)
185   AM_RANGE(0x02, 0x03) AM_DEVWRITE_LEGACY("ay2", ay8910_data_address_w)
184   AM_RANGE(0x00, 0x01) AM_DEVWRITE("ay1", ay8910_device, data_address_w)
185   AM_RANGE(0x02, 0x03) AM_DEVWRITE("ay2", ay8910_device, data_address_w)
186186   AM_RANGE(0x04, 0x04) AM_DEVWRITE("dac", dac_device, write_unsigned8)
187187   AM_RANGE(0x05, 0x05) AM_WRITE(kc_sound_control_w)
188188   AM_RANGE(0x06, 0x06) AM_READ(soundlatch_byte_r)
trunk/src/mame/drivers/slotcarn.c
r22781r22782
195195   AM_RANGE(0x7000, 0xafff) AM_ROM // spielbud
196196
197197
198   AM_RANGE(0xb000, 0xb000) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w)
199   AM_RANGE(0xb100, 0xb100) AM_DEVREADWRITE_LEGACY("aysnd", ay8910_r, ay8910_data_w)
198   AM_RANGE(0xb000, 0xb000) AM_DEVWRITE("aysnd", ay8910_device, address_w)
199   AM_RANGE(0xb100, 0xb100) AM_DEVREADWRITE("aysnd", ay8910_device, data_r, data_w)
200200
201201   AM_RANGE(0xb800, 0xb803) AM_DEVREADWRITE("ppi8255_0", i8255_device, read, write)    /* Input Ports */
202202   AM_RANGE(0xba00, 0xba03) AM_DEVREADWRITE("ppi8255_1", i8255_device, read, write)    /* Input Ports */
r22781r22782
217217
218218// spielbud - is the ay mirrored, or are there now 2?
219219static ADDRESS_MAP_START( spielbud_io_map, AS_IO, 8, slotcarn_state )
220   AM_RANGE(0xb000, 0xb000) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w)
221   AM_RANGE(0xb100, 0xb100) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_w)
220   AM_RANGE(0xb000, 0xb000) AM_DEVWRITE("aysnd", ay8910_device, address_w)
221   AM_RANGE(0xb100, 0xb100) AM_DEVWRITE("aysnd", ay8910_device, data_w)
222222ADDRESS_MAP_END
223223
224224/********************************
trunk/src/mame/drivers/solomon.c
r22781r22782
7474
7575static ADDRESS_MAP_START( sound_portmap, AS_IO, 8, solomon_state )
7676   ADDRESS_MAP_GLOBAL_MASK(0xff)
77   AM_RANGE(0x10, 0x11) AM_DEVWRITE_LEGACY("ay1", ay8910_address_data_w)
78   AM_RANGE(0x20, 0x21) AM_DEVWRITE_LEGACY("ay2", ay8910_address_data_w)
79   AM_RANGE(0x30, 0x31) AM_DEVWRITE_LEGACY("ay3", ay8910_address_data_w)
77   AM_RANGE(0x10, 0x11) AM_DEVWRITE("ay1", ay8910_device, address_data_w)
78   AM_RANGE(0x20, 0x21) AM_DEVWRITE("ay2", ay8910_device, address_data_w)
79   AM_RANGE(0x30, 0x31) AM_DEVWRITE("ay3", ay8910_device, address_data_w)
8080ADDRESS_MAP_END
8181
8282
trunk/src/mame/drivers/imolagp.c
r22781r22782
324324   AM_RANGE(0x2000, 0x23ff) AM_RAM
325325   AM_RANGE(0x2800, 0x2803) AM_DEVREADWRITE("ppi8255", i8255_device, read, write)
326326   AM_RANGE(0x3000, 0x3000) AM_WRITE(vreg_control_w)
327   AM_RANGE(0x37f0, 0x37f0) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w)
327   AM_RANGE(0x37f0, 0x37f0) AM_DEVWRITE("aysnd", ay8910_device, address_w)
328328//  AM_RANGE(0x37f7, 0x37f7) AM_NOP
329329   AM_RANGE(0x3800, 0x3800) AM_READWRITE(vreg_data_r, vreg_data_w)
330   AM_RANGE(0x3810, 0x3810) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_w)
330   AM_RANGE(0x3810, 0x3810) AM_DEVWRITE("aysnd", ay8910_device, data_w)
331331   AM_RANGE(0x4000, 0x4000) AM_READ_PORT("DSWA")
332332   AM_RANGE(0x47ff, 0x4800) AM_WRITE(transmit_data_w)
333333   AM_RANGE(0x5000, 0x50ff) AM_WRITE(imola_led_board_w)
trunk/src/mame/drivers/poker72.c
r22781r22782
117117   AM_RANGE(0xfe17, 0xfe17) AM_READNOP //irq ack
118118   AM_RANGE(0xfe20, 0xfe20) AM_WRITE(output_w) //output, irq enable?
119119   AM_RANGE(0xfe22, 0xfe22) AM_WRITE(tile_bank_w)
120   AM_RANGE(0xfe40, 0xfe40) AM_DEVREADWRITE_LEGACY("ay", ay8910_r, ay8910_data_w)
121   AM_RANGE(0xfe60, 0xfe60) AM_DEVWRITE_LEGACY("ay", ay8910_address_w)
120   AM_RANGE(0xfe40, 0xfe40) AM_DEVREADWRITE("ay", ay8910_device, data_r, data_w)
121   AM_RANGE(0xfe60, 0xfe60) AM_DEVWRITE("ay", ay8910_device, address_w)
122122ADDRESS_MAP_END
123123
124124
trunk/src/mame/drivers/cidelsa.c
r22781r22782
6464   switch (data)
6565   {
6666   case 0x01:
67      ay8910_data_w(m_psg, space, 0, m_psg_latch);
67      m_psg->data_w(space, 0, m_psg_latch);
6868      break;
6969
7070   case 0x02:
71      m_psg_latch = ay8910_r(m_psg, space, 0);
71      m_psg_latch = m_psg->data_r(space, 0);
7272      break;
7373
7474   case 0x03:
75      ay8910_address_w(m_psg, space, 0, m_psg_latch);
75      m_psg->address_w(space, 0, m_psg_latch);
7676      break;
7777   }
7878}
trunk/src/mame/drivers/royalmah.c
r22781r22782
549549
550550static ADDRESS_MAP_START( royalmah_iomap, AS_IO, 8, royalmah_state )
551551   ADDRESS_MAP_GLOBAL_MASK(0xff)
552   AM_RANGE( 0x01, 0x01 ) AM_DEVREAD_LEGACY("aysnd", ay8910_r )
553   AM_RANGE( 0x02, 0x03 ) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_address_w )
552   AM_RANGE( 0x01, 0x01 ) AM_DEVREAD("aysnd", ay8910_device, data_r)
553   AM_RANGE( 0x02, 0x03 ) AM_DEVWRITE("aysnd", ay8910_device, data_address_w)
554554   AM_RANGE( 0x10, 0x10 ) AM_READ_PORT("DSW1") AM_WRITE(royalmah_palbank_w )
555555   AM_RANGE( 0x11, 0x11 ) AM_READ_PORT("SYSTEM") AM_WRITE(input_port_select_w )
556556ADDRESS_MAP_END
557557
558558static ADDRESS_MAP_START( ippatsu_iomap, AS_IO, 8, royalmah_state )
559559   ADDRESS_MAP_GLOBAL_MASK(0xff)
560   AM_RANGE( 0x01, 0x01 ) AM_DEVREAD_LEGACY("aysnd", ay8910_r )
561   AM_RANGE( 0x02, 0x03 ) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_address_w )
560   AM_RANGE( 0x01, 0x01 ) AM_DEVREAD("aysnd", ay8910_device, data_r)
561   AM_RANGE( 0x02, 0x03 ) AM_DEVWRITE("aysnd", ay8910_device, data_address_w)
562562   AM_RANGE( 0x10, 0x10 ) AM_READ_PORT("DSW1") AM_WRITE(royalmah_palbank_w )
563563   AM_RANGE( 0x11, 0x11 ) AM_READ_PORT("SYSTEM") AM_WRITE(input_port_select_w )
564564   AM_RANGE( 0x12, 0x12 ) AM_READ_PORT("DSW2")
r22781r22782
567567
568568static ADDRESS_MAP_START( suzume_iomap, AS_IO, 8, royalmah_state )
569569   ADDRESS_MAP_GLOBAL_MASK(0xff)
570   AM_RANGE( 0x01, 0x01 ) AM_DEVREAD_LEGACY("aysnd", ay8910_r )
571   AM_RANGE( 0x02, 0x03 ) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_address_w )
570   AM_RANGE( 0x01, 0x01 ) AM_DEVREAD("aysnd", ay8910_device, data_r)
571   AM_RANGE( 0x02, 0x03 ) AM_DEVWRITE("aysnd", ay8910_device, data_address_w)
572572   AM_RANGE( 0x10, 0x10 ) AM_READ_PORT("DSW1") AM_WRITE(royalmah_palbank_w )
573573   AM_RANGE( 0x11, 0x11 ) AM_READ_PORT("SYSTEM") AM_WRITE(input_port_select_w )
574574   AM_RANGE( 0x80, 0x80 ) AM_READ(suzume_dsw_r )
r22781r22782
577577
578578static ADDRESS_MAP_START( dondenmj_iomap, AS_IO, 8, royalmah_state )
579579   ADDRESS_MAP_GLOBAL_MASK(0xff)
580   AM_RANGE( 0x01, 0x01 ) AM_DEVREAD_LEGACY("aysnd", ay8910_r )
581   AM_RANGE( 0x02, 0x03 ) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_address_w)
580   AM_RANGE( 0x01, 0x01 ) AM_DEVREAD("aysnd", ay8910_device, data_r)
581   AM_RANGE( 0x02, 0x03 ) AM_DEVWRITE("aysnd", ay8910_device, data_address_w)
582582   AM_RANGE( 0x10, 0x10 ) AM_READ_PORT("DSW1") AM_WRITE(royalmah_palbank_w )
583583   AM_RANGE( 0x11, 0x11 ) AM_READ_PORT("SYSTEM") AM_WRITE(input_port_select_w )
584584   AM_RANGE( 0x85, 0x85 ) AM_READ_PORT("DSW2") // DSW2
r22781r22782
588588
589589static ADDRESS_MAP_START( makaijan_iomap, AS_IO, 8, royalmah_state )
590590   ADDRESS_MAP_GLOBAL_MASK(0xff)
591   AM_RANGE( 0x01, 0x01 ) AM_DEVREAD_LEGACY("aysnd", ay8910_r )
592   AM_RANGE( 0x02, 0x03 ) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_address_w)
591   AM_RANGE( 0x01, 0x01 ) AM_DEVREAD("aysnd", ay8910_device, data_r)
592   AM_RANGE( 0x02, 0x03 ) AM_DEVWRITE("aysnd", ay8910_device, data_address_w)
593593   AM_RANGE( 0x10, 0x10 ) AM_READ_PORT("DSW1") AM_WRITE(royalmah_palbank_w )
594594   AM_RANGE( 0x11, 0x11 ) AM_READ_PORT("SYSTEM") AM_WRITE(input_port_select_w )
595595   AM_RANGE( 0x84, 0x84 ) AM_READ_PORT("DSW2") // DSW2
r22781r22782
599599
600600static ADDRESS_MAP_START( daisyari_iomap, AS_IO, 8, royalmah_state )
601601   ADDRESS_MAP_GLOBAL_MASK(0xff)
602   AM_RANGE( 0x01, 0x01 ) AM_DEVREAD_LEGACY("aysnd", ay8910_r )
603   AM_RANGE( 0x02, 0x03 ) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_address_w)
602   AM_RANGE( 0x01, 0x01 ) AM_DEVREAD("aysnd", ay8910_device, data_r)
603   AM_RANGE( 0x02, 0x03 ) AM_DEVWRITE("aysnd", ay8910_device, data_address_w)
604604   AM_RANGE( 0x10, 0x10 ) AM_WRITE(royalmah_palbank_w )
605605   AM_RANGE( 0x11, 0x11 ) AM_READ_PORT("SYSTEM") AM_WRITE(input_port_select_w )
606606   AM_RANGE( 0xc0, 0xc0 ) AM_READWRITE(daisyari_dsw_r, daisyari_bank_w )
r22781r22782
609609static ADDRESS_MAP_START( mjclub_iomap, AS_IO, 8, royalmah_state )
610610   ADDRESS_MAP_GLOBAL_MASK(0xff)
611611   AM_RANGE( 0x00, 0x00 ) AM_READWRITE(mjclub_dsw_r, mjclub_bank_w )
612   AM_RANGE( 0x01, 0x01 ) AM_DEVREAD_LEGACY("aysnd", ay8910_r )
613   AM_RANGE( 0x02, 0x03 ) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_address_w)
612   AM_RANGE( 0x01, 0x01 ) AM_DEVREAD("aysnd", ay8910_device, data_r)
613   AM_RANGE( 0x02, 0x03 ) AM_DEVWRITE("aysnd", ay8910_device, data_address_w)
614614   AM_RANGE( 0x10, 0x10 ) AM_READ_PORT("DSW1") AM_WRITE(royalmah_palbank_w )
615615   AM_RANGE( 0x11, 0x11 ) AM_READ_PORT("SYSTEM") AM_WRITE(input_port_select_w )
616616ADDRESS_MAP_END
617617
618618static ADDRESS_MAP_START( mjdiplob_iomap, AS_IO, 8, royalmah_state )
619619   ADDRESS_MAP_GLOBAL_MASK(0xff)
620   AM_RANGE( 0x01, 0x01 ) AM_DEVREAD_LEGACY("aysnd", ay8910_r )
621   AM_RANGE( 0x02, 0x03 ) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_address_w )
620   AM_RANGE( 0x01, 0x01 ) AM_DEVREAD("aysnd", ay8910_device, data_r)
621   AM_RANGE( 0x02, 0x03 ) AM_DEVWRITE("aysnd", ay8910_device, data_address_w)
622622   AM_RANGE( 0x10, 0x10 ) AM_READ_PORT("DSW1") AM_WRITE(royalmah_palbank_w )
623623   AM_RANGE( 0x11, 0x11 ) AM_READ_PORT("SYSTEM") AM_WRITE(input_port_select_w )
624624   AM_RANGE( 0x61, 0x61 ) AM_WRITE(tontonb_bank_w)
r22781r22782
628628
629629static ADDRESS_MAP_START( tontonb_iomap, AS_IO, 8, royalmah_state )
630630   ADDRESS_MAP_GLOBAL_MASK(0xff)
631   AM_RANGE( 0x01, 0x01 ) AM_DEVREAD_LEGACY("aysnd", ay8910_r )
632   AM_RANGE( 0x02, 0x03 ) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_address_w )
631   AM_RANGE( 0x01, 0x01 ) AM_DEVREAD("aysnd", ay8910_device, data_r)
632   AM_RANGE( 0x02, 0x03 ) AM_DEVWRITE("aysnd", ay8910_device, data_address_w)
633633   AM_RANGE( 0x10, 0x10 ) AM_READ_PORT("DSW1") AM_WRITE(royalmah_palbank_w )
634634   AM_RANGE( 0x11, 0x11 ) AM_READ_PORT("SYSTEM") AM_WRITE(input_port_select_w )
635635   AM_RANGE( 0x44, 0x44 ) AM_WRITE(tontonb_bank_w )
r22781r22782
639639
640640static ADDRESS_MAP_START( majs101b_iomap, AS_IO, 8, royalmah_state )
641641   ADDRESS_MAP_GLOBAL_MASK(0xff)
642   AM_RANGE( 0x01, 0x01 ) AM_DEVREAD_LEGACY("aysnd", ay8910_r )
643   AM_RANGE( 0x02, 0x03 ) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_address_w )
642   AM_RANGE( 0x01, 0x01 ) AM_DEVREAD("aysnd", ay8910_device, data_r)
643   AM_RANGE( 0x02, 0x03 ) AM_DEVWRITE("aysnd", ay8910_device, data_address_w)
644644   AM_RANGE( 0x10, 0x10 ) AM_READ_PORT("DSW1") AM_WRITE(royalmah_palbank_w )
645645   AM_RANGE( 0x11, 0x11 ) AM_READ_PORT("SYSTEM") AM_WRITE(input_port_select_w )
646646   AM_RANGE( 0x00, 0x00 ) AM_READWRITE(majs101b_dsw_r, dynax_bank_w )
r22781r22782
648648
649649static ADDRESS_MAP_START( mjderngr_iomap, AS_IO, 8, royalmah_state )
650650   ADDRESS_MAP_GLOBAL_MASK(0xff)
651   AM_RANGE( 0x01, 0x01 ) AM_DEVREAD_LEGACY("aysnd", ay8910_r )
652   AM_RANGE( 0x02, 0x03 ) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_address_w )
651   AM_RANGE( 0x01, 0x01 ) AM_DEVREAD("aysnd", ay8910_device, data_r)
652   AM_RANGE( 0x02, 0x03 ) AM_DEVWRITE("aysnd", ay8910_device, data_address_w)
653653//  AM_RANGE( 0x10, 0x10 ) AM_READ_PORT("DSW1")
654654   AM_RANGE( 0x10, 0x10 ) AM_WRITE(mjderngr_coin_w )   // palette bank is set separately
655655   AM_RANGE( 0x11, 0x11 ) AM_READ_PORT("SYSTEM") AM_WRITE(input_port_select_w )
r22781r22782
662662static ADDRESS_MAP_START( mjapinky_iomap, AS_IO, 8, royalmah_state )
663663   ADDRESS_MAP_GLOBAL_MASK(0xff)
664664   AM_RANGE( 0x00, 0x00 ) AM_WRITE(mjapinky_bank_w )
665   AM_RANGE( 0x01, 0x01 ) AM_DEVREAD_LEGACY("aysnd", ay8910_r )
666   AM_RANGE( 0x02, 0x03 ) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_address_w )
665   AM_RANGE( 0x01, 0x01 ) AM_DEVREAD("aysnd", ay8910_device, data_r)
666   AM_RANGE( 0x02, 0x03 ) AM_DEVWRITE("aysnd", ay8910_device, data_address_w)
667667   AM_RANGE( 0x04, 0x04 ) AM_READ_PORT("DSW2")
668668   AM_RANGE( 0x10, 0x10 ) AM_READ_PORT("DSW1") AM_WRITE(mjapinky_palbank_w )
669669   AM_RANGE( 0x11, 0x11 ) AM_READ_PORT("SYSTEM") AM_WRITE(input_port_select_w )
r22781r22782
871871   AM_RANGE( 0x20, 0x20 ) AM_READWRITE(janptr96_unknown_r, janptr96_rambank_w )
872872   AM_RANGE( 0x50, 0x50 ) AM_WRITE(mjderngr_palbank_w )
873873   AM_RANGE( 0x60, 0x6f ) AM_DEVREADWRITE("rtc", msm6242_device, read, write)
874   AM_RANGE( 0x81, 0x81 ) AM_DEVREAD_LEGACY("aysnd", ay8910_r )
875   AM_RANGE( 0x82, 0x83 ) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_address_w )
874   AM_RANGE( 0x81, 0x81 ) AM_DEVREAD("aysnd", ay8910_device, data_r)
875   AM_RANGE( 0x82, 0x83 ) AM_DEVWRITE("aysnd", ay8910_device, data_address_w)
876876   AM_RANGE( 0x93, 0x93 ) AM_WRITE(input_port_select_w )
877877   AM_RANGE( 0xd8, 0xd8 ) AM_WRITE(janptr96_coin_counter_w )
878878   AM_RANGE( 0xd9, 0xd9 ) AM_READ_PORT("SYSTEM")
r22781r22782
901901   {
902902      case 0x8000:    return ioport("DSW4")->read();      // dsw 4
903903      case 0x8200:    return ioport("DSW3")->read();      // dsw 3
904      case 0x9001:    return ay8910_r(machine().device("aysnd"), space, 0);   // inputs
904      case 0x9001:    return machine().device<ay8910_device>("aysnd")->data_r(space, 0);   // inputs
905905      case 0x9011:    return ioport("SYSTEM")->read();
906906   }
907907
r22781r22782
923923   switch(offset)
924924   {
925925      case 0x8e00:    m_palette_base = data & 0x1f;   return;
926      case 0x9002:    ay8910_data_w(machine().device("aysnd"),space,0,data);          return;
927      case 0x9003:    ay8910_address_w(machine().device("aysnd"),space,0,data);       return;
926      case 0x9002:    machine().device<ay8910_device>("aysnd")->data_w(space,0,data);          return;
927      case 0x9003:    machine().device<ay8910_device>("aysnd")->address_w(space,0,data);       return;
928928      case 0x9010:
929929         mjifb_coin_counter_w(space,0,data);
930930         return;
r22781r22782
10101010   {
10111011      case 0x8000:    return ioport("DSW2")->read();      // dsw 2
10121012      case 0x8001:    return ioport("DSW1")->read();      // dsw 1
1013      case 0x9001:    return ay8910_r(machine().device("aysnd"), space, 0);   // inputs
1013      case 0x9001:    return machine().device<ay8910_device>("aysnd")->data_r(space, 0);   // inputs
10141014      case 0x9011:    return ioport("SYSTEM")->read();
10151015   }
10161016
r22781r22782
10311031   switch(offset)
10321032   {
10331033      case 0x8802:    m_palette_base = data & 0x1f;                   return;
1034      case 0x9002:    ay8910_data_w(machine().device("aysnd"),space,0,data);      return;
1035      case 0x9003:    ay8910_address_w(machine().device("aysnd"),space,0,data);   return;
1034      case 0x9002:    machine().device<ay8910_device>("aysnd")->data_w(space,0,data);      return;
1035      case 0x9003:    machine().device<ay8910_device>("aysnd")->address_w(space,0,data);   return;
10361036      case 0x9010:    mjifb_coin_counter_w(space,0,data);     return;
10371037      case 0x9011:    input_port_select_w(space,0,data);      return;
10381038      case 0x9013:
r22781r22782
10781078static ADDRESS_MAP_START( mjtensin_map, AS_PROGRAM, 8, royalmah_state )
10791079   AM_RANGE( 0x0000, 0x5fff ) AM_ROM
10801080   AM_RANGE( 0x6000, 0x6fbf ) AM_RAM
1081   AM_RANGE( 0x6fc1, 0x6fc1 ) AM_DEVREAD_LEGACY("aysnd", ay8910_r )
1082   AM_RANGE( 0x6fc2, 0x6fc3 ) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_address_w )
1081   AM_RANGE( 0x6fc1, 0x6fc1 ) AM_DEVREAD("aysnd", ay8910_device, data_r)
1082   AM_RANGE( 0x6fc2, 0x6fc3 ) AM_DEVWRITE("aysnd", ay8910_device, data_address_w)
10831083   AM_RANGE( 0x6fd0, 0x6fd0 ) AM_WRITE(janptr96_coin_counter_w )
10841084   AM_RANGE( 0x6fd1, 0x6fd1 ) AM_READ_PORT("SYSTEM") AM_WRITE(input_port_select_w )
10851085   AM_RANGE( 0x6fe0, 0x6fef ) AM_DEVREADWRITE("rtc", msm6242_device, read, write)
r22781r22782
11461146static ADDRESS_MAP_START( cafetime_map, AS_PROGRAM, 8, royalmah_state )
11471147   AM_RANGE( 0x0000, 0x5fff ) AM_ROM
11481148   AM_RANGE( 0x6000, 0x7eff ) AM_RAM AM_SHARE("nvram")
1149   AM_RANGE( 0x7fc1, 0x7fc1 ) AM_DEVREAD_LEGACY("aysnd", ay8910_r )
1150   AM_RANGE( 0x7fc2, 0x7fc3 ) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_address_w )
1149   AM_RANGE( 0x7fc1, 0x7fc1 ) AM_DEVREAD("aysnd", ay8910_device, data_r)
1150   AM_RANGE( 0x7fc2, 0x7fc3 ) AM_DEVWRITE("aysnd", ay8910_device, data_address_w)
11511151   AM_RANGE( 0x7fd0, 0x7fd0 ) AM_WRITE(janptr96_coin_counter_w )
11521152   AM_RANGE( 0x7fd1, 0x7fd1 ) AM_READ_PORT("SYSTEM") AM_WRITENOP
11531153   AM_RANGE( 0x7fd3, 0x7fd3 ) AM_WRITE(input_port_select_w )
r22781r22782
12501250   AM_RANGE( 0x06000, 0x07fff ) AM_RAM AM_SHARE("nvram")
12511251   AM_RANGE( 0x08000, 0x0ffff ) AM_READWRITE(mjvegasa_rom_io_r, mjvegasa_rom_io_w) AM_SHARE("videoram")
12521252
1253   AM_RANGE( 0x10001, 0x10001 ) AM_DEVREAD_LEGACY("aysnd", ay8910_r )
1254   AM_RANGE( 0x10002, 0x10003 ) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_address_w )
1253   AM_RANGE( 0x10001, 0x10001 ) AM_DEVREAD("aysnd", ay8910_device, data_r)
1254   AM_RANGE( 0x10002, 0x10003 ) AM_DEVWRITE("aysnd", ay8910_device, data_address_w)
12551255   AM_RANGE( 0x10010, 0x10010 ) AM_WRITE(mjvegasa_coin_counter_w )
12561256   AM_RANGE( 0x10011, 0x10011 ) AM_READ_PORT("SYSTEM") AM_WRITE(input_port_select_w )
12571257   AM_RANGE( 0x10013, 0x10013 ) AM_WRITE(input_port_select_w )
trunk/src/mame/drivers/marineb.c
r22781r22782
8787
8888static ADDRESS_MAP_START( marineb_io_map, AS_IO, 8, marineb_state )
8989   ADDRESS_MAP_GLOBAL_MASK(0xff)
90   AM_RANGE(0x08, 0x09) AM_DEVWRITE_LEGACY("ay1", ay8910_address_data_w)
90   AM_RANGE(0x08, 0x09) AM_DEVWRITE("ay1", ay8910_device, address_data_w)
9191ADDRESS_MAP_END
9292
9393static ADDRESS_MAP_START( wanted_io_map, AS_IO, 8, marineb_state )
9494   ADDRESS_MAP_GLOBAL_MASK(0xff)
95   AM_RANGE(0x00, 0x01) AM_DEVWRITE_LEGACY("ay1", ay8910_address_data_w)
96   AM_RANGE(0x02, 0x03) AM_DEVWRITE_LEGACY("ay2", ay8910_address_data_w)
95   AM_RANGE(0x00, 0x01) AM_DEVWRITE("ay1", ay8910_device, address_data_w)
96   AM_RANGE(0x02, 0x03) AM_DEVWRITE("ay2", ay8910_device, address_data_w)
9797ADDRESS_MAP_END
9898
9999
trunk/src/mame/drivers/miniboy7.c
r22781r22782
280280   AM_RANGE(0x2600, 0x27ff) AM_RAM
281281   AM_RANGE(0x2800, 0x2800) AM_DEVWRITE("crtc", mc6845_device, address_w)
282282   AM_RANGE(0x2801, 0x2801) AM_DEVREADWRITE("crtc", mc6845_device, register_r, register_w)
283   AM_RANGE(0x3000, 0x3001) AM_DEVREADWRITE_LEGACY("ay8910", ay8910_r, ay8910_address_data_w)  // FIXME
283   AM_RANGE(0x3000, 0x3001) AM_DEVREADWRITE("ay8910", ay8910_device, data_r, address_data_w)  // FIXME
284284   AM_RANGE(0x3080, 0x3083) AM_DEVREADWRITE("pia0", pia6821_device, read, write)
285285   AM_RANGE(0x3800, 0x3800) AM_READNOP // R (right after each read, another value is loaded to the ACCU, so it lacks of sense)
286286   AM_RANGE(0x4000, 0xffff) AM_ROM
trunk/src/mame/drivers/nycaptor.c
r22781r22782
380380static ADDRESS_MAP_START( nycaptor_sound_map, AS_PROGRAM, 8, nycaptor_state )
381381   AM_RANGE(0x0000, 0xbfff) AM_ROM
382382   AM_RANGE(0xc000, 0xc7ff) AM_RAM
383   AM_RANGE(0xc800, 0xc801) AM_DEVWRITE_LEGACY("ay1", ay8910_address_data_w)
384   AM_RANGE(0xc802, 0xc803) AM_DEVWRITE_LEGACY("ay2", ay8910_address_data_w)
383   AM_RANGE(0xc800, 0xc801) AM_DEVWRITE("ay1", ay8910_device, address_data_w)
384   AM_RANGE(0xc802, 0xc803) AM_DEVWRITE("ay2", ay8910_device, address_data_w)
385385   AM_RANGE(0xc900, 0xc90d) AM_DEVWRITE_LEGACY("msm", msm5232_w)
386386   AM_RANGE(0xca00, 0xca00) AM_WRITENOP
387387   AM_RANGE(0xcb00, 0xcb00) AM_WRITENOP
trunk/src/mame/drivers/ssozumo.c
r22781r22782
4848/* Same as Tag Team */
4949static ADDRESS_MAP_START( ssozumo_sound_map, AS_PROGRAM, 8, ssozumo_state )
5050   AM_RANGE(0x0000, 0x01ff) AM_RAM
51   AM_RANGE(0x2000, 0x2001) AM_DEVWRITE_LEGACY("ay1", ay8910_data_address_w)
52   AM_RANGE(0x2002, 0x2003) AM_DEVWRITE_LEGACY("ay2", ay8910_data_address_w)
51   AM_RANGE(0x2000, 0x2001) AM_DEVWRITE("ay1", ay8910_device, data_address_w)
52   AM_RANGE(0x2002, 0x2003) AM_DEVWRITE("ay2", ay8910_device, data_address_w)
5353   AM_RANGE(0x2004, 0x2004) AM_DEVWRITE("dac", dac_device, write_signed8)
5454   AM_RANGE(0x2005, 0x2005) AM_WRITE(sound_nmi_mask_w)
5555   AM_RANGE(0x2007, 0x2007) AM_READ(soundlatch_byte_r)
trunk/src/mame/drivers/kurukuru.c
r22781r22782
368368   AM_RANGE(0x90, 0x90) AM_MIRROR(0x0f) AM_WRITE(kurukuru_bankswitch_w)
369369   AM_RANGE(0xa0, 0xa0) AM_MIRROR(0x0f) AM_READ_PORT("IN0")
370370   AM_RANGE(0xb0, 0xb0) AM_MIRROR(0x0f) AM_READ_PORT("IN1")
371   AM_RANGE(0xc0, 0xc0) AM_MIRROR(0x0f) AM_DEVREADWRITE_LEGACY("ym2149", ay8910_r, ay8910_address_w)
372   AM_RANGE(0xd0, 0xd0) AM_MIRROR(0x0f) AM_DEVWRITE_LEGACY("ym2149", ay8910_data_w)
371   AM_RANGE(0xc0, 0xc0) AM_MIRROR(0x0f) AM_DEVREADWRITE("ym2149", ay8910_device, data_r, address_w)
372   AM_RANGE(0xd0, 0xd0) AM_MIRROR(0x0f) AM_DEVWRITE("ym2149", ay8910_device, data_w)
373373ADDRESS_MAP_END
374374
375375
trunk/src/mame/drivers/coinmstr.c
r22781r22782
225225   ADDRESS_MAP_GLOBAL_MASK(0xff)
226226   AM_RANGE(0x00, 0x00) AM_READ(question_r)
227227   AM_RANGE(0x00, 0x03) AM_WRITE(question_w)
228   AM_RANGE(0x40, 0x41) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
229   AM_RANGE(0x41, 0x41) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
228   AM_RANGE(0x40, 0x41) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
229   AM_RANGE(0x41, 0x41) AM_DEVREAD("aysnd", ay8910_device, data_r)
230230   AM_RANGE(0x48, 0x4b) AM_DEVREADWRITE("pia0", pia6821_device, read, write)
231231   AM_RANGE(0x50, 0x53) AM_READNOP
232232   AM_RANGE(0x50, 0x53) AM_WRITENOP
r22781r22782
243243   AM_RANGE(0x00, 0x03) AM_WRITE(question_w)
244244   AM_RANGE(0x40, 0x40) AM_DEVWRITE("crtc", mc6845_device, address_w)
245245   AM_RANGE(0x41, 0x41) AM_DEVWRITE("crtc", mc6845_device, register_w)
246   AM_RANGE(0x48, 0x49) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
247   AM_RANGE(0x49, 0x49) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
246   AM_RANGE(0x48, 0x49) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
247   AM_RANGE(0x49, 0x49) AM_DEVREAD("aysnd", ay8910_device, data_r)
248248   AM_RANGE(0x50, 0x53) AM_DEVREADWRITE("pia0", pia6821_device, read, write) //?
249249   AM_RANGE(0x60, 0x63) AM_DEVREADWRITE("pia1", pia6821_device, read, write)
250250   AM_RANGE(0x70, 0x73) AM_DEVREADWRITE("pia2", pia6821_device, read, write)
r22781r22782
267267   AM_RANGE(0x68, 0x69) AM_READNOP
268268   AM_RANGE(0x68, 0x6b) AM_WRITENOP
269269   AM_RANGE(0x6b, 0x6b) AM_READNOP
270   AM_RANGE(0x78, 0x79) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
271   AM_RANGE(0x79, 0x79) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
270   AM_RANGE(0x78, 0x79) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
271   AM_RANGE(0x79, 0x79) AM_DEVREAD("aysnd", ay8910_device, data_r)
272272   AM_RANGE(0xc0, 0xc1) AM_READNOP
273273   AM_RANGE(0xc0, 0xc3) AM_WRITENOP
274274ADDRESS_MAP_END
r22781r22782
277277   ADDRESS_MAP_GLOBAL_MASK(0xff)
278278   AM_RANGE(0x40, 0x40) AM_DEVWRITE("crtc", mc6845_device, address_w)
279279   AM_RANGE(0x41, 0x41) AM_DEVWRITE("crtc", mc6845_device, register_w)
280   AM_RANGE(0x48, 0x49) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
281   AM_RANGE(0x49, 0x49) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
280   AM_RANGE(0x48, 0x49) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
281   AM_RANGE(0x49, 0x49) AM_DEVREAD("aysnd", ay8910_device, data_r)
282282   AM_RANGE(0x58, 0x5b) AM_DEVREADWRITE("pia0", pia6821_device, read, write) /* confirmed */
283283   AM_RANGE(0x68, 0x6b) AM_DEVREADWRITE("pia1", pia6821_device, read, write) /* confirmed */
284284   AM_RANGE(0x78, 0x7b) AM_DEVREADWRITE("pia2", pia6821_device, read, write) /* confirmed */
trunk/src/mame/drivers/mystston.c
r22781r22782
7676   if (((*m_ay8910_select & 0x20) == 0x20) && ((data & 0x20) == 0x00))
7777   {
7878      /* bit 4 goes to the 8910 #0 BC1 pin */
79      ay8910_data_address_w(machine().device("ay1"), space, *m_ay8910_select >> 4, *m_ay8910_data);
79      machine().device<ay8910_device>("ay1")->data_address_w(space, *m_ay8910_select >> 4, *m_ay8910_data);
8080   }
8181
8282   /* bit 7 goes to 8910 #1 BDIR pin */
8383   if (((*m_ay8910_select & 0x80) == 0x80) && ((data & 0x80) == 0x00))
8484   {
8585      /* bit 6 goes to the 8910 #1 BC1 pin */
86      ay8910_data_address_w(machine().device("ay2"), space, *m_ay8910_select >> 6, *m_ay8910_data);
86      machine().device<ay8910_device>("ay2")->data_address_w(space, *m_ay8910_select >> 6, *m_ay8910_data);
8787   }
8888
8989   *m_ay8910_select = data;
trunk/src/mame/drivers/ssrj.c
r22781r22782
6363   AM_RANGE(0xf001, 0xf001) AM_READ(ssrj_wheel_r)
6464   AM_RANGE(0xf002, 0xf002) AM_READ_PORT("IN2")
6565   AM_RANGE(0xf003, 0xf003) AM_WRITENOP /* unknown */
66   AM_RANGE(0xf401, 0xf401) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
67   AM_RANGE(0xf400, 0xf401) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
66   AM_RANGE(0xf401, 0xf401) AM_DEVREAD("aysnd", ay8910_device, data_r)
67   AM_RANGE(0xf400, 0xf401) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
6868   AM_RANGE(0xf800, 0xf800) AM_WRITENOP /* wheel ? */
6969   AM_RANGE(0xfc00, 0xfc00) AM_WRITENOP /* unknown */
7070ADDRESS_MAP_END
trunk/src/mame/drivers/cntsteer.c
r22781r22782
607607static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, cntsteer_state )
608608   AM_RANGE(0x0000, 0x01ff) AM_RAM
609609//  AM_RANGE(0x1000, 0x1000) AM_WRITE(nmiack_w)
610   AM_RANGE(0x2000, 0x2000) AM_DEVWRITE_LEGACY("ay1", ay8910_data_w)
611   AM_RANGE(0x4000, 0x4000) AM_DEVWRITE_LEGACY("ay1", ay8910_address_w)
612   AM_RANGE(0x6000, 0x6000) AM_DEVWRITE_LEGACY("ay2", ay8910_data_w)
613   AM_RANGE(0x8000, 0x8000) AM_DEVWRITE_LEGACY("ay2", ay8910_address_w)
610   AM_RANGE(0x2000, 0x2000) AM_DEVWRITE("ay1", ay8910_device, data_w)
611   AM_RANGE(0x4000, 0x4000) AM_DEVWRITE("ay1", ay8910_device, address_w)
612   AM_RANGE(0x6000, 0x6000) AM_DEVWRITE("ay2", ay8910_device, data_w)
613   AM_RANGE(0x8000, 0x8000) AM_DEVWRITE("ay2", ay8910_device, address_w)
614614   AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r)
615615   AM_RANGE(0xd000, 0xd000) AM_WRITE(nmimask_w)
616616   AM_RANGE(0xe000, 0xffff) AM_ROM
trunk/src/mame/drivers/skeetsht.c
r22781r22782
2727      : driver_device(mconfig, type, tag),
2828      m_tlc34076(*this, "tlc34076"),
2929      m_tms_vram(*this, "tms_vram"),
30      m_68hc11(*this, "68hc11"){ }
30      m_68hc11(*this, "68hc11"),
31      m_ay(*this, "aysnd")
32   {
33   }
3134
3235   required_device<tlc34076_device> m_tlc34076;
3336   required_shared_ptr<UINT16> m_tms_vram;
r22781r22782
3538   UINT8 m_ay_sel;
3639   UINT8 m_lastdataw;
3740   UINT16 m_lastdatar;
38   device_t *m_ay;
3941   device_t *m_tms;
4042   DECLARE_READ16_MEMBER(ramdac_r);
4143   DECLARE_WRITE16_MEMBER(ramdac_w);
r22781r22782
4749   virtual void machine_reset();
4850   virtual void video_start();
4951   required_device<cpu_device> m_68hc11;
52   required_device<ay8910_device> m_ay;
5053};
5154
5255
r22781r22782
5861
5962void skeetsht_state::machine_reset()
6063{
61   m_ay = machine().device("aysnd");
6264   m_tms = machine().device("tms");
6365}
6466
r22781r22782
163165WRITE8_MEMBER(skeetsht_state::ay8910_w)
164166{
165167   if (m_ay_sel)
166      ay8910_data_w(m_ay, space, 0, data);
168      m_ay->data_w(space, 0, data);
167169   else
168      ay8910_address_w(m_ay, space, 0, data);
170      m_ay->address_w(space, 0, data);
169171}
170172
171173
trunk/src/mame/drivers/tickee.c
r22781r22782
394394   AM_RANGE(0x02000000, 0x02ffffff) AM_ROM AM_REGION("user1", 0)
395395   AM_RANGE(0x04000000, 0x04003fff) AM_RAM AM_SHARE("nvram")
396396   AM_RANGE(0x04100000, 0x041000ff) AM_DEVREADWRITE8("tlc34076", tlc34076_device, read, write, 0x00ff)
397   AM_RANGE(0x04200000, 0x0420000f) AM_DEVREAD8_LEGACY("ym1", ay8910_r, 0x00ff)
398   AM_RANGE(0x04200000, 0x0420001f) AM_DEVWRITE8_LEGACY("ym1", ay8910_address_data_w, 0x00ff)
399   AM_RANGE(0x04200100, 0x0420010f) AM_DEVREAD8_LEGACY("ym2", ay8910_r, 0x00ff)
400   AM_RANGE(0x04200100, 0x0420011f) AM_DEVWRITE8_LEGACY("ym2", ay8910_address_data_w, 0x00ff)
397   AM_RANGE(0x04200000, 0x0420000f) AM_DEVREAD8("ym1", ay8910_device, data_r, 0x00ff)
398   AM_RANGE(0x04200000, 0x0420001f) AM_DEVWRITE8("ym1", ay8910_device, address_data_w, 0x00ff)
399   AM_RANGE(0x04200100, 0x0420010f) AM_DEVREAD8("ym2", ay8910_device, data_r, 0x00ff)
400   AM_RANGE(0x04200100, 0x0420011f) AM_DEVWRITE8("ym2", ay8910_device, address_data_w, 0x00ff)
401401   AM_RANGE(0x04400000, 0x0440007f) AM_WRITE(tickee_control_w) AM_SHARE("control")
402402   AM_RANGE(0x04400040, 0x0440004f) AM_READ_PORT("IN2")
403403   AM_RANGE(0xc0000000, 0xc00001ff) AM_READWRITE_LEGACY(tms34010_io_register_r, tms34010_io_register_w)
r22781r22782
412412   AM_RANGE(0x02000000, 0x02ffffff) AM_ROM AM_REGION("user1", 0)
413413   AM_RANGE(0x04100000, 0x04103fff) AM_RAM AM_SHARE("nvram")
414414   AM_RANGE(0x04200000, 0x042000ff) AM_DEVREADWRITE8("tlc34076", tlc34076_device, read, write, 0x00ff)
415   AM_RANGE(0x04300000, 0x0430000f) AM_DEVREAD8_LEGACY("ym1", ay8910_r, 0x00ff)
416   AM_RANGE(0x04300000, 0x0430001f) AM_DEVWRITE8_LEGACY("ym1", ay8910_address_data_w, 0x00ff)
417   AM_RANGE(0x04300100, 0x0430010f) AM_DEVREAD8_LEGACY("ym2", ay8910_r, 0x00ff)
418   AM_RANGE(0x04300100, 0x0430011f) AM_DEVWRITE8_LEGACY("ym2", ay8910_address_data_w, 0x00ff)
415   AM_RANGE(0x04300000, 0x0430000f) AM_DEVREAD8("ym1", ay8910_device, data_r, 0x00ff)
416   AM_RANGE(0x04300000, 0x0430001f) AM_DEVWRITE8("ym1", ay8910_device, address_data_w, 0x00ff)
417   AM_RANGE(0x04300100, 0x0430010f) AM_DEVREAD8("ym2", ay8910_device, data_r, 0x00ff)
418   AM_RANGE(0x04300100, 0x0430011f) AM_DEVWRITE8("ym2", ay8910_device, address_data_w, 0x00ff)
419419   AM_RANGE(0x04500000, 0x0450007f) AM_WRITE(tickee_control_w) AM_SHARE("control")
420420   AM_RANGE(0xc0000000, 0xc00001ff) AM_READWRITE_LEGACY(tms34010_io_register_r, tms34010_io_register_w)
421421   AM_RANGE(0xc0000240, 0xc000025f) AM_WRITENOP        /* seems to be a bug in their code */
r22781r22782
428428   AM_RANGE(0x02000000, 0x02ffffff) AM_ROM AM_REGION("user1", 0)
429429   AM_RANGE(0x04000000, 0x04003fff) AM_RAM AM_SHARE("nvram")
430430   AM_RANGE(0x04100000, 0x041000ff) AM_DEVREADWRITE8("tlc34076", tlc34076_device, read, write, 0x00ff)
431   AM_RANGE(0x04200000, 0x0420000f) AM_DEVREAD8_LEGACY("ym", ay8910_r, 0x00ff)
432   AM_RANGE(0x04200000, 0x0420000f) AM_DEVWRITE8_LEGACY("ym", ay8910_address_data_w, 0x00ff)
431   AM_RANGE(0x04200000, 0x0420000f) AM_DEVREAD8("ym", ay8910_device, data_r, 0x00ff)
432   AM_RANGE(0x04200000, 0x0420000f) AM_DEVWRITE8("ym", ay8910_device, address_data_w, 0x00ff)
433433   AM_RANGE(0x04200100, 0x0420010f) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff)
434434   AM_RANGE(0x04400000, 0x0440007f) AM_WRITE(tickee_control_w) AM_SHARE("control")
435435   AM_RANGE(0x04400040, 0x0440004f) AM_READ_PORT("IN2") // ?
trunk/src/mame/drivers/vulgus.c
r22781r22782
7575   AM_RANGE(0x4000, 0x47ff) AM_RAM
7676   AM_RANGE(0x4000, 0x47ff) AM_WRITEONLY
7777   AM_RANGE(0x6000, 0x6000) AM_READ(soundlatch_byte_r)
78   AM_RANGE(0x8000, 0x8001) AM_DEVWRITE_LEGACY("ay1", ay8910_address_data_w)
79   AM_RANGE(0xc000, 0xc001) AM_DEVWRITE_LEGACY("ay2", ay8910_address_data_w)
78   AM_RANGE(0x8000, 0x8001) AM_DEVWRITE("ay1", ay8910_device, address_data_w)
79   AM_RANGE(0xc000, 0xc001) AM_DEVWRITE("ay2", ay8910_device, address_data_w)
8080ADDRESS_MAP_END
8181
8282
trunk/src/mame/drivers/bfcobra.c
r22781r22782
14851485   AM_RANGE(0x2800, 0x2800) AM_RAM     // W
14861486   AM_RANGE(0x2A00, 0x2A02) AM_READWRITE(latch_r, latch_w)
14871487   AM_RANGE(0x2E00, 0x2E00) AM_READ(int_latch_r)
1488   AM_RANGE(0x3001, 0x3001) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_w)
1489   AM_RANGE(0x3201, 0x3201) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w)
1488   AM_RANGE(0x3001, 0x3001) AM_DEVWRITE("aysnd", ay8910_device, data_w)
1489   AM_RANGE(0x3201, 0x3201) AM_DEVWRITE("aysnd", ay8910_device, address_w)
14901490   AM_RANGE(0x3404, 0x3404) AM_DEVREADWRITE("acia6850_1", acia6850_device, status_read, control_write)
14911491   AM_RANGE(0x3405, 0x3405) AM_DEVREADWRITE("acia6850_1", acia6850_device, data_read, data_write)
14921492   AM_RANGE(0x3406, 0x3406) AM_DEVREADWRITE("acia6850_2", acia6850_device, status_read, control_write)
trunk/src/mame/drivers/speedatk.c
r22781r22782
182182   ADDRESS_MAP_GLOBAL_MASK(0xff)
183183   AM_RANGE(0x00, 0x01) AM_WRITE(speedatk_6845_w) //h46505 address / data routing
184184   AM_RANGE(0x24, 0x24) AM_WRITE(watchdog_reset_w)
185   AM_RANGE(0x40, 0x40) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
186   AM_RANGE(0x40, 0x41) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
185   AM_RANGE(0x40, 0x40) AM_DEVREAD("aysnd", ay8910_device, data_r)
186   AM_RANGE(0x40, 0x41) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
187187   //what's 60-6f for? Seems used only in attract mode and read back when a 2p play ends ...
188188ADDRESS_MAP_END
189189
trunk/src/mame/drivers/vastar.c
r22781r22782
162162
163163static ADDRESS_MAP_START( cpu2_port_map, AS_IO, 8, vastar_state )
164164   ADDRESS_MAP_GLOBAL_MASK(0x0f)
165   AM_RANGE(0x00, 0x01) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
166   AM_RANGE(0x02, 0x02) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
165   AM_RANGE(0x00, 0x01) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
166   AM_RANGE(0x02, 0x02) AM_DEVREAD("aysnd", ay8910_device, data_r)
167167ADDRESS_MAP_END
168168
169169
trunk/src/mame/drivers/wink.c
r22781r22782
182182
183183static ADDRESS_MAP_START( wink_sound_io, AS_IO, 8, wink_state )
184184   ADDRESS_MAP_GLOBAL_MASK(0xff)
185   AM_RANGE(0x00, 0x00) AM_DEVREADWRITE_LEGACY("aysnd", ay8910_r, ay8910_data_w)
186   AM_RANGE(0x80, 0x80) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w)
185   AM_RANGE(0x00, 0x00) AM_DEVREADWRITE("aysnd", ay8910_device, data_r, data_w)
186   AM_RANGE(0x80, 0x80) AM_DEVWRITE("aysnd", ay8910_device, address_w)
187187ADDRESS_MAP_END
188188
189189static INPUT_PORTS_START( wink )
trunk/src/mame/drivers/exedexes.c
r22781r22782
5454   AM_RANGE(0x0000, 0x3fff) AM_ROM
5555   AM_RANGE(0x4000, 0x47ff) AM_RAM
5656   AM_RANGE(0x6000, 0x6000) AM_READ(soundlatch_byte_r)
57   AM_RANGE(0x8000, 0x8001) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
57   AM_RANGE(0x8000, 0x8001) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
5858   AM_RANGE(0x8002, 0x8002) AM_DEVWRITE("sn1", sn76489_device, write)
5959   AM_RANGE(0x8003, 0x8003) AM_DEVWRITE("sn2", sn76489_device, write)
6060ADDRESS_MAP_END
trunk/src/mame/drivers/mainsnk.c
r22781r22782
158158   AM_RANGE(0x8000, 0x87ff) AM_RAM
159159   AM_RANGE(0xa000, 0xa000) AM_READ(sound_command_r)
160160   AM_RANGE(0xc000, 0xc000) AM_READ(sound_ack_r)
161   AM_RANGE(0xe000, 0xe001) AM_DEVWRITE_LEGACY("ay1", ay8910_address_data_w)
161   AM_RANGE(0xe000, 0xe001) AM_DEVWRITE("ay1", ay8910_device, address_data_w)
162162   AM_RANGE(0xe002, 0xe003) AM_WRITENOP    // ? always FFFF, snkwave leftover?
163   AM_RANGE(0xe008, 0xe009) AM_DEVWRITE_LEGACY("ay2", ay8910_address_data_w)
163   AM_RANGE(0xe008, 0xe009) AM_DEVWRITE("ay2", ay8910_device, address_data_w)
164164ADDRESS_MAP_END
165165
166166static ADDRESS_MAP_START( sound_portmap, AS_IO, 8, mainsnk_state )
trunk/src/mame/drivers/bfm_sc1.c
r22781r22782
715715   AM_RANGE(0x2E00, 0x2E00) AM_READ(irqlatch_r)            // irq latch
716716
717717   AM_RANGE(0x3001, 0x3001) AM_READ(soundlatch_byte_r)
718   AM_RANGE(0x3001, 0x3001) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_w)
719   AM_RANGE(0x3101, 0x3201) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w)
718   AM_RANGE(0x3001, 0x3001) AM_DEVWRITE("aysnd", ay8910_device, data_w)
719   AM_RANGE(0x3101, 0x3201) AM_DEVWRITE("aysnd", ay8910_device, address_w)
720720
721721   AM_RANGE(0x3406, 0x3406) AM_READWRITE(aciastat_r,aciactrl_w)  // MC6850 status register
722722   AM_RANGE(0x3407, 0x3407) AM_READWRITE(aciadata_r,aciadata_w)  // MC6850 data register
trunk/src/mame/drivers/tx1.c
r22781r22782
541541
542542static ADDRESS_MAP_START( tx1_sound_io, AS_IO, 8, tx1_state )
543543   ADDRESS_MAP_GLOBAL_MASK(0xff)
544   AM_RANGE(0x40, 0x41) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_address_w)
544   AM_RANGE(0x40, 0x41) AM_DEVWRITE("aysnd", ay8910_device, data_address_w)
545545ADDRESS_MAP_END
546546
547547
r22781r22782
616616/* Common */
617617static ADDRESS_MAP_START( buggyboy_sound_io, AS_IO, 8, tx1_state )
618618   ADDRESS_MAP_GLOBAL_MASK(0xff)
619   AM_RANGE(0x40, 0x40) AM_DEVREAD_LEGACY("ym1", ay8910_r)
620   AM_RANGE(0x40, 0x41) AM_DEVWRITE_LEGACY("ym1", ay8910_data_address_w)
621   AM_RANGE(0x80, 0x80) AM_DEVREAD_LEGACY("ym2", ay8910_r)
622   AM_RANGE(0x80, 0x81) AM_DEVWRITE_LEGACY("ym2", ay8910_data_address_w)
619   AM_RANGE(0x40, 0x40) AM_DEVREAD("ym1", ay8910_device, data_r)
620   AM_RANGE(0x40, 0x41) AM_DEVWRITE("ym1", ay8910_device, data_address_w)
621   AM_RANGE(0x80, 0x80) AM_DEVREAD("ym2", ay8910_device, data_r)
622   AM_RANGE(0x80, 0x81) AM_DEVWRITE("ym2", ay8910_device, data_address_w)
623623ADDRESS_MAP_END
624624
625625
trunk/src/mame/drivers/drw80pkr.c
r22781r22782
198198
199199      // ay8910 control port
200200      if (m_p1 == 0xfc)
201         ay8910_address_w(machine().device("aysnd"), space, 0, data);
201         machine().device<ay8910_device>("aysnd")->address_w(space, 0, data);
202202
203203      // ay8910_write_port_0_w
204204      if (m_p1 == 0xfe)
205         ay8910_data_w(machine().device("aysnd"), space, 0, data);
205         machine().device<ay8910_device>("aysnd")->data_w(space, 0, data);
206206   }
207207}
208208
trunk/src/mame/drivers/hyhoo.c
r22781r22782
5050   ADDRESS_MAP_GLOBAL_MASK(0xff)
5151//  AM_RANGE(0x00, 0x00) AM_WRITE_LEGACY(nb1413m3_nmi_clock_w)
5252   AM_RANGE(0x00, 0x7f) AM_READ_LEGACY(nb1413m3_sndrom_r)
53   AM_RANGE(0x81, 0x81) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
54   AM_RANGE(0x82, 0x83) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_address_w)
53   AM_RANGE(0x81, 0x81) AM_DEVREAD("aysnd", ay8910_device, data_r)
54   AM_RANGE(0x82, 0x83) AM_DEVWRITE("aysnd", ay8910_device, data_address_w)
5555   AM_RANGE(0x90, 0x90) AM_READ_PORT("SYSTEM")
5656   AM_RANGE(0x90, 0x97) AM_WRITE(hyhoo_blitter_w)
5757   AM_RANGE(0xa0, 0xa0) AM_READWRITE_LEGACY(nb1413m3_inputport1_r, nb1413m3_inputportsel_w)
trunk/src/mame/drivers/shangkid.c
r22781r22782
309309
310310static ADDRESS_MAP_START( chinhero_bbx_portmap, AS_IO, 8, shangkid_state )
311311   ADDRESS_MAP_GLOBAL_MASK(0xff)
312   AM_RANGE(0x00, 0x01) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
312   AM_RANGE(0x00, 0x01) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
313313ADDRESS_MAP_END
314314
315315static ADDRESS_MAP_START( shangkid_bbx_portmap, AS_IO, 8, shangkid_state )
316316   ADDRESS_MAP_GLOBAL_MASK(0xff)
317   AM_RANGE(0x00, 0x01) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
317   AM_RANGE(0x00, 0x01) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
318318ADDRESS_MAP_END
319319
320320/***************************************************************************************/
r22781r22782
446446static ADDRESS_MAP_START( dynamski_portmap, AS_IO, 8, shangkid_state )
447447   ADDRESS_MAP_GLOBAL_MASK(0xff)
448448   /* ports are reversed */
449   AM_RANGE(0x00, 0x01) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_address_w)
449   AM_RANGE(0x00, 0x01) AM_DEVWRITE("aysnd", ay8910_device, data_address_w)
450450ADDRESS_MAP_END
451451
452452static MACHINE_CONFIG_START( dynamski, shangkid_state )
trunk/src/mame/drivers/thepit.c
r22781r22782
203203static ADDRESS_MAP_START( audio_io_map, AS_IO, 8, thepit_state )
204204   ADDRESS_MAP_GLOBAL_MASK(0xff)
205205   AM_RANGE(0x00, 0x00) AM_WRITE(soundlatch_clear_byte_w)
206   AM_RANGE(0x8c, 0x8d) AM_DEVWRITE_LEGACY("ay2", ay8910_address_data_w)
207   AM_RANGE(0x8d, 0x8d) AM_DEVREAD_LEGACY("ay2", ay8910_r)
208   AM_RANGE(0x8e, 0x8f) AM_DEVWRITE_LEGACY("ay1", ay8910_address_data_w)
209   AM_RANGE(0x8f, 0x8f) AM_DEVREAD_LEGACY("ay1", ay8910_r)
206   AM_RANGE(0x8c, 0x8d) AM_DEVWRITE("ay2", ay8910_device, address_data_w)
207   AM_RANGE(0x8d, 0x8d) AM_DEVREAD("ay2", ay8910_device, data_r)
208   AM_RANGE(0x8e, 0x8f) AM_DEVWRITE("ay1", ay8910_device, address_data_w)
209   AM_RANGE(0x8f, 0x8f) AM_DEVREAD("ay1", ay8910_device, data_r)
210210ADDRESS_MAP_END
211211
212212
trunk/src/mame/drivers/arabian.c
r22781r22782
191191 *************************************/
192192
193193static ADDRESS_MAP_START( main_io_map, AS_IO, 8, arabian_state )
194   AM_RANGE(0xc800, 0xc800) AM_MIRROR(0x01ff) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w)
195   AM_RANGE(0xca00, 0xca00) AM_MIRROR(0x01ff) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_w)
194   AM_RANGE(0xc800, 0xc800) AM_MIRROR(0x01ff) AM_DEVWRITE("aysnd", ay8910_device, address_w)
195   AM_RANGE(0xca00, 0xca00) AM_MIRROR(0x01ff) AM_DEVWRITE("aysnd", ay8910_device, data_w)
196196ADDRESS_MAP_END
197197
198198
trunk/src/mame/drivers/fastfred.c
r22781r22782
216216   AM_RANGE(0xf116, 0xf116) AM_WRITE(fastfred_flip_screen_x_w)
217217   AM_RANGE(0xf117, 0xf117) AM_WRITE(fastfred_flip_screen_y_w)
218218   //AM_RANGE(0xf800, 0xf800) AM_READ(watchdog_reset_r)  // Why doesn't this work???
219   AM_RANGE(0xf800, 0xf801) AM_READNOP AM_DEVWRITE_LEGACY("ay8910.1", ay8910_address_data_w)
219   AM_RANGE(0xf800, 0xf801) AM_READNOP AM_DEVWRITE("ay8910.1", ay8910_device, address_data_w)
220220ADDRESS_MAP_END
221221
222222
r22781r22782
252252   AM_RANGE(0x2000, 0x23ff) AM_RAM
253253   AM_RANGE(0x3000, 0x3000) AM_READ(soundlatch_byte_r) AM_WRITE(sound_nmi_mask_w)
254254   AM_RANGE(0x4000, 0x4000) AM_WRITEONLY  // Reset PSG's
255   AM_RANGE(0x5000, 0x5001) AM_DEVWRITE_LEGACY("ay8910.1", ay8910_address_data_w)
256   AM_RANGE(0x6000, 0x6001) AM_DEVWRITE_LEGACY("ay8910.2", ay8910_address_data_w)
255   AM_RANGE(0x5000, 0x5001) AM_DEVWRITE("ay8910.1", ay8910_device, address_data_w)
256   AM_RANGE(0x6000, 0x6001) AM_DEVWRITE("ay8910.2", ay8910_device, address_data_w)
257257   AM_RANGE(0x7000, 0x7000) AM_READNOP // only for Imago, read but not used
258258ADDRESS_MAP_END
259259
trunk/src/mame/drivers/albazg.c
r22781r22782
253253   ADDRESS_MAP_GLOBAL_MASK(0xff)
254254   AM_RANGE(0x00, 0x00) AM_DEVWRITE("crtc", mc6845_device, address_w)
255255   AM_RANGE(0x01, 0x01) AM_DEVWRITE("crtc", mc6845_device, register_w)
256   AM_RANGE(0x40, 0x40) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
257   AM_RANGE(0x40, 0x41) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
256   AM_RANGE(0x40, 0x40) AM_DEVREAD("aysnd", ay8910_device, data_r)
257   AM_RANGE(0x40, 0x41) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
258258   AM_RANGE(0x80, 0x83) AM_DEVREADWRITE("ppi8255_0", i8255_device, read, write)
259259   AM_RANGE(0xc0, 0xc0) AM_WRITE(watchdog_reset_w)
260260ADDRESS_MAP_END
trunk/src/mame/drivers/sms.c
r22781r22782
529529   AM_RANGE(0x0000, 0x1fff) AM_ROM
530530   AM_RANGE(0x2000, 0x27ff) AM_RAM
531531   AM_RANGE(0x3100, 0x3103) AM_DEVREADWRITE("ppi8255_1", i8255_device, read, write)
532   AM_RANGE(0x3381, 0x3382) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_address_w)
532   AM_RANGE(0x3381, 0x3382) AM_DEVWRITE("aysnd", ay8910_device, data_address_w)
533533   AM_RANGE(0x3400, 0x3400) AM_READ(z80_8088_r)
534534   AM_RANGE(0x3500, 0x3501) AM_READWRITE(p03_r, p03_w)
535535ADDRESS_MAP_END
trunk/src/mame/drivers/cclimber.c
r22781r22782
382382
383383static ADDRESS_MAP_START( cclimber_portmap, AS_IO, 8, cclimber_state )
384384   ADDRESS_MAP_GLOBAL_MASK(0xff)
385   AM_RANGE(0x08, 0x09) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
386   AM_RANGE(0x0c, 0x0c) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
385   AM_RANGE(0x08, 0x09) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
386   AM_RANGE(0x0c, 0x0c) AM_DEVREAD("aysnd", ay8910_device, data_r)
387387ADDRESS_MAP_END
388388
389389static ADDRESS_MAP_START( yamato_portmap, AS_IO, 8, cclimber_state )
r22781r22782
408408
409409static ADDRESS_MAP_START( swimmer_audio_portmap, AS_IO, 8, cclimber_state )
410410   ADDRESS_MAP_GLOBAL_MASK(0xff)
411   AM_RANGE(0x00, 0x01) AM_DEVWRITE_LEGACY("ay1", ay8910_data_address_w)
412   AM_RANGE(0x80, 0x81) AM_DEVWRITE_LEGACY("ay2", ay8910_data_address_w)
411   AM_RANGE(0x00, 0x01) AM_DEVWRITE("ay1", ay8910_device, data_address_w)
412   AM_RANGE(0x80, 0x81) AM_DEVWRITE("ay2", ay8910_device, data_address_w)
413413ADDRESS_MAP_END
414414
415415static ADDRESS_MAP_START( yamato_audio_portmap, AS_IO, 8, cclimber_state )
416416   ADDRESS_MAP_GLOBAL_MASK(0xff)
417   AM_RANGE(0x00, 0x01) AM_DEVWRITE_LEGACY("ay1", ay8910_address_data_w)
418   AM_RANGE(0x02, 0x03) AM_DEVWRITE_LEGACY("ay2", ay8910_address_data_w)
417   AM_RANGE(0x00, 0x01) AM_DEVWRITE("ay1", ay8910_device, address_data_w)
418   AM_RANGE(0x02, 0x03) AM_DEVWRITE("ay2", ay8910_device, address_data_w)
419419   AM_RANGE(0x04, 0x04) AM_READ(yamato_p0_r)   /* ??? */
420420   AM_RANGE(0x08, 0x08) AM_READ(yamato_p1_r)   /* ??? */
421421ADDRESS_MAP_END
trunk/src/mame/drivers/mpu4hw.c
r22781r22782
11431143         case 0x02:
11441144         {/* CA2 = 0 CB2 = 1? : Write to selected PSG register and write data to Port A */
11451145            pia6821_device *pia_ic6 = device->machine().device<pia6821_device>("pia_ic6");
1146            device_t *ay = device->machine().device("ay8913");
1147            ay8910_data_w(ay, space, 0, pia_ic6->a_output());
1146            ay8910_device *ay8910 = device->machine().device<ay8910_device>("ay8913");
1147            ay8910->data_w(space, 0, pia_ic6->a_output());
11481148            LOG(("AY Chip Write \n"));
11491149            break;
11501150         }
r22781r22782
11521152         {/* CA2 = 1 CB2 = 1? : The register will now be selected and the user can read from or write to it.
11531153             The register will remain selected until another is chosen.*/
11541154            pia6821_device *pia_ic6 = device->machine().device<pia6821_device>("pia_ic6");
1155            device_t *ay = device->machine().device("ay8913");
1156            ay8910_address_w(ay, space, 0, pia_ic6->a_output());
1155            ay8910_device *ay8910 = device->machine().device<ay8910_device>("ay8913");
1156            ay8910->address_w(space, 0, pia_ic6->a_output());
11571157            LOG(("AY Chip Select \n"));
11581158            break;
11591159         }
trunk/src/mame/drivers/vroulet.c
r22781r22782
141141
142142static ADDRESS_MAP_START( vroulet_io_map, AS_IO, 8, vroulet_state )
143143   ADDRESS_MAP_GLOBAL_MASK(0xff)
144   AM_RANGE(0x00, 0x00) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
145   AM_RANGE(0x00, 0x01) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_address_w)
144   AM_RANGE(0x00, 0x00) AM_DEVREAD("aysnd", ay8910_device, data_r)
145   AM_RANGE(0x00, 0x01) AM_DEVWRITE("aysnd", ay8910_device, data_address_w)
146146   AM_RANGE(0x10, 0x13) AM_DEVREADWRITE("ppi8255_0", i8255_device, read, write)
147147   AM_RANGE(0x80, 0x83) AM_DEVREADWRITE("ppi8255_1", i8255_device, read, write)
148148ADDRESS_MAP_END
trunk/src/mame/drivers/ddenlovr.c
r22781r22782
19181918   AM_RANGE(0x3002c0, 0x3002c1) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff)// Sound
19191919   AM_RANGE(0x300300, 0x300303) AM_DEVWRITE8_LEGACY("ymsnd", ym2413_w, 0x00ff)
19201920   AM_RANGE(0x300340, 0x30035f) AM_DEVREADWRITE8("rtc", msm6242_device, read, write,0x00ff)
1921   AM_RANGE(0x300380, 0x300383) AM_DEVWRITE8_LEGACY("aysnd", ay8910_address_data_w, 0x00ff)
1922   AM_RANGE(0x300384, 0x300385) AM_DEVREAD8_LEGACY("aysnd", ay8910_r, 0x00ff)
1921   AM_RANGE(0x300380, 0x300383) AM_DEVWRITE8("aysnd", ay8910_device, address_data_w, 0x00ff)
1922   AM_RANGE(0x300384, 0x300385) AM_DEVREAD8("aysnd", ay8910_device, data_r, 0x00ff)
19231923   AM_RANGE(0x3003c2, 0x3003c3) AM_WRITE(quiz365_oki_bank1_w)
19241924   AM_RANGE(0x3003ca, 0x3003cb) AM_WRITE(ddenlovr_blitter_irq_ack_w)                   // Blitter irq acknowledge
19251925   AM_RANGE(0x3003cc, 0x3003cd) AM_WRITE(quiz365_oki_bank2_w)
r22781r22782
19701970   AM_RANGE(0x300086, 0x300087) AM_READ(ddenlovr_gfxrom_r)                             // Video Chip
19711971   AM_RANGE(0x3000c0, 0x3000c3) AM_DEVWRITE8_LEGACY("ymsnd", ym2413_w, 0x00ff)
19721972   AM_RANGE(0x300100, 0x30011f) AM_DEVREADWRITE8("rtc", msm6242_device, read, write,0x00ff)
1973   AM_RANGE(0x300140, 0x300143) AM_DEVWRITE8_LEGACY("aysnd", ay8910_address_data_w, 0x00ff)
1973   AM_RANGE(0x300140, 0x300143) AM_DEVWRITE8("aysnd", ay8910_device, address_data_w, 0x00ff)
19741974   AM_RANGE(0x300180, 0x300181) AM_READ_PORT("P1")
19751975   AM_RANGE(0x300182, 0x300183) AM_READ_PORT("P2")
19761976   AM_RANGE(0x300184, 0x300185) AM_READ_PORT("SYSTEM")
r22781r22782
20372037
20382038   AM_RANGE(0xe00400, 0xe00403) AM_DEVWRITE8_LEGACY("ymsnd", ym2413_w, 0x00ff)
20392039   AM_RANGE(0xe00500, 0xe0051f) AM_DEVREADWRITE8("rtc", msm6242_device, read, write,0x00ff)
2040   AM_RANGE(0xe00600, 0xe00603) AM_DEVWRITE8_LEGACY("aysnd", ay8910_address_data_w, 0x00ff)
2041   AM_RANGE(0xe00604, 0xe00605) AM_DEVREAD8_LEGACY("aysnd", ay8910_r, 0x00ff)
2040   AM_RANGE(0xe00600, 0xe00603) AM_DEVWRITE8("aysnd", ay8910_device, address_data_w, 0x00ff)
2041   AM_RANGE(0xe00604, 0xe00605) AM_DEVREAD8("aysnd", ay8910_device, data_r, 0x00ff)
20422042   AM_RANGE(0xe00700, 0xe00701) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff)  // Sound
20432043   AM_RANGE(0xff0000, 0xffffff) AM_RAM                                                     // RAM
20442044ADDRESS_MAP_END
r22781r22782
20752075
20762076   AM_RANGE(0xe00400, 0xe00403) AM_DEVWRITE8_LEGACY("ymsnd", ym2413_w, 0x00ff)
20772077   AM_RANGE(0xe00500, 0xe0051f) AM_DEVREADWRITE8("rtc", msm6242_device, read, write,0x00ff)
2078   AM_RANGE(0xe00600, 0xe00603) AM_DEVWRITE8_LEGACY("aysnd", ay8910_address_data_w, 0x00ff)
2079   AM_RANGE(0xe00604, 0xe00605) AM_DEVREAD8_LEGACY("aysnd", ay8910_r, 0x00ff)
2078   AM_RANGE(0xe00600, 0xe00603) AM_DEVWRITE8("aysnd", ay8910_device, address_data_w, 0x00ff)
2079   AM_RANGE(0xe00604, 0xe00605) AM_DEVREAD8("aysnd", ay8910_device, data_r, 0x00ff)
20802080   AM_RANGE(0xe00700, 0xe00701) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff)  // Sound
20812081   AM_RANGE(0xff0000, 0xffffff) AM_RAM                                                     // RAM
20822082ADDRESS_MAP_END
r22781r22782
21492149   AM_RANGE(0x300086, 0x300087) AM_READ(ddenlovr_gfxrom_r)                                 // Video Chip
21502150   AM_RANGE(0x3000c0, 0x3000c3) AM_DEVWRITE8_LEGACY("ymsnd", ym2413_w, 0x00ff)
21512151   AM_RANGE(0x300100, 0x30011f) AM_DEVREADWRITE8("rtc", msm6242_device, read, write,0x00ff)
2152   AM_RANGE(0x300140, 0x300143) AM_DEVWRITE8_LEGACY("aysnd", ay8910_address_data_w, 0x00ff)
2152   AM_RANGE(0x300140, 0x300143) AM_DEVWRITE8("aysnd", ay8910_device, address_data_w, 0x00ff)
21532153   AM_RANGE(0x300180, 0x300181) AM_READ_PORT("P1")
21542154   AM_RANGE(0x300182, 0x300183) AM_READ_PORT("P2")
21552155   AM_RANGE(0x300184, 0x300185) AM_READ_PORT("SYSTEM")
r22781r22782
22122212
22132213   AM_RANGE(0xe00400, 0xe00403) AM_DEVWRITE8_LEGACY("ymsnd", ym2413_w, 0x00ff)
22142214   AM_RANGE(0xe00500, 0xe0051f) AM_DEVREADWRITE8("rtc", msm6242_device, read, write,0x00ff)
2215   AM_RANGE(0xe00600, 0xe00603) AM_DEVWRITE8_LEGACY("aysnd", ay8910_address_data_w, 0x00ff)
2216   AM_RANGE(0xe00604, 0xe00605) AM_DEVREAD8_LEGACY("aysnd", ay8910_r, 0x00ff)
2215   AM_RANGE(0xe00600, 0xe00603) AM_DEVWRITE8("aysnd", ay8910_device, address_data_w, 0x00ff)
2216   AM_RANGE(0xe00604, 0xe00605) AM_DEVREAD8("aysnd", ay8910_device, data_r, 0x00ff)
22172217   AM_RANGE(0xe00700, 0xe00701) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff)  // Sound
22182218   AM_RANGE(0xff0000, 0xffffff) AM_RAM AM_SHARE("nvram")                                       // RAM (Battey-backed)
22192219ADDRESS_MAP_END
r22781r22782
24582458   AM_RANGE(0x04, 0x04) AM_NOP                 // read only once at the start
24592459   AM_RANGE(0x06, 0x06) AM_WRITENOP    // almost always 1, sometimes 0
24602460   AM_RANGE(0x08, 0x09) AM_DEVWRITE_LEGACY("ymsnd", ym2413_w)
2461   AM_RANGE(0x0c, 0x0c) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_w)
2462   AM_RANGE(0x0e, 0x0e) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w)
2461   AM_RANGE(0x0c, 0x0c) AM_DEVWRITE("aysnd", ay8910_device, data_w)
2462   AM_RANGE(0x0e, 0x0e) AM_DEVWRITE("aysnd", ay8910_device, address_w)
24632463ADDRESS_MAP_END
24642464
24652465
r22781r22782
29712971   AM_RANGE(0x80, 0x80) AM_MIRROR(0xff00) AM_DEVREADWRITE("oki", okim6295_device, read, write)
29722972   AM_RANGE(0xa0, 0xa1) AM_MIRROR(0xff00) AM_DEVWRITE_LEGACY("ymsnd", ym2413_w)
29732973   AM_RANGE(0xc0, 0xcf) AM_MIRROR(0xff00) AM_DEVREADWRITE("rtc", msm6242_device, read, write)
2974   AM_RANGE(0xe0, 0xe1) AM_MIRROR(0xff00) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
2974   AM_RANGE(0xe0, 0xe1) AM_MIRROR(0xff00) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
29752975ADDRESS_MAP_END
29762976
29772977
r22781r22782
30793079   AM_RANGE(0x23, 0x23) AM_READ(mjmyster_keyb_r)
30803080   AM_RANGE(0x40, 0x40) AM_DEVREADWRITE("oki", okim6295_device, read, write)
30813081   AM_RANGE(0x42, 0x43) AM_DEVWRITE_LEGACY("ymsnd", ym2413_w)
3082   AM_RANGE(0x44, 0x44) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
3083   AM_RANGE(0x46, 0x46) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_w)
3084   AM_RANGE(0x48, 0x48) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w)
3082   AM_RANGE(0x44, 0x44) AM_DEVREAD("aysnd", ay8910_device, data_r)
3083   AM_RANGE(0x46, 0x46) AM_DEVWRITE("aysnd", ay8910_device, data_w)
3084   AM_RANGE(0x48, 0x48) AM_DEVWRITE("aysnd", ay8910_device, address_w)
30853085   AM_RANGE(0x60, 0x6f) AM_DEVREADWRITE("rtc", msm6242_device, read, write)
30863086   AM_RANGE(0x80, 0x83) AM_WRITE(ddenlovr_palette_base_w)
30873087   AM_RANGE(0x84, 0x87) AM_WRITE(ddenlovr_palette_mask_w)
r22781r22782
32443244   AM_RANGE(0x1c, 0x1c) AM_READNOP AM_WRITE(mjmyster_rambank_w)
32453245   AM_RANGE(0x1e, 0x1e) AM_WRITE(hginga_rombank_w)
32463246   AM_RANGE(0x22, 0x23) AM_DEVWRITE_LEGACY("ymsnd", ym2413_w)
3247   AM_RANGE(0x24, 0x24) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
3248   AM_RANGE(0x26, 0x26) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_w)
3249   AM_RANGE(0x28, 0x28) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w)
3247   AM_RANGE(0x24, 0x24) AM_DEVREAD("aysnd", ay8910_device, data_r)
3248   AM_RANGE(0x26, 0x26) AM_DEVWRITE("aysnd", ay8910_device, data_w)
3249   AM_RANGE(0x28, 0x28) AM_DEVWRITE("aysnd", ay8910_device, address_w)
32503250   AM_RANGE(0x40, 0x40) AM_WRITE(hginga_input_w)
32513251   AM_RANGE(0x41, 0x41) AM_WRITE(hginga_coins_w)
32523252   AM_RANGE(0x42, 0x42) AM_READ(hginga_coins_r)
r22781r22782
33673367   AM_RANGE(0x62, 0x62) AM_READ(hgokou_input_r)
33683368   AM_RANGE(0x80, 0x80) AM_DEVREADWRITE("oki", okim6295_device, read, write)
33693369   AM_RANGE(0x82, 0x83) AM_DEVWRITE_LEGACY("ymsnd", ym2413_w)
3370   AM_RANGE(0x84, 0x84) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
3371   AM_RANGE(0x86, 0x86) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_w)
3372   AM_RANGE(0x88, 0x88) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w)
3370   AM_RANGE(0x84, 0x84) AM_DEVREAD("aysnd", ay8910_device, data_r)
3371   AM_RANGE(0x86, 0x86) AM_DEVWRITE("aysnd", ay8910_device, data_w)
3372   AM_RANGE(0x88, 0x88) AM_DEVWRITE("aysnd", ay8910_device, address_w)
33733373   AM_RANGE(0xb0, 0xb0) AM_READ(hanakanz_rand_r)
33743374ADDRESS_MAP_END
33753375
r22781r22782
34103410   AM_RANGE(0x1e, 0x1e) AM_WRITE(hginga_rombank_w)
34113411   AM_RANGE(0x20, 0x20) AM_DEVREADWRITE("oki", okim6295_device, read, write)
34123412   AM_RANGE(0x22, 0x23) AM_DEVWRITE_LEGACY("ymsnd", ym2413_w)
3413   AM_RANGE(0x24, 0x24) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
3414   AM_RANGE(0x26, 0x26) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_w)
3415   AM_RANGE(0x28, 0x28) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w)
3413   AM_RANGE(0x24, 0x24) AM_DEVREAD("aysnd", ay8910_device, data_r)
3414   AM_RANGE(0x26, 0x26) AM_DEVWRITE("aysnd", ay8910_device, data_w)
3415   AM_RANGE(0x28, 0x28) AM_DEVWRITE("aysnd", ay8910_device, address_w)
34163416   AM_RANGE(0x40, 0x40) AM_WRITE(hgokou_dsw_sel_w)
34173417   AM_RANGE(0x41, 0x41) AM_WRITE(hgokou_input_w)
34183418   AM_RANGE(0x42, 0x42) AM_READ(hgokou_input_r)
r22781r22782
35473547   AM_RANGE(0x23, 0x23) AM_READ(mjmyster_keyb_r)
35483548   AM_RANGE(0x40, 0x40) AM_DEVREADWRITE("oki", okim6295_device, read, write)
35493549   AM_RANGE(0x42, 0x43) AM_DEVWRITE_LEGACY("ymsnd", ym2413_w)
3550   AM_RANGE(0x44, 0x44) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
3551   AM_RANGE(0x46, 0x46) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_w)
3552   AM_RANGE(0x48, 0x48) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w)
3550   AM_RANGE(0x44, 0x44) AM_DEVREAD("aysnd", ay8910_device, data_r)
3551   AM_RANGE(0x46, 0x46) AM_DEVWRITE("aysnd", ay8910_device, data_w)
3552   AM_RANGE(0x48, 0x48) AM_DEVWRITE("aysnd", ay8910_device, address_w)
35533553   AM_RANGE(0x60, 0x6f) AM_DEVREADWRITE("rtc", msm6242_device, read, write)
35543554   AM_RANGE(0x80, 0x83) AM_WRITE(ddenlovr_palette_base_w)
35553555   AM_RANGE(0x84, 0x87) AM_WRITE(ddenlovr_palette_mask_w)
r22781r22782
36483648
36493649   AM_RANGE(0xe00400, 0xe00403) AM_DEVWRITE8_LEGACY("ymsnd", ym2413_w, 0x00ff)
36503650   AM_RANGE(0xe00500, 0xe0051f) AM_DEVREADWRITE8("rtc", msm6242_device, read, write, 0x00ff)
3651   AM_RANGE(0xe00600, 0xe00603) AM_DEVWRITE8_LEGACY("aysnd", ay8910_address_data_w, 0x00ff)
3652   AM_RANGE(0xe00604, 0xe00605) AM_DEVREAD8_LEGACY("aysnd", ay8910_r, 0x00ff)
3651   AM_RANGE(0xe00600, 0xe00603) AM_DEVWRITE8("aysnd", ay8910_device, address_data_w, 0x00ff)
3652   AM_RANGE(0xe00604, 0xe00605) AM_DEVREAD8("aysnd", ay8910_device, data_r, 0x00ff)
36533653   AM_RANGE(0xe00700, 0xe00701) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff)  // Sound
36543654   AM_RANGE(0xff0000, 0xffffff) AM_RAM                                                     // RAM
36553655ADDRESS_MAP_END
r22781r22782
37393739   AM_RANGE(0x0184, 0x0184) AM_WRITE(mjflove_coincounter_w)
37403740   AM_RANGE(0x0200, 0x0201) AM_DEVWRITE_LEGACY("ymsnd", ym2413_w)
37413741   AM_RANGE(0x0280, 0x028f) AM_DEVREADWRITE("rtc", msm6242_device, read, write)
3742   AM_RANGE(0x0300, 0x0301) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
3742   AM_RANGE(0x0300, 0x0301) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
37433743   AM_RANGE(0x0380, 0x0380) AM_DEVREADWRITE("oki", okim6295_device, read, write)
37443744ADDRESS_MAP_END
37453745
r22781r22782
38423842   ADDRESS_MAP_GLOBAL_MASK(0xff)
38433843   AM_RANGE(0x00, 0x00) AM_DEVREADWRITE("oki", okim6295_device, read, write)
38443844   AM_RANGE(0x02, 0x03) AM_DEVWRITE_LEGACY("ymsnd", ym2413_w)
3845   AM_RANGE(0x04, 0x05) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
3845   AM_RANGE(0x04, 0x05) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
38463846   AM_RANGE(0x1c, 0x1c) AM_READNOP AM_WRITE(sryudens_rambank_w)    // ? ack on RTC int
38473847   AM_RANGE(0x1e, 0x1e) AM_WRITE(mjflove_rombank_w)
38483848   AM_RANGE(0x20, 0x23) AM_WRITE(ddenlovr_palette_base_w)
r22781r22782
39293929   AM_RANGE(0x80, 0x80) AM_RAM
39303930   AM_RANGE(0x90, 0x90) AM_DEVREADWRITE("oki", okim6295_device, read, write)
39313931   AM_RANGE(0x92, 0x93) AM_DEVWRITE_LEGACY("ymsnd", ym2413_w)
3932   AM_RANGE(0x94, 0x95) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
3932   AM_RANGE(0x94, 0x95) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
39333933ADDRESS_MAP_END
39343934
39353935
r22781r22782
40024002   AM_RANGE(0x43, 0x43) AM_READ(rongrong_gfxrom_r)
40034003   AM_RANGE(0x50, 0x51) AM_DEVWRITE_LEGACY("ymsnd", ym2413_w)
40044004   AM_RANGE(0x54, 0x54) AM_DEVREADWRITE("oki", okim6295_device, read, write)
4005   AM_RANGE(0x58, 0x58) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w)
4006   AM_RANGE(0x5c, 0x5c) AM_DEVREADWRITE_LEGACY("aysnd", ay8910_r, ay8910_data_w)   // dsw
4005   AM_RANGE(0x58, 0x58) AM_DEVWRITE("aysnd", ay8910_device, address_w)
4006   AM_RANGE(0x5c, 0x5c) AM_DEVREADWRITE("aysnd", ay8910_device, data_r, data_w)   // dsw
40074007   AM_RANGE(0x60, 0x60) AM_READNOP AM_WRITE(sryudens_rambank_w)    // ? ack on RTC int
40084008   AM_RANGE(0x70, 0x70) AM_WRITE(seljan2_rombank_w)
40094009   AM_RANGE(0x80, 0x80) AM_READ_PORT("SYSTEM") AM_WRITE(seljan2_palette_enab_w)    // writes: 1 = palette RAM at b000, 0 = ROM
r22781r22782
41514151   AM_RANGE( 0x21, 0x21 ) AM_WRITE(htengoku_coin_w)        //
41524152   AM_RANGE( 0x22, 0x22 ) AM_READ(htengoku_coin_r)         //
41534153   AM_RANGE( 0x23, 0x23 ) AM_READ(htengoku_input_r)        //
4154   AM_RANGE( 0x40, 0x40 ) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w)    // AY8910
4155   AM_RANGE( 0x42, 0x42 ) AM_DEVREAD_LEGACY("aysnd", ay8910_r)     //
4156   AM_RANGE( 0x44, 0x44 ) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_w)   //
4154   AM_RANGE( 0x40, 0x40 ) AM_DEVWRITE("aysnd", ay8910_device, address_w)    // AY8910
4155   AM_RANGE( 0x42, 0x42 ) AM_DEVREAD("aysnd", ay8910_device, data_r)     //
4156   AM_RANGE( 0x44, 0x44 ) AM_DEVWRITE("aysnd", ay8910_device, data_w)   //
41574157   AM_RANGE( 0x46, 0x47 ) AM_DEVWRITE_LEGACY("ymsnd", ym2413_w)        //
41584158   AM_RANGE( 0x80, 0x8f ) AM_DEVREADWRITE("rtc", msm6242_device, read, write)
41594159   AM_RANGE( 0xa0, 0xa3 ) AM_WRITE(ddenlovr_palette_base_w)    // ddenlovr mixer chip
trunk/src/mame/drivers/kaneko16.c
r22781r22782
160160
161161READ16_MEMBER(kaneko16_state::kaneko16_ay1_YM2149_r)
162162{
163   device_t *device = machine().device("ay1");
163   ay8910_device *ay8910 = machine().device<ay8910_device>("ay1");
164164   /* Each 2149 register is mapped to a different address */
165   ay8910_address_w(device,space,0,offset);
166   return ay8910_r(device,space,0);
165   ay8910->address_w(space,0,offset);
166   return ay8910->data_r(space,0);
167167}
168168
169169WRITE16_MEMBER(kaneko16_state::kaneko16_ay1_YM2149_w)
170170{
171   device_t *device = machine().device("ay1");
171   ay8910_device *ay8910 = machine().device<ay8910_device>("ay1");
172172   /* Each 2149 register is mapped to a different address */
173   ay8910_address_w(device,space,0,offset);
173   ay8910->address_w(space,0,offset);
174174   /* The registers are mapped to odd addresses, except one! */
175   if (ACCESSING_BITS_0_7) ay8910_data_w(device,space,0, data       & 0xff);
176   else                ay8910_data_w(device,space,0,(data >> 8) & 0xff);
175   if (ACCESSING_BITS_0_7) ay8910->data_w(space,0, data       & 0xff);
176   else                ay8910->data_w(space,0,(data >> 8) & 0xff);
177177}
178178
179179READ16_MEMBER(kaneko16_state::kaneko16_ay2_YM2149_r)
180180{
181   device_t *device = machine().device("ay2");
181   ay8910_device *ay8910 = machine().device<ay8910_device>("ay2");
182182   /* Each 2149 register is mapped to a different address */
183   ay8910_address_w(device,space,0,offset);
184   return ay8910_r(device,space,0);
183   ay8910->address_w(space,0,offset);
184   return ay8910->data_r(space,0);
185185}
186186
187187WRITE16_MEMBER(kaneko16_state::kaneko16_ay2_YM2149_w)
188188{
189   device_t *device = machine().device("ay2");
189   ay8910_device *ay8910 = machine().device<ay8910_device>("ay2");
190190   /* Each 2149 register is mapped to a different address */
191   ay8910_address_w(device,space,0,offset);
191   ay8910->address_w(space,0,offset);
192192   /* The registers are mapped to odd addresses, except one! */
193   if (ACCESSING_BITS_0_7) ay8910_data_w(device,space,0, data       & 0xff);
194   else                ay8910_data_w(device,space,0,(data >> 8) & 0xff);
193   if (ACCESSING_BITS_0_7) ay8910->data_w(space,0, data       & 0xff);
194   else                ay8910->data_w(space,0,(data >> 8) & 0xff);
195195}
196196
197197
trunk/src/mame/drivers/nova2001.c
r22781r22782
177177   AM_RANGE(0xa800, 0xafff) AM_RAM_WRITE(nova2001_bg_videoram_w) AM_SHARE("bg_videoram")
178178   AM_RANGE(0xb000, 0xb7ff) AM_RAM AM_SHARE("spriteram")
179179   AM_RANGE(0xb800, 0xbfff) AM_WRITE(nova2001_flipscreen_w)
180   AM_RANGE(0xc000, 0xc000) AM_DEVREADWRITE_LEGACY("ay1", ay8910_r, ay8910_data_w)
181   AM_RANGE(0xc001, 0xc001) AM_DEVREADWRITE_LEGACY("ay2", ay8910_r, ay8910_data_w)
182   AM_RANGE(0xc002, 0xc002) AM_DEVWRITE_LEGACY("ay1", ay8910_address_w)
183   AM_RANGE(0xc003, 0xc003) AM_DEVWRITE_LEGACY("ay2", ay8910_address_w)
180   AM_RANGE(0xc000, 0xc000) AM_DEVREADWRITE("ay1", ay8910_device, data_r, data_w)
181   AM_RANGE(0xc001, 0xc001) AM_DEVREADWRITE("ay2", ay8910_device, data_r, data_w)
182   AM_RANGE(0xc002, 0xc002) AM_DEVWRITE("ay1", ay8910_device, address_w)
183   AM_RANGE(0xc003, 0xc003) AM_DEVWRITE("ay2", ay8910_device, address_w)
184184   AM_RANGE(0xc004, 0xc004) AM_READ(watchdog_reset_r)
185185   AM_RANGE(0xc006, 0xc006) AM_READ_PORT("IN0")
186186   AM_RANGE(0xc007, 0xc007) AM_READ_PORT("IN1")
r22781r22782
192192static ADDRESS_MAP_START( ninjakun_cpu1_map, AS_PROGRAM, 8, nova2001_state )
193193   AM_RANGE(0x0000, 0x1fff) AM_ROM
194194   AM_RANGE(0x2000, 0x7fff) AM_ROM
195   AM_RANGE(0x8000, 0x8001) AM_DEVWRITE_LEGACY("ay1", ay8910_address_data_w)
196   AM_RANGE(0x8001, 0x8001) AM_DEVREAD_LEGACY("ay1", ay8910_r)
197   AM_RANGE(0x8002, 0x8003) AM_DEVWRITE_LEGACY("ay2", ay8910_address_data_w)
198   AM_RANGE(0x8003, 0x8003) AM_DEVREAD_LEGACY("ay2", ay8910_r)
195   AM_RANGE(0x8000, 0x8001) AM_DEVWRITE("ay1", ay8910_device, address_data_w)
196   AM_RANGE(0x8001, 0x8001) AM_DEVREAD("ay1", ay8910_device, data_r)
197   AM_RANGE(0x8002, 0x8003) AM_DEVWRITE("ay2", ay8910_device, address_data_w)
198   AM_RANGE(0x8003, 0x8003) AM_DEVREAD("ay2", ay8910_device, data_r)
199199   AM_RANGE(0xa000, 0xa000) AM_READ_PORT("IN0")
200200   AM_RANGE(0xa001, 0xa001) AM_READ_PORT("IN1")
201201   AM_RANGE(0xa002, 0xa002) AM_READ_PORT("IN2") AM_WRITE(ninjakun_cpu1_io_A002_w)
r22781r22782
211211static ADDRESS_MAP_START( ninjakun_cpu2_map, AS_PROGRAM, 8, nova2001_state )
212212   AM_RANGE(0x0000, 0x1fff) AM_ROM
213213   AM_RANGE(0x2000, 0x7fff) AM_ROM AM_REGION("maincpu", 0x2000)
214   AM_RANGE(0x8000, 0x8001) AM_DEVWRITE_LEGACY("ay1", ay8910_address_data_w)
215   AM_RANGE(0x8001, 0x8001) AM_DEVREAD_LEGACY("ay1", ay8910_r)
216   AM_RANGE(0x8002, 0x8003) AM_DEVWRITE_LEGACY("ay2", ay8910_address_data_w)
217   AM_RANGE(0x8003, 0x8003) AM_DEVREAD_LEGACY("ay2", ay8910_r)
214   AM_RANGE(0x8000, 0x8001) AM_DEVWRITE("ay1", ay8910_device, address_data_w)
215   AM_RANGE(0x8001, 0x8001) AM_DEVREAD("ay1", ay8910_device, data_r)
216   AM_RANGE(0x8002, 0x8003) AM_DEVWRITE("ay2", ay8910_device, address_data_w)
217   AM_RANGE(0x8003, 0x8003) AM_DEVREAD("ay2", ay8910_device, data_r)
218218   AM_RANGE(0xa000, 0xa000) AM_READ_PORT("IN0")
219219   AM_RANGE(0xa001, 0xa001) AM_READ_PORT("IN1")
220220   AM_RANGE(0xa002, 0xa002) AM_READ_PORT("IN2") AM_WRITE(ninjakun_cpu2_io_A002_w)
r22781r22782
232232   AM_RANGE(0x0000, 0x7fff) AM_ROM
233233   AM_RANGE(0x8000, 0x87ff) AM_RAM AM_SHARE("spriteram")
234234   AM_RANGE(0x8800, 0x8fff) AM_RAM_WRITE(nova2001_bg_videoram_w) AM_SHARE("bg_videoram")
235   AM_RANGE(0xa000, 0xa001) AM_DEVWRITE_LEGACY("ay1", ay8910_address_data_w)
236   AM_RANGE(0xa001, 0xa001) AM_DEVREAD_LEGACY("ay1", ay8910_r)
237   AM_RANGE(0xa002, 0xa003) AM_DEVWRITE_LEGACY("ay2", ay8910_address_data_w)
238   AM_RANGE(0xa003, 0xa003) AM_DEVREAD_LEGACY("ay2", ay8910_r)
235   AM_RANGE(0xa000, 0xa001) AM_DEVWRITE("ay1", ay8910_device, address_data_w)
236   AM_RANGE(0xa001, 0xa001) AM_DEVREAD("ay1", ay8910_device, data_r)
237   AM_RANGE(0xa002, 0xa003) AM_DEVWRITE("ay2", ay8910_device, address_data_w)
238   AM_RANGE(0xa003, 0xa003) AM_DEVREAD("ay2", ay8910_device, data_r)
239239   AM_RANGE(0xc000, 0xc7ff) AM_RAM
240240   AM_RANGE(0xe000, 0xffff) AM_ROM
241241ADDRESS_MAP_END
r22781r22782
254254   AM_RANGE(0xa000, 0xa000) AM_WRITE(nova2001_scroll_x_w)
255255   AM_RANGE(0xa001, 0xa001) AM_WRITE(nova2001_scroll_y_w)
256256   AM_RANGE(0xa002, 0xa002) AM_WRITE(pkunwar_flipscreen_w)
257   AM_RANGE(0xc000, 0xc001) AM_DEVWRITE_LEGACY("ay1", ay8910_address_data_w)
258   AM_RANGE(0xc001, 0xc001) AM_DEVREAD_LEGACY("ay1", ay8910_r)
259   AM_RANGE(0xc002, 0xc003) AM_DEVWRITE_LEGACY("ay2", ay8910_address_data_w)
260   AM_RANGE(0xc003, 0xc003) AM_DEVREAD_LEGACY("ay2", ay8910_r)
257   AM_RANGE(0xc000, 0xc001) AM_DEVWRITE("ay1", ay8910_device, address_data_w)
258   AM_RANGE(0xc001, 0xc001) AM_DEVREAD("ay1", ay8910_device, data_r)
259   AM_RANGE(0xc002, 0xc003) AM_DEVWRITE("ay2", ay8910_device, address_data_w)
260   AM_RANGE(0xc003, 0xc003) AM_DEVREAD("ay2", ay8910_device, data_r)
261261   AM_RANGE(0xd000, 0xd1ff) AM_RAM_WRITE(ninjakun_paletteram_w) AM_SHARE("paletteram")
262262   AM_RANGE(0xe000, 0xe7ff) AM_RAM AM_SHARE("share1")
263263ADDRESS_MAP_END
264264
265265static ADDRESS_MAP_START( raiders5_cpu2_map, AS_PROGRAM, 8, nova2001_state )
266266   AM_RANGE(0x0000, 0x3fff) AM_ROM
267   AM_RANGE(0x8000, 0x8001) AM_DEVWRITE_LEGACY("ay1", ay8910_address_data_w)
268   AM_RANGE(0x8001, 0x8001) AM_DEVREAD_LEGACY("ay1", ay8910_r)
269   AM_RANGE(0x8002, 0x8003) AM_DEVWRITE_LEGACY("ay2", ay8910_address_data_w)
270   AM_RANGE(0x8003, 0x8003) AM_DEVREAD_LEGACY("ay2", ay8910_r)
267   AM_RANGE(0x8000, 0x8001) AM_DEVWRITE("ay1", ay8910_device, address_data_w)
268   AM_RANGE(0x8001, 0x8001) AM_DEVREAD("ay1", ay8910_device, data_r)
269   AM_RANGE(0x8002, 0x8003) AM_DEVWRITE("ay2", ay8910_device, address_data_w)
270   AM_RANGE(0x8003, 0x8003) AM_DEVREAD("ay2", ay8910_device, data_r)
271271   AM_RANGE(0x9000, 0x9000) AM_READNOP /* unknown */
272272   AM_RANGE(0xa000, 0xa7ff) AM_RAM AM_SHARE("share1")
273273   AM_RANGE(0xc000, 0xc000) AM_READNOP /* unknown */
trunk/src/mame/drivers/mouser.c
r22781r22782
8383
8484static ADDRESS_MAP_START( mouser_sound_io_map, AS_IO, 8, mouser_state )
8585   ADDRESS_MAP_GLOBAL_MASK(0xff)
86   AM_RANGE(0x00, 0x01) AM_DEVWRITE_LEGACY("ay1", ay8910_data_address_w)
87   AM_RANGE(0x80, 0x81) AM_DEVWRITE_LEGACY("ay2", ay8910_data_address_w)
86   AM_RANGE(0x00, 0x01) AM_DEVWRITE("ay1", ay8910_device, data_address_w)
87   AM_RANGE(0x80, 0x81) AM_DEVWRITE("ay2", ay8910_device, data_address_w)
8888ADDRESS_MAP_END
8989
9090static INPUT_PORTS_START( mouser )
trunk/src/mame/drivers/scramble.c
r22781r22782
7676
7777static ADDRESS_MAP_START( scramble_sound_io_map, AS_IO, 8, scramble_state )
7878   ADDRESS_MAP_GLOBAL_MASK(0xff)
79   AM_RANGE(0x10, 0x10) AM_DEVWRITE_LEGACY("8910.1", ay8910_address_w)
80   AM_RANGE(0x20, 0x20) AM_DEVREADWRITE_LEGACY("8910.1", ay8910_r, ay8910_data_w)
81   AM_RANGE(0x40, 0x40) AM_DEVWRITE_LEGACY("8910.2", ay8910_address_w)
82   AM_RANGE(0x80, 0x80) AM_DEVREADWRITE_LEGACY("8910.2", ay8910_r, ay8910_data_w)
79   AM_RANGE(0x10, 0x10) AM_DEVWRITE("8910.1", ay8910_device, address_w)
80   AM_RANGE(0x20, 0x20) AM_DEVREADWRITE("8910.1", ay8910_device, data_r, data_w)
81   AM_RANGE(0x40, 0x40) AM_DEVWRITE("8910.2", ay8910_device, address_w)
82   AM_RANGE(0x80, 0x80) AM_DEVREADWRITE("8910.2", ay8910_device, data_r, data_w)
8383ADDRESS_MAP_END
8484
8585
r22781r22782
340340
341341static ADDRESS_MAP_START( triplep_io_map, AS_IO, 8, scramble_state )
342342   ADDRESS_MAP_GLOBAL_MASK(0xff)
343   AM_RANGE(0x00, 0x01) AM_DEVWRITE_LEGACY("8910.1", ay8910_data_address_w)
344   AM_RANGE(0x01, 0x01) AM_DEVREAD_LEGACY("8910.1", ay8910_r)
343   AM_RANGE(0x00, 0x01) AM_DEVWRITE("8910.1", ay8910_device, data_address_w)
344   AM_RANGE(0x01, 0x01) AM_DEVREAD("8910.1", ay8910_device, data_r)
345345   AM_RANGE(0x02, 0x02) AM_READ(triplep_pip_r)
346346   AM_RANGE(0x03, 0x03) AM_READ(triplep_pap_r)
347347ADDRESS_MAP_END
348348
349349static ADDRESS_MAP_START( hotshock_sound_io_map, AS_IO, 8, scramble_state )
350350   ADDRESS_MAP_GLOBAL_MASK(0xff)
351   AM_RANGE(0x10, 0x10) AM_DEVWRITE_LEGACY("8910.1", ay8910_address_w)
352   AM_RANGE(0x20, 0x20) AM_DEVREADWRITE_LEGACY("8910.1", ay8910_r, ay8910_data_w)
353   AM_RANGE(0x40, 0x40) AM_DEVREADWRITE_LEGACY("8910.2", ay8910_r, ay8910_data_w)
354   AM_RANGE(0x80, 0x80) AM_DEVWRITE_LEGACY("8910.2", ay8910_address_w)
351   AM_RANGE(0x10, 0x10) AM_DEVWRITE("8910.1", ay8910_device, address_w)
352   AM_RANGE(0x20, 0x20) AM_DEVREADWRITE("8910.1", ay8910_device, data_r, data_w)
353   AM_RANGE(0x40, 0x40) AM_DEVREADWRITE("8910.2", ay8910_device, data_r, data_w)
354   AM_RANGE(0x80, 0x80) AM_DEVWRITE("8910.2", ay8910_device, address_w)
355355ADDRESS_MAP_END
356356
357357
r22781r22782
414414   ADDRESS_MAP_GLOBAL_MASK(0xff)
415415
416416   // ports->speech?:
417   AM_RANGE(0x04, 0x04) AM_DEVWRITE_LEGACY    ("8910.3", ay8910_address_w)
418   AM_RANGE(0x08, 0x08) AM_DEVREADWRITE_LEGACY("8910.3", ay8910_r, ay8910_data_w)
417   AM_RANGE(0x04, 0x04) AM_DEVWRITE("8910.3", ay8910_device, address_w)
418   AM_RANGE(0x08, 0x08) AM_DEVREADWRITE("8910.3", ay8910_device, data_r, data_w)
419419   // same as scramble:
420   AM_RANGE(0x10, 0x10) AM_DEVWRITE_LEGACY    ("8910.1", ay8910_address_w)
421   AM_RANGE(0x20, 0x20) AM_DEVREADWRITE_LEGACY("8910.1", ay8910_r, ay8910_data_w)
422   AM_RANGE(0x40, 0x40) AM_DEVWRITE_LEGACY    ("8910.2", ay8910_address_w)
423   AM_RANGE(0x80, 0x80) AM_DEVREADWRITE_LEGACY("8910.2", ay8910_r, ay8910_data_w)  // read soundlatch
420   AM_RANGE(0x10, 0x10) AM_DEVWRITE("8910.1", ay8910_device, address_w)
421   AM_RANGE(0x20, 0x20) AM_DEVREADWRITE("8910.1", ay8910_device, data_r, data_w)
422   AM_RANGE(0x40, 0x40) AM_DEVWRITE("8910.2", ay8910_device, address_w)
423   AM_RANGE(0x80, 0x80) AM_DEVREADWRITE("8910.2", ay8910_device, data_r, data_w)  // read soundlatch
424424ADDRESS_MAP_END
425425
426426
trunk/src/mame/drivers/taxidriv.c
r22781r22782
189189
190190static ADDRESS_MAP_START( cpu3_port_map, AS_IO, 8, taxidriv_state )
191191   ADDRESS_MAP_GLOBAL_MASK(0xff)
192   AM_RANGE(0x00, 0x01) AM_DEVWRITE_LEGACY("ay1", ay8910_address_data_w)
193   AM_RANGE(0x01, 0x01) AM_DEVREAD_LEGACY("ay1", ay8910_r)
194   AM_RANGE(0x02, 0x03) AM_DEVWRITE_LEGACY("ay2", ay8910_address_data_w)
195   AM_RANGE(0x03, 0x03) AM_DEVREAD_LEGACY("ay2", ay8910_r)
192   AM_RANGE(0x00, 0x01) AM_DEVWRITE("ay1", ay8910_device, address_data_w)
193   AM_RANGE(0x01, 0x01) AM_DEVREAD("ay1", ay8910_device, data_r)
194   AM_RANGE(0x02, 0x03) AM_DEVWRITE("ay2", ay8910_device, address_data_w)
195   AM_RANGE(0x03, 0x03) AM_DEVREAD("ay2", ay8910_device, data_r)
196196ADDRESS_MAP_END
197197
198198
trunk/src/mame/drivers/tehkanwc.c
r22781r22782
259259
260260static ADDRESS_MAP_START( sound_port, AS_IO, 8, tehkanwc_state )
261261   ADDRESS_MAP_GLOBAL_MASK(0xff)
262   AM_RANGE(0x00, 0x00) AM_DEVREAD_LEGACY("ay1", ay8910_r)
263   AM_RANGE(0x00, 0x01) AM_DEVWRITE_LEGACY("ay1", ay8910_data_address_w)
264   AM_RANGE(0x02, 0x02) AM_DEVREAD_LEGACY("ay2", ay8910_r)
265   AM_RANGE(0x02, 0x03) AM_DEVWRITE_LEGACY("ay2", ay8910_data_address_w)
262   AM_RANGE(0x00, 0x00) AM_DEVREAD("ay1", ay8910_device, data_r)
263   AM_RANGE(0x00, 0x01) AM_DEVWRITE("ay1", ay8910_device, data_address_w)
264   AM_RANGE(0x02, 0x02) AM_DEVREAD("ay2", ay8910_device, data_r)
265   AM_RANGE(0x02, 0x03) AM_DEVWRITE("ay2", ay8910_device, data_address_w)
266266ADDRESS_MAP_END
267267
268268
trunk/src/mame/drivers/peyper.c
r22781r22782
200200   ADDRESS_MAP_GLOBAL_MASK(0xff)
201201   AM_RANGE(0x00, 0x00) AM_READWRITE(sw_r,disp_w)
202202   AM_RANGE(0x01, 0x01) AM_WRITE(col_w)
203//  AM_RANGE(0x04, 0x04) AM_DEVWRITE_LEGACY("ay8910_0", ay8910_address_w)
204//  AM_RANGE(0x06, 0x06) AM_DEVWRITE_LEGACY("ay8910_0", ay8910_data_w)
205//  AM_RANGE(0x08, 0x08) AM_DEVWRITE_LEGACY("ay8910_1", ay8910_address_w)
206//  AM_RANGE(0x0a, 0x0a) AM_DEVWRITE_LEGACY("ay8910_1", ay8910_data_w)
203//  AM_RANGE(0x04, 0x04) AM_DEVWRITE_LEGACY("ay8910_0", ay8910_device, address_w)
204//  AM_RANGE(0x06, 0x06) AM_DEVWRITE_LEGACY("ay8910_0", ay8910_device, data_w)
205//  AM_RANGE(0x08, 0x08) AM_DEVWRITE_LEGACY("ay8910_1", ay8910_device, address_w)
206//  AM_RANGE(0x0a, 0x0a) AM_DEVWRITE_LEGACY("ay8910_1", ay8910_device, data_w)
207207   AM_RANGE(0x0c, 0x0c) AM_WRITE(sol_w)
208208   AM_RANGE(0x10, 0x18) AM_WRITE(lamp_w)
209209   AM_RANGE(0x20, 0x20) AM_READ_PORT("DSW0")
trunk/src/mame/drivers/mermaid.c
r22781r22782
116116
117117#include "emu.h"
118118#include "cpu/z80/z80.h"
119#include "sound/ay8910.h"
120119#include "sound/msm5205.h"
121120#include "includes/mermaid.h"
122121
r22781r22782
124123
125124WRITE8_MEMBER(mermaid_state::mermaid_ay8910_write_port_w)
126125{
127   if (m_ay8910_enable[0]) ay8910_data_w(m_ay1, space, offset, data);
128   if (m_ay8910_enable[1]) ay8910_data_w(m_ay2, space, offset, data);
126   if (m_ay8910_enable[0]) m_ay1->data_w(space, offset, data);
127   if (m_ay8910_enable[1]) m_ay2->data_w(space, offset, data);
129128}
130129
131130WRITE8_MEMBER(mermaid_state::mermaid_ay8910_control_port_w)
132131{
133   if (m_ay8910_enable[0]) ay8910_address_w(m_ay1, space, offset, data);
134   if (m_ay8910_enable[1]) ay8910_address_w(m_ay2, space, offset, data);
132   if (m_ay8910_enable[0]) m_ay1->address_w(space, offset, data);
133   if (m_ay8910_enable[1]) m_ay2->address_w(space, offset, data);
135134}
136135
137136
r22781r22782
360359
361360void mermaid_state::machine_start()
362361{
363   m_ay1 = machine().device("ay1");
364   m_ay2 = machine().device("ay2");
365
366362   save_item(NAME(m_coll_bit0));
367363   save_item(NAME(m_coll_bit1));
368364   save_item(NAME(m_coll_bit2));
trunk/src/mame/drivers/dynadice.c
r22781r22782
8585
8686WRITE8_MEMBER(dynadice_state::sound_control_w)
8787{
88   device_t *device = machine().device("aysnd");
88   ay8910_device *ay8910 = machine().device<ay8910_device>("aysnd");
8989/*
9090    AY 3-8910 :
9191
r22781r22782
9696
9797*/
9898   if ((data & 7) == 7)
99      ay8910_address_w(device, space, 0, m_ay_data);
99      ay8910->address_w(space, 0, m_ay_data);
100100
101101   if ((data & 7) == 6)
102      ay8910_data_w(device, space, 0, m_ay_data);
102      ay8910->data_w(space, 0, m_ay_data);
103103}
104104
105105
trunk/src/mame/drivers/ampoker2.c
r22781r22782
628628   AM_RANGE(0x35, 0x35) AM_WRITE(ampoker2_port35_w)    /* see write handlers */
629629   AM_RANGE(0x36, 0x36) AM_WRITE(ampoker2_port36_w)    /* see write handlers */
630630   AM_RANGE(0x37, 0x37) AM_WRITE(ampoker2_watchdog_reset_w)
631   AM_RANGE(0x38, 0x39) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
632   AM_RANGE(0x3A, 0x3A) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
631   AM_RANGE(0x38, 0x39) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
632   AM_RANGE(0x3A, 0x3A) AM_DEVREAD("aysnd", ay8910_device, data_r)
633633ADDRESS_MAP_END
634634
635635/*
trunk/src/mame/drivers/gameplan.c
r22781r22782
225225static ADDRESS_MAP_START( gameplan_audio_map, AS_PROGRAM, 8, gameplan_state )
226226   AM_RANGE(0x0000, 0x007f) AM_MIRROR(0x1780) AM_RAM  /* 6532 internal RAM */
227227   AM_RANGE(0x0800, 0x081f) AM_MIRROR(0x17e0) AM_DEVREADWRITE("riot", riot6532_device, read, write)
228   AM_RANGE(0xa000, 0xa000) AM_MIRROR(0x1ffc) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w)
229   AM_RANGE(0xa001, 0xa001) AM_MIRROR(0x1ffc) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
230   AM_RANGE(0xa002, 0xa002) AM_MIRROR(0x1ffc) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_w)
228   AM_RANGE(0xa000, 0xa000) AM_MIRROR(0x1ffc) AM_DEVWRITE("aysnd", ay8910_device, address_w)
229   AM_RANGE(0xa001, 0xa001) AM_MIRROR(0x1ffc) AM_DEVREAD("aysnd", ay8910_device, data_r)
230   AM_RANGE(0xa002, 0xa002) AM_MIRROR(0x1ffc) AM_DEVWRITE("aysnd", ay8910_device, data_w)
231231   AM_RANGE(0xe000, 0xe7ff) AM_MIRROR(0x1800) AM_ROM
232232ADDRESS_MAP_END
233233
r22781r22782
236236static ADDRESS_MAP_START( leprechn_audio_map, AS_PROGRAM, 8, gameplan_state )
237237   AM_RANGE(0x0000, 0x007f) AM_MIRROR(0x1780) AM_RAM  /* 6532 internal RAM */
238238   AM_RANGE(0x0800, 0x081f) AM_MIRROR(0x17e0) AM_DEVREADWRITE("riot", riot6532_device, read, write)
239   AM_RANGE(0xa000, 0xa000) AM_MIRROR(0x1ffc) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w)
240   AM_RANGE(0xa001, 0xa001) AM_MIRROR(0x1ffc) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
241   AM_RANGE(0xa002, 0xa002) AM_MIRROR(0x1ffc) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_w)
239   AM_RANGE(0xa000, 0xa000) AM_MIRROR(0x1ffc) AM_DEVWRITE("aysnd", ay8910_device, address_w)
240   AM_RANGE(0xa001, 0xa001) AM_MIRROR(0x1ffc) AM_DEVREAD("aysnd", ay8910_device, data_r)
241   AM_RANGE(0xa002, 0xa002) AM_MIRROR(0x1ffc) AM_DEVWRITE("aysnd", ay8910_device, data_w)
242242   AM_RANGE(0xe000, 0xefff) AM_MIRROR(0x1000) AM_ROM
243243ADDRESS_MAP_END
244244
trunk/src/mame/drivers/koikoi.c
r22781r22782
237237static ADDRESS_MAP_START( koikoi_io_map, AS_IO, 8, koikoi_state )
238238   ADDRESS_MAP_GLOBAL_MASK(0xff)
239239   AM_RANGE(0x02, 0x02) AM_WRITENOP //watchdog
240   AM_RANGE(0x03, 0x03) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
241   AM_RANGE(0x06, 0x07) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_address_w)
240   AM_RANGE(0x03, 0x03) AM_DEVREAD("aysnd", ay8910_device, data_r)
241   AM_RANGE(0x06, 0x07) AM_DEVWRITE("aysnd", ay8910_device, data_address_w)
242242ADDRESS_MAP_END
243243
244244/*************************************
trunk/src/mame/drivers/pengadvb.c
r22781r22782
167167   ADDRESS_MAP_GLOBAL_MASK(0xff)
168168   AM_RANGE(0x98, 0x98) AM_DEVREADWRITE( "tms9928a", tms9928a_device, vram_read, vram_write )
169169   AM_RANGE(0x99, 0x99) AM_DEVREADWRITE( "tms9928a", tms9928a_device, register_read, register_write )
170   AM_RANGE(0xa0, 0xa1) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
171   AM_RANGE(0xa2, 0xa2) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
170   AM_RANGE(0xa0, 0xa1) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
171   AM_RANGE(0xa2, 0xa2) AM_DEVREAD("aysnd", ay8910_device, data_r)
172172   AM_RANGE(0xa8, 0xab) AM_DEVREADWRITE("ppi8255", i8255_device, read, write)
173173ADDRESS_MAP_END
174174
trunk/src/mame/drivers/ssingles.c
r22781r22782
412412
413413static ADDRESS_MAP_START( ssingles_io_map, AS_IO, 8, ssingles_state )
414414   ADDRESS_MAP_GLOBAL_MASK(0xff)
415   AM_RANGE(0x00, 0x00) AM_DEVWRITE_LEGACY("ay1", ay8910_address_w)
416   AM_RANGE(0x04, 0x04) AM_DEVWRITE_LEGACY("ay1", ay8910_data_w)
417   AM_RANGE(0x06, 0x06) AM_DEVWRITE_LEGACY("ay2", ay8910_address_w)
415   AM_RANGE(0x00, 0x00) AM_DEVWRITE("ay1", ay8910_device, address_w)
416   AM_RANGE(0x04, 0x04) AM_DEVWRITE("ay1", ay8910_device, data_w)
417   AM_RANGE(0x06, 0x06) AM_DEVWRITE("ay2", ay8910_device, address_w)
418418   AM_RANGE(0x08, 0x08) AM_READNOP
419   AM_RANGE(0x0a, 0x0a) AM_DEVWRITE_LEGACY("ay2", ay8910_data_w)
419   AM_RANGE(0x0a, 0x0a) AM_DEVWRITE("ay2", ay8910_device, data_w)
420420   AM_RANGE(0x16, 0x16) AM_READ_PORT("DSW0")
421421   AM_RANGE(0x18, 0x18) AM_READ_PORT("DSW1")
422422   AM_RANGE(0x1c, 0x1c) AM_READ_PORT("INPUTS")
r22781r22782
427427
428428static ADDRESS_MAP_START( atamanot_io_map, AS_IO, 8, ssingles_state )
429429   ADDRESS_MAP_GLOBAL_MASK(0xff)
430   AM_RANGE(0x00, 0x00) AM_DEVWRITE_LEGACY("ay1", ay8910_address_w)
431   AM_RANGE(0x04, 0x04) AM_DEVWRITE_LEGACY("ay1", ay8910_data_w)
432   AM_RANGE(0x06, 0x06) AM_DEVWRITE_LEGACY("ay2", ay8910_address_w)
430   AM_RANGE(0x00, 0x00) AM_DEVWRITE("ay1", ay8910_device, address_w)
431   AM_RANGE(0x04, 0x04) AM_DEVWRITE("ay1", ay8910_device, data_w)
432   AM_RANGE(0x06, 0x06) AM_DEVWRITE("ay2", ay8910_device, address_w)
433433   AM_RANGE(0x08, 0x08) AM_READNOP
434   AM_RANGE(0x0a, 0x0a) AM_DEVWRITE_LEGACY("ay2", ay8910_data_w)
434   AM_RANGE(0x0a, 0x0a) AM_DEVWRITE("ay2", ay8910_device, data_w)
435435   AM_RANGE(0x16, 0x16) AM_READ_PORT("DSW0")
436436   AM_RANGE(0x18, 0x18) AM_READ_PORT("DSW1") AM_WRITE(atamanot_prot_w)
437437   AM_RANGE(0x1c, 0x1c) AM_READ_PORT("INPUTS")
trunk/src/mame/drivers/ksayakyu.c
r22781r22782
122122static ADDRESS_MAP_START( soundcpu_map, AS_PROGRAM, 8, ksayakyu_state )
123123   AM_RANGE(0x0000, 0x7fff) AM_ROM
124124   AM_RANGE(0x8000, 0x83ff) AM_RAM
125   AM_RANGE(0xa001, 0xa001) AM_DEVREAD_LEGACY("ay1", ay8910_r)
126   AM_RANGE(0xa002, 0xa003) AM_DEVWRITE_LEGACY("ay1", ay8910_data_address_w)
127   AM_RANGE(0xa006, 0xa007) AM_DEVWRITE_LEGACY("ay2", ay8910_data_address_w)
125   AM_RANGE(0xa001, 0xa001) AM_DEVREAD("ay1", ay8910_device, data_r)
126   AM_RANGE(0xa002, 0xa003) AM_DEVWRITE("ay1", ay8910_device, data_address_w)
127   AM_RANGE(0xa006, 0xa007) AM_DEVWRITE("ay2", ay8910_device, data_address_w)
128128   AM_RANGE(0xa008, 0xa008) AM_DEVWRITE("dac", dac_device, write_unsigned8)
129129   AM_RANGE(0xa00c, 0xa00c) AM_WRITE(tomaincpu_w)
130130   AM_RANGE(0xa010, 0xa010) AM_WRITENOP //a timer of some sort?
trunk/src/mame/drivers/othello.c
r22781r22782
5353   othello_state(const machine_config &mconfig, device_type type, const char *tag)
5454      : driver_device(mconfig, type, tag),
5555      m_videoram(*this, "videoram"),
56      m_maincpu(*this, "maincpu"){ }
56      m_maincpu(*this, "maincpu"),
57      m_ay1(*this, "ay1"),
58      m_ay2(*this, "ay2")
59   {
60   }
5761
5862   /* memory pointers */
5963   required_shared_ptr<UINT8> m_videoram;
r22781r22782
7175
7276   /* devices */
7377   required_device<cpu_device> m_maincpu;
78   required_device<ay8910_device> m_ay1;
79   required_device<ay8910_device> m_ay2;
7480   mc6845_device *m_mc6845;
7581   device_t *m_n7751;
76   device_t *m_ay1;
77   device_t *m_ay2;
7882   DECLARE_READ8_MEMBER(unk_87_r);
7983   DECLARE_WRITE8_MEMBER(unk_8a_w);
8084   DECLARE_WRITE8_MEMBER(unk_8c_w);
r22781r22782
226230
227231WRITE8_MEMBER(othello_state::ay_address_w)
228232{
229   if (m_ay_select & 1) ay8910_address_w(m_ay1, space, 0, data);
230   if (m_ay_select & 2) ay8910_address_w(m_ay2, space, 0, data);
233   if (m_ay_select & 1) m_ay1->address_w(space, 0, data);
234   if (m_ay_select & 2) m_ay2->address_w(space, 0, data);
231235}
232236
233237WRITE8_MEMBER(othello_state::ay_data_w)
234238{
235   if (m_ay_select & 1) ay8910_data_w(m_ay1, space, 0, data);
236   if (m_ay_select & 2) ay8910_data_w(m_ay2, space, 0, data);
239   if (m_ay_select & 1) m_ay1->data_w(space, 0, data);
240   if (m_ay_select & 2) m_ay2->data_w(space, 0, data);
237241}
238242
239243static ADDRESS_MAP_START( audio_map, AS_PROGRAM, 8, othello_state )
r22781r22782
385389{
386390   m_mc6845 = machine().device<mc6845_device>("crtc");
387391   m_n7751 = machine().device("n7751");
388   m_ay1 = machine().device("ay1");
389   m_ay2 = machine().device("ay2");
390392
391393   save_item(NAME(m_tile_bank));
392394   save_item(NAME(m_ay_select));
trunk/src/mame/drivers/quizo.c
r22781r22782
149149   AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0")
150150   AM_RANGE(0x10, 0x10) AM_READ_PORT("IN1")
151151   AM_RANGE(0x40, 0x40) AM_READ_PORT("IN2")
152   AM_RANGE(0x50, 0x51) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
152   AM_RANGE(0x50, 0x51) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
153153   AM_RANGE(0x60, 0x60) AM_WRITE(port60_w)
154154   AM_RANGE(0x70, 0x70) AM_WRITE(port70_w)
155155ADDRESS_MAP_END
trunk/src/mame/drivers/dynax.c
r22781r22782
532532   AM_RANGE( 0x76, 0x76 ) AM_WRITE(dynax_blit_palbank_w)       // Layers Palettes (High Bit)
533533   AM_RANGE( 0x77, 0x77 ) AM_WRITE(hanamai_layer_half_w)       // half of the interleaved layer to write to
534534   AM_RANGE( 0x78, 0x79 ) AM_DEVREADWRITE("ymsnd", ym2203_device, read, write) // 2 x DSW
535   AM_RANGE( 0x7a, 0x7b ) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)   // AY8910
535   AM_RANGE( 0x7a, 0x7b ) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)   // AY8910
536536//  AM_RANGE( 0x7c, 0x7c ) AM_WRITENOP   // CRT Controller
537537//  AM_RANGE( 0x7d, 0x7d ) AM_WRITENOP   //
538538   AM_RANGE( 0x7e, 0x7e ) AM_WRITE(dynax_blit_romregion_w) // Blitter ROM bank
r22781r22782
554554   AM_RANGE( 0x30, 0x30 ) AM_WRITE(adpcm_reset_w)  // MSM5205 reset
555555   AM_RANGE( 0x32, 0x32 ) AM_WRITE(adpcm_data_w)           // MSM5205 data
556556   AM_RANGE( 0x34, 0x35 ) AM_DEVWRITE_LEGACY("ymsnd", ym2413_w)        //
557   AM_RANGE( 0x36, 0x36 ) AM_DEVREAD_LEGACY("aysnd", ay8910_r)     // AY8910, DSW1
558   AM_RANGE( 0x38, 0x38 ) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_w)   // AY8910
559   AM_RANGE( 0x3a, 0x3a ) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w)    //
557   AM_RANGE( 0x36, 0x36 ) AM_DEVREAD("aysnd", ay8910_device, data_r)     // AY8910, DSW1
558   AM_RANGE( 0x38, 0x38 ) AM_DEVWRITE("aysnd", ay8910_device, data_w)   // AY8910
559   AM_RANGE( 0x3a, 0x3a ) AM_DEVWRITE("aysnd", ay8910_device, address_w)    //
560560   AM_RANGE( 0x40, 0x40 ) AM_WRITE(dynax_blit_pen_w)       // Destination Pen
561561   AM_RANGE( 0x41, 0x41 ) AM_WRITE(dynax_blit_dest_w)      // Destination Layer
562562   AM_RANGE( 0x42, 0x42 ) AM_WRITE(dynax_blit_palette01_w) // Layers Palettes
r22781r22782
640640   AM_RANGE( 0x32, 0x32 ) AM_WRITE(adpcm_data_w)           // MSM5205 data
641641   AM_RANGE( 0x34, 0x35 ) AM_DEVWRITE_LEGACY("ymsnd", ym2413_w)        //
642642
643   AM_RANGE( 0x36, 0x36 ) AM_DEVREAD_LEGACY("aysnd", ay8910_r)     // AY8910, DSW1
644   AM_RANGE( 0x38, 0x38 ) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_w)   // AY8910
645   AM_RANGE( 0x3a, 0x3a ) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w)    //
643   AM_RANGE( 0x36, 0x36 ) AM_DEVREAD("aysnd", ay8910_device, data_r)     // AY8910, DSW1
644   AM_RANGE( 0x38, 0x38 ) AM_DEVWRITE("aysnd", ay8910_device, data_w)   // AY8910
645   AM_RANGE( 0x3a, 0x3a ) AM_DEVWRITE("aysnd", ay8910_device, address_w)    //
646646
647647   AM_RANGE( 0x40, 0x40 ) AM_WRITE(dynax_blit_pen_w)       // Destination Pen
648648   AM_RANGE( 0x41, 0x41 ) AM_WRITE(dynax_blit_dest_w)      // Destination Layer
r22781r22782
779779   AM_RANGE( 0x20, 0x20 ) AM_WRITE(adpcm_reset_w)  // MSM5205 reset
780780   AM_RANGE( 0x22, 0x22 ) AM_WRITE(adpcm_data_w)           // MSM5205 data
781781   AM_RANGE( 0x24, 0x25 ) AM_DEVWRITE_LEGACY("ymsnd", ym2413_w)        //
782   AM_RANGE( 0x28, 0x28 ) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_w)   // AY8910
783   AM_RANGE( 0x2a, 0x2a ) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w)    //
782   AM_RANGE( 0x28, 0x28 ) AM_DEVWRITE("aysnd", ay8910_device, data_w)   // AY8910
783   AM_RANGE( 0x2a, 0x2a ) AM_DEVWRITE("aysnd", ay8910_device, address_w)    //
784784   AM_RANGE( 0x48, 0x48 ) AM_WRITE(dynax_extra_scrollx_w)  // screen scroll X
785785   AM_RANGE( 0x49, 0x49 ) AM_WRITE(dynax_extra_scrolly_w)  // screen scroll Y
786786   AM_RANGE( 0x4a, 0x4a ) AM_WRITE(yarunara_rombank_w)     // BANK ROM Select
r22781r22782
818818   AM_RANGE( 0x30, 0x30 ) AM_WRITE(adpcm_reset_w)  // MSM5205 reset
819819   AM_RANGE( 0x32, 0x32 ) AM_WRITE(adpcm_data_w)           // MSM5205 data
820820   AM_RANGE( 0x34, 0x35 ) AM_DEVWRITE_LEGACY("ymsnd", ym2413_w)        //
821   AM_RANGE( 0x38, 0x38 ) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_w)   // AY8910
822   AM_RANGE( 0x3a, 0x3a ) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w)    //
821   AM_RANGE( 0x38, 0x38 ) AM_DEVWRITE("aysnd", ay8910_device, data_w)   // AY8910
822   AM_RANGE( 0x3a, 0x3a ) AM_DEVWRITE("aysnd", ay8910_device, address_w)    //
823823   AM_RANGE( 0x40, 0x40 ) AM_WRITE(dynax_blit_pen_w)       // Destination Pen
824824   AM_RANGE( 0x41, 0x41 ) AM_WRITE(dynax_blit_dest_w)      // Destination Layer
825825   AM_RANGE( 0x42, 0x42 ) AM_WRITE(dynax_blit_palette01_w) // Layers Palettes
r22781r22782
901901   AM_RANGE( 0x00, 0x00 ) AM_WRITE(adpcm_reset_w)  // MSM5205 reset
902902   AM_RANGE( 0x02, 0x02 ) AM_WRITE(adpcm_data_w)           // MSM5205 data
903903   AM_RANGE( 0x04, 0x05 ) AM_DEVWRITE_LEGACY("ymsnd", ym2413_w)        //
904   AM_RANGE( 0x08, 0x08 ) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_w)   // AY8910
905   AM_RANGE( 0x0a, 0x0a ) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w)    //
904   AM_RANGE( 0x08, 0x08 ) AM_DEVWRITE("aysnd", ay8910_device, data_w)   // AY8910
905   AM_RANGE( 0x0a, 0x0a ) AM_DEVWRITE("aysnd", ay8910_device, address_w)    //
906906   AM_RANGE( 0x10, 0x10 ) AM_WRITE(hanamai_keyboard_w)     // keyboard row select
907907   AM_RANGE( 0x11, 0x11 ) AM_READ_PORT("COINS")            // Coins
908908   AM_RANGE( 0x12, 0x12 ) AM_READ(hanamai_keyboard_1_r)        // P2
r22781r22782
10201020   ADDRESS_MAP_GLOBAL_MASK(0xff)
10211021   AM_RANGE( 0x00, 0x00 ) AM_WRITE(jantouki_sound_rombank_w)       // BANK ROM Select
10221022   AM_RANGE( 0x10, 0x10 ) AM_WRITE(jantouki_sound_vblank_ack_w)    // VBlank IRQ Ack
1023   AM_RANGE( 0x21, 0x21 ) AM_DEVREAD_LEGACY("aysnd", ay8910_r)         // AY8910
1024   AM_RANGE( 0x22, 0x23 ) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_address_w)   //
1023   AM_RANGE( 0x21, 0x21 ) AM_DEVREAD("aysnd", ay8910_device, data_r)         // AY8910
1024   AM_RANGE( 0x22, 0x23 ) AM_DEVWRITE("aysnd", ay8910_device, data_address_w)   //
10251025   AM_RANGE( 0x28, 0x29 ) AM_DEVREADWRITE("ymsnd", ym2203_device, read, write) //
10261026   AM_RANGE( 0x30, 0x30 ) AM_WRITE(adpcm_reset_w)      // MSM5205 reset
10271027   AM_RANGE( 0x40, 0x40 ) AM_WRITE(adpcm_data_w)               // MSM5205 data
r22781r22782
10591059   AM_RANGE( 0x00, 0x00 ) AM_WRITE(adpcm_reset_w)  // MSM5205 reset
10601060   AM_RANGE( 0x02, 0x02 ) AM_WRITE(adpcm_data_w)           // MSM5205 data
10611061   AM_RANGE( 0x04, 0x05 ) AM_DEVWRITE_LEGACY("ymsnd", ym2413_w)        //
1062   AM_RANGE( 0x08, 0x08 ) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_w)   // AY8910
1063   AM_RANGE( 0x0a, 0x0a ) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w)    //
1062   AM_RANGE( 0x08, 0x08 ) AM_DEVWRITE("aysnd", ay8910_device, data_w)   // AY8910
1063   AM_RANGE( 0x0a, 0x0a ) AM_DEVWRITE("aysnd", ay8910_device, address_w)    //
10641064   AM_RANGE( 0x11, 0x12 ) AM_WRITE(mjelctrn_blitter_ack_w) //?
10651065//  AM_RANGE( 0x20, 0x20 ) AM_WRITENOP   // CRT Controller
10661066//  AM_RANGE( 0x21, 0x21 ) AM_WRITENOP   // CRT Controller
r22781r22782
13391339   AM_RANGE(  0x6000,  0x6fff ) AM_RAM
13401340   AM_RANGE(  0x7000,  0x7fff ) AM_RAM AM_SHARE("nvram")
13411341   AM_RANGE(  0x8000,  0xffff ) AM_READWRITE(tenkai_8000_r, tenkai_8000_w)
1342   AM_RANGE( 0x10000, 0x10000 ) AM_DEVREAD_LEGACY("aysnd", ay8910_r)       // AY8910
1343   AM_RANGE( 0x10008, 0x10008 ) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_w) //
1344   AM_RANGE( 0x10010, 0x10010 ) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w)  //
1342   AM_RANGE( 0x10000, 0x10000 ) AM_DEVREAD("aysnd", ay8910_device, data_r)       // AY8910
1343   AM_RANGE( 0x10008, 0x10008 ) AM_DEVWRITE("aysnd", ay8910_device, data_w) //
1344   AM_RANGE( 0x10010, 0x10010 ) AM_DEVWRITE("aysnd", ay8910_device, address_w)  //
13451345   AM_RANGE( 0x10020, 0x10021 ) AM_DEVWRITE_LEGACY("ymsnd", ym2413_w)      //
13461346   AM_RANGE( 0x10040, 0x10040 ) AM_WRITE(dynax_blit_pen_w)     // Destination Pen
13471347   AM_RANGE( 0x10044, 0x10044 ) AM_WRITE(tenkai_blit_dest_w)       // Destination Layer
trunk/src/mame/drivers/4enraya.c
r22781r22782
6969WRITE8_MEMBER(_4enraya_state::sound_control_w)
7070{
7171   if ((m_last_snd_ctrl & m_snd_latch_bit ) == m_snd_latch_bit && (data & m_snd_latch_bit) == 0x00)
72      ay8910_data_address_w(m_ay, space, m_last_snd_ctrl, m_soundlatch);
72      m_ay->data_address_w(space, m_last_snd_ctrl, m_soundlatch);
7373
7474   m_last_snd_ctrl = data;
7575}
trunk/src/mame/drivers/funkybee.c
r22781r22782
105105
106106static ADDRESS_MAP_START( io_map, AS_IO, 8, funkybee_state )
107107   ADDRESS_MAP_GLOBAL_MASK(0xff)
108   AM_RANGE(0x00, 0x01) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
109   AM_RANGE(0x02, 0x02) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
108   AM_RANGE(0x00, 0x01) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
109   AM_RANGE(0x02, 0x02) AM_DEVREAD("aysnd", ay8910_device, data_r)
110110ADDRESS_MAP_END
111111
112112
trunk/src/mame/drivers/vlc.c
r22781r22782
607607   AM_RANGE(0x00a00000, 0x00a00001) AM_READWRITE(io_board_r,io_board_w)
608608   AM_RANGE(0x00a08000, 0x00a08001) AM_WRITE(io_board_x)
609609   AM_RANGE(0x00a10000, 0x00a10001) AM_WRITE(watchdog_reset16_w )
610   AM_RANGE(0x00a20000, 0x00a20001) AM_DEVWRITE8_LEGACY("aysnd", ay8910_address_w,0x00ff )
611   AM_RANGE(0x00a28000, 0x00a28001) AM_DEVWRITE8_LEGACY("aysnd", ay8910_data_w   ,0x00ff )
610   AM_RANGE(0x00a20000, 0x00a20001) AM_DEVWRITE8("aysnd", ay8910_device, address_w, 0x00ff)
611   AM_RANGE(0x00a28000, 0x00a28001) AM_DEVWRITE8("aysnd", ay8910_device, data_w, 0x00ff)
612612   AM_RANGE(0x00a30000, 0x00A300ff) AM_DEVREADWRITE8("rtc",msm6242_device, read, write, 0x00ff)
613613   AM_RANGE(0x00a40000, 0x00A40001) AM_READWRITE( nevada_sec_r, nevada_sec_w)
614614      //AM_RANGE(0x00b00000, 0x00b01fff) AM_RAM_WRITE(nevada_videoram_w) AM_BASE_MEMBER(nevada_state, m_videoram)
trunk/src/mame/drivers/centiped.c
r22781r22782
700700   AM_RANGE(0x0c01, 0x0c01) AM_MIRROR(0x4000) AM_READ_PORT("IN1")      /* IN1 */
701701   AM_RANGE(0x0c02, 0x0c02) AM_MIRROR(0x4000) AM_READ(centiped_IN2_r)  /* IN2 */
702702   AM_RANGE(0x0c03, 0x0c03) AM_MIRROR(0x4000) AM_READ_PORT("IN3")      /* IN3 */
703   AM_RANGE(0x1000, 0x1001) AM_MIRROR(0x4000) AM_DEVWRITE_LEGACY("pokey", ay8910_data_address_w)
704   AM_RANGE(0x1001, 0x1001) AM_MIRROR(0x4000) AM_DEVREAD_LEGACY("pokey", ay8910_r)
703   AM_RANGE(0x1000, 0x1001) AM_MIRROR(0x4000) AM_DEVWRITE("pokey", ay8910_device, data_address_w)
704   AM_RANGE(0x1001, 0x1001) AM_MIRROR(0x4000) AM_DEVREAD("pokey", ay8910_device, data_r)
705705   AM_RANGE(0x1400, 0x140f) AM_MIRROR(0x4000) AM_WRITE(centiped_paletteram_w) AM_SHARE("paletteram")
706706   AM_RANGE(0x1600, 0x163f) AM_MIRROR(0x4000) AM_DEVWRITE("earom", atari_vg_earom_device, write)
707707   AM_RANGE(0x1680, 0x1680) AM_MIRROR(0x4000) AM_DEVWRITE("earom", atari_vg_earom_device, ctrl_w)
r22781r22782
718718
719719static ADDRESS_MAP_START( magworm_map, AS_PROGRAM, 8, centiped_state )
720720   AM_IMPORT_FROM(centiped_base_map)
721   AM_RANGE(0x1001, 0x1001) AM_DEVWRITE_LEGACY("pokey", ay8910_address_w)
722   AM_RANGE(0x1003, 0x1003) AM_DEVREADWRITE_LEGACY("pokey", ay8910_r, ay8910_data_w)
721   AM_RANGE(0x1001, 0x1001) AM_DEVWRITE("pokey", ay8910_device, address_w)
722   AM_RANGE(0x1003, 0x1003) AM_DEVREADWRITE("pokey", ay8910_device, data_r, data_w)
723723ADDRESS_MAP_END
724724
725725
r22781r22782
731731
732732WRITE8_MEMBER(centiped_state::caterplr_AY8910_w)
733733{
734   device_t *device = machine().device("pokey");
735   ay8910_address_w(device, space, 0, offset);
736   ay8910_data_w(device, space, 0, data);
734   ay8910_device *ay8910 = machine().device<ay8910_device>("pokey");
735   ay8910->address_w(space, 0, offset);
736   ay8910->data_w(space, 0, data);
737737}
738738
739739READ8_MEMBER(centiped_state::caterplr_AY8910_r)
740740{
741   device_t *device = machine().device("pokey");
742   ay8910_address_w(device, space, 0, offset);
743   return ay8910_r(device, space, 0);
741   ay8910_device *ay8910 = machine().device<ay8910_device>("pokey");
742   ay8910->address_w(space, 0, offset);
743   return ay8910->data_r(space, 0);
744744}
745745
746746
trunk/src/mame/drivers/aces1.c
r22781r22782
183183static ADDRESS_MAP_START( aces1_map, AS_PROGRAM, 8, aces1_state )
184184   AM_RANGE(0x0000, 0x7fff) AM_ROM
185185   AM_RANGE(0x8000, 0x8fff) AM_RAM
186   AM_RANGE(0xadf0, 0xadf3) AM_DEVREADWRITE_LEGACY("aysnd", ay8910_r, ay8910_address_data_w) //  Dips, Sound
186   AM_RANGE(0xadf0, 0xadf3) AM_DEVREADWRITE("aysnd", ay8910_device, data_r, address_data_w) //  Dips, Sound
187187   AM_RANGE(0xafb0, 0xafb3) AM_DEVREADWRITE("ppi8255_ic24", i8255_device, read, write) // IC24 - lamps, 7segs
188188   AM_RANGE(0xafd0, 0xafd3) AM_DEVREADWRITE("ppi8255_ic25", i8255_device, read, write) // IC25 - lamps, meters, reel comms (writes)
189189   AM_RANGE(0xafe0, 0xafe3) AM_DEVREADWRITE("ppi8255_ic37", i8255_device, read, write)//  IC37 - doors, coins, reel optics (reads)
trunk/src/mame/drivers/pitnrun.c
r22781r22782
124124static ADDRESS_MAP_START( pitnrun_sound_io_map, AS_IO, 8, pitnrun_state )
125125   ADDRESS_MAP_GLOBAL_MASK(0xff)
126126   AM_RANGE(0x00, 0x00) AM_WRITE(soundlatch_clear_byte_w)
127   AM_RANGE(0x8c, 0x8d) AM_DEVWRITE_LEGACY("ay2", ay8910_address_data_w)
128   AM_RANGE(0x8e, 0x8f) AM_DEVWRITE_LEGACY("ay1", ay8910_address_data_w)
129   AM_RANGE(0x8f, 0x8f) AM_DEVREAD_LEGACY("ay1", ay8910_r)
127   AM_RANGE(0x8c, 0x8d) AM_DEVWRITE("ay2", ay8910_device, address_data_w)
128   AM_RANGE(0x8e, 0x8f) AM_DEVWRITE("ay1", ay8910_device, address_data_w)
129   AM_RANGE(0x8f, 0x8f) AM_DEVREAD("ay1", ay8910_device, data_r)
130130   AM_RANGE(0x90, 0x96) AM_WRITENOP
131131   AM_RANGE(0x97, 0x97) AM_WRITENOP
132132   AM_RANGE(0x98, 0x98) AM_WRITENOP
trunk/src/mame/drivers/citycon.c
r22781r22782
4343
4444static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, citycon_state )
4545   AM_RANGE(0x0000, 0x0fff) AM_RAM
46   AM_RANGE(0x4000, 0x4001) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
47//  AM_RANGE(0x4002, 0x4002) AM_DEVREAD_LEGACY("aysnd", ay8910_r)  /* ?? */
46   AM_RANGE(0x4000, 0x4001) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
47//  AM_RANGE(0x4002, 0x4002) AM_DEVREAD("aysnd", ay8910_device, data_r)  /* ?? */
4848   AM_RANGE(0x6000, 0x6001) AM_DEVREADWRITE("ymsnd", ym2203_device, read, write)
4949   AM_RANGE(0x8000, 0xffff) AM_ROM
5050ADDRESS_MAP_END
trunk/src/mame/drivers/scobra.c
r22781r22782
251251
252252static ADDRESS_MAP_START( scobra_sound_io_map, AS_IO, 8, scobra_state )
253253   ADDRESS_MAP_GLOBAL_MASK(0xff)
254   AM_RANGE(0x10, 0x10) AM_DEVWRITE_LEGACY("ay1", ay8910_address_w)
255   AM_RANGE(0x20, 0x20) AM_DEVREADWRITE_LEGACY("ay1", ay8910_r, ay8910_data_w)
256   AM_RANGE(0x40, 0x40) AM_DEVWRITE_LEGACY("ay2", ay8910_address_w)
257   AM_RANGE(0x80, 0x80) AM_DEVREADWRITE_LEGACY("ay2", ay8910_r, ay8910_data_w)
254   AM_RANGE(0x10, 0x10) AM_DEVWRITE("ay1", ay8910_device, address_w)
255   AM_RANGE(0x20, 0x20) AM_DEVREADWRITE("ay1", ay8910_device, data_r, data_w)
256   AM_RANGE(0x40, 0x40) AM_DEVWRITE("ay2", ay8910_device, address_w)
257   AM_RANGE(0x80, 0x80) AM_DEVREADWRITE("ay2", ay8910_device, data_r, data_w)
258258ADDRESS_MAP_END
259259
260260static ADDRESS_MAP_START( hustler_sound_map, AS_PROGRAM, 8, scobra_state )
r22781r22782
265265
266266static ADDRESS_MAP_START( hustler_sound_io_map, AS_IO, 8, scobra_state )
267267   ADDRESS_MAP_GLOBAL_MASK(0xff)
268   AM_RANGE(0x40, 0x40) AM_DEVREADWRITE_LEGACY("aysnd", ay8910_r, ay8910_data_w)
269   AM_RANGE(0x80, 0x80) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w)
268   AM_RANGE(0x40, 0x40) AM_DEVREADWRITE("aysnd", ay8910_device, data_r, data_w)
269   AM_RANGE(0x80, 0x80) AM_DEVWRITE("aysnd", ay8910_device, address_w)
270270ADDRESS_MAP_END
271271
272272
r22781r22782
278278
279279static ADDRESS_MAP_START( hustlerb_sound_io_map, AS_IO, 8, scobra_state )
280280   ADDRESS_MAP_GLOBAL_MASK(0xff)
281   AM_RANGE(0x40, 0x40) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w)
282   AM_RANGE(0x80, 0x80) AM_DEVREADWRITE_LEGACY("aysnd", ay8910_r, ay8910_data_w)
281   AM_RANGE(0x40, 0x40) AM_DEVWRITE("aysnd", ay8910_device, address_w)
282   AM_RANGE(0x80, 0x80) AM_DEVREADWRITE("aysnd", ay8910_device, data_r, data_w)
283283ADDRESS_MAP_END
284284
285285
trunk/src/mame/drivers/nightgal.c
r22781r22782
523523
524524static ADDRESS_MAP_START( nightgal_io, AS_IO, 8, nightgal_state )
525525   ADDRESS_MAP_GLOBAL_MASK(0xff)
526   AM_RANGE(0x01,0x01) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
527   AM_RANGE(0x02,0x03) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_address_w)
526   AM_RANGE(0x01,0x01) AM_DEVREAD("aysnd", ay8910_device, data_r)
527   AM_RANGE(0x02,0x03) AM_DEVWRITE("aysnd", ay8910_device, data_address_w)
528528//  AM_RANGE(0x10,0x10) AM_WRITE(output_w)
529529   AM_RANGE(0x10,0x10) AM_READ_PORT("DSWC")
530530   AM_RANGE(0x11,0x11) AM_READ_PORT("SYSA")
r22781r22782
598598
599599static ADDRESS_MAP_START( royalqn_io, AS_IO, 8, nightgal_state )
600600   ADDRESS_MAP_GLOBAL_MASK(0xff)
601   AM_RANGE(0x01,0x01) AM_MIRROR(0xec) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
602   AM_RANGE(0x02,0x03) AM_MIRROR(0xec) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_address_w)
601   AM_RANGE(0x01,0x01) AM_MIRROR(0xec) AM_DEVREAD("aysnd", ay8910_device, data_r)
602   AM_RANGE(0x02,0x03) AM_MIRROR(0xec) AM_DEVWRITE("aysnd", ay8910_device, data_address_w)
603603   AM_RANGE(0x10,0x10) AM_MIRROR(0xe8) AM_READ_PORT("DSWC") AM_WRITENOP //AM_WRITE(output_w)
604604   AM_RANGE(0x11,0x11) AM_MIRROR(0xe8) AM_READ_PORT("SYSA") AM_WRITE(mux_w)
605605   AM_RANGE(0x12,0x12) AM_MIRROR(0xe8) AM_READ_PORT("DSWA") AM_WRITE(royalqn_blitter_0_w)
trunk/src/mame/drivers/skyarmy.c
r22781r22782
186186
187187static ADDRESS_MAP_START( skyarmy_io_map, AS_IO, 8, skyarmy_state )
188188   ADDRESS_MAP_GLOBAL_MASK(0xff)
189   AM_RANGE(0x04, 0x05) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
190   AM_RANGE(0x06, 0x06) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
189   AM_RANGE(0x04, 0x05) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
190   AM_RANGE(0x06, 0x06) AM_DEVREAD("aysnd", ay8910_device, data_r)
191191ADDRESS_MAP_END
192192
193193
trunk/src/mame/drivers/battlex.c
r22781r22782
9191   AM_RANGE(0x10, 0x10) AM_WRITE(battlex_flipscreen_w)
9292
9393   /* verify all of these */
94   AM_RANGE(0x22, 0x23) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_address_w)
94   AM_RANGE(0x22, 0x23) AM_DEVWRITE("aysnd", ay8910_device, data_address_w)
9595   AM_RANGE(0x30, 0x30) AM_WRITE(battlex_scroll_starfield_w)
9696   AM_RANGE(0x32, 0x32) AM_WRITE(battlex_scroll_x_lsb_w)
9797   AM_RANGE(0x33, 0x33) AM_WRITE(battlex_scroll_x_msb_w)
trunk/src/mame/drivers/zaccaria.c
r22781r22782
112112
113113READ8_MEMBER(zaccaria_state::zaccaria_port0a_r)
114114{
115   return ay8910_r(machine().device((m_active_8910 == 0) ? "ay1" : "ay2"), space, 0);
115   return machine().device<ay8910_device>((m_active_8910 == 0) ? "ay1" : "ay2")->data_r(space, 0);
116116}
117117
118118WRITE8_MEMBER(zaccaria_state::zaccaria_port0a_w)
r22781r22782
126126   if ((m_last_port0b & 0x02) == 0x02 && (data & 0x02) == 0x00)
127127   {
128128      /* bit 0 goes to the 8910 #0 BC1 pin */
129      ay8910_data_address_w(machine().device("ay1"), space, m_last_port0b, m_port0a);
129      machine().device<ay8910_device>("ay1")->data_address_w(space, m_last_port0b, m_port0a);
130130   }
131131   else if ((m_last_port0b & 0x02) == 0x00 && (data & 0x02) == 0x02)
132132   {
r22781r22782
138138   if ((m_last_port0b & 0x08) == 0x08 && (data & 0x08) == 0x00)
139139   {
140140      /* bit 2 goes to the 8910 #1 BC1 pin */
141      ay8910_data_address_w(machine().device("ay2"), space, m_last_port0b >> 2, m_port0a);
141      machine().device<ay8910_device>("ay2")->data_address_w(space, m_last_port0b >> 2, m_port0a);
142142   }
143143   else if ((m_last_port0b & 0x08) == 0x00 && (data & 0x08) == 0x08)
144144   {
trunk/src/mame/drivers/dmndrby.c
r22781r22782
151151static ADDRESS_MAP_START( dderby_sound_map, AS_PROGRAM, 8, dmndrby_state )
152152   AM_RANGE(0x0000, 0x0fff) AM_ROM
153153   AM_RANGE(0x1000, 0x1000) AM_RAM //???
154   AM_RANGE(0x4000, 0x4001) AM_DEVWRITE_LEGACY("ay1", ay8910_address_data_w)
154   AM_RANGE(0x4000, 0x4001) AM_DEVWRITE("ay1", ay8910_device, address_data_w)
155155   AM_RANGE(0x4000, 0x4000) AM_READ(soundlatch_byte_r)
156   AM_RANGE(0x4001, 0x4001) AM_DEVREAD_LEGACY("ay1", ay8910_r)
156   AM_RANGE(0x4001, 0x4001) AM_DEVREAD("ay1", ay8910_device, data_r)
157157   AM_RANGE(0x6000, 0x67ff) AM_RAM
158158ADDRESS_MAP_END
159159
trunk/src/mame/drivers/mjsister.c
r22781r22782
290290static ADDRESS_MAP_START( mjsister_io_map, AS_IO, 8, mjsister_state )
291291   ADDRESS_MAP_GLOBAL_MASK(0xff)
292292   AM_RANGE(0x00, 0x01) AM_WRITENOP /* HD46505? */
293   AM_RANGE(0x10, 0x10) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w)
294   AM_RANGE(0x11, 0x11) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
295   AM_RANGE(0x12, 0x12) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_w)
293   AM_RANGE(0x10, 0x10) AM_DEVWRITE("aysnd", ay8910_device, address_w)
294   AM_RANGE(0x11, 0x11) AM_DEVREAD("aysnd", ay8910_device, data_r)
295   AM_RANGE(0x12, 0x12) AM_DEVWRITE("aysnd", ay8910_device, data_w)
296296   AM_RANGE(0x20, 0x20) AM_READ(mjsister_keys_r)
297297   AM_RANGE(0x21, 0x21) AM_READ_PORT("IN0")
298298   AM_RANGE(0x30, 0x30) AM_WRITE(mjsister_banksel1_w)
trunk/src/mame/drivers/munchmo.c
r22781r22782
6868
6969READ8_MEMBER(munchmo_state::munchmo_ay1reset_r)
7070{
71   device_t *device = machine().device("ay1");
72   ay8910_reset_w(device,space,0,0);
71   ay8910_device *ay8910 = machine().device<ay8910_device>("ay1");
72   ay8910->reset_w(space,0,0);
7373   return 0;
7474}
7575
7676READ8_MEMBER(munchmo_state::munchmo_ay2reset_r)
7777{
78   device_t *device = machine().device("ay2");
79   ay8910_reset_w(device,space,0,0);
78   ay8910_device *ay8910 = machine().device<ay8910_device>("ay2");
79   ay8910->reset_w(space,0,0);
8080   return 0;
8181}
8282/*************************************
r22781r22782
113113static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, munchmo_state )
114114   AM_RANGE(0x0000, 0x1fff) AM_ROM
115115   AM_RANGE(0x2000, 0x3fff) AM_READ(soundlatch_byte_r)
116   AM_RANGE(0x4000, 0x4fff) AM_DEVWRITE_LEGACY("ay1", ay8910_data_w)
117   AM_RANGE(0x5000, 0x5fff) AM_DEVWRITE_LEGACY("ay1", ay8910_address_w)
118   AM_RANGE(0x6000, 0x6fff) AM_DEVWRITE_LEGACY("ay2", ay8910_data_w)
119   AM_RANGE(0x7000, 0x7fff) AM_DEVWRITE_LEGACY("ay2", ay8910_address_w)
120   AM_RANGE(0x8000, 0x9fff) AM_READ(munchmo_ay1reset_r) AM_DEVWRITE_LEGACY("ay1",ay8910_reset_w)
121   AM_RANGE(0xa000, 0xbfff) AM_READ(munchmo_ay2reset_r) AM_DEVWRITE_LEGACY("ay2",ay8910_reset_w)
116   AM_RANGE(0x4000, 0x4fff) AM_DEVWRITE("ay1", ay8910_device, data_w)
117   AM_RANGE(0x5000, 0x5fff) AM_DEVWRITE("ay1", ay8910_device, address_w)
118   AM_RANGE(0x6000, 0x6fff) AM_DEVWRITE("ay2", ay8910_device, data_w)
119   AM_RANGE(0x7000, 0x7fff) AM_DEVWRITE("ay2", ay8910_device, address_w)
120   AM_RANGE(0x8000, 0x9fff) AM_READ(munchmo_ay1reset_r) AM_DEVWRITE("ay1", ay8910_device, reset_w)
121   AM_RANGE(0xa000, 0xbfff) AM_READ(munchmo_ay2reset_r) AM_DEVWRITE("ay2", ay8910_device, reset_w)
122122   AM_RANGE(0xc000, 0xdfff) AM_WRITE(sound_nmi_ack_w)
123123   AM_RANGE(0xe000, 0xe7ff) AM_MIRROR(0x1800) AM_RAM // is mirror ok?
124124ADDRESS_MAP_END
trunk/src/mame/drivers/espial.c
r22781r22782
151151
152152static ADDRESS_MAP_START( espial_sound_io_map, AS_IO, 8, espial_state )
153153   ADDRESS_MAP_GLOBAL_MASK(0xff)
154   AM_RANGE(0x00, 0x01) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
154   AM_RANGE(0x00, 0x01) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
155155ADDRESS_MAP_END
156156
157157
trunk/src/mame/drivers/nbmj8891.c
r22781r22782
478478   AM_RANGE(0x40, 0x4f) AM_WRITE(nbmj8891_clut_w)
479479//  AM_RANGE(0x50, 0x50) AM_WRITE_LEGACY(nb1413m3_nmi_clock_w)
480480   AM_RANGE(0x70, 0x70) AM_WRITE(nbmj8891_scrolly_w)
481   AM_RANGE(0x81, 0x81) AM_DEVREAD_LEGACY("fmsnd", ay8910_r)
482   AM_RANGE(0x82, 0x83) AM_DEVWRITE_LEGACY("fmsnd", ay8910_data_address_w)
481   AM_RANGE(0x81, 0x81) AM_DEVREAD("fmsnd", ay8910_device, data_r)
482   AM_RANGE(0x82, 0x83) AM_DEVWRITE("fmsnd", ay8910_device, data_address_w)
483483   AM_RANGE(0x90, 0x90) AM_READ_LEGACY(nb1413m3_inputport0_r) AM_WRITENOP
484484   AM_RANGE(0xa0, 0xa0) AM_READWRITE_LEGACY(nb1413m3_inputport1_r,nb1413m3_inputportsel_w)
485485   AM_RANGE(0xb0, 0xb0) AM_READWRITE_LEGACY(nb1413m3_inputport2_r,nb1413m3_sndrombank1_w)
r22781r22782
555555   AM_RANGE(0x20, 0x20) AM_WRITE(nbmj8891_clutsel_w)
556556   AM_RANGE(0x40, 0x4f) AM_WRITE(nbmj8891_clut_w)
557557   AM_RANGE(0x50, 0x50) AM_WRITE(nbmj8891_scrolly_w)
558   AM_RANGE(0x81, 0x81) AM_DEVREAD_LEGACY("fmsnd", ay8910_r)
559   AM_RANGE(0x82, 0x83) AM_DEVWRITE_LEGACY("fmsnd", ay8910_data_address_w)
558   AM_RANGE(0x81, 0x81) AM_DEVREAD("fmsnd", ay8910_device, data_r)
559   AM_RANGE(0x82, 0x83) AM_DEVWRITE("fmsnd", ay8910_device, data_address_w)
560560   AM_RANGE(0x90, 0x90) AM_READ_LEGACY(nb1413m3_inputport0_r)
561561   AM_RANGE(0xa0, 0xa0) AM_READWRITE_LEGACY(nb1413m3_inputport1_r,nb1413m3_inputportsel_w)
562562   AM_RANGE(0xb0, 0xb0) AM_READWRITE_LEGACY(nb1413m3_inputport2_r,nb1413m3_sndrombank1_w)
r22781r22782
628628static ADDRESS_MAP_START( taiwanmb_io_map, AS_IO, 8, nbmj8891_state )
629629   ADDRESS_MAP_GLOBAL_MASK(0xff)
630630   AM_RANGE(0x00, 0x7f) AM_READ_LEGACY(nb1413m3_sndrom_r)
631   AM_RANGE(0x81, 0x81) AM_DEVREAD_LEGACY("fmsnd", ay8910_r)
632   AM_RANGE(0x82, 0x83) AM_DEVWRITE_LEGACY("fmsnd", ay8910_data_address_w)
631   AM_RANGE(0x81, 0x81) AM_DEVREAD("fmsnd", ay8910_device, data_r)
632   AM_RANGE(0x82, 0x83) AM_DEVWRITE("fmsnd", ay8910_device, data_address_w)
633633   AM_RANGE(0x90, 0x90) AM_READ_LEGACY(nb1413m3_inputport0_r) //AM_WRITENOP   // ?
634634   AM_RANGE(0xa0, 0xa0) AM_READWRITE_LEGACY(nb1413m3_inputport1_r,nb1413m3_inputportsel_w)
635635   AM_RANGE(0xb0, 0xb0) AM_READWRITE_LEGACY(nb1413m3_inputport2_r,nb1413m3_sndrombank1_w)
trunk/src/mame/drivers/holeland.c
r22781r22782
4242static ADDRESS_MAP_START( io_map, AS_IO, 8, holeland_state )
4343   ADDRESS_MAP_GLOBAL_MASK(0xff)
4444   AM_RANGE(0x01, 0x01) AM_READ(watchdog_reset_r)  /* ? */
45   AM_RANGE(0x04, 0x04) AM_DEVREAD_LEGACY("ay1", ay8910_r)
46   AM_RANGE(0x04, 0x05) AM_DEVWRITE_LEGACY("ay1", ay8910_address_data_w)
47   AM_RANGE(0x06, 0x06) AM_DEVREAD_LEGACY("ay2", ay8910_r)
48   AM_RANGE(0x06, 0x07) AM_DEVWRITE_LEGACY("ay2", ay8910_address_data_w)
45   AM_RANGE(0x04, 0x04) AM_DEVREAD("ay1", ay8910_device, data_r)
46   AM_RANGE(0x04, 0x05) AM_DEVWRITE("ay1", ay8910_device, address_data_w)
47   AM_RANGE(0x06, 0x06) AM_DEVREAD("ay2", ay8910_device, data_r)
48   AM_RANGE(0x06, 0x07) AM_DEVWRITE("ay2", ay8910_device, address_data_w)
4949ADDRESS_MAP_END
5050
5151
trunk/src/mame/drivers/liberate.c
r22781r22782
312312
313313static ADDRESS_MAP_START( prosoccr_sound_map, AS_PROGRAM, 8, liberate_state )
314314   AM_RANGE(0x0000, 0x01ff) AM_RAM
315   AM_RANGE(0x2000, 0x2000) AM_DEVWRITE_LEGACY("ay1", ay8910_data_w)
316   AM_RANGE(0x4000, 0x4000) AM_DEVWRITE_LEGACY("ay1", ay8910_address_w)
317   AM_RANGE(0x6000, 0x6000) AM_DEVWRITE_LEGACY("ay2", ay8910_data_w)
318   AM_RANGE(0x8000, 0x8000) AM_DEVWRITE_LEGACY("ay2", ay8910_address_w)
315   AM_RANGE(0x2000, 0x2000) AM_DEVWRITE("ay1", ay8910_device, data_w)
316   AM_RANGE(0x4000, 0x4000) AM_DEVWRITE("ay1", ay8910_device, address_w)
317   AM_RANGE(0x6000, 0x6000) AM_DEVWRITE("ay2", ay8910_device, data_w)
318   AM_RANGE(0x8000, 0x8000) AM_DEVWRITE("ay2", ay8910_device, address_w)
319319   AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r)
320320   AM_RANGE(0xc000, 0xc000) AM_WRITENOP //irq ack
321321   AM_RANGE(0xe000, 0xffff) AM_ROM
r22781r22782
324324static ADDRESS_MAP_START( liberate_sound_map, AS_PROGRAM, 8, liberate_state )
325325   AM_RANGE(0x0000, 0x01ff) AM_RAM
326326   AM_RANGE(0x1000, 0x1000) AM_WRITENOP
327   AM_RANGE(0x3000, 0x3000) AM_DEVWRITE_LEGACY("ay1", ay8910_data_w)
328   AM_RANGE(0x4000, 0x4000) AM_DEVWRITE_LEGACY("ay1", ay8910_address_w)
329   AM_RANGE(0x7000, 0x7000) AM_DEVWRITE_LEGACY("ay2", ay8910_data_w)
330   AM_RANGE(0x8000, 0x8000) AM_DEVWRITE_LEGACY("ay2", ay8910_address_w)
327   AM_RANGE(0x3000, 0x3000) AM_DEVWRITE("ay1", ay8910_device, data_w)
328   AM_RANGE(0x4000, 0x4000) AM_DEVWRITE("ay1", ay8910_device, address_w)
329   AM_RANGE(0x7000, 0x7000) AM_DEVWRITE("ay2", ay8910_device, data_w)
330   AM_RANGE(0x8000, 0x8000) AM_DEVWRITE("ay2", ay8910_device, address_w)
331331   AM_RANGE(0xb000, 0xb000) AM_READ(soundlatch_byte_r)
332332   AM_RANGE(0xc000, 0xffff) AM_ROM
333333ADDRESS_MAP_END
trunk/src/mame/drivers/laserbat.c
r22781r22782
2020#include "cpu/m6800/m6800.h"
2121#include "cpu/s2650/s2650.h"
2222#include "machine/6821pia.h"
23#include "sound/ay8910.h"
2423#include "sound/sn76477.h"
2524#include "sound/tms3615.h"
2625#include "video/s2636.h"
r22781r22782
578577
579578READ8_MEMBER(laserbat_state::zaccaria_port0a_r)
580579{
581   device_t *ay = (m_active_8910 == 0) ? m_ay1 : m_ay2;
582   return ay8910_r(ay, space, 0);
580   ay8910_device *ay8910 = (m_active_8910 == 0) ? m_ay1 : m_ay2;
581   return ay8910->data_r(space, 0);
583582}
584583
585584WRITE8_MEMBER(laserbat_state::zaccaria_port0a_w)
r22781r22782
593592   if ((m_last_port0b & 0x02) == 0x02 && (data & 0x02) == 0x00)
594593   {
595594      /* bit 0 goes to the 8910 #0 BC1 pin */
596      ay8910_data_address_w(m_ay1, space, m_last_port0b >> 0, m_port0a);
595      m_ay1->data_address_w(space, m_last_port0b >> 0, m_port0a);
597596   }
598597   else if ((m_last_port0b & 0x02) == 0x00 && (data & 0x02) == 0x02)
599598   {
r22781r22782
605604   if ((m_last_port0b & 0x08) == 0x08 && (data & 0x08) == 0x00)
606605   {
607606      /* bit 2 goes to the 8910 #1 BC1 pin */
608      ay8910_data_address_w(m_ay2, space, m_last_port0b >> 2, m_port0a);
607      m_ay2->data_address_w(space, m_last_port0b >> 2, m_port0a);
609608   }
610609   else if ((m_last_port0b & 0x08) == 0x00 && (data & 0x08) == 0x08)
611610   {
r22781r22782
689688   m_sn = machine().device("snsnd");
690689   m_tms1 = machine().device<tms3615_device>("tms1");
691690   m_tms2 = machine().device<tms3615_device>("tms2");
692   m_ay1 = machine().device("ay1");
693   m_ay2 = machine().device("ay2");
694691
695692   save_item(NAME(m_video_page));
696693   save_item(NAME(m_input_mux));
trunk/src/mame/drivers/timelimt.c
r22781r22782
7474static ADDRESS_MAP_START( sound_io_map, AS_IO, 8, timelimt_state )
7575   ADDRESS_MAP_GLOBAL_MASK(0xff)
7676   AM_RANGE(0x00, 0x00) AM_WRITE(soundlatch_clear_byte_w)
77   AM_RANGE(0x8c, 0x8d) AM_DEVREADWRITE_LEGACY("ay1", ay8910_r, ay8910_address_data_w)
78   AM_RANGE(0x8e, 0x8f) AM_DEVREADWRITE_LEGACY("ay2", ay8910_r, ay8910_address_data_w)
77   AM_RANGE(0x8c, 0x8d) AM_DEVREADWRITE("ay1", ay8910_device, data_r, address_data_w)
78   AM_RANGE(0x8e, 0x8f) AM_DEVREADWRITE("ay2", ay8910_device, data_r, address_data_w)
7979ADDRESS_MAP_END
8080
8181/***************************************************************************/
trunk/src/mame/drivers/cb2001.c
r22781r22782
570570static ADDRESS_MAP_START( cb2001_io, AS_IO, 16, cb2001_state )
571571   AM_RANGE(0x00, 0x03) AM_DEVREADWRITE8("ppi8255_0", i8255_device, read, write, 0xffff)   /* Input Ports */
572572   AM_RANGE(0x10, 0x13) AM_DEVREADWRITE8("ppi8255_1", i8255_device, read, write, 0xffff)   /* DIP switches */
573   AM_RANGE(0x20, 0x21) AM_DEVREAD8_LEGACY("aysnd", ay8910_r, 0xff00)
574   AM_RANGE(0x22, 0x23) AM_DEVWRITE8_LEGACY("aysnd", ay8910_data_address_w, 0xffff)
573   AM_RANGE(0x20, 0x21) AM_DEVREAD8("aysnd", ay8910_device, data_r, 0xff00)
574   AM_RANGE(0x22, 0x23) AM_DEVWRITE8("aysnd", ay8910_device, data_address_w, 0xffff)
575575
576576   AM_RANGE(0x30, 0x31) AM_WRITE(cb2001_vidctrl_w)
577577   AM_RANGE(0x32, 0x33) AM_WRITE(cb2001_vidctrl2_w)
trunk/src/mame/drivers/mrflea.c
r22781r22782
190190   AM_RANGE(0x21, 0x21) AM_WRITE(mrflea_main_w)
191191   AM_RANGE(0x22, 0x22) AM_READ(mrflea_io_status_r)
192192   AM_RANGE(0x23, 0x23) AM_WRITENOP /* 0xb4,0x09,0x05 */
193   AM_RANGE(0x40, 0x40) AM_DEVREAD_LEGACY("ay1", ay8910_r)
194   AM_RANGE(0x40, 0x41) AM_DEVWRITE_LEGACY("ay1", ay8910_data_address_w)
193   AM_RANGE(0x40, 0x40) AM_DEVREAD("ay1", ay8910_device, data_r)
194   AM_RANGE(0x40, 0x41) AM_DEVWRITE("ay1", ay8910_device, data_address_w)
195195   AM_RANGE(0x42, 0x42) AM_READWRITE(mrflea_input1_r, mrflea_data1_w)
196196   AM_RANGE(0x43, 0x43) AM_WRITE(mrflea_select1_w)
197   AM_RANGE(0x44, 0x44) AM_DEVREAD_LEGACY("ay2", ay8910_r)
198   AM_RANGE(0x44, 0x45) AM_DEVWRITE_LEGACY("ay2", ay8910_data_address_w)
199   AM_RANGE(0x46, 0x46) AM_DEVREAD_LEGACY("ay3", ay8910_r)
200   AM_RANGE(0x46, 0x47) AM_DEVWRITE_LEGACY("ay3", ay8910_data_address_w)
197   AM_RANGE(0x44, 0x44) AM_DEVREAD("ay2", ay8910_device, data_r)
198   AM_RANGE(0x44, 0x45) AM_DEVWRITE("ay2", ay8910_device, data_address_w)
199   AM_RANGE(0x46, 0x46) AM_DEVREAD("ay3", ay8910_device, data_r)
200   AM_RANGE(0x46, 0x47) AM_DEVWRITE("ay3", ay8910_device, data_address_w)
201201ADDRESS_MAP_END
202202
203203/*************************************
trunk/src/mame/drivers/jongkyo.c
r22781r22782
238238static ADDRESS_MAP_START( jongkyo_portmap, AS_IO, 8, jongkyo_state )
239239   ADDRESS_MAP_GLOBAL_MASK(0xff)
240240   // R 01 keyboard
241   AM_RANGE(0x01, 0x01) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
242   AM_RANGE(0x02, 0x03) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_address_w)
241   AM_RANGE(0x01, 0x01) AM_DEVREAD("aysnd", ay8910_device, data_r)
242   AM_RANGE(0x02, 0x03) AM_DEVWRITE("aysnd", ay8910_device, data_address_w)
243243
244244   AM_RANGE(0x10, 0x10) AM_READ_PORT("DSW") AM_WRITE(jongkyo_coin_counter_w)
245245   AM_RANGE(0x11, 0x11) AM_READ_PORT("IN0") AM_WRITE(mux_w)
trunk/src/mame/drivers/tonton.c
r22781r22782
110110   AM_RANGE(0x02, 0x02) AM_READ_PORT("DSW1")
111111   AM_RANGE(0x03, 0x03) AM_READ_PORT("DSW2")
112112   AM_RANGE(0x88, 0x8b) AM_DEVREADWRITE( "v9938", v9938_device, read, write )
113   AM_RANGE(0xa0, 0xa1) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
114   AM_RANGE(0xa2, 0xa2) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
113   AM_RANGE(0xa0, 0xa1) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
114   AM_RANGE(0xa2, 0xa2) AM_DEVREAD("aysnd", ay8910_device, data_r)
115115ADDRESS_MAP_END
116116
117117
trunk/src/mame/drivers/tagteam.c
r22781r22782
6363/* Same as Syusse Oozumou */
6464static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, tagteam_state )
6565   AM_RANGE(0x0000, 0x03ff) AM_RAM
66   AM_RANGE(0x2000, 0x2001) AM_DEVWRITE_LEGACY("ay1", ay8910_data_address_w)
67   AM_RANGE(0x2002, 0x2003) AM_DEVWRITE_LEGACY("ay2", ay8910_data_address_w)
66   AM_RANGE(0x2000, 0x2001) AM_DEVWRITE("ay1", ay8910_device, data_address_w)
67   AM_RANGE(0x2002, 0x2003) AM_DEVWRITE("ay2", ay8910_device, data_address_w)
6868   AM_RANGE(0x2004, 0x2004) AM_DEVWRITE("dac", dac_device, write_unsigned8)
6969   AM_RANGE(0x2005, 0x2005) AM_WRITE(sound_nmi_mask_w)
7070   AM_RANGE(0x2007, 0x2007) AM_READ(soundlatch_byte_r)
trunk/src/mame/drivers/carjmbre.c
r22781r22782
8383   ADDRESS_MAP_GLOBAL_MASK(0xff)
8484   AM_RANGE(0x00, 0x00) AM_READ(soundlatch_byte_r)
8585   AM_RANGE(0x10, 0x10) AM_WRITENOP            //?? written on init/0xff sound command reset
86   AM_RANGE(0x20, 0x21) AM_DEVWRITE_LEGACY("ay1", ay8910_address_data_w)
86   AM_RANGE(0x20, 0x21) AM_DEVWRITE("ay1", ay8910_device, address_data_w)
8787   AM_RANGE(0x22, 0x22) AM_WRITENOP            //?? written before and after 0x21 with same value
8888   AM_RANGE(0x24, 0x24) AM_READNOP             //??
89   AM_RANGE(0x30, 0x31) AM_DEVWRITE_LEGACY("ay2", ay8910_address_data_w)
89   AM_RANGE(0x30, 0x31) AM_DEVWRITE("ay2", ay8910_device, address_data_w)
9090   AM_RANGE(0x32, 0x32) AM_WRITENOP            //?? written before and after 0x31 with same value
9191ADDRESS_MAP_END
9292
trunk/src/mame/drivers/kyugo.c
r22781r22782
138138
139139static ADDRESS_MAP_START( gyrodine_sub_portmap, AS_IO, 8, kyugo_state )
140140   ADDRESS_MAP_GLOBAL_MASK(0xff)
141   AM_RANGE(0x00, 0x01) AM_DEVWRITE_LEGACY("ay1", ay8910_address_data_w)
142   AM_RANGE(0x02, 0x02) AM_DEVREAD_LEGACY("ay1", ay8910_r)
143   AM_RANGE(0xc0, 0xc1) AM_DEVWRITE_LEGACY("ay2", ay8910_address_data_w)
141   AM_RANGE(0x00, 0x01) AM_DEVWRITE("ay1", ay8910_device, address_data_w)
142   AM_RANGE(0x02, 0x02) AM_DEVREAD("ay1", ay8910_device, data_r)
143   AM_RANGE(0xc0, 0xc1) AM_DEVWRITE("ay2", ay8910_device, address_data_w)
144144ADDRESS_MAP_END
145145
146146
147147static ADDRESS_MAP_START( repulse_sub_portmap, AS_IO, 8, kyugo_state )
148148   ADDRESS_MAP_GLOBAL_MASK(0xff)
149   AM_RANGE(0x00, 0x01) AM_DEVWRITE_LEGACY("ay1", ay8910_address_data_w)
150   AM_RANGE(0x02, 0x02) AM_DEVREAD_LEGACY("ay1", ay8910_r)
151   AM_RANGE(0x40, 0x41) AM_DEVWRITE_LEGACY("ay2", ay8910_address_data_w)
149   AM_RANGE(0x00, 0x01) AM_DEVWRITE("ay1", ay8910_device, address_data_w)
150   AM_RANGE(0x02, 0x02) AM_DEVREAD("ay1", ay8910_device, data_r)
151   AM_RANGE(0x40, 0x41) AM_DEVWRITE("ay2", ay8910_device, address_data_w)
152152   AM_RANGE(0xc0, 0xc1) AM_WRITE(kyugo_coin_counter_w)
153153ADDRESS_MAP_END
154154
155155
156156static ADDRESS_MAP_START( flashgala_sub_portmap, AS_IO, 8, kyugo_state )
157157   ADDRESS_MAP_GLOBAL_MASK(0xff)
158   AM_RANGE(0x40, 0x41) AM_DEVWRITE_LEGACY("ay1", ay8910_address_data_w)
159   AM_RANGE(0x42, 0x42) AM_DEVREAD_LEGACY("ay1", ay8910_r)
160   AM_RANGE(0x80, 0x81) AM_DEVWRITE_LEGACY("ay2", ay8910_address_data_w)
158   AM_RANGE(0x40, 0x41) AM_DEVWRITE("ay1", ay8910_device, address_data_w)
159   AM_RANGE(0x42, 0x42) AM_DEVREAD("ay1", ay8910_device, data_r)
160   AM_RANGE(0x80, 0x81) AM_DEVWRITE("ay2", ay8910_device, address_data_w)
161161   AM_RANGE(0xc0, 0xc1) AM_WRITE(kyugo_coin_counter_w)
162162ADDRESS_MAP_END
163163
164164
165165static ADDRESS_MAP_START( srdmissn_sub_portmap, AS_IO, 8, kyugo_state )
166166   ADDRESS_MAP_GLOBAL_MASK(0xff)
167   AM_RANGE(0x80, 0x81) AM_DEVWRITE_LEGACY("ay1", ay8910_address_data_w)
168   AM_RANGE(0x82, 0x82) AM_DEVREAD_LEGACY("ay1", ay8910_r)
169   AM_RANGE(0x84, 0x85) AM_DEVWRITE_LEGACY("ay2", ay8910_address_data_w)
167   AM_RANGE(0x80, 0x81) AM_DEVWRITE("ay1", ay8910_device, address_data_w)
168   AM_RANGE(0x82, 0x82) AM_DEVREAD("ay1", ay8910_device, data_r)
169   AM_RANGE(0x84, 0x85) AM_DEVWRITE("ay2", ay8910_device, address_data_w)
170170   AM_RANGE(0x90, 0x91) AM_WRITE(kyugo_coin_counter_w)
171171ADDRESS_MAP_END
172172
trunk/src/mame/drivers/junofrst.c
r22781r22782
309309   AM_RANGE(0x0000, 0x0fff) AM_ROM
310310   AM_RANGE(0x2000, 0x23ff) AM_RAM
311311   AM_RANGE(0x3000, 0x3000) AM_READ(soundlatch_byte_r)
312   AM_RANGE(0x4000, 0x4000) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w)
313   AM_RANGE(0x4001, 0x4001) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
314   AM_RANGE(0x4002, 0x4002) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_w)
312   AM_RANGE(0x4000, 0x4000) AM_DEVWRITE("aysnd", ay8910_device, address_w)
313   AM_RANGE(0x4001, 0x4001) AM_DEVREAD("aysnd", ay8910_device, data_r)
314   AM_RANGE(0x4002, 0x4002) AM_DEVWRITE("aysnd", ay8910_device, data_w)
315315   AM_RANGE(0x5000, 0x5000) AM_WRITE(soundlatch2_byte_w)
316316   AM_RANGE(0x6000, 0x6000) AM_WRITE(junofrst_i8039_irq_w)
317317ADDRESS_MAP_END
trunk/src/mame/drivers/nbmj8688.c
r22781r22782
300300   ADDRESS_MAP_GLOBAL_MASK(0xff)
301301   AM_RANGE(0x00, 0x7f) AM_READ_LEGACY(nb1413m3_sndrom_r)
302302   AM_RANGE(0x00, 0x00) AM_WRITE_LEGACY(nb1413m3_nmi_clock_w)
303   AM_RANGE(0x81, 0x81) AM_DEVREAD_LEGACY("psg", ay8910_r)
304   AM_RANGE(0x82, 0x83) AM_DEVWRITE_LEGACY("psg", ay8910_data_address_w)
303   AM_RANGE(0x81, 0x81) AM_DEVREAD("psg", ay8910_device, data_r)
304   AM_RANGE(0x82, 0x83) AM_DEVWRITE("psg", ay8910_device, data_address_w)
305305   AM_RANGE(0x90, 0x90) AM_READ_LEGACY(nb1413m3_inputport0_r)
306306   AM_RANGE(0x90, 0x97) AM_WRITE(nbmj8688_blitter_w)
307307   AM_RANGE(0xa0, 0xa0) AM_READWRITE_LEGACY(nb1413m3_inputport1_r,nb1413m3_inputportsel_w)
r22781r22782
343343   ADDRESS_MAP_GLOBAL_MASK(0xff)
344344   AM_RANGE(0x00, 0x7f) AM_READ_LEGACY(nb1413m3_sndrom_r)
345345   AM_RANGE(0x00, 0x00) AM_WRITE_LEGACY(nb1413m3_nmi_clock_w)
346   AM_RANGE(0x81, 0x81) AM_DEVREAD_LEGACY("psg", ay8910_r)
347   AM_RANGE(0x82, 0x83) AM_DEVWRITE_LEGACY("psg", ay8910_data_address_w)
346   AM_RANGE(0x81, 0x81) AM_DEVREAD("psg", ay8910_device, data_r)
347   AM_RANGE(0x82, 0x83) AM_DEVWRITE("psg", ay8910_device, data_address_w)
348348   AM_RANGE(0x90, 0x90) AM_READ_LEGACY(nb1413m3_inputport0_r)
349349   AM_RANGE(0x90, 0x97) AM_WRITE(nbmj8688_blitter_w)
350350   AM_RANGE(0xa0, 0xa0) AM_READWRITE_LEGACY(nb1413m3_inputport1_r,nb1413m3_inputportsel_w)
r22781r22782
385385   AM_RANGE(0x20, 0x3f) AM_WRITE(nbmj8688_clut_w)
386386   AM_RANGE(0x50, 0x50) AM_WRITE(mjsikaku_romsel_w)
387387   AM_RANGE(0x70, 0x77) AM_WRITE(nbmj8688_blitter_w)
388   AM_RANGE(0x81, 0x81) AM_DEVREAD_LEGACY("psg", ay8910_r)
389   AM_RANGE(0x82, 0x83) AM_DEVWRITE_LEGACY("psg", ay8910_data_address_w)
388   AM_RANGE(0x81, 0x81) AM_DEVREAD("psg", ay8910_device, data_r)
389   AM_RANGE(0x82, 0x83) AM_DEVWRITE("psg", ay8910_device, data_address_w)
390390   AM_RANGE(0x90, 0x90) AM_READ_LEGACY(nb1413m3_inputport0_r)
391391   AM_RANGE(0xa0, 0xa0) AM_READWRITE_LEGACY(nb1413m3_inputport1_r,nb1413m3_inputportsel_w)
392392   AM_RANGE(0xb0, 0xb0) AM_READWRITE_LEGACY(nb1413m3_inputport2_r,nb1413m3_sndrombank1_w)
r22781r22782
406406   AM_RANGE(0x20, 0x3f) AM_WRITE(nbmj8688_clut_w)
407407   AM_RANGE(0x40, 0x47) AM_WRITE(nbmj8688_blitter_w)
408408   AM_RANGE(0x50, 0x50) AM_WRITE(seiha_romsel_w)
409   AM_RANGE(0x81, 0x81) AM_DEVREAD_LEGACY("psg", ay8910_r)
410   AM_RANGE(0x82, 0x83) AM_DEVWRITE_LEGACY("psg", ay8910_data_address_w)
409   AM_RANGE(0x81, 0x81) AM_DEVREAD("psg", ay8910_device, data_r)
410   AM_RANGE(0x82, 0x83) AM_DEVWRITE("psg", ay8910_device, data_address_w)
411411   AM_RANGE(0x90, 0x90) AM_READ_LEGACY(nb1413m3_inputport0_r)
412412   AM_RANGE(0xa0, 0xa0) AM_READWRITE_LEGACY(nb1413m3_inputport1_r,nb1413m3_inputportsel_w)
413413   AM_RANGE(0xb0, 0xb0) AM_READWRITE_LEGACY(nb1413m3_inputport2_r,nb1413m3_sndrombank1_w)
r22781r22782
427427   AM_RANGE(0x10, 0x10) AM_WRITE_LEGACY(nb1413m3_sndrombank2_w)
428428   AM_RANGE(0x20, 0x3f) AM_WRITE(nbmj8688_clut_w)
429429   AM_RANGE(0x50, 0x50) AM_WRITE(seiha_romsel_w)
430   AM_RANGE(0x81, 0x81) AM_DEVREAD_LEGACY("psg", ay8910_r)
431   AM_RANGE(0x82, 0x83) AM_DEVWRITE_LEGACY("psg", ay8910_data_address_w)
430   AM_RANGE(0x81, 0x81) AM_DEVREAD("psg", ay8910_device, data_r)
431   AM_RANGE(0x82, 0x83) AM_DEVWRITE("psg", ay8910_device, data_address_w)
432432   AM_RANGE(0x90, 0x90) AM_READ_LEGACY(nb1413m3_inputport0_r)
433433   AM_RANGE(0x90, 0x97) AM_WRITE(nbmj8688_blitter_w)
434434   AM_RANGE(0xa0, 0xa0) AM_READWRITE_LEGACY(nb1413m3_inputport1_r,nb1413m3_inputportsel_w)
r22781r22782
447447   AM_RANGE(0x00, 0x00) AM_WRITE_LEGACY(nb1413m3_nmi_clock_w)
448448   AM_RANGE(0x20, 0x3f) AM_WRITE(nbmj8688_clut_w)
449449   AM_RANGE(0x50, 0x50) AM_WRITE(mjsikaku_romsel_w)
450   AM_RANGE(0x81, 0x81) AM_DEVREAD_LEGACY("psg", ay8910_r)
451   AM_RANGE(0x82, 0x83) AM_DEVWRITE_LEGACY("psg", ay8910_data_address_w)
450   AM_RANGE(0x81, 0x81) AM_DEVREAD("psg", ay8910_device, data_r)
451   AM_RANGE(0x82, 0x83) AM_DEVWRITE("psg", ay8910_device, data_address_w)
452452   AM_RANGE(0x90, 0x90) AM_READ_LEGACY(nb1413m3_inputport0_r)
453453   AM_RANGE(0x90, 0x97) AM_WRITE(nbmj8688_blitter_w)
454454   AM_RANGE(0xa0, 0xa0) AM_READWRITE_LEGACY(nb1413m3_inputport1_r,nb1413m3_inputportsel_w)
r22781r22782
471471   AM_RANGE(0x45, 0x45) AM_WRITE(nbmj8688_HD61830B_1_instr_w)
472472   AM_RANGE(0x46, 0x46) AM_WRITE(nbmj8688_HD61830B_both_data_w)
473473   AM_RANGE(0x47, 0x47) AM_WRITE(nbmj8688_HD61830B_both_instr_w)
474   AM_RANGE(0x81, 0x81) AM_DEVREAD_LEGACY("psg", ay8910_r)
475   AM_RANGE(0x82, 0x83) AM_DEVWRITE_LEGACY("psg", ay8910_data_address_w)
474   AM_RANGE(0x81, 0x81) AM_DEVREAD("psg", ay8910_device, data_r)
475   AM_RANGE(0x82, 0x83) AM_DEVWRITE("psg", ay8910_device, data_address_w)
476476   AM_RANGE(0x90, 0x90) AM_READ_LEGACY(nb1413m3_inputport0_r)
477477   AM_RANGE(0x90, 0x97) AM_WRITE(nbmj8688_blitter_w)
478478   AM_RANGE(0xa0, 0xa0) AM_READWRITE_LEGACY(nb1413m3_inputport1_r,nb1413m3_inputportsel_w)
r22781r22782
516516   AM_RANGE(0x20, 0x3f) AM_WRITE(nbmj8688_clut_w)
517517   AM_RANGE(0x40, 0x47) AM_WRITE(nbmj8688_blitter_w)
518518   AM_RANGE(0x50, 0x50) AM_WRITE(mjsikaku_romsel_w)
519   AM_RANGE(0x81, 0x81) AM_DEVREAD_LEGACY("psg", ay8910_r)
520   AM_RANGE(0x82, 0x83) AM_DEVWRITE_LEGACY("psg", ay8910_data_address_w)
519   AM_RANGE(0x81, 0x81) AM_DEVREAD("psg", ay8910_device, data_r)
520   AM_RANGE(0x82, 0x83) AM_DEVWRITE("psg", ay8910_device, data_address_w)
521521   AM_RANGE(0x90, 0x90) AM_READ_LEGACY(nb1413m3_inputport0_r)
522522   AM_RANGE(0xa0, 0xa0) AM_READWRITE_LEGACY(nb1413m3_inputport1_r,nb1413m3_inputportsel_w)
523523   AM_RANGE(0xb0, 0xb0) AM_READWRITE_LEGACY(nb1413m3_inputport2_r,nb1413m3_sndrombank1_w)
trunk/src/mame/drivers/hitpoker.c
r22781r22782
259259   AM_RANGE(0xbe53, 0xbe53) AM_READWRITE(eeprom_r, eeprom_w)
260260   AM_RANGE(0xbe80, 0xbe80) AM_DEVWRITE("crtc", mc6845_device, address_w)
261261   AM_RANGE(0xbe81, 0xbe81) AM_DEVWRITE("crtc", mc6845_device, register_w)
262   AM_RANGE(0xbe90, 0xbe91) AM_DEVREADWRITE_LEGACY("aysnd", ay8910_r,ay8910_address_data_w)
262   AM_RANGE(0xbe90, 0xbe91) AM_DEVREADWRITE("aysnd", ay8910_device, data_r, address_data_w)
263263   AM_RANGE(0xbea0, 0xbea0) AM_READ_PORT("VBLANK") //probably other bits as well
264264//  AM_RANGE(0xbe00, 0xbeff) AM_READ(test_r)
265265   AM_RANGE(0xc000, 0xdfff) AM_READWRITE(hitpoker_cram_r,hitpoker_cram_w)
trunk/src/mame/drivers/ginganin.c
r22781r22782
9595   AM_RANGE(0x0800, 0x0807) AM_DEVREADWRITE("6840ptm", ptm6840_device, read, write)
9696   AM_RANGE(0x1800, 0x1800) AM_READ(soundlatch_byte_r)
9797   AM_RANGE(0x2000, 0x2001) AM_DEVWRITE_LEGACY("ymsnd", y8950_w)
98   AM_RANGE(0x2800, 0x2801) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
98   AM_RANGE(0x2800, 0x2801) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
9999   AM_RANGE(0x4000, 0xffff) AM_ROM
100100ADDRESS_MAP_END
101101
trunk/src/mame/drivers/nbmj8991.c
r22781r22782
262262static ADDRESS_MAP_START( hyouban_io_map, AS_IO, 8, nbmj8991_state )
263263   ADDRESS_MAP_GLOBAL_MASK(0xff)
264264   AM_RANGE(0x00, 0x7f) AM_READ_LEGACY(nb1413m3_sndrom_r) AM_WRITE(nbmj8991_blitter_w)
265   AM_RANGE(0x81, 0x81) AM_DEVREAD_LEGACY("fmsnd", ay8910_r)
266   AM_RANGE(0x82, 0x83) AM_DEVWRITE_LEGACY("fmsnd", ay8910_data_address_w)
265   AM_RANGE(0x81, 0x81) AM_DEVREAD("fmsnd", ay8910_device, data_r)
266   AM_RANGE(0x82, 0x83) AM_DEVWRITE("fmsnd", ay8910_device, data_address_w)
267267   AM_RANGE(0x90, 0x90) AM_READ_LEGACY(nb1413m3_inputport0_r)
268268   AM_RANGE(0xa0, 0xa0) AM_READWRITE_LEGACY(nb1413m3_inputport1_r,nb1413m3_inputportsel_w)
269269   AM_RANGE(0xb0, 0xb0) AM_READWRITE_LEGACY(nb1413m3_inputport2_r,nb1413m3_sndrombank1_w)
trunk/src/mame/drivers/wallc.c
r22781r22782
180180   AM_RANGE(0xb000, 0xb000) AM_WRITENOP
181181   AM_RANGE(0xb100, 0xb100) AM_WRITE(wallc_coin_counter_w)
182182   AM_RANGE(0xb200, 0xb200) AM_WRITENOP
183   AM_RANGE(0xb500, 0xb500) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w)
184   AM_RANGE(0xb600, 0xb600) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_w)
183   AM_RANGE(0xb500, 0xb500) AM_DEVWRITE("aysnd", ay8910_device, address_w)
184   AM_RANGE(0xb600, 0xb600) AM_DEVWRITE("aysnd", ay8910_device, data_w)
185185ADDRESS_MAP_END
186186
187187
trunk/src/mame/drivers/vd.c
r22781r22782
5959   AM_RANGE(0x20,0x27) AM_WRITE(lamp_w)
6060   AM_RANGE(0x28,0x28) AM_WRITE(sol_w)
6161   AM_RANGE(0x40,0x44) AM_WRITE(disp_w)
62   AM_RANGE(0x60,0x60) AM_DEVWRITE_LEGACY("ay1", ay8910_address_w)
62   AM_RANGE(0x60,0x60) AM_DEVWRITE("ay1", ay8910_device, address_w)
6363   AM_RANGE(0x61,0x61) AM_READ_PORT("DSW") //AM_READ(dsw_r)
64   AM_RANGE(0x62,0x62) AM_DEVWRITE_LEGACY("ay1", ay8910_data_w)
65   AM_RANGE(0x80,0x80) AM_DEVWRITE_LEGACY("ay2", ay8910_address_w)
66   AM_RANGE(0x82,0x82) AM_DEVWRITE_LEGACY("ay2", ay8910_data_w)
67   AM_RANGE(0xa0,0xa0) AM_DEVREAD_LEGACY("ay2", ay8910_r)
64   AM_RANGE(0x62,0x62) AM_DEVWRITE("ay1", ay8910_device, data_w)
65   AM_RANGE(0x80,0x80) AM_DEVWRITE("ay2", ay8910_device, address_w)
66   AM_RANGE(0x82,0x82) AM_DEVWRITE("ay2", ay8910_device, data_w)
67   AM_RANGE(0xa0,0xa0) AM_DEVREAD("ay2", ay8910_device, data_r)
6868   AM_RANGE(0xc0,0xc0) AM_WRITE(col_w)
6969ADDRESS_MAP_END
7070
trunk/src/mame/drivers/suna16.c
r22781r22782
267267
268268static ADDRESS_MAP_START( bestbest_sound_map, AS_PROGRAM, 8, suna16_state )
269269   AM_RANGE( 0x0000, 0xbfff ) AM_ROM                                   // ROM
270   AM_RANGE( 0xc000, 0xc001 ) AM_DEVWRITE_LEGACY("ymsnd", ym3526_w )   //
271   AM_RANGE( 0xc002, 0xc003 ) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w    )   // AY8910
270   AM_RANGE( 0xc000, 0xc001 ) AM_DEVWRITE_LEGACY("ymsnd", ym3526_w)    //
271   AM_RANGE( 0xc002, 0xc003 ) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)   // AY8910
272272   AM_RANGE( 0xe000, 0xe7ff ) AM_RAM                                   // RAM
273273   AM_RANGE( 0xf000, 0xf000 ) AM_WRITE(soundlatch2_byte_w              )   // To PCM Z80
274274   AM_RANGE( 0xf800, 0xf800 ) AM_READ ( soundlatch_byte_r              )   // From Main CPU
trunk/src/mame/drivers/bagman.c
r22781r22782
156156   AM_RANGE(0xa007, 0xa007) AM_WRITENOP    /* ???? */
157157
158158   /* guess */
159   AM_RANGE(0xb000, 0xb000) AM_DEVWRITE_LEGACY("ay2", ay8910_address_w)
160   AM_RANGE(0xb800, 0xb800) AM_DEVREADWRITE_LEGACY("ay2", ay8910_r, ay8910_data_w)
159   AM_RANGE(0xb000, 0xb000) AM_DEVWRITE("ay2", ay8910_device, address_w)
160   AM_RANGE(0xb800, 0xb800) AM_DEVREADWRITE("ay2", ay8910_device, data_r, data_w)
161161ADDRESS_MAP_END
162162
163163static ADDRESS_MAP_START( main_portmap, AS_IO, 8, bagman_state )
164164   ADDRESS_MAP_GLOBAL_MASK(0xff)
165   AM_RANGE(0x08, 0x09) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
166   AM_RANGE(0x0c, 0x0c) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
165   AM_RANGE(0x08, 0x09) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
166   AM_RANGE(0x0c, 0x0c) AM_DEVREAD("aysnd", ay8910_device, data_r)
167167   //AM_RANGE(0x56, 0x56) AM_WRITENOP
168168ADDRESS_MAP_END
169169
trunk/src/mame/drivers/bogeyman.c
r22781r22782
3333
3434   // bit 5 goes to 8910 #0 BDIR pin
3535   if ((m_last_write & 0x20) == 0x20 && (data & 0x20) == 0x00)
36      ay8910_data_address_w(machine().device("ay1"), space, m_last_write >> 4, m_psg_latch);
36      machine().device<ay8910_device>("ay1")->data_address_w(space, m_last_write >> 4, m_psg_latch);
3737
3838   // bit 7 goes to 8910 #1 BDIR pin
3939   if ((m_last_write & 0x80) == 0x80 && (data & 0x80) == 0x00)
40      ay8910_data_address_w(machine().device("ay2"), space, m_last_write >> 6, m_psg_latch);
40      machine().device<ay8910_device>("ay2")->data_address_w(space, m_last_write >> 6, m_psg_latch);
4141
4242   m_last_write = data;
4343}
trunk/src/mame/drivers/rmhaihai.c
r22781r22782
217217   AM_RANGE(0x0000, 0x7fff) AM_READ(samples_r)
218218   AM_RANGE(0x8000, 0x8000) AM_READ(keyboard_r) AM_WRITENOP    // ??
219219   AM_RANGE(0x8001, 0x8001) AM_READNOP AM_WRITE(keyboard_w)    // ??
220   AM_RANGE(0x8020, 0x8020) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
221   AM_RANGE(0x8020, 0x8021) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
220   AM_RANGE(0x8020, 0x8020) AM_DEVREAD("aysnd", ay8910_device, data_r)
221   AM_RANGE(0x8020, 0x8021) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
222222   AM_RANGE(0x8040, 0x8040) AM_WRITE(adpcm_w)
223223   AM_RANGE(0x8060, 0x8060) AM_WRITE(ctrl_w)
224224   AM_RANGE(0x8080, 0x8080) AM_WRITENOP    // ??
r22781r22782
240240   AM_RANGE(0x0000, 0x7fff) AM_READ(samples_r)
241241   AM_RANGE(0x8000, 0x8000) AM_READ(keyboard_r) AM_WRITENOP    // ??
242242   AM_RANGE(0x8001, 0x8001) AM_READNOP AM_WRITE(keyboard_w)    // ??
243   AM_RANGE(0x8020, 0x8020) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
244   AM_RANGE(0x8020, 0x8021) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
243   AM_RANGE(0x8020, 0x8020) AM_DEVREAD("aysnd", ay8910_device, data_r)
244   AM_RANGE(0x8020, 0x8021) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
245245   AM_RANGE(0x8040, 0x8040) AM_WRITE(adpcm_w)
246246   AM_RANGE(0x8060, 0x8060) AM_WRITE(ctrl_w)
247247   AM_RANGE(0x8080, 0x8080) AM_WRITENOP    // ??
trunk/src/mame/drivers/mole.c
r22781r22782
202202   AM_RANGE(0x5000, 0x7fff) AM_MIRROR(0x8000) AM_ROM
203203   AM_RANGE(0x8000, 0x83ff) AM_WRITE(mole_tileram_w) AM_READNOP
204204   AM_RANGE(0x8400, 0x8400) AM_WRITE(mole_tilebank_w)
205   AM_RANGE(0x8c00, 0x8c01) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_address_w)
205   AM_RANGE(0x8c00, 0x8c01) AM_DEVWRITE("aysnd", ay8910_device, data_address_w)
206206   AM_RANGE(0x8c40, 0x8c40) AM_WRITENOP // ???
207207   AM_RANGE(0x8c80, 0x8c80) AM_WRITENOP // ???
208208   AM_RANGE(0x8c81, 0x8c81) AM_WRITENOP // ???
trunk/src/mame/drivers/aristmk4.c
r22781r22782
656656
657657   if (m_ay8910_1&0x03) // SW1 read.
658658   {
659   psg_ret = ay8910_r(machine().device("ay1"), space, 0);
660   //logerror("PSG porta ay1 returned %02X\n",psg_ret);
659      psg_ret = machine().device<ay8910_device>("ay1")->data_r(space, 0);
660      //logerror("PSG porta ay1 returned %02X\n",psg_ret);
661661   }
662662
663663   else if (m_ay8910_2&0x03) //i don't think we read anything from Port A on ay2, Can be removed once game works ok.
664664   {
665      psg_ret = ay8910_r(machine().device("ay2"), space, 0);
665      psg_ret = machine().device<ay8910_device>("ay2")->data_r(space, 0);
666666      //logerror("PSG porta ay2 returned %02X\n",psg_ret);
667667   }
668668   return psg_ret;
r22781r22782
755755      break;
756756   case 0x06:  //WRITE
757757   {
758      ay8910_data_w( machine().device("ay1"), space, 0 , m_psg_data );
758      machine().device<ay8910_device>("ay1")->data_w(space, 0 , m_psg_data);
759759      //logerror("VIA Port A write data ay1: %02X\n",m_psg_data);
760760      break;
761761   }
762762   case 0x07:  //LATCH Address (set register)
763763   {
764      ay8910_address_w( machine().device("ay1"), space, 0 , m_psg_data );
764      machine().device<ay8910_device>("ay1")->address_w(space, 0 , m_psg_data);
765765      //logerror("VIA Port B write register ay1: %02X\n",m_psg_data);
766766      break;
767767   }
r22781r22782
782782      break;
783783   case 0x06:  //WRITE
784784   {
785      ay8910_data_w( machine().device("ay2"), space, 0 , m_psg_data );
785      machine().device<ay8910_device>("ay2")->data_w(space, 0, m_psg_data);
786786      //logerror("VIA Port A write data ay2: %02X\n",m_psg_data);
787787      break;
788788   }
789789   case 0x07:  //LATCH Address (set register)
790790   {
791      ay8910_address_w( machine().device("ay2"), space, 0 , m_psg_data );
791      machine().device<ay8910_device>("ay2")->address_w(space, 0, m_psg_data);
792792      //logerror("VIA Port B write register ay2: %02X\n",m_psg_data);
793793      break;
794794   }
trunk/src/mame/drivers/lucky74.c
r22781r22782
928928   AM_RANGE(0xf100, 0xf100) AM_DEVWRITE("sn1", sn76489_device, write)                      /* SN76489 #1 */
929929   AM_RANGE(0xf200, 0xf203) AM_DEVREADWRITE("ppi8255_1", i8255_device, read, write)        /* Input Ports 2 & 4 */
930930   AM_RANGE(0xf300, 0xf300) AM_DEVWRITE("sn2", sn76489_device, write)                      /* SN76489 #2 */
931   AM_RANGE(0xf400, 0xf400) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w)                  /* YM2149 control */
931   AM_RANGE(0xf400, 0xf400) AM_DEVWRITE("aysnd", ay8910_device, address_w)                  /* YM2149 control */
932932   AM_RANGE(0xf500, 0xf500) AM_DEVWRITE("sn3", sn76489_device, write)                      /* SN76489 #3 */
933   AM_RANGE(0xf600, 0xf600) AM_DEVREADWRITE_LEGACY("aysnd", ay8910_r, ay8910_data_w)       /* YM2149 (Input Port 1) */
933   AM_RANGE(0xf600, 0xf600) AM_DEVREADWRITE("aysnd", ay8910_device, data_r, data_w)       /* YM2149 (Input Port 1) */
934934   AM_RANGE(0xf700, 0xf701) AM_READWRITE(usart_8251_r, usart_8251_w)                       /* USART 8251 port */
935935   AM_RANGE(0xf800, 0xf803) AM_READWRITE(copro_sm7831_r, copro_sm7831_w)                   /* SM7831 Co-Processor */
936936ADDRESS_MAP_END
trunk/src/mame/drivers/pturn.c
r22781r22782
353353   AM_RANGE(0x2000, 0x23ff) AM_RAM
354354   AM_RANGE(0x3000, 0x3000) AM_READ(soundlatch_byte_r) AM_WRITE(nmi_sub_enable_w)
355355   AM_RANGE(0x4000, 0x4000) AM_RAM
356   AM_RANGE(0x5000, 0x5001) AM_DEVWRITE_LEGACY("ay1", ay8910_address_data_w)
357   AM_RANGE(0x6000, 0x6001) AM_DEVWRITE_LEGACY("ay2", ay8910_address_data_w)
356   AM_RANGE(0x5000, 0x5001) AM_DEVWRITE("ay1", ay8910_device, address_data_w)
357   AM_RANGE(0x6000, 0x6001) AM_DEVWRITE("ay2", ay8910_device, address_data_w)
358358ADDRESS_MAP_END
359359
360360static const gfx_layout charlayout =
trunk/src/mame/drivers/magmax.c
r22781r22782
220220
221221static ADDRESS_MAP_START( magmax_sound_io_map, AS_IO, 8, magmax_state )
222222   ADDRESS_MAP_GLOBAL_MASK(0xff)
223   AM_RANGE(0x00, 0x01) AM_DEVWRITE_LEGACY("ay1", ay8910_address_data_w)
224   AM_RANGE(0x02, 0x03) AM_DEVWRITE_LEGACY("ay2", ay8910_address_data_w)
225   AM_RANGE(0x04, 0x05) AM_DEVWRITE_LEGACY("ay3", ay8910_address_data_w)
223   AM_RANGE(0x00, 0x01) AM_DEVWRITE("ay1", ay8910_device, address_data_w)
224   AM_RANGE(0x02, 0x03) AM_DEVWRITE("ay2", ay8910_device, address_data_w)
225   AM_RANGE(0x04, 0x05) AM_DEVWRITE("ay3", ay8910_device, address_data_w)
226226   AM_RANGE(0x06, 0x06) AM_READ(magmax_sound_r)
227227ADDRESS_MAP_END
228228
trunk/src/mame/drivers/taitosj.c
r22781r22782
217217   AM_RANGE(0xd40b, 0xd40b) AM_MIRROR(0x00f0) AM_READ_PORT("IN2")
218218   AM_RANGE(0xd40c, 0xd40c) AM_MIRROR(0x00f0) AM_READ_PORT("IN3")          /* Service */
219219   AM_RANGE(0xd40d, 0xd40d) AM_MIRROR(0x00f0) AM_READ_PORT("IN4")
220   AM_RANGE(0xd40e, 0xd40f) AM_MIRROR(0x00f0) AM_DEVWRITE_LEGACY("ay1", ay8910_address_data_w)
221   AM_RANGE(0xd40f, 0xd40f) AM_MIRROR(0x00f0) AM_DEVREAD_LEGACY("ay1", ay8910_r)   /* DSW2 and DSW3 */
220   AM_RANGE(0xd40e, 0xd40f) AM_MIRROR(0x00f0) AM_DEVWRITE("ay1", ay8910_device, address_data_w)
221   AM_RANGE(0xd40f, 0xd40f) AM_MIRROR(0x00f0) AM_DEVREAD("ay1", ay8910_device, data_r)   /* DSW2 and DSW3 */
222222   AM_RANGE(0xd500, 0xd505) AM_MIRROR(0x00f0) AM_WRITEONLY AM_SHARE("scroll")
223223   AM_RANGE(0xd506, 0xd507) AM_MIRROR(0x00f0) AM_WRITEONLY AM_SHARE("colorbank")
224224   AM_RANGE(0xd508, 0xd508) AM_MIRROR(0x00f0) AM_WRITE(taitosj_collision_reg_clear_w)
r22781r22782
257257   AM_RANGE(0xd40b, 0xd40b) AM_MIRROR(0x00f0) AM_READ_PORT("IN2")
258258   AM_RANGE(0xd40c, 0xd40c) AM_MIRROR(0x00f0) AM_READ_PORT("IN3")          /* Service */
259259   AM_RANGE(0xd40d, 0xd40d) AM_MIRROR(0x00f0) AM_READ_PORT("IN4")
260   AM_RANGE(0xd40e, 0xd40f) AM_MIRROR(0x00f0) AM_DEVWRITE_LEGACY("ay1", ay8910_address_data_w)
261   AM_RANGE(0xd40f, 0xd40f) AM_MIRROR(0x00f0) AM_DEVREAD_LEGACY("ay1", ay8910_r)   /* DSW2 and DSW3 */
260   AM_RANGE(0xd40e, 0xd40f) AM_MIRROR(0x00f0) AM_DEVWRITE("ay1", ay8910_device, address_data_w)
261   AM_RANGE(0xd40f, 0xd40f) AM_MIRROR(0x00f0) AM_DEVREAD("ay1", ay8910_device, data_r)   /* DSW2 and DSW3 */
262262   AM_RANGE(0xd500, 0xd505) AM_MIRROR(0x00f0) AM_WRITEONLY AM_SHARE("scroll")
263263   AM_RANGE(0xd506, 0xd507) AM_MIRROR(0x00f0) AM_WRITEONLY AM_SHARE("colorbank")
264264   AM_RANGE(0xd508, 0xd508) AM_MIRROR(0x00f0) AM_WRITE(taitosj_collision_reg_clear_w)
r22781r22782
322322   AM_RANGE(0xd40b, 0xd40b) AM_MIRROR(0x00f0) AM_READ_PORT("IN2")
323323   AM_RANGE(0xd40c, 0xd40c) AM_MIRROR(0x00f0) AM_READ_PORT("IN3")          /* Service */
324324   AM_RANGE(0xd40d, 0xd40d) AM_MIRROR(0x00f0) AM_READ_PORT("IN4")
325   AM_RANGE(0xd40e, 0xd40f) AM_DEVWRITE_LEGACY("ay1", ay8910_address_data_w)
326   AM_RANGE(0xd40f, 0xd40f) AM_DEVREAD_LEGACY("ay1", ay8910_r) /* DSW2 and DSW3 */
325   AM_RANGE(0xd40e, 0xd40f) AM_DEVWRITE("ay1", ay8910_device, address_data_w)
326   AM_RANGE(0xd40f, 0xd40f) AM_DEVREAD("ay1", ay8910_device, data_r) /* DSW2 and DSW3 */
327327   AM_RANGE(0xd508, 0xd508) AM_WRITE(taitosj_collision_reg_clear_w)
328328   AM_RANGE(0xd509, 0xd50a) AM_WRITEONLY AM_SHARE("gfxpointer")
329329   AM_RANGE(0xd50b, 0xd50b) AM_WRITE(taitosj_soundcommand_w)
r22781r22782
338338static ADDRESS_MAP_START( taitosj_audio_map, AS_PROGRAM, 8, taitosj_state )
339339   AM_RANGE(0x0000, 0x3fff) AM_ROM
340340   AM_RANGE(0x4000, 0x43ff) AM_RAM
341   AM_RANGE(0x4800, 0x4801) AM_DEVWRITE_LEGACY("ay2", ay8910_address_data_w)
342   AM_RANGE(0x4801, 0x4801) AM_DEVREAD_LEGACY("ay2", ay8910_r)
343   AM_RANGE(0x4802, 0x4803) AM_DEVWRITE_LEGACY("ay3", ay8910_address_data_w)
344   AM_RANGE(0x4803, 0x4803) AM_DEVREAD_LEGACY("ay3", ay8910_r)
345   AM_RANGE(0x4804, 0x4805) AM_DEVWRITE_LEGACY("ay4", ay8910_address_data_w)
346   AM_RANGE(0x4805, 0x4805) AM_DEVREAD_LEGACY("ay4", ay8910_r)
341   AM_RANGE(0x4800, 0x4801) AM_DEVWRITE("ay2", ay8910_device, address_data_w)
342   AM_RANGE(0x4801, 0x4801) AM_DEVREAD("ay2", ay8910_device, data_r)
343   AM_RANGE(0x4802, 0x4803) AM_DEVWRITE("ay3", ay8910_device, address_data_w)
344   AM_RANGE(0x4803, 0x4803) AM_DEVREAD("ay3", ay8910_device, data_r)
345   AM_RANGE(0x4804, 0x4805) AM_DEVWRITE("ay4", ay8910_device, address_data_w)
346   AM_RANGE(0x4805, 0x4805) AM_DEVREAD("ay4", ay8910_device, data_r)
347347   AM_RANGE(0x5000, 0x5000) AM_READ(soundlatch_byte_r)
348348   AM_RANGE(0xe000, 0xefff) AM_ROM /* space for diagnostic ROM */
349349ADDRESS_MAP_END
trunk/src/mame/drivers/cop01.c
r22781r22782
158158
159159static ADDRESS_MAP_START( audio_io_map, AS_IO, 8, cop01_state )
160160   ADDRESS_MAP_GLOBAL_MASK(0xff)
161   AM_RANGE(0x00, 0x01) AM_DEVWRITE_LEGACY("ay1", ay8910_address_data_w)
162   AM_RANGE(0x02, 0x03) AM_DEVWRITE_LEGACY("ay2", ay8910_address_data_w)
163   AM_RANGE(0x04, 0x05) AM_DEVWRITE_LEGACY("ay3", ay8910_address_data_w)
161   AM_RANGE(0x00, 0x01) AM_DEVWRITE("ay1", ay8910_device, address_data_w)
162   AM_RANGE(0x02, 0x03) AM_DEVWRITE("ay2", ay8910_device, address_data_w)
163   AM_RANGE(0x04, 0x05) AM_DEVWRITE("ay3", ay8910_device, address_data_w)
164164   AM_RANGE(0x06, 0x06) AM_READ(cop01_sound_command_r)
165165ADDRESS_MAP_END
166166
trunk/src/mame/drivers/snk.c
r22781r22782
13801380static ADDRESS_MAP_START( marvins_sound_map, AS_PROGRAM, 8, snk_state )
13811381   AM_RANGE(0x0000, 0x3fff) AM_ROM
13821382   AM_RANGE(0x4000, 0x4000) AM_READ(marvins_soundlatch_r)
1383   AM_RANGE(0x8000, 0x8001) AM_DEVWRITE_LEGACY("ay1", ay8910_address_data_w)
1383   AM_RANGE(0x8000, 0x8001) AM_DEVWRITE("ay1", ay8910_device, address_data_w)
13841384   AM_RANGE(0x8002, 0x8007) AM_DEVWRITE("wave", snkwave_device, snkwave_w)
1385   AM_RANGE(0x8008, 0x8009) AM_DEVWRITE_LEGACY("ay2", ay8910_address_data_w)
1385   AM_RANGE(0x8008, 0x8009) AM_DEVWRITE("ay2", ay8910_device, address_data_w)
13861386   AM_RANGE(0xa000, 0xa000) AM_READ(marvins_sound_nmi_ack_r)
13871387   AM_RANGE(0xe000, 0xe7ff) AM_RAM
13881388ADDRESS_MAP_END
r22781r22782
13981398   AM_RANGE(0x8000, 0x87ff) AM_RAM
13991399   AM_RANGE(0xa000, 0xa000) AM_READ(sgladiat_soundlatch_r)
14001400   AM_RANGE(0xc000, 0xc000) AM_READ(sgladiat_sound_nmi_ack_r)
1401   AM_RANGE(0xe000, 0xe001) AM_DEVWRITE_LEGACY("ay1", ay8910_address_data_w)
1401   AM_RANGE(0xe000, 0xe001) AM_DEVWRITE("ay1", ay8910_device, address_data_w)
14021402   AM_RANGE(0xe002, 0xe003) AM_WRITENOP    // ? always FFFF, snkwave leftover?
1403   AM_RANGE(0xe004, 0xe005) AM_DEVWRITE_LEGACY("ay2", ay8910_address_data_w)
1403   AM_RANGE(0xe004, 0xe005) AM_DEVWRITE("ay2", ay8910_device, address_data_w)
14041404ADDRESS_MAP_END
14051405
14061406static ADDRESS_MAP_START( jcross_sound_portmap, AS_IO, 8, snk_state )
r22781r22782
14141414   AM_RANGE(0x8000, 0x87ff) AM_RAM
14151415   AM_RANGE(0xa000, 0xa000) AM_READ(sgladiat_soundlatch_r)
14161416   AM_RANGE(0xc000, 0xc000) AM_READ(sgladiat_sound_nmi_ack_r)
1417   AM_RANGE(0xe000, 0xe001) AM_DEVWRITE_LEGACY("ay1", ay8910_address_data_w)
1417   AM_RANGE(0xe000, 0xe001) AM_DEVWRITE("ay1", ay8910_device, address_data_w)
14181418//  AM_RANGE(0xe002, 0xe002) AM_WRITENOP    // bitfielded(0-5) details unknown. Filter enable?
1419   AM_RANGE(0xe008, 0xe009) AM_DEVWRITE_LEGACY("ay2", ay8910_address_data_w)
1419   AM_RANGE(0xe008, 0xe009) AM_DEVWRITE("ay2", ay8910_device, address_data_w)
14201420ADDRESS_MAP_END
14211421
14221422static ADDRESS_MAP_START( hal21_sound_portmap, AS_IO, 8, snk_state )
trunk/src/mame/drivers/olibochu.c
r22781r22782
277277   AM_RANGE(0x0000, 0x1fff) AM_ROM
278278   AM_RANGE(0x6000, 0x63ff) AM_RAM
279279   AM_RANGE(0x7000, 0x7000) AM_READ(soundlatch_byte_r) /* likely ay8910 input port, not direct */
280   AM_RANGE(0x7000, 0x7001) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
280   AM_RANGE(0x7000, 0x7001) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
281281   AM_RANGE(0x7004, 0x7004) AM_WRITENOP //sound filter?
282282   AM_RANGE(0x7006, 0x7006) AM_WRITENOP //irq ack?
283283ADDRESS_MAP_END
trunk/src/mame/drivers/route16.c
r22781r22782
262262   AM_RANGE(0x4800, 0x4800) AM_READ_PORT("DSW") AM_WRITE(route16_out0_w)
263263   AM_RANGE(0x5000, 0x5000) AM_READ_PORT("IN0") AM_WRITE(route16_out1_w)
264264   AM_RANGE(0x5800, 0x5800) AM_READWRITE(ttmahjng_input_port_matrix_r, ttmahjng_input_port_matrix_w)
265   AM_RANGE(0x6800, 0x6800) AM_DEVWRITE_LEGACY("ay8910", ay8910_data_w)
266   AM_RANGE(0x6900, 0x6900) AM_DEVWRITE_LEGACY("ay8910", ay8910_address_w)
265   AM_RANGE(0x6800, 0x6800) AM_DEVWRITE("ay8910", ay8910_device, data_w)
266   AM_RANGE(0x6900, 0x6900) AM_DEVWRITE("ay8910", ay8910_device, address_w)
267267   AM_RANGE(0x8000, 0xbfff) AM_RAM AM_SHARE("videoram1")
268268ADDRESS_MAP_END
269269
r22781r22782
285285
286286static ADDRESS_MAP_START( cpu1_io_map, AS_IO, 8, route16_state )
287287   ADDRESS_MAP_GLOBAL_MASK(0x1ff)
288   AM_RANGE(0x0000, 0x0000) AM_MIRROR(0x00ff) AM_DEVWRITE_LEGACY("ay8910", ay8910_data_w)
289   AM_RANGE(0x0100, 0x0100) AM_MIRROR(0x00ff) AM_DEVWRITE_LEGACY("ay8910", ay8910_address_w)
288   AM_RANGE(0x0000, 0x0000) AM_MIRROR(0x00ff) AM_DEVWRITE("ay8910", ay8910_device, data_w)
289   AM_RANGE(0x0100, 0x0100) AM_MIRROR(0x00ff) AM_DEVWRITE("ay8910", ay8910_device, address_w)
290290ADDRESS_MAP_END
291291
292292
trunk/src/mame/drivers/kingdrby.c
r22781r22782
455455
456456static ADDRESS_MAP_START( sound_io_map, AS_IO, 8, kingdrby_state )
457457   ADDRESS_MAP_GLOBAL_MASK(0xff)
458   AM_RANGE(0x40, 0x40) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
459   AM_RANGE(0x40, 0x41) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_address_w)
458   AM_RANGE(0x40, 0x40) AM_DEVREAD("aysnd", ay8910_device, data_r)
459   AM_RANGE(0x40, 0x41) AM_DEVWRITE("aysnd", ay8910_device, data_address_w)
460460ADDRESS_MAP_END
461461
462462static ADDRESS_MAP_START( cowrace_sound_map, AS_PROGRAM, 8, kingdrby_state )
trunk/src/mame/drivers/superqix.c
r22781r22782
562562
563563static ADDRESS_MAP_START( pbillian_port_map, AS_IO, 8, superqix_state )
564564   AM_RANGE(0x0000, 0x01ff) AM_RAM_WRITE(paletteram_BBGGRRII_byte_w) AM_SHARE("paletteram")
565   AM_RANGE(0x0401, 0x0401) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
566   AM_RANGE(0x0402, 0x0403) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_address_w)
565   AM_RANGE(0x0401, 0x0401) AM_DEVREAD("aysnd", ay8910_device, data_r)
566   AM_RANGE(0x0402, 0x0403) AM_DEVWRITE("aysnd", ay8910_device, data_address_w)
567567   AM_RANGE(0x0408, 0x0408) AM_READ(pbillian_from_mcu_r)
568568   AM_RANGE(0x0408, 0x0408) AM_WRITE(pbillian_z80_mcu_w)
569569   AM_RANGE(0x0410, 0x0410) AM_WRITE(pbillian_0410_w)
r22781r22782
575575
576576static ADDRESS_MAP_START( hotsmash_port_map, AS_IO, 8, superqix_state )
577577   AM_RANGE(0x0000, 0x01ff) AM_RAM_WRITE(paletteram_BBGGRRII_byte_w) AM_SHARE("paletteram")
578   AM_RANGE(0x0401, 0x0401) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
579   AM_RANGE(0x0402, 0x0403) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_address_w)
578   AM_RANGE(0x0401, 0x0401) AM_DEVREAD("aysnd", ay8910_device, data_r)
579   AM_RANGE(0x0402, 0x0403) AM_DEVWRITE("aysnd", ay8910_device, data_address_w)
580580   AM_RANGE(0x0408, 0x0408) AM_READ(hotsmash_from_mcu_r)
581581   AM_RANGE(0x0408, 0x0408) AM_WRITE(hotsmash_z80_mcu_w)
582582   AM_RANGE(0x0410, 0x0410) AM_WRITE(pbillian_0410_w)
r22781r22782
588588
589589static ADDRESS_MAP_START( sqix_port_map, AS_IO, 8, superqix_state )
590590   AM_RANGE(0x0000, 0x00ff) AM_RAM_WRITE(paletteram_BBGGRRII_byte_w) AM_SHARE("paletteram")
591   AM_RANGE(0x0401, 0x0401) AM_DEVREAD_LEGACY("ay1", ay8910_r)
592   AM_RANGE(0x0402, 0x0403) AM_DEVWRITE_LEGACY("ay1", ay8910_data_address_w)
593   AM_RANGE(0x0405, 0x0405) AM_DEVREAD_LEGACY("ay2", ay8910_r)
594   AM_RANGE(0x0406, 0x0407) AM_DEVWRITE_LEGACY("ay2", ay8910_data_address_w)
591   AM_RANGE(0x0401, 0x0401) AM_DEVREAD("ay1", ay8910_device, data_r)
592   AM_RANGE(0x0402, 0x0403) AM_DEVWRITE("ay1", ay8910_device, data_address_w)
593   AM_RANGE(0x0405, 0x0405) AM_DEVREAD("ay2", ay8910_device, data_r)
594   AM_RANGE(0x0406, 0x0407) AM_DEVWRITE("ay2", ay8910_device, data_address_w)
595595   AM_RANGE(0x0408, 0x0408) AM_READ(mcu_acknowledge_r)
596596   AM_RANGE(0x0410, 0x0410) AM_WRITE(superqix_0410_w)  /* ROM bank, NMI enable, tile bank */
597597   AM_RANGE(0x0418, 0x0418) AM_READ(nmi_ack_r)
trunk/src/mame/drivers/r2dtank.c
r22781r22782
180180   UINT8 ret = 0;
181181
182182   if (m_AY8910_selected & 0x08)
183      ret = ay8910_r(machine().device("ay1"), space, 0);
183      ret = machine().device<ay8910_device>("ay1")->data_r(space, 0);
184184
185185   if (m_AY8910_selected & 0x10)
186      ret = ay8910_r(machine().device("ay2"), space, 0);
186      ret = machine().device<ay8910_device>("ay2")->data_r(space, 0);
187187
188188   return ret;
189189}
r22781r22782
192192WRITE8_MEMBER(r2dtank_state::AY8910_port_w)
193193{
194194   if (m_AY8910_selected & 0x08)
195      ay8910_data_address_w(machine().device("ay1"), space, m_AY8910_selected >> 2, data);
195      machine().device<ay8910_device>("ay1")->data_address_w(space, m_AY8910_selected >> 2, data);
196196
197197   if (m_AY8910_selected & 0x10)
198      ay8910_data_address_w(machine().device("ay2"), space, m_AY8910_selected >> 2, data);
198      machine().device<ay8910_device>("ay2")->data_address_w(space, m_AY8910_selected >> 2, data);
199199}
200200
201201
trunk/src/mame/drivers/slapfght.c
r22781r22782
392392   AM_RANGE(0x0000, 0x1fff) AM_ROM
393393   AM_RANGE(0x8800, 0x880f) AM_RAM AM_SHARE("share1")
394394   AM_RANGE(0x8810, 0x8fff) AM_RAMBANK("bank1") /* Shared RAM with main CPU */
395   AM_RANGE(0xa080, 0xa080) AM_DEVWRITE_LEGACY("ay1", ay8910_address_w)
396   AM_RANGE(0xa081, 0xa081) AM_DEVREAD_LEGACY("ay1", ay8910_r)
397   AM_RANGE(0xa082, 0xa082) AM_DEVWRITE_LEGACY("ay1", ay8910_data_w)
398   AM_RANGE(0xa090, 0xa090) AM_DEVWRITE_LEGACY("ay2", ay8910_address_w)
399   AM_RANGE(0xa091, 0xa091) AM_DEVREAD_LEGACY("ay2", ay8910_r)
400   AM_RANGE(0xa092, 0xa092) AM_DEVWRITE_LEGACY("ay2", ay8910_data_w)
395   AM_RANGE(0xa080, 0xa080) AM_DEVWRITE("ay1", ay8910_device, address_w)
396   AM_RANGE(0xa081, 0xa081) AM_DEVREAD("ay1", ay8910_device, data_r)
397   AM_RANGE(0xa082, 0xa082) AM_DEVWRITE("ay1", ay8910_device, data_w)
398   AM_RANGE(0xa090, 0xa090) AM_DEVWRITE("ay2", ay8910_device, address_w)
399   AM_RANGE(0xa091, 0xa091) AM_DEVREAD("ay2", ay8910_device, data_r)
400   AM_RANGE(0xa092, 0xa092) AM_DEVWRITE("ay2", ay8910_device, data_w)
401401   AM_RANGE(0xa0e0, 0xa0e0) AM_WRITE(getstar_sh_intenable_w) /* maybe a0f0 also -LE */
402402//  AM_RANGE(0xa0f0, 0xa0f0) AM_WRITENOP
403403ADDRESS_MAP_END
404404
405405static ADDRESS_MAP_START( slapfght_sound_map, AS_PROGRAM, 8, slapfght_state )
406406   AM_RANGE(0x0000, 0x1fff) AM_ROM
407   AM_RANGE(0xa080, 0xa080) AM_DEVWRITE_LEGACY("ay1", ay8910_address_w)
408   AM_RANGE(0xa081, 0xa081) AM_DEVREAD_LEGACY("ay1", ay8910_r)
409   AM_RANGE(0xa082, 0xa082) AM_DEVWRITE_LEGACY("ay1", ay8910_data_w)
410   AM_RANGE(0xa090, 0xa090) AM_DEVWRITE_LEGACY("ay2", ay8910_address_w)
411   AM_RANGE(0xa091, 0xa091) AM_DEVREAD_LEGACY("ay2", ay8910_r)
412   AM_RANGE(0xa092, 0xa092) AM_DEVWRITE_LEGACY("ay2", ay8910_data_w)
407   AM_RANGE(0xa080, 0xa080) AM_DEVWRITE("ay1", ay8910_device, address_w)
408   AM_RANGE(0xa081, 0xa081) AM_DEVREAD("ay1", ay8910_device, data_r)
409   AM_RANGE(0xa082, 0xa082) AM_DEVWRITE("ay1", ay8910_device, data_w)
410   AM_RANGE(0xa090, 0xa090) AM_DEVWRITE("ay2", ay8910_device, address_w)
411   AM_RANGE(0xa091, 0xa091) AM_DEVREAD("ay2", ay8910_device, data_r)
412   AM_RANGE(0xa092, 0xa092) AM_DEVWRITE("ay2", ay8910_device, data_w)
413413   AM_RANGE(0xa0e0, 0xa0e0) AM_WRITE(getstar_sh_intenable_w) /* maybe a0f0 also -LE */
414414//  AM_RANGE(0xa0f0, 0xa0f0) AM_WRITENOP
415415   AM_RANGE(0xc800, 0xc80f) AM_RAM AM_SHARE("share1")
trunk/src/mame/drivers/40love.c
r22781r22782
738738static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, fortyl_state )
739739   AM_RANGE(0x0000, 0xbfff) AM_ROM
740740   AM_RANGE(0xc000, 0xc7ff) AM_RAM
741   AM_RANGE(0xc800, 0xc801) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
741   AM_RANGE(0xc800, 0xc801) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
742742   AM_RANGE(0xca00, 0xca0d) AM_DEVWRITE_LEGACY("msm", msm5232_w)
743743   AM_RANGE(0xcc00, 0xcc00) AM_WRITE(sound_control_0_w)
744744   AM_RANGE(0xce00, 0xce00) AM_WRITE(sound_control_1_w)
trunk/src/mame/drivers/supertnk.c
r22781r22782
309309   AM_RANGE(0x1800, 0x1bff) AM_RAM
310310   AM_RANGE(0x1efc, 0x1efc) AM_READ_PORT("JOYS")
311311   AM_RANGE(0x1efd, 0x1efd) AM_READ_PORT("INPUTS")
312   AM_RANGE(0x1efe, 0x1eff) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
312   AM_RANGE(0x1efe, 0x1eff) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
313313   AM_RANGE(0x1efe, 0x1efe) AM_READ_PORT("DSW")
314314   AM_RANGE(0x1eff, 0x1eff) AM_READ_PORT("UNK")
315315   AM_RANGE(0x2000, 0x3fff) AM_READWRITE(supertnk_videoram_r, supertnk_videoram_w)
trunk/src/mame/drivers/roul.c
r22781r22782
211211static ADDRESS_MAP_START( sound_cpu_io_map, AS_IO, 8, roul_state )
212212   ADDRESS_MAP_GLOBAL_MASK(0xff)
213213   AM_RANGE(0x00, 0x00) AM_READ(soundlatch_byte_r)
214   AM_RANGE(0x00, 0x01) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
214   AM_RANGE(0x00, 0x01) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
215215ADDRESS_MAP_END
216216
217217void roul_state::video_start()
trunk/src/mame/drivers/avt.c
r22781r22782
632632//  AM_RANGE(0x08, 0x0b) unk, maybe IO
633633//  AM_RANGE(0x08, 0x08)  AM_READ_PORT("IN2")
634634//  AM_RANGE(0x09, 0x09)  AM_READ_PORT("IN3")
635   AM_RANGE(0x21, 0x21) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_w)     /* AY8910 data */
636   AM_RANGE(0x23, 0x23) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w)      /* AY8910 control */
635   AM_RANGE(0x21, 0x21) AM_DEVWRITE("aysnd", ay8910_device, data_w)     /* AY8910 data */
636   AM_RANGE(0x23, 0x23) AM_DEVWRITE("aysnd", ay8910_device, address_w)      /* AY8910 control */
637637   AM_RANGE(0x28, 0x28) AM_WRITE(avt_6845_address_w)
638638   AM_RANGE(0x29, 0x29) AM_READWRITE(avt_6845_data_r,avt_6845_data_w)
639639ADDRESS_MAP_END
trunk/src/mame/drivers/fromance.c
r22781r22782
274274   AM_RANGE(0xe6, 0xe6) AM_READWRITE(fromance_commanddata_r, fromance_busycheck_sub_w)
275275   AM_RANGE(0xe7, 0xe7) AM_WRITE(fromance_adpcm_reset_w)
276276   AM_RANGE(0xe8, 0xe8) AM_WRITE(fromance_adpcm_w)
277   AM_RANGE(0xe9, 0xea) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_address_w)
277   AM_RANGE(0xe9, 0xea) AM_DEVWRITE("aysnd", ay8910_device, data_address_w)
278278ADDRESS_MAP_END
279279
280280static ADDRESS_MAP_START( idolmj_sub_io_map, AS_IO, 8, fromance_state )
r22781r22782
288288   AM_RANGE(0x26, 0x26) AM_READWRITE(fromance_commanddata_r, fromance_busycheck_sub_w)
289289   AM_RANGE(0x27, 0x27) AM_WRITE(fromance_adpcm_reset_w)
290290   AM_RANGE(0x28, 0x28) AM_WRITE(fromance_adpcm_w)
291   AM_RANGE(0x29, 0x2a) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_address_w)
291   AM_RANGE(0x29, 0x2a) AM_DEVWRITE("aysnd", ay8910_device, data_address_w)
292292ADDRESS_MAP_END
293293
294294static ADDRESS_MAP_START( fromance_sub_io_map, AS_IO, 8, fromance_state )
trunk/src/mame/drivers/popper.c
r22781r22782
181181
182182static ADDRESS_MAP_START( popper_sound_map, AS_PROGRAM, 8, popper_state )
183183   AM_RANGE(0x0000, 0x0fff) AM_ROM
184   AM_RANGE(0x8000, 0x8001) AM_DEVWRITE_LEGACY("ay1", ay8910_address_data_w)
184   AM_RANGE(0x8000, 0x8001) AM_DEVWRITE("ay1", ay8910_device, address_data_w)
185185   AM_RANGE(0x8002, 0x8002) AM_READNOP                 //?? all read once at startup and the
186186   AM_RANGE(0x8002, 0x8002) AM_WRITENOP                //?? same writes as 0x8000 (mostly)
187187   AM_RANGE(0x8003, 0x8003) AM_READNOP                 //?? result ignored, looks like part
188   AM_RANGE(0xa000, 0xa001) AM_DEVWRITE_LEGACY("ay2", ay8910_address_data_w)
188   AM_RANGE(0xa000, 0xa001) AM_DEVWRITE("ay2", ay8910_device, address_data_w)
189189   AM_RANGE(0xa002, 0xa002) AM_READNOP                 //?? of AY8910 initialisation
190190   AM_RANGE(0xa002, 0xa002) AM_WRITENOP                //?? same writes as 0xa000
191191   AM_RANGE(0xd800, 0xdfff) AM_RAM AM_SHARE("share1")
trunk/src/mame/drivers/statriv2.c
r22781r22782
309309static ADDRESS_MAP_START( statriv2_io_map, AS_IO, 8, statriv2_state )
310310   AM_RANGE(0x20, 0x23) AM_DEVREADWRITE("ppi8255", i8255_device, read, write)
311311   AM_RANGE(0x28, 0x2b) AM_READ(question_data_r) AM_WRITEONLY AM_SHARE("question_offset")
312   AM_RANGE(0xb0, 0xb1) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
313   AM_RANGE(0xb1, 0xb1) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
312   AM_RANGE(0xb0, 0xb1) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
313   AM_RANGE(0xb1, 0xb1) AM_DEVREAD("aysnd", ay8910_device, data_r)
314314   AM_RANGE(0xc0, 0xcf) AM_DEVREADWRITE_LEGACY("tms", tms9927_r, tms9927_w)
315315ADDRESS_MAP_END
316316
r22781r22782
318318static ADDRESS_MAP_START( statusbj_io, AS_IO, 8, statriv2_state )
319319   ADDRESS_MAP_GLOBAL_MASK(0xff)
320320   AM_RANGE(0x20, 0x23) AM_DEVREADWRITE("ppi8255", i8255_device, read, write)
321   AM_RANGE(0xb0, 0xb1) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
322   AM_RANGE(0xb1, 0xb1) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
321   AM_RANGE(0xb0, 0xb1) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
322   AM_RANGE(0xb1, 0xb1) AM_DEVREAD("aysnd", ay8910_device, data_r)
323323   AM_RANGE(0xc0, 0xcf) AM_DEVREADWRITE_LEGACY("tms", tms9927_r, tms9927_w)
324324ADDRESS_MAP_END
325325#endif
trunk/src/mame/drivers/sub.c
r22781r22782
274274static ADDRESS_MAP_START( subm_sound_io, AS_IO, 8, sub_state )
275275   ADDRESS_MAP_GLOBAL_MASK(0xff)
276276   AM_RANGE(0x00, 0x00) AM_READWRITE(soundlatch_byte_r, soundlatch2_byte_w) // to/from main CPU
277   AM_RANGE(0x40, 0x41) AM_DEVREADWRITE_LEGACY("ay1", ay8910_r, ay8910_address_data_w)
278   AM_RANGE(0x80, 0x81) AM_DEVREADWRITE_LEGACY("ay2", ay8910_r, ay8910_address_data_w)
277   AM_RANGE(0x40, 0x41) AM_DEVREADWRITE("ay1", ay8910_device, data_r, address_data_w)
278   AM_RANGE(0x80, 0x81) AM_DEVREADWRITE("ay2", ay8910_device, data_r, address_data_w)
279279ADDRESS_MAP_END
280280
281281
trunk/src/mame/drivers/blueprnt.c
r22781r22782
117117   AM_RANGE(0x0000, 0x0fff) AM_ROM AM_MIRROR(0x1000)
118118   AM_RANGE(0x2000, 0x2fff) AM_ROM AM_MIRROR(0x1000)
119119   AM_RANGE(0x4000, 0x43ff) AM_RAM
120   AM_RANGE(0x6000, 0x6001) AM_DEVWRITE_LEGACY("ay1", ay8910_address_data_w)
121   AM_RANGE(0x6002, 0x6002) AM_DEVREAD_LEGACY("ay1", ay8910_r)
122   AM_RANGE(0x8000, 0x8001) AM_DEVWRITE_LEGACY("ay2", ay8910_address_data_w)
123   AM_RANGE(0x8002, 0x8002) AM_DEVREAD_LEGACY("ay2", ay8910_r)
120   AM_RANGE(0x6000, 0x6001) AM_DEVWRITE("ay1", ay8910_device, address_data_w)
121   AM_RANGE(0x6002, 0x6002) AM_DEVREAD("ay1", ay8910_device, data_r)
122   AM_RANGE(0x8000, 0x8001) AM_DEVWRITE("ay2", ay8910_device, address_data_w)
123   AM_RANGE(0x8002, 0x8002) AM_DEVREAD("ay2", ay8910_device, data_r)
124124ADDRESS_MAP_END
125125
126126static ADDRESS_MAP_START( sound_io, AS_IO, 8, blueprnt_state )
trunk/src/mame/drivers/adp.c
r22781r22782
449449   AM_RANGE(0x800080, 0x800081) AM_DEVREADWRITE("h63484", h63484_device, status_r, address_w)
450450   AM_RANGE(0x800082, 0x800083) AM_DEVREADWRITE("h63484", h63484_device, data_r, data_w)
451451   AM_RANGE(0x800100, 0x800101) AM_READWRITE(test_r,wh2_w) //related to input
452   AM_RANGE(0x800140, 0x800143) AM_DEVREADWRITE8_LEGACY("aysnd", ay8910_r, ay8910_address_data_w, 0x00ff) //18b too
452   AM_RANGE(0x800140, 0x800143) AM_DEVREADWRITE8("aysnd", ay8910_device, data_r, address_data_w, 0x00ff) //18b too
453453   AM_RANGE(0x800180, 0x80019f) AM_DEVREADWRITE8_LEGACY("duart68681", duart68681_r, duart68681_w, 0xff )
454454   AM_RANGE(0xffc000, 0xffffff) AM_RAM
455455ADDRESS_MAP_END
r22781r22782
459459//  AM_RANGE(0x400000, 0x40001f) ?
460460   AM_RANGE(0x800080, 0x800081) AM_DEVREADWRITE("h63484", h63484_device, status_r, address_w) // bad
461461   AM_RANGE(0x800082, 0x800083) AM_DEVREADWRITE("h63484", h63484_device, data_r, data_w) // bad
462   AM_RANGE(0x800140, 0x800143) AM_DEVREADWRITE8_LEGACY("aysnd", ay8910_r, ay8910_address_data_w, 0x00ff) //18b too
462   AM_RANGE(0x800140, 0x800143) AM_DEVREADWRITE8("aysnd", ay8910_device, data_r, address_data_w, 0x00ff) //18b too
463463   AM_RANGE(0x800180, 0x80019f) AM_DEVREADWRITE8_LEGACY("duart68681", duart68681_r, duart68681_w, 0xff )
464464   AM_RANGE(0xff0000, 0xffffff) AM_RAM
465465ADDRESS_MAP_END
r22781r22782
514514   AM_RANGE(0x800082, 0x800083) AM_DEVREADWRITE("h63484", h63484_device, data_r, data_w)
515515   AM_RANGE(0x800088, 0x80008d) AM_WRITE8(ramdac_io_w, 0x00ff)
516516   AM_RANGE(0x800100, 0x800101) AM_RAM //???
517   AM_RANGE(0x800140, 0x800143) AM_DEVREADWRITE8_LEGACY("aysnd", ay8910_r, ay8910_address_data_w, 0x00ff) //18b too
517   AM_RANGE(0x800140, 0x800143) AM_DEVREADWRITE8("aysnd", ay8910_device, data_r, address_data_w, 0x00ff) //18b too
518518   AM_RANGE(0x800180, 0x80019f) AM_DEVREADWRITE8_LEGACY("duart68681", duart68681_r, duart68681_w, 0xff )
519519   AM_RANGE(0xfc0000, 0xffffff) AM_RAM
520520ADDRESS_MAP_END
r22781r22782
525525   AM_RANGE(0x800080, 0x800081) AM_DEVREADWRITE("h63484", h63484_device, status_r, address_w)
526526   AM_RANGE(0x800082, 0x800083) AM_DEVREADWRITE("h63484", h63484_device, data_r, data_w)
527527   AM_RANGE(0x800100, 0x800101) AM_RAM //???
528   AM_RANGE(0x800140, 0x800143) AM_DEVREADWRITE8_LEGACY("aysnd", ay8910_r, ay8910_address_data_w, 0x00ff) //18b too
528   AM_RANGE(0x800140, 0x800143) AM_DEVREADWRITE8("aysnd", ay8910_device, data_r, address_data_w, 0x00ff) //18b too
529529   AM_RANGE(0x800180, 0x80019f) AM_DEVREADWRITE8_LEGACY("duart68681", duart68681_r, duart68681_w, 0xff )
530530   AM_RANGE(0xfc0000, 0xffffff) AM_RAM
531531ADDRESS_MAP_END
trunk/src/mame/drivers/buggychl.c
r22781r22782
162162static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, buggychl_state )
163163   AM_RANGE(0x0000, 0x3fff) AM_ROM
164164   AM_RANGE(0x4000, 0x47ff) AM_RAM
165   AM_RANGE(0x4800, 0x4801) AM_DEVWRITE_LEGACY("ay1", ay8910_address_data_w)
166   AM_RANGE(0x4802, 0x4803) AM_DEVWRITE_LEGACY("ay2", ay8910_address_data_w)
165   AM_RANGE(0x4800, 0x4801) AM_DEVWRITE("ay1", ay8910_device, address_data_w)
166   AM_RANGE(0x4802, 0x4803) AM_DEVWRITE("ay2", ay8910_device, address_data_w)
167167   AM_RANGE(0x4810, 0x481d) AM_DEVWRITE_LEGACY("msm", msm5232_w)
168168   AM_RANGE(0x4820, 0x4820) AM_RAM /* VOL/BAL   for the 7630 on the MSM5232 output */
169169   AM_RANGE(0x4830, 0x4830) AM_RAM /* TRBL/BASS for the 7630 on the MSM5232 output  */
trunk/src/mame/drivers/tugboat.c
r22781r22782
219219
220220static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, tugboat_state )
221221   AM_RANGE(0x0000, 0x01ff) AM_RAM AM_SHARE("ram")
222   AM_RANGE(0x1060, 0x1061) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
222   AM_RANGE(0x1060, 0x1061) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
223223   AM_RANGE(0x10a0, 0x10a1) AM_WRITE(tugboat_hd46505_0_w)  /* scrolling is performed changing the start_addr register (0C/0D) */
224224   AM_RANGE(0x10c0, 0x10c1) AM_WRITE(tugboat_hd46505_1_w)
225225   AM_RANGE(0x11e4, 0x11e7) AM_DEVREADWRITE("pia0", pia6821_device, read, write)
trunk/src/mame/drivers/pandoras.c
r22781r22782
158158   AM_RANGE(0x0000, 0x1fff) AM_ROM                                                         /* ROM */
159159   AM_RANGE(0x2000, 0x23ff) AM_RAM                                                         /* RAM */
160160   AM_RANGE(0x4000, 0x4000) AM_READ(soundlatch_byte_r)                                         /* soundlatch_byte_r */
161   AM_RANGE(0x6000, 0x6000) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w)                          /* AY-8910 */
162   AM_RANGE(0x6001, 0x6001) AM_DEVREAD_LEGACY("aysnd", ay8910_r)                                   /* AY-8910 */
163   AM_RANGE(0x6002, 0x6002) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_w)                         /* AY-8910 */
161   AM_RANGE(0x6000, 0x6000) AM_DEVWRITE("aysnd", ay8910_device, address_w)                          /* AY-8910 */
162   AM_RANGE(0x6001, 0x6001) AM_DEVREAD("aysnd", ay8910_device, data_r)                                   /* AY-8910 */
163   AM_RANGE(0x6002, 0x6002) AM_DEVWRITE("aysnd", ay8910_device, data_w)                         /* AY-8910 */
164164   AM_RANGE(0x8000, 0x8000) AM_WRITE(pandoras_i8039_irqtrigger_w)                          /* cause INT on the 8039 */
165165   AM_RANGE(0xa000, 0xa000) AM_WRITE(soundlatch2_byte_w)                                       /* sound command to the 8039 */
166166ADDRESS_MAP_END
trunk/src/mame/drivers/rgum.c
r22781r22782
7070   AM_RANGE(0x0800, 0x0800) AM_DEVWRITE("crtc", mc6845_device, address_w)
7171   AM_RANGE(0x0801, 0x0801) AM_DEVREADWRITE("crtc", mc6845_device, register_r, register_w)
7272
73   AM_RANGE(0x2000, 0x2000) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_w)
74   AM_RANGE(0x2002, 0x2002) AM_DEVREADWRITE_LEGACY("aysnd", ay8910_r, ay8910_address_w)
73   AM_RANGE(0x2000, 0x2000) AM_DEVWRITE("aysnd", ay8910_device, data_w)
74   AM_RANGE(0x2002, 0x2002) AM_DEVREADWRITE("aysnd", ay8910_device, data_r, address_w)
7575
7676   AM_RANGE(0x2801, 0x2801) AM_READNOP //read but value discarded?
7777   AM_RANGE(0x2803, 0x2803) AM_READNOP
trunk/src/mame/drivers/phoenix.c
r22781r22782
6565   AM_RANGE(0x4000, 0x4fff) AM_READ_BANK("bank1") AM_WRITE(phoenix_videoram_w) /* 2 pages selected by bit 0 of the video register */
6666   AM_RANGE(0x5000, 0x53ff) AM_WRITE(phoenix_videoreg_w)
6767   AM_RANGE(0x5800, 0x5bff) AM_WRITE(phoenix_scroll_w)
68   AM_RANGE(0x6800, 0x68ff) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w)
69   AM_RANGE(0x6900, 0x69ff) AM_DEVREADWRITE_LEGACY("aysnd", ay8910_r, ay8910_data_w)
68   AM_RANGE(0x6800, 0x68ff) AM_DEVWRITE("aysnd", ay8910_device, address_w)
69   AM_RANGE(0x6900, 0x69ff) AM_DEVREADWRITE("aysnd", ay8910_device, data_r, data_w)
7070   AM_RANGE(0x7000, 0x73ff) AM_READ(survival_input_port_0_r)               /* IN0 or IN1 */
7171   AM_RANGE(0x7800, 0x7bff) AM_READ_PORT("DSW0")                           /* DSW */
7272ADDRESS_MAP_END
trunk/src/mame/drivers/goldnpkr.c
r22781r22782
13131313{
13141314   if (wcfalcon_flag == 0)
13151315   {
1316      ay8910_data_address_w(machine().device("ay8910"), space, 0, data);
1316      machine().device<ay8910_device>("ay8910")->data_address_w(space, 0, data);
13171317   }
13181318   else
13191319   {
1320      ay8910_data_address_w(machine().device("ay8910"), space, 1, data);
1320      machine().device<ay8910_device>("ay8910")->data_address_w(space, 1, data);
13211321   }
13221322
13231323   wcfalcon_flag = wcfalcon_flag ^ 1;
trunk/src/mame/drivers/looping.c
r22781r22782
549549   ADDRESS_MAP_GLOBAL_MASK(0x3fff)
550550   AM_RANGE(0x0000, 0x37ff) AM_ROM
551551   AM_RANGE(0x3800, 0x3bff) AM_RAM
552   AM_RANGE(0x3c00, 0x3c00) AM_MIRROR(0x00f4) AM_DEVREADWRITE_LEGACY("aysnd", ay8910_r, ay8910_address_w)
553   AM_RANGE(0x3c02, 0x3c02) AM_MIRROR(0x00f4) AM_READNOP AM_DEVWRITE_LEGACY("aysnd", ay8910_data_w)
552   AM_RANGE(0x3c00, 0x3c00) AM_MIRROR(0x00f4) AM_DEVREADWRITE("aysnd", ay8910_device, data_r, address_w)
553   AM_RANGE(0x3c02, 0x3c02) AM_MIRROR(0x00f4) AM_READNOP AM_DEVWRITE("aysnd", ay8910_device, data_w)
554554   AM_RANGE(0x3c03, 0x3c03) AM_MIRROR(0x00f6) AM_NOP
555555   AM_RANGE(0x3e00, 0x3e00) AM_MIRROR(0x00f4) AM_READNOP AM_DEVWRITE("tms", tms5220n_device, write)
556556   AM_RANGE(0x3e02, 0x3e02) AM_MIRROR(0x00f4) AM_DEVREAD("tms", tms5220n_device, read) AM_WRITENOP
trunk/src/mame/drivers/lasso.c
r22781r22782
190190
191191static ADDRESS_MAP_START( pinbo_audio_io_map, AS_IO, 8, lasso_state )
192192   ADDRESS_MAP_GLOBAL_MASK(0xff)
193   AM_RANGE(0x00, 0x01) AM_DEVWRITE_LEGACY("ay1", ay8910_address_data_w)
194   AM_RANGE(0x02, 0x02) AM_DEVREAD_LEGACY("ay1", ay8910_r)
195   AM_RANGE(0x04, 0x05) AM_DEVWRITE_LEGACY("ay2", ay8910_address_data_w)
196   AM_RANGE(0x06, 0x06) AM_DEVREAD_LEGACY("ay2", ay8910_r)
193   AM_RANGE(0x00, 0x01) AM_DEVWRITE("ay1", ay8910_device, address_data_w)
194   AM_RANGE(0x02, 0x02) AM_DEVREAD("ay1", ay8910_device, data_r)
195   AM_RANGE(0x04, 0x05) AM_DEVWRITE("ay2", ay8910_device, address_data_w)
196   AM_RANGE(0x06, 0x06) AM_DEVREAD("ay2", ay8910_device, data_r)
197197   AM_RANGE(0x08, 0x08) AM_READ(soundlatch_byte_r) AM_WRITENOP /* ??? */
198198   AM_RANGE(0x14, 0x14) AM_WRITENOP    /* ??? */
199199ADDRESS_MAP_END
trunk/src/mame/drivers/shangha3.c
r22781r22782
134134   AM_RANGE(0x200008, 0x200009) AM_WRITE(shangha3_blitter_go_w)
135135   AM_RANGE(0x20000a, 0x20000b) AM_WRITE(shangha3_irq_ack_w)
136136   AM_RANGE(0x20000c, 0x20000d) AM_WRITE(shangha3_coinctrl_w)
137   AM_RANGE(0x20001e, 0x20001f) AM_DEVREAD8_LEGACY("aysnd", ay8910_r, 0x00ff)
138   AM_RANGE(0x20002e, 0x20002f) AM_DEVWRITE8_LEGACY("aysnd", ay8910_data_w, 0x00ff)
139   AM_RANGE(0x20003e, 0x20003f) AM_DEVWRITE8_LEGACY("aysnd", ay8910_address_w, 0x00ff)
137   AM_RANGE(0x20001e, 0x20001f) AM_DEVREAD8("aysnd", ay8910_device, data_r, 0x00ff)
138   AM_RANGE(0x20002e, 0x20002f) AM_DEVWRITE8("aysnd", ay8910_device, data_w, 0x00ff)
139   AM_RANGE(0x20003e, 0x20003f) AM_DEVWRITE8("aysnd", ay8910_device, address_w, 0x00ff)
140140   AM_RANGE(0x20004e, 0x20004f) AM_READWRITE(shangha3_prot_r,shangha3_prot_w)
141141   AM_RANGE(0x20006e, 0x20006f) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff)
142142   AM_RANGE(0x300000, 0x30ffff) AM_RAM AM_SHARE("ram") /* gfx & work ram */
trunk/src/mame/drivers/halleys.c
r22781r22782
16881688static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, halleys_state )
16891689   AM_RANGE(0x0000, 0x3fff) AM_ROM
16901690   AM_RANGE(0x4000, 0x47ff) AM_RAM
1691   AM_RANGE(0x4800, 0x4801) AM_DEVWRITE_LEGACY("ay2", ay8910_address_data_w)
1692   AM_RANGE(0x4801, 0x4801) AM_DEVREAD_LEGACY("ay2", ay8910_r)
1693   AM_RANGE(0x4802, 0x4803) AM_DEVWRITE_LEGACY("ay3", ay8910_address_data_w)
1694   AM_RANGE(0x4803, 0x4803) AM_DEVREAD_LEGACY("ay3", ay8910_r)
1695   AM_RANGE(0x4804, 0x4805) AM_DEVWRITE_LEGACY("ay4", ay8910_address_data_w)
1696   AM_RANGE(0x4805, 0x4805) AM_DEVREAD_LEGACY("ay4", ay8910_r)
1691   AM_RANGE(0x4800, 0x4801) AM_DEVWRITE("ay2", ay8910_device, address_data_w)
1692   AM_RANGE(0x4801, 0x4801) AM_DEVREAD("ay2", ay8910_device, data_r)
1693   AM_RANGE(0x4802, 0x4803) AM_DEVWRITE("ay3", ay8910_device, address_data_w)
1694   AM_RANGE(0x4803, 0x4803) AM_DEVREAD("ay3", ay8910_device, data_r)
1695   AM_RANGE(0x4804, 0x4805) AM_DEVWRITE("ay4", ay8910_device, address_data_w)
1696   AM_RANGE(0x4805, 0x4805) AM_DEVREAD("ay4", ay8910_device, data_r)
16971697   AM_RANGE(0x5000, 0x5000) AM_READ(soundlatch_byte_r)
16981698   AM_RANGE(0xe000, 0xefff) AM_ROM // space for diagnostic ROM
16991699ADDRESS_MAP_END
trunk/src/mame/drivers/gsword.c
r22781r22782
290290
291291WRITE8_MEMBER(gsword_state::gsword_AY8910_control_port_0_w)
292292{
293   device_t *device = machine().device("ay1");
294   ay8910_address_w(device,space,offset,data);
293   ay8910_device *ay8910 = machine().device<ay8910_device>("ay1");
294   ay8910->address_w(space,offset,data);
295295   m_fake8910_0 = data;
296296}
297297WRITE8_MEMBER(gsword_state::gsword_AY8910_control_port_1_w)
298298{
299   device_t *device = machine().device("ay2");
300   ay8910_address_w(device,space,offset,data);
299   ay8910_device *ay8910 = machine().device<ay8910_device>("ay2");
300   ay8910->address_w(space,offset,data);
301301   m_fake8910_1 = data;
302302}
303303
r22781r22782
360360   AM_RANGE(0x20, 0x21) AM_READWRITE_LEGACY(TAITO8741_3_r,TAITO8741_3_w)
361361   AM_RANGE(0x40, 0x41) AM_READWRITE_LEGACY(TAITO8741_1_r,TAITO8741_1_w)
362362   AM_RANGE(0x60, 0x60) AM_READWRITE(gsword_fake_0_r, gsword_AY8910_control_port_0_w)
363   AM_RANGE(0x61, 0x61) AM_DEVREADWRITE_LEGACY("ay1", ay8910_r,        ay8910_data_w)
363   AM_RANGE(0x61, 0x61) AM_DEVREADWRITE("ay1", ay8910_device, data_r, data_w)
364364   AM_RANGE(0x80, 0x80) AM_READWRITE(gsword_fake_1_r, gsword_AY8910_control_port_1_w)
365   AM_RANGE(0x81, 0x81) AM_DEVREADWRITE_LEGACY("ay2", ay8910_r,        ay8910_data_w)
365   AM_RANGE(0x81, 0x81) AM_DEVREADWRITE("ay2", ay8910_device, data_r, data_w)
366366//
367367   AM_RANGE(0xe0, 0xe0) AM_READNOP /* ?? */
368368   AM_RANGE(0xa0, 0xa0) AM_WRITENOP /* ?? */
r22781r22782
394394static ADDRESS_MAP_START( josvolly_cpu2_io_map, AS_IO, 8, gsword_state )
395395   ADDRESS_MAP_GLOBAL_MASK(0xff)
396396   AM_RANGE(0x00, 0x00) AM_READWRITE(gsword_fake_0_r, gsword_AY8910_control_port_0_w)
397   AM_RANGE(0x01, 0x01) AM_DEVREADWRITE_LEGACY("ay1", ay8910_r,        ay8910_data_w)
397   AM_RANGE(0x01, 0x01) AM_DEVREADWRITE("ay1", ay8910_device, data_r, data_w)
398398   AM_RANGE(0x40, 0x40) AM_READWRITE(gsword_fake_1_r, gsword_AY8910_control_port_1_w)
399   AM_RANGE(0x41, 0x41) AM_DEVREADWRITE_LEGACY("ay2", ay8910_r,        ay8910_data_w)
399   AM_RANGE(0x41, 0x41) AM_DEVREADWRITE("ay2", ay8910_device, data_r, data_w)
400400
401401   AM_RANGE(0x81, 0x81) AM_WRITE_LEGACY(josvolly_nmi_enable_w)
402402   AM_RANGE(0xC1, 0xC1) AM_NOP // irq clear
trunk/src/mame/drivers/fortecar.c
r22781r22782
575575   ADDRESS_MAP_GLOBAL_MASK(0xff)
576576   AM_RANGE(0x20, 0x20) AM_DEVWRITE("crtc", mc6845_device, address_w)  // pc=444
577577   AM_RANGE(0x21, 0x21) AM_DEVWRITE("crtc", mc6845_device, register_w)
578   AM_RANGE(0x40, 0x40) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
579   AM_RANGE(0x40, 0x41) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
578   AM_RANGE(0x40, 0x40) AM_DEVREAD("aysnd", ay8910_device, data_r)
579   AM_RANGE(0x40, 0x41) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
580580   AM_RANGE(0x60, 0x63) AM_DEVREADWRITE("fcppi0", i8255_device, read, write)//M5L8255AP
581581//  AM_RANGE(0x80, 0x81) //8251A UART
582582   AM_RANGE(0xa0, 0xa0) AM_DEVREADWRITE("rtc", v3021_device, read, write)
trunk/src/mame/drivers/superwng.c
r22781r22782
314314   AM_RANGE(0x0000, 0x1fff) AM_ROM
315315   AM_RANGE(0x2000, 0x23ff) AM_RAM
316316   AM_RANGE(0x3000, 0x3000) AM_WRITE(superwng_sound_nmi_clear_w)
317   AM_RANGE(0x4000, 0x4000) AM_DEVREADWRITE_LEGACY("ay1", ay8910_r, ay8910_data_w)
318   AM_RANGE(0x5000, 0x5000) AM_DEVWRITE_LEGACY("ay1", ay8910_address_w)
319   AM_RANGE(0x6000, 0x6000) AM_DEVREADWRITE_LEGACY("ay2", ay8910_r, ay8910_data_w)
320   AM_RANGE(0x7000, 0x7000) AM_DEVWRITE_LEGACY("ay2", ay8910_address_w)
317   AM_RANGE(0x4000, 0x4000) AM_DEVREADWRITE("ay1", ay8910_device, data_r, data_w)
318   AM_RANGE(0x5000, 0x5000) AM_DEVWRITE("ay1", ay8910_device, address_w)
319   AM_RANGE(0x6000, 0x6000) AM_DEVREADWRITE("ay2", ay8910_device, data_r, data_w)
320   AM_RANGE(0x7000, 0x7000) AM_DEVWRITE("ay2", ay8910_device, address_w)
321321ADDRESS_MAP_END
322322
323323static INPUT_PORTS_START( superwng )
trunk/src/mame/drivers/carrera.c
r22781r22782
8585   AM_RANGE(0x04, 0x04) AM_READ_PORT("IN4")
8686   AM_RANGE(0x05, 0x05) AM_READ_PORT("IN5")
8787   AM_RANGE(0x06, 0x06) AM_WRITENOP // ?
88   AM_RANGE(0x08, 0x09) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
88   AM_RANGE(0x08, 0x09) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
8989ADDRESS_MAP_END
9090
9191static INPUT_PORTS_START( carrera )
trunk/src/mame/drivers/corona.c
r22781r22782
646646static ADDRESS_MAP_START(  winner81_sound_cpu_io_map, AS_IO, 8, corona_state )
647647   ADDRESS_MAP_GLOBAL_MASK(0xff)
648648   AM_RANGE(0x00, 0x00) AM_READ(sound_latch_r)
649   AM_RANGE(0x00, 0x01) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
649   AM_RANGE(0x00, 0x01) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
650650ADDRESS_MAP_END
651651
652652/*  Winners Circle 1982
r22781r22782
700700static ADDRESS_MAP_START( winner82_sound_cpu_io_map, AS_IO, 8, corona_state )
701701   ADDRESS_MAP_GLOBAL_MASK(0xff)
702702   AM_RANGE(0x00, 0x00) AM_READ(sound_latch_r)
703   AM_RANGE(0x00, 0x01) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
703   AM_RANGE(0x00, 0x01) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
704704   AM_RANGE(0x02, 0x03) AM_WRITENOP    /* socket for another ay, inited but never played */
705705ADDRESS_MAP_END
706706
r22781r22782
761761static ADDRESS_MAP_START( re800_sound_cpu_io_map, AS_IO, 8, corona_state )
762762   ADDRESS_MAP_GLOBAL_MASK(0xff)
763763   AM_RANGE(0x00, 0x00) AM_READ(sound_latch_r)
764   AM_RANGE(0x00, 0x01) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
764   AM_RANGE(0x00, 0x01) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
765765ADDRESS_MAP_END
766766
767767
r22781r22782
821821static ADDRESS_MAP_START( luckyrlt_sound_cpu_io_map, AS_IO, 8, corona_state )
822822   ADDRESS_MAP_GLOBAL_MASK(0xff)
823823   AM_RANGE(0x00, 0x00) AM_READ(sound_latch_r)
824   AM_RANGE(0x00, 0x01) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
824   AM_RANGE(0x00, 0x01) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
825825ADDRESS_MAP_END
826826
827827
trunk/src/mame/drivers/matmania.c
r22781r22782
102102
103103static ADDRESS_MAP_START( matmania_sound_map, AS_PROGRAM, 8, matmania_state )
104104   AM_RANGE(0x0000, 0x01ff) AM_RAM
105   AM_RANGE(0x2000, 0x2001) AM_DEVWRITE_LEGACY("ay1", ay8910_data_address_w)
106   AM_RANGE(0x2002, 0x2003) AM_DEVWRITE_LEGACY("ay2", ay8910_data_address_w)
105   AM_RANGE(0x2000, 0x2001) AM_DEVWRITE("ay1", ay8910_device, data_address_w)
106   AM_RANGE(0x2002, 0x2003) AM_DEVWRITE("ay2", ay8910_device, data_address_w)
107107   AM_RANGE(0x2004, 0x2004) AM_DEVWRITE("dac", dac_device, write_signed8)
108108   AM_RANGE(0x2007, 0x2007) AM_READ(soundlatch_byte_r)
109109   AM_RANGE(0x8000, 0xffff) AM_ROM
trunk/src/mame/drivers/1942.c
r22781r22782
109109   AM_RANGE(0x0000, 0x3fff) AM_ROM
110110   AM_RANGE(0x4000, 0x47ff) AM_RAM
111111   AM_RANGE(0x6000, 0x6000) AM_READ(soundlatch_byte_r)
112   AM_RANGE(0x8000, 0x8001) AM_DEVWRITE_LEGACY("ay1", ay8910_address_data_w)
113   AM_RANGE(0xc000, 0xc001) AM_DEVWRITE_LEGACY("ay2", ay8910_address_data_w)
112   AM_RANGE(0x8000, 0x8001) AM_DEVWRITE("ay1", ay8910_device, address_data_w)
113   AM_RANGE(0xc000, 0xc001) AM_DEVWRITE("ay2", ay8910_device, address_data_w)
114114ADDRESS_MAP_END
115115
116116
trunk/src/mame/drivers/icecold.c
r22781r22782
223223WRITE8_MEMBER( icecold_state::snd_ctrl_w )
224224{
225225   if (m_ay_ctrl & ~data & 0x04)
226      ay8910_data_address_w(m_ay8910_0, space, m_ay_ctrl & 0x01, m_sound_latch);
226      m_ay8910_0->data_address_w(space, m_ay_ctrl & 0x01, m_sound_latch);
227227   if (m_ay_ctrl & ~data & 0x20)
228      ay8910_data_address_w(m_ay8910_1, space, (m_ay_ctrl>>3) & 0x01, m_sound_latch);
228      m_ay8910_1->data_address_w(space, (m_ay_ctrl>>3) & 0x01, m_sound_latch);
229229
230230   m_ay_ctrl = data;
231231}
r22781r22782
238238READ8_MEMBER( icecold_state::ay_r )
239239{
240240   if (m_ay_ctrl & 0x02)
241      return ay8910_r(m_ay8910_0, space, 0);
241      return m_ay8910_0->data_r(space, 0);
242242   if (m_ay_ctrl & 0x10)
243      return ay8910_r(m_ay8910_1, space, 0);
243      return m_ay8910_1->data_r(space, 0);
244244
245245   return 0;
246246}
trunk/src/mame/drivers/dblcrown.c
r22781r22782
322322   AM_RANGE(0x10, 0x10) AM_READWRITE(lamps_r,lamps_w)
323323   AM_RANGE(0x11, 0x11) AM_READWRITE(bank_r,bank_w)
324324   AM_RANGE(0x12, 0x12) AM_READWRITE(mux_r,mux_w)
325   AM_RANGE(0x20, 0x21) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
325   AM_RANGE(0x20, 0x21) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
326326//  AM_RANGE(0x30, 0x30) always 1?
327327   AM_RANGE(0x40, 0x40) AM_WRITE(output_w)
328328ADDRESS_MAP_END
trunk/src/mame/drivers/lsasquad.c
r22781r22782
190190   AM_RANGE(0x0000, 0x7fff) AM_ROM
191191   AM_RANGE(0x8000, 0x87ff) AM_RAM
192192   AM_RANGE(0xa000, 0xa001) AM_DEVREADWRITE("ymsnd", ym2203_device, read, write)
193   AM_RANGE(0xc000, 0xc001) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
193   AM_RANGE(0xc000, 0xc001) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
194194   AM_RANGE(0xd000, 0xd000) AM_READWRITE(lsasquad_sh_sound_command_r, lsasquad_sh_result_w)
195195   AM_RANGE(0xd400, 0xd400) AM_WRITE(lsasquad_sh_nmi_disable_w)
196196   AM_RANGE(0xd800, 0xd800) AM_WRITE(lsasquad_sh_nmi_enable_w)
r22781r22782
397397   AM_RANGE(0x0000, 0x7fff) AM_ROM
398398   AM_RANGE(0x8000, 0x87ff) AM_RAM
399399   AM_RANGE(0xa000, 0xa001) AM_DEVREADWRITE("ymsnd", ym2203_device, read, write)
400   AM_RANGE(0xc000, 0xc001) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
400   AM_RANGE(0xc000, 0xc001) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
401401   AM_RANGE(0xd000, 0xd000) AM_READ(daikaiju_sh_sound_command_r)
402402   AM_RANGE(0xd400, 0xd400) AM_WRITENOP
403403   AM_RANGE(0xd800, 0xd800) AM_READ(daikaiju_sound_status_r) AM_WRITENOP
trunk/src/mame/drivers/merit.c
r22781r22782
470470ADDRESS_MAP_END
471471
472472static ADDRESS_MAP_START( trvwhiz_io_map, AS_IO, 8, merit_state )
473   AM_RANGE(0x8000, 0x8000) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w)
474   AM_RANGE(0x8100, 0x8100) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_w)
473   AM_RANGE(0x8000, 0x8000) AM_DEVWRITE("aysnd", ay8910_device, address_w)
474   AM_RANGE(0x8100, 0x8100) AM_DEVWRITE("aysnd", ay8910_device, data_w)
475475ADDRESS_MAP_END
476476
477477
r22781r22782
491491ADDRESS_MAP_END
492492
493493static ADDRESS_MAP_START( phrcraze_io_map, AS_IO, 8, merit_state )
494   AM_RANGE(0xc004, 0xc004) AM_MIRROR(0x1cf3) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w)
495   AM_RANGE(0xc104, 0xc104) AM_MIRROR(0x1cf3) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_w)
494   AM_RANGE(0xc004, 0xc004) AM_MIRROR(0x1cf3) AM_DEVWRITE("aysnd", ay8910_device, address_w)
495   AM_RANGE(0xc104, 0xc104) AM_MIRROR(0x1cf3) AM_DEVWRITE("aysnd", ay8910_device, data_w)
496496ADDRESS_MAP_END
497497
498498
r22781r22782
512512ADDRESS_MAP_END
513513
514514static ADDRESS_MAP_START( tictac_io_map, AS_IO, 8, merit_state )
515   AM_RANGE(0xc00c, 0xc00c) AM_MIRROR(0x1cf3) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w)
516   AM_RANGE(0xc10c, 0xc10c) AM_MIRROR(0x1cf3) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_w)
515   AM_RANGE(0xc00c, 0xc00c) AM_MIRROR(0x1cf3) AM_DEVWRITE("aysnd", ay8910_device, address_w)
516   AM_RANGE(0xc10c, 0xc10c) AM_MIRROR(0x1cf3) AM_DEVWRITE("aysnd", ay8910_device, data_w)
517517ADDRESS_MAP_END
518518
519519
trunk/src/mame/drivers/trvmadns.c
r22781r22782
232232
233233static ADDRESS_MAP_START( io_map, AS_IO, 8, trvmadns_state )
234234   ADDRESS_MAP_GLOBAL_MASK(0xff)
235   AM_RANGE(0x00, 0x01) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
235   AM_RANGE(0x00, 0x01) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
236236   AM_RANGE(0x02, 0x02) AM_READ_PORT("IN0")
237237   AM_RANGE(0x80, 0x80) AM_WRITE(trvmadns_banking_w)
238238ADDRESS_MAP_END
trunk/src/mame/audio/gottlieb.c
r22781r22782
814814         // bit 3 selects which of the two 8913 to enable
815815         // bit 4 goes to the 8913 BC1 pin
816816         if ((data & 0x08) != 0)
817            ay8910_data_address_w(m_ay1, space, data >> 4, m_psg_latch);
817            m_ay1->data_address_w(space, data >> 4, m_psg_latch);
818818         else
819            ay8910_data_address_w(m_ay2, space, data >> 4, m_psg_latch);
819            m_ay2->data_address_w(space, data >> 4, m_psg_latch);
820820      }
821821   }
822822   else
r22781r22782
828828      else
829829      {
830830         ay8913_device *ay = (data & 0x08) ? m_ay1 : m_ay2;
831         ay8910_address_w(ay, space, 0, m_psg_latch);
832         ay8910_data_w(ay, space, 0, m_psg_data_latch);
831         ay->address_w(space, 0, m_psg_latch);
832         ay->data_w(space, 0, m_psg_data_latch);
833833      }
834834   }
835835
trunk/src/mame/audio/mario.c
r22781r22782
601601static ADDRESS_MAP_START( masao_sound_map, AS_PROGRAM, 8, mario_state )
602602   AM_RANGE(0x0000, 0x0fff) AM_ROM
603603   AM_RANGE(0x2000, 0x23ff) AM_RAM
604   AM_RANGE(0x4000, 0x4000) AM_DEVREADWRITE_LEGACY("aysnd", ay8910_r, ay8910_data_w)
605   AM_RANGE(0x6000, 0x6000) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w)
604   AM_RANGE(0x4000, 0x4000) AM_DEVREADWRITE("aysnd", ay8910_device, data_r, data_w)
605   AM_RANGE(0x6000, 0x6000) AM_DEVWRITE("aysnd", ay8910_device, address_w)
606606ADDRESS_MAP_END
607607
608608/*************************************
trunk/src/mame/audio/midway.c
r22781r22782
416416   AM_RANGE(0x0000, 0x3fff) AM_ROM
417417   AM_RANGE(0x8000, 0x83ff) AM_MIRROR(0x0c00) AM_RAM
418418   AM_RANGE(0x9000, 0x9003) AM_MIRROR(0x0ffc) AM_READ(data_r)
419   AM_RANGE(0xa000, 0xa000) AM_MIRROR(0x0ffc) AM_DEVWRITE_LEGACY("ay0", ay8910_address_w)
420   AM_RANGE(0xa001, 0xa001) AM_MIRROR(0x0ffc) AM_DEVREAD_LEGACY("ay0", ay8910_r)
421   AM_RANGE(0xa002, 0xa002) AM_MIRROR(0x0ffc) AM_DEVWRITE_LEGACY("ay0", ay8910_data_w)
422   AM_RANGE(0xb000, 0xb000) AM_MIRROR(0x0ffc) AM_DEVWRITE_LEGACY("ay1", ay8910_address_w)
423   AM_RANGE(0xb001, 0xb001) AM_MIRROR(0x0ffc) AM_DEVREAD_LEGACY("ay1", ay8910_r)
424   AM_RANGE(0xb002, 0xb002) AM_MIRROR(0x0ffc) AM_DEVWRITE_LEGACY("ay1", ay8910_data_w)
419   AM_RANGE(0xa000, 0xa000) AM_MIRROR(0x0ffc) AM_DEVWRITE("ay0", ay8910_device, address_w)
420   AM_RANGE(0xa001, 0xa001) AM_MIRROR(0x0ffc) AM_DEVREAD("ay0", ay8910_device, data_r)
421   AM_RANGE(0xa002, 0xa002) AM_MIRROR(0x0ffc) AM_DEVWRITE("ay0", ay8910_device, data_w)
422   AM_RANGE(0xb000, 0xb000) AM_MIRROR(0x0ffc) AM_DEVWRITE("ay1", ay8910_device, address_w)
423   AM_RANGE(0xb001, 0xb001) AM_MIRROR(0x0ffc) AM_DEVREAD("ay1", ay8910_device, data_r)
424   AM_RANGE(0xb002, 0xb002) AM_MIRROR(0x0ffc) AM_DEVWRITE("ay1", ay8910_device, data_w)
425425   AM_RANGE(0xc000, 0xcfff) AM_READNOP AM_WRITE(status_w)
426426   AM_RANGE(0xd000, 0xdfff) AM_WRITENOP    // low bit controls yellow LED
427427   AM_RANGE(0xe000, 0xefff) AM_READ(irq_clear)
trunk/src/mame/audio/redalert.c
r22781r22782
7676
7777WRITE8_MEMBER(redalert_state::redalert_AY8910_w)
7878{
79   device_t *device = machine().device("aysnd");
79   ay8910_device *ay8910 = machine().device<ay8910_device>("aysnd");
8080   /* BC2 is connected to a pull-up resistor, so BC2=1 always */
8181   switch (data & 0x03)
8282   {
r22781r22782
8686
8787      /* BC1=1, BDIR=0 : read from PSG */
8888      case 0x01:
89         m_ay8910_latch_1 = ay8910_r(device, space, 0);
89         m_ay8910_latch_1 = ay8910->data_r(space, 0);
9090         break;
9191
9292      /* BC1=0, BDIR=1 : write to PSG */
r22781r22782
9494      case 0x02:
9595      case 0x03:
9696      default:
97         ay8910_data_address_w(device, space, data, m_ay8910_latch_2);
97         ay8910->data_address_w(space, data, m_ay8910_latch_2);
9898         break;
9999   }
100100}
r22781r22782
300300
301301WRITE8_MEMBER(redalert_state::demoneye_ay8910_data_w)
302302{
303   device_t *ay1 = machine().device("ay1");
304   device_t *ay2 = machine().device("ay2");
303   ay8910_device *ay1 = machine().device<ay8910_device>("ay1");
304   ay8910_device *ay2 = machine().device<ay8910_device>("ay2");
305305
306306   switch (m_ay8910_latch_1 & 0x03)
307307   {
308308      case 0x00:
309309         if (m_ay8910_latch_1 & 0x10)
310            ay8910_data_w(ay1, space, 0, data);
310            ay1->data_w(space, 0, data);
311311
312312         if (m_ay8910_latch_1 & 0x20)
313            ay8910_data_w(ay2, space, 0, data);
313            ay2->data_w(space, 0, data);
314314
315315         break;
316316
317317      case 0x01:
318318         if (m_ay8910_latch_1 & 0x10)
319            m_ay8910_latch_2 = ay8910_r(ay1, space, 0);
319            m_ay8910_latch_2 = ay1->data_r(space, 0);
320320
321321         if (m_ay8910_latch_1 & 0x20)
322            m_ay8910_latch_2 = ay8910_r(ay2, space, 0);
322            m_ay8910_latch_2 = ay2->data_r(space, 0);
323323
324324         break;
325325
326326      case 0x03:
327327         if (m_ay8910_latch_1 & 0x10)
328            ay8910_address_w(ay1, space, 0, data);
328            ay1->address_w(space, 0, data);
329329
330330         if (m_ay8910_latch_1 & 0x20)
331            ay8910_address_w(ay2, space, 0, data);
331            ay2->address_w(space, 0, data);
332332
333333         break;
334334
trunk/src/mame/audio/timeplt.c
r22781r22782
167167static ADDRESS_MAP_START( timeplt_sound_map, AS_PROGRAM, 8, driver_device )
168168   AM_RANGE(0x0000, 0x2fff) AM_ROM
169169   AM_RANGE(0x3000, 0x33ff) AM_MIRROR(0x0c00) AM_RAM
170   AM_RANGE(0x4000, 0x4000) AM_MIRROR(0x0fff) AM_DEVREADWRITE_LEGACY("ay1", ay8910_r, ay8910_data_w)
171   AM_RANGE(0x5000, 0x5000) AM_MIRROR(0x0fff) AM_DEVWRITE_LEGACY("ay1", ay8910_address_w)
172   AM_RANGE(0x6000, 0x6000) AM_MIRROR(0x0fff) AM_DEVREADWRITE_LEGACY("ay2", ay8910_r, ay8910_data_w)
173   AM_RANGE(0x7000, 0x7000) AM_MIRROR(0x0fff) AM_DEVWRITE_LEGACY("ay2", ay8910_address_w)
170   AM_RANGE(0x4000, 0x4000) AM_MIRROR(0x0fff) AM_DEVREADWRITE("ay1", ay8910_device, data_r, data_w)
171   AM_RANGE(0x5000, 0x5000) AM_MIRROR(0x0fff) AM_DEVWRITE("ay1", ay8910_device, address_w)
172   AM_RANGE(0x6000, 0x6000) AM_MIRROR(0x0fff) AM_DEVREADWRITE("ay2", ay8910_device, data_r, data_w)
173   AM_RANGE(0x7000, 0x7000) AM_MIRROR(0x0fff) AM_DEVWRITE("ay2", ay8910_device, address_w)
174174   AM_RANGE(0x8000, 0xffff) AM_DEVWRITE_LEGACY("timeplt_audio", timeplt_filter_w)
175175ADDRESS_MAP_END
176176
r22781r22782
179179   AM_RANGE(0x0000, 0x1fff) AM_ROM
180180   AM_RANGE(0x2000, 0x23ff) AM_MIRROR(0x0c00) AM_RAM
181181   AM_RANGE(0x3000, 0x3fff) AM_DEVWRITE_LEGACY("timeplt_audio", timeplt_filter_w)
182   AM_RANGE(0x4000, 0x4000) AM_MIRROR(0x0fff) AM_DEVREADWRITE_LEGACY("ay1", ay8910_r, ay8910_data_w)
183   AM_RANGE(0x5000, 0x5000) AM_MIRROR(0x0fff) AM_DEVWRITE_LEGACY("ay1", ay8910_address_w)
184   AM_RANGE(0x6000, 0x6000) AM_MIRROR(0x0fff) AM_DEVREADWRITE_LEGACY("ay2", ay8910_r, ay8910_data_w)
185   AM_RANGE(0x7000, 0x7000) AM_MIRROR(0x0fff) AM_DEVWRITE_LEGACY("ay2", ay8910_address_w)
182   AM_RANGE(0x4000, 0x4000) AM_MIRROR(0x0fff) AM_DEVREADWRITE("ay1", ay8910_device, data_r, data_w)
183   AM_RANGE(0x5000, 0x5000) AM_MIRROR(0x0fff) AM_DEVWRITE("ay1", ay8910_device, address_w)
184   AM_RANGE(0x6000, 0x6000) AM_MIRROR(0x0fff) AM_DEVREADWRITE("ay2", ay8910_device, data_r, data_w)
185   AM_RANGE(0x7000, 0x7000) AM_MIRROR(0x0fff) AM_DEVWRITE("ay2", ay8910_device, address_w)
186186ADDRESS_MAP_END
187187
188188
trunk/src/mame/audio/cinemat.c
r22781r22782
14171417static ADDRESS_MAP_START( demon_sound_map, AS_PROGRAM, 8, driver_device )
14181418   AM_RANGE(0x0000, 0x1fff) AM_ROM
14191419   AM_RANGE(0x3000, 0x33ff) AM_RAM
1420   AM_RANGE(0x4000, 0x4001) AM_DEVREAD_LEGACY("ay1", ay8910_r)
1421   AM_RANGE(0x4002, 0x4003) AM_DEVWRITE_LEGACY("ay1", ay8910_data_address_w)
1422   AM_RANGE(0x5000, 0x5001) AM_DEVREAD_LEGACY("ay2", ay8910_r)
1423   AM_RANGE(0x5002, 0x5003) AM_DEVWRITE_LEGACY("ay2", ay8910_data_address_w)
1424   AM_RANGE(0x6000, 0x6001) AM_DEVREAD_LEGACY("ay3", ay8910_r)
1425   AM_RANGE(0x6002, 0x6003) AM_DEVWRITE_LEGACY("ay3", ay8910_data_address_w)
1420   AM_RANGE(0x4000, 0x4001) AM_DEVREAD("ay1", ay8910_device, data_r)
1421   AM_RANGE(0x4002, 0x4003) AM_DEVWRITE("ay1", ay8910_device, data_address_w)
1422   AM_RANGE(0x5000, 0x5001) AM_DEVREAD("ay2", ay8910_device, data_r)
1423   AM_RANGE(0x5002, 0x5003) AM_DEVWRITE("ay2", ay8910_device, data_address_w)
1424   AM_RANGE(0x6000, 0x6001) AM_DEVREAD("ay3", ay8910_device, data_r)
1425   AM_RANGE(0x6002, 0x6003) AM_DEVWRITE("ay3", ay8910_device, data_address_w)
14261426   AM_RANGE(0x7000, 0x7000) AM_WRITENOP  /* watchdog? */
14271427ADDRESS_MAP_END
14281428
trunk/src/mame/audio/irem.c
r22781r22782
1616   UINT8                m_port1;
1717   UINT8                m_port2;
1818
19   device_t *m_ay1;
20   device_t *m_ay2;
19   ay8910_device *m_ay1;
20   ay8910_device *m_ay2;
2121   device_t *m_adpcm1;
2222   device_t *m_adpcm2;
2323};
r22781r22782
4545
4646   state->m_adpcm1 = machine.device("msm1");
4747   state->m_adpcm2 = machine.device("msm2");
48   state->m_ay1 = machine.device("ay1");
49   state->m_ay2 = machine.device("ay2");
48   state->m_ay1 = machine.device<ay8910_device>("ay1");
49   state->m_ay2 = machine.device<ay8910_device>("ay2");
5050
5151   device->save_item(NAME(state->m_port1));
5252   device->save_item(NAME(state->m_port2));
r22781r22782
9898      {
9999         /* PSG 0 or 1? */
100100         if (state->m_port2 & 0x08)
101            ay8910_address_w(state->m_ay1, space, 0, state->m_port1);
101            state->m_ay1->address_w(space, 0, state->m_port1);
102102         if (state->m_port2 & 0x10)
103            ay8910_address_w(state->m_ay2, space, 0, state->m_port1);
103            state->m_ay2->address_w(space, 0, state->m_port1);
104104      }
105105      else
106106      {
107107         /* PSG 0 or 1? */
108108         if (state->m_port2 & 0x08)
109            ay8910_data_w(state->m_ay1, space, 0, state->m_port1);
109            state->m_ay1->data_w(space, 0, state->m_port1);
110110         if (state->m_port2 & 0x10)
111            ay8910_data_w(state->m_ay2, space, 0, state->m_port1);
111            state->m_ay2->data_w(space, 0, state->m_port1);
112112      }
113113   }
114114   state->m_port2 = data;
r22781r22782
128128
129129   /* PSG 0 or 1? */
130130   if (state->m_port2 & 0x08)
131      return ay8910_r(state->m_ay1, space, 0);
131      return state->m_ay1->data_r(space, 0);
132132   if (state->m_port2 & 0x10)
133      return ay8910_r(state->m_ay2, space, 0);
133      return state->m_ay2->data_r(space, 0);
134134   return 0xff;
135135}
136136
trunk/src/mame/audio/carnival.c
r22781r22782
255255
256256static WRITE8_DEVICE_HANDLER( carnival_music_port_2_w )
257257{
258   ay8910_device *ay8910 = (ay8910_device *) device;
258259   static int psgSelect = 0;
259260   int newSelect;
260261
r22781r22782
274275         break;
275276
276277      case PSG_BC_WRITE:
277         ay8910_data_w( device, space, 0, psgData );
278         ay8910->data_w(space, 0, psgData);
278279         break;
279280
280281      case PSG_BC_LATCH_ADDRESS:
281         ay8910_address_w( device, space, 0, psgData );
282         ay8910->address_w(space, 0, psgData);
282283         break;
283284      }
284285   }
trunk/src/mame/audio/scramble.c
r22781r22782
311311static ADDRESS_MAP_START( ad2083_sound_io_map, AS_IO, 8, driver_device )
312312   ADDRESS_MAP_GLOBAL_MASK(0xff)
313313   AM_RANGE(0x01, 0x01) AM_DEVWRITE_LEGACY("tmsprom", ad2083_tms5110_ctrl_w)
314   AM_RANGE(0x10, 0x10) AM_DEVWRITE_LEGACY("ay1", ay8910_address_w)
315   AM_RANGE(0x20, 0x20) AM_DEVREADWRITE_LEGACY("ay1", ay8910_r, ay8910_data_w)
316   AM_RANGE(0x40, 0x40) AM_DEVREADWRITE_LEGACY("ay2", ay8910_r, ay8910_data_w)
317   AM_RANGE(0x80, 0x80) AM_DEVWRITE_LEGACY("ay2", ay8910_address_w)
314   AM_RANGE(0x10, 0x10) AM_DEVWRITE("ay1", ay8910_device, address_w)
315   AM_RANGE(0x20, 0x20) AM_DEVREADWRITE("ay1", ay8910_device, data_r, data_w)
316   AM_RANGE(0x40, 0x40) AM_DEVREADWRITE("ay2", ay8910_device, data_r, data_w)
317   AM_RANGE(0x80, 0x80) AM_DEVWRITE("ay2", ay8910_device, address_w)
318318ADDRESS_MAP_END
319319
320320static SOUND_START( ad2083 )
trunk/src/mame/machine/leland.c
r22781r22782
10901090
10911091      case 0x03:  /* /IGID */
10921092      case 0x13:
1093         result = ay8910_r(machine().device("ay8910.1"), space, offset);
1093         result = machine().device<ay8910_device>("ay8910.1")->data_r(space, offset);
10941094         break;
10951095
10961096      case 0x10:  /* /GIN0 */
r22781r22782
11291129
11301130      case 0x0a:  /* /OGIA */
11311131      case 0x0b:  /* /OGID */
1132         ay8910_address_data_w(machine().device("ay8910.1"), space, offset, data);
1132         machine().device<ay8910_device>("ay8910.1")->address_data_w(space, offset, data);
11331133         break;
11341134
11351135      case 0x0c:  /* /BKXL */
trunk/src/mame/machine/vectrex.c
r22781r22782
246246   if ((!(m_via_out[PORTB] & 0x10)) && (m_via_out[PORTB] & 0x08))
247247      /* BDIR inactive, we can read the PSG. BC1 has to be active. */
248248   {
249      m_via_out[PORTA] = ay8910_r(m_ay8912, space, 0)
249      m_via_out[PORTA] = m_ay8912->data_r(space, 0)
250250         & ~(m_imager_pinlevel & 0x80);
251251   }
252252   return m_via_out[PORTA];
trunk/src/mame/video/vectrex.c
r22781r22782
33#include "includes/vectrex.h"
44#include "video/vector.h"
55#include "cpu/m6809/m6809.h"
6#include "sound/ay8910.h"
76
87
98#define ANALOG_DELAY 7800
r22781r22782
365364   /* Sound */
366365   if (data & 0x10)
367366   {
368      device_t *ay8912 = machine().device("ay8912");
369
370367      if (data & 0x08) /* BC1 (do we select a reg or write it ?) */
371         ay8910_address_w(ay8912, space, 0, m_via_out[PORTA]);
368         m_ay8912->address_w(space, 0, m_via_out[PORTA]);
372369      else
373         ay8910_data_w(ay8912, space, 0, m_via_out[PORTA]);
370         m_ay8912->data_w(space, 0, m_via_out[PORTA]);
374371   }
375372
376373   if (!(data & 0x1) && (m_via_out[PORTB] & 0x1))
trunk/src/mame/includes/laserbat.h
r22781r22782
55*************************************************************************/
66
77#include "machine/6821pia.h"
8#include "sound/ay8910.h"
89
910class laserbat_state : public driver_device
1011{
r22781r22782
1314      : driver_device(mconfig, type, tag),
1415      m_maincpu(*this, "maincpu"),
1516      m_audiocpu(*this, "audiocpu"),
16      m_fo_state(*this, "fo_state")
17   { }
17      m_fo_state(*this, "fo_state"),
18      m_ay1(*this, "ay1"),
19      m_ay2(*this, "ay2")
20   {
21   }
1822
1923   required_device<cpu_device> m_maincpu;
2024   optional_device<cpu_device> m_audiocpu;
2125   required_shared_ptr<UINT8> m_fo_state;
26   optional_device<ay8910_device> m_ay1;
27   optional_device<ay8910_device> m_ay2;
2228
2329   /* video-related */
2430   tilemap_t    *m_bg_tilemap;
r22781r22782
5763   device_t *m_sn;
5864   tms3615_device *m_tms1;
5965   tms3615_device *m_tms2;
60   device_t *m_ay1;
61   device_t *m_ay2;
6266
6367   // memory
6468   UINT8      m_videoram[0x400];
trunk/src/mame/includes/vectrex.h
r22781r22782
99
1010#include "machine/6522via.h"
1111#include "sound/dac.h"
12#include "sound/ay8910.h"
1213
1314
1415#define NVECT 10000
r22781r22782
107108   required_device<cpu_device> m_maincpu;
108109   required_device<via6522_device> m_via6522_0;
109110   required_device<dac_device> m_dac;
110   required_device<device_t> m_ay8912;
111   required_device<ay8910_device> m_ay8912;
111112   optional_ioport m_io_contr1x;
112113   optional_ioport m_io_contr1y;
113114   optional_ioport m_io_contr2x;
trunk/src/mame/includes/mermaid.h
r22781r22782
44
55*************************************************************************/
66#include "sound/msm5205.h"
7#include "sound/ay8910.h"
78
89class mermaid_state : public driver_device
910{
r22781r22782
1819      m_colorram(*this, "colorram"),
1920      m_ay8910_enable(*this, "ay8910_enable"),
2021      m_maincpu(*this, "maincpu"),
21      m_adpcm(*this, "adpcm"){ }
22      m_adpcm(*this, "adpcm"),
23      m_ay1(*this, "ay1"),
24      m_ay2(*this, "ay2")
25   {
26   }
2227
2328   /* memory pointers */
2429   required_shared_ptr<UINT8> m_videoram2;
r22781r22782
5459   /* devices */
5560   required_device<cpu_device> m_maincpu;
5661   optional_device<msm5205_device> m_adpcm;
57   device_t *m_ay1;
58   device_t *m_ay2;
62   required_device<ay8910_device> m_ay1;
63   required_device<ay8910_device> m_ay2;
5964
6065   UINT8    m_nmi_mask;
6166   DECLARE_WRITE8_MEMBER(mermaid_ay8910_write_port_w);
trunk/src/emu/sound/ay8910.c
r22781r22782
194194   devcb_resolved_write8 portBwrite;
195195};
196196
197INLINE ay8910_context *get_safe_token(device_t *device)
198{
199   assert(device != NULL);
200   assert(device->type() == AY8910 ||
201         device->type() == AY8912 ||
202         device->type() == AY8913 ||
203         device->type() == AY8914 ||
204         device->type() == AY8930 ||
205         device->type() == YM2149 ||
206         device->type() == YM3439 ||
207         device->type() == YMZ284 ||
208         device->type() == YMZ294);
209   return (ay8910_context *)downcast<ay8910_device *>(device)->token();
210}
211197
212
213198/*************************************
214199 *
215200 *  Static
r22781r22782
843828#endif
844829}
845830
846void ay8910_set_volume(device_t *device,int channel,int volume)
831void ay8910_set_volume(void *chip,int channel,int volume)
847832{
848   ay8910_context *psg = get_safe_token(device);
833   ay8910_context *psg = (ay8910_context *)chip;
849834   int ch;
850835
851836   for (ch = 0; ch < psg->streams; ch++)
r22781r22782
939924 *
940925 *************************************/
941926
942static DEVICE_START( ay8910 )
927void ay8910_device::set_volume(int channel,int volume)
943928{
944   static const ay8910_interface generic_ay8910 =
929   ay8910_set_volume(m_psg, channel, volume);
930}
931
932//-------------------------------------------------
933//  device_start - device-specific startup
934//-------------------------------------------------
935
936void ay8910_device::device_start()
937{
938   m_ay8910_config = (const ay8910_interface *) static_config();
939
940   static const ay8910_interface default_ay8910_config =
945941   {
946942      AY8910_LEGACY_OUTPUT,
947943      AY8910_DEFAULT_LOADS,
948944      DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL
949945   };
950   const ay8910_interface *intf = (device->static_config() ? (const ay8910_interface *)device->static_config() : &generic_ay8910);
951   ay8910_start_ym(get_safe_token(device), AY8910, device, device->clock(), intf);
946
947   const ay8910_interface *ay8910_config = m_ay8910_config != NULL ? m_ay8910_config : &default_ay8910_config;
948
949   m_psg = ay8910_start_ym(NULL, type(), this, clock(), ay8910_config);
952950}
953951
954static DEVICE_START( ym2149 )
952//-------------------------------------------------
953//  device_start - device-specific startup
954//-------------------------------------------------
955
956void ym2149_device::device_start()
955957{
956   static const ay8910_interface generic_ay8910 =
958   m_ay8910_config = (const ay8910_interface *) static_config();
959
960   static const ay8910_interface default_ay8910_config =
957961   {
958962      AY8910_LEGACY_OUTPUT,
959963      AY8910_DEFAULT_LOADS,
960964      DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL
961965   };
962   const ay8910_interface *intf = (device->static_config() ? (const ay8910_interface *)device->static_config() : &generic_ay8910);
963   ay8910_start_ym(get_safe_token(device), YM2149, device, device->clock(), intf);
966
967   const ay8910_interface *ay8910_config = m_ay8910_config != NULL ? m_ay8910_config : &default_ay8910_config;
968
969   m_psg = ay8910_start_ym(NULL, type(), this, clock(), ay8910_config);
964970}
965971
966static DEVICE_STOP( ay8910 )
972//-------------------------------------------------
973//  device_stop - device-specific stop
974//-------------------------------------------------
975
976void ay8910_device::device_stop()
967977{
968   ay8910_stop_ym(get_safe_token(device));
978   ay8910_stop_ym(m_psg);
969979}
970980
971static DEVICE_RESET( ay8910 )
981//-------------------------------------------------
982//  device_reset - device-specific reset
983//-------------------------------------------------
984
985void ay8910_device::device_reset()
972986{
973   ay8910_reset_ym(get_safe_token(device));
987   ay8910_reset_ym(m_psg);
974988}
975989
976990/*************************************
r22781r22782
979993 *
980994 *************************************/
981995
982READ8_DEVICE_HANDLER( ay8910_r )
996READ8_MEMBER( ay8910_device::data_r )
983997{
984   return ay8910_read_ym(get_safe_token(device));
998   return ay8910_read_ym(m_psg);
985999}
9861000
987WRITE8_DEVICE_HANDLER( ay8910_data_address_w )
1001WRITE8_MEMBER( ay8910_device::data_address_w )
9881002{
9891003   /* note that directly connecting BC1 to A0 puts data on 0 and address on 1 */
990   ay8910_write_ym(get_safe_token(device), ~offset & 1, data);
1004   ay8910_write_ym(m_psg, ~offset & 1, data);
9911005}
9921006
993WRITE8_DEVICE_HANDLER( ay8910_address_data_w )
1007WRITE8_MEMBER( ay8910_device::address_data_w )
9941008{
995   ay8910_write_ym(get_safe_token(device), offset & 1, data);
1009   ay8910_write_ym(m_psg, offset & 1, data);
9961010}
9971011
998WRITE8_DEVICE_HANDLER( ay8910_address_w )
1012WRITE8_MEMBER( ay8910_device::address_w )
9991013{
10001014#if ENABLE_REGISTER_TEST
10011015   return;
10021016#else
1003   ay8910_data_address_w(device, space, 1, data);
1017   data_address_w(space, 1, data);
10041018#endif
10051019}
10061020
1007WRITE8_DEVICE_HANDLER( ay8910_data_w )
1021WRITE8_MEMBER( ay8910_device::data_w )
10081022{
10091023#if ENABLE_REGISTER_TEST
10101024   return;
10111025#else
1012   ay8910_data_address_w(device, space, 0, data);
1026   data_address_w(space, 0, data);
10131027#endif
10141028}
10151029
1016WRITE8_DEVICE_HANDLER( ay8910_reset_w )
1030WRITE8_MEMBER( ay8910_device::reset_w )
10171031{
1018   ay8910_reset_ym(get_safe_token(device));
1032   ay8910_reset_ym(m_psg);
10191033}
10201034
10211035static const int mapping8914to8910[16] = { 0, 2, 4, 11, 1, 3, 5, 12, 7, 6, 13, 8, 9, 10, 14, 15 };
10221036
1023READ8_DEVICE_HANDLER( ay8914_r )
1037READ8_MEMBER( ay8914_device::read )
10241038{
10251039   UINT16 rv;
1026   ay8910_address_w(device, space, 0, mapping8914to8910[offset & 0xff]);
1027   rv = (UINT16)ay8910_r(device, space, 0);
1040   address_w(space, 0, mapping8914to8910[offset & 0xf]);
1041   rv = (UINT16) data_r(space, 0);
10281042   return rv;
10291043}
10301044
1031WRITE8_DEVICE_HANDLER( ay8914_w )
1045WRITE8_MEMBER( ay8914_device::write )
10321046{
1033   ay8910_address_w(device, space, 0, mapping8914to8910[offset & 0xff]);
1034   ay8910_data_w(device, space, 0, data & 0xff);
1047   address_w(space, 0, mapping8914to8910[offset & 0xf]);
1048   data_w(space, 0, data & 0xff);
10351049}
10361050
10371051
r22781r22782
10421056   : device_t(mconfig, AY8910, "AY-3-8910A", tag, owner, clock),
10431057      device_sound_interface(mconfig, *this)
10441058{
1045   m_token = global_alloc_clear(ay8910_context);
10461059}
10471060ay8910_device::ay8910_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
10481061   : device_t(mconfig, type, name, tag, owner, clock),
10491062      device_sound_interface(mconfig, *this)
10501063{
1051   m_token = global_alloc_clear(ay8910_context);
10521064}
10531065
10541066//-------------------------------------------------
r22781r22782
10611073{
10621074}
10631075
1064//-------------------------------------------------
1065//  device_start - device-specific startup
1066//-------------------------------------------------
10671076
1068void ay8910_device::device_start()
1069{
1070   DEVICE_START_NAME( ay8910 )(this);
1071}
1072
10731077//-------------------------------------------------
1074//  device_reset - device-specific reset
1075//-------------------------------------------------
1076
1077void ay8910_device::device_reset()
1078{
1079   DEVICE_RESET_NAME( ay8910 )(this);
1080}
1081
1082//-------------------------------------------------
1083//  device_stop - device-specific stop
1084//-------------------------------------------------
1085
1086void ay8910_device::device_stop()
1087{
1088   DEVICE_STOP_NAME( ay8910 )(this);
1089}
1090
1091//-------------------------------------------------
10921078//  sound_stream_update - handle a stream update
10931079//-------------------------------------------------
10941080
r22781r22782
11061092{
11071093}
11081094
1109//-------------------------------------------------
1110//  sound_stream_update - handle a stream update
1111//-------------------------------------------------
11121095
1113void ay8912_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
1114{
1115   // should never get here
1116   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
1117}
1118
1119
11201096const device_type AY8913 = &device_creator<ay8913_device>;
11211097
11221098ay8913_device::ay8913_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
r22781r22782
11241100{
11251101}
11261102
1127//-------------------------------------------------
1128//  sound_stream_update - handle a stream update
1129//-------------------------------------------------
11301103
1131void ay8913_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
1132{
1133   // should never get here
1134   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
1135}
1136
1137
11381104const device_type AY8914 = &device_creator<ay8914_device>;
11391105
11401106ay8914_device::ay8914_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
r22781r22782
11421108{
11431109}
11441110
1145//-------------------------------------------------
1146//  sound_stream_update - handle a stream update
1147//-------------------------------------------------
11481111
1149void ay8914_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
1150{
1151   // should never get here
1152   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
1153}
1154
1155
11561112const device_type AY8930 = &device_creator<ay8930_device>;
11571113
11581114ay8930_device::ay8930_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
r22781r22782
11601116{
11611117}
11621118
1163//-------------------------------------------------
1164//  sound_stream_update - handle a stream update
1165//-------------------------------------------------
11661119
1167void ay8930_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
1168{
1169   // should never get here
1170   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
1171}
1172
1173
11741120const device_type YM2149 = &device_creator<ym2149_device>;
11751121
11761122ym2149_device::ym2149_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
r22781r22782
11821128{
11831129}
11841130
1185//-------------------------------------------------
1186//  device_start - device-specific startup
1187//-------------------------------------------------
11881131
1189void ym2149_device::device_start()
1190{
1191   DEVICE_START_NAME( ym2149 )(this);
1192}
1193
1194//-------------------------------------------------
1195//  sound_stream_update - handle a stream update
1196//-------------------------------------------------
1197
1198void ym2149_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
1199{
1200   // should never get here
1201   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
1202}
1203
1204
12051132const device_type YM3439 = &device_creator<ym3439_device>;
12061133
12071134ym3439_device::ym3439_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
r22781r22782
12091136{
12101137}
12111138
1212//-------------------------------------------------
1213//  sound_stream_update - handle a stream update
1214//-------------------------------------------------
12151139
1216void ym3439_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
1217{
1218   // should never get here
1219   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
1220}
1221
1222
12231140const device_type YMZ284 = &device_creator<ymz284_device>;
12241141
12251142ymz284_device::ymz284_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
r22781r22782
12271144{
12281145}
12291146
1230//-------------------------------------------------
1231//  sound_stream_update - handle a stream update
1232//-------------------------------------------------
12331147
1234void ymz284_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
1235{
1236   // should never get here
1237   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
1238}
1239
1240
12411148const device_type YMZ294 = &device_creator<ymz294_device>;
12421149
12431150ymz294_device::ymz294_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
12441151   : ym2149_device(mconfig, YMZ294, "YMZ294", tag, owner, clock)
12451152{
12461153}
1247
1248//-------------------------------------------------
1249//  sound_stream_update - handle a stream update
1250//-------------------------------------------------
1251
1252void ymz294_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
1253{
1254   // should never get here
1255   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
1256}
trunk/src/emu/sound/ay8910.h
r22781r22782
33#ifndef __AY8910_H__
44#define __AY8910_H__
55
6#include "devlegcy.h"
6#include "emu.h"
77
88/*
99AY-3-8910A: 2 I/O ports
r22781r22782
7474#define YM2149_PIN26_LOW            (0x10)
7575
7676
77#define AY8910_INTERFACE(name) \
78   const ay8910_interface (name) =
79
8077struct ay8910_interface
8178{
8279   int                 flags;          /* Flags */
r22781r22782
8784   devcb_write8        portBwrite;
8885};
8986
90
91void ay8910_set_volume(device_t *device,int channel,int volume);
92
93DECLARE_READ8_DEVICE_HANDLER( ay8910_r );
94DECLARE_WRITE8_DEVICE_HANDLER( ay8910_address_w );
95DECLARE_WRITE8_DEVICE_HANDLER( ay8910_data_w );
96
97/* /RES */
98DECLARE_WRITE8_DEVICE_HANDLER( ay8910_reset_w );
99
100/* use this when BC1 == A0; here, BC1=0 selects 'data' and BC1=1 selects 'latch address' */
101DECLARE_WRITE8_DEVICE_HANDLER( ay8910_data_address_w );
102
103/* use this when BC1 == !A0; here, BC1=0 selects 'latch address' and BC1=1 selects 'data' */
104DECLARE_WRITE8_DEVICE_HANDLER( ay8910_address_data_w );
105
106/* AY8914 handlers needed due to different register map */
107DECLARE_READ8_DEVICE_HANDLER( ay8914_r );
108DECLARE_WRITE8_DEVICE_HANDLER( ay8914_w );
109
110
11187/*********** An interface for SSG of YM2203 ***********/
11288
11389void *ay8910_start_ym(void *infoptr, device_type chip_type, device_t *device, int clock, const ay8910_interface *intf);
r22781r22782
11591void ay8910_stop_ym(void *chip);
11692void ay8910_reset_ym(void *chip);
11793void ay8910_set_clock_ym(void *chip, int clock);
94void ay8910_set_volume(void *chip ,int channel, int volume);
11895void ay8910_write_ym(void *chip, int addr, int data);
11996int ay8910_read_ym(void *chip);
12097
r22781r22782
124101public:
125102   ay8910_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
126103   ay8910_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
127   ~ay8910_device() { global_free(m_token); }
128104
129   // access to legacy token
130   void *token() const { assert(m_token != NULL); return m_token; }
105   DECLARE_READ8_MEMBER( data_r );
106   DECLARE_WRITE8_MEMBER( address_w );
107   DECLARE_WRITE8_MEMBER( data_w );
108
109   /* /RES */
110   DECLARE_WRITE8_MEMBER( reset_w );
111
112   /* use this when BC1 == A0; here, BC1=0 selects 'data' and BC1=1 selects 'latch address' */
113   DECLARE_WRITE8_MEMBER( data_address_w );
114
115   /* use this when BC1 == !A0; here, BC1=0 selects 'latch address' and BC1=1 selects 'data' */
116   DECLARE_WRITE8_MEMBER( address_data_w );
117
118   void set_volume(int channel,int volume);
119
131120protected:
132121   // device-level overrides
133122   virtual void device_config_complete();
r22781r22782
137126
138127   // sound stream update overrides
139128   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
140private:
129
141130   // internal state
142   void *m_token;
131   const ay8910_interface *m_ay8910_config;
132   void *m_psg;
143133};
144134
145135extern const device_type AY8910;
r22781r22782
148138{
149139public:
150140   ay8912_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
151
152   // sound stream update overrides
153   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
154141};
155142
156143extern const device_type AY8912;
r22781r22782
159146{
160147public:
161148   ay8913_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
162
163   // sound stream update overrides
164   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
165149};
166150
167151extern const device_type AY8913;
r22781r22782
171155public:
172156   ay8914_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
173157
174   // sound stream update overrides
175   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
158   /* AY8914 handlers needed due to different register map */
159   DECLARE_READ8_MEMBER( read );
160   DECLARE_WRITE8_MEMBER( write );
176161};
177162
178163extern const device_type AY8914;
r22781r22782
181166{
182167public:
183168   ay8930_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
184
185   // sound stream update overrides
186   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
187169};
188170
189171extern const device_type AY8930;
r22781r22782
196178protected:
197179   // device-level overrides
198180   virtual void device_start();
199
200   // sound stream update overrides
201   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
202181};
203182
204183extern const device_type YM2149;
r22781r22782
207186{
208187public:
209188   ym3439_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
210
211   // sound stream update overrides
212   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
213189};
214190
215191extern const device_type YM3439;
r22781r22782
218194{
219195public:
220196   ymz284_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
221
222   // sound stream update overrides
223   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
224197};
225198
226199extern const device_type YMZ284;
r22781r22782
229202{
230203public:
231204   ymz294_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
232
233   // sound stream update overrides
234   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
235205};
236206
237207extern const device_type YMZ294;
trunk/src/mess/machine/nes_sunsoft.c
r22781r22782
585585   switch (offset & 0x6000)
586586   {
587587      case 0x4000:
588         ay8910_address_w(m_ym2149, space, 0, data & 0x0f);
588         m_ym2149->address_w(space, 0, data & 0x0f);
589589         break;
590590      case 0x6000:
591         ay8910_data_w(m_ym2149, space, 0, data);
591         m_ym2149->data_w(space, 0, data);
592592         break;
593593      default:
594594         fme7_write(space, offset, data, mem_mask);
trunk/src/mess/machine/a2arcadebd.c
r22781r22782
108108    6 - AY data
109109*/
110110
111   UINT8 a2bus_arcboard_device::read_c0nx(address_space &space, UINT8 offset)
111UINT8 a2bus_arcboard_device::read_c0nx(address_space &space, UINT8 offset)
112112{
113113   switch (offset)
114114   {
r22781r22782
119119         return m_tms->register_read(space, 0);
120120
121121      case 6:
122         return ay8910_r(m_ay, space, 0);
122         return m_ay->data_r(space, 0);
123123   }
124124
125125   return 0xff;
r22781r22782
138138         break;
139139
140140      case 5:
141         ay8910_address_w(m_ay, space, 0, data);
141         m_ay->address_w(space, 0, data);
142142         break;
143143
144144      case 6:
145         ay8910_data_w(m_ay, space, 0, data);
145         m_ay->data_w(space, 0, data);
146146         break;
147147   }
148148}
trunk/src/mess/machine/amstrad.c
r22781r22782
506506   {
507507   case 0x0000:  // Load PSG register
508508      {
509         ay8910_address_w(m_ay, generic_space(), 0, (command & 0x0f00) >> 8);
510         ay8910_data_w(m_ay, generic_space(), 0, command & 0x00ff);
511         ay8910_address_w(m_ay, generic_space(), 0, m_prev_reg);
509         m_ay->address_w(generic_space(), 0, (command & 0x0f00) >> 8);
510         m_ay->data_w(generic_space(), 0, command & 0x00ff);
511         m_ay->address_w(generic_space(), 0, m_prev_reg);
512512      }
513513      logerror("DMA %i: LOAD %i, %i\n",channel,(command & 0x0f00) >> 8, command & 0x00ff);
514514      break;
r22781r22782
22592259   /* PSG */
22602260   for (i=0; i<16; i++)
22612261   {
2262      ay8910_address_w(m_ay, space, 0, i);
2263      ay8910_data_w(m_ay, space, 0, pSnapshot[0x05b + i] & 0x0ff);
2262      m_ay->address_w(space, 0, i);
2263      m_ay->data_w(space, 0, pSnapshot[0x05b + i] & 0x0ff);
22642264   }
22652265
2266   ay8910_address_w(m_ay, space, 0, pSnapshot[0x05a]);
2266   m_ay->address_w(space, 0, pSnapshot[0x05a]);
22672267
22682268   {
22692269      int MemSize;
r22781r22782
24612461      } break;
24622462   case 1:
24632463      {/* b6 = 1 ? : Read from selected PSG register and make the register data available to PPI Port A */
2464         m_ppi_port_inputs[amstrad_ppi_PortA] = ay8910_r(m_ay, space, 0);
2464         m_ppi_port_inputs[amstrad_ppi_PortA] = m_ay->data_r(space, 0);
24652465      }
24662466      break;
24672467   case 2:
24682468      {/* b7 = 1 ? : Write to selected PSG register and write data to PPI Port A */
2469         ay8910_data_w(m_ay, space, 0, m_ppi_port_outputs[amstrad_ppi_PortA]);
2469         m_ay->data_w(space, 0, m_ppi_port_outputs[amstrad_ppi_PortA]);
24702470      }
24712471      break;
24722472   case 3:
24732473      {/* b6 and b7 = 1 ? : The register will now be selected and the user can read from or write to it.  The register will remain selected until another is chosen.*/
2474         ay8910_address_w(m_ay, space, 0, m_ppi_port_outputs[amstrad_ppi_PortA]);
2474         m_ay->address_w(space, 0, m_ppi_port_outputs[amstrad_ppi_PortA]);
24752475         m_prev_reg = m_ppi_port_outputs[amstrad_ppi_PortA];
24762476      }
24772477      break;
trunk/src/mess/machine/dgnalpha.c
r22781r22782
239239      case 0x00:      /* Inactive, do nothing */
240240         break;
241241      case 0x01:      /* Write to selected port */
242         ay8910_data_w(m_ay8912, space, 0, m_pia_2->b_output());
242         m_ay8912->data_w(space, 0, m_pia_2->b_output());
243243         break;
244244      case 0x02:      /* Read from selected port */
245         m_pia_2->portb_w(ay8910_r(m_ay8912, space, 0));
245         m_pia_2->portb_w(m_ay8912->data_r(space, 0));
246246         break;
247247      case 0x03:      /* Select port to write to */
248         ay8910_address_w(m_ay8912, space, 0, m_pia_2->b_output());
248         m_ay8912->address_w(space, 0, m_pia_2->b_output());
249249         break;
250250   }
251251}
trunk/src/mess/machine/oric.c
r22781r22782
157157      /* if psg is in read register state return reg data */
158158      if (m_psg_control==0x01)
159159      {
160         return ay8910_r(m_ay8912, space, 0);
160         return m_ay8912->data_r(space, 0);
161161      }
162162
163163      /* return high-impedance */
r22781r22782
199199
200200         /* write register data */
201201         case 2:
202            ay8910_data_w(m_ay8912, space, 0, m_via_port_a_data);
202            m_ay8912->data_w(space, 0, m_via_port_a_data);
203203            break;
204204
205205         /* write register index */
206206         case 3:
207            ay8910_address_w(m_ay8912, space, 0, m_via_port_a_data);
207            m_ay8912->address_w(space, 0, m_via_port_a_data);
208208            break;
209209
210210         default:
trunk/src/mess/machine/a2mockingboard.c
r22781r22782
331331{
332332   if (!(data & 4))
333333   {
334      ay8910_reset_w(m_ay1, space, 0, 0);
334      m_ay1->reset_w(space, 0, 0);
335335      if (m_isPhasor && m_PhasorNative)
336336      {
337         ay8910_reset_w(m_ay2, space, 0, 0);
337         m_ay2->reset_w(space, 0, 0);
338338      }
339339   }
340340   else
r22781r22782
347347               break;
348348
349349            case 1: // BDIR=0, BC1=1 (read PSG)
350               m_porta1 = ay8910_r(m_ay1, space, 0);
350               m_porta1 = m_ay1->data_r(space, 0);
351351               break;
352352
353353            case 2: // BDIR=1, BC1=0 (write PSG)
354               ay8910_data_w(m_ay1, space, 0, m_porta1);
354               m_ay1->data_w(space, 0, m_porta1);
355355               break;
356356
357357            case 3: // BDIR=1, BC1=1 (latch)
358               ay8910_address_w(m_ay1, space, 0, m_porta1);
358               m_ay1->address_w(space, 0, m_porta1);
359359               break;
360360         }
361361      }
r22781r22782
381381            case 1: // BDIR=0, BC1=1 (read PSG)
382382               if (chipSel & 1)
383383               {
384                  m_porta1 = ay8910_r(m_ay1, space, 0);
384                  m_porta1 = m_ay1->data_r(space, 0);
385385               }
386386               if (chipSel & 2)
387387               {
388                  m_porta1 = ay8910_r(m_ay2, space, 0);
388                  m_porta1 = m_ay2->data_r(space, 0);
389389               }
390390               break;
391391
392392            case 2: // BDIR=1, BC1=0 (write PSG)
393393               if (chipSel & 1)
394394               {
395                  ay8910_data_w(m_ay1, space, 0, m_porta1);
395                  m_ay1->data_w(space, 0, m_porta1);
396396               }
397397               if (chipSel & 2)
398398               {
399                  ay8910_data_w(m_ay2, space, 0, m_porta1);
399                  m_ay2->data_w(space, 0, m_porta1);
400400               }
401401               break;
402402
403403            case 3: // BDIR=1, BC1=1 (latch)
404404               if (chipSel & 1)
405405               {
406                  ay8910_address_w(m_ay1, space, 0, m_porta1);
406                  m_ay1->address_w(space, 0, m_porta1);
407407               }
408408               if (chipSel & 2)
409409               {
410                  ay8910_address_w(m_ay2, space, 0, m_porta1);
410                  m_ay2->address_w(space, 0, m_porta1);
411411               }
412412               break;
413413         }
r22781r22782
436436   {
437437      if (m_isPhasor && m_PhasorNative)
438438      {
439         ay8910_reset_w(m_ay3, space, 0, 0);
440         ay8910_reset_w(m_ay4, space, 0, 0);
439         m_ay3->reset_w(space, 0, 0);
440         m_ay4->reset_w(space, 0, 0);
441441      }
442442      else
443443      {
444         ay8910_reset_w(m_ay2, space, 0, 0);
444         m_ay2->reset_w(space, 0, 0);
445445      }
446446   }
447447   else
r22781r22782
454454               break;
455455
456456            case 1: // BDIR=0, BC1=1 (read PSG)
457               m_porta2 = ay8910_r(m_ay2, space, 0);
457               m_porta2 = m_ay2->data_r(space, 0);
458458               break;
459459
460460            case 2: // BDIR=1, BC1=0 (write PSG)
461               ay8910_data_w(m_ay2, space, 0, m_porta2);
461               m_ay2->data_w(space, 0, m_porta2);
462462               break;
463463
464464            case 3: // BDIR=1, BC1=1 (latch)
465               ay8910_address_w(m_ay2, space, 0, m_porta2);
465               m_ay2->address_w(space, 0, m_porta2);
466466               break;
467467         }
468468      }
r22781r22782
488488            case 1: // BDIR=0, BC1=1 (read PSG)
489489               if (chipSel & 1)
490490               {
491                  m_porta2 = ay8910_r(m_ay3, space, 0);
491                  m_porta2 = m_ay3->data_r(space, 0);
492492               }
493493               if (chipSel & 2)
494494               {
495                  m_porta2 = ay8910_r(m_ay4, space, 0);
495                  m_porta2 = m_ay4->data_r(space, 0);
496496               }
497497               break;
498498
499499            case 2: // BDIR=1, BC1=0 (write PSG)
500500               if (chipSel & 1)
501501               {
502                  ay8910_data_w(m_ay3, space, 0, m_porta2);
502                  m_ay3->data_w(space, 0, m_porta2);
503503               }
504504               if (chipSel & 2)
505505               {
506                  ay8910_data_w(m_ay4, space, 0, m_porta2);
506                  m_ay4->data_w(space, 0, m_porta2);
507507               }
508508               break;
509509
510510            case 3: // BDIR=1, BC1=1 (latch)
511511               if (chipSel & 1)
512512               {
513                  ay8910_address_w(m_ay3, space, 0, m_porta2);
513                  m_ay3->address_w(space, 0, m_porta2);
514514               }
515515               if (chipSel & 2)
516516               {
517                  ay8910_address_w(m_ay4, space, 0, m_porta2);
517                  m_ay4->address_w(space, 0, m_porta2);
518518               }
519519               break;
520520         }
trunk/src/mess/machine/cgenie.c
r22781r22782
1313#include "machine/wd17xx.h"
1414#include "imagedev/cartslot.h"
1515#include "imagedev/cassette.h"
16#include "sound/ay8910.h"
1716#include "sound/dac.h"
1817#include "imagedev/flopdrv.h"
1918#include "machine/ram.h"
2019
2120#define AYWriteReg(chip,port,value) \
22   ay8910_address_w(ay8910, space, 0,port);  \
23   ay8910_data_w(ay8910, space, 0,value)
21   m_ay8910->address_w(space, 0,port);  \
22   m_ay8910->data_w(space, 0,value)
2423
2524#define TAPE_HEADER "Colour Genie - Virtual Tape File"
2625
r22781r22782
4746void cgenie_state::machine_reset()
4847{
4948   address_space &space = m_maincpu->space(AS_PROGRAM);
50   device_t *ay8910 = machine().device("ay8910");
5149   UINT8 *ROM = memregion("maincpu")->base();
5250
5351   /* reset the AY8910 to be quiet, since the cgenie BIOS doesn't */
r22781r22782
594592WRITE8_MEMBER(cgenie_state::cgenie_sh_control_port_w)
595593{
596594   m_control_port = data;
597   ay8910_address_w(machine().device("ay8910"), space, offset, data);
595   m_ay8910->address_w(space, offset, data);
598596}
trunk/src/mess/machine/rmnimbus.c
r22781r22782
6868#include "machine/ctronics.h"
6969#include "machine/6522via.h"
7070#include "machine/scsibus.h"
71#include "sound/ay8910.h"
7271#include "sound/msm5205.h"
7372
7473#include "includes/rmnimbus.h"
r22781r22782
27192718
27202719READ8_MEMBER(rmnimbus_state::nimbus_sound_ay8910_r)
27212720{
2722   device_t *ay8910 = machine().device(AY8910_TAG);
27232721   UINT8   result=0;
27242722
27252723   if ((offset*2)==0)
2726      result=ay8910_r(ay8910,space, 0);
2724      result = m_ay8910->data_r(space, 0);
27272725
27282726   return result;
27292727}
r22781r22782
27312729WRITE8_MEMBER(rmnimbus_state::nimbus_sound_ay8910_w)
27322730{
27332731   int pc=space.device().safe_pc();
2734   device_t *ay8910 = machine().device(AY8910_TAG);
27352732
27362733   if(LOG_SOUND)
27372734      logerror("Nimbus SoundW %05X write of %02X to %04X\n",pc,data,(offset*2)+0xE0);
27382735
27392736   switch (offset*2)
27402737   {
2741      case 0x00   : ay8910_data_address_w(ay8910, space, 1, data); break;
2742      case 0x02   : ay8910_data_address_w(ay8910, space, 0, data); break;
2738      case 0x00   : m_ay8910->data_address_w(space, 1, data); break;
2739      case 0x02   : m_ay8910->data_address_w(space, 0, data); break;
27432740   }
27442741
27452742}
trunk/src/mess/machine/microtan.c
r22781r22782
774774   address_space &space = m_maincpu->space(AS_PROGRAM);
775775   via6522_device *via_0 = machine().device<via6522_device>("via6522_0");
776776   via6522_device *via_1 = machine().device<via6522_device>("via6522_1");
777   device_t *ay8910 = machine().device("ay8910.1");
777   ay8910_device *ay8910 = machine().device<ay8910_device>("ay8910.1");
778778
779779   /* check for .DMP file format */
780780   if (snapshot_size == 8263)
r22781r22782
850850      /* first set of AY8910 registers */
851851      for (i = 0; i < 16; i++ )
852852      {
853         ay8910_address_w(ay8910, generic_space(), 0, i);
854         ay8910_data_w(ay8910, generic_space(), 0, snapshot_buff[base++]);
853         ay8910->address_w(generic_space(), 0, i);
854         ay8910->data_w(generic_space(), 0, snapshot_buff[base++]);
855855      }
856856
857857      /* second set of AY8910 registers */
858858      for (i = 0; i < 16; i++ )
859859      {
860         ay8910_address_w(ay8910, generic_space(), 0, i);
861         ay8910_data_w(ay8910, generic_space(), 0, snapshot_buff[base++]);
860         ay8910->address_w(generic_space(), 0, i);
861         ay8910->data_w(generic_space(), 0, snapshot_buff[base++]);
862862      }
863863
864864      for (i = 0; i < 32*16; i++)
trunk/src/mess/machine/spec_snqk.c
r22781r22782
23542354
23552355      if ((z80_type == SPECTRUM_Z80_SNAPSHOT_128K) || ((z80_type == SPECTRUM_Z80_SNAPSHOT_TS2068) && !strcmp(machine.system().name,"ts2068")))
23562356      {
2357         device_t *ay8912 = machine.device("ay8912");
2357         ay8910_device *ay8912 = machine.device<ay8910_device>("ay8912");
23582358
23592359         /* Only set up sound registers for 128K machine or TS2068! */
23602360         for (i = 0; i < 16; i++)
23612361         {
2362            ay8910_address_w(ay8912, state->generic_space(), 0, i);
2363            ay8910_data_w(ay8912, state->generic_space(), 0, snapdata[39 + i]);
2362            ay8912->address_w(state->generic_space(), 0, i);
2363            ay8912->data_w(state->generic_space(), 0, snapdata[39 + i]);
23642364         }
2365         ay8910_address_w(ay8912, state->generic_space(), 0, snapdata[38]);
2365         ay8912->address_w(state->generic_space(), 0, snapdata[38]);
23662366      }
23672367
23682368      pSource = snapdata + header_size;
trunk/src/mess/machine/orion.c
r22781r22782
1212#include "cpu/i8085/i8085.h"
1313#include "imagedev/cassette.h"
1414#include "sound/speaker.h"
15#include "sound/ay8910.h"
1615#include "includes/orion.h"
1716
1817#define SCREEN_WIDTH_384 48
r22781r22782
363362{
364363   if (offset == 0xFFFD)
365364   {
366      return ay8910_r(m_ay8912, space, 0);
365      return m_ay8912->data_r(space, 0);
367366   }
368367   return 0xff;
369368}
r22781r22782
381380   }
382381   switch(offset)
383382   {
384      case 0xfffd : ay8910_address_w(m_ay8912, space, 0, data);
383      case 0xfffd : m_ay8912->address_w(space, 0, data);
385384                  break;
386385      case 0xbffd :
387      case 0xbefd : ay8910_data_w(m_ay8912, space, 0, data);
386      case 0xbefd : m_ay8912->data_w(space, 0, data);
388387                  break;
389388   }
390389}
r22781r22782
554553   }
555554   if (offset == 0xFFFD)
556555   {
557      return ay8910_r(m_ay8912, space, 0);
556      return m_ay8912->data_r(space, 0);
558557   }
559558   return 0xff;
560559}
r22781r22782
592591   }
593592   switch(offset)
594593   {
595      case 0xfffd : ay8910_address_w(m_ay8912, space, 0, data);
594      case 0xfffd : m_ay8912->address_w(space, 0, data);
596595                  break;
597596      case 0xbffd :
598      case 0xbefd : ay8910_data_w(m_ay8912, space, 0, data);
597      case 0xbefd : m_ay8912->data_w(space, 0, data);
599598                  break;
600599   }
601600}
trunk/src/mess/includes/fm7.h
r22781r22782
114114      m_x86(*this, "x86"),
115115      m_cassette(*this, "cassette"),
116116      m_beeper(*this, "beeper"),
117      m_ym(*this, "ym")
117      m_ym(*this, "ym"),
118      m_psg(*this, "psg")
118119   {
119120   }
120121
r22781r22782
270271   required_device<cassette_image_device> m_cassette;
271272   required_device<beep_device> m_beeper;
272273   optional_device<ym2203_device> m_ym;
274   optional_device<ay8910_device> m_psg;
273275   void fm7_alu_mask_write(UINT32 offset, int bank, UINT8 dat);
274276   void fm7_alu_function_compare(UINT32 offset);
275277   void fm7_alu_function_pset(UINT32 offset);
trunk/src/mess/includes/cgenie.h
r22781r22782
1010#include "machine/wd17xx.h"
1111#include "imagedev/cassette.h"
1212#include "machine/ram.h"
13#include "sound/ay8910.h"
1314
1415// CRTC 6845
1516struct CRTC6845
r22781r22782
4546      m_fontram(*this, "fontram"),
4647      m_maincpu(*this, "maincpu"),
4748      m_cassette(*this, "cassette"),
48      m_ram(*this, RAM_TAG) { }
49      m_ram(*this, RAM_TAG),
50      m_ay8910(*this, "ay8910")
51   {
52   }
4953
5054   required_shared_ptr<UINT8> m_colorram;
5155   required_shared_ptr<UINT8> m_fontram;
r22781r22782
8589   required_device<cpu_device> m_maincpu;
8690   required_device<cassette_image_device> m_cassette;
8791   required_device<ram_device> m_ram;
92   required_device<ay8910_device> m_ay8910;
8893
8994   void cgenie_offset_xy();
9095   int cgenie_get_register(int indx);
trunk/src/mess/includes/rmnimbus.h
r22781r22782
1111#include "machine/scsicb.h"
1212#include "machine/6522via.h"
1313#include "machine/ram.h"
14#include "sound/ay8910.h"
1415
1516#define MAINCPU_TAG "maincpu"
1617#define IOCPU_TAG   "iocpu"
r22781r22782
395396      : driver_device(mconfig, type, tag),
396397         m_scsibus(*this, SCSIBUS_TAG ":host"),
397398      m_maincpu(*this, "maincpu"),
398      m_ram(*this, RAM_TAG) {
399      m_ram(*this, RAM_TAG),
400      m_ay8910(*this, AY8910_TAG)
401   {
399402   }
400403
401404   required_device<scsicb_device> m_scsibus;
r22781r22782
472475   IRQ_CALLBACK_MEMBER(int_callback);
473476   required_device<cpu_device> m_maincpu;
474477   required_device<ram_device> m_ram;
478   required_device<ay8910_device> m_ay8910;
475479   UINT8 get_pixel(UINT16 x, UINT16 y);
476480   UINT16 read_pixel_line(UINT16 x, UINT16 y, UINT8 width);
477481   UINT16 read_pixel_data(UINT16 x, UINT16 y);
trunk/src/mess/includes/msx.h
r22781r22782
140140   required_device<cpu_device> m_maincpu;
141141   optional_device<v9938_device> m_v9938;
142142   required_device<cassette_image_device> m_cassette;
143   required_device<device_t> m_ay8910;
143   required_device<ay8910_device> m_ay8910;
144144   required_device<ym2413_device> m_ym;
145145   optional_device<k051649_device> m_k051649;
146146   required_device<dac_device> m_dac;
trunk/src/mess/includes/orion.h
r22781r22782
1313#include "machine/ram.h"
1414#include "machine/mc146818.h"
1515#include "sound/speaker.h"
16#include "sound/ay8910.h"
1617
1718
1819class orion_state : public radio86_state
r22781r22782
102103   required_device<floppy_connector> m_fd3;
103104   optional_device<mc146818_device> m_rtc;
104105   optional_device<device_t> m_speaker;
105   optional_device<device_t> m_ay8912;
106   optional_device<ay8910_device> m_ay8912;
106107   required_memory_bank m_bank2;
107108   optional_memory_bank m_bank3;
108109   optional_memory_bank m_bank4;
trunk/src/mess/includes/oric.h
r22781r22782
154154
155155protected:
156156   required_device<cpu_device> m_maincpu;
157   required_device<device_t> m_ay8912;
157   required_device<ay8910_device> m_ay8912;
158158   required_device<centronics_device> m_centronics;
159159   required_device<cassette_image_device> m_cassette;
160160   required_device<via6522_device> m_via6522_0;
trunk/src/mess/drivers/x1.c
r22781r22782
15961596   else if(offset >= 0x1400 && offset <= 0x17ff)   { return x1_pcg_r(space, offset-0x1400); }
15971597   else if(offset >= 0x1900 && offset <= 0x19ff)   { return x1_sub_io_r(space, 0); }
15981598   else if(offset >= 0x1a00 && offset <= 0x1aff)   { return machine().device<i8255_device>("ppi8255_0")->read(space, (offset-0x1a00) & 3); }
1599   else if(offset >= 0x1b00 && offset <= 0x1bff)   { return ay8910_r(machine().device("ay"), space, 0); }
1599   else if(offset >= 0x1b00 && offset <= 0x1bff)   { return machine().device<ay8910_device>("ay")->data_r(space, 0); }
16001600//  else if(offset >= 0x1f80 && offset <= 0x1f8f)   { return z80dma_r(machine().device("dma"), 0); }
16011601//  else if(offset >= 0x1f90 && offset <= 0x1f91)   { return z80sio_c_r(machine().device("sio"), (offset-0x1f90) & 1); }
16021602//  else if(offset >= 0x1f92 && offset <= 0x1f93)   { return z80sio_d_r(machine().device("sio"), (offset-0x1f92) & 1); }
r22781r22782
16321632   else if(offset == 0x1800 || offset == 0x1801)   { x1_6845_w(space, offset-0x1800, data); }
16331633   else if(offset >= 0x1900 && offset <= 0x19ff)   { x1_sub_io_w(space, 0,data); }
16341634   else if(offset >= 0x1a00 && offset <= 0x1aff)   { machine().device<i8255_device>("ppi8255_0")->write(space, (offset-0x1a00) & 3,data); }
1635   else if(offset >= 0x1b00 && offset <= 0x1bff)   { ay8910_data_w(machine().device("ay"), space, 0,data); }
1636   else if(offset >= 0x1c00 && offset <= 0x1cff)   { ay8910_address_w(machine().device("ay"), space, 0,data); }
1635   else if(offset >= 0x1b00 && offset <= 0x1bff)   { machine().device<ay8910_device>("ay")->data_w(space, 0,data); }
1636   else if(offset >= 0x1c00 && offset <= 0x1cff)   { machine().device<ay8910_device>("ay")->address_w(space, 0,data); }
16371637   else if(offset >= 0x1d00 && offset <= 0x1dff)   { x1_rom_bank_1_w(space,0,data); }
16381638   else if(offset >= 0x1e00 && offset <= 0x1eff)   { x1_rom_bank_0_w(space,0,data); }
16391639//  else if(offset >= 0x1f80 && offset <= 0x1f8f)   { z80dma_w(machine().device("dma"), 0,data); }
r22781r22782
16801680   else if(offset >= 0x1400 && offset <= 0x17ff)   { return x1_pcg_r(space, offset-0x1400); }
16811681   else if(offset >= 0x1900 && offset <= 0x19ff)   { return x1_sub_io_r(space, 0); }
16821682   else if(offset >= 0x1a00 && offset <= 0x1aff)   { return machine().device<i8255_device>("ppi8255_0")->read(space, (offset-0x1a00) & 3); }
1683   else if(offset >= 0x1b00 && offset <= 0x1bff)   { return ay8910_r(machine().device("ay"), space, 0); }
1683   else if(offset >= 0x1b00 && offset <= 0x1bff)   { return machine().device<ay8910_device>("ay")->data_r(space, 0); }
16841684   else if(offset >= 0x1f80 && offset <= 0x1f8f)   { return z80dma_r(machine().device("dma"), space, 0); }
16851685   else if(offset >= 0x1f90 && offset <= 0x1f93)   { return z80dart_ba_cd_r(machine().device("sio"), space, (offset-0x1f90) & 3); }
16861686   else if(offset >= 0x1f98 && offset <= 0x1f9f)   { printf("Extended SIO/CTC read %04x\n",offset); return 0xff; }
r22781r22782
17301730   else if(offset == 0x1800 || offset == 0x1801)   { x1_6845_w(space, offset-0x1800, data); }
17311731   else if(offset >= 0x1900 && offset <= 0x19ff)   { x1_sub_io_w(space, 0,data); }
17321732   else if(offset >= 0x1a00 && offset <= 0x1aff)   { machine().device<i8255_device>("ppi8255_0")->write(space, (offset-0x1a00) & 3,data); }
1733   else if(offset >= 0x1b00 && offset <= 0x1bff)   { ay8910_data_w(machine().device("ay"), space, 0,data); }
1734   else if(offset >= 0x1c00 && offset <= 0x1cff)   { ay8910_address_w(machine().device("ay"), space, 0,data); }
1733   else if(offset >= 0x1b00 && offset <= 0x1bff)   { machine().device<ay8910_device>("ay")->data_w(space, 0,data); }
1734   else if(offset >= 0x1c00 && offset <= 0x1cff)   { machine().device<ay8910_device>("ay")->address_w(space, 0,data); }
17351735   else if(offset >= 0x1d00 && offset <= 0x1dff)   { x1_rom_bank_1_w(space,0,data); }
17361736   else if(offset >= 0x1e00 && offset <= 0x1eff)   { x1_rom_bank_0_w(space,0,data); }
17371737   else if(offset >= 0x1f80 && offset <= 0x1f8f)   { z80dma_w(machine().device("dma"), space, 0,data); }
trunk/src/mess/drivers/msx.c
r22781r22782
345345WRITE8_MEMBER(msx_state::msx_ay8910_w)
346346{
347347   if ( offset & 1 )
348      ay8910_data_w( m_ay8910, space, offset, data );
348      m_ay8910->data_w( space, offset, data );
349349   else
350      ay8910_address_w( m_ay8910, space, offset, data );
350      m_ay8910->address_w( space, offset, data );
351351}
352352
353353
r22781r22782
358358   AM_RANGE( 0x7c, 0x7d) AM_WRITE(msx_fmpac_w)
359359   AM_RANGE( 0x90, 0x90) AM_READWRITE(msx_printer_status_r, msx_printer_strobe_w)
360360   AM_RANGE( 0x91, 0x91) AM_WRITE(msx_printer_data_w)
361   AM_RANGE( 0xa0, 0xa7) AM_DEVREAD_LEGACY("ay8910", ay8910_r) AM_WRITE(msx_ay8910_w)
361   AM_RANGE( 0xa0, 0xa7) AM_DEVREAD("ay8910", ay8910_device, data_r) AM_WRITE(msx_ay8910_w)
362362   AM_RANGE( 0xa8, 0xab) AM_DEVREADWRITE("ppi8255", i8255_device, read, write)
363363   AM_RANGE( 0x98, 0x98) AM_DEVREADWRITE("tms9928a", tms9928a_device, vram_read, vram_write)
364364   AM_RANGE( 0x99, 0x99) AM_DEVREADWRITE("tms9928a", tms9928a_device, register_read, register_write)
r22781r22782
373373   AM_RANGE( 0x7c, 0x7d) AM_WRITE(msx_fmpac_w)
374374   AM_RANGE( 0x90, 0x90) AM_READWRITE(msx_printer_status_r, msx_printer_strobe_w)
375375   AM_RANGE( 0x91, 0x91) AM_WRITE(msx_printer_data_w)
376   AM_RANGE( 0xa0, 0xa7) AM_DEVREAD_LEGACY("ay8910", ay8910_r) AM_WRITE(msx_ay8910_w)
376   AM_RANGE( 0xa0, 0xa7) AM_DEVREAD("ay8910", ay8910_device, data_r) AM_WRITE(msx_ay8910_w)
377377   AM_RANGE( 0xa8, 0xab) AM_DEVREADWRITE("ppi8255", i8255_device, read, write)
378378   AM_RANGE( 0x98, 0x9b) AM_DEVREADWRITE("v9938", v9938_device, read, write)
379379   AM_RANGE( 0xb4, 0xb4) AM_WRITE(msx_rtc_latch_w)
trunk/src/mess/drivers/pc6001.c
r22781r22782
931931   AM_RANGE(0x80, 0x80) AM_DEVREADWRITE("uart", i8251_device, data_r, data_w)
932932   AM_RANGE(0x81, 0x81) AM_DEVREADWRITE("uart", i8251_device, status_r, control_w)
933933   AM_RANGE(0x90, 0x93) AM_MIRROR(0x0c) AM_READWRITE(nec_ppi8255_r, nec_ppi8255_w)
934   AM_RANGE(0xa0, 0xa0) AM_MIRROR(0x0c) AM_DEVWRITE_LEGACY("ay8910", ay8910_address_w)
935   AM_RANGE(0xa1, 0xa1) AM_MIRROR(0x0c) AM_DEVWRITE_LEGACY("ay8910", ay8910_data_w)
936   AM_RANGE(0xa2, 0xa2) AM_MIRROR(0x0c) AM_DEVREAD_LEGACY("ay8910", ay8910_r)
934   AM_RANGE(0xa0, 0xa0) AM_MIRROR(0x0c) AM_DEVWRITE("ay8910", ay8910_device, address_w)
935   AM_RANGE(0xa1, 0xa1) AM_MIRROR(0x0c) AM_DEVWRITE("ay8910", ay8910_device, data_w)
936   AM_RANGE(0xa2, 0xa2) AM_MIRROR(0x0c) AM_DEVREAD("ay8910", ay8910_device, data_r)
937937   AM_RANGE(0xa3, 0xa3) AM_MIRROR(0x0c) AM_WRITENOP
938938   AM_RANGE(0xb0, 0xb0) AM_MIRROR(0x0f) AM_WRITE(pc6001_system_latch_w)
939939   AM_RANGE(0xd0, 0xd3) AM_MIRROR(0x0c) AM_NOP // disk device
r22781r22782
14671467
14681468   AM_RANGE(0x90, 0x93) AM_MIRROR(0x0c) AM_READWRITE(nec_ppi8255_r, necmk2_ppi8255_w)
14691469
1470   AM_RANGE(0xa0, 0xa0) AM_MIRROR(0x0c) AM_DEVWRITE_LEGACY("ay8910", ay8910_address_w)
1471   AM_RANGE(0xa1, 0xa1) AM_MIRROR(0x0c) AM_DEVWRITE_LEGACY("ay8910", ay8910_data_w)
1472   AM_RANGE(0xa2, 0xa2) AM_MIRROR(0x0c) AM_DEVREAD_LEGACY("ay8910", ay8910_r)
1470   AM_RANGE(0xa0, 0xa0) AM_MIRROR(0x0c) AM_DEVWRITE("ay8910", ay8910_device, address_w)
1471   AM_RANGE(0xa1, 0xa1) AM_MIRROR(0x0c) AM_DEVWRITE("ay8910", ay8910_device, data_w)
1472   AM_RANGE(0xa2, 0xa2) AM_MIRROR(0x0c) AM_DEVREAD("ay8910", ay8910_device, data_r)
14731473   AM_RANGE(0xa3, 0xa3) AM_MIRROR(0x0c) AM_NOP
14741474
14751475   AM_RANGE(0xb0, 0xb0) AM_MIRROR(0x0f) AM_WRITE(pc6001m2_system_latch_w)
r22781r22782
15101510
15111511   AM_RANGE(0x90, 0x93) AM_MIRROR(0x0c) AM_READWRITE(nec_ppi8255_r, necmk2_ppi8255_w)
15121512
1513   AM_RANGE(0xa0, 0xa0) AM_MIRROR(0x0c) AM_DEVWRITE_LEGACY("ay8910", ay8910_address_w)
1514   AM_RANGE(0xa1, 0xa1) AM_MIRROR(0x0c) AM_DEVWRITE_LEGACY("ay8910", ay8910_data_w)
1515   AM_RANGE(0xa2, 0xa2) AM_MIRROR(0x0c) AM_DEVREAD_LEGACY("ay8910", ay8910_r)
1513   AM_RANGE(0xa0, 0xa0) AM_MIRROR(0x0c) AM_DEVWRITE("ay8910", ay8910_device, address_w)
1514   AM_RANGE(0xa1, 0xa1) AM_MIRROR(0x0c) AM_DEVWRITE("ay8910", ay8910_device, data_w)
1515   AM_RANGE(0xa2, 0xa2) AM_MIRROR(0x0c) AM_DEVREAD("ay8910", ay8910_device, data_r)
15161516   AM_RANGE(0xa3, 0xa3) AM_MIRROR(0x0c) AM_NOP
15171517
15181518   AM_RANGE(0xb0, 0xb0) AM_WRITE(pc6001m2_system_latch_w)
r22781r22782
17111711
17121712   AM_RANGE(0x90, 0x93) AM_MIRROR(0x0c) AM_READWRITE(nec_ppi8255_r, necsr_ppi8255_w)
17131713
1714   AM_RANGE(0xa0, 0xa0) AM_MIRROR(0x0c) AM_DEVWRITE_LEGACY("ay8910", ay8910_address_w)
1715   AM_RANGE(0xa1, 0xa1) AM_MIRROR(0x0c) AM_DEVWRITE_LEGACY("ay8910", ay8910_data_w)
1716   AM_RANGE(0xa2, 0xa2) AM_MIRROR(0x0c) AM_DEVREAD_LEGACY("ay8910", ay8910_r)
1714   AM_RANGE(0xa0, 0xa0) AM_MIRROR(0x0c) AM_DEVWRITE("ay8910", ay8910_device, address_w)
1715   AM_RANGE(0xa1, 0xa1) AM_MIRROR(0x0c) AM_DEVWRITE("ay8910", ay8910_device, data_w)
1716   AM_RANGE(0xa2, 0xa2) AM_MIRROR(0x0c) AM_DEVREAD("ay8910", ay8910_device, data_r)
17171717   AM_RANGE(0xa3, 0xa3) AM_MIRROR(0x0c) AM_NOP
17181718
17191719   AM_RANGE(0xb0, 0xb0) AM_WRITE(pc6001sr_system_latch_w)
trunk/src/mess/drivers/svi318.c
r22781r22782
4949   AM_RANGE( 0x81, 0x81) AM_DEVWRITE( "tms9928a", tms9928a_device, register_write )
5050   AM_RANGE( 0x84, 0x84) AM_DEVREAD( "tms9928a", tms9928a_device, vram_read )
5151   AM_RANGE( 0x85, 0x85) AM_DEVREAD( "tms9928a", tms9928a_device, register_read )
52   AM_RANGE( 0x88, 0x88) AM_DEVWRITE_LEGACY("ay8910", ay8910_address_w )
53   AM_RANGE( 0x8c, 0x8c) AM_DEVWRITE_LEGACY("ay8910", ay8910_data_w )
54   AM_RANGE( 0x90, 0x90) AM_DEVREAD_LEGACY("ay8910", ay8910_r )
52   AM_RANGE( 0x88, 0x88) AM_DEVWRITE("ay8910", ay8910_device, address_w )
53   AM_RANGE( 0x8c, 0x8c) AM_DEVWRITE("ay8910", ay8910_device, data_w )
54   AM_RANGE( 0x90, 0x90) AM_DEVREAD("ay8910", ay8910_device, data_r )
5555   AM_RANGE( 0x96, 0x97) AM_WRITE(svi318_ppi_w)
5656   AM_RANGE( 0x98, 0x9a) AM_DEVREAD("ppi8255", i8255_device, read)
5757ADDRESS_MAP_END
r22781r22782
6464   AM_RANGE( 0x81, 0x81) AM_DEVWRITE( "tms9928a", tms9928a_device, register_write )
6565   AM_RANGE( 0x84, 0x84) AM_DEVREAD( "tms9928a", tms9928a_device, vram_read )
6666   AM_RANGE( 0x85, 0x85) AM_DEVREAD( "tms9928a", tms9928a_device, register_read )
67   AM_RANGE( 0x88, 0x88) AM_DEVWRITE_LEGACY("ay8910", ay8910_address_w )
68   AM_RANGE( 0x8c, 0x8c) AM_DEVWRITE_LEGACY("ay8910", ay8910_data_w )
69   AM_RANGE( 0x90, 0x90) AM_DEVREAD_LEGACY("ay8910", ay8910_r )
67   AM_RANGE( 0x88, 0x88) AM_DEVWRITE("ay8910", ay8910_device, address_w )
68   AM_RANGE( 0x8c, 0x8c) AM_DEVWRITE("ay8910", ay8910_device, data_w )
69   AM_RANGE( 0x90, 0x90) AM_DEVREAD("ay8910", ay8910_device, data_r )
7070   AM_RANGE( 0x96, 0x97) AM_WRITE(svi318_ppi_w)
7171   AM_RANGE( 0x98, 0x9a) AM_DEVREAD("ppi8255", i8255_device, read)
7272ADDRESS_MAP_END
trunk/src/mess/drivers/phc25.c
r22781r22782
135135   AM_RANGE(0x86, 0x86) AM_READ_PORT("KEY6")
136136   AM_RANGE(0x87, 0x87) AM_READ_PORT("KEY7")
137137   AM_RANGE(0x88, 0x88) AM_READ_PORT("KEY8")
138   AM_RANGE(0xc0, 0xc0) AM_DEVWRITE_LEGACY(AY8910_TAG, ay8910_address_w)
139   AM_RANGE(0xc1, 0xc1) AM_DEVREADWRITE_LEGACY(AY8910_TAG, ay8910_r, ay8910_data_w)
138   AM_RANGE(0xc0, 0xc0) AM_DEVWRITE(AY8910_TAG, ay8910_device, address_w)
139   AM_RANGE(0xc1, 0xc1) AM_DEVREADWRITE(AY8910_TAG, ay8910_device, data_r, data_w)
140140ADDRESS_MAP_END
141141
142142/* Input Ports */
trunk/src/mess/drivers/spc1000.c
r22781r22782
128128   AM_RANGE(0x2000, 0x3fff) AM_READWRITE(spc1000_gmode_r, spc1000_gmode_w)
129129   AM_RANGE(0x8000, 0x8009) AM_READ(spc1000_keyboard_r)
130130   AM_RANGE(0xA000, 0xA000) AM_READWRITE(spc1000_iplk_r, spc1000_iplk_w)
131   AM_RANGE(0x4000, 0x4000) AM_DEVWRITE_LEGACY("ay8910", ay8910_address_w)
132   AM_RANGE(0x4001, 0x4001) AM_DEVREADWRITE_LEGACY("ay8910", ay8910_r, ay8910_data_w)
131   AM_RANGE(0x4000, 0x4000) AM_DEVWRITE("ay8910", ay8910_device, address_w)
132   AM_RANGE(0x4001, 0x4001) AM_DEVREADWRITE("ay8910", ay8910_device, data_r, data_w)
133133ADDRESS_MAP_END
134134
135135/* Input ports */
trunk/src/mess/drivers/atarist.c
r22781r22782
12121212   AM_RANGE(0xff8604, 0xff8605) AM_READWRITE(fdc_data_r, fdc_data_w)
12131213   AM_RANGE(0xff8606, 0xff8607) AM_READWRITE(dma_status_r, dma_mode_w)
12141214   AM_RANGE(0xff8608, 0xff860d) AM_READWRITE8(dma_counter_r, dma_base_w, 0x00ff)
1215   AM_RANGE(0xff8800, 0xff8801) AM_DEVREADWRITE8_LEGACY(YM2149_TAG, ay8910_r, ay8910_address_w, 0xff00) AM_MIRROR(0xfc)
1216   AM_RANGE(0xff8802, 0xff8803) AM_DEVREADWRITE8_LEGACY(YM2149_TAG, ay8910_r, ay8910_data_w, 0xff00) AM_MIRROR(0xfc)
1215   AM_RANGE(0xff8800, 0xff8801) AM_DEVREADWRITE8(YM2149_TAG, ay8910_device, data_r, address_w, 0xff00) AM_MIRROR(0xfc)
1216   AM_RANGE(0xff8802, 0xff8803) AM_DEVREADWRITE8(YM2149_TAG, ay8910_device, data_r, data_w, 0xff00) AM_MIRROR(0xfc)
12171217#if 0
12181218   AM_RANGE(0xff8a00, 0xff8a1f) AM_READWRITE(blitter_halftone_r, blitter_halftone_w)
12191219   AM_RANGE(0xff8a20, 0xff8a21) AM_READWRITE(blitter_src_inc_x_r, blitter_src_inc_x_w)
r22781r22782
12571257   AM_RANGE(0xff8604, 0xff8605) AM_READWRITE(fdc_data_r, fdc_data_w)
12581258   AM_RANGE(0xff8606, 0xff8607) AM_READWRITE(dma_status_r, dma_mode_w)
12591259   AM_RANGE(0xff8608, 0xff860d) AM_READWRITE8(dma_counter_r, dma_base_w, 0x00ff)
1260   AM_RANGE(0xff8800, 0xff8801) AM_DEVREADWRITE8_LEGACY(YM2149_TAG, ay8910_r, ay8910_address_w, 0xff00)
1261   AM_RANGE(0xff8802, 0xff8803) AM_DEVWRITE8_LEGACY(YM2149_TAG, ay8910_data_w, 0xff00)
1260   AM_RANGE(0xff8800, 0xff8801) AM_DEVREADWRITE8(YM2149_TAG, ay8910_device, data_r, address_w, 0xff00)
1261   AM_RANGE(0xff8802, 0xff8803) AM_DEVWRITE8(YM2149_TAG, ay8910_device, data_w, 0xff00)
12621262   AM_RANGE(0xff8a00, 0xff8a1f) AM_READWRITE(blitter_halftone_r, blitter_halftone_w)
12631263   AM_RANGE(0xff8a20, 0xff8a21) AM_READWRITE(blitter_src_inc_x_r, blitter_src_inc_x_w)
12641264   AM_RANGE(0xff8a22, 0xff8a23) AM_READWRITE(blitter_src_inc_y_r, blitter_src_inc_y_w)
r22781r22782
13821382    AM_RANGE(0xff8260, 0xff8261) AM_READWRITE8(stbook_shifter_mode_r, stbook_shifter_mode_w, 0xff00)
13831383    AM_RANGE(0xff8264, 0xff8265) AM_READWRITE(stbook_shifter_pixelofs_r, stbook_shifter_pixelofs_w)
13841384    AM_RANGE(0xff827e, 0xff827f) AM_WRITE(lcd_control_w)*/
1385   AM_RANGE(0xff8800, 0xff8801) AM_DEVREADWRITE8_LEGACY(YM3439_TAG, ay8910_r, ay8910_address_w, 0xff00)
1386   AM_RANGE(0xff8802, 0xff8803) AM_DEVWRITE8_LEGACY(YM3439_TAG, ay8910_data_w, 0xff00)
1385   AM_RANGE(0xff8800, 0xff8801) AM_DEVREADWRITE8(YM3439_TAG, ay8910_device, data_r, address_w, 0xff00)
1386   AM_RANGE(0xff8802, 0xff8803) AM_DEVWRITE8(YM3439_TAG, ay8910_device, data_w, 0xff00)
13871387/*  AM_RANGE(0xff8900, 0xff8901) AM_READWRITE8(sound_dma_control_r, sound_dma_control_w, 0x00ff)
13881388    AM_RANGE(0xff8902, 0xff8907) AM_READWRITE8(sound_dma_base_r, sound_dma_base_w, 0x00ff)
13891389    AM_RANGE(0xff8908, 0xff890d) AM_READ8(sound_dma_counter_r, 0x00ff)
trunk/src/mess/drivers/spec128.c
r22781r22782
236236   AM_RANGE(0x007f, 0x007f) AM_READ(spectrum_port_7f_r) AM_MIRROR(0xff00)
237237   AM_RANGE(0x00df, 0x00df) AM_READ(spectrum_port_df_r) AM_MIRROR(0xff00)
238238   AM_RANGE(0x4000, 0x4000) AM_WRITE(spectrum_128_port_7ffd_w) AM_MIRROR(0x3ffd)
239   AM_RANGE(0x8000, 0x8000) AM_DEVWRITE_LEGACY("ay8912", ay8910_data_w) AM_MIRROR(0x3ffd)
240   AM_RANGE(0xc000, 0xc000) AM_DEVREADWRITE_LEGACY("ay8912", ay8910_r, ay8910_address_w) AM_MIRROR(0x3ffd)
239   AM_RANGE(0x8000, 0x8000) AM_DEVWRITE("ay8912", ay8910_device, data_w) AM_MIRROR(0x3ffd)
240   AM_RANGE(0xc000, 0xc000) AM_DEVREADWRITE("ay8912", ay8910_device, data_r, address_w) AM_MIRROR(0x3ffd)
241241   AM_RANGE(0x0001, 0x0001) AM_READ(spectrum_128_ula_r) AM_MIRROR(0xfffe)
242242ADDRESS_MAP_END
243243
trunk/src/mess/drivers/fm7.c
r22781r22782
824824            break;
825825         case 0x01:
826826            // Data read
827            m_psg_data = ay8910_r(space.machine().device("psg"),space, 0);
827            m_psg_data = m_psg->data_r(space, 0);
828828            break;
829829         case 0x02:
830830            // Data write
831            ay8910_data_w(space.machine().device("psg"),space, 0,m_psg_data);
831            m_psg->data_w(space, 0,m_psg_data);
832832            break;
833833         case 0x03:
834834            // Address latch
835            ay8910_address_w(space.machine().device("psg"),space, 0,m_psg_data);
835            m_psg->address_w(space, 0,m_psg_data);
836836            break;
837837      }
838838   }
trunk/src/mess/drivers/aquarius.c
r22781r22782
208208
209209static ADDRESS_MAP_START( aquarius_io, AS_IO, 8, aquarius_state )
210210//  AM_RANGE(0x7e, 0x7f) AM_MIRROR(0xff00) AM_READWRITE(modem_r, modem_w)
211   AM_RANGE(0xf6, 0xf6) AM_MIRROR(0xff00) AM_DEVREADWRITE_LEGACY("ay8910", ay8910_r, ay8910_data_w)
212   AM_RANGE(0xf7, 0xf7) AM_MIRROR(0xff00) AM_DEVWRITE_LEGACY("ay8910", ay8910_address_w)
211   AM_RANGE(0xf6, 0xf6) AM_MIRROR(0xff00) AM_DEVREADWRITE("ay8910", ay8910_device, data_r, data_w)
212   AM_RANGE(0xf7, 0xf7) AM_MIRROR(0xff00) AM_DEVWRITE("ay8910", ay8910_device, address_w)
213213   AM_RANGE(0xfc, 0xfc) AM_MIRROR(0xff00) AM_READWRITE(cassette_r, cassette_w)
214214   AM_RANGE(0xfd, 0xfd) AM_MIRROR(0xff00) AM_READWRITE(vsync_r, mapper_w)
215215   AM_RANGE(0xfe, 0xfe) AM_MIRROR(0xff00) AM_READWRITE(printer_r, printer_w)
trunk/src/mess/drivers/cgc7900.c
r22781r22782
273273//  AM_RANGE(0xff8246, 0xff8247) Buffer memory parity check
274274//  AM_RANGE(0xff8248, 0xff8249) Buffer memory parity set/reset
275275   AM_RANGE(0xff824a, 0xff824b) AM_READ(sync_r)
276   AM_RANGE(0xff83c0, 0xff83c1) AM_DEVWRITE8_LEGACY(AY8910_TAG, ay8910_address_w, 0xff00)
277   AM_RANGE(0xff83c2, 0xff83c3) AM_DEVREAD8_LEGACY(AY8910_TAG, ay8910_r, 0xff00)
278   AM_RANGE(0xff83c4, 0xff83c5) AM_DEVWRITE8_LEGACY(AY8910_TAG, ay8910_data_w, 0xff00)
276   AM_RANGE(0xff83c0, 0xff83c1) AM_DEVWRITE8(AY8910_TAG, ay8910_device, address_w, 0xff00)
277   AM_RANGE(0xff83c2, 0xff83c3) AM_DEVREAD8(AY8910_TAG, ay8910_device, data_r, 0xff00)
278   AM_RANGE(0xff83c4, 0xff83c5) AM_DEVWRITE8(AY8910_TAG, ay8910_device, data_w, 0xff00)
279279//  AM_RANGE(0xff8500, 0xff8501) Disk DMA Command Register
280280//  AM_RANGE(0xff8502, 0xff8503) Disk DMA Address Register
281281//  AM_RANGE(0xff8507, 0xff8507) Disk DMA Control/Status Register
trunk/src/mess/drivers/tiki100.c
r22781r22782
218218   AM_RANGE(0x0c, 0x0c) AM_MIRROR(0x03) AM_WRITE(video_mode_w)
219219   AM_RANGE(0x10, 0x13) AM_DEVREADWRITE(FD1797_TAG, fd1797_t, read, write)
220220   AM_RANGE(0x14, 0x14) AM_MIRROR(0x01) AM_WRITE(palette_w)
221   AM_RANGE(0x16, 0x16) AM_DEVWRITE_LEGACY(AY8912_TAG, ay8910_address_w)
222   AM_RANGE(0x17, 0x17) AM_DEVREADWRITE_LEGACY(AY8912_TAG, ay8910_r, ay8910_data_w)
221   AM_RANGE(0x16, 0x16) AM_DEVWRITE(AY8912_TAG, ay8910_device, address_w)
222   AM_RANGE(0x17, 0x17) AM_DEVREADWRITE(AY8912_TAG, ay8910_device, data_r, data_w)
223223   AM_RANGE(0x18, 0x1b) AM_DEVREADWRITE(Z80CTC_TAG, z80ctc_device, read, write)
224224   AM_RANGE(0x1c, 0x1c) AM_MIRROR(0x03) AM_WRITE(system_w)
225225   AM_RANGE(0x20, 0x27) AM_NOP // winchester controller
trunk/src/mess/drivers/mc1000.c
r22781r22782
138138//  AM_RANGE(0x10, 0x10) AM_DEVWRITE_LEGACY(MC6845_TAG, mc6845_address_w)
139139//  AM_RANGE(0x11, 0x11) AM_DEVREADWRITE_LEGACY(MC6845_TAG, mc6845_register_r, mc6845_register_w)
140140   AM_RANGE(0x12, 0x12) AM_WRITE(mc6845_ctrl_w)
141   AM_RANGE(0x20, 0x20) AM_DEVWRITE_LEGACY(AY8910_TAG, ay8910_address_w)
142   AM_RANGE(0x40, 0x40) AM_DEVREAD_LEGACY(AY8910_TAG, ay8910_r)
143   AM_RANGE(0x60, 0x60) AM_DEVWRITE_LEGACY(AY8910_TAG, ay8910_data_w)
141   AM_RANGE(0x20, 0x20) AM_DEVWRITE(AY8910_TAG, ay8910_device, address_w)
142   AM_RANGE(0x40, 0x40) AM_DEVREAD(AY8910_TAG, ay8910_device, data_r)
143   AM_RANGE(0x60, 0x60) AM_DEVWRITE(AY8910_TAG, ay8910_device, data_w)
144144   AM_RANGE(0x80, 0x80) AM_WRITE(mc6847_attr_w)
145145ADDRESS_MAP_END
146146
trunk/src/mess/drivers/timex.c
r22781r22782
555555   AM_RANGE(0x7f, 0x7f) AM_READ(spectrum_port_7f_r ) AM_MIRROR(0xff00)
556556   AM_RANGE(0xdf, 0xdf) AM_READ(spectrum_port_df_r ) AM_MIRROR(0xff00)
557557   AM_RANGE(0xf4, 0xf4) AM_READWRITE(ts2068_port_f4_r,ts2068_port_f4_w ) AM_MIRROR(0xff00)
558   AM_RANGE(0xf5, 0xf5) AM_DEVWRITE_LEGACY("ay8912", ay8910_address_w ) AM_MIRROR(0xff00)
559   AM_RANGE(0xf6, 0xf6) AM_DEVREADWRITE_LEGACY("ay8912", ay8910_r, ay8910_data_w ) AM_MIRROR(0xff00)
558   AM_RANGE(0xf5, 0xf5) AM_DEVWRITE("ay8912", ay8910_device, address_w ) AM_MIRROR(0xff00)
559   AM_RANGE(0xf6, 0xf6) AM_DEVREADWRITE("ay8912", ay8910_device, data_r, data_w ) AM_MIRROR(0xff00)
560560   AM_RANGE(0xfe, 0xfe) AM_READWRITE(spectrum_port_fe_r,spectrum_port_fe_w )  AM_MIRROR(0xff00)  AM_MASK(0xffff)
561561   AM_RANGE(0xff, 0xff) AM_READWRITE(ts2068_port_ff_r,ts2068_port_ff_w ) AM_MIRROR(0xff00)
562562ADDRESS_MAP_END
trunk/src/mess/drivers/scorpion.c
r22781r22782
320320   AM_RANGE(0x00fe, 0x00fe) AM_READWRITE(spectrum_port_fe_r,spectrum_port_fe_w) AM_MIRROR(0xff00) AM_MASK(0xffff)
321321   AM_RANGE(0x00ff, 0x00ff) AM_DEVREADWRITE_LEGACY(BETA_DISK_TAG, betadisk_state_r, betadisk_param_w) AM_MIRROR(0xff00)
322322   AM_RANGE(0x4000, 0x4000) AM_WRITE(scorpion_port_7ffd_w)  AM_MIRROR(0x3ffd)
323   AM_RANGE(0x8000, 0x8000) AM_DEVWRITE_LEGACY("ay8912", ay8910_data_w) AM_MIRROR(0x3ffd)
324   AM_RANGE(0xc000, 0xc000) AM_DEVREADWRITE_LEGACY("ay8912", ay8910_r, ay8910_address_w) AM_MIRROR(0x3ffd)
323   AM_RANGE(0x8000, 0x8000) AM_DEVWRITE("ay8912", ay8910_device, data_w) AM_MIRROR(0x3ffd)
324   AM_RANGE(0xc000, 0xc000) AM_DEVREADWRITE("ay8912", ay8910_device, data_r, address_w) AM_MIRROR(0x3ffd)
325325   AM_RANGE(0x1000, 0x1000) AM_WRITE(scorpion_port_1ffd_w) AM_MIRROR(0x0ffd)
326326ADDRESS_MAP_END
327327
trunk/src/mess/drivers/multi8.c
r22781r22782
327327   }
328328}
329329
330READ8_MEMBER(multi8_state::ay8912_0_r){ return ay8910_r(machine().device("aysnd"),space, 0); }
331READ8_MEMBER(multi8_state::ay8912_1_r){ return ay8910_r(machine().device("aysnd"),space, 1); }
330READ8_MEMBER(multi8_state::ay8912_0_r){ return machine().device<ay8910_device>("aysnd")->data_r(space, 0); }
331READ8_MEMBER(multi8_state::ay8912_1_r){ return machine().device<ay8910_device>("aysnd")->data_r(space, 1); }
332332
333333READ8_MEMBER( multi8_state::multi8_kanji_r )
334334{
r22781r22782
352352   ADDRESS_MAP_GLOBAL_MASK(0xff)
353353   AM_RANGE(0x00, 0x00) AM_READ(key_input_r) AM_WRITENOP//keyboard
354354   AM_RANGE(0x01, 0x01) AM_READ(key_status_r) AM_WRITENOP//keyboard
355   AM_RANGE(0x18, 0x19) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w)
355   AM_RANGE(0x18, 0x19) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
356356   AM_RANGE(0x18, 0x18) AM_READ(ay8912_0_r)
357357   AM_RANGE(0x1a, 0x1a) AM_READ(ay8912_1_r)
358358   AM_RANGE(0x1c, 0x1d) AM_WRITE(multi8_6845_w)
trunk/src/mess/drivers/microtan.c
r22781r22782
5454static ADDRESS_MAP_START( microtan_map, AS_PROGRAM, 8, microtan_state )
5555   AM_RANGE(0x0000, 0x01ff) AM_RAM
5656   AM_RANGE(0x0200, 0x03ff) AM_RAM_WRITE(microtan_videoram_w) AM_SHARE("videoram")
57   AM_RANGE(0xbc00, 0xbc00) AM_DEVWRITE_LEGACY("ay8910.1", ay8910_address_w)
58   AM_RANGE(0xbc01, 0xbc01) AM_DEVREADWRITE_LEGACY("ay8910.1", ay8910_r, ay8910_data_w)
59   AM_RANGE(0xbc02, 0xbc02) AM_DEVWRITE_LEGACY("ay8910.2", ay8910_address_w)
60   AM_RANGE(0xbc03, 0xbc03) AM_DEVREADWRITE_LEGACY("ay8910.2", ay8910_r, ay8910_data_w)
57   AM_RANGE(0xbc00, 0xbc00) AM_DEVWRITE("ay8910.1", ay8910_device, address_w)
58   AM_RANGE(0xbc01, 0xbc01) AM_DEVREADWRITE("ay8910.1", ay8910_device, data_r, data_w)
59   AM_RANGE(0xbc02, 0xbc02) AM_DEVWRITE("ay8910.2", ay8910_device, address_w)
60   AM_RANGE(0xbc03, 0xbc03) AM_DEVREADWRITE("ay8910.2", ay8910_device, data_r, data_w)
6161   AM_RANGE(0xbfc0, 0xbfcf) AM_DEVREADWRITE("via6522_0", via6522_device, read, write)
6262   AM_RANGE(0xbfd0, 0xbfd3) AM_DEVREADWRITE("acia", mos6551_device, read, write)
6363   AM_RANGE(0xbfe0, 0xbfef) AM_DEVREADWRITE("via6522_1", via6522_device, read, write)
trunk/src/mess/drivers/einstein.c
r22781r22782
475475/* The I/O ports are decoded into 8 blocks using address lines A3 to A7 */
476476static ADDRESS_MAP_START( einstein_io, AS_IO, 8, einstein_state )
477477   /* block 0, ay8910 psg */
478   AM_RANGE(0x02, 0x02) AM_MIRROR(0xff04) AM_DEVREADWRITE_LEGACY(IC_I030, ay8910_r, ay8910_address_w)
479   AM_RANGE(0x03, 0x03) AM_MIRROR(0xff04) AM_DEVWRITE_LEGACY(IC_I030, ay8910_data_w)
478   AM_RANGE(0x02, 0x02) AM_MIRROR(0xff04) AM_DEVREADWRITE(IC_I030, ay8910_device, data_r, address_w)
479   AM_RANGE(0x03, 0x03) AM_MIRROR(0xff04) AM_DEVWRITE(IC_I030, ay8910_device, data_w)
480480   /* block 1, tms9928a vdp */
481481   AM_RANGE(0x08, 0x08) AM_MIRROR(0xff06) AM_DEVREADWRITE("tms9929a", tms9929a_device, vram_read, vram_write)
482482   AM_RANGE(0x09, 0x09) AM_MIRROR(0xff06) AM_DEVREADWRITE("tms9929a", tms9929a_device, register_read, register_write)
trunk/src/mess/drivers/galaxy.c
r22781r22782
3434static ADDRESS_MAP_START (galaxyp_io, AS_IO, 8, galaxy_state )
3535   ADDRESS_MAP_GLOBAL_MASK(0x01)
3636   ADDRESS_MAP_UNMAP_HIGH
37   AM_RANGE(0xbe, 0xbe) AM_DEVWRITE_LEGACY("ay8910", ay8910_address_w)
38   AM_RANGE(0xbf, 0xbf) AM_DEVWRITE_LEGACY("ay8910", ay8910_data_w)
37   AM_RANGE(0xbe, 0xbe) AM_DEVWRITE("ay8910", ay8910_device, address_w)
38   AM_RANGE(0xbf, 0xbf) AM_DEVWRITE("ay8910", ay8910_device, data_w)
3939ADDRESS_MAP_END
4040
4141
trunk/src/mess/drivers/ace.c
r22781r22782
347347   AM_RANGE(0x83, 0x83) AM_MIRROR(0xff38) AM_READWRITE(pio_bd_r, pio_bd_w)
348348   AM_RANGE(0x85, 0x85) AM_MIRROR(0xff38) AM_READWRITE(pio_ac_r, pio_ac_w)
349349   AM_RANGE(0x87, 0x87) AM_MIRROR(0xff38) AM_READWRITE(pio_bc_r, pio_bc_w)
350   AM_RANGE(0xfd, 0xfd) AM_MIRROR(0xff00) AM_DEVWRITE_LEGACY(AY8910_TAG, ay8910_address_w)
351   AM_RANGE(0xff, 0xff) AM_MIRROR(0xff00) AM_DEVREADWRITE_LEGACY(AY8910_TAG, ay8910_r, ay8910_data_w)
350   AM_RANGE(0xfd, 0xfd) AM_MIRROR(0xff00) AM_DEVWRITE(AY8910_TAG, ay8910_device, address_w)
351   AM_RANGE(0xff, 0xff) AM_MIRROR(0xff00) AM_DEVREADWRITE(AY8910_TAG, ay8910_device, data_r, data_w)
352352ADDRESS_MAP_END
353353
354354
trunk/src/mess/drivers/sbc6510.c
r22781r22782
8888   AM_RANGE(0x0002, 0x0002) AM_READWRITE(a2_r,a2_w)
8989   AM_RANGE(0x0003, 0xdfff) AM_RAM
9090   AM_RANGE(0xE000, 0xE00F) AM_MIRROR(0x1f0) AM_DEVREADWRITE_LEGACY("cia6526", mos6526_r, mos6526_w)
91   AM_RANGE(0xE800, 0xE800) AM_MIRROR(0x1ff) AM_DEVWRITE_LEGACY("ay8910", ay8910_address_w)
92   AM_RANGE(0xEA00, 0xEA00) AM_MIRROR(0x1ff) AM_DEVREADWRITE_LEGACY("ay8910", ay8910_r, ay8910_data_w)
91   AM_RANGE(0xE800, 0xE800) AM_MIRROR(0x1ff) AM_DEVWRITE("ay8910", ay8910_device, address_w)
92   AM_RANGE(0xEA00, 0xEA00) AM_MIRROR(0x1ff) AM_DEVREADWRITE("ay8910", ay8910_device, data_r, data_w)
9393   AM_RANGE(0xf000, 0xffff) AM_ROM
9494ADDRESS_MAP_END
9595
trunk/src/mess/drivers/cgenie.c
r22781r22782
6161static ADDRESS_MAP_START (cgenie_io, AS_IO, 8, cgenie_state )
6262   ADDRESS_MAP_GLOBAL_MASK(0xff)
6363   AM_RANGE(0xf8, 0xf8) AM_READWRITE(cgenie_sh_control_port_r, cgenie_sh_control_port_w )
64   AM_RANGE(0xf9, 0xf9) AM_DEVREADWRITE_LEGACY("ay8910", ay8910_r, ay8910_data_w )
64   AM_RANGE(0xf9, 0xf9) AM_DEVREADWRITE("ay8910", ay8910_device, data_r, data_w)
6565   AM_RANGE(0xfa, 0xfa) AM_READWRITE(cgenie_index_r, cgenie_index_w )
6666   AM_RANGE(0xfb, 0xfb) AM_READWRITE(cgenie_register_r, cgenie_register_w )
6767   AM_RANGE(0xff, 0xff) AM_READWRITE(cgenie_port_ff_r, cgenie_port_ff_w )
trunk/src/mess/drivers/pentagon.c
r22781r22782
121121   AM_RANGE(0x00fe, 0x00fe) AM_READWRITE(spectrum_port_fe_r,spectrum_port_fe_w) AM_MIRROR(0xff00) AM_MASK(0xffff)
122122   AM_RANGE(0x00ff, 0x00ff) AM_DEVREADWRITE_LEGACY(BETA_DISK_TAG, betadisk_state_r, betadisk_param_w) AM_MIRROR(0xff00)
123123   AM_RANGE(0x4000, 0x4000) AM_WRITE(pentagon_port_7ffd_w)  AM_MIRROR(0x3ffd)
124   AM_RANGE(0x8000, 0x8000) AM_DEVWRITE_LEGACY("ay8912", ay8910_data_w) AM_MIRROR(0x3ffd)
125   AM_RANGE(0xc000, 0xc000) AM_DEVREADWRITE_LEGACY("ay8912", ay8910_r, ay8910_address_w) AM_MIRROR(0x3ffd)
124   AM_RANGE(0x8000, 0x8000) AM_DEVWRITE("ay8912", ay8910_device, data_w) AM_MIRROR(0x3ffd)
125   AM_RANGE(0xc000, 0xc000) AM_DEVREADWRITE("ay8912", ay8910_device, data_r, address_w) AM_MIRROR(0x3ffd)
126126ADDRESS_MAP_END
127127
128128MACHINE_RESET_MEMBER(pentagon_state,pentagon)
trunk/src/mess/drivers/intv.c
r22781r22782
714714   AM_RANGE(0x0000, 0x003f) AM_READWRITE( intv_stic_r, intv_stic_w )
715715   AM_RANGE(0x0080, 0x0081) AM_DEVREADWRITE_LEGACY("sp0256_speech", spb640_r, spb640_w ) /* Intellivoice */
716716   AM_RANGE(0x0100, 0x01ef) AM_READWRITE( intv_ram8_r, intv_ram8_w )
717   AM_RANGE(0x01f0, 0x01ff) AM_DEVREADWRITE8_LEGACY("ay8914.1", ay8914_r, ay8914_w, 0x00ff )
717   AM_RANGE(0x01f0, 0x01ff) AM_DEVREADWRITE8("ay8914.1", ay8914_device, read, write, 0x00ff )
718718   AM_RANGE(0x0200, 0x035f) AM_READWRITE( intv_ram16_r, intv_ram16_w )
719719   AM_RANGE(0x1000, 0x1fff) AM_ROM AM_REGION("maincpu", 0x1000<<1) /* Exec ROM, 10-bits wide */
720720   AM_RANGE(0x3000, 0x37ff) AM_ROM AM_REGION("maincpu", 0x3000<<1) /* GROM,     8-bits wide */
r22781r22782
731731   AM_RANGE(0x0000, 0x003f) AM_READWRITE( intv_stic_r, intv_stic_w )
732732   AM_RANGE(0x0080, 0x0081) AM_DEVREADWRITE_LEGACY("sp0256_speech", spb640_r, spb640_w ) /* Intellivoice */
733733   AM_RANGE(0x0100, 0x01ef) AM_READWRITE( intv_ram8_r, intv_ram8_w )
734   AM_RANGE(0x01f0, 0x01ff) AM_DEVREADWRITE8_LEGACY("ay8914.1", ay8914_r, ay8914_w, 0x00ff )
734   AM_RANGE(0x01f0, 0x01ff) AM_DEVREADWRITE8("ay8914.1", ay8914_device, read, write, 0x00ff )
735735   AM_RANGE(0x0200, 0x035f) AM_READWRITE( intv_ram16_r, intv_ram16_w )
736736   AM_RANGE(0x0400, 0x04ff) AM_ROM AM_REGION("maincpu", 0x400<<1)  /* Exec ROM, 10-bits wide */
737737   AM_RANGE(0x1000, 0x1fff) AM_ROM AM_REGION("maincpu", 0x1000<<1) /* Exec ROM, 10-bits wide */
r22781r22782
749749   AM_RANGE(0x0000, 0x003f) AM_READWRITE( intv_stic_r, intv_stic_w )
750750   AM_RANGE(0x0080, 0x0081) AM_DEVREADWRITE_LEGACY("sp0256_speech", spb640_r, spb640_w ) /* Intellivoice */
751751   // AM_RANGE(0x00E0, 0x00E3) AM_READWRITE( intv_ecs_uart_r, intv_ecs_uart_w )
752   AM_RANGE(0x00f0, 0x00ff) AM_DEVREADWRITE8_LEGACY("ay8914.2", ay8914_r, ay8914_w, 0x00ff ) /* ecs psg */
752   AM_RANGE(0x00f0, 0x00ff) AM_DEVREADWRITE8("ay8914.2", ay8914_device, read, write, 0x00ff ) /* ecs psg */
753753   AM_RANGE(0x0100, 0x01ef) AM_READWRITE( intv_ram8_r, intv_ram8_w )
754   AM_RANGE(0x01f0, 0x01ff) AM_DEVREADWRITE8_LEGACY("ay8914.1", ay8914_r, ay8914_w, 0x00ff )
754   AM_RANGE(0x01f0, 0x01ff) AM_DEVREADWRITE8("ay8914.1", ay8914_device, read, write, 0x00ff )
755755   AM_RANGE(0x0200, 0x035f) AM_READWRITE( intv_ram16_r, intv_ram16_w )
756756   AM_RANGE(0x1000, 0x1fff) AM_ROM AM_REGION("maincpu", 0x1000<<1) /* Exec ROM, 10-bits wide */
757757   AM_RANGE(0x2000, 0x2fff) AM_READ_BANK("bank1") AM_WRITE( ecs_bank1_page_select );
r22781r22782
773773   AM_RANGE(0x0000, 0x003f) AM_READWRITE( intv_stic_r, intv_stic_w )
774774   AM_RANGE(0x0080, 0x0081) AM_DEVREADWRITE_LEGACY("sp0256_speech", spb640_r, spb640_w ) /* Intellivoice */
775775   AM_RANGE(0x0100, 0x01ef) AM_READWRITE( intv_ram8_r, intv_ram8_w )
776   AM_RANGE(0x01f0, 0x01ff) AM_DEVREADWRITE8_LEGACY("ay8914.1", ay8914_r, ay8914_w, 0x00ff )
776   AM_RANGE(0x01f0, 0x01ff) AM_DEVREADWRITE8("ay8914.1", ay8914_device, read, write, 0x00ff )
777777   AM_RANGE(0x0200, 0x035f) AM_READWRITE( intv_ram16_r, intv_ram16_w )
778778   AM_RANGE(0x1000, 0x1fff) AM_ROM AM_REGION("maincpu", 0x1000<<1) /* Exec ROM, 10-bits wide */
779779   AM_RANGE(0x3000, 0x37ff) AM_ROM AM_REGION("maincpu", 0x3000<<1) /* GROM,     8-bits wide */
trunk/src/mess/drivers/atm.c
r22781r22782
127127   AM_RANGE(0x00fe, 0x00fe) AM_READWRITE(spectrum_port_fe_r,spectrum_port_fe_w) AM_MIRROR(0xff00) AM_MASK(0xffff)
128128   AM_RANGE(0x00ff, 0x00ff) AM_DEVREADWRITE_LEGACY(BETA_DISK_TAG, betadisk_state_r, betadisk_param_w) AM_MIRROR(0xff00)
129129   AM_RANGE(0x4000, 0x4000) AM_WRITE(atm_port_7ffd_w)  AM_MIRROR(0x3ffd)
130   AM_RANGE(0x8000, 0x8000) AM_DEVWRITE_LEGACY("ay8912", ay8910_data_w) AM_MIRROR(0x3ffd)
131   AM_RANGE(0xc000, 0xc000) AM_DEVREADWRITE_LEGACY("ay8912", ay8910_r, ay8910_address_w) AM_MIRROR(0x3ffd)
130   AM_RANGE(0x8000, 0x8000) AM_DEVWRITE("ay8912", ay8910_device, data_w) AM_MIRROR(0x3ffd)
131   AM_RANGE(0xc000, 0xc000) AM_DEVREADWRITE("ay8912", ay8910_device, data_r, address_w) AM_MIRROR(0x3ffd)
132132ADDRESS_MAP_END
133133
134134MACHINE_RESET_MEMBER(atm_state,atm)
trunk/src/mess/drivers/specpls3.c
r22781r22782
326326   AM_RANGE(0x0000, 0x0000) AM_READWRITE(spectrum_port_fe_r,spectrum_port_fe_w) AM_MIRROR(0xfffe) AM_MASK(0xffff)
327327   AM_RANGE(0x001f, 0x001f) AM_READ(spectrum_port_1f_r) AM_MIRROR(0xff00)
328328   AM_RANGE(0x4000, 0x4000) AM_WRITE(spectrum_plus3_port_7ffd_w) AM_MIRROR(0x3ffd)
329   AM_RANGE(0x8000, 0x8000) AM_DEVWRITE_LEGACY("ay8912", ay8910_data_w) AM_MIRROR(0x3ffd)
330   AM_RANGE(0xc000, 0xc000) AM_DEVREADWRITE_LEGACY("ay8912", ay8910_r, ay8910_address_w) AM_MIRROR(0x3ffd)
329   AM_RANGE(0x8000, 0x8000) AM_DEVWRITE("ay8912", ay8910_device, data_w) AM_MIRROR(0x3ffd)
330   AM_RANGE(0xc000, 0xc000) AM_DEVREADWRITE("ay8912", ay8910_device, data_r, address_w) AM_MIRROR(0x3ffd)
331331   AM_RANGE(0x1000, 0x1000) AM_WRITE(spectrum_plus3_port_1ffd_w) AM_MIRROR(0x0ffd)
332332   AM_RANGE(0x2000, 0x2000) AM_READ(spectrum_plus3_port_2ffd_r) AM_MIRROR(0x0ffd)
333333   AM_RANGE(0x3000, 0x3000) AM_READWRITE(spectrum_plus3_port_3ffd_r,spectrum_plus3_port_3ffd_w) AM_MIRROR(0x0ffd)

Previous 199869 Revisions Next


© 1997-2024 The MAME Team