Previous 199869 Revisions Next

r17962 Monday 17th September, 2012 at 07:43:37 UTC by Aaron Giles
Memory handler normalization, part 1.
READ/WRITE_DEVICE*_HANDLERs are now passed an
address_space &, and the 8-bit variants get a mem_mask
as well. This means they are now directly compatible
with the member function delegates. Added a generic
address space to the driver_device that can be used
when no specific address space is available. Also
added DECLARE_READ/WRITE_DEVICE*_HANDLER macros to
declare device callbacks with default mem_mask
parameters. [Aaron Giles]
[src/emu]addrmap.c addrmap.h devcb.c devcb.h devconv.h dimemory.c driver.c driver.h memory.c memory.h
[src/emu/cpu/arm7]arm7.c arm7ops.c
[src/emu/cpu/cubeqcpu]cubeqcpu.h
[src/emu/cpu/esrip]esrip.c
[src/emu/cpu/m68000]68307ser.c
[src/emu/cpu/powerpc]ppccom.c
[src/emu/cpu/rsp]rspdrc.c
[src/emu/cpu/tms0980]tms0980.c
[src/emu/imagedev]flopdrv.h
[src/emu/machine]6525tpi.h 6526cia.h 6532riot.h 68681.h 74123.c 74123.h 8237dma.h 8257dma.h adc1213x.h at28c16.h ds2404.h f3853.h i8243.h idectrl.h ins8154.h k033906.h k053252.h k056230.h latch8.c latch8.h mb14241.h pd4990a.h pic8259.h pit8253.h rp5h01.h s3c2410.h s3c24xx.c smc91c9x.h timekpr.h tms6100.h upd4701.h wd17xx.c wd17xx.h z80dart.c z80dart.h z80dma.h z80sio.c z80sio.h z80sti.h
[src/emu/sound]2151intf.c 2151intf.h 2203intf.c 2203intf.h 2413intf.c 2413intf.h 2608intf.c 2608intf.h 2610intf.c 2610intf.h 2612intf.c 2612intf.h 262intf.c 262intf.h 3526intf.c 3526intf.h 3812intf.c 3812intf.h 8950intf.c 8950intf.h aica.c aica.h astrocde.h ay8910.c ay8910.h c140.h c6280.h digitalk.h discrete.h es5506.h es8712.h gaelco.h ics2115.h iremga20.h k005289.h k007232.h k051649.c k051649.h k053260.h k056800.h msm5232.c msm5232.h multipcm.h n63701x.h namco.c namco.h nes_apu.h nile.h okim6258.h okim6376.h qsound.h rf5c400.h rf5c68.h saa1099.h scsp.c scsp.h segapcm.h sn76496.h snkwave.h sp0250.h sp0256.c sp0256.h st0016.h t6w28.h tiaintf.h tms5110.h tms5220.h upd7759.h vlm5030.h vrender0.h x1_010.c x1_010.h ym2151.c ym2151.h ymf271.h ymf278b.h ymz280b.h zsg2.h
[src/emu/video]hd63484.h i8275.h pc_vga.h s2636.h tlc34076.h tms9927.c tms9927.h voodoo.c voodoo.h
[src/mame/audio]8080bw.c asteroid.c atarijsa.c avalnche.c blockade.c bsktball.c bzone.c canyon.c carnival.c circus.c copsnrob.c crbaloon.c dkong.c exidy.c exidy.h firetrk.c galaxian.c galaxian.h gottlieb.c hyprolyb.h irem.c jedi.c leland.c llander.c m72.h m79amb.c mario.c micro3d.c midway.c mw8080bw.c namco52.c namco52.h namco54.c namco54.h orbit.c phoenix.c pleiads.h poolshrk.c qix.c redalert.c scramble.c segag80r.c segasnd.h seibu.h skyraid.c snes_snd.c snes_snd.h snk6502.c spiders.c sprint8.c subs.c taitosnd.h trackfld.h vicdual.c wiping.h
[src/mame/drivers]40love.c 4enraya.c 5clown.c 88games.c aliens.c amspdwy.c aristmk4.c asterix.c atarisy1.c atarisy2.c bagman.c berzerk.c bfcobra.c bfm_sc1.c bfm_sc2.c bfm_sc4h.c bigevglf.c bishi.c blockhl.c bogeyman.c bottom9.c buggychl.c bzone.c calchase.c cd32.c centiped.c cham24.c cidelsa.c circusc.c cliffhgr.c cninja.c contra.c crbaloon.c crimfght.c cubeqst.c cvs.c cybertnk.c dambustr.c darius.c dblewing.c djmain.c dkong.c dlair.c dogfgt.c dragrace.c drw80pkr.c dynadice.c dynax.c equites.c esripsys.c ettrivia.c exterm.c famibox.c fastlane.c fgoal.c firetrk.c flstory.c funkball.c fuukifg3.c gaelco3d.c galaxian.c gamecstl.c gbusters.c ghosteo.c goldnpkr.c gradius3.c grchamp.c gsword.c gticlub.c gyruss.c highvdeo.c hitme.c homedata.c homerun.c hornet.c icecold.c igs011.c ironhors.c jpmimpct.c jpmsys5.c kaneko16.c kinst.c kncljoe.c ksys573.c labyrunr.c ladyfrog.c laserbat.c lethal.c m10.c m63.c m72.c m90.c madalien.c mainevt.c malzak.c maygay1b.c mcr.c mediagx.c mermaid.c metro.c mexico86.c midqslvr.c midzeus.c mirage.c mirax.c mlanding.c model2.c model3.c mpu4hw.c msisaac.c multfish.c multigam.c munchmo.c mw8080bw.c mystston.c namcona1.c namcos86.c neogeo.c neoprint.c ninjaw.c norautp.c nss.c nwk-tr.c nycaptor.c nyny.c orbit.c othello.c othunder.c overdriv.c pacman.c parodius.c playch10.c polepos.c ppmast93.c prehisle.c proconn.c qdrmfgp.c queen.c r2dtank.c rbmk.c rollerg.c royalmah.c rpunch.c sauro.c savquest.c seattle.c segac2.c segag80r.c segag80v.c segas16a.c segas16b.c seta.c sfcbox.c shanghai.c sigmab52.c skeetsht.c skydiver.c slapshot.c snesb.c snk.c snk68.c spiders.c sprint2.c sprint4.c spy.c starshp1.c surpratk.c system1.c taito_b.c taito_h.c taito_l.c taito_z.c taitogn.c taitowlf.c tank8.c thunderx.c tmnt.c toaplan2.c topspeed.c triplhnt.c uapce.c ultratnk.c ultrsprt.c vega.c vegas.c vendetta.c vertigo.c videopin.c videopkr.c viper.c vmetal.c voyager.c vsnes.c warpwarp.c warriorb.c wecleman.c wgp.c wiz.c xtom3d.c zaccaria.c zn.c
[src/mame/includes]8080bw.h asteroid.h atari.h avalnche.h beezer.h blockade.h bsktball.h bzone.h canyon.h cd32.h cps3.h crbaloon.h dc.h firetrk.h flower.h gaelco2.h gomoku.h gridlee.h hanaawas.h harddriv.h homerun.h leland.h m79amb.h mario.h mcr.h megadriv.h micro3d.h mw8080bw.h n64.h orbit.h phoenix.h polepos.h poolshrk.h qix.h scramble.h segas16a.h simpsons.h skyraid.h spiders.h sprint8.h stfight.h subs.h suna8.h system1.h tatsumi.h tiamc1.h turbo.h tx1.h vectrex.h warpwarp.h xxmissio.h zaxxon.h
[src/mame/machine]amiga.c archimds.c atarifb.c beezer.c buggychl.h cd32.c cdicdic.h cdislave.h dc.c gaelco3d.h konppc.c konppc.h leland.c mathbox.h mcr.c mcr68.c megadriv.c megavdp.c mhavoc.c midwayic.c midwayic.h namco06.c namco06.h namco50.h namco51.h namco53.h namco62.h namcoio.h namcos1.c nitedrvr.c nmk004.c nmk112.c nmk112.h playch10.c qix.c simpsons.c snes.c taitoio.c taitoio.h tatsumi.c vectrex.c williams.c
[src/mame/video]astrocde.c atarirle.h boogwing.c btoads.c cbuster.c cninja.c combatsc.c contra.c dassault.c dec0.c decbac06.c decbac06.h deco16ic.c deco16ic.h decocomn.h dietgo.c dkong.c fastlane.c flkatck.c funkyjet.c gp9001.c gp9001.h gradius3.c groundfx.c hcastle.c itech8.c kan_pand.h konicdev.c konicdev.h labyrunr.c naughtyb.c phoenix.c pktgaldx.c rohga.c seta001.h simpsons.c skydiver.c slapshot.c sprint4.c subs.c supbtime.c taito_b.c taito_f2.c taito_h.c taito_o.c taitoair.c taitoic.c taitoic.h tia.c triplhnt.c tumblep.c ultratnk.c undrfire.c vaportra.c vectrex.c xmen.c
[src/mess/audio]dave.c dave.h gb.h mea8000.c mea8000.h t6721.h upd1771.h
[src/mess/drivers]abc1600.c abc80x.c ace.c ami1200.c amiga.c apf.c apollo.c apricot.c at.c bebox.c bigbord2.c bml3.c c128.c c64.c c65.c elwro800.c exelv.c fm7.c fmtowns.c gba.c homelab.c ip22.c m20.c mikromik.c msx.c multi8.c mz2000.c mz2500.c mz6500.c nanos.c nascom1.c nes.c ng_aes.c ngp.c osi.c p8k.c palm.c pasopia7.c pc1512.c pc8801.c pc88va.c pc9801.c pcm.c pcw.c pes.c plus4.c ptcsol.c ql.c rt1715.c smc777.c snes.c sorcerer.c specpls3.c ssystem3.c svision.c trs80.c trs80m2.c vic10.c vidbrain.c vip.c vixen.c vt100.c wangpc.c x1.c x1twin.c x68k.c z100.c z80ne.c
[src/mess/formats]m65_snqk.c spec_snqk.c
[src/mess/includes]amstrad.h apollo.h c16.h c64.h c64_legacy.h cbmb.h cgenie.h kaypro.h mc68328.h msx.h mtx.h nascom1.h pc.h pokemini.h svision.h vic10.h wswan.h z80ne.h
[src/mess/machine]3c505.h 990_tap.h a2diskii.c a2echoii.c a2mockingboard.c a7800.c abc77.c aim65.c amigacd.c amigacd.h amstr_pc.c amstrad.c apollo.c apollo_kbd.c apollo_kbd.h apple1.c apple2gs.c apple3.c applefdc.h ataridev.h ay31015.c ay31015.h bbc.c bebox.c beta.c beta.h c128.c c1551.c c64.c c64_currah_speech.c c64_ieee488.c c64_sfx_sound_expander.c c65.c cgenie.c coco_fdc.c compis.c comx_fd.c concept.c cpc_ssa1.c dai.c dgn_beta.c dgnalpha.c ds1315.h e05a03.h gb.c hd63450.h hec2hrp.c hecdisk2.c i8271.c i8271.h iq151_disc2.c isa_adlib.c isa_fdc.c isa_gblaster.c isa_hdc.c isa_ibm_mfc.c isa_ide.c isa_sblaster.c kaypro.c kr2376.c kr2376.h lisa.c lux10828.c mac.c macpci.c mbc55x.c mc68328.c mc68328.h mc6843.h mc6846.c mc6846.h mc6854.h mc80.c micropolis.c micropolis.h mm58274c.h mos6530.h msx.c msx_slot.c mtx.c mz700.c nes_pcb.c odyssey2.c omti8621.c omti8621.h oric.c orion.c osborne1.c partner.c pc.c pc_fdc.c pc_fdc.h pc_lpt.c pc_lpt.h pk8020.c pmd85.c rmnimbus.c s100.c s100.h s100_dj2db.c s100_dj2db.h s100_mm65k16s.c s100_mm65k16s.h s100_wunderbus.c s100_wunderbus.h s3c44b0.c sc499.h sms.c southbridge.c super80.c svi318.c thomflop.c thomson.c trs80.c tvc_hbf.c upd7002.h upd71071.c upd71071.h upd765.c upd765.h v1050kb.c wswan.c z80ne.c
[src/mess/machine/ti99]bwg.c genboard.c hfdc.c ti_fdc.c
[src/mess/video]733_asr.h 911_vdt.h dl1416.h isa_mda.c k1ge.h vdc8563.h vic4567.h vic6567.h vtvideo.h x68k.c

trunk/src/mame/audio/micro3d.c
r17961r17962
395395
396396WRITE8_DEVICE_HANDLER( micro3d_upd7759_w )
397397{
398   upd7759_port_w(device, 0, data);
398   upd7759_port_w(device, space, 0, data);
399399   upd7759_start_w(device, 0);
400400   upd7759_start_w(device, 1);
401401}
trunk/src/mame/audio/phoenix.c
r17961r17962
494494{
495495   phoenix_sound_state *state = get_safe_token(device);
496496
497   discrete_sound_w(state->m_discrete, PHOENIX_EFFECT_2_DATA, data & 0x0f);
498   discrete_sound_w(state->m_discrete, PHOENIX_EFFECT_2_FREQ, (data & 0x30) >> 4);
497   discrete_sound_w(state->m_discrete, space, PHOENIX_EFFECT_2_DATA, data & 0x0f);
498   discrete_sound_w(state->m_discrete, space, PHOENIX_EFFECT_2_FREQ, (data & 0x30) >> 4);
499499#if 0
500500   /* future handling of noise sounds */
501   discrete_sound_w(state->m_discrete, PHOENIX_EFFECT_3_EN  , data & 0x40);
502   discrete_sound_w(state->m_discrete, PHOENIX_EFFECT_4_EN  , data & 0x80);
501   discrete_sound_w(state->m_discrete, space, PHOENIX_EFFECT_3_EN  , data & 0x40);
502   discrete_sound_w(state->m_discrete, space, PHOENIX_EFFECT_4_EN  , data & 0x80);
503503#endif
504504   state->m_channel->update();
505505   state->m_sound_latch_a = data;
r17961r17962
526526{
527527   phoenix_sound_state *state = get_safe_token(device);
528528
529   discrete_sound_w(state->m_discrete, PHOENIX_EFFECT_1_DATA, data & 0x0f);
530   discrete_sound_w(state->m_discrete, PHOENIX_EFFECT_1_FILT, data & 0x20);
531   discrete_sound_w(state->m_discrete, PHOENIX_EFFECT_1_FREQ, data & 0x10);
529   discrete_sound_w(state->m_discrete, space, PHOENIX_EFFECT_1_DATA, data & 0x0f);
530   discrete_sound_w(state->m_discrete, space, PHOENIX_EFFECT_1_FILT, data & 0x20);
531   discrete_sound_w(state->m_discrete, space, PHOENIX_EFFECT_1_FREQ, data & 0x10);
532532
533533   /* update the tune that the MM6221AA is playing */
534534   mm6221aa_tune_w(state->m_tms, data >> 6);
trunk/src/mame/audio/avalnche.c
r17961r17962
2222
2323WRITE8_DEVICE_HANDLER( avalnche_noise_amplitude_w )
2424{
25   discrete_sound_w(device, AVALNCHE_SOUNDLVL_DATA, data & 0x3f);
25   discrete_sound_w(device, space, AVALNCHE_SOUNDLVL_DATA, data & 0x3f);
2626}
2727
2828WRITE8_DEVICE_HANDLER( avalnche_attract_enable_w )
2929{
30   discrete_sound_w(device, AVALNCHE_ATTRACT_EN, data & 0x01);
30   discrete_sound_w(device, space, AVALNCHE_ATTRACT_EN, data & 0x01);
3131}
3232
3333WRITE8_DEVICE_HANDLER( avalnche_audio_w )
r17961r17962
3737   switch (offset & 0x07)
3838   {
3939   case 0x00:      /* AUD0 */
40      discrete_sound_w(device, AVALNCHE_AUD0_EN, bit);
40      discrete_sound_w(device, space, AVALNCHE_AUD0_EN, bit);
4141      break;
4242
4343   case 0x01:      /* AUD1 */
44      discrete_sound_w(device, AVALNCHE_AUD1_EN, bit);
44      discrete_sound_w(device, space, AVALNCHE_AUD1_EN, bit);
4545      break;
4646
4747   case 0x02:      /* AUD2 */
4848   default:
49      discrete_sound_w(device, AVALNCHE_AUD2_EN, bit);
49      discrete_sound_w(device, space, AVALNCHE_AUD2_EN, bit);
5050      break;
5151   }
5252}
trunk/src/mame/audio/galaxian.c
r17961r17962
408408/* IC 9J */
409409WRITE8_DEVICE_HANDLER( galaxian_pitch_w )
410410{
411   discrete_sound_w(device, GAL_INP_PITCH, data );
411   discrete_sound_w(device, space, GAL_INP_PITCH, data );
412412}
413413
414414WRITE8_DEVICE_HANDLER( galaxian_lfo_freq_w )
r17961r17962
418418   if (lfo_val != lfo_val_new)
419419   {
420420      lfo_val = lfo_val_new;
421      discrete_sound_w(device, GAL_INP_BG_DAC, lfo_val);
421      discrete_sound_w(device, space, GAL_INP_BG_DAC, lfo_val);
422422   }
423423}
424424
425425WRITE8_DEVICE_HANDLER( galaxian_background_enable_w )
426426{
427   discrete_sound_w(device, NODE_RELATIVE(GAL_INP_FS1, offset), data & 0x01);
427   discrete_sound_w(device, space, NODE_RELATIVE(GAL_INP_FS1, offset), data & 0x01);
428428}
429429
430430WRITE8_DEVICE_HANDLER( galaxian_noise_enable_w )
431431{
432   discrete_sound_w(device, GAL_INP_HIT, data & 0x01);
432   discrete_sound_w(device, space, GAL_INP_HIT, data & 0x01);
433433}
434434
435435WRITE8_DEVICE_HANDLER( galaxian_vol_w )
436436{
437   discrete_sound_w(device, NODE_RELATIVE(GAL_INP_VOL1,offset), data & 0x01);
437   discrete_sound_w(device, space, NODE_RELATIVE(GAL_INP_VOL1,offset), data & 0x01);
438438}
439439
440440/* FIXME: rename to fire to be consistent */
441441WRITE8_DEVICE_HANDLER( galaxian_shoot_enable_w )
442442{
443   discrete_sound_w(device, GAL_INP_FIRE, data & 0x01);
443   discrete_sound_w(device, space, GAL_INP_FIRE, data & 0x01);
444444}
445445
446446/* FIXME: May be replaced by one call! */
r17961r17962
452452      case 0:      /* FS1 (controls 555 timer at 8R) */
453453      case 1:      /* FS2 (controls 555 timer at 8S) */
454454      case 2:      /* FS3 (controls 555 timer at 8T) */
455         galaxian_background_enable_w(device, offset, data);
455         galaxian_background_enable_w(device, space, offset, data);
456456         break;
457457
458458      case 3:      /* HIT */
459         galaxian_noise_enable_w(device, 0, data);
459         galaxian_noise_enable_w(device, space, 0, data);
460460         break;
461461
462462      case 4:      /* n/c */
463463         break;
464464
465465      case 5:      /* FIRE */
466         galaxian_shoot_enable_w(device, 0, data);
466         galaxian_shoot_enable_w(device, space, 0, data);
467467         break;
468468
469469      case 6:      /* VOL1 */
470470      case 7:      /* VOL2 */
471         galaxian_vol_w(device, offset & 1, data);
471         galaxian_vol_w(device, space, offset & 1, data);
472472         break;
473473   }
474474}
trunk/src/mame/audio/galaxian.h
r17961r17962
33MACHINE_CONFIG_EXTERN( mooncrst_audio );
44MACHINE_CONFIG_EXTERN( galaxian_audio );
55
6WRITE8_DEVICE_HANDLER( galaxian_sound_w );
7WRITE8_DEVICE_HANDLER( galaxian_pitch_w );
8WRITE8_DEVICE_HANDLER( galaxian_vol_w );
9WRITE8_DEVICE_HANDLER( galaxian_noise_enable_w );
10WRITE8_DEVICE_HANDLER( galaxian_background_enable_w );
11WRITE8_DEVICE_HANDLER( galaxian_shoot_enable_w );
12WRITE8_DEVICE_HANDLER( galaxian_lfo_freq_w );
6DECLARE_WRITE8_DEVICE_HANDLER( galaxian_sound_w );
7DECLARE_WRITE8_DEVICE_HANDLER( galaxian_pitch_w );
8DECLARE_WRITE8_DEVICE_HANDLER( galaxian_vol_w );
9DECLARE_WRITE8_DEVICE_HANDLER( galaxian_noise_enable_w );
10DECLARE_WRITE8_DEVICE_HANDLER( galaxian_background_enable_w );
11DECLARE_WRITE8_DEVICE_HANDLER( galaxian_shoot_enable_w );
12DECLARE_WRITE8_DEVICE_HANDLER( galaxian_lfo_freq_w );
1313
trunk/src/mame/audio/atarijsa.c
r17961r17962
269269
270270      case 0x200:      /* /VOICE */
271271         if (tms5220 != NULL)
272            tms5220_data_w(tms5220, 0, data);
272            tms5220_data_w(tms5220, *space, 0, data);
273273         break;
274274
275275      case 0x202:      /* /WRP */
trunk/src/mame/audio/namco52.c
r17961r17962
104104static WRITE8_HANDLER( namco_52xx_P_w )
105105{
106106   namco_52xx_state *state = get_safe_token(space->device().owner());
107   discrete_sound_w(state->m_discrete, NAMCO_52XX_P_DATA(state->m_basenode), data & 0x0f);
107   discrete_sound_w(state->m_discrete, *space, NAMCO_52XX_P_DATA(state->m_basenode), data & 0x0f);
108108}
109109
110110static WRITE8_HANDLER( namco_52xx_R2_w )
trunk/src/mame/audio/namco52.h
r17961r17962
2121   MCFG_DEVICE_CONFIG(_interface)
2222
2323
24WRITE8_DEVICE_HANDLER( namco_52xx_write );
24DECLARE_WRITE8_DEVICE_HANDLER( namco_52xx_write );
2525
2626
2727class namco_52xx_device : public device_t
trunk/src/mame/audio/asteroid.c
r17961r17962
280280
281281WRITE8_DEVICE_HANDLER( asteroid_explode_w )
282282{
283   discrete_sound_w(device,ASTEROID_EXPLODE_DATA,(data&0x3c)>>2);            // Volume
283   discrete_sound_w(device,space,ASTEROID_EXPLODE_DATA,(data&0x3c)>>2);            // Volume
284284   /* We will modify the pitch data to send the divider value. */
285285   switch ((data&0xc0))
286286   {
r17961r17962
297297         data = 5;
298298         break;
299299   }
300   discrete_sound_w(device,ASTEROID_EXPLODE_PITCH, data);
300   discrete_sound_w(device, space, ASTEROID_EXPLODE_PITCH, data);
301301}
302302
303303WRITE8_DEVICE_HANDLER( asteroid_thump_w )
304304{
305   discrete_sound_w(device, ASTEROID_THUMP_EN,   data & 0x10);
306   discrete_sound_w(device, ASTEROID_THUMP_DATA, data & 0x0f);
305   discrete_sound_w(device, space, ASTEROID_THUMP_EN,   data & 0x10);
306   discrete_sound_w(device, space, ASTEROID_THUMP_DATA, data & 0x0f);
307307}
308308
309309WRITE8_DEVICE_HANDLER( asteroid_sounds_w )
310310{
311   discrete_sound_w(device, NODE_RELATIVE(ASTEROID_SAUCER_SND_EN, offset), data & 0x80);
311   discrete_sound_w(device, space, NODE_RELATIVE(ASTEROID_SAUCER_SND_EN, offset), data & 0x80);
312312}
313313
314314WRITE8_DEVICE_HANDLER( astdelux_sounds_w )
315315{
316316   /* Only ever activates the thrusters in Astdelux */
317   discrete_sound_w(device, ASTEROID_THRUST_EN, data & 0x80);
317   discrete_sound_w(device, space, ASTEROID_THRUST_EN, data & 0x80);
318318}
319319
320320WRITE8_DEVICE_HANDLER( asteroid_noise_reset_w )
321321{
322   discrete_sound_w(device, ASTEROID_NOISE_RESET, 0);
322   discrete_sound_w(device, space, ASTEROID_NOISE_RESET, 0);
323323}
trunk/src/mame/audio/bzone.c
r17961r17962
389389
390390WRITE8_DEVICE_HANDLER( bzone_sounds_w )
391391{
392   discrete_sound_w(device, BZ_INPUT, data);
392   discrete_sound_w(device, space, BZ_INPUT, data);
393393
394394   output_set_value("startled", (data >> 6) & 1);
395395   device->machine().sound().system_enable(data & 0x20);
trunk/src/mame/audio/copsnrob.c
r17961r17962
704704   switch (offset)
705705   {
706706      case 0x00:
707         discrete_sound_w(device, COPSNROB_MOTOR3_INV, special_data);
707         discrete_sound_w(device, space, COPSNROB_MOTOR3_INV, special_data);
708708         break;
709709
710710      case 0x01:
711         discrete_sound_w(device, COPSNROB_MOTOR2_INV, special_data);
711         discrete_sound_w(device, space, COPSNROB_MOTOR2_INV, special_data);
712712         break;
713713
714714      case 0x02:
715         discrete_sound_w(device, COPSNROB_MOTOR1_INV, special_data);
715         discrete_sound_w(device, space, COPSNROB_MOTOR1_INV, special_data);
716716         break;
717717
718718      case 0x03:
719         discrete_sound_w(device, COPSNROB_MOTOR0_INV, special_data);
719         discrete_sound_w(device, space, COPSNROB_MOTOR0_INV, special_data);
720720         break;
721721
722722      case 0x04:
723         discrete_sound_w(device, COPSNROB_SCREECH_INV, special_data);
723         discrete_sound_w(device, space, COPSNROB_SCREECH_INV, special_data);
724724         break;
725725
726726      case 0x05:
727         discrete_sound_w(device, COPSNROB_CRASH_INV, special_data);
727         discrete_sound_w(device, space, COPSNROB_CRASH_INV, special_data);
728728         break;
729729
730730      case 0x06:
r17961r17962
733733         break;
734734
735735      case 0x07:
736         discrete_sound_w(device, COPSNROB_AUDIO_ENABLE, special_data);
736         discrete_sound_w(device, space, COPSNROB_AUDIO_ENABLE, special_data);
737737         //machine().sound().system_mute(special_data);
738738         break;
739739
trunk/src/mame/audio/segasnd.h
r17961r17962
66
77MACHINE_CONFIG_EXTERN( sega_speech_board );
88
9WRITE8_DEVICE_HANDLER( sega_speech_data_w );
10WRITE8_DEVICE_HANDLER( sega_speech_control_w );
9DECLARE_WRITE8_DEVICE_HANDLER( sega_speech_data_w );
10DECLARE_WRITE8_DEVICE_HANDLER( sega_speech_control_w );
1111
1212
1313
1414MACHINE_CONFIG_EXTERN( sega_universal_sound_board );
1515MACHINE_CONFIG_EXTERN( sega_universal_sound_board_rom );
1616
17READ8_DEVICE_HANDLER( sega_usb_status_r );
18WRITE8_DEVICE_HANDLER( sega_usb_data_w );
19READ8_DEVICE_HANDLER( sega_usb_ram_r );
20WRITE8_DEVICE_HANDLER( sega_usb_ram_w );
17DECLARE_READ8_DEVICE_HANDLER( sega_usb_status_r );
18DECLARE_WRITE8_DEVICE_HANDLER( sega_usb_data_w );
19DECLARE_READ8_DEVICE_HANDLER( sega_usb_ram_r );
20DECLARE_WRITE8_DEVICE_HANDLER( sega_usb_ram_w );
trunk/src/mame/audio/taitosnd.h
r17961r17962
4848***************************************************************************/
4949
5050/* MASTER (8bit bus) control functions */
51WRITE8_DEVICE_HANDLER( tc0140syt_port_w );
52WRITE8_DEVICE_HANDLER( tc0140syt_comm_w );
53READ8_DEVICE_HANDLER( tc0140syt_comm_r );
51DECLARE_WRITE8_DEVICE_HANDLER( tc0140syt_port_w );
52DECLARE_WRITE8_DEVICE_HANDLER( tc0140syt_comm_w );
53DECLARE_READ8_DEVICE_HANDLER( tc0140syt_comm_r );
5454
5555
5656/* SLAVE (8bit bus) control functions ONLY */
57WRITE8_DEVICE_HANDLER( tc0140syt_slave_port_w );
58READ8_DEVICE_HANDLER( tc0140syt_slave_comm_r );
59WRITE8_DEVICE_HANDLER( tc0140syt_slave_comm_w );
57DECLARE_WRITE8_DEVICE_HANDLER( tc0140syt_slave_port_w );
58DECLARE_READ8_DEVICE_HANDLER( tc0140syt_slave_comm_r );
59DECLARE_WRITE8_DEVICE_HANDLER( tc0140syt_slave_comm_w );
6060
6161
6262#endif /*__TAITOSND_H__*/
trunk/src/mame/audio/carnival.c
r17961r17962
274274         break;
275275
276276      case PSG_BC_WRITE:
277         ay8910_data_w( device, 0, psgData );
277         ay8910_data_w( device, space, 0, psgData );
278278         break;
279279
280280      case PSG_BC_LATCH_ADDRESS:
281         ay8910_address_w( device, 0, psgData );
281         ay8910_address_w( device, space, 0, psgData );
282282         break;
283283      }
284284   }
trunk/src/mame/audio/leland.c
r17961r17962
307307
308308static void set_dac_frequency(leland_sound_state *state, int which, int frequency);
309309
310static READ16_DEVICE_HANDLER( peripheral_r );
311static WRITE16_DEVICE_HANDLER( peripheral_w );
310static DECLARE_READ16_DEVICE_HANDLER( peripheral_r );
311static DECLARE_WRITE16_DEVICE_HANDLER( peripheral_w );
312312
313313
314314
r17961r17962
14411441
14421442   /* handle partials */
14431443   if (!ACCESSING_BITS_8_15)
1444      data = (i80186_internal_port_r(device, offset, 0xff00) & 0xff00) | (data & 0x00ff);
1444      data = (i80186_internal_port_r(device, space, offset, 0xff00) & 0xff00) | (data & 0x00ff);
14451445   else if (!ACCESSING_BITS_0_7)
1446      data = (i80186_internal_port_r(device, offset, 0x00ff) & 0x00ff) | (data & 0xff00);
1446      data = (i80186_internal_port_r(device, space, offset, 0x00ff) & 0x00ff) | (data & 0xff00);
14471447
14481448   switch (offset)
14491449   {
r17961r17962
21182118      case 0x01:
21192119      case 0x02:
21202120         if (ACCESSING_BITS_0_7)
2121            dac_w(device, offset, data, 0x00ff);
2121            dac_w(device, space, offset, data, 0x00ff);
21222122         return;
21232123
21242124      case 0x03:
2125         dac_w(device, 0, ((data << 13) & 0xe000) | ((data << 10) & 0x1c00) | ((data << 7) & 0x0300), 0xff00);
2126         dac_w(device, 2, ((data << 10) & 0xe000) | ((data <<  7) & 0x1c00) | ((data << 4) & 0x0300), 0xff00);
2127         dac_w(device, 4, ((data <<  8) & 0xc000) | ((data <<  6) & 0x3000) | ((data << 4) & 0x0c00) | ((data << 2) & 0x0300), 0xff00);
2125         dac_w(device, space, 0, ((data << 13) & 0xe000) | ((data << 10) & 0x1c00) | ((data << 7) & 0x0300), 0xff00);
2126         dac_w(device, space, 2, ((data << 10) & 0xe000) | ((data <<  7) & 0x1c00) | ((data << 4) & 0x0300), 0xff00);
2127         dac_w(device, space, 4, ((data <<  8) & 0xc000) | ((data <<  6) & 0x3000) | ((data << 4) & 0x0c00) | ((data << 2) & 0x0300), 0xff00);
21282128         return;
21292129   }
21302130
r17961r17962
21592159            return;
21602160
21612161         case 0x21:
2162            dac_w(device, offset - 0x21 + 7, data, mem_mask);
2162            dac_w(device, space, offset - 0x21 + 7, data, mem_mask);
21632163            return;
21642164      }
21652165   }
r17961r17962
21952195            return ((state->m_clock_active << 1) & 0x7e);
21962196
21972197      case 1:
2198         return main_to_sound_comm_r(device, offset, mem_mask);
2198         return main_to_sound_comm_r(device, space, offset, mem_mask);
21992199
22002200      case 2:
2201         return pit8254_r(device, offset, mem_mask);
2201         return pit8254_r(device, space, offset, mem_mask);
22022202
22032203      case 3:
22042204         if (!state->m_has_ym2151)
2205            return pit8254_r(device, offset | 0x40, mem_mask);
2205            return pit8254_r(device, space, offset | 0x40, mem_mask);
22062206         else
2207            return ym2151_r(device->machine().device("ymsnd"), offset);
2207            return ym2151_r(device->machine().device("ymsnd"), space, offset);
22082208
22092209      case 4:
22102210         if (state->m_is_redline)
2211            return pit8254_r(device, offset | 0x80, mem_mask);
2211            return pit8254_r(device, space, offset | 0x80, mem_mask);
22122212         else
22132213            logerror("%05X:Unexpected peripheral read %d/%02X\n", state->m_i80186.cpu->safe_pc(), select, offset*2);
22142214         break;
r17961r17962
22302230   switch (select)
22312231   {
22322232      case 1:
2233         sound_to_main_comm_w(device, offset, data, mem_mask);
2233         sound_to_main_comm_w(device, space, offset, data, mem_mask);
22342234         break;
22352235
22362236      case 2:
2237         pit8254_w(device, offset, data, mem_mask);
2237         pit8254_w(device, space, offset, data, mem_mask);
22382238         break;
22392239
22402240      case 3:
22412241         if (!state->m_has_ym2151)
2242            pit8254_w(device, offset | 0x40, data, mem_mask);
2242            pit8254_w(device, space, offset | 0x40, data, mem_mask);
22432243         else
2244            ym2151_w(device->machine().device("ymsnd"), offset, data);
2244            ym2151_w(device->machine().device("ymsnd"), space, offset, data);
22452245         break;
22462246
22472247      case 4:
22482248         if (state->m_is_redline)
2249            pit8254_w(device, offset | 0x80, data, mem_mask);
2249            pit8254_w(device, space, offset | 0x80, data, mem_mask);
22502250         else
2251            dac_10bit_w(device, offset, data, mem_mask);
2251            dac_10bit_w(device, space, offset, data, mem_mask);
22522252         break;
22532253
22542254      case 5:   /* Ataxx/WSF/Indy Heat only */
2255         ataxx_dac_control(device, offset, data, mem_mask);
2255         ataxx_dac_control(device, space, offset, data, mem_mask);
22562256         break;
22572257
22582258      default:
r17961r17962
22762276               ((data & 0x02) << 5) |
22772277               ((data & 0x04) << 3) |
22782278               ((data & 0x08) << 1);
2279   leland_80186_control_w(device, offset, modified);
2279   leland_80186_control_w(device, space, offset, modified);
22802280}
22812281
22822282
trunk/src/mame/audio/poolshrk.c
r17961r17962
157157
158158WRITE8_DEVICE_HANDLER( poolshrk_scratch_sound_w )
159159{
160   discrete_sound_w(device, POOLSHRK_SCRATCH_SND, offset & 1);
160   discrete_sound_w(device, space, POOLSHRK_SCRATCH_SND, offset & 1);
161161}
162162
163163WRITE8_DEVICE_HANDLER( poolshrk_score_sound_w )
164164{
165   discrete_sound_w(device, POOLSHRK_SCORE_EN, 1); /* this will trigger the sound code for 1 sample */
165   discrete_sound_w(device, space, POOLSHRK_SCORE_EN, 1); /* this will trigger the sound code for 1 sample */
166166}
167167
168168WRITE8_DEVICE_HANDLER( poolshrk_click_sound_w )
169169{
170   discrete_sound_w(device, POOLSHRK_CLICK_EN, 1); /* this will trigger the sound code for 1 sample */
170   discrete_sound_w(device, space, POOLSHRK_CLICK_EN, 1); /* this will trigger the sound code for 1 sample */
171171}
172172
173173WRITE8_DEVICE_HANDLER( poolshrk_bump_sound_w )
174174{
175   discrete_sound_w(device, POOLSHRK_BUMP_EN, offset & 1);
175   discrete_sound_w(device, space, POOLSHRK_BUMP_EN, offset & 1);
176176}
trunk/src/mame/audio/wiping.h
r17961r17962
2222extern const device_type WIPING;
2323
2424
25WRITE8_DEVICE_HANDLER( wiping_sound_w );
25DECLARE_WRITE8_DEVICE_HANDLER( wiping_sound_w );
trunk/src/mame/audio/blockade.c
r17961r17962
3838
3939WRITE8_DEVICE_HANDLER( blockade_sound_freq_w )
4040{
41   discrete_sound_w(device,BLOCKADE_NOTE_DATA, data);
41   discrete_sound_w(device,space,BLOCKADE_NOTE_DATA, data);
4242   return;
4343}
4444
trunk/src/mame/audio/firetrk.c
r17961r17962
1616   state->m_skid[1] = 0;
1717
1818   // also SUPERBUG_SKID_EN
19   discrete_sound_w(device, FIRETRUCK_SKID_EN, 1);
19   discrete_sound_w(device, space, FIRETRUCK_SKID_EN, 1);
2020}
2121
2222
2323WRITE8_DEVICE_HANDLER( montecar_skid_reset_w )
2424{
25   discrete_sound_w(device, MONTECAR_SKID_EN, 1);
25   discrete_sound_w(device, space, MONTECAR_SKID_EN, 1);
2626}
2727
2828
2929WRITE8_DEVICE_HANDLER( firetrk_crash_snd_w )
3030{
3131   // also SUPERBUG_CRASH_DATA and MONTECAR_CRASH_DATA
32   discrete_sound_w(device, FIRETRUCK_CRASH_DATA, data >> 4);
32   discrete_sound_w(device, space, FIRETRUCK_CRASH_DATA, data >> 4);
3333}
3434
3535
3636WRITE8_DEVICE_HANDLER( firetrk_skid_snd_w )
3737{
3838   // also SUPERBUG_SKID_EN and MONTECAR_SKID_EN
39   discrete_sound_w(device, FIRETRUCK_SKID_EN, 0);
39   discrete_sound_w(device, space, FIRETRUCK_SKID_EN, 0);
4040}
4141
4242
4343WRITE8_DEVICE_HANDLER( firetrk_motor_snd_w )
4444{
4545   // also MONTECAR_DRONE_MOTOR_DATA
46   discrete_sound_w(device, FIRETRUCK_SIREN_DATA, data >> 4);
46   discrete_sound_w(device, space, FIRETRUCK_SIREN_DATA, data >> 4);
4747
4848   // also MONTECAR_MOTOR_DATA
49   discrete_sound_w(device, FIRETRUCK_MOTOR_DATA, data & 0x0f);
49   discrete_sound_w(device, space, FIRETRUCK_MOTOR_DATA, data & 0x0f);
5050}
5151
5252
5353WRITE8_DEVICE_HANDLER( superbug_motor_snd_w )
5454{
55   discrete_sound_w(device, SUPERBUG_SPEED_DATA, data & 0x0f);
55   discrete_sound_w(device, space, SUPERBUG_SPEED_DATA, data & 0x0f);
5656}
5757
5858
5959WRITE8_DEVICE_HANDLER( firetrk_xtndply_w )
6060{
6161   // also SUPERBUG_ASR_EN (extended play)
62   discrete_sound_w(device, FIRETRUCK_XTNDPLY_EN, data);
62   discrete_sound_w(device, space, FIRETRUCK_XTNDPLY_EN, data);
6363}
6464
6565
trunk/src/mame/audio/seibu.h
r17961r17962
6060void seibu_sound_decrypt(running_machine &machine,const char *cpu,int length);
6161
6262void seibu_adpcm_decrypt(running_machine &machine, const char *region);
63WRITE8_DEVICE_HANDLER( seibu_adpcm_adr_w );
64WRITE8_DEVICE_HANDLER( seibu_adpcm_ctl_w );
63DECLARE_WRITE8_DEVICE_HANDLER( seibu_adpcm_adr_w );
64DECLARE_WRITE8_DEVICE_HANDLER( seibu_adpcm_ctl_w );
6565
6666class seibu_adpcm_device : public device_t,
6767                                  public device_sound_interface
trunk/src/mame/audio/orbit.c
r17961r17962
1515
1616WRITE8_DEVICE_HANDLER( orbit_note_w )
1717{
18   discrete_sound_w(device, ORBIT_NOTE_FREQ, (~data) & 0xff);
18   discrete_sound_w(device, space, ORBIT_NOTE_FREQ, (~data) & 0xff);
1919}
2020
2121WRITE8_DEVICE_HANDLER( orbit_note_amp_w )
2222{
23   discrete_sound_w(device, ORBIT_ANOTE1_AMP, data & 0x0f);
24   discrete_sound_w(device, ORBIT_ANOTE2_AMP, data >> 4);
23   discrete_sound_w(device, space, ORBIT_ANOTE1_AMP, data & 0x0f);
24   discrete_sound_w(device, space, ORBIT_ANOTE2_AMP, data >> 4);
2525}
2626
2727WRITE8_DEVICE_HANDLER( orbit_noise_amp_w )
2828{
29   discrete_sound_w(device, ORBIT_NOISE1_AMP, data & 0x0f);
30   discrete_sound_w(device, ORBIT_NOISE2_AMP, data >> 4);
29   discrete_sound_w(device, space, ORBIT_NOISE1_AMP, data & 0x0f);
30   discrete_sound_w(device, space, ORBIT_NOISE2_AMP, data >> 4);
3131}
3232
3333WRITE8_DEVICE_HANDLER( orbit_noise_rst_w )
3434{
35   discrete_sound_w(device, ORBIT_NOISE_EN, 0);
35   discrete_sound_w(device, space, ORBIT_NOISE_EN, 0);
3636}
3737
3838
trunk/src/mame/audio/segag80r.c
r17961r17962
376376static SOUND_START( sega005 );
377377static STREAM_UPDATE( sega005_stream_update );
378378static TIMER_CALLBACK( sega005_auto_timer );
379static WRITE8_DEVICE_HANDLER( sega005_sound_a_w );
380static WRITE8_DEVICE_HANDLER( sega005_sound_b_w );
379static DECLARE_WRITE8_DEVICE_HANDLER( sega005_sound_a_w );
380static DECLARE_WRITE8_DEVICE_HANDLER( sega005_sound_b_w );
381381
382382/*
383383    005
r17961r17962
783783 *************************************/
784784
785785static SOUND_START( monsterb );
786static WRITE8_DEVICE_HANDLER( monsterb_sound_a_w );
787static WRITE8_DEVICE_HANDLER( monsterb_sound_b_w );
788static READ8_DEVICE_HANDLER( n7751_status_r );
789static WRITE8_DEVICE_HANDLER( n7751_command_w );
790static WRITE8_DEVICE_HANDLER( n7751_rom_control_w );
786static DECLARE_WRITE8_DEVICE_HANDLER( monsterb_sound_a_w );
787static DECLARE_WRITE8_DEVICE_HANDLER( monsterb_sound_b_w );
788static DECLARE_READ8_DEVICE_HANDLER( n7751_status_r );
789static DECLARE_WRITE8_DEVICE_HANDLER( n7751_command_w );
790static DECLARE_WRITE8_DEVICE_HANDLER( n7751_rom_control_w );
791791
792792
793static WRITE8_DEVICE_HANDLER( n7751_p2_w );
793static DECLARE_WRITE8_DEVICE_HANDLER( n7751_p2_w );
794794
795795
796796/*
r17961r17962
10321032{
10331033   segag80r_state *state = device->machine().driver_data<segag80r_state>();
10341034   /* write to P2; low 4 bits go to 8243 */
1035   i8243_p2_w(device, offset, data & 0x0f);
1035   i8243_p2_w(device, space, offset, data & 0x0f);
10361036
10371037   /* output of bit $80 indicates we are ready (1) or busy (0) */
10381038   /* no other outputs are used */
trunk/src/mame/audio/scramble.c
r17961r17962
247247{
248248   static const int tbl[8] = {0,4,2,6,1,5,3,7};
249249
250   tmsprom_bit_w(device, 0, tbl[data & 0x07]);
250   tmsprom_bit_w(device, space, 0, tbl[data & 0x07]);
251251   switch (data>>3)
252252   {
253253      case 0x01:
254         tmsprom_rom_csq_w(device, 1, 0);
254         tmsprom_rom_csq_w(device, space, 1, 0);
255255         break;
256256      case 0x03:
257         tmsprom_rom_csq_w(device, 0, 0);
257         tmsprom_rom_csq_w(device, space, 0, 0);
258258         break;
259259      case 0x00:
260260         /* Rom 2 select */
trunk/src/mame/audio/gottlieb.c
r17961r17962
772772         // bit 3 selects which of the two 8913 to enable
773773         // bit 4 goes to the 8913 BC1 pin
774774         if ((data & 0x08) != 0)
775            ay8910_data_address_w(m_ay1, data >> 4, m_psg_latch);
775            ay8910_data_address_w(m_ay1, space, data >> 4, m_psg_latch);
776776         else
777            ay8910_data_address_w(m_ay2, data >> 4, m_psg_latch);
777            ay8910_data_address_w(m_ay2, space, data >> 4, m_psg_latch);
778778      }
779779   }
780780   else
r17961r17962
786786      else
787787      {
788788         ay8913_device *ay = (data & 0x08) ? m_ay1 : m_ay2;
789         ay8910_address_w(ay, 0, m_psg_latch);
790         ay8910_data_w(ay, 0, m_psg_data_latch);
789         ay8910_address_w(ay, space, 0, m_psg_latch);
790         ay8910_data_w(ay, space, 0, m_psg_data_latch);
791791      }
792792   }
793793
r17961r17962
795795
796796   // bit 6 = speech chip DATA PRESENT pin; high then low to make the chip read data
797797   if ((previous & 0x40) == 0 && (data & 0x40) != 0)
798      sp0250_w(m_sp0250, 0, m_sp0250_latch);
798      sp0250_w(m_sp0250, space, 0, m_sp0250_latch);
799799
800800   // bit 7 goes to the speech chip RESET pin
801801   if ((previous ^ data) & 0x80)
trunk/src/mame/audio/jedi.c
r17961r17962
143143   if ((new_speech_strobe_state != m_speech_strobe_state) && new_speech_strobe_state)
144144   {
145145      device_t *tms = machine().device("tms");
146      tms5220_data_w(tms, 0, *m_speech_data);
146      tms5220_data_w(tms, space, 0, *m_speech_data);
147147   }
148148   m_speech_strobe_state = new_speech_strobe_state;
149149}
trunk/src/mame/audio/exidy.c
r17961r17962
533533   if (state->m_tms != NULL)
534534   {
535535      logerror("(%f)%s:TMS5220 data write = %02X\n", device->machine().time().as_double(), device->machine().describe_context(), riot6532_porta_out_get(state->m_riot));
536      tms5220_data_w(state->m_tms, 0, data);
536      tms5220_data_w(state->m_tms, space, 0, data);
537537   }
538538}
539539
r17961r17962
542542   exidy_sound_state *state = get_safe_token(device);
543543   if (state->m_tms != NULL)
544544   {
545      logerror("(%f)%s:TMS5220 status read = %02X\n", device->machine().time().as_double(), device->machine().describe_context(), tms5220_status_r(state->m_tms, 0));
546      return tms5220_status_r(state->m_tms, 0);
545      logerror("(%f)%s:TMS5220 status read = %02X\n", device->machine().time().as_double(), device->machine().describe_context(), tms5220_status_r(state->m_tms, space, 0));
546      return tms5220_status_r(state->m_tms, space, 0);
547547   }
548548   else
549549      return 0xff;
trunk/src/mame/audio/exidy.h
r17961r17962
6060extern const device_type EXIDY_VICTORY;
6161
6262
63READ8_DEVICE_HANDLER( exidy_sh6840_r );
64WRITE8_DEVICE_HANDLER( exidy_sh6840_w );
65WRITE8_DEVICE_HANDLER( exidy_sfxctrl_w );
63DECLARE_READ8_DEVICE_HANDLER( exidy_sh6840_r );
64DECLARE_WRITE8_DEVICE_HANDLER( exidy_sh6840_w );
65DECLARE_WRITE8_DEVICE_HANDLER( exidy_sfxctrl_w );
6666
6767MACHINE_CONFIG_EXTERN( venture_audio );
6868
6969MACHINE_CONFIG_EXTERN( mtrap_cvsd_audio );
7070
7171MACHINE_CONFIG_EXTERN( victory_audio );
72READ8_DEVICE_HANDLER( victory_sound_response_r );
73READ8_DEVICE_HANDLER( victory_sound_status_r );
74WRITE8_DEVICE_HANDLER( victory_sound_command_w );
72DECLARE_READ8_DEVICE_HANDLER( victory_sound_response_r );
73DECLARE_READ8_DEVICE_HANDLER( victory_sound_status_r );
74DECLARE_WRITE8_DEVICE_HANDLER( victory_sound_command_w );
trunk/src/mame/audio/8080bw.c
r17961r17962
282282
283283WRITE8_DEVICE_HANDLER( indianbt_sh_port_3_w )
284284{
285   discrete_sound_w(device, INDIANBT_MUSIC_DATA, data);
285   discrete_sound_w(device, space, INDIANBT_MUSIC_DATA, data);
286286}
287287
288288
r17961r17962
600600
601601WRITE8_DEVICE_HANDLER( polaris_sh_port_1_w )
602602{
603   discrete_sound_w(device, POLARIS_MUSIC_DATA, data);
603   discrete_sound_w(device, space, POLARIS_MUSIC_DATA, data);
604604}
605605
606606WRITE8_DEVICE_HANDLER( polaris_sh_port_2_w )
607607{
608608   /* 0x01 - SX0 - Shot */
609   discrete_sound_w(device, POLARIS_SX0_EN, data & 0x01);
609   discrete_sound_w(device, space, POLARIS_SX0_EN, data & 0x01);
610610
611611   /* 0x02 - SX1 - Ship Hit (Sub) */
612   discrete_sound_w(device, POLARIS_SX1_EN, data & 0x02);
612   discrete_sound_w(device, space, POLARIS_SX1_EN, data & 0x02);
613613
614614   /* 0x04 - SX2 - Ship */
615   discrete_sound_w(device, POLARIS_SX2_EN, data & 0x04);
615   discrete_sound_w(device, space, POLARIS_SX2_EN, data & 0x04);
616616
617617   /* 0x08 - SX3 - Explosion */
618   discrete_sound_w(device, POLARIS_SX3_EN, data & 0x08);
618   discrete_sound_w(device, space, POLARIS_SX3_EN, data & 0x08);
619619
620620   /* 0x10 - SX4 */
621621
622622   /* 0x20 - SX5 - Sound Enable */
623   discrete_sound_w(device, POLARIS_SX5_EN, data & 0x20);
623   discrete_sound_w(device, space, POLARIS_SX5_EN, data & 0x20);
624624}
625625
626626WRITE8_DEVICE_HANDLER( polaris_sh_port_3_w )
r17961r17962
632632   state->m_c8080bw_flip_screen = data & 0x20;      /* SX11 */
633633
634634   /* 0x01 - SX6 - Plane Down */
635   discrete_sound_w(device, POLARIS_SX6_EN, data & 0x01);
635   discrete_sound_w(device, space, POLARIS_SX6_EN, data & 0x01);
636636
637637   /* 0x02 - SX7 - Plane Up */
638   discrete_sound_w(device, POLARIS_SX7_EN, data & 0x02);
638   discrete_sound_w(device, space, POLARIS_SX7_EN, data & 0x02);
639639
640640   /* 0x08 - SX9 - Hit */
641   discrete_sound_w(device, POLARIS_SX9_EN, data & 0x08);
641   discrete_sound_w(device, space, POLARIS_SX9_EN, data & 0x08);
642642
643643   /* 0x10 - SX10 - Hit */
644   discrete_sound_w(device, POLARIS_SX10_EN, data & 0x10);
644   discrete_sound_w(device, space, POLARIS_SX10_EN, data & 0x10);
645645}
646646
647647
r17961r17962
789789       bit 5 - Explosion (SX5) */
790790
791791    //printf( "schaser_sh_port_1_w: %02x\n", data );
792   discrete_sound_w(m_discrete, SCHASER_DOT_EN, data & 0x01);
793   discrete_sound_w(m_discrete, SCHASER_DOT_SEL, data & 0x02);
792   discrete_sound_w(m_discrete, space, SCHASER_DOT_EN, data & 0x01);
793   discrete_sound_w(m_discrete, space, SCHASER_DOT_SEL, data & 0x02);
794794
795795   /* The effect is a variable rate 555 timer.  A diode/resistor array is used to
796796     * select the frequency.  Because of the diode voltage drop, we can not use the
r17961r17962
854854
855855   //printf( "schaser_sh_port_2_w: %02x\n", data );
856856
857   discrete_sound_w(m_discrete, SCHASER_MUSIC_BIT, data & 0x01);
857   discrete_sound_w(m_discrete, space, SCHASER_MUSIC_BIT, data & 0x01);
858858
859   discrete_sound_w(m_discrete, SCHASER_SND_EN, data & 0x02);
859   discrete_sound_w(m_discrete, space, SCHASER_SND_EN, data & 0x02);
860860   machine().sound().system_enable(data & 0x02);
861861
862862   coin_lockout_global_w(machine(), data & 0x04);
trunk/src/mame/audio/m79amb.c
r17961r17962
325325   /* these values are not latched */
326326   /* they are pulsed when the port is addressed */
327327   /* the discrete system will just trigger from them */
328   discrete_sound_w(device, M79AMB_SHOT_EN, data & 0x01);
329   discrete_sound_w(device, M79AMB_BOOM_EN, data & 0x02);
330   discrete_sound_w(device, M79AMB_THUD_EN, data & 0x04);
328   discrete_sound_w(device, space, M79AMB_SHOT_EN, data & 0x01);
329   discrete_sound_w(device, space, M79AMB_BOOM_EN, data & 0x02);
330   discrete_sound_w(device, space, M79AMB_THUD_EN, data & 0x04);
331331};
332332
333333WRITE8_DEVICE_HANDLER( m79amb_8003_w )
r17961r17962
335335   /* Self Test goes low on reset and lights LED */
336336   /* LED goes off on pass */
337337   output_set_value("SELF_TEST", data & 0x01);
338   discrete_sound_w(device, M79AMB_MC_REV_EN, data & 0x02);
339   discrete_sound_w(device, M79AMB_MC_CONTROL_EN, data & 0x04);
340   discrete_sound_w(device, M79AMB_TANK_TRUCK_JEEP_EN, data & 0x08);
341   discrete_sound_w(device, M79AMB_WHISTLE_B_EN, data & 0x10);
342   discrete_sound_w(device, M79AMB_WHISTLE_A_EN, data & 0x20);
338   discrete_sound_w(device, space, M79AMB_MC_REV_EN, data & 0x02);
339   discrete_sound_w(device, space, M79AMB_MC_CONTROL_EN, data & 0x04);
340   discrete_sound_w(device, space, M79AMB_TANK_TRUCK_JEEP_EN, data & 0x08);
341   discrete_sound_w(device, space, M79AMB_WHISTLE_B_EN, data & 0x10);
342   discrete_sound_w(device, space, M79AMB_WHISTLE_A_EN, data & 0x20);
343343}
trunk/src/mame/audio/qix.c
r17961r17962
2828
2929static WRITE8_DEVICE_HANDLER( qix_dac_w )
3030{
31   discrete_sound_w(device, QIX_DAC_DATA, data);
31   discrete_sound_w(device, space, QIX_DAC_DATA, data);
3232}
3333
3434static WRITE8_DEVICE_HANDLER( qix_vol_w )
3535{
36   discrete_sound_w(device, QIX_VOL_DATA, data);
36   discrete_sound_w(device, space, QIX_VOL_DATA, data);
3737}
3838
3939
trunk/src/mame/audio/spiders.c
r17961r17962
182182
183183WRITE8_DEVICE_HANDLER( spiders_audio_a_w )
184184{
185   discrete_sound_w(device, SPIDER_WEB_SOUND_MOD_DATA, 1 + (data & 4) * 8 + (data & 2) * 4 + (data & 1) * 2);
185   discrete_sound_w(device, space, SPIDER_WEB_SOUND_MOD_DATA, 1 + (data & 4) * 8 + (data & 2) * 4 + (data & 1) * 2);
186186}
187187
188188WRITE8_DEVICE_HANDLER( spiders_audio_b_w )
189189{
190   discrete_sound_w(device, SPIDERS_WEB_SOUND_DATA, data);
190   discrete_sound_w(device, space, SPIDERS_WEB_SOUND_DATA, data);
191191}
192192
193193
194194WRITE8_DEVICE_HANDLER( spiders_audio_ctrl_w )
195195{
196   discrete_sound_w(device, SPIDERS_FIRE_EN, data & 0x10 ? 1 : 0);
197   discrete_sound_w(device, SPIDERS_EXP_EN, data & 0x08 ? 1 : 0);
198   discrete_sound_w(device, SPIDERS_SUPER_WEB_EXPL_EN, data & 0x04 ? 1 : 0);
199   discrete_sound_w(device, SPIDERS_SUPER_WEB_EN, data & 0x02 ? 1 : 0);
200   discrete_sound_w(device, SPIDERS_X_EN, data & 0x01 ? 1 : 0);
196   discrete_sound_w(device, space, SPIDERS_FIRE_EN, data & 0x10 ? 1 : 0);
197   discrete_sound_w(device, space, SPIDERS_EXP_EN, data & 0x08 ? 1 : 0);
198   discrete_sound_w(device, space, SPIDERS_SUPER_WEB_EXPL_EN, data & 0x04 ? 1 : 0);
199   discrete_sound_w(device, space, SPIDERS_SUPER_WEB_EN, data & 0x02 ? 1 : 0);
200   discrete_sound_w(device, space, SPIDERS_X_EN, data & 0x01 ? 1 : 0);
201201}
202202
203203
trunk/src/mame/audio/hyprolyb.h
r17961r17962
1WRITE8_DEVICE_HANDLER( hyprolyb_adpcm_w );
2READ8_DEVICE_HANDLER( hyprolyb_adpcm_busy_r );
1DECLARE_WRITE8_DEVICE_HANDLER( hyprolyb_adpcm_w );
2DECLARE_READ8_DEVICE_HANDLER( hyprolyb_adpcm_busy_r );
33
44MACHINE_CONFIG_EXTERN( hyprolyb_adpcm );
55
trunk/src/mame/audio/llander.c
r17961r17962
8383WRITE8_DEVICE_HANDLER( llander_snd_reset_w )
8484{
8585   /* Resets the LFSR that is used for the white noise generator       */
86   discrete_sound_w(device, LLANDER_NOISE_RESET, 0);            /* Reset */
86   discrete_sound_w(device, space, LLANDER_NOISE_RESET, 0);            /* Reset */
8787}
8888
8989WRITE8_DEVICE_HANDLER( llander_sounds_w )
9090{
91   discrete_sound_w(device, LLANDER_THRUST_DATA, data & 0x07);      /* Thrust volume */
92   discrete_sound_w(device, LLANDER_TONE3K_EN, data & 0x10);      /* Tone 3KHz enable */
93   discrete_sound_w(device, LLANDER_TONE6K_EN, data & 0x20);      /* Tone 6KHz enable */
94   discrete_sound_w(device, LLANDER_EXPLOD_EN, data & 0x08);      /* Explosion */
91   discrete_sound_w(device, space, LLANDER_THRUST_DATA, data & 0x07);      /* Thrust volume */
92   discrete_sound_w(device, space, LLANDER_TONE3K_EN, data & 0x10);      /* Tone 3KHz enable */
93   discrete_sound_w(device, space, LLANDER_TONE6K_EN, data & 0x20);      /* Tone 6KHz enable */
94   discrete_sound_w(device, space, LLANDER_EXPLOD_EN, data & 0x08);      /* Explosion */
9595}
9696
trunk/src/mame/audio/canyon.c
r17961r17962
1616
1717WRITE8_DEVICE_HANDLER( canyon_motor_w )
1818{
19   discrete_sound_w(device, NODE_RELATIVE(CANYON_MOTOR1_DATA, (offset & 0x01)), data & 0x0f);
19   discrete_sound_w(device, space, NODE_RELATIVE(CANYON_MOTOR1_DATA, (offset & 0x01)), data & 0x0f);
2020}
2121
2222
2323WRITE8_DEVICE_HANDLER( canyon_explode_w )
2424{
25   discrete_sound_w(device, CANYON_EXPLODE_DATA, data >> 4);
25   discrete_sound_w(device, space, CANYON_EXPLODE_DATA, data >> 4);
2626}
2727
2828
2929WRITE8_DEVICE_HANDLER( canyon_attract_w )
3030{
31   discrete_sound_w(device, NODE_RELATIVE(CANYON_ATTRACT1_EN, (offset & 0x01)), offset & 0x02);
31   discrete_sound_w(device, space, NODE_RELATIVE(CANYON_ATTRACT1_EN, (offset & 0x01)), offset & 0x02);
3232}
3333
3434
3535WRITE8_DEVICE_HANDLER( canyon_whistle_w )
3636{
37   discrete_sound_w(device, NODE_RELATIVE(CANYON_WHISTLE1_EN, (offset & 0x01)), offset & 0x02);
37   discrete_sound_w(device, space, NODE_RELATIVE(CANYON_WHISTLE1_EN, (offset & 0x01)), offset & 0x02);
3838}
3939
4040
trunk/src/mame/audio/circus.c
r17961r17962
184184         switch ((data & 0x70) >> 4)
185185         {
186186            case 0 : /* All Off */
187               discrete_sound_w(m_discrete, CIRCUS_MUSIC_BIT, 0);
187               discrete_sound_w(m_discrete, space, CIRCUS_MUSIC_BIT, 0);
188188               break;
189189
190190            case 1 : /* Music */
191               discrete_sound_w(m_discrete, CIRCUS_MUSIC_BIT, 1);
191               discrete_sound_w(m_discrete, space, CIRCUS_MUSIC_BIT, 1);
192192               break;
193193
194194            case 2 : /* Circus = Pop; Rip Cord = Splash */
r17961r17962
217217         break;
218218
219219      case 2:   /* robotbwl */
220         discrete_sound_w(m_discrete, ROBOTBWL_MUSIC_BIT, data & 0x08);   /* Footsteps */
220         discrete_sound_w(m_discrete, space, ROBOTBWL_MUSIC_BIT, data & 0x08);   /* Footsteps */
221221
222222         if (data & 0x40)   /* Hit */
223223            m_samples->start(0, 0);
r17961r17962
242242         switch ((data & 0x70) >> 4)
243243         {
244244            case 0 : /* All Off */
245               discrete_sound_w(m_discrete, CRASH_MUSIC_BIT, 0);
245               discrete_sound_w(m_discrete, space, CRASH_MUSIC_BIT, 0);
246246               break;
247247
248248            case 1 : /* Music */
249               discrete_sound_w(m_discrete, CRASH_MUSIC_BIT, 1);
249               discrete_sound_w(m_discrete, space, CRASH_MUSIC_BIT, 1);
250250               break;
251251
252252            case 2 : /* Crash */
r17961r17962
254254               break;
255255
256256            case 3 : /* Normal Video and Beep */
257               discrete_sound_w(m_discrete, CRASH_BEEPER_EN, 0);
257               discrete_sound_w(m_discrete, space, CRASH_BEEPER_EN, 0);
258258               break;
259259
260260            case 4 : /* Skid */
261261               break;
262262
263263            case 5 : /* Invert Video and Beep */
264               discrete_sound_w(m_discrete, CRASH_BEEPER_EN, 0);
264               discrete_sound_w(m_discrete, space, CRASH_BEEPER_EN, 0);
265265               break;
266266
267267            case 6 : /* Hi Motor */
trunk/src/mame/audio/midway.c
r17961r17962
11981198   // write strobe -- pass the current command to the TMS5200
11991199   if (((data ^ m_tms_strobes) & 0x02) && !(data & 0x02))
12001200   {
1201      tms5220_data_w(m_tms5200, offset, m_tms_command);
1201      tms5220_data_w(m_tms5200, space, offset, m_tms_command);
12021202
12031203      // DoT expects the ready line to transition on a command/write here, so we oblige
12041204      m_pia1->ca2_w(1);
r17961r17962
12081208   // read strobe -- read the current status from the TMS5200
12091209   else if (((data ^ m_tms_strobes) & 0x01) && !(data & 0x01))
12101210   {
1211      m_pia1->porta_w(tms5220_status_r(m_tms5200, offset));
1211      m_pia1->porta_w(tms5220_status_r(m_tms5200, space, offset));
12121212
12131213      // DoT expects the ready line to transition on a command/write here, so we oblige
12141214      m_pia1->ca2_w(1);
trunk/src/mame/audio/trackfld.h
r17961r17962
11WRITE8_HANDLER( konami_sh_irqtrigger_w );
22READ8_HANDLER( trackfld_sh_timer_r );
3READ8_DEVICE_HANDLER( trackfld_speech_r );
4WRITE8_DEVICE_HANDLER( trackfld_sound_w );
3DECLARE_READ8_DEVICE_HANDLER( trackfld_speech_r );
4DECLARE_WRITE8_DEVICE_HANDLER( trackfld_sound_w );
55READ8_HANDLER( hyperspt_sh_timer_r );
6WRITE8_DEVICE_HANDLER( hyperspt_sound_w );
6DECLARE_WRITE8_DEVICE_HANDLER( hyperspt_sound_w );
77WRITE8_HANDLER( konami_SN76496_latch_w );
8WRITE8_DEVICE_HANDLER( konami_SN76496_w );
8DECLARE_WRITE8_DEVICE_HANDLER( konami_SN76496_w );
99
1010class trackfld_audio_device : public device_t,
1111                                  public device_sound_interface
trunk/src/mame/audio/crbaloon.c
r17961r17962
3232
3333WRITE8_DEVICE_HANDLER( crbaloon_audio_set_music_freq )
3434{
35   discrete_sound_w(device, CRBALOON_MUSIC_DATA, data);
35   discrete_sound_w(device, space, CRBALOON_MUSIC_DATA, data);
3636}
3737
3838
3939WRITE8_DEVICE_HANDLER( crbaloon_audio_set_music_enable )
4040{
41   discrete_sound_w(device, CRBALOON_MUSIC_EN, data);
41   discrete_sound_w(device, space, CRBALOON_MUSIC_EN, data);
4242}
4343
4444
r17961r17962
6666
6767WRITE8_DEVICE_HANDLER( crbaloon_audio_set_laugh_enable )
6868{
69   discrete_sound_w(device, CRBALOON_LAUGH_EN, data);
69   discrete_sound_w(device, space, CRBALOON_LAUGH_EN, data);
7070}
7171
7272
trunk/src/mame/audio/namco54.c
r17961r17962
9393   namco_54xx_state *state = get_safe_token(space->device().owner());
9494   UINT8 out = (data & 0x0f);
9595   if (data & 0x10)
96      discrete_sound_w(state->m_discrete, NAMCO_54XX_1_DATA(state->m_basenode), out);
96      discrete_sound_w(state->m_discrete, *space, NAMCO_54XX_1_DATA(state->m_basenode), out);
9797   else
98      discrete_sound_w(state->m_discrete, NAMCO_54XX_0_DATA(state->m_basenode), out);
98      discrete_sound_w(state->m_discrete, *space, NAMCO_54XX_0_DATA(state->m_basenode), out);
9999}
100100
101101static WRITE8_HANDLER( namco_54xx_R1_w )
r17961r17962
103103   namco_54xx_state *state = get_safe_token(space->device().owner());
104104   UINT8 out = (data & 0x0f);
105105
106   discrete_sound_w(state->m_discrete, NAMCO_54XX_2_DATA(state->m_basenode), out);
106   discrete_sound_w(state->m_discrete, *space, NAMCO_54XX_2_DATA(state->m_basenode), out);
107107}
108108
109109
trunk/src/mame/audio/snk6502.c
r17961r17962
957957      }
958958
959959      /* BOMB */
960      discrete_sound_w(space->machine().device("discrete"), FANTASY_BOMB_EN, data & 0x80);
960      discrete_sound_w(space->machine().device("discrete"), *space, FANTASY_BOMB_EN, data & 0x80);
961961
962962      state->m_LastPort1 = data;
963963      break;
trunk/src/mame/audio/namco54.h
r17961r17962
1717   MCFG_DEVICE_CONFIG(_config)
1818
1919
20WRITE8_DEVICE_HANDLER( namco_54xx_write );
20DECLARE_WRITE8_DEVICE_HANDLER( namco_54xx_write );
2121
2222
2323class namco_54xx_device : public device_t
trunk/src/mame/audio/vicdual.c
r17961r17962
151151   int new_croak = data & 0x08;
152152   int new_buzzz = data & 0x10;
153153
154//  discrete_sound_w(discrete, FROGS_HOP_EN, data & 0x01);
155//  discrete_sound_w(discrete, FROGS_JUMP_EN, data & 0x02);
156   discrete_sound_w(discrete, FROGS_TONGUE_EN, data & 0x04);
157//  discrete_sound_w(discrete, FROGS_CAPTURE_EN, data & 0x08);
158//  discrete_sound_w(discrete, FROGS_FLY_EN, data & 0x10);
159//  discrete_sound_w(discrete, FROGS_SPLASH_EN, data & 0x80);
154//  discrete_sound_w(discrete, *space, FROGS_HOP_EN, data & 0x01);
155//  discrete_sound_w(discrete, *space, FROGS_JUMP_EN, data & 0x02);
156   discrete_sound_w(discrete, *space, FROGS_TONGUE_EN, data & 0x04);
157//  discrete_sound_w(discrete, *space, FROGS_CAPTURE_EN, data & 0x08);
158//  discrete_sound_w(discrete, *space, FROGS_FLY_EN, data & 0x10);
159//  discrete_sound_w(discrete, *space, FROGS_SPLASH_EN, data & 0x80);
160160
161161   if (data & 0x01)
162162      samples->start(3, 3);   // Hop
r17961r17962
464464   device_t *discrete = space->machine().device("discrete");
465465   if (discrete == NULL)
466466      return;
467   discrete_sound_w(discrete, HEADON_HISPEED_PC_EN, data & 0x01);
468   discrete_sound_w(discrete, HEADON_SCREECH1_EN, data & 0x02);
469   discrete_sound_w(discrete, HEADON_CRASH_EN, data & 0x04);
470   discrete_sound_w(discrete, HEADON_HISPEED_CC_EN, data & 0x08);
471   discrete_sound_w(discrete, HEADON_SCREECH2_EN, data & 0x10);
472   discrete_sound_w(discrete, HEADON_BONUS_EN, data & 0x20);
473   discrete_sound_w(discrete, HEADON_CAR_ON_EN, data & 0x40);
467   discrete_sound_w(discrete, *space, HEADON_HISPEED_PC_EN, data & 0x01);
468   discrete_sound_w(discrete, *space, HEADON_SCREECH1_EN, data & 0x02);
469   discrete_sound_w(discrete, *space, HEADON_CRASH_EN, data & 0x04);
470   discrete_sound_w(discrete, *space, HEADON_HISPEED_CC_EN, data & 0x08);
471   discrete_sound_w(discrete, *space, HEADON_SCREECH2_EN, data & 0x10);
472   discrete_sound_w(discrete, *space, HEADON_BONUS_EN, data & 0x20);
473   discrete_sound_w(discrete, *space, HEADON_CAR_ON_EN, data & 0x40);
474474
475475}
476476
r17961r17962
479479   device_t *discrete = space->machine().device("discrete");
480480   if (discrete == NULL)
481481      return;
482   discrete_sound_w(discrete, HEADON_HISPEED_PC_EN, data & 0x10);
483   discrete_sound_w(discrete, HEADON_SCREECH1_EN, data & 0x08);
484   discrete_sound_w(discrete, HEADON_CRASH_EN, data & 0x80);
485   discrete_sound_w(discrete, HEADON_HISPEED_CC_EN, data & 0x40);
486   discrete_sound_w(discrete, HEADON_SCREECH2_EN, data & 0x04);
487   discrete_sound_w(discrete, HEADON_BONUS_EN, data & 0x02);
488   discrete_sound_w(discrete, HEADON_CAR_ON_EN, data & 0x20);
482   discrete_sound_w(discrete, *space, HEADON_HISPEED_PC_EN, data & 0x10);
483   discrete_sound_w(discrete, *space, HEADON_SCREECH1_EN, data & 0x08);
484   discrete_sound_w(discrete, *space, HEADON_CRASH_EN, data & 0x80);
485   discrete_sound_w(discrete, *space, HEADON_HISPEED_CC_EN, data & 0x40);
486   discrete_sound_w(discrete, *space, HEADON_SCREECH2_EN, data & 0x04);
487   discrete_sound_w(discrete, *space, HEADON_BONUS_EN, data & 0x02);
488   discrete_sound_w(discrete, *space, HEADON_CAR_ON_EN, data & 0x20);
489489
490490}
491491
trunk/src/mame/audio/irem.c
r17961r17962
9898      {
9999         /* PSG 0 or 1? */
100100         if (state->m_port2 & 0x08)
101            ay8910_address_w(state->m_ay1, 0, state->m_port1);
101            ay8910_address_w(state->m_ay1, space, 0, state->m_port1);
102102         if (state->m_port2 & 0x10)
103            ay8910_address_w(state->m_ay2, 0, state->m_port1);
103            ay8910_address_w(state->m_ay2, 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, 0, state->m_port1);
109            ay8910_data_w(state->m_ay1, space, 0, state->m_port1);
110110         if (state->m_port2 & 0x10)
111            ay8910_data_w(state->m_ay2, 0, state->m_port1);
111            ay8910_data_w(state->m_ay2, space, 0, state->m_port1);
112112      }
113113   }
114114   state->m_port2 = data;
r17961r17962
128128
129129   /* PSG 0 or 1? */
130130   if (state->m_port2 & 0x08)
131      return ay8910_r(state->m_ay1, 0);
131      return ay8910_r(state->m_ay1, space, 0);
132132   if (state->m_port2 & 0x10)
133      return ay8910_r(state->m_ay2, 0);
133      return ay8910_r(state->m_ay2, space, 0);
134134   return 0xff;
135135}
136136
trunk/src/mame/audio/bsktball.c
r17961r17962
1212***************************************************************************/
1313WRITE8_DEVICE_HANDLER( bsktball_bounce_w )
1414{
15   discrete_sound_w(device, BSKTBALL_CROWD_DATA, data & 0x0f);   // Crowd
16   discrete_sound_w(device, BSKTBALL_BOUNCE_EN, data & 0x10);   // Bounce
15   discrete_sound_w(device, space, BSKTBALL_CROWD_DATA, data & 0x0f);   // Crowd
16   discrete_sound_w(device, space, BSKTBALL_BOUNCE_EN, data & 0x10);   // Bounce
1717}
1818
1919WRITE8_DEVICE_HANDLER( bsktball_note_w )
2020{
21   discrete_sound_w(device, BSKTBALL_NOTE_DATA, data);   // Note
21   discrete_sound_w(device, space, BSKTBALL_NOTE_DATA, data);   // Note
2222}
2323
2424WRITE8_DEVICE_HANDLER( bsktball_noise_reset_w )
2525{
26   discrete_sound_w(device, BSKTBALL_NOISE_EN, offset & 0x01);
26   discrete_sound_w(device, space, BSKTBALL_NOISE_EN, offset & 0x01);
2727}
2828
2929
trunk/src/mame/audio/dkong.c
r17961r17962
12141214
12151215static WRITE8_DEVICE_HANDLER( M58817_command_w )
12161216{
1217   tms5110_ctl_w(device, 0, data & 0x0f);
1217   tms5110_ctl_w(device, space, 0, data & 0x0f);
12181218   tms5110_pdc_w(device, (data>>4) & 0x01);
12191219   /* FIXME 0x20 is CS */
12201220}
r17961r17962
12341234   logerror("dkong_speech_w: 0x%02x\n", data);
12351235}
12361236
1237static DECLARE_READ8_DEVICE_HANDLER( dkong_voice_status_r );
12371238static READ8_DEVICE_HANDLER( dkong_voice_status_r )
12381239{
12391240   /* only provided for documentation purposes
r17961r17962
12451246static READ8_DEVICE_HANDLER( dkong_tune_r )
12461247{
12471248   dkong_state *state = device->machine().driver_data<dkong_state>();
1248   UINT8 page = latch8_r(state->m_dev_vp2, 0) & 0x47;
1249   UINT8 page = latch8_r(state->m_dev_vp2, space, 0) & 0x47;
12491250
12501251   if ( page & 0x40 )
12511252   {
1252      return (latch8_r(device, 0) & 0x0F) | (dkong_voice_status_r(device, 0) << 4);
1253      return (latch8_r(device, space, 0) & 0x0F) | (dkong_voice_status_r(device, space, 0) << 4);
12531254   }
12541255   else
12551256   {
r17961r17962
12601261
12611262static WRITE8_DEVICE_HANDLER( dkong_p1_w )
12621263{
1263   discrete_sound_w(device,DS_DAC,data);
1264   discrete_sound_w(device,space,DS_DAC,data);
12641265}
12651266
12661267
trunk/src/mame/audio/skyraid.c
r17961r17962
292292   /* BIT4 => PLANE ON    */
293293   /* BIT5 => ATTRACT     */
294294
295   discrete_sound_w(device, SKYRAID_PLANE_SWEEP_EN, data & 0x01);
296   discrete_sound_w(device, SKYRAID_MISSILE_EN, data & 0x02);
297   discrete_sound_w(device, SKYRAID_EXPLOSION_EN, data & 0x04);
295   discrete_sound_w(device, space, SKYRAID_PLANE_SWEEP_EN, data & 0x01);
296   discrete_sound_w(device, space, SKYRAID_MISSILE_EN, data & 0x02);
297   discrete_sound_w(device, space, SKYRAID_EXPLOSION_EN, data & 0x04);
298298   set_led_status(device->machine(), 0, !(data & 0x08));
299   discrete_sound_w(device, SKYRAID_PLANE_ON_EN, data & 0x10);
300   discrete_sound_w(device, SKYRAID_ATTRACT_EN, data & 0x20);
299   discrete_sound_w(device, space, SKYRAID_PLANE_ON_EN, data & 0x10);
300   discrete_sound_w(device, space, SKYRAID_ATTRACT_EN, data & 0x20);
301301}
trunk/src/mame/audio/sprint8.c
r17961r17962
295295
296296WRITE8_DEVICE_HANDLER( sprint8_crash_w )
297297{
298   discrete_sound_w(device, SPRINT8_CRASH_EN, data & 0x01);
298   discrete_sound_w(device, space, SPRINT8_CRASH_EN, data & 0x01);
299299}
300300
301301WRITE8_DEVICE_HANDLER( sprint8_screech_w )
302302{
303   discrete_sound_w(device, SPRINT8_SCREECH_EN, data & 0x01);
303   discrete_sound_w(device, space, SPRINT8_SCREECH_EN, data & 0x01);
304304}
305305
306306WRITE8_DEVICE_HANDLER( sprint8_attract_w )
307307{
308   discrete_sound_w(device, SPRINT8_ATTRACT_EN, data & 0x01);
308   discrete_sound_w(device, space, SPRINT8_ATTRACT_EN, data & 0x01);
309309}
310310
311311WRITE8_DEVICE_HANDLER( sprint8_motor_w )
312312{
313   discrete_sound_w(device, NODE_RELATIVE(SPRINT8_MOTOR1_EN, offset & 0x07), data & 0x01);
313   discrete_sound_w(device, space, NODE_RELATIVE(SPRINT8_MOTOR1_EN, offset & 0x07), data & 0x01);
314314}
trunk/src/mame/audio/m72.h
r17961r17962
55****************************************************************************/
66
77void m72_ym2151_irq_handler(device_t *device, int irq);
8WRITE8_DEVICE_HANDLER( m72_sound_command_byte_w );
9WRITE16_DEVICE_HANDLER( m72_sound_command_w );
10WRITE8_DEVICE_HANDLER( m72_sound_irq_ack_w );
11READ8_DEVICE_HANDLER( m72_sample_r );
12WRITE8_DEVICE_HANDLER( m72_sample_w );
8DECLARE_WRITE8_DEVICE_HANDLER( m72_sound_command_byte_w );
9DECLARE_WRITE16_DEVICE_HANDLER( m72_sound_command_w );
10DECLARE_WRITE8_DEVICE_HANDLER( m72_sound_irq_ack_w );
11DECLARE_READ8_DEVICE_HANDLER( m72_sample_r );
12DECLARE_WRITE8_DEVICE_HANDLER( m72_sample_w );
1313
1414/* the port goes to different address bits depending on the game */
1515void m72_set_sample_start(device_t *device, int start);
16WRITE8_DEVICE_HANDLER( vigilant_sample_addr_w );
17WRITE8_DEVICE_HANDLER( shisen_sample_addr_w );
18WRITE8_DEVICE_HANDLER( rtype2_sample_addr_w );
19WRITE8_DEVICE_HANDLER( poundfor_sample_addr_w );
16DECLARE_WRITE8_DEVICE_HANDLER( vigilant_sample_addr_w );
17DECLARE_WRITE8_DEVICE_HANDLER( shisen_sample_addr_w );
18DECLARE_WRITE8_DEVICE_HANDLER( rtype2_sample_addr_w );
19DECLARE_WRITE8_DEVICE_HANDLER( poundfor_sample_addr_w );
2020
2121class m72_audio_device : public device_t,
2222                                  public device_sound_interface
trunk/src/mame/audio/snes_snd.c
r17961r17962
10681068         I/O for DSP
10691069 ***************************/
10701070
1071static DECLARE_READ8_DEVICE_HANDLER( snes_dsp_io_r );
10711072static READ8_DEVICE_HANDLER( snes_dsp_io_r )
10721073{
10731074   snes_sound_state *spc700 = get_safe_token(device);
r17961r17962
10831084   return spc700->dsp_regs[offset & 0x7f];
10841085}
10851086
1087static DECLARE_WRITE8_DEVICE_HANDLER( snes_dsp_io_w );
10861088static WRITE8_DEVICE_HANDLER( snes_dsp_io_w )
10871089{
10881090   snes_sound_state *spc700 = get_safe_token(device);
r17961r17962
11181120      case 0x2:      /* Register address */
11191121         return spc700->ram[0xf2];
11201122      case 0x3:      /* Register data */
1121         return snes_dsp_io_r(device, spc700->ram[0xf2]);
1123         return snes_dsp_io_r(device, space, spc700->ram[0xf2]);
11221124      case 0x4:      /* Port 0 */
11231125      case 0x5:      /* Port 1 */
11241126      case 0x6:      /* Port 2 */
r17961r17962
11861188         break;
11871189      case 0x3:      /* Register data - 0x80-0xff is a read-only mirror of 0x00-0x7f */
11881190         if (!(spc700->ram[0xf2] & 0x80))
1189            snes_dsp_io_w(device, spc700->ram[0xf2] & 0x7f, data);
1191            snes_dsp_io_w(device, space, spc700->ram[0xf2] & 0x7f, data);
11901192         break;
11911193      case 0x4:      /* Port 0 */
11921194      case 0x5:      /* Port 1 */
trunk/src/mame/audio/snes_snd.h
r17961r17962
4646    I/O PROTOTYPES
4747***************************************************************************/
4848
49READ8_DEVICE_HANDLER( spc_io_r );
50WRITE8_DEVICE_HANDLER( spc_io_w );
51READ8_DEVICE_HANDLER( spc_ram_r );
52WRITE8_DEVICE_HANDLER( spc_ram_w );
53READ8_DEVICE_HANDLER( spc_port_out );
54WRITE8_DEVICE_HANDLER( spc_port_in );
49DECLARE_READ8_DEVICE_HANDLER( spc_io_r );
50DECLARE_WRITE8_DEVICE_HANDLER( spc_io_w );
51DECLARE_READ8_DEVICE_HANDLER( spc_ram_r );
52DECLARE_WRITE8_DEVICE_HANDLER( spc_ram_w );
53DECLARE_READ8_DEVICE_HANDLER( spc_port_out );
54DECLARE_WRITE8_DEVICE_HANDLER( spc_port_in );
5555
5656UINT8 *spc_get_ram(device_t *device);
5757void spc700_set_volume(device_t *device,int volume);
trunk/src/mame/audio/pleiads.h
r17961r17962
1WRITE8_DEVICE_HANDLER( pleiads_sound_control_a_w );
2WRITE8_DEVICE_HANDLER( pleiads_sound_control_b_w );
3WRITE8_DEVICE_HANDLER( pleiads_sound_control_c_w );
1DECLARE_WRITE8_DEVICE_HANDLER( pleiads_sound_control_a_w );
2DECLARE_WRITE8_DEVICE_HANDLER( pleiads_sound_control_b_w );
3DECLARE_WRITE8_DEVICE_HANDLER( pleiads_sound_control_c_w );
44
55class pleiads_sound_device : public device_t,
66                                  public device_sound_interface
trunk/src/mame/audio/redalert.c
r17961r17962
8686
8787      /* BC1=1, BDIR=0 : read from PSG */
8888      case 0x01:
89         state->m_ay8910_latch_1 = ay8910_r(device, 0);
89         state->m_ay8910_latch_1 = ay8910_r(device, space, 0);
9090         break;
9191
9292      /* BC1=0, BDIR=1 : write to PSG */
r17961r17962
9494      case 0x02:
9595      case 0x03:
9696      default:
97         ay8910_data_address_w(device, data, state->m_ay8910_latch_2);
97         ay8910_data_address_w(device, space, data, state->m_ay8910_latch_2);
9898         break;
9999   }
100100}
r17961r17962
310310   {
311311      case 0x00:
312312         if (state->m_ay8910_latch_1 & 0x10)
313            ay8910_data_w(ay1, 0, data);
313            ay8910_data_w(ay1, space, 0, data);
314314
315315         if (state->m_ay8910_latch_1 & 0x20)
316            ay8910_data_w(ay2, 0, data);
316            ay8910_data_w(ay2, space, 0, data);
317317
318318         break;
319319
320320      case 0x01:
321321         if (state->m_ay8910_latch_1 & 0x10)
322            state->m_ay8910_latch_2 = ay8910_r(ay1, 0);
322            state->m_ay8910_latch_2 = ay8910_r(ay1, space, 0);
323323
324324         if (state->m_ay8910_latch_1 & 0x20)
325            state->m_ay8910_latch_2 = ay8910_r(ay2, 0);
325            state->m_ay8910_latch_2 = ay8910_r(ay2, space, 0);
326326
327327         break;
328328
329329      case 0x03:
330330         if (state->m_ay8910_latch_1 & 0x10)
331            ay8910_address_w(ay1, 0, data);
331            ay8910_address_w(ay1, space, 0, data);
332332
333333         if (state->m_ay8910_latch_1 & 0x20)
334            ay8910_address_w(ay2, 0, data);
334            ay8910_address_w(ay2, space, 0, data);
335335
336336         break;
337337
trunk/src/mame/audio/mario.c
r17961r17962
494494
495495static WRITE8_DEVICE_HANDLER( mario_sh_sound_w )
496496{
497   discrete_sound_w(device, DS_DAC, data);
497   discrete_sound_w(device, space, DS_DAC, data);
498498}
499499
500500WRITE8_MEMBER(mario_state::mario_sh_p1_w)
r17961r17962
536536/* Mario running sample */
537537WRITE8_DEVICE_HANDLER( mario_sh1_w )
538538{
539   discrete_sound_w(device, DS_SOUND0_INP, 0);
539   discrete_sound_w(device, space, DS_SOUND0_INP, 0);
540540}
541541
542542/* Luigi running sample */
543543WRITE8_DEVICE_HANDLER( mario_sh2_w )
544544{
545   discrete_sound_w(device, DS_SOUND1_INP, 0);
545   discrete_sound_w(device, space, DS_SOUND1_INP, 0);
546546}
547547
548548/* Misc samples */
r17961r17962
576576         I8035_P1_W_AH(space, 3, data & 1);
577577         break;
578578      case 7: /* skid */
579         discrete_sound_w(machine().device("discrete"), DS_SOUND7_INP, data & 1);
579         discrete_sound_w(machine().device("discrete"), space, DS_SOUND7_INP, data & 1);
580580         break;
581581   }
582582}
trunk/src/mame/audio/subs.c
r17961r17962
1414
1515WRITE8_DEVICE_HANDLER( subs_sonar1_w )
1616{
17   discrete_sound_w(device, SUBS_SONAR1_EN, offset & 0x01);
17   discrete_sound_w(device, space, SUBS_SONAR1_EN, offset & 0x01);
1818}
1919
2020WRITE8_DEVICE_HANDLER( subs_sonar2_w )
2121{
22   discrete_sound_w(device, SUBS_SONAR2_EN, offset & 0x01);
22   discrete_sound_w(device, space, SUBS_SONAR2_EN, offset & 0x01);
2323}
2424
2525WRITE8_DEVICE_HANDLER( subs_crash_w )
2626{
27   discrete_sound_w(device, SUBS_CRASH_EN, offset & 0x01);
27   discrete_sound_w(device, space, SUBS_CRASH_EN, offset & 0x01);
2828}
2929
3030WRITE8_DEVICE_HANDLER( subs_explode_w )
3131{
32   discrete_sound_w(device, SUBS_EXPLODE_EN, offset & 0x01);
32   discrete_sound_w(device, space, SUBS_EXPLODE_EN, offset & 0x01);
3333}
3434
3535WRITE8_DEVICE_HANDLER( subs_noise_reset_w )
3636{
3737   /* Pulse noise reset */
38   discrete_sound_w(device, SUBS_NOISE_RESET, 0);
38   discrete_sound_w(device, space, SUBS_NOISE_RESET, 0);
3939}
4040
4141
trunk/src/mame/audio/mw8080bw.c
r17961r17962
8585
8686WRITE8_DEVICE_HANDLER( midway_tone_generator_lo_w )
8787{
88   discrete_sound_w(device, MIDWAY_TONE_EN, (data >> 0) & 0x01);
88   discrete_sound_w(device, space, MIDWAY_TONE_EN, (data >> 0) & 0x01);
8989
90   discrete_sound_w(device, MIDWAY_TONE_DATA_L, (data >> 1) & 0x1f);
90   discrete_sound_w(device, space, MIDWAY_TONE_DATA_L, (data >> 1) & 0x1f);
9191
9292   /* D6 and D7 are not connected */
9393}
r17961r17962
9595
9696WRITE8_DEVICE_HANDLER( midway_tone_generator_hi_w )
9797{
98   discrete_sound_w(device, MIDWAY_TONE_DATA_H, data & 0x3f);
98   discrete_sound_w(device, space, MIDWAY_TONE_DATA_H, data & 0x3f);
9999
100100   /* D6 and D7 are not connected */
101101}
r17961r17962
328328
329329WRITE8_DEVICE_HANDLER( tornbase_audio_w )
330330{
331   discrete_sound_w(device, TORNBASE_TONE_240_EN, (data >> 0) & 0x01);
331   discrete_sound_w(device, space, TORNBASE_TONE_240_EN, (data >> 0) & 0x01);
332332
333   discrete_sound_w(device, TORNBASE_TONE_960_EN, (data >> 1) & 0x01);
333   discrete_sound_w(device, space, TORNBASE_TONE_960_EN, (data >> 1) & 0x01);
334334
335   discrete_sound_w(device, TORNBASE_TONE_120_EN, (data >> 2) & 0x01);
335   discrete_sound_w(device, space, TORNBASE_TONE_120_EN, (data >> 2) & 0x01);
336336
337337   /* if (data & 0x08)  enable SIREN sound */
338338
r17961r17962
577577   /* controls need to be active low */
578578   int controls = ~device->machine().root_device().ioport("IN0")->read() & 0xff;
579579
580   discrete_sound_w(device, MAZE_TONE_TIMING, maze_tone_timing_state);
581   discrete_sound_w(device, MAZE_P1_DATA, controls & 0x0f);
582   discrete_sound_w(device, MAZE_P2_DATA, (controls >> 4) & 0x0f);
583   discrete_sound_w(device, MAZE_JOYSTICK_IN_USE, controls != 0xff);
580   address_space &space = device->machine().driver_data()->generic_space();
581   discrete_sound_w(device, space, MAZE_TONE_TIMING, maze_tone_timing_state);
582   discrete_sound_w(device, space, MAZE_P1_DATA, controls & 0x0f);
583   discrete_sound_w(device, space, MAZE_P2_DATA, (controls >> 4) & 0x0f);
584   discrete_sound_w(device, space, MAZE_JOYSTICK_IN_USE, controls != 0xff);
584585
585586   /* The coin line is connected directly to the discrete circuit. */
586587   /* We can't really do that, so updating it with the tone timing is close enough. */
587588   /* A better option might be to update it at vblank or set a timer to do it. */
588589   /* The only noticeable difference doing it here, is that the controls don't */
589590   /* immediately start making tones if pressed right after the coin is inserted. */
590   discrete_sound_w(device, MAZE_COIN, (~device->machine().root_device().ioport("IN1")->read() >> 3) & 0x01);
591   discrete_sound_w(device, space, MAZE_COIN, (~device->machine().root_device().ioport("IN1")->read() >> 3) & 0x01);
591592}
592593
593594
r17961r17962
825826
826827   coin_counter_w(device->machine(), 0, (data >> 2) & 0x01);
827828
828   discrete_sound_w(device, BOOTHILL_GAME_ON_EN, (data >> 3) & 0x01);
829   discrete_sound_w(device, space, BOOTHILL_GAME_ON_EN, (data >> 3) & 0x01);
829830
830   discrete_sound_w(device, BOOTHILL_LEFT_SHOT_EN, (data >> 4) & 0x01);
831   discrete_sound_w(device, space, BOOTHILL_LEFT_SHOT_EN, (data >> 4) & 0x01);
831832
832   discrete_sound_w(device, BOOTHILL_RIGHT_SHOT_EN, (data >> 5) & 0x01);
833   discrete_sound_w(device, space, BOOTHILL_RIGHT_SHOT_EN, (data >> 5) & 0x01);
833834
834   discrete_sound_w(device, BOOTHILL_LEFT_HIT_EN, (data >> 6) & 0x01);
835   discrete_sound_w(device, space, BOOTHILL_LEFT_HIT_EN, (data >> 6) & 0x01);
835836
836   discrete_sound_w(device, BOOTHILL_RIGHT_HIT_EN, (data >> 7) & 0x01);
837   discrete_sound_w(device, space, BOOTHILL_RIGHT_HIT_EN, (data >> 7) & 0x01);
837838}
838839
839840
r17961r17962
10501051
10511052WRITE8_DEVICE_HANDLER( checkmat_audio_w )
10521053{
1053   discrete_sound_w(device, CHECKMAT_TONE_EN, data & 0x01);
1054   discrete_sound_w(device, space, CHECKMAT_TONE_EN, data & 0x01);
10541055
1055   discrete_sound_w(device, CHECKMAT_BOOM_EN, (data >> 1) & 0x01);
1056   discrete_sound_w(device, space, CHECKMAT_BOOM_EN, (data >> 1) & 0x01);
10561057
10571058   coin_counter_w(device->machine(), 0, (data >> 2) & 0x01);
10581059
10591060   device->machine().sound().system_enable((data >> 3) & 0x01);
10601061
1061   discrete_sound_w(device, CHECKMAT_TONE_DATA_45, (data >> 4) & 0x03);
1062   discrete_sound_w(device, CHECKMAT_TONE_DATA_67, (data >> 6) & 0x03);
1062   discrete_sound_w(device, space, CHECKMAT_TONE_DATA_45, (data >> 4) & 0x03);
1063   discrete_sound_w(device, space, CHECKMAT_TONE_DATA_67, (data >> 6) & 0x03);
10631064}
10641065
10651066
r17961r17962
12651266
12661267   coin_counter_w(device->machine(), 0, (data >> 2) & 0x01);
12671268
1268   discrete_sound_w(device, DESERTGU_GAME_ON_EN, (data >> 3) & 0x01);
1269   discrete_sound_w(device, space, DESERTGU_GAME_ON_EN, (data >> 3) & 0x01);
12691270
1270   discrete_sound_w(device, DESERTGU_RIFLE_SHOT_EN, (data >> 4) & 0x01);
1271   discrete_sound_w(device, space, DESERTGU_RIFLE_SHOT_EN, (data >> 4) & 0x01);
12711272
1272   discrete_sound_w(device, DESERTGU_BOTTLE_HIT_EN, (data >> 5) & 0x01);
1273   discrete_sound_w(device, space, DESERTGU_BOTTLE_HIT_EN, (data >> 5) & 0x01);
12731274
1274   discrete_sound_w(device, DESERTGU_ROAD_RUNNER_HIT_EN, (data >> 6) & 0x01);
1275   discrete_sound_w(device, space, DESERTGU_ROAD_RUNNER_HIT_EN, (data >> 6) & 0x01);
12751276
1276   discrete_sound_w(device, DESERTGU_CREATURE_HIT_EN, (data >> 7) & 0x01);
1277   discrete_sound_w(device, space, DESERTGU_CREATURE_HIT_EN, (data >> 7) & 0x01);
12771278}
12781279
12791280
r17961r17962
12811282{
12821283   mw8080bw_state *state = device->machine().driver_data<mw8080bw_state>();
12831284
1284   discrete_sound_w(device, DESERTGU_ROADRUNNER_BEEP_BEEP_EN, (data >> 0) & 0x01);
1285   discrete_sound_w(device, space, DESERTGU_ROADRUNNER_BEEP_BEEP_EN, (data >> 0) & 0x01);
12851286
1286   discrete_sound_w(device, DESERTGU_TRIGGER_CLICK_EN, (data >> 1) & 0x01);
1287   discrete_sound_w(device, space, DESERTGU_TRIGGER_CLICK_EN, (data >> 1) & 0x01);
12871288
12881289   output_set_value("Player1_Gun_Recoil", (data >> 2) & 0x01);
12891290
r17961r17962
15281529
15291530WRITE8_DEVICE_HANDLER( dplay_audio_w )
15301531{
1531   discrete_sound_w(device, DPLAY_TONE_ON_EN, (data >> 0) & 0x01);
1532   discrete_sound_w(device, space, DPLAY_TONE_ON_EN, (data >> 0) & 0x01);
15321533
1533   discrete_sound_w(device, DPLAY_CHEER_EN, (data >> 1) & 0x01);
1534   discrete_sound_w(device, space, DPLAY_CHEER_EN, (data >> 1) & 0x01);
15341535
1535   discrete_sound_w(device, DPLAY_SIREN_EN, (data >> 2) & 0x01);
1536   discrete_sound_w(device, space, DPLAY_SIREN_EN, (data >> 2) & 0x01);
15361537
1537   discrete_sound_w(device, DPLAY_WHISTLE_EN, (data >> 3) & 0x01);
1538   discrete_sound_w(device, space, DPLAY_WHISTLE_EN, (data >> 3) & 0x01);
15381539
1539   discrete_sound_w(device, DPLAY_GAME_ON_EN, (data >> 4) & 0x01);
1540   discrete_sound_w(device, space, DPLAY_GAME_ON_EN, (data >> 4) & 0x01);
15401541
15411542   coin_counter_w(device->machine(), 0, (data >> 5) & 0x01);
15421543
r17961r17962
19501951   mw8080bw_state *state = device->machine().driver_data<mw8080bw_state>();
19511952   UINT8 rising_bits = data & ~state->m_port_2_last;
19521953
1953   discrete_sound_w(device, CLOWNS_POP_BOTTOM_EN, (data >> 0) & 0x01);
1954   discrete_sound_w(device, space, CLOWNS_POP_BOTTOM_EN, (data >> 0) & 0x01);
19541955
1955   discrete_sound_w(device, CLOWNS_POP_MIDDLE_EN, (data >> 1) & 0x01);
1956   discrete_sound_w(device, space, CLOWNS_POP_MIDDLE_EN, (data >> 1) & 0x01);
19561957
1957   discrete_sound_w(device, CLOWNS_POP_TOP_EN, (data >> 2) & 0x01);
1958   discrete_sound_w(device, space, CLOWNS_POP_TOP_EN, (data >> 2) & 0x01);
19581959
19591960   device->machine().sound().system_enable((data >> 3) & 0x01);
19601961
1961   discrete_sound_w(device, CLOWNS_SPRINGBOARD_HIT_EN, (data >> 4) & 0x01);
1962   discrete_sound_w(device, space, CLOWNS_SPRINGBOARD_HIT_EN, (data >> 4) & 0x01);
19621963
19631964   if (rising_bits & 0x20) state->m_samples->start(0, 0);  /* springboard miss */
19641965
r17961r17962
23112312
23122313   device->machine().sound().system_enable((data >> 2) & 0x01);
23132314
2314   discrete_sound_w(device, SPACWALK_SPACE_SHIP_EN, (data >> 3) & 0x01);
2315   discrete_sound_w(device, space, SPACWALK_SPACE_SHIP_EN, (data >> 3) & 0x01);
23152316}
23162317
23172318WRITE8_DEVICE_HANDLER( spacwalk_audio_2_w )
23182319{
2319   discrete_sound_w(device, SPACWALK_TARGET_HIT_BOTTOM_EN, (data >> 0) & 0x01);
2320   discrete_sound_w(device, space, SPACWALK_TARGET_HIT_BOTTOM_EN, (data >> 0) & 0x01);
23202321
2321   discrete_sound_w(device, SPACWALK_TARGET_HIT_MIDDLE_EN, (data >> 1) & 0x01);
2322   discrete_sound_w(device, space, SPACWALK_TARGET_HIT_MIDDLE_EN, (data >> 1) & 0x01);
23222323
2323   discrete_sound_w(device, SPACWALK_TARGET_HIT_TOP_EN, (data >> 2) & 0x01);
2324   discrete_sound_w(device, space, SPACWALK_TARGET_HIT_TOP_EN, (data >> 2) & 0x01);
23242325
2325   discrete_sound_w(device, SPACWALK_SPRINGBOARD_HIT1_EN, (data >> 3) & 0x01);
2326   discrete_sound_w(device, space, SPACWALK_SPRINGBOARD_HIT1_EN, (data >> 3) & 0x01);
23262327
2327   discrete_sound_w(device, SPACWALK_SPRINGBOARD_HIT2_EN, (data >> 4) & 0x01);
2328   discrete_sound_w(device, space, SPACWALK_SPRINGBOARD_HIT2_EN, (data >> 4) & 0x01);
23282329
2329   discrete_sound_w(device, SPACWALK_SPRINGBOARD_MISS_EN, (data >> 5) & 0x01);
2330   discrete_sound_w(device, space, SPACWALK_SPRINGBOARD_MISS_EN, (data >> 5) & 0x01);
23302331}
23312332
23322333
r17961r17962
25352536
25362537WRITE8_DEVICE_HANDLER( shuffle_audio_1_w )
25372538{
2538   discrete_sound_w(device, SHUFFLE_CLICK_EN, (data >> 0) & 0x01);
2539   discrete_sound_w(device, space, SHUFFLE_CLICK_EN, (data >> 0) & 0x01);
25392540
2540   discrete_sound_w(device, SHUFFLE_ROLLOVER_EN, (data >> 1) & 0x01);
2541   discrete_sound_w(device, space, SHUFFLE_ROLLOVER_EN, (data >> 1) & 0x01);
25412542
25422543   device->machine().sound().system_enable((data >> 2) & 0x01);
25432544
2544   discrete_sound_w(device, NODE_29, (data >> 3) & 0x07);
2545   discrete_sound_w(device, space, NODE_29, (data >> 3) & 0x07);
25452546
2546   discrete_sound_w(device, SHUFFLE_ROLLING_3_EN, (data >> 3) & 0x01);
2547   discrete_sound_w(device, SHUFFLE_ROLLING_2_EN, (data >> 4) & 0x01);
2548   discrete_sound_w(device, SHUFFLE_ROLLING_1_EN, (data >> 5) & 0x01);
2547   discrete_sound_w(device, space, SHUFFLE_ROLLING_3_EN, (data >> 3) & 0x01);
2548   discrete_sound_w(device, space, SHUFFLE_ROLLING_2_EN, (data >> 4) & 0x01);
2549   discrete_sound_w(device, space, SHUFFLE_ROLLING_1_EN, (data >> 5) & 0x01);
25492550
25502551   /* D6 and D7 are not connected */
25512552}
r17961r17962
25532554
25542555WRITE8_DEVICE_HANDLER( shuffle_audio_2_w )
25552556{
2556   discrete_sound_w(device, SHUFFLE_FOUL_EN, (data >> 0) & 0x01);
2557   discrete_sound_w(device, space, SHUFFLE_FOUL_EN, (data >> 0) & 0x01);
25572558
25582559   coin_counter_w(device->machine(), 0, (data >> 1) & 0x01);
25592560
r17961r17962
27202721   coin_counter_w(device->machine(), 0, (data >> 2) & 0x01);
27212722
27222723   device->machine().sound().system_enable((data >> 3) & 0x01);
2723   discrete_sound_w(device, DOGPATCH_GAME_ON_EN, (data >> 3) & 0x01);
2724   discrete_sound_w(device, space, DOGPATCH_GAME_ON_EN, (data >> 3) & 0x01);
27242725
2725   discrete_sound_w(device, DOGPATCH_LEFT_SHOT_EN, (data >> 4) & 0x01);
2726   discrete_sound_w(device, space, DOGPATCH_LEFT_SHOT_EN, (data >> 4) & 0x01);
27262727
2727   discrete_sound_w(device, DOGPATCH_RIGHT_SHOT_EN, (data >> 5) & 0x01);
2728   discrete_sound_w(device, space, DOGPATCH_RIGHT_SHOT_EN, (data >> 5) & 0x01);
27282729
2729   discrete_sound_w(device, DOGPATCH_HIT_EN, (data >> 6) & 0x01);
2730   discrete_sound_w(device, space, DOGPATCH_HIT_EN, (data >> 6) & 0x01);
27302731}
27312732
27322733
r17961r17962
32583259   /* D1 is marked as 'OPTIONAL SWITCH VIDEO FOR COCKTAIL',
32593260       but it is never set by the software */
32603261
3261   discrete_sound_w(device, SPCENCTR_CRASH_EN, (data >> 2) & 0x01);
3262   discrete_sound_w(device, space, SPCENCTR_CRASH_EN, (data >> 2) & 0x01);
32623263
32633264   /* D3-D7 are not connected */
32643265}
r17961r17962
32703271
32713272   /* set WIND SOUND FREQ(data & 0x0f)  0, if no wind */
32723273
3273   discrete_sound_w(device, SPCENCTR_EXPLOSION_EN, (data >> 4) & 0x01);
3274   discrete_sound_w(device, space, SPCENCTR_EXPLOSION_EN, (data >> 4) & 0x01);
32743275
3275   discrete_sound_w(device, SPCENCTR_PLAYER_SHOT_EN, (data >> 5) & 0x01);
3276   discrete_sound_w(device, space, SPCENCTR_PLAYER_SHOT_EN, (data >> 5) & 0x01);
32763277
32773278   /* D6 and D7 are not connected */
32783279
r17961r17962
32863287
32873288   /* if (data & 0x01)  enable SCREECH (hit the sides) sound */
32883289
3289   discrete_sound_w(device, SPCENCTR_ENEMY_SHIP_SHOT_EN, (data >> 1) & 0x01);
3290   discrete_sound_w(device, space, SPCENCTR_ENEMY_SHIP_SHOT_EN, (data >> 1) & 0x01);
32903291
32913292   state->m_spcenctr_strobe_state = (data >> 2) & 0x01;
32923293
32933294   output_set_value("LAMP", (data >> 3) & 0x01);
32943295
3295   discrete_sound_w(device, SPCENCTR_BONUS_EN, (data >> 4) & 0x01);
3296   discrete_sound_w(device, space, SPCENCTR_BONUS_EN, (data >> 4) & 0x01);
32963297
32973298   sn76477_enable_w(state->m_sn, (data >> 5) & 0x01);   /* saucer sound */
32983299
r17961r17962
34683469
34693470   device->machine().sound().system_enable((data >> 2) & 0x01);
34703471
3471   discrete_sound_w(device, BOWLER_FOWL_EN, (data >> 3) & 0x01);
3472   discrete_sound_w(device, space, BOWLER_FOWL_EN, (data >> 3) & 0x01);
34723473
34733474   /* D4 - appears to be a screen flip, but it's
34743475            shown unconnected on the schematics for both the
r17961r17962
41894190
41904191   sn76477_enable_w(state->m_sn, (~data >> 0) & 0x01);   /* saucer sound */
41914192
4192   discrete_sound_w(device, INVADERS_NODE(INVADERS_MISSILE_EN, 1), data & 0x02);
4193   discrete_sound_w(device, INVADERS_NODE(INVADERS_EXPLOSION_EN, 1), data & 0x04);
4194   discrete_sound_w(device, INVADERS_NODE(INVADERS_INVADER_HIT_EN, 1), data & 0x08);
4195   discrete_sound_w(device, INVADERS_NODE(INVADERS_BONUS_MISSLE_BASE_EN, 1), data & 0x10);
4193   discrete_sound_w(device, space, INVADERS_NODE(INVADERS_MISSILE_EN, 1), data & 0x02);
4194   discrete_sound_w(device, space, INVADERS_NODE(INVADERS_EXPLOSION_EN, 1), data & 0x04);
4195   discrete_sound_w(device, space, INVADERS_NODE(INVADERS_INVADER_HIT_EN, 1), data & 0x08);
4196   discrete_sound_w(device, space, INVADERS_NODE(INVADERS_BONUS_MISSLE_BASE_EN, 1), data & 0x10);
41964197
41974198   device->machine().sound().system_enable(data & 0x20);
41984199
r17961r17962
42044205{
42054206   mw8080bw_state *state = device->machine().driver_data<mw8080bw_state>();
42064207
4207   discrete_sound_w(device, INVADERS_NODE(INVADERS_FLEET_DATA, 1), data & 0x0f);
4208   discrete_sound_w(device, INVADERS_NODE(INVADERS_SAUCER_HIT_EN, 1), data & 0x10);
4208   discrete_sound_w(device, space, INVADERS_NODE(INVADERS_FLEET_DATA, 1), data & 0x0f);
4209   discrete_sound_w(device, space, INVADERS_NODE(INVADERS_SAUCER_HIT_EN, 1), data & 0x10);
42094210
42104211   /* the flip screen line is only connected on the cocktail PCB */
42114212   if (invaders_is_cabinet_cocktail(device->machine()))
r17961r17962
45904591
45914592WRITE8_DEVICE_HANDLER( blueshrk_audio_w )
45924593{
4593   discrete_sound_w(device, BLUESHRK_GAME_ON_EN, (data >> 0) & 0x01);
4594   discrete_sound_w(device, space, BLUESHRK_GAME_ON_EN, (data >> 0) & 0x01);
45944595
4595   discrete_sound_w(device, BLUESHRK_SHOT_EN, (data >> 1) & 0x01);
4596   discrete_sound_w(device, space, BLUESHRK_SHOT_EN, (data >> 1) & 0x01);
45964597
4597   discrete_sound_w(device, BLUESHRK_HIT_EN, (data >> 2) & 0x01);
4598   discrete_sound_w(device, space, BLUESHRK_HIT_EN, (data >> 2) & 0x01);
45984599
4599   discrete_sound_w(device, BLUESHRK_SHARK_EN, (data >> 3) & 0x01);
4600   discrete_sound_w(device, space, BLUESHRK_SHARK_EN, (data >> 3) & 0x01);
46004601
46014602   /* if (data & 0x10)  enable KILLED DIVER sound, this circuit
46024603       doesn't appear to be on the schematics */
46034604
4604   discrete_sound_w(device, BLUESHRK_OCTOPUS_EN, (data >> 5) & 0x01);
4605   discrete_sound_w(device, space, BLUESHRK_OCTOPUS_EN, (data >> 5) & 0x01);
46054606
46064607   /* D6 and D7 are not connected */
46074608}
r17961r17962
48224823
48234824   sn76477_enable_w(state->m_sn1, (~data >> 0) & 0x01);   /* saucer sound */
48244825
4825   discrete_sound_w(device, INVADERS_NODE(INVADERS_MISSILE_EN, 1), data & 0x02);
4826   discrete_sound_w(device, INVADERS_NODE(INVADERS_EXPLOSION_EN, 1), data & 0x04);
4827   discrete_sound_w(device, INVADERS_NODE(INVADERS_INVADER_HIT_EN, 1), data & 0x08);
4828   discrete_sound_w(device, INVADERS_NODE(INVADERS_BONUS_MISSLE_BASE_EN, 1), data & 0x10);
4826   discrete_sound_w(device, space, INVADERS_NODE(INVADERS_MISSILE_EN, 1), data & 0x02);
4827   discrete_sound_w(device, space, INVADERS_NODE(INVADERS_EXPLOSION_EN, 1), data & 0x04);
4828   discrete_sound_w(device, space, INVADERS_NODE(INVADERS_INVADER_HIT_EN, 1), data & 0x08);
4829   discrete_sound_w(device, space, INVADERS_NODE(INVADERS_BONUS_MISSLE_BASE_EN, 1), data & 0x10);
48294830
48304831   device->machine().sound().system_enable(data & 0x20);
48314832
r17961r17962
48354836
48364837WRITE8_DEVICE_HANDLER( invad2ct_audio_2_w )
48374838{
4838   discrete_sound_w(device, INVADERS_NODE(INVADERS_FLEET_DATA, 1), data & 0x0f);
4839   discrete_sound_w(device, INVADERS_NODE(INVADERS_SAUCER_HIT_EN, 1), data & 0x10);
4839   discrete_sound_w(device, space, INVADERS_NODE(INVADERS_FLEET_DATA, 1), data & 0x0f);
4840   discrete_sound_w(device, space, INVADERS_NODE(INVADERS_SAUCER_HIT_EN, 1), data & 0x10);
48404841
48414842   /* D5-D7 are not connected */
48424843}
r17961r17962
48484849
48494850   sn76477_enable_w(state->m_sn2, (~data >> 0) & 0x01);   /* saucer sound */
48504851
4851   discrete_sound_w(device, INVADERS_NODE(INVADERS_MISSILE_EN, 2), data & 0x02);
4852   discrete_sound_w(device, INVADERS_NODE(INVADERS_EXPLOSION_EN, 2), data & 0x04);
4853   discrete_sound_w(device, INVADERS_NODE(INVADERS_INVADER_HIT_EN, 2), data & 0x08);
4854   discrete_sound_w(device, INVADERS_NODE(INVADERS_BONUS_MISSLE_BASE_EN, 2), data & 0x10);
4852   discrete_sound_w(device, space, INVADERS_NODE(INVADERS_MISSILE_EN, 2), data & 0x02);
4853   discrete_sound_w(device, space, INVADERS_NODE(INVADERS_EXPLOSION_EN, 2), data & 0x04);
4854   discrete_sound_w(device, space, INVADERS_NODE(INVADERS_INVADER_HIT_EN, 2), data & 0x08);
4855   discrete_sound_w(device, space, INVADERS_NODE(INVADERS_BONUS_MISSLE_BASE_EN, 2), data & 0x10);
48554856
48564857   /* D5-D7 are not connected */
48574858}
r17961r17962
48594860
48604861WRITE8_DEVICE_HANDLER( invad2ct_audio_4_w )
48614862{
4862   discrete_sound_w(device, INVADERS_NODE(INVADERS_FLEET_DATA, 2), data & 0x0f);
4863   discrete_sound_w(device, INVADERS_NODE(INVADERS_SAUCER_HIT_EN, 2), data & 0x10);
4863   discrete_sound_w(device, space, INVADERS_NODE(INVADERS_FLEET_DATA, 2), data & 0x0f);
4864   discrete_sound_w(device, space, INVADERS_NODE(INVADERS_SAUCER_HIT_EN, 2), data & 0x10);
48644865
48654866   /* D5-D7 are not connected */
48664867}
trunk/src/mame/machine/taitoio.c
r17961r17962
162162READ8_DEVICE_HANDLER( tc0220ioc_portreg_r )
163163{
164164   tc0220ioc_state *tc0220ioc =  tc0220ioc_get_safe_token(device);
165   return tc0220ioc_r(device, tc0220ioc->port);
165   return tc0220ioc_r(device, space, tc0220ioc->port);
166166}
167167
168168WRITE8_DEVICE_HANDLER( tc0220ioc_portreg_w )
169169{
170170   tc0220ioc_state *tc0220ioc =  tc0220ioc_get_safe_token(device);
171   tc0220ioc_w(device, tc0220ioc->port, data);
171   tc0220ioc_w(device, space, tc0220ioc->port, data);
172172}
173173
174174
r17961r17962
300300
301301READ16_DEVICE_HANDLER( tc0510nio_halfword_r )
302302{
303   return tc0510nio_r(device, offset);
303   return tc0510nio_r(device, space, offset);
304304}
305305
306306WRITE16_DEVICE_HANDLER( tc0510nio_halfword_w )
307307{
308308   if (ACCESSING_BITS_0_7)
309      tc0510nio_w(device, offset, data & 0xff);
309      tc0510nio_w(device, space, offset, data & 0xff);
310310   else
311311   {
312312      /* driftout writes the coin counters here - bug? */
313313//logerror("CPU #0 PC %06x: warning - write to MSB of TC0510NIO address %02x\n",space->device().safe_pc(),offset);
314      tc0510nio_w(device, offset, (data >> 8) & 0xff);
314      tc0510nio_w(device, space, offset, (data >> 8) & 0xff);
315315   }
316316}
317317
318318READ16_DEVICE_HANDLER( tc0510nio_halfword_wordswap_r )
319319{
320   return tc0510nio_halfword_r(device, offset ^ 1, mem_mask);
320   return tc0510nio_halfword_r(device, space, offset ^ 1, mem_mask);
321321}
322322
323323WRITE16_DEVICE_HANDLER( tc0510nio_halfword_wordswap_w )
324324{
325   tc0510nio_halfword_w(device, offset ^ 1,data, mem_mask);
325   tc0510nio_halfword_w(device, space, offset ^ 1,data, mem_mask);
326326}
327327
328328
r17961r17962
450450
451451READ16_DEVICE_HANDLER( tc0640fio_halfword_r )
452452{
453   return tc0640fio_r(device, offset);
453   return tc0640fio_r(device, space, offset);
454454}
455455
456456WRITE16_DEVICE_HANDLER( tc0640fio_halfword_w )
457457{
458458   if (ACCESSING_BITS_0_7)
459      tc0640fio_w(device, offset, data & 0xff);
459      tc0640fio_w(device, space, offset, data & 0xff);
460460   else
461461   {
462      tc0640fio_w(device, offset, (data >> 8) & 0xff);
462      tc0640fio_w(device, space, offset, (data >> 8) & 0xff);
463463//logerror("CPU #0 PC %06x: warning - write to MSB of TC0640FIO address %02x\n",space->device().safe_pc(),offset);
464464   }
465465}
466466
467467READ16_DEVICE_HANDLER( tc0640fio_halfword_byteswap_r )
468468{
469   return tc0640fio_halfword_r(device, offset, mem_mask) << 8;
469   return tc0640fio_halfword_r(device, space, offset, mem_mask) << 8;
470470}
471471
472472WRITE16_DEVICE_HANDLER( tc0640fio_halfword_byteswap_w )
473473{
474474   if (ACCESSING_BITS_8_15)
475      tc0640fio_w(device, offset, (data >> 8) & 0xff);
475      tc0640fio_w(device, space, offset, (data >> 8) & 0xff);
476476   else
477477   {
478      tc0640fio_w(device, offset, data & 0xff);
478      tc0640fio_w(device, space, offset, data & 0xff);
479479//logerror("CPU #0 PC %06x: warning - write to LSB of TC0640FIO address %02x\n",space->device().safe_pc(),offset);
480480   }
481481}
trunk/src/mame/machine/nmk004.c
r17961r17962
311311static void fm_update(int channel)
312312{
313313   struct fm_control *fm = &NMK004_state.fm_control[channel];
314   address_space &space = *NMK004_state.machine().firstcpu->space(AS_PROGRAM);
314315
315316   // advance the timers
316317   if (fm->timer1)
r17961r17962
356357                     fm->slot = read8(fm->current++);
357358                     if (channel < 3 || !(NMK004_state.fm_control[channel-3].flags & FM_FLAG_ACTIVE))
358359                     {
359                        ym2203_control_port_w(NMK004_state.ymdevice, 0, 0x28);   // keyon/off
360                        ym2203_write_port_w(NMK004_state.ymdevice, 0, channel % 3);
360                        ym2203_control_port_w(NMK004_state.ymdevice, space, 0, 0x28);   // keyon/off
361                        ym2203_write_port_w(NMK004_state.ymdevice, space, 0, channel % 3);
361362                     }
362363                     break;
363364
r17961r17962
594595   };
595596   int channel,i;
596597
598   address_space &space = *NMK004_state.machine().firstcpu->space(AS_PROGRAM);
597599   for (channel = 0; channel < 3;channel++)
598600   {
599601      struct fm_control *fm1 = &NMK004_state.fm_control[channel];
r17961r17962
605607
606608         for (i = 0; i < 0x18; i++)
607609         {
608            ym2203_control_port_w(NMK004_state.ymdevice, 0, ym2203_registers[i] + channel);
609            ym2203_write_port_w(NMK004_state.ymdevice, 0, fm1->voice_params[i]);
610            ym2203_control_port_w(NMK004_state.ymdevice, space, 0, ym2203_registers[i] + channel);
611            ym2203_write_port_w(NMK004_state.ymdevice, space, 0, fm1->voice_params[i]);
610612         }
611613      }
612614
r17961r17962
618620         {
619621            for (i = 0; i < 0x18; i++)
620622            {
621               ym2203_control_port_w(NMK004_state.ymdevice, 0, ym2203_registers[i] + channel);
622               ym2203_write_port_w(NMK004_state.ymdevice, 0, fm2->voice_params[i]);
623               ym2203_control_port_w(NMK004_state.ymdevice, space, 0, ym2203_registers[i] + channel);
624               ym2203_write_port_w(NMK004_state.ymdevice, space, 0, fm2->voice_params[i]);
623625            }
624626         }
625627      }
r17961r17962
627629
628630      if (fm1->flags & FM_FLAG_ACTIVE)
629631      {
630         ym2203_control_port_w(NMK004_state.ymdevice, 0, 0xb0 + channel);   // self-feedback
631         ym2203_write_port_w(NMK004_state.ymdevice, 0, fm1->self_feedback);
632         ym2203_control_port_w(NMK004_state.ymdevice, space, 0, 0xb0 + channel);   // self-feedback
633         ym2203_write_port_w(NMK004_state.ymdevice, space, 0, fm1->self_feedback);
632634
633         ym2203_control_port_w(NMK004_state.ymdevice, 0, 0xa4 + channel);   // F-number
634         ym2203_write_port_w(NMK004_state.ymdevice, 0, fm1->f_number >> 8);
635         ym2203_control_port_w(NMK004_state.ymdevice, space, 0, 0xa4 + channel);   // F-number
636         ym2203_write_port_w(NMK004_state.ymdevice, space, 0, fm1->f_number >> 8);
635637
636         ym2203_control_port_w(NMK004_state.ymdevice, 0, 0xa0 + channel);   // F-number
637         ym2203_write_port_w(NMK004_state.ymdevice, 0, fm1->f_number & 0xff);
638         ym2203_control_port_w(NMK004_state.ymdevice, space, 0, 0xa0 + channel);   // F-number
639         ym2203_write_port_w(NMK004_state.ymdevice, space, 0, fm1->f_number & 0xff);
638640      }
639641      else
640642      {
641         ym2203_control_port_w(NMK004_state.ymdevice, 0, 0xb0 + channel);   // self-feedback
642         ym2203_write_port_w(NMK004_state.ymdevice, 0, fm2->self_feedback);
643         ym2203_control_port_w(NMK004_state.ymdevice, space, 0, 0xb0 + channel);   // self-feedback
644         ym2203_write_port_w(NMK004_state.ymdevice, space, 0, fm2->self_feedback);
643645
644         ym2203_control_port_w(NMK004_state.ymdevice, 0, 0xa4 + channel);   // F-number
645         ym2203_write_port_w(NMK004_state.ymdevice, 0, fm2->f_number >> 8);
646         ym2203_control_port_w(NMK004_state.ymdevice, space, 0, 0xa4 + channel);   // F-number
647         ym2203_write_port_w(NMK004_state.ymdevice, space, 0, fm2->f_number >> 8);
646648
647         ym2203_control_port_w(NMK004_state.ymdevice, 0, 0xa0 + channel);   // F-number
648         ym2203_write_port_w(NMK004_state.ymdevice, 0, fm2->f_number & 0xff);
649         ym2203_control_port_w(NMK004_state.ymdevice, space, 0, 0xa0 + channel);   // F-number
650         ym2203_write_port_w(NMK004_state.ymdevice, space, 0, fm2->f_number & 0xff);
649651      }
650652
651653
r17961r17962
654656      {
655657         fm1->flags &= ~FM_FLAG_MUST_SEND_KEYON;
656658
657         ym2203_control_port_w(NMK004_state.ymdevice, 0, 0x28);   // keyon/off
658         ym2203_write_port_w(NMK004_state.ymdevice, 0, fm1->slot | channel);
659         ym2203_control_port_w(NMK004_state.ymdevice, space, 0, 0x28);   // keyon/off
660         ym2203_write_port_w(NMK004_state.ymdevice, space, 0, fm1->slot | channel);
659661      }
660662
661663      if (fm2->flags & FM_FLAG_MUST_SEND_KEYON)
r17961r17962
664666
665667         if (!(fm1->flags & FM_FLAG_ACTIVE))
666668         {
667            ym2203_control_port_w(NMK004_state.ymdevice, 0, 0x28);   // keyon/off
668            ym2203_write_port_w(NMK004_state.ymdevice, 0, fm2->slot | channel);
669            ym2203_control_port_w(NMK004_state.ymdevice, space, 0, 0x28);   // keyon/off
670            ym2203_write_port_w(NMK004_state.ymdevice, space, 0, fm2->slot | channel);
669671         }
670672      }
671673   }
r17961r17962
682684static void psg_update(int channel)
683685{
684686   struct psg_control *psg = &NMK004_state.psg_control[channel];
687   address_space &space = *NMK004_state.machine().firstcpu->space(AS_PROGRAM);
685688
686689   // advance the timers
687690   if (psg->note_timer)
r17961r17962
703706         psg->flags &= ~PSG_FLAG_NOISE_NOT_ENABLED;
704707
705708         // enable noise, disable tone on this channel
706         ym2203_control_port_w(NMK004_state.ymdevice, 0, 0x07);
707         enable = ym2203_read_port_r(NMK004_state.ymdevice, 0);
709         ym2203_control_port_w(NMK004_state.ymdevice, space, 0, 0x07);
710         enable = ym2203_read_port_r(NMK004_state.ymdevice, space, 0);
708711         enable |=  (0x01 << channel);   // disable tone
709712         enable &= ~(0x08 << channel);   // enable noise
710         ym2203_write_port_w(NMK004_state.ymdevice, 0, enable);
713         ym2203_write_port_w(NMK004_state.ymdevice, space, 0, enable);
711714      }
712715
713716
r17961r17962
741744                     psg->flags &= ~PSG_FLAG_NOISE_NOT_ENABLED;
742745
743746                     // enable noise, disable tone on this channel
744                     ym2203_control_port_w(NMK004_state.ymdevice, 0, 0x07);
745                     enable = ym2203_read_port_r(NMK004_state.ymdevice, 0);
747                     ym2203_control_port_w(NMK004_state.ymdevice, space, 0, 0x07);
748                     enable = ym2203_read_port_r(NMK004_state.ymdevice, space, 0);
746749                     enable |=  (0x01 << channel);   // disable tone
747750                     enable &= ~(0x08 << channel);   // enable noise
748                     ym2203_write_port_w(NMK004_state.ymdevice, 0, enable);
751                     ym2203_write_port_w(NMK004_state.ymdevice, space, 0, enable);
749752                     break;
750753
751754                  case 0xf2:   // set volume shape
r17961r17962
790793                     psg->volume_shape = 0;
791794
792795                     // mute channel
793                     ym2203_control_port_w(NMK004_state.ymdevice, 0, 8 + channel);
794                     ym2203_write_port_w(NMK004_state.ymdevice, 0, 0);
796                     ym2203_control_port_w(NMK004_state.ymdevice, space, 0, 8 + channel);
797                     ym2203_write_port_w(NMK004_state.ymdevice, space, 0, 0);
795798                     return;
796799               }
797800            }
r17961r17962
831834
832835               period >>= octave;
833836
834               ym2203_control_port_w(NMK004_state.ymdevice, 0, 2 * channel + 1);
835               ym2203_write_port_w(NMK004_state.ymdevice, 0, (period & 0x0f00) >> 8);
836               ym2203_control_port_w(NMK004_state.ymdevice, 0, 2 * channel + 0);
837               ym2203_write_port_w(NMK004_state.ymdevice, 0, (period & 0x00ff));
837               ym2203_control_port_w(NMK004_state.ymdevice, space, 0, 2 * channel + 1);
838               ym2203_write_port_w(NMK004_state.ymdevice, space, 0, (period & 0x0f00) >> 8);
839               ym2203_control_port_w(NMK004_state.ymdevice, space, 0, 2 * channel + 0);
840               ym2203_write_port_w(NMK004_state.ymdevice, space, 0, (period & 0x00ff));
838841
839842               psg->note_period_hi_bits = (period & 0x0f00) >> 8;
840843            }
r17961r17962
847850                  psg->flags |= PSG_FLAG_NOISE_NOT_ENABLED;
848851
849852                  // disable noise, enable tone on this channel
850                  ym2203_control_port_w(NMK004_state.ymdevice, 0, 0x07);
851                  enable = ym2203_read_port_r(NMK004_state.ymdevice, 0);
853                  ym2203_control_port_w(NMK004_state.ymdevice, space, 0, 0x07);
854                  enable = ym2203_read_port_r(NMK004_state.ymdevice, space, 0);
852855                  enable &= ~(0x01 << channel);   // enable tone
853856                  enable |=  (0x08 << channel);   // disable noise
854                  ym2203_write_port_w(NMK004_state.ymdevice, 0, enable);
857                  ym2203_write_port_w(NMK004_state.ymdevice, space, 0, enable);
855858               }
856859
857               ym2203_control_port_w(NMK004_state.ymdevice, 0, 0x06);   // noise period
858               ym2203_write_port_w(NMK004_state.ymdevice, 0, psg->note);
860               ym2203_control_port_w(NMK004_state.ymdevice, space, 0, 0x06);   // noise period
861               ym2203_write_port_w(NMK004_state.ymdevice, space, 0, psg->note);
859862               psg->note_period_hi_bits = psg->note;
860863            }
861864         }
r17961r17962
880883            volume = 0;
881884
882885         // set volume
883         ym2203_control_port_w(NMK004_state.ymdevice, 0, 8 + channel);
884         ym2203_write_port_w(NMK004_state.ymdevice, 0, volume & 0x0f);
886         ym2203_control_port_w(NMK004_state.ymdevice, space, 0, 8 + channel);
887         ym2203_write_port_w(NMK004_state.ymdevice, space, 0, volume & 0x0f);
885888      }
886889   }
887890}
r17961r17962
10001003{
10011004   if (irq)
10021005   {
1003      int status = ym2203_status_port_r(device,0);
1006      address_space &space = *NMK004_state.machine().firstcpu->space(AS_PROGRAM);
1007      int status = ym2203_status_port_r(device,space,0);
10041008
10051009      if (status & 1)   // timer A expired
10061010      {
r17961r17962
10091013         update_music();
10101014
10111015         // restart timer
1012         ym2203_control_port_w(device, 0, 0x27);
1013         ym2203_write_port_w(device, 0, 0x15);
1016         ym2203_control_port_w(device, space, 0, 0x27);
1017         ym2203_write_port_w(device, space, 0, 0x15);
10141018      }
10151019   }
10161020}
r17961r17962
10351039
10361040   NMK004_state.rom = machine.root_device().memregion("audiocpu")->base();
10371041
1038   ym2203_control_port_w(NMK004_state.ymdevice, 0, 0x2f);
1042   address_space &space = *NMK004_state.machine().firstcpu->space(AS_PROGRAM);
1043   ym2203_control_port_w(NMK004_state.ymdevice, space, 0, 0x2f);
10391044
10401045   i = 0;
10411046   while (ym2203_init[i] != 0xff)
10421047   {
1043      ym2203_control_port_w(NMK004_state.ymdevice, 0, ym2203_init[i++]);
1044      ym2203_write_port_w(NMK004_state.ymdevice, 0, ym2203_init[i++]);
1048      ym2203_control_port_w(NMK004_state.ymdevice, space, 0, ym2203_init[i++]);
1049      ym2203_write_port_w(NMK004_state.ymdevice, space, 0, ym2203_init[i++]);
10451050   }
10461051
10471052   NMK004_state.oki_playing = 0;
trunk/src/mame/machine/taitoio.h
r17961r17962
127127***************************************************************************/
128128
129129/** TC0220IOC **/
130READ8_DEVICE_HANDLER( tc0220ioc_r );
131WRITE8_DEVICE_HANDLER( tc0220ioc_w );
132READ8_DEVICE_HANDLER( tc0220ioc_port_r );
133WRITE8_DEVICE_HANDLER( tc0220ioc_port_w );
134READ8_DEVICE_HANDLER( tc0220ioc_portreg_r );
135WRITE8_DEVICE_HANDLER( tc0220ioc_portreg_w );
130DECLARE_READ8_DEVICE_HANDLER( tc0220ioc_r );
131DECLARE_WRITE8_DEVICE_HANDLER( tc0220ioc_w );
132DECLARE_READ8_DEVICE_HANDLER( tc0220ioc_port_r );
133DECLARE_WRITE8_DEVICE_HANDLER( tc0220ioc_port_w );
134DECLARE_READ8_DEVICE_HANDLER( tc0220ioc_portreg_r );
135DECLARE_WRITE8_DEVICE_HANDLER( tc0220ioc_portreg_w );
136136
137137
138138/** TC0510NIO **/
139READ8_DEVICE_HANDLER( tc0510nio_r );
140WRITE8_DEVICE_HANDLER( tc0510nio_w );
141READ16_DEVICE_HANDLER( tc0510nio_halfword_r );
142WRITE16_DEVICE_HANDLER( tc0510nio_halfword_w );
143READ16_DEVICE_HANDLER( tc0510nio_halfword_wordswap_r );
144WRITE16_DEVICE_HANDLER( tc0510nio_halfword_wordswap_w );
139DECLARE_READ8_DEVICE_HANDLER( tc0510nio_r );
140DECLARE_WRITE8_DEVICE_HANDLER( tc0510nio_w );
141DECLARE_READ16_DEVICE_HANDLER( tc0510nio_halfword_r );
142DECLARE_WRITE16_DEVICE_HANDLER( tc0510nio_halfword_w );
143DECLARE_READ16_DEVICE_HANDLER( tc0510nio_halfword_wordswap_r );
144DECLARE_WRITE16_DEVICE_HANDLER( tc0510nio_halfword_wordswap_w );
145145
146146
147147/** TC0640FIO**/
148READ8_DEVICE_HANDLER( tc0640fio_r );
149WRITE8_DEVICE_HANDLER( tc0640fio_w );
150READ16_DEVICE_HANDLER( tc0640fio_halfword_r );
151WRITE16_DEVICE_HANDLER( tc0640fio_halfword_w );
152READ16_DEVICE_HANDLER( tc0640fio_halfword_byteswap_r );
153WRITE16_DEVICE_HANDLER( tc0640fio_halfword_byteswap_w );
148DECLARE_READ8_DEVICE_HANDLER( tc0640fio_r );
149DECLARE_WRITE8_DEVICE_HANDLER( tc0640fio_w );
150DECLARE_READ16_DEVICE_HANDLER( tc0640fio_halfword_r );
151DECLARE_WRITE16_DEVICE_HANDLER( tc0640fio_halfword_w );
152DECLARE_READ16_DEVICE_HANDLER( tc0640fio_halfword_byteswap_r );
153DECLARE_WRITE16_DEVICE_HANDLER( tc0640fio_halfword_byteswap_w );
154154
155155
156156#endif   /* __TAITOIO_H__ */
trunk/src/mame/machine/mhavoc.c
r17961r17962
311311WRITE8_MEMBER(mhavoc_state::mhavocrv_speech_strobe_w)
312312{
313313   device_t *tms = machine().device("tms");
314   tms5220_data_w(tms, 0, m_speech_write_buffer);
314   tms5220_data_w(tms, space, 0, m_speech_write_buffer);
315315}
316316
317317/*************************************
trunk/src/mame/machine/namco06.c
r17961r17962
145145
146146   for (devnum = 0; devnum < 4; devnum++)
147147      if ((state->m_control & (1 << devnum)) && state->m_read[devnum] != NULL)
148         result &= (*state->m_read[devnum])(state->m_device[devnum], 0);
148         result &= (*state->m_read[devnum])(state->m_device[devnum], space, 0, 0xff);
149149
150150   return result;
151151}
r17961r17962
166166
167167   for (devnum = 0; devnum < 4; devnum++)
168168      if ((state->m_control & (1 << devnum)) && state->m_write[devnum] != NULL)
169         (*state->m_write[devnum])(state->m_device[devnum], 0, data);
169         (*state->m_write[devnum])(state->m_device[devnum], space, 0, data, 0xff);
170170}
171171
172172
trunk/src/mame/machine/namco06.h
r17961r17962
1919   MCFG_DEVICE_CONFIG(_config)
2020
2121
22READ8_DEVICE_HANDLER( namco_06xx_data_r );
23WRITE8_DEVICE_HANDLER( namco_06xx_data_w );
24READ8_DEVICE_HANDLER( namco_06xx_ctrl_r );
25WRITE8_DEVICE_HANDLER( namco_06xx_ctrl_w );
22DECLARE_READ8_DEVICE_HANDLER( namco_06xx_data_r );
23DECLARE_WRITE8_DEVICE_HANDLER( namco_06xx_data_w );
24DECLARE_READ8_DEVICE_HANDLER( namco_06xx_ctrl_r );
25DECLARE_WRITE8_DEVICE_HANDLER( namco_06xx_ctrl_w );
2626
2727
2828/* device get info callback */
trunk/src/mame/machine/cdicdic.h
r17961r17962
128128//  READ/WRITE HANDLERS
129129//**************************************************************************
130130
131READ16_DEVICE_HANDLER( cdic_r );
132WRITE16_DEVICE_HANDLER( cdic_w );
133READ16_DEVICE_HANDLER( cdic_ram_r );
134WRITE16_DEVICE_HANDLER( cdic_ram_w );
131DECLARE_READ16_DEVICE_HANDLER( cdic_r );
132DECLARE_WRITE16_DEVICE_HANDLER( cdic_w );
133DECLARE_READ16_DEVICE_HANDLER( cdic_ram_r );
134DECLARE_WRITE16_DEVICE_HANDLER( cdic_ram_w );
135135
136136
137137#endif // __CDICDIC_H__
trunk/src/mame/machine/namcoio.h
r17961r17962
5959    DEVICE I/O FUNCTIONS
6060***************************************************************************/
6161
62READ8_DEVICE_HANDLER( namcoio_r );
63WRITE8_DEVICE_HANDLER( namcoio_w );
62DECLARE_READ8_DEVICE_HANDLER( namcoio_r );
63DECLARE_WRITE8_DEVICE_HANDLER( namcoio_w );
6464
6565WRITE_LINE_DEVICE_HANDLER( namcoio_set_reset_line );
6666READ_LINE_DEVICE_HANDLER( namcoio_read_reset_line );
trunk/src/mame/machine/namcos1.c
r17961r17962
611611      offset &= 0x3ff;
612612
613613      /* CUS 30 */
614      return namcos1_cus30_r(space->machine().device("namco"),offset);
614      return namcos1_cus30_r(space->machine().device("namco"),*space,offset);
615615   }
616616   else
617617   {
r17961r17962
630630      offset &= 0x3ff;
631631
632632      /* CUS 30 */
633      namcos1_cus30_w(space->machine().device("namco"),offset,data);
633      namcos1_cus30_w(space->machine().device("namco"),*space,offset,data);
634634   }
635635   else
636636   {
trunk/src/mame/machine/nmk112.c
r17961r17962
9292{
9393   if (ACCESSING_BITS_0_7)
9494   {
95      nmk112_okibank_w(device, offset, data & 0xff);
95      nmk112_okibank_w(device, space, offset, data & 0xff);
9696   }
9797}
9898
trunk/src/mame/machine/nmk112.h
r17961r17962
5252    DEVICE I/O FUNCTIONS
5353***************************************************************************/
5454
55WRITE8_DEVICE_HANDLER( nmk112_okibank_w );
56WRITE16_DEVICE_HANDLER( nmk112_okibank_lsb_w );
55DECLARE_WRITE8_DEVICE_HANDLER( nmk112_okibank_w );
56DECLARE_WRITE16_DEVICE_HANDLER( nmk112_okibank_lsb_w );
5757
5858
5959#endif /* __NMK112_H__ */
trunk/src/mame/machine/megadriv.c
r17961r17962
110110   //mame_printf_debug("megadriv_68k_YM2612_read %02x %04x\n",offset,mem_mask);
111111   if ( (genz80.z80_has_bus==0) && (genz80.z80_is_reset==0) )
112112   {
113      return ym2612_r(device, offset);
113      return ym2612_r(device, space, offset);
114114   }
115115   else
116116   {
r17961r17962
127127   //mame_printf_debug("megadriv_68k_YM2612_write %02x %04x %04x\n",offset,data,mem_mask);
128128   if ( (genz80.z80_has_bus==0) && (genz80.z80_is_reset==0) )
129129   {
130      ym2612_w(device, offset, data);
130      ym2612_w(device, space, offset, data);
131131   }
132132   else
133133   {
r17961r17962
820820      case 0x13:
821821      case 0x15:
822822      case 0x17:
823         sn76496_w(space->machine().device("snsnd"), 0, data);
823         sn76496_w(space->machine().device("snsnd"), *space, 0, data);
824824         break;
825825
826826      default:
trunk/src/mame/machine/amiga.c
r17961r17962
10391039   }
10401040
10411041   /* handle the reads */
1042   data = mos6526_r(cia, offset >> 7);
1042   data = mos6526_r(cia, *space, offset >> 7);
10431043
10441044   if (LOG_CIA)
10451045      logerror("%06x:cia_%c_read(%03x) = %04x & %04x\n", space->device().safe_pc(), 'A' + ((~offset & 0x0800) >> 11), offset * 2, data << shift, mem_mask);
r17961r17962
10811081   }
10821082
10831083   /* handle the writes */
1084   mos6526_w(cia, offset >> 7, (UINT8) data);
1084   mos6526_w(cia, *space, offset >> 7, (UINT8) data);
10851085}
10861086
10871087
trunk/src/mame/machine/cdislave.h
r17961r17962
119119//  READ/WRITE HANDLERS
120120//**************************************************************************
121121
122READ16_DEVICE_HANDLER( slave_r );
123WRITE16_DEVICE_HANDLER( slave_w );
122DECLARE_READ16_DEVICE_HANDLER( slave_r );
123DECLARE_WRITE16_DEVICE_HANDLER( slave_w );
124124
125125
126126#endif // __CDISLAVE_H__
trunk/src/mame/machine/namco50.h
r17961r17962
88   MCFG_DEVICE_ADD(_tag, NAMCO_50XX, _clock) \
99
1010
11READ8_DEVICE_HANDLER( namco_50xx_read );
11DECLARE_READ8_DEVICE_HANDLER( namco_50xx_read );
1212void namco_50xx_read_request(device_t *device);
13WRITE8_DEVICE_HANDLER( namco_50xx_write );
13DECLARE_WRITE8_DEVICE_HANDLER( namco_50xx_write );
1414
1515
1616/* device get info callback */
trunk/src/mame/machine/tatsumi.c
r17961r17962
337337// self-test in Tatsumi games.  Needs fixed, but hack it here for now.
338338READ8_DEVICE_HANDLER(tatsumi_hack_ym2151_r)
339339{
340   address_space *space = device->machine().device("audiocpu")->memory().space(AS_PROGRAM);
341   int r=ym2151_status_port_r(device,0);
340   int r=ym2151_status_port_r(device,space,0);
342341
343   if (space->device().safe_pc()==0x2aca || space->device().safe_pc()==0x29fe
344      || space->device().safe_pc()==0xf9721
345      || space->device().safe_pc()==0x1b96 || space->device().safe_pc()==0x1c65) // BigFight
342   if (space.device().safe_pc()==0x2aca || space.device().safe_pc()==0x29fe
343      || space.device().safe_pc()==0xf9721
344      || space.device().safe_pc()==0x1b96 || space.device().safe_pc()==0x1c65) // BigFight
346345      return 0x80;
347346   return r;
348347}
r17961r17962
351350// Mame really should emulate the OKI status reads even with Mame sound off.
352351READ8_DEVICE_HANDLER(tatsumi_hack_oki_r)
353352{
354   address_space *space = device->machine().device("audiocpu")->memory().space(AS_PROGRAM);
355   int r=downcast<okim6295_device *>(device)->read(*space,0);
353   int r=downcast<okim6295_device *>(device)->read(space,0);
356354
357   if (space->device().safe_pc()==0x2b70 || space->device().safe_pc()==0x2bb5
358      || space->device().safe_pc()==0x2acc
359      || space->device().safe_pc()==0x1c79 // BigFight
360      || space->device().safe_pc()==0x1cbe // BigFight
361      || space->device().safe_pc()==0xf9881)
355   if (space.device().safe_pc()==0x2b70 || space.device().safe_pc()==0x2bb5
356      || space.device().safe_pc()==0x2acc
357      || space.device().safe_pc()==0x1c79 // BigFight
358      || space.device().safe_pc()==0x1cbe // BigFight
359      || space.device().safe_pc()==0xf9881)
362360      return 0xf;
363   if (space->device().safe_pc()==0x2ba3 || space->device().safe_pc()==0x2a9b || space->device().safe_pc()==0x2adc
364      || space->device().safe_pc()==0x1cac) // BigFight
361   if (space.device().safe_pc()==0x2ba3 || space.device().safe_pc()==0x2a9b || space.device().safe_pc()==0x2adc
362      || space.device().safe_pc()==0x1cac) // BigFight
365363      return 0;
366364   return r;
367365}
trunk/src/mame/machine/beezer.c
r17961r17962
44#include "includes/beezer.h"
55
66
7static READ8_DEVICE_HANDLER( b_via_0_pa_r );
8static READ8_DEVICE_HANDLER( b_via_0_pb_r );
9static WRITE8_DEVICE_HANDLER( b_via_0_pa_w );
10static WRITE8_DEVICE_HANDLER( b_via_0_pb_w );
7static DECLARE_READ8_DEVICE_HANDLER( b_via_0_pa_r );
8static DECLARE_READ8_DEVICE_HANDLER( b_via_0_pb_r );
9static DECLARE_WRITE8_DEVICE_HANDLER( b_via_0_pa_w );
10static DECLARE_WRITE8_DEVICE_HANDLER( b_via_0_pb_w );
1111static READ_LINE_DEVICE_HANDLER( b_via_0_ca2_r );
1212
13static READ8_DEVICE_HANDLER( b_via_1_pa_r );
14static READ8_DEVICE_HANDLER( b_via_1_pb_r );
15static WRITE8_DEVICE_HANDLER( b_via_1_pa_w );
16static WRITE8_DEVICE_HANDLER( b_via_1_pb_w );
13static DECLARE_READ8_DEVICE_HANDLER( b_via_1_pa_r );
14static DECLARE_READ8_DEVICE_HANDLER( b_via_1_pb_r );
15static DECLARE_WRITE8_DEVICE_HANDLER( b_via_1_pa_w );
16static DECLARE_WRITE8_DEVICE_HANDLER( b_via_1_pb_w );
1717
1818
1919/* VIA 0 (aka "PPCNP74", U6 @1C on schematics)
r17961r17962
140140
141141static READ8_DEVICE_HANDLER( b_via_1_pb_r )
142142{
143   return 0x1F | (beezer_noise_r(device->machine().device("custom"), 0)?0x40:0);
143   return 0x1F | (beezer_noise_r(device->machine().device("custom"), space, 0)?0x40:0);
144144}
145145
146146static WRITE8_DEVICE_HANDLER( b_via_1_pa_w )
r17961r17962
151151
152152static WRITE8_DEVICE_HANDLER( b_via_1_pb_w )
153153{
154   beezer_timer1_w(device->machine().device("custom"), 0, data&0x80);
154   beezer_timer1_w(device->machine().device("custom"), space, 0, data&0x80);
155155   //if ((data&0x1f) != 0x01)
156156   //  popmessage("via1 pb low write of 0x%02x is not supported! contact mamedev!", data&0x1f);
157157}
trunk/src/mame/machine/mcr68.c
r17961r17962
2424static TIMER_CALLBACK( mcr68_493_callback );
2525static TIMER_CALLBACK( zwackery_493_callback );
2626
27static WRITE8_DEVICE_HANDLER( zwackery_pia0_w );
28static WRITE8_DEVICE_HANDLER( zwackery_pia1_w );
27static DECLARE_WRITE8_DEVICE_HANDLER( zwackery_pia0_w );
28static DECLARE_WRITE8_DEVICE_HANDLER( zwackery_pia1_w );
2929static WRITE_LINE_DEVICE_HANDLER( zwackery_ca2_w );
3030static WRITE_LINE_DEVICE_HANDLER( zwackery_pia_irq );
3131
trunk/src/mame/machine/atarifb.c
r17961r17962
1515
1616   m_CTRLD = data;
1717
18   discrete_sound_w(discrete, ATARIFB_WHISTLE_EN, data & 0x01);      // Whistle
19   discrete_sound_w(discrete, ATARIFB_HIT_EN, data & 0x02);         // Hit
20   discrete_sound_w(discrete, ATARIFB_ATTRACT_EN, data & 0x10);      // Attract
21   discrete_sound_w(discrete, ATARIFB_NOISE_EN, data & 0x04);         // Noise Enable / Kicker
18   discrete_sound_w(discrete, space, ATARIFB_WHISTLE_EN, data & 0x01);      // Whistle
19   discrete_sound_w(discrete, space, ATARIFB_HIT_EN, data & 0x02);         // Hit
20   discrete_sound_w(discrete, space, ATARIFB_ATTRACT_EN, data & 0x10);      // Attract
21   discrete_sound_w(discrete, space, ATARIFB_NOISE_EN, data & 0x04);         // Noise Enable / Kicker
2222}
2323
2424
r17961r17962
2828
2929   m_CTRLD = data;
3030
31   discrete_sound_w(discrete, ATARIFB_WHISTLE_EN, data & 0x01);      // Whistle
32   discrete_sound_w(discrete, ATARIFB_HIT_EN, data & 0x02);         // Hit
33   discrete_sound_w(discrete, ATARIFB_ATTRACT_EN, data & 0x10);      // Attract
34   discrete_sound_w(discrete, ATARIFB_NOISE_EN, data & 0x04);         // Noise Enable / Kicker
31   discrete_sound_w(discrete, space, ATARIFB_WHISTLE_EN, data & 0x01);      // Whistle
32   discrete_sound_w(discrete, space, ATARIFB_HIT_EN, data & 0x02);         // Hit
33   discrete_sound_w(discrete, space, ATARIFB_ATTRACT_EN, data & 0x10);      // Attract
34   discrete_sound_w(discrete, space, ATARIFB_NOISE_EN, data & 0x04);         // Noise Enable / Kicker
3535
3636   coin_counter_w(machine(), 1, data & 0x80);
3737}
r17961r17962
4343
4444   m_CTRLD = data;
4545
46   discrete_sound_w(discrete, ATARIFB_WHISTLE_EN, data & 0x01);      // Whistle
47   discrete_sound_w(discrete, ATARIFB_HIT_EN, data & 0x02);         // Hit
48   discrete_sound_w(discrete, ATARIFB_ATTRACT_EN, data & 0x10);      // Attract
49   discrete_sound_w(discrete, ATARIFB_NOISE_EN, data & 0x04);         // Noise Enable / Kicker
46   discrete_sound_w(discrete, space, ATARIFB_WHISTLE_EN, data & 0x01);      // Whistle
47   discrete_sound_w(discrete, space, ATARIFB_HIT_EN, data & 0x02);         // Hit
48   discrete_sound_w(discrete, space, ATARIFB_ATTRACT_EN, data & 0x10);      // Attract
49   discrete_sound_w(discrete, space, ATARIFB_NOISE_EN, data & 0x04);         // Noise Enable / Kicker
5050
5151   if (data & 0x80)
5252   {
r17961r17962
7777   /* bit 5-6 = trackball CTRL bits */
7878   /* bit 7 = Rule LED */
7979
80   discrete_sound_w(discrete, ATARIFB_WHISTLE_EN, data & 0x01);      // Whistle
81   discrete_sound_w(discrete, ATARIFB_HIT_EN, data & 0x02);         // Hit
82   discrete_sound_w(discrete, ATARIFB_ATTRACT_EN, data & 0x10);      // Attract
83   discrete_sound_w(discrete, ATARIFB_NOISE_EN, data & 0x04);         // Noise Enable / Kicker
80   discrete_sound_w(discrete, space, ATARIFB_WHISTLE_EN, data & 0x01);      // Whistle
81   discrete_sound_w(discrete, space, ATARIFB_HIT_EN, data & 0x02);         // Hit
82   discrete_sound_w(discrete, space, ATARIFB_ATTRACT_EN, data & 0x10);      // Attract
83   discrete_sound_w(discrete, space, ATARIFB_NOISE_EN, data & 0x04);         // Noise Enable / Kicker
8484
8585//  set_led_status(machine(), 0, data & 0x10);  // !!!!!!!!!! Is this correct????
8686   set_led_status(machine(), 1, data & 0x80);
r17961r17962
9191{
9292   device_t *discrete = machine().device("discrete");
9393
94   discrete_sound_w(discrete, ATARIFB_CROWD_DATA, data & 0x0f);   // Crowd
94   discrete_sound_w(discrete, space, ATARIFB_CROWD_DATA, data & 0x0f);   // Crowd
9595
9696   coin_counter_w (machine(), 0, data & 0x10);
9797}
r17961r17962
101101{
102102   device_t *discrete = machine().device("discrete");
103103
104   discrete_sound_w(discrete, ATARIFB_CROWD_DATA, data & 0x0f);   // Crowd
104   discrete_sound_w(discrete, space, ATARIFB_CROWD_DATA, data & 0x0f);   // Crowd
105105
106106   coin_counter_w (machine(), 0, data & 0x10);
107107   coin_counter_w (machine(), 1, data & 0x20);
trunk/src/mame/machine/namco51.h
r17961r17962
1616   MCFG_DEVICE_CONFIG(_interface)
1717
1818
19READ8_DEVICE_HANDLER( namco_51xx_read );
20WRITE8_DEVICE_HANDLER( namco_51xx_write );
19DECLARE_READ8_DEVICE_HANDLER( namco_51xx_read );
20DECLARE_WRITE8_DEVICE_HANDLER( namco_51xx_write );
2121
2222
2323class namco_51xx_device : public device_t
trunk/src/mame/machine/simpsons.c
r17961r17962
5353
5454READ8_DEVICE_HANDLER( simpsons_sound_r )
5555{
56   return k053260_r(device, 2 + offset);
56   return k053260_r(device, space, 2 + offset);
5757}
5858
5959
trunk/src/mame/machine/megavdp.c
r17961r17962
854854      case 0x12:
855855      case 0x14:
856856      case 0x16:
857         if (ACCESSING_BITS_0_7) sn76496_w(space.machine().device(":snsnd"), 0, data & 0xff);
857         if (ACCESSING_BITS_0_7) sn76496_w(space.machine().device(":snsnd"), space, 0, data & 0xff);
858858         //if (ACCESSING_BITS_8_15) sn76496_w(space->machine().device("snsnd"), 0, (data >>8) & 0xff);
859859         break;
860860
trunk/src/mame/machine/cd32.c
r17961r17962
774774READ32_DEVICE_HANDLER( amiga_akiko32_r )
775775{
776776   akiko_state *state = get_safe_token(device);
777   address_space *space = state->m_space;
778777   UINT32      retval;
779778
780779   if ( LOG_AKIKO && offset < (0x30/4) )
781780   {
782      logerror( "Reading AKIKO reg %0x [%s] at PC=%06x\n", offset, get_akiko_reg_name(offset), space->device().safe_pc() );
781      logerror( "Reading AKIKO reg %0x [%s] at PC=%06x\n", offset, get_akiko_reg_name(offset), state->m_space->device().safe_pc() );
783782   }
784783
785784   switch( offset )
786785   {
787786      case 0x00/4:   /* ID */
788         if ( state->m_cdrom != NULL ) cdda_set_cdrom(space->machine().device("cdda"), state->m_cdrom);
787         if ( state->m_cdrom != NULL ) cdda_set_cdrom(state->m_space->machine().device("cdda"), state->m_cdrom);
789788         return 0x0000cafe;
790789
791790      case 0x04/4:   /* CDROM STATUS 1 */
r17961r17962
838837WRITE32_DEVICE_HANDLER( amiga_akiko32_w )
839838{
840839   akiko_state *state = get_safe_token(device);
841   address_space *space = state->m_space;
842840
843841   if ( LOG_AKIKO && offset < (0x30/4) )
844842   {
845      logerror( "Writing AKIKO reg %0x [%s] with %08x at PC=%06x\n", offset, get_akiko_reg_name(offset), data, space->device().safe_pc() );
843      logerror( "Writing AKIKO reg %0x [%s] with %08x at PC=%06x\n", offset, get_akiko_reg_name(offset), data, state->m_space->device().safe_pc() );
846844   }
847845
848846   switch( offset )
trunk/src/mame/machine/playch10.c
r17961r17962
3434   m_MMC2_bank_latch[0] = m_MMC2_bank_latch[1] = 0xfe;
3535
3636   /* reset the security chip */
37   rp5h01_enable_w(rp5h01, 0, 0);
38   rp5h01_reset_w(rp5h01, 0, 0);
39   rp5h01_reset_w(rp5h01, 0, 1);
40   rp5h01_enable_w(rp5h01, 0, 1);
37   address_space &space = generic_space();
38   rp5h01_enable_w(rp5h01, space, 0, 0);
39   rp5h01_reset_w(rp5h01, space, 0, 0);
40   rp5h01_reset_w(rp5h01, space, 0, 1);
41   rp5h01_enable_w(rp5h01, space, 0, 1);
4142
4243   pc10_set_mirroring(m_mirroring);
4344}
r17961r17962
168169   /* we only support a single cart connected at slot 0 */
169170   if (m_cart_sel == 0)
170171   {
171      rp5h01_enable_w(rp5h01, 0, 0);
172      data |= ((~rp5h01_counter_r(rp5h01, 0)) << 4) & 0x10;   /* D4 */
173      data |= ((rp5h01_data_r(rp5h01, 0)) << 3) & 0x08;      /* D3 */
174      rp5h01_enable_w(rp5h01, 0, 1);
172      rp5h01_enable_w(rp5h01, space, 0, 0);
173      data |= ((~rp5h01_counter_r(rp5h01, space, 0)) << 4) & 0x10;   /* D4 */
174      data |= ((rp5h01_data_r(rp5h01, space, 0)) << 3) & 0x08;      /* D3 */
175      rp5h01_enable_w(rp5h01, space, 0, 1);
175176   }
176177   return data;
177178}
r17961r17962
182183   /* we only support a single cart connected at slot 0 */
183184   if (m_cart_sel == 0)
184185   {
185      rp5h01_enable_w(rp5h01, 0, 0);
186      rp5h01_test_w(rp5h01, 0, data & 0x10);      /* D4 */
187      rp5h01_clock_w(rp5h01, 0, data & 0x08);      /* D3 */
188      rp5h01_reset_w(rp5h01, 0, ~data & 0x01);   /* D0 */
189      rp5h01_enable_w(rp5h01, 0, 1);
186      rp5h01_enable_w(rp5h01, space, 0, 0);
187      rp5h01_test_w(rp5h01, space, 0, data & 0x10);      /* D4 */
188      rp5h01_clock_w(rp5h01, space, 0, data & 0x08);      /* D3 */
189      rp5h01_reset_w(rp5h01, space, 0, ~data & 0x01);   /* D0 */
190      rp5h01_enable_w(rp5h01, space, 0, 1);
190191
191192      /* this thing gets dense at some point                      */
192193      /* it wants to jump and execute an opcode at $ffff, wich    */
trunk/src/mame/machine/gaelco3d.h
r17961r17962
4444    FUNCTION PROTOTYPES
4545***************************************************************************/
4646
47READ8_DEVICE_HANDLER( gaelco_serial_status_r);
48WRITE8_DEVICE_HANDLER( gaelco_serial_data_w);
49READ8_DEVICE_HANDLER( gaelco_serial_data_r);
50WRITE8_DEVICE_HANDLER( gaelco_serial_rts_w );
47DECLARE_READ8_DEVICE_HANDLER( gaelco_serial_status_r);
48DECLARE_WRITE8_DEVICE_HANDLER( gaelco_serial_data_w);
49DECLARE_READ8_DEVICE_HANDLER( gaelco_serial_data_r);
50DECLARE_WRITE8_DEVICE_HANDLER( gaelco_serial_rts_w );
5151/* Set to 1 during transmit, 0 for receive */
52WRITE8_DEVICE_HANDLER( gaelco_serial_tr_w);
52DECLARE_WRITE8_DEVICE_HANDLER( gaelco_serial_tr_w);
5353
5454
5555/* Big questions marks, related to serial i/o */
r17961r17962
5757/* Not used in surfplnt, but in radikalb
5858 * Set at beginning of transfer sub, cleared at end
5959 */
60WRITE8_DEVICE_HANDLER( gaelco_serial_unknown_w);
60DECLARE_WRITE8_DEVICE_HANDLER( gaelco_serial_unknown_w);
6161
6262
6363/* only used in radikalb, set at beginning of receive isr, cleared at end */
64WRITE8_DEVICE_HANDLER( gaelco_serial_irq_enable );
64DECLARE_WRITE8_DEVICE_HANDLER( gaelco_serial_irq_enable );
6565
6666
6767
trunk/src/mame/machine/konppc.c
r17961r17962
413413   if (nwk_device_sel[0] & 0x01)
414414      return nwk_fifo_r(space, 0);
415415   else
416      return k033906_r(k033906_1, offset, mem_mask);
416      return k033906_r(k033906_1, *space, offset, mem_mask);
417417}
418418
419419WRITE32_HANDLER( K033906_0_w )
420420{
421421   device_t *k033906_1 = space->machine().device("k033906_1");
422   k033906_w(k033906_1, offset, data, mem_mask);
422   k033906_w(k033906_1, *space, offset, data, mem_mask);
423423}
424424
425425READ32_HANDLER( K033906_1_r )
r17961r17962
428428   if (nwk_device_sel[1] & 0x01)
429429      return nwk_fifo_r(space, 1);
430430   else
431      return k033906_r(k033906_2, offset, mem_mask);
431      return k033906_r(k033906_2, *space, offset, mem_mask);
432432}
433433
434434WRITE32_HANDLER(K033906_1_w)
435435{
436436   device_t *k033906_2 = space->machine().device("k033906_2");
437   k033906_w(k033906_2, offset, data, mem_mask);
437   k033906_w(k033906_2, *space, offset, data, mem_mask);
438438}
439439
440440/*****************************************************************************/
r17961r17962
452452   }
453453   else
454454   {
455      voodoo_w(device, offset ^ 0x80000, data, mem_mask);
455      voodoo_w(device, space, offset ^ 0x80000, data, mem_mask);
456456   }
457457}
458458
r17961r17962
469469   }
470470   else
471471   {
472      voodoo_w(device, offset ^ 0x80000, data, mem_mask);
472      voodoo_w(device, space, offset ^ 0x80000, data, mem_mask);
473473   }
474474}
475475
r17961r17962
481481   }
482482   else
483483   {
484      return voodoo_r(device, offset, mem_mask);
484      return voodoo_r(device, space, offset, mem_mask);
485485   }
486486}
487487
r17961r17962
493493   }
494494   else
495495   {
496      return voodoo_r(device, offset, mem_mask);
496      return voodoo_r(device, space, offset, mem_mask);
497497   }
498498}
499499
r17961r17962
510510   }
511511   else
512512   {
513      voodoo_w(device, offset, data, mem_mask);
513      voodoo_w(device, space, offset, data, mem_mask);
514514   }
515515}
516516
r17961r17962
527527   }
528528   else
529529   {
530      voodoo_w(device, offset, data, mem_mask);
530      voodoo_w(device, space, offset, data, mem_mask);
531531   }
532532}
533533
trunk/src/mame/machine/leland.c
r17961r17962
332332
333333   /* reset globals */
334334   m_gfx_control = 0x00;
335   leland_sound_port_w(machine().device("ay8910.1"), 0, 0xff);
335   address_space &space = generic_space();
336   leland_sound_port_w(machine().device("ay8910.1"), space, 0, 0xff);
336337   m_wcol_enable = 0;
337338
338339   m_dangerz_x = 512;
r17961r17962
470471   (*m_update_master_bank)(machine());
471472
472473   /* sound control is in the rest */
473   leland_80186_control_w(machine().device("custom"), offset, data);
474   leland_80186_control_w(machine().device("custom"), space, offset, data);
474475}
475476
476477
r17961r17962
11031104
11041105      case 0x03:   /* /IGID */
11051106      case 0x13:
1106         result = ay8910_r(machine().device("ay8910.1"), offset);
1107         result = ay8910_r(machine().device("ay8910.1"), space, offset);
11071108         break;
11081109
11091110      case 0x10:   /* /GIN0 */
r17961r17962
11451146
11461147      case 0x0a:   /* /OGIA */
11471148      case 0x0b:   /* /OGID */
1148         ay8910_address_data_w(machine().device("ay8910.1"), offset, data);
1149         ay8910_address_data_w(machine().device("ay8910.1"), space, offset, data);
11491150         break;
11501151
11511152      case 0x0c:   /* /BKXL */
r17961r17962
13141315{
13151316   leland_state *state = device->machine().driver_data<leland_state>();
13161317   /* update the graphics banking */
1317   leland_gfx_port_w(device, 0, data);
1318   leland_gfx_port_w(device, space, 0, data);
13181319
13191320   /* set the new value */
13201321   state->m_gfx_control = data;
trunk/src/mame/machine/konppc.h
r17961r17962
3131READ32_HANDLER(K033906_1_r);
3232WRITE32_HANDLER(K033906_1_w);
3333
34WRITE32_DEVICE_HANDLER(nwk_fifo_0_w);
35WRITE32_DEVICE_HANDLER(nwk_fifo_1_w);
36READ32_DEVICE_HANDLER(nwk_voodoo_0_r);
37READ32_DEVICE_HANDLER(nwk_voodoo_1_r);
38WRITE32_DEVICE_HANDLER(nwk_voodoo_0_w);
39WRITE32_DEVICE_HANDLER(nwk_voodoo_1_w);
34DECLARE_WRITE32_DEVICE_HANDLER(nwk_fifo_0_w);
35DECLARE_WRITE32_DEVICE_HANDLER(nwk_fifo_1_w);
36DECLARE_READ32_DEVICE_HANDLER(nwk_voodoo_0_r);
37DECLARE_READ32_DEVICE_HANDLER(nwk_voodoo_1_r);
38DECLARE_WRITE32_DEVICE_HANDLER(nwk_voodoo_0_w);
39DECLARE_WRITE32_DEVICE_HANDLER(nwk_voodoo_1_w);
4040
4141void draw_7segment_led(bitmap_rgb32 &bitmap, int x, int y, UINT8 value);
4242
trunk/src/mame/machine/midwayic.c
r17961r17962
10671067
10681068   /* offset 0 is a special case */
10691069   if (offset == 0)
1070      result = ide_controller32_r(device, ideoffs, 0x0000ffff);
1070      result = ide_controller32_r(device, space, ideoffs, 0x0000ffff);
10711071
10721072   /* everything else is byte-sized */
10731073   else
1074      result = ide_controller32_r(device, ideoffs, 0xff << shift) >> shift;
1074      result = ide_controller32_r(device, space, ideoffs, 0xff << shift) >> shift;
10751075   return result;
10761076}
10771077
r17961r17962
10841084
10851085   /* offset 0 is a special case */
10861086   if (offset == 0)
1087      ide_controller32_w(device, ideoffs, data, 0x0000ffff);
1087      ide_controller32_w(device, space, ideoffs, data, 0x0000ffff);
10881088
10891089   /* everything else is byte-sized */
10901090   else
1091      ide_controller32_w(device, ideoffs, data << shift, 0xff << shift);
1091      ide_controller32_w(device, space, ideoffs, data << shift, 0xff << shift);
10921092}
trunk/src/mame/machine/midwayic.h
r17961r17962
5151
5252
5353/* IDE ASIC maps the IDE registers */
54READ32_DEVICE_HANDLER( midway_ide_asic_r );
55WRITE32_DEVICE_HANDLER( midway_ide_asic_w );
54DECLARE_READ32_DEVICE_HANDLER( midway_ide_asic_r );
55DECLARE_WRITE32_DEVICE_HANDLER( midway_ide_asic_w );
trunk/src/mame/machine/vectrex.c
r17961r17962
252252   {
253253      device_t *ay = device->machine().device("ay8912");
254254
255      state->m_via_out[PORTA] = ay8910_r(ay, 0)
255      state->m_via_out[PORTA] = ay8910_r(ay, space, 0)
256256         & ~(state->m_imager_pinlevel & 0x80);
257257   }
258258   return state->m_via_out[PORTA];
trunk/src/mame/machine/dc.c
r17961r17962
843843
844844//  mame_printf_verbose("AICA REG: [%08x] read %" I64FMT "x, mask %" I64FMT "x\n", 0x700000+reg*4, (UINT64)offset, mem_mask);
845845
846   return (UINT64) aica_r(device, offset*2, 0xffff)<<shift;
846   return (UINT64) aica_r(device, space, offset*2, 0xffff)<<shift;
847847}
848848
849849WRITE64_DEVICE_HANDLER( dc_aica_reg_w )
r17961r17962
870870      }
871871    }
872872
873   aica_w(device, offset*2, dat, shift ? ((mem_mask>>32)&0xffff) : (mem_mask & 0xffff));
873   aica_w(device, space, offset*2, dat, shift ? ((mem_mask>>32)&0xffff) : (mem_mask & 0xffff));
874874
875875//  mame_printf_verbose("AICA REG: [%08x=%x] write %" I64FMT "x to %x, mask %" I64FMT "x\n", 0x700000+reg*4, dat, data, offset, mem_mask);
876876}
877877
878878READ32_DEVICE_HANDLER( dc_arm_aica_r )
879879{
880   return aica_r(device, offset*2, 0xffff) & 0xffff;
880   return aica_r(device, space, offset*2, 0xffff) & 0xffff;
881881}
882882
883883WRITE32_DEVICE_HANDLER( dc_arm_aica_w )
884884{
885   aica_w(device, offset*2, data, mem_mask&0xffff);
885   aica_w(device, space, offset*2, data, mem_mask&0xffff);
886886}
887887
trunk/src/mame/machine/buggychl.h
r17961r17962
11ADDRESS_MAP_EXTERN( buggychl_mcu_map, 8 );
22
3WRITE8_DEVICE_HANDLER( buggychl_mcu_w );
4READ8_DEVICE_HANDLER( buggychl_mcu_r );
5READ8_DEVICE_HANDLER( buggychl_mcu_status_r );
3DECLARE_WRITE8_DEVICE_HANDLER( buggychl_mcu_w );
4DECLARE_READ8_DEVICE_HANDLER( buggychl_mcu_r );
5DECLARE_READ8_DEVICE_HANDLER( buggychl_mcu_status_r );
66
77class buggychl_mcu_device : public device_t
88{
trunk/src/mame/machine/namco53.h
r17961r17962
1818
1919
2020void namco_53xx_read_request(device_t *device);
21READ8_DEVICE_HANDLER( namco_53xx_read );
21DECLARE_READ8_DEVICE_HANDLER( namco_53xx_read );
2222
2323
2424class namco_53xx_device : public device_t
trunk/src/mame/machine/qix.c
r17961r17962
2222 *
2323 *************************************/
2424
25static READ8_DEVICE_HANDLER( qixmcu_coin_r );
26static WRITE8_DEVICE_HANDLER( qixmcu_coinctrl_w );
27static WRITE8_DEVICE_HANDLER( qixmcu_coin_w );
25static DECLARE_READ8_DEVICE_HANDLER( qixmcu_coin_r );
26static DECLARE_WRITE8_DEVICE_HANDLER( qixmcu_coinctrl_w );
27static DECLARE_WRITE8_DEVICE_HANDLER( qixmcu_coin_w );
2828
29static WRITE8_DEVICE_HANDLER( qix_coinctl_w );
29static DECLARE_WRITE8_DEVICE_HANDLER( qix_coinctl_w );
3030
31static WRITE8_DEVICE_HANDLER( slither_76489_0_w );
32static WRITE8_DEVICE_HANDLER( slither_76489_1_w );
31static DECLARE_WRITE8_DEVICE_HANDLER( slither_76489_0_w );
32static DECLARE_WRITE8_DEVICE_HANDLER( slither_76489_1_w );
3333
34static READ8_DEVICE_HANDLER( slither_trak_lr_r );
35static READ8_DEVICE_HANDLER( slither_trak_ud_r );
34static DECLARE_READ8_DEVICE_HANDLER( slither_trak_lr_r );
35static DECLARE_READ8_DEVICE_HANDLER( slither_trak_ud_r );
3636
3737
3838
trunk/src/mame/machine/snes.c
r17961r17962
442442   // APU is mirrored from 2140 to 217f
443443   if (offset >= APU00 && offset < WMDATA)
444444   {
445      return spc_port_out(state->m_spc700, offset & 0x3);
445      return spc_port_out(state->m_spc700, *space, offset & 0x3);
446446   }
447447
448448   if (state->m_has_addon_chip == HAS_SUPERFX && state->m_superfx != NULL)
r17961r17962
605605   if (offset >= APU00 && offset < WMDATA)
606606   {
607607//      printf("816: %02x to APU @ %d (PC=%06x)\n", data, offset & 3,space->device().safe_pc());
608      spc_port_in(state->m_spc700, offset & 0x3, data);
608      spc_port_in(state->m_spc700, *space, offset & 0x3, data);
609609      space->machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(20));
610610      return;
611611   }
trunk/src/mame/machine/namco62.h
r17961r17962
1616   MCFG_DEVICE_CONFIG(_interface)
1717
1818
19READ8_DEVICE_HANDLER( namco_62xx_read );
20WRITE8_DEVICE_HANDLER( namco_62xx_write );
19DECLARE_READ8_DEVICE_HANDLER( namco_62xx_read );
20DECLARE_WRITE8_DEVICE_HANDLER( namco_62xx_write );
2121
2222
2323class namco_62xx_device : public device_t
trunk/src/mame/machine/mcr.c
r17961r17962
4141 *************************************/
4242
4343static TIMER_CALLBACK( ipu_watchdog_reset );
44static WRITE8_DEVICE_HANDLER( ipu_break_changed );
44static DECLARE_WRITE8_DEVICE_HANDLER( ipu_break_changed );
4545
4646
4747
r17961r17962
140140
141141const z80sio_interface nflfoot_sio_intf =
142142{
143   ipu_ctc_interrupt,   /* interrupt handler */
144   0,               /* DTR changed handler */
145   0,               /* RTS changed handler */
146   ipu_break_changed,   /* BREAK changed handler */
147   mcr_ipu_sio_transmit/* transmit handler */
143   DEVCB_LINE(ipu_ctc_interrupt),   /* interrupt handler */
144   DEVCB_NULL,               /* DTR changed handler */
145   DEVCB_NULL,               /* RTS changed handler */
146   DEVCB_HANDLER(ipu_break_changed),   /* BREAK changed handler */
147   DEVCB_HANDLER(mcr_ipu_sio_transmit)/* transmit handler */
148148};
149149
150150
trunk/src/mame/machine/archimds.c
r17961r17962
684684            case 1:
685685               if (fdc) {
686686                  logerror("17XX: R @ addr %x mask %08x\n", offset*4, mem_mask);
687                  return wd17xx_data_r(fdc, offset&0xf);
687                  return wd17xx_data_r(fdc, *space, offset&0xf);
688688               } else {
689689                  logerror("Read from FDC device?\n");
690690                  return 0;
r17961r17962
740740            case 1:
741741                  if (fdc) {
742742                     logerror("17XX: %x to addr %x mask %08x\n", data, offset*4, mem_mask);
743                     wd17xx_data_w(fdc, offset&0xf, data&0xff);
743                     wd17xx_data_w(fdc, *space, offset&0xf, data&0xff);
744744                  } else {
745745                     logerror("Write to FDC device?\n");
746746                  }
trunk/src/mame/machine/mathbox.h
r17961r17962
2020    FUNCTION PROTOTYPES
2121***************************************************************************/
2222
23WRITE8_DEVICE_HANDLER( mathbox_go_w );
24READ8_DEVICE_HANDLER( mathbox_status_r );
25READ8_DEVICE_HANDLER( mathbox_lo_r );
26READ8_DEVICE_HANDLER( mathbox_hi_r );
23DECLARE_WRITE8_DEVICE_HANDLER( mathbox_go_w );
24DECLARE_READ8_DEVICE_HANDLER( mathbox_status_r );
25DECLARE_READ8_DEVICE_HANDLER( mathbox_lo_r );
26DECLARE_READ8_DEVICE_HANDLER( mathbox_hi_r );
2727
2828/* ----- device interface ----- */
2929class mathbox_device : public device_t
trunk/src/mame/machine/williams.c
r17961r17962
1919static void williams_main_firq(device_t *device, int state);
2020static void williams_snd_irq(device_t *device, int state);
2121static void williams_snd_irq_b(device_t *device, int state);
22static WRITE8_DEVICE_HANDLER( williams_snd_cmd_w );
23static WRITE8_DEVICE_HANDLER( playball_snd_cmd_w );
24static WRITE8_DEVICE_HANDLER( blaster_snd_cmd_w );
22static DECLARE_WRITE8_DEVICE_HANDLER( williams_snd_cmd_w );
23static DECLARE_WRITE8_DEVICE_HANDLER( playball_snd_cmd_w );
24static DECLARE_WRITE8_DEVICE_HANDLER( blaster_snd_cmd_w );
2525
2626/* input port mapping */
27static WRITE8_DEVICE_HANDLER( williams_port_select_w );
28static READ8_DEVICE_HANDLER( williams_input_port_49way_0_5_r );
29static READ8_DEVICE_HANDLER( williams_49way_port_0_r );
27static DECLARE_WRITE8_DEVICE_HANDLER( williams_port_select_w );
28static DECLARE_READ8_DEVICE_HANDLER( williams_input_port_49way_0_5_r );
29static DECLARE_READ8_DEVICE_HANDLER( williams_49way_port_0_r );
3030
3131/* newer-Williams routines */
32static WRITE8_DEVICE_HANDLER( williams2_snd_cmd_w );
32static DECLARE_WRITE8_DEVICE_HANDLER( williams2_snd_cmd_w );
3333static void mysticm_main_irq(device_t *device, int state);
3434static void tshoot_main_irq(device_t *device, int state);
3535
3636/* Lotto Fun-specific code */
37static WRITE8_DEVICE_HANDLER( lottofun_coin_lock_w );
37static DECLARE_WRITE8_DEVICE_HANDLER( lottofun_coin_lock_w );
3838
3939/* Turkey Shoot-specific code */
40static READ8_DEVICE_HANDLER( tshoot_input_port_0_3_r );
41static WRITE8_DEVICE_HANDLER( tshoot_lamp_w );
42static WRITE8_DEVICE_HANDLER( tshoot_maxvol_w );
40static DECLARE_READ8_DEVICE_HANDLER( tshoot_input_port_0_3_r );
41static DECLARE_WRITE8_DEVICE_HANDLER( tshoot_lamp_w );
42static DECLARE_WRITE8_DEVICE_HANDLER( tshoot_maxvol_w );
4343
4444/* Joust 2-specific code */
45static WRITE8_DEVICE_HANDLER( joust2_snd_cmd_w );
46static WRITE8_DEVICE_HANDLER( joust2_pia_3_cb1_w );
45static DECLARE_WRITE8_DEVICE_HANDLER( joust2_snd_cmd_w );
46static DECLARE_WRITE8_DEVICE_HANDLER( joust2_pia_3_cb1_w );
4747
4848
4949/*************************************
r17961r17962
658658{
659659   williams_state *state = device->machine().driver_data<williams_state>();
660660   if (state->m_port_select)
661      return williams_49way_port_0_r(device, 0);
661      return williams_49way_port_0_r(device, space, 0);
662662   else
663663      return state->ioport("IN3")->read();
664664}
trunk/src/mame/machine/nitedrvr.c
r17961r17962
209209WRITE8_MEMBER(nitedrvr_state::nitedrvr_out0_w)
210210{
211211
212   discrete_sound_w(m_discrete, NITEDRVR_MOTOR_DATA, data & 0x0f);   // Motor freq data
213   discrete_sound_w(m_discrete, NITEDRVR_SKID1_EN, data & 0x10);   // Skid1 enable
214   discrete_sound_w(m_discrete, NITEDRVR_SKID2_EN, data & 0x20);   // Skid2 enable
212   discrete_sound_w(m_discrete, space, NITEDRVR_MOTOR_DATA, data & 0x0f);   // Motor freq data
213   discrete_sound_w(m_discrete, space, NITEDRVR_SKID1_EN, data & 0x10);   // Skid1 enable
214   discrete_sound_w(m_discrete, space, NITEDRVR_SKID2_EN, data & 0x20);   // Skid2 enable
215215}
216216
217217/***************************************************************************
r17961r17962
232232
233233   m_crash_en = data & 0x01;
234234
235   discrete_sound_w(m_discrete, NITEDRVR_CRASH_EN, m_crash_en);   // Crash enable
236   discrete_sound_w(m_discrete, NITEDRVR_ATTRACT_EN, data & 0x02);      // Attract enable (sound disable)
235   discrete_sound_w(m_discrete, space, NITEDRVR_CRASH_EN, m_crash_en);   // Crash enable
236   discrete_sound_w(m_discrete, space, NITEDRVR_ATTRACT_EN, data & 0x02);      // Attract enable (sound disable)
237237
238238   if (!m_crash_en)
239239   {
r17961r17962
244244      palette_set_color(machine(), 1, MAKE_RGB(0x00,0x00,0x00)); /* BLACK */
245245      palette_set_color(machine(), 0, MAKE_RGB(0xff,0xff,0xff)); /* WHITE */
246246   }
247   discrete_sound_w(m_discrete, NITEDRVR_BANG_DATA, m_crash_data_en ? m_crash_data : 0);   // Crash Volume
247   discrete_sound_w(m_discrete, space, NITEDRVR_BANG_DATA, m_crash_data_en ? m_crash_data : 0);   // Crash Volume
248248}
249249
250250
r17961r17962
255255   if (state->m_crash_en && state->m_crash_data_en)
256256   {
257257      state->m_crash_data--;
258      discrete_sound_w(state->m_discrete, NITEDRVR_BANG_DATA, state->m_crash_data);   // Crash Volume
258      address_space &space = timer.machine().driver_data()->generic_space();
259      discrete_sound_w(state->m_discrete, space, NITEDRVR_BANG_DATA, state->m_crash_data);   // Crash Volume
259260      if (!state->m_crash_data)
260261         state->m_crash_data_en = 0;   // Done counting?
261262
trunk/src/mame/video/hcastle.c
r17961r17962
7373
7474TILE_GET_INFO_MEMBER(hcastle_state::get_fg_tile_info)
7575{
76   UINT8 ctrl_5 = k007121_ctrlram_r(m_k007121_1, 5);
77   UINT8 ctrl_6 = k007121_ctrlram_r(m_k007121_1, 6);
76   UINT8 ctrl_5 = k007121_ctrlram_r(m_k007121_1, generic_space(), 5);
77   UINT8 ctrl_6 = k007121_ctrlram_r(m_k007121_1, generic_space(), 6);
7878   int bit0 = (ctrl_5 >> 0) & 0x03;
7979   int bit1 = (ctrl_5 >> 2) & 0x03;
8080   int bit2 = (ctrl_5 >> 4) & 0x03;
r17961r17962
9797
9898TILE_GET_INFO_MEMBER(hcastle_state::get_bg_tile_info)
9999{
100   UINT8 ctrl_5 = k007121_ctrlram_r(m_k007121_2, 5);
101   UINT8 ctrl_6 = k007121_ctrlram_r(m_k007121_2, 6);
100   UINT8 ctrl_5 = k007121_ctrlram_r(m_k007121_2, generic_space(), 5);
101   UINT8 ctrl_6 = k007121_ctrlram_r(m_k007121_2, generic_space(), 6);
102102   int bit0 = (ctrl_5 >> 0) & 0x03;
103103   int bit1 = (ctrl_5 >> 2) & 0x03;
104104   int bit2 = (ctrl_5 >> 4) & 0x03;
r17961r17962
180180   {
181181      m_fg_tilemap->set_flip((data & 0x08) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
182182   }
183   k007121_ctrl_w(m_k007121_1, offset, data);
183   k007121_ctrl_w(m_k007121_1, space, offset, data);
184184}
185185
186186WRITE8_MEMBER(hcastle_state::hcastle_pf2_control_w)
r17961r17962
197197   {
198198      m_bg_tilemap->set_flip((data & 0x08) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
199199   }
200   k007121_ctrl_w(m_k007121_2, offset, data);
200   k007121_ctrl_w(m_k007121_2, space, offset, data);
201201}
202202
203203/*****************************************************************************/
r17961r17962
206206{
207207   hcastle_state *state = machine.driver_data<hcastle_state>();
208208   device_t *k007121 = bank ? state->m_k007121_2 : state->m_k007121_1;
209   int base_color = (k007121_ctrlram_r(k007121, 6) & 0x30) * 2;
209   address_space &space = machine.driver_data()->generic_space();
210   int base_color = (k007121_ctrlram_r(k007121, space, 6) & 0x30) * 2;
210211   int bank_base = (bank == 0) ? 0x4000 * (state->m_gfx_bank & 1) : 0;
211212
212213   k007121_sprites_draw(k007121, bitmap, cliprect, machine.gfx[bank], machine.colortable, sbank, base_color, 0, bank_base, (UINT32)-1);
r17961r17962
217218SCREEN_UPDATE_IND16( hcastle )
218219{
219220   hcastle_state *state = screen.machine().driver_data<hcastle_state>();
221   address_space &space = screen.machine().driver_data()->generic_space();
220222
221   UINT8 ctrl_1_0 = k007121_ctrlram_r(state->m_k007121_1, 0);
222   UINT8 ctrl_1_1 = k007121_ctrlram_r(state->m_k007121_1, 1);
223   UINT8 ctrl_1_2 = k007121_ctrlram_r(state->m_k007121_1, 2);
224   UINT8 ctrl_1_3 = k007121_ctrlram_r(state->m_k007121_1, 3);
225   UINT8 ctrl_2_0 = k007121_ctrlram_r(state->m_k007121_2, 0);
226   UINT8 ctrl_2_1 = k007121_ctrlram_r(state->m_k007121_2, 1);
227   UINT8 ctrl_2_2 = k007121_ctrlram_r(state->m_k007121_2, 2);
228   UINT8 ctrl_2_3 = k007121_ctrlram_r(state->m_k007121_2, 3);
223   UINT8 ctrl_1_0 = k007121_ctrlram_r(state->m_k007121_1, space, 0);
224   UINT8 ctrl_1_1 = k007121_ctrlram_r(state->m_k007121_1, space, 1);
225   UINT8 ctrl_1_2 = k007121_ctrlram_r(state->m_k007121_1, space, 2);
226   UINT8 ctrl_1_3 = k007121_ctrlram_r(state->m_k007121_1, space, 3);
227   UINT8 ctrl_2_0 = k007121_ctrlram_r(state->m_k007121_2, space, 0);
228   UINT8 ctrl_2_1 = k007121_ctrlram_r(state->m_k007121_2, space, 1);
229   UINT8 ctrl_2_2 = k007121_ctrlram_r(state->m_k007121_2, space, 2);
230   UINT8 ctrl_2_3 = k007121_ctrlram_r(state->m_k007121_2, space, 3);
229231
230232   set_pens(screen.machine());
231233
trunk/src/mame/video/labyrunr.c
r17961r17962
6666
6767TILE_GET_INFO_MEMBER(labyrunr_state::get_tile_info0)
6868{
69   UINT8 ctrl_3 = k007121_ctrlram_r(m_k007121, 3);
70   UINT8 ctrl_4 = k007121_ctrlram_r(m_k007121, 4);
71   UINT8 ctrl_5 = k007121_ctrlram_r(m_k007121, 5);
72   UINT8 ctrl_6 = k007121_ctrlram_r(m_k007121, 6);
69   UINT8 ctrl_3 = k007121_ctrlram_r(m_k007121, generic_space(), 3);
70   UINT8 ctrl_4 = k007121_ctrlram_r(m_k007121, generic_space(), 4);
71   UINT8 ctrl_5 = k007121_ctrlram_r(m_k007121, generic_space(), 5);
72   UINT8 ctrl_6 = k007121_ctrlram_r(m_k007121, generic_space(), 6);
7373   int attr = m_videoram1[tile_index];
7474   int code = m_videoram1[tile_index + 0x400];
7575   int bit0 = (ctrl_5 >> 0) & 0x03;
r17961r17962
9595
9696TILE_GET_INFO_MEMBER(labyrunr_state::get_tile_info1)
9797{
98   UINT8 ctrl_3 = k007121_ctrlram_r(m_k007121, 3);
99   UINT8 ctrl_4 = k007121_ctrlram_r(m_k007121, 4);
100   UINT8 ctrl_5 = k007121_ctrlram_r(m_k007121, 5);
101   UINT8 ctrl_6 = k007121_ctrlram_r(m_k007121, 6);
98   UINT8 ctrl_3 = k007121_ctrlram_r(m_k007121, generic_space(), 3);
99   UINT8 ctrl_4 = k007121_ctrlram_r(m_k007121, generic_space(), 4);
100   UINT8 ctrl_5 = k007121_ctrlram_r(m_k007121, generic_space(), 5);
101   UINT8 ctrl_6 = k007121_ctrlram_r(m_k007121, generic_space(), 6);
102102   int attr = m_videoram2[tile_index];
103103   int code = m_videoram2[tile_index + 0x400];
104104   int bit0 = (ctrl_5 >> 0) & 0x03;
r17961r17962
179179SCREEN_UPDATE_IND16( labyrunr )
180180{
181181   labyrunr_state *state = screen.machine().driver_data<labyrunr_state>();
182   UINT8 ctrl_0 = k007121_ctrlram_r(state->m_k007121, 0);
182   address_space &space = screen.machine().driver_data()->generic_space();
183   UINT8 ctrl_0 = k007121_ctrlram_r(state->m_k007121, space, 0);
183184   rectangle finalclip0, finalclip1;
184185
185186   set_pens(screen.machine());
r17961r17962
187188   screen.machine().priority_bitmap.fill(0, cliprect);
188189   bitmap.fill(get_black_pen(screen.machine()), cliprect);
189190
190   if (~k007121_ctrlram_r(state->m_k007121, 3) & 0x20)
191   if (~k007121_ctrlram_r(state->m_k007121, space, 3) & 0x20)
191192   {
192193      int i;
193194
r17961r17962
203204      for(i = 0; i < 32; i++)
204205      {
205206         /* enable colscroll */
206         if((k007121_ctrlram_r(state->m_k007121, 1) & 6) == 6) // it's probably just one bit, but it's only used once in the game so I don't know which it's
207            state->m_layer0->set_scrolly((i + 2) & 0x1f, k007121_ctrlram_r(state->m_k007121, 2) + state->m_scrollram[i]);
207         if((k007121_ctrlram_r(state->m_k007121, space, 1) & 6) == 6) // it's probably just one bit, but it's only used once in the game so I don't know which it's
208            state->m_layer0->set_scrolly((i + 2) & 0x1f, k007121_ctrlram_r(state->m_k007121, space, 2) + state->m_scrollram[i]);
208209         else
209            state->m_layer0->set_scrolly((i + 2) & 0x1f, k007121_ctrlram_r(state->m_k007121, 2));
210            state->m_layer0->set_scrolly((i + 2) & 0x1f, k007121_ctrlram_r(state->m_k007121, space, 2));
210211      }
211212
212213      state->m_layer0->draw(bitmap, finalclip0, TILEMAP_DRAW_OPAQUE, 0);
213      k007121_sprites_draw(state->m_k007121, bitmap, cliprect, screen.machine().gfx[0], screen.machine().colortable, state->m_spriteram,(k007121_ctrlram_r(state->m_k007121, 6) & 0x30) * 2, 40,0,(k007121_ctrlram_r(state->m_k007121, 3) & 0x40) >> 5);
214      k007121_sprites_draw(state->m_k007121, bitmap, cliprect, screen.machine().gfx[0], screen.machine().colortable, state->m_spriteram,(k007121_ctrlram_r(state->m_k007121, space, 6) & 0x30) * 2, 40,0,(k007121_ctrlram_r(state->m_k007121, space, 3) & 0x40) >> 5);
214215      /* we ignore the transparency because layer1 is drawn only at the top of the screen also covering sprites */
215216      state->m_layer1->draw(bitmap, finalclip1, TILEMAP_DRAW_OPAQUE, 0);
216217   }
r17961r17962
223224      finalclip0.min_y = finalclip1.min_y = cliprect.min_y;
224225      finalclip0.max_y = finalclip1.max_y = cliprect.max_y;
225226
226      if(k007121_ctrlram_r(state->m_k007121, 1) & 1)
227      if(k007121_ctrlram_r(state->m_k007121, space, 1) & 1)
227228      {
228229         finalclip0.min_x = cliprect.max_x - ctrl_0 + 8;
229230         finalclip0.max_x = cliprect.max_x;
r17961r17962
280281      if(use_clip3[1])
281282         state->m_layer1->draw(bitmap, finalclip3, 0, 1);
282283
283      k007121_sprites_draw(state->m_k007121, bitmap, cliprect, screen.machine().gfx[0], screen.machine().colortable, state->m_spriteram, (k007121_ctrlram_r(state->m_k007121, 6) & 0x30) * 2,40,0,(k007121_ctrlram_r(state->m_k007121, 3) & 0x40) >> 5);
284      k007121_sprites_draw(state->m_k007121, bitmap, cliprect, screen.machine().gfx[0], screen.machine().colortable, state->m_spriteram, (k007121_ctrlram_r(state->m_k007121, space, 6) & 0x30) * 2,40,0,(k007121_ctrlram_r(state->m_k007121, space, 3) & 0x40) >> 5);
284285   }
285286   return 0;
286287}
trunk/src/mame/video/taito_o.c
r17961r17962
3131       is always 64 pixels. */
3232
3333   taitoo_state *state = machine.driver_data<taitoo_state>();
34   address_space &space = machine.driver_data()->generic_space();
3435   static const int size[] = { 1, 2, 4, 4 };
3536   int x0, y0, x, y, dx, dy, ex, ey, zx, zy;
3637   int ysize;
r17961r17962
4445      if (offs <  0x01b0 && priority == 0)   continue;
4546      if (offs >= 0x01b0 && priority == 1)   continue;
4647
47      x0        =  tc0080vco_sprram_r(state->m_tc0080vco, offs + 1, 0xffff) & 0x3ff;
48      y0        =  tc0080vco_sprram_r(state->m_tc0080vco, offs + 0, 0xffff) & 0x3ff;
49      zoomx     = (tc0080vco_sprram_r(state->m_tc0080vco, offs + 2, 0xffff) & 0x7f00) >> 8;
50      zoomy     = (tc0080vco_sprram_r(state->m_tc0080vco, offs + 2, 0xffff) & 0x007f);
51      tile_offs = (tc0080vco_sprram_r(state->m_tc0080vco, offs + 3, 0xffff) & 0x1fff) << 2;
52      ysize     = size[(tc0080vco_sprram_r(state->m_tc0080vco, offs, 0xffff) & 0x0c00) >> 10];
48      x0        =  tc0080vco_sprram_r(state->m_tc0080vco, space, offs + 1, 0xffff) & 0x3ff;
49      y0        =  tc0080vco_sprram_r(state->m_tc0080vco, space, offs + 0, 0xffff) & 0x3ff;
50      zoomx     = (tc0080vco_sprram_r(state->m_tc0080vco, space, offs + 2, 0xffff) & 0x7f00) >> 8;
51      zoomy     = (tc0080vco_sprram_r(state->m_tc0080vco, space, offs + 2, 0xffff) & 0x007f);
52      tile_offs = (tc0080vco_sprram_r(state->m_tc0080vco, space, offs + 3, 0xffff) & 0x1fff) << 2;
53      ysize     = size[(tc0080vco_sprram_r(state->m_tc0080vco, space, offs, 0xffff) & 0x0c00) >> 10];
5354
5455      if (tile_offs)
5556      {
r17961r17962
108109               {
109110                  int tile, color, flipx, flipy;
110111
111                  tile  = tc0080vco_cram_0_r(state->m_tc0080vco, tile_offs, 0xffff) & 0x7fff;
112                  color = tc0080vco_cram_1_r(state->m_tc0080vco, tile_offs, 0xffff) & 0x001f;
113                  flipx = tc0080vco_cram_1_r(state->m_tc0080vco, tile_offs, 0xffff) & 0x0040;
114                  flipy = tc0080vco_cram_1_r(state->m_tc0080vco, tile_offs, 0xffff) & 0x0080;
112                  tile  = tc0080vco_cram_0_r(state->m_tc0080vco, space, tile_offs, 0xffff) & 0x7fff;
113                  color = tc0080vco_cram_1_r(state->m_tc0080vco, space, tile_offs, 0xffff) & 0x001f;
114                  flipx = tc0080vco_cram_1_r(state->m_tc0080vco, space, tile_offs, 0xffff) & 0x0040;
115                  flipy = tc0080vco_cram_1_r(state->m_tc0080vco, space, tile_offs, 0xffff) & 0x0080;
115116
116117                  if (tc0080vco_flipscreen_r(state->m_tc0080vco))
117118                  {
trunk/src/mame/video/decbac06.c
r17961r17962
389389WRITE8_DEVICE_HANDLER( deco_bac06_pf_data_8bit_w )
390390{
391391   if (offset&1)
392      deco_bac06_pf_data_w(device,offset/2,data,0x00ff);
392      deco_bac06_pf_data_w(device,space,offset/2,data,0x00ff);
393393   else
394      deco_bac06_pf_data_w(device,offset/2,data<<8,0xff00);
394      deco_bac06_pf_data_w(device,space,offset/2,data<<8,0xff00);
395395}
396396
397397READ8_DEVICE_HANDLER( deco_bac06_pf_data_8bit_r )
398398{
399399   if (offset&1) /* MSB */
400      return deco_bac06_pf_data_r(device,offset/2,0x00ff);
400      return deco_bac06_pf_data_r(device,space,offset/2,0x00ff);
401401   else
402      return deco_bac06_pf_data_r(device,offset/2,0xff00)>>8;
402      return deco_bac06_pf_data_r(device,space,offset/2,0xff00)>>8;
403403}
404404
405405WRITE16_DEVICE_HANDLER( deco_bac06_pf_rowscroll_w )
r17961r17962
430430WRITE8_DEVICE_HANDLER( deco_bac06_pf_control0_8bit_w )
431431{
432432   if (offset&1)
433      deco_bac06_pf_control_0_w(device,offset/2,data,0x00ff); // oscar (mirrors?)
433      deco_bac06_pf_control_0_w(device,space,offset/2,data,0x00ff); // oscar (mirrors?)
434434   else
435      deco_bac06_pf_control_0_w(device,offset/2,data,0x00ff);
435      deco_bac06_pf_control_0_w(device,space,offset/2,data,0x00ff);
436436}
437437
438438/* used by dec8.c */
439439READ8_DEVICE_HANDLER( deco_bac06_pf_control1_8bit_r )
440440{
441441   if (offset&1)
442      return deco_bac06_pf_control_1_r(device,offset/2,0x00ff);
442      return deco_bac06_pf_control_1_r(device,space,offset/2,0x00ff);
443443   else
444      return deco_bac06_pf_control_1_r(device,offset/2,0xff00)>>8;
444      return deco_bac06_pf_control_1_r(device,space,offset/2,0xff00)>>8;
445445}
446446
447447/* used by dec8.c */
r17961r17962
450450   if (offset<4) // these registers are 16-bit?
451451   {
452452      if (offset&1)
453         deco_bac06_pf_control_1_w(device,offset/2,data,0x00ff);
453         deco_bac06_pf_control_1_w(device,space,offset/2,data,0x00ff);
454454      else
455         deco_bac06_pf_control_1_w(device,offset/2,data<<8,0xff00);
455         deco_bac06_pf_control_1_w(device,space,offset/2,data<<8,0xff00);
456456   }
457457   else // these registers are 8-bit and mirror? (triothep vs actfancr)
458458   {
459459      if (offset&1)
460         deco_bac06_pf_control_1_w(device,offset/2,data,0x00ff);
460         deco_bac06_pf_control_1_w(device,space,offset/2,data,0x00ff);
461461      else
462         deco_bac06_pf_control_1_w(device,offset/2,data,0x00ff);
462         deco_bac06_pf_control_1_w(device,space,offset/2,data,0x00ff);
463463   }
464464}
465465
466466READ8_DEVICE_HANDLER( deco_bac06_pf_rowscroll_8bit_r )
467467{
468468   if (offset&1)
469      return deco_bac06_pf_rowscroll_r(device,offset/2,0x00ff);
469      return deco_bac06_pf_rowscroll_r(device,space,offset/2,0x00ff);
470470   else
471      return deco_bac06_pf_rowscroll_r(device,offset/2,0xff00)>>8;
471      return deco_bac06_pf_rowscroll_r(device,space,offset/2,0xff00)>>8;
472472}
473473
474474
475475WRITE8_DEVICE_HANDLER( deco_bac06_pf_rowscroll_8bit_w )
476476{
477477   if (offset&1)
478      deco_bac06_pf_rowscroll_w(device,offset/2,data,0x00ff);
478      deco_bac06_pf_rowscroll_w(device,space,offset/2,data,0x00ff);
479479   else
480      deco_bac06_pf_rowscroll_w(device,offset/2,data<<8,0xff00);
480      deco_bac06_pf_rowscroll_w(device,space,offset/2,data<<8,0xff00);
481481}
482482
483483READ8_DEVICE_HANDLER( deco_bac06_pf_rowscroll_8bit_swap_r )
484484{
485485   if (offset&1)
486      return deco_bac06_pf_rowscroll_r(device,offset/2,0xff00)>>8;
486      return deco_bac06_pf_rowscroll_r(device,space,offset/2,0xff00)>>8;
487487   else
488      return deco_bac06_pf_rowscroll_r(device,offset/2,0x00ff);
488      return deco_bac06_pf_rowscroll_r(device,space,offset/2,0x00ff);
489489}
490490
491491WRITE8_DEVICE_HANDLER( deco_bac06_pf_rowscroll_8bit_swap_w )
492492{
493493   if (offset&1)
494      deco_bac06_pf_rowscroll_w(device,offset/2,data<<8,0xff00);
494      deco_bac06_pf_rowscroll_w(device,space,offset/2,data<<8,0xff00);
495495   else
496      deco_bac06_pf_rowscroll_w(device,offset/2,data,0x00ff);
496      deco_bac06_pf_rowscroll_w(device,space,offset/2,data,0x00ff);
497497}
498498
499499
r17961r17962
502502WRITE8_DEVICE_HANDLER( deco_bac06_pf_control0_8bit_packed_w )
503503{
504504   if (offset&1)
505      deco_bac06_pf_control_0_w(device,offset/2,data<<8,0xff00);
505      deco_bac06_pf_control_0_w(device,space,offset/2,data<<8,0xff00);
506506   else
507      deco_bac06_pf_control_0_w(device,offset/2,data,0x00ff);
507      deco_bac06_pf_control_0_w(device,space,offset/2,data,0x00ff);
508508}
509509
510510/* used by hippodrm */
511511WRITE8_DEVICE_HANDLER( deco_bac06_pf_control1_8bit_swap_w )
512512{
513   deco_bac06_pf_control1_8bit_w(device, offset^1, data);
513   deco_bac06_pf_control1_8bit_w(device,space, offset^1, data);
514514}
515515
516516/* used by hippodrm */
517517READ8_DEVICE_HANDLER( deco_bac06_pf_data_8bit_swap_r )
518518{
519   return deco_bac06_pf_data_8bit_r(device, offset^1);
519   return deco_bac06_pf_data_8bit_r(device,space, offset^1);
520520}
521521
522522/* used by hippodrm */
523523WRITE8_DEVICE_HANDLER( deco_bac06_pf_data_8bit_swap_w )
524524{
525   deco_bac06_pf_data_8bit_w(device, offset^1, data);
525   deco_bac06_pf_data_8bit_w(device,space, offset^1, data);
526526}
trunk/src/mame/video/decbac06.h
r17961r17962
6565
6666/* 16-bit accessors */
6767
68WRITE16_DEVICE_HANDLER( deco_bac06_pf_control_0_w );
69READ16_DEVICE_HANDLER( deco_bac06_pf_control_1_r );
70WRITE16_DEVICE_HANDLER( deco_bac06_pf_control_1_w );
68DECLARE_WRITE16_DEVICE_HANDLER( deco_bac06_pf_control_0_w );
69DECLARE_READ16_DEVICE_HANDLER( deco_bac06_pf_control_1_r );
70DECLARE_WRITE16_DEVICE_HANDLER( deco_bac06_pf_control_1_w );
7171
72WRITE16_DEVICE_HANDLER( deco_bac06_pf_data_w );
73READ16_DEVICE_HANDLER( deco_bac06_pf_data_r );
74WRITE16_DEVICE_HANDLER( deco_bac06_pf_rowscroll_w );
75READ16_DEVICE_HANDLER( deco_bac06_pf_rowscroll_r );
76WRITE16_DEVICE_HANDLER( deco_bac06_pf_colscroll_w );
77READ16_DEVICE_HANDLER( deco_bac06_pf_colscroll_r );
72DECLARE_WRITE16_DEVICE_HANDLER( deco_bac06_pf_data_w );
73DECLARE_READ16_DEVICE_HANDLER( deco_bac06_pf_data_r );
74DECLARE_WRITE16_DEVICE_HANDLER( deco_bac06_pf_rowscroll_w );
75DECLARE_READ16_DEVICE_HANDLER( deco_bac06_pf_rowscroll_r );
76DECLARE_WRITE16_DEVICE_HANDLER( deco_bac06_pf_colscroll_w );
77DECLARE_READ16_DEVICE_HANDLER( deco_bac06_pf_colscroll_r );
7878
7979/* 8-bit accessors */
8080
8181/* for dec8.c, pcktgal.c */
82READ8_DEVICE_HANDLER( deco_bac06_pf_data_8bit_r );
83WRITE8_DEVICE_HANDLER( deco_bac06_pf_data_8bit_w );
82DECLARE_READ8_DEVICE_HANDLER( deco_bac06_pf_data_8bit_r );
83DECLARE_WRITE8_DEVICE_HANDLER( deco_bac06_pf_data_8bit_w );
8484
85WRITE8_DEVICE_HANDLER( deco_bac06_pf_control0_8bit_w );
86READ8_DEVICE_HANDLER( deco_bac06_pf_control1_8bit_r );
87WRITE8_DEVICE_HANDLER( deco_bac06_pf_control1_8bit_w );
85DECLARE_WRITE8_DEVICE_HANDLER( deco_bac06_pf_control0_8bit_w );
86DECLARE_READ8_DEVICE_HANDLER( deco_bac06_pf_control1_8bit_r );
87DECLARE_WRITE8_DEVICE_HANDLER( deco_bac06_pf_control1_8bit_w );
8888
89READ8_DEVICE_HANDLER( deco_bac06_pf_rowscroll_8bit_r );
90WRITE8_DEVICE_HANDLER( deco_bac06_pf_rowscroll_8bit_w );
89DECLARE_READ8_DEVICE_HANDLER( deco_bac06_pf_rowscroll_8bit_r );
90DECLARE_WRITE8_DEVICE_HANDLER( deco_bac06_pf_rowscroll_8bit_w );
9191
9292/* for hippodrm (dec0.c) and actfancr / triothep (H6280 based games)*/
93WRITE8_DEVICE_HANDLER( deco_bac06_pf_control0_8bit_packed_w );
94WRITE8_DEVICE_HANDLER( deco_bac06_pf_control1_8bit_swap_w );
95READ8_DEVICE_HANDLER( deco_bac06_pf_data_8bit_swap_r );
96WRITE8_DEVICE_HANDLER( deco_bac06_pf_data_8bit_swap_w );
97READ8_DEVICE_HANDLER( deco_bac06_pf_rowscroll_8bit_swap_r );
98WRITE8_DEVICE_HANDLER( deco_bac06_pf_rowscroll_8bit_swap_w );
93DECLARE_WRITE8_DEVICE_HANDLER( deco_bac06_pf_control0_8bit_packed_w );
94DECLARE_WRITE8_DEVICE_HANDLER( deco_bac06_pf_control1_8bit_swap_w );
95DECLARE_READ8_DEVICE_HANDLER( deco_bac06_pf_data_8bit_swap_r );
96DECLARE_WRITE8_DEVICE_HANDLER( deco_bac06_pf_data_8bit_swap_w );
97DECLARE_READ8_DEVICE_HANDLER( deco_bac06_pf_rowscroll_8bit_swap_r );
98DECLARE_WRITE8_DEVICE_HANDLER( deco_bac06_pf_rowscroll_8bit_swap_w );
9999
100100extern const device_type DECO_BAC06;
101101
trunk/src/mame/video/flkatck.c
r17961r17962
1616
1717TILE_GET_INFO_MEMBER(flkatck_state::get_tile_info_A)
1818{
19   UINT8 ctrl_0 = k007121_ctrlram_r(m_k007121, 0);
20   UINT8 ctrl_2 = k007121_ctrlram_r(m_k007121, 2);
21   UINT8 ctrl_3 = k007121_ctrlram_r(m_k007121, 3);
22   UINT8 ctrl_4 = k007121_ctrlram_r(m_k007121, 4);
23   UINT8 ctrl_5 = k007121_ctrlram_r(m_k007121, 5);
19   UINT8 ctrl_0 = k007121_ctrlram_r(m_k007121, generic_space(), 0);
20   UINT8 ctrl_2 = k007121_ctrlram_r(m_k007121, generic_space(), 2);
21   UINT8 ctrl_3 = k007121_ctrlram_r(m_k007121, generic_space(), 3);
22   UINT8 ctrl_4 = k007121_ctrlram_r(m_k007121, generic_space(), 4);
23   UINT8 ctrl_5 = k007121_ctrlram_r(m_k007121, generic_space(), 5);
2424   int attr = m_k007121_ram[tile_index];
2525   int code = m_k007121_ram[tile_index + 0x400];
2626   int bit0 = (ctrl_5 >> 0) & 0x03;
r17961r17962
9999   switch (offset)
100100   {
101101      case 0x04:   /* ROM bank select */
102         if (data != k007121_ctrlram_r(m_k007121, 4))
102         if (data != k007121_ctrlram_r(m_k007121, space, 4))
103103            machine().tilemap().mark_all_dirty();
104104         break;
105105
r17961r17962
110110         break;
111111   }
112112
113   k007121_ctrl_w(m_k007121, offset, data);
113   k007121_ctrl_w(m_k007121, space, offset, data);
114114}
115115
116116
r17961r17962
133133   rectangle clip[2];
134134   const rectangle &visarea = screen.visible_area();
135135
136   address_space &space = screen.machine().driver_data()->generic_space();
136137   if (state->m_flipscreen)
137138   {
138139      clip[0] = visarea;
r17961r17962
141142      clip[1] = visarea;
142143      clip[1].min_x = clip[1].max_x - 40;
143144
144      state->m_k007121_tilemap[0]->set_scrollx(0, k007121_ctrlram_r(state->m_k007121, 0) - 56 );
145      state->m_k007121_tilemap[0]->set_scrolly(0, k007121_ctrlram_r(state->m_k007121, 2));
145      state->m_k007121_tilemap[0]->set_scrollx(0, k007121_ctrlram_r(state->m_k007121, space, 0) - 56 );
146      state->m_k007121_tilemap[0]->set_scrolly(0, k007121_ctrlram_r(state->m_k007121, space, 2));
146147      state->m_k007121_tilemap[1]->set_scrollx(0, -16);
147148   }
148149   else
r17961r17962
154155      clip[1].max_x = 39;
155156      clip[1].min_x = 0;
156157
157      state->m_k007121_tilemap[0]->set_scrollx(0, k007121_ctrlram_r(state->m_k007121, 0) - 40 );
158      state->m_k007121_tilemap[0]->set_scrolly(0, k007121_ctrlram_r(state->m_k007121, 2));
158      state->m_k007121_tilemap[0]->set_scrollx(0, k007121_ctrlram_r(state->m_k007121, space, 0) - 40 );
159      state->m_k007121_tilemap[0]->set_scrolly(0, k007121_ctrlram_r(state->m_k007121, space, 2));
159160      state->m_k007121_tilemap[1]->set_scrollx(0, 0);
160161   }
161162
trunk/src/mame/video/contra.c
r17961r17962
7878
7979TILE_GET_INFO_MEMBER(contra_state::get_fg_tile_info)
8080{
81   UINT8 ctrl_3 = k007121_ctrlram_r(m_k007121_1, 3);
82   UINT8 ctrl_4 = k007121_ctrlram_r(m_k007121_1, 4);
83   UINT8 ctrl_5 = k007121_ctrlram_r(m_k007121_1, 5);
84   UINT8 ctrl_6 = k007121_ctrlram_r(m_k007121_1, 6);
81   UINT8 ctrl_3 = k007121_ctrlram_r(m_k007121_1, generic_space(), 3);
82   UINT8 ctrl_4 = k007121_ctrlram_r(m_k007121_1, generic_space(), 4);
83   UINT8 ctrl_5 = k007121_ctrlram_r(m_k007121_1, generic_space(), 5);
84   UINT8 ctrl_6 = k007121_ctrlram_r(m_k007121_1, generic_space(), 6);
8585   int attr = m_fg_cram[tile_index];
8686   int bit0 = (ctrl_5 >> 0) & 0x03;
8787   int bit1 = (ctrl_5 >> 2) & 0x03;
r17961r17962
106106
107107TILE_GET_INFO_MEMBER(contra_state::get_bg_tile_info)
108108{
109   UINT8 ctrl_3 = k007121_ctrlram_r(m_k007121_2, 3);
110   UINT8 ctrl_4 = k007121_ctrlram_r(m_k007121_2, 4);
111   UINT8 ctrl_5 = k007121_ctrlram_r(m_k007121_2, 5);
112   UINT8 ctrl_6 = k007121_ctrlram_r(m_k007121_2, 6);
109   UINT8 ctrl_3 = k007121_ctrlram_r(m_k007121_2, generic_space(), 3);
110   UINT8 ctrl_4 = k007121_ctrlram_r(m_k007121_2, generic_space(), 4);
111   UINT8 ctrl_5 = k007121_ctrlram_r(m_k007121_2, generic_space(), 5);
112   UINT8 ctrl_6 = k007121_ctrlram_r(m_k007121_2, generic_space(), 6);
113113   int attr = m_bg_cram[tile_index];
114114   int bit0 = (ctrl_5 >> 0) & 0x03;
115115   int bit1 = (ctrl_5 >> 2) & 0x03;
r17961r17962
135135
136136TILE_GET_INFO_MEMBER(contra_state::get_tx_tile_info)
137137{
138   UINT8 ctrl_5 = k007121_ctrlram_r(m_k007121_1, 5);
139   UINT8 ctrl_6 = k007121_ctrlram_r(m_k007121_1, 6);
138   UINT8 ctrl_5 = k007121_ctrlram_r(m_k007121_1, generic_space(), 5);
139   UINT8 ctrl_6 = k007121_ctrlram_r(m_k007121_1, generic_space(), 6);
140140   int attr = m_tx_cram[tile_index];
141141   int bit0 = (ctrl_5 >> 0) & 0x03;
142142   int bit1 = (ctrl_5 >> 2) & 0x03;
r17961r17962
238238
239239WRITE8_MEMBER(contra_state::contra_K007121_ctrl_0_w)
240240{
241   UINT8 ctrl_6 = k007121_ctrlram_r(m_k007121_1, 6);
241   UINT8 ctrl_6 = k007121_ctrlram_r(m_k007121_1, space, 6);
242242
243243   if (offset == 3)
244244   {
r17961r17962
257257   if (offset == 7)
258258      m_fg_tilemap->set_flip((data & 0x08) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
259259
260   k007121_ctrl_w(m_k007121_1, offset, data);
260   k007121_ctrl_w(m_k007121_1, space, offset, data);
261261}
262262
263263WRITE8_MEMBER(contra_state::contra_K007121_ctrl_1_w)
264264{
265   UINT8 ctrl_6 = k007121_ctrlram_r(m_k007121_2, 6);
265   UINT8 ctrl_6 = k007121_ctrlram_r(m_k007121_2, space, 6);
266266
267267   if (offset == 3)
268268   {
r17961r17962
279279   if (offset == 7)
280280      m_bg_tilemap->set_flip((data & 0x08) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
281281
282   k007121_ctrl_w(m_k007121_2, offset, data);
282   k007121_ctrl_w(m_k007121_2, space, offset, data);
283283}
284284
285285
r17961r17962
294294{
295295   contra_state *state = machine.driver_data<contra_state>();
296296   device_t *k007121 = bank ? state->m_k007121_2 : state->m_k007121_1;
297   int base_color = (k007121_ctrlram_r(k007121, 6) & 0x30) * 2;
297   address_space &space = machine.driver_data()->generic_space();
298   int base_color = (k007121_ctrlram_r(k007121, space, 6) & 0x30) * 2;
298299   const UINT8 *source;
299300
300301   if (bank == 0)
r17961r17962
308309SCREEN_UPDATE_IND16( contra )
309310{
310311   contra_state *state = screen.machine().driver_data<contra_state>();
311   UINT8 ctrl_1_0 = k007121_ctrlram_r(state->m_k007121_1, 0);
312   UINT8 ctrl_1_2 = k007121_ctrlram_r(state->m_k007121_1, 2);
313   UINT8 ctrl_2_0 = k007121_ctrlram_r(state->m_k007121_2, 0);
314   UINT8 ctrl_2_2 = k007121_ctrlram_r(state->m_k007121_2, 2);
312   address_space &space = screen.machine().driver_data()->generic_space();
313   UINT8 ctrl_1_0 = k007121_ctrlram_r(state->m_k007121_1, space, 0);
314   UINT8 ctrl_1_2 = k007121_ctrlram_r(state->m_k007121_1, space, 2);
315   UINT8 ctrl_2_0 = k007121_ctrlram_r(state->m_k007121_2, space, 0);
316   UINT8 ctrl_2_2 = k007121_ctrlram_r(state->m_k007121_2, space, 2);
315317   rectangle bg_finalclip = state->m_bg_clip;
316318   rectangle fg_finalclip = state->m_fg_clip;
317319   rectangle tx_finalclip = state->m_tx_clip;
trunk/src/mame/video/undrfire.c
r17961r17962
350350{
351351   device_t *tc0100scn = screen.machine().device("tc0100scn");
352352   device_t *tc0480scp = screen.machine().device("tc0480scp");
353   address_space &space = screen.machine().driver_data()->generic_space();
353354   UINT8 layer[5];
354355   UINT8 pivlayer[3];
355356   UINT16 priority;
r17961r17962
445446#endif
446447   /* Sprites have variable priority (we kludge this on road levels) */
447448   {
448      if ((tc0480scp_pri_reg_r(tc0480scp, 0) & 0x3) == 3)   /* on road levels kludge sprites up 1 priority */
449      if ((tc0480scp_pri_reg_r(tc0480scp, space, 0) & 0x3) == 3)   /* on road levels kludge sprites up 1 priority */
449450      {
450451         static const int primasks[4] = {0xfff0, 0xff00, 0x0, 0x0};
451452         draw_sprites(screen.machine(), bitmap, cliprect, primasks, 44, -574);
r17961r17962
493494{
494495   device_t *tc0100scn = screen.machine().device("tc0100scn");
495496   device_t *tc0480scp = screen.machine().device("tc0480scp");
497   address_space &space = screen.machine().driver_data()->generic_space();
496498   UINT8 layer[5];
497499   UINT8 pivlayer[3];
498500   UINT16 priority;
r17961r17962
588590#endif
589591   /* Sprites have variable priority (we kludge this on road levels) */
590592   {
591      if ((tc0480scp_pri_reg_r(tc0480scp, 0) & 0x3) == 3)   /* on road levels kludge sprites up 1 priority */
593      if ((tc0480scp_pri_reg_r(tc0480scp, space, 0) & 0x3) == 3)   /* on road levels kludge sprites up 1 priority */
592594      {
593595         static const int primasks[4] = {0xfff0, 0xff00, 0x0, 0x0};
594596         draw_sprites_cbombers(screen.machine(), bitmap, cliprect, primasks, 80, -208);
trunk/src/mame/video/dkong.c
r17961r17962
725725      state->m_sig30Hz = (1-state->m_sig30Hz);
726726
727727   /* Now mix with SND02 (sound 2) line - on 74ls259, bit2 */
728   state->m_rflip_sig = latch8_bit2_r(state->m_dev_6h, 0) & state->m_sig30Hz;
728   address_space &space = machine.driver_data()->generic_space();
729   state->m_rflip_sig = latch8_bit2_r(state->m_dev_6h, space, 0) & state->m_sig30Hz;
729730
730731   sig = state->m_rflip_sig ^ ((line_cnt & 0x80)>>7);
731732
r17961r17962
759760     *
760761     * Mixed with ANS line (bit 5) from Port B of 8039
761762     */
762   if (state->m_grid_on && latch8_bit5_r(state->m_dev_vp2, 0))
763   if (state->m_grid_on && latch8_bit5_r(state->m_dev_vp2, space, 0))
763764   {
764765      diff = (0.0 - state->m_cv3);
765766      diff = diff - diff*exp(0.0 - (1.0/RC32 * dt) );
trunk/src/mame/video/sprint4.c
r17961r17962
139139
140140      /* update sound status */
141141
142      discrete_sound_w(discrete, SPRINT4_MOTOR_DATA_1, videoram[0x391] & 15);
143      discrete_sound_w(discrete, SPRINT4_MOTOR_DATA_2, videoram[0x393] & 15);
144      discrete_sound_w(discrete, SPRINT4_MOTOR_DATA_3, videoram[0x395] & 15);
145      discrete_sound_w(discrete, SPRINT4_MOTOR_DATA_4, videoram[0x397] & 15);
142      address_space &space = screen.machine().driver_data()->generic_space();
143      discrete_sound_w(discrete, space, SPRINT4_MOTOR_DATA_1, videoram[0x391] & 15);
144      discrete_sound_w(discrete, space, SPRINT4_MOTOR_DATA_2, videoram[0x393] & 15);
145      discrete_sound_w(discrete, space, SPRINT4_MOTOR_DATA_3, videoram[0x395] & 15);
146      discrete_sound_w(discrete, space, SPRINT4_MOTOR_DATA_4, videoram[0x397] & 15);
146147   }
147148}
148149
trunk/src/mame/video/simpsons.c
r17961r17962
4848
4949READ8_MEMBER(simpsons_state::simpsons_k052109_r)
5050{
51   return k052109_r(m_k052109, offset + 0x2000);
51   return k052109_r(m_k052109, space, offset + 0x2000);
5252}
5353
5454WRITE8_MEMBER(simpsons_state::simpsons_k052109_w)
5555{
56   k052109_w(m_k052109, offset + 0x2000, data);
56   k052109_w(m_k052109, space, offset + 0x2000, data);
5757}
5858
5959READ8_MEMBER(simpsons_state::simpsons_k053247_r)
trunk/src/mame/video/taito_b.c
r17961r17962
264264   taitob_state *state = machine.driver_data<taitob_state>();
265265   rectangle myclip = cliprect;
266266   int x, y;
267   UINT8 video_control = tc0180vcu_get_videoctrl(state->m_tc0180vcu, 0);
268   UINT8 framebuffer_page = tc0180vcu_get_fb_page(state->m_tc0180vcu, 0);
267   address_space &space = machine.driver_data()->generic_space();
268   UINT8 video_control = tc0180vcu_get_videoctrl(state->m_tc0180vcu, space, 0);
269   UINT8 framebuffer_page = tc0180vcu_get_fb_page(state->m_tc0180vcu, space, 0);
269270
270271g_profiler.start(PROFILER_USER1);
271272
r17961r17962
367368SCREEN_UPDATE_IND16( taitob )
368369{
369370   taitob_state *state = screen.machine().driver_data<taitob_state>();
370   UINT8 video_control = tc0180vcu_get_videoctrl(state->m_tc0180vcu, 0);
371   address_space &space = screen.machine().driver_data()->generic_space();
372   UINT8 video_control = tc0180vcu_get_videoctrl(state->m_tc0180vcu, space, 0);
371373
372374   if ((video_control & 0x20) == 0)
373375   {
r17961r17962
403405SCREEN_UPDATE_RGB32( realpunc )
404406{
405407   taitob_state *state = screen.machine().driver_data<taitob_state>();
408   address_space &space = screen.machine().driver_data()->generic_space();
406409   const rgb_t *palette = palette_entry_list_adjusted(screen.machine().palette);
407   UINT8 video_control = tc0180vcu_get_videoctrl(state->m_tc0180vcu, 0);
410   UINT8 video_control = tc0180vcu_get_videoctrl(state->m_tc0180vcu, space, 0);
408411   int x, y;
409412
410413   /* Video blanked? */
r17961r17962
434437   {
435438      device_t *hd63484 = screen.machine().device("hd63484");
436439
437      int base = (hd63484_regs_r(hd63484, 0xcc/2, 0xffff) << 16) + hd63484_regs_r(hd63484, 0xce/2, 0xffff);
438      int stride = hd63484_regs_r(hd63484, 0xca/2, 0xffff);
440      int base = (hd63484_regs_r(hd63484, space, 0xcc/2, 0xffff) << 16) + hd63484_regs_r(hd63484, space, 0xce/2, 0xffff);
441      int stride = hd63484_regs_r(hd63484, space, 0xca/2, 0xffff);
439442
440443//      scrollx = taitob_scroll[0];
441444//      scrolly = taitob_scroll[1];
r17961r17962
446449         for (x = 0; x <= cliprect.max_x; x++)
447450         {
448451            int r, g, b;
449            UINT16 srcpix = hd63484_ram_r(hd63484, addr++, 0xffff);
452            UINT16 srcpix = hd63484_ram_r(hd63484, space, addr++, 0xffff);
450453
451454            r = (BIT(srcpix, 1)) | ((srcpix >> 11) & 0x1e);
452455            g = (BIT(srcpix, 2)) | ((srcpix >> 7) & 0x1e);
r17961r17962
498501   if (vblank_on)
499502   {
500503      taitob_state *state = screen.machine().driver_data<taitob_state>();
501      UINT8 video_control = tc0180vcu_get_videoctrl(state->m_tc0180vcu, 0);
502      UINT8 framebuffer_page = tc0180vcu_get_fb_page(state->m_tc0180vcu, 0);
504      address_space &space = screen.machine().driver_data()->generic_space();
505      UINT8 video_control = tc0180vcu_get_videoctrl(state->m_tc0180vcu, space, 0);
506      UINT8 framebuffer_page = tc0180vcu_get_fb_page(state->m_tc0180vcu, space, 0);
503507
504508      if (~video_control & 0x01)
505509         state->m_framebuffer[framebuffer_page]->fill(0, screen.machine().primary_screen->visible_area());
r17961r17962
507511      if (~video_control & 0x80)
508512      {
509513         framebuffer_page ^= 1;
510         tc0180vcu_set_fb_page(state->m_tc0180vcu, 0, framebuffer_page);
514         tc0180vcu_set_fb_page(state->m_tc0180vcu, space, 0, framebuffer_page);
511515      }
512516
513517      draw_sprites(screen.machine(), *state->m_framebuffer[framebuffer_page], screen.machine().primary_screen->visible_area());
trunk/src/mame/video/taitoic.c
r17961r17962
15501550   else if (offset < 0x20800 / 2)   /* sprite ram */
15511551   {}
15521552   else if (offset < 0x20fff / 2)
1553      tc0080vco_scrollram_w(device, offset - (0x20800 / 2), tc0080vco->ram[offset], mem_mask);
1553      tc0080vco_scrollram_w(device, space, offset - (0x20800 / 2), tc0080vco->ram[offset], mem_mask);
15541554}
15551555
15561556void tc0080vco_tilemap_update( device_t *device )
r17961r17962
23442344
23452345READ32_DEVICE_HANDLER( tc0100scn_ctrl_long_r )
23462346{
2347   return (tc0100scn_ctrl_word_r(device, offset * 2, 0xffff) << 16) | tc0100scn_ctrl_word_r(device, offset * 2 + 1, 0xffff);
2347   return (tc0100scn_ctrl_word_r(device, space, offset * 2, 0xffff) << 16) | tc0100scn_ctrl_word_r(device, space, offset * 2 + 1, 0xffff);
23482348}
23492349
23502350WRITE32_DEVICE_HANDLER( tc0100scn_ctrl_long_w )
23512351{
23522352   if (ACCESSING_BITS_16_31)
2353      tc0100scn_ctrl_word_w(device, offset * 2, data >> 16, mem_mask >> 16);
2353      tc0100scn_ctrl_word_w(device, space, offset * 2, data >> 16, mem_mask >> 16);
23542354   if (ACCESSING_BITS_0_15)
2355      tc0100scn_ctrl_word_w(device, (offset * 2) + 1, data & 0xffff, mem_mask & 0xffff);
2355      tc0100scn_ctrl_word_w(device, space, (offset * 2) + 1, data & 0xffff, mem_mask & 0xffff);
23562356}
23572357
23582358READ32_DEVICE_HANDLER( tc0100scn_long_r )
23592359{
2360   return (tc0100scn_word_r(device, offset * 2, 0xffff) << 16) | tc0100scn_word_r(device, offset * 2 + 1, 0xffff);
2360   return (tc0100scn_word_r(device, space, offset * 2, 0xffff) << 16) | tc0100scn_word_r(device, space, offset * 2 + 1, 0xffff);
23612361}
23622362
23632363WRITE32_DEVICE_HANDLER( tc0100scn_long_w )
23642364{
23652365   if (ACCESSING_BITS_16_31)
23662366   {
2367      int oldword = tc0100scn_word_r(device, offset * 2, 0xffff);
2367      int oldword = tc0100scn_word_r(device, space, offset * 2, 0xffff);
23682368      int newword = data >> 16;
23692369      if (!ACCESSING_BITS_16_23)
23702370         newword |= (oldword & 0x00ff);
23712371      if (!ACCESSING_BITS_24_31)
23722372         newword |= (oldword & 0xff00);
2373      tc0100scn_word_w(device, offset * 2, newword, 0xffff);
2373      tc0100scn_word_w(device, space, offset * 2, newword, 0xffff);
23742374   }
23752375   if (ACCESSING_BITS_0_15)
23762376   {
2377      int oldword = tc0100scn_word_r(device, (offset * 2) + 1, 0xffff);
2377      int oldword = tc0100scn_word_r(device, space, (offset * 2) + 1, 0xffff);
23782378      int newword = data& 0xffff;
23792379      if (!ACCESSING_BITS_0_7)
23802380         newword |= (oldword & 0x00ff);
23812381      if (!ACCESSING_BITS_8_15)
23822382         newword |= (oldword & 0xff00);
2383      tc0100scn_word_w(device, (offset * 2) + 1, newword, 0xffff);
2383      tc0100scn_word_w(device, space, (offset * 2) + 1, newword, 0xffff);
23842384   }
23852385}
23862386
r17961r17962
26992699
27002700READ16_DEVICE_HANDLER( tc0430grw_word_r )
27012701{
2702   return tc0280grd_word_r(device, offset, mem_mask);
2702   return tc0280grd_word_r(device, space, offset, mem_mask);
27032703}
27042704
27052705WRITE16_DEVICE_HANDLER( tc0430grw_word_w )
27062706{
2707   tc0280grd_word_w(device, offset, data, mem_mask);
2707   tc0280grd_word_w(device, space, offset, data, mem_mask);
27082708}
27092709
27102710WRITE16_DEVICE_HANDLER( tc0430grw_ctrl_word_w )
27112711{
2712   tc0280grd_ctrl_word_w(device, offset, data, mem_mask);
2712   tc0280grd_ctrl_word_w(device, space, offset, data, mem_mask);
27132713}
27142714
27152715void tc0280grd_tilemap_update( device_t *device, int base_color )
r17961r17962
32763276
32773277READ32_DEVICE_HANDLER( tc0480scp_ctrl_long_r )
32783278{
3279   return (tc0480scp_ctrl_word_r(device, offset * 2, 0xffff) << 16) | tc0480scp_ctrl_word_r(device, offset * 2 + 1, 0xffff);
3279   return (tc0480scp_ctrl_word_r(device, space, offset * 2, 0xffff) << 16) | tc0480scp_ctrl_word_r(device, space, offset * 2 + 1, 0xffff);
32803280}
32813281
32823282/* TODO: byte access ? */
r17961r17962
32843284WRITE32_DEVICE_HANDLER( tc0480scp_ctrl_long_w )
32853285{
32863286   if (ACCESSING_BITS_16_31)
3287      tc0480scp_ctrl_word_w(device, offset * 2, data >> 16, mem_mask >> 16);
3287      tc0480scp_ctrl_word_w(device, space, offset * 2, data >> 16, mem_mask >> 16);
32883288   if (ACCESSING_BITS_0_15)
3289      tc0480scp_ctrl_word_w(device, (offset * 2) + 1, data & 0xffff, mem_mask & 0xffff);
3289      tc0480scp_ctrl_word_w(device, space, (offset * 2) + 1, data & 0xffff, mem_mask & 0xffff);
32903290}
32913291
32923292READ32_DEVICE_HANDLER( tc0480scp_long_r )
32933293{
3294   return (tc0480scp_word_r(device, offset * 2, 0xffff) << 16) | tc0480scp_word_r(device, offset * 2 + 1, 0xffff);
3294   return (tc0480scp_word_r(device, space, offset * 2, 0xffff) << 16) | tc0480scp_word_r(device, space, offset * 2 + 1, 0xffff);
32953295}
32963296
32973297WRITE32_DEVICE_HANDLER( tc0480scp_long_w )
32983298{
32993299   if (ACCESSING_BITS_16_31)
33003300   {
3301      int oldword = tc0480scp_word_r(device, offset * 2, 0xffff);
3301      int oldword = tc0480scp_word_r(device, space, offset * 2, 0xffff);
33023302      int newword = data >> 16;
33033303      if (!ACCESSING_BITS_16_23)
33043304         newword |= (oldword & 0x00ff);
33053305      if (!ACCESSING_BITS_24_31)
33063306         newword |= (oldword & 0xff00);
3307      tc0480scp_word_w(device, offset * 2, newword, 0xffff);
3307      tc0480scp_word_w(device, space, offset * 2, newword, 0xffff);
33083308   }
33093309   if (ACCESSING_BITS_0_15)
33103310   {
3311      int oldword = tc0480scp_word_r(device, (offset * 2) + 1, 0xffff);
3311      int oldword = tc0480scp_word_r(device, space, (offset * 2) + 1, 0xffff);
33123312      int newword = data & 0xffff;
33133313      if (!ACCESSING_BITS_0_7)
33143314         newword |= (oldword & 0x00ff);
33153315      if (!ACCESSING_BITS_8_15)
33163316         newword |= (oldword & 0xff00);
3317      tc0480scp_word_w(device, (offset * 2) + 1, newword, 0xffff);
3317      tc0480scp_word_w(device, space, (offset * 2) + 1, newword, 0xffff);
33183318   }
33193319}
33203320
trunk/src/mame/video/vaportra.c
r17961r17962
5353SCREEN_UPDATE_IND16( vaportra )
5454{
5555   vaportra_state *state = screen.machine().driver_data<vaportra_state>();
56   UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, 0, 0xffff);
56   address_space &space = screen.machine().driver_data()->generic_space();
57   UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, space, 0, 0xffff);
5758   int pri = state->m_priority[0] & 0x03;
5859
5960   state->flip_screen_set(!BIT(flip, 7));
trunk/src/mame/video/taitoic.h
r17961r17962
372372***************************************************************************/
373373
374374/**  PC080SN  **/
375READ16_DEVICE_HANDLER( pc080sn_word_r );
376WRITE16_DEVICE_HANDLER( pc080sn_word_w );
377WRITE16_DEVICE_HANDLER( pc080sn_xscroll_word_w );
378WRITE16_DEVICE_HANDLER( pc080sn_yscroll_word_w );
379WRITE16_DEVICE_HANDLER( pc080sn_ctrl_word_w );
375DECLARE_READ16_DEVICE_HANDLER( pc080sn_word_r );
376DECLARE_WRITE16_DEVICE_HANDLER( pc080sn_word_w );
377DECLARE_WRITE16_DEVICE_HANDLER( pc080sn_xscroll_word_w );
378DECLARE_WRITE16_DEVICE_HANDLER( pc080sn_yscroll_word_w );
379DECLARE_WRITE16_DEVICE_HANDLER( pc080sn_ctrl_word_w );
380380
381381void pc080sn_set_scroll(device_t *device, int tilemap_num, int scrollx, int scrolly);
382382void pc080sn_set_trans_pen(device_t *device, int tilemap_num, int pen);
r17961r17962
389389
390390
391391/**  PC090OJ  **/
392READ16_DEVICE_HANDLER( pc090oj_word_r );
393WRITE16_DEVICE_HANDLER( pc090oj_word_w );
392DECLARE_READ16_DEVICE_HANDLER( pc090oj_word_r );
393DECLARE_WRITE16_DEVICE_HANDLER( pc090oj_word_w );
394394
395395void pc090oj_set_sprite_ctrl(device_t *device, UINT16 sprctrl);
396396void pc090oj_eof_callback(device_t *device);
r17961r17962
398398
399399
400400/** TC0080VCO **/
401READ16_DEVICE_HANDLER( tc0080vco_word_r );
402WRITE16_DEVICE_HANDLER( tc0080vco_word_w );
401DECLARE_READ16_DEVICE_HANDLER( tc0080vco_word_r );
402DECLARE_WRITE16_DEVICE_HANDLER( tc0080vco_word_w );
403403
404404void tc0080vco_tilemap_update(device_t *device);
405405void tc0080vco_tilemap_draw(device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int flags, UINT32 priority);
406406
407READ16_DEVICE_HANDLER( tc0080vco_cram_0_r );
408READ16_DEVICE_HANDLER( tc0080vco_cram_1_r );
409READ16_DEVICE_HANDLER( tc0080vco_sprram_r );
410READ16_DEVICE_HANDLER( tc0080vco_scrram_r );
407DECLARE_READ16_DEVICE_HANDLER( tc0080vco_cram_0_r );
408DECLARE_READ16_DEVICE_HANDLER( tc0080vco_cram_1_r );
409DECLARE_READ16_DEVICE_HANDLER( tc0080vco_sprram_r );
410DECLARE_READ16_DEVICE_HANDLER( tc0080vco_scrram_r );
411411READ_LINE_DEVICE_HANDLER( tc0080vco_flipscreen_r );
412412
413413
r17961r17962
426426void tc0100scn_set_bg_tilemask(device_t *device, int mask);
427427
428428/* Function to for Mjnquest to select gfx bank */
429WRITE16_DEVICE_HANDLER( tc0100scn_gfxbank_w );
429DECLARE_WRITE16_DEVICE_HANDLER( tc0100scn_gfxbank_w );
430430
431READ16_DEVICE_HANDLER( tc0100scn_word_r );
432WRITE16_DEVICE_HANDLER( tc0100scn_word_w );
433READ16_DEVICE_HANDLER( tc0100scn_ctrl_word_r );
434WRITE16_DEVICE_HANDLER( tc0100scn_ctrl_word_w );
431DECLARE_READ16_DEVICE_HANDLER( tc0100scn_word_r );
432DECLARE_WRITE16_DEVICE_HANDLER( tc0100scn_word_w );
433DECLARE_READ16_DEVICE_HANDLER( tc0100scn_ctrl_word_r );
434DECLARE_WRITE16_DEVICE_HANDLER( tc0100scn_ctrl_word_w );
435435
436436/* Functions for use with 68020 (Under Fire) */
437READ32_DEVICE_HANDLER( tc0100scn_long_r );
438WRITE32_DEVICE_HANDLER( tc0100scn_long_w );
439READ32_DEVICE_HANDLER( tc0100scn_ctrl_long_r );
440WRITE32_DEVICE_HANDLER( tc0100scn_ctrl_long_w );
437DECLARE_READ32_DEVICE_HANDLER( tc0100scn_long_r );
438DECLARE_WRITE32_DEVICE_HANDLER( tc0100scn_long_w );
439DECLARE_READ32_DEVICE_HANDLER( tc0100scn_ctrl_long_r );
440DECLARE_WRITE32_DEVICE_HANDLER( tc0100scn_ctrl_long_w );
441441
442442void tc0100scn_tilemap_update(device_t *device);
443443int tc0100scn_tilemap_draw(device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int flags, UINT32 priority);
r17961r17962
448448
449449
450450/** TC0280GRD & TC0430GRW **/
451READ16_DEVICE_HANDLER( tc0280grd_word_r );
452WRITE16_DEVICE_HANDLER( tc0280grd_word_w );
453WRITE16_DEVICE_HANDLER( tc0280grd_ctrl_word_w );
451DECLARE_READ16_DEVICE_HANDLER( tc0280grd_word_r );
452DECLARE_WRITE16_DEVICE_HANDLER( tc0280grd_word_w );
453DECLARE_WRITE16_DEVICE_HANDLER( tc0280grd_ctrl_word_w );
454454void tc0280grd_tilemap_update(device_t *device, int base_color);
455455void tc0280grd_zoom_draw(device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect, int xoffset, int yoffset, UINT32 priority);
456456
457READ16_DEVICE_HANDLER( tc0430grw_word_r );
458WRITE16_DEVICE_HANDLER( tc0430grw_word_w );
459WRITE16_DEVICE_HANDLER( tc0430grw_ctrl_word_w );
457DECLARE_READ16_DEVICE_HANDLER( tc0430grw_word_r );
458DECLARE_WRITE16_DEVICE_HANDLER( tc0430grw_word_w );
459DECLARE_WRITE16_DEVICE_HANDLER( tc0430grw_ctrl_word_w );
460460void tc0430grw_tilemap_update(device_t *device, int base_color);
461461void tc0430grw_zoom_draw(device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect, int xoffset, int yoffset, UINT32 priority);
462462
463463
464464/** TC0360PRI **/
465WRITE8_DEVICE_HANDLER( tc0360pri_w );
466READ8_DEVICE_HANDLER( tc0360pri_r );
465DECLARE_WRITE8_DEVICE_HANDLER( tc0360pri_w );
466DECLARE_READ8_DEVICE_HANDLER( tc0360pri_r );
467467
468468
469469/** TC0480SCP **/
r17961r17962
471471   then tweak them once you have the 4 bg layer positions correct. Col_base
472472   may be needed when tilemaps use a palette area from sprites. */
473473
474READ16_DEVICE_HANDLER( tc0480scp_word_r );
475WRITE16_DEVICE_HANDLER( tc0480scp_word_w );
476READ16_DEVICE_HANDLER( tc0480scp_ctrl_word_r );
477WRITE16_DEVICE_HANDLER( tc0480scp_ctrl_word_w );
474DECLARE_READ16_DEVICE_HANDLER( tc0480scp_word_r );
475DECLARE_WRITE16_DEVICE_HANDLER( tc0480scp_word_w );
476DECLARE_READ16_DEVICE_HANDLER( tc0480scp_ctrl_word_r );
477DECLARE_WRITE16_DEVICE_HANDLER( tc0480scp_ctrl_word_w );
478478
479479/* Functions for use with 68020 (Super-Z system) */
480READ32_DEVICE_HANDLER( tc0480scp_long_r );
481WRITE32_DEVICE_HANDLER( tc0480scp_long_w );
482READ32_DEVICE_HANDLER( tc0480scp_ctrl_long_r );
483WRITE32_DEVICE_HANDLER( tc0480scp_ctrl_long_w );
480DECLARE_READ32_DEVICE_HANDLER( tc0480scp_long_r );
481DECLARE_WRITE32_DEVICE_HANDLER( tc0480scp_long_w );
482DECLARE_READ32_DEVICE_HANDLER( tc0480scp_ctrl_long_r );
483DECLARE_WRITE32_DEVICE_HANDLER( tc0480scp_ctrl_long_w );
484484
485485void tc0480scp_tilemap_update(device_t *device);
486486void tc0480scp_tilemap_draw(device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int flags, UINT32 priority);
r17961r17962
491491int tc0480scp_get_bg_priority(device_t *device);
492492
493493/* Undrfire needs to read this for a sprite/tile priority hack */
494READ8_DEVICE_HANDLER( tc0480scp_pri_reg_r );
494DECLARE_READ8_DEVICE_HANDLER( tc0480scp_pri_reg_r );
495495
496496
497497/** TC0150ROD **/
498READ16_DEVICE_HANDLER( tc0150rod_word_r );
499WRITE16_DEVICE_HANDLER( tc0150rod_word_w );
498DECLARE_READ16_DEVICE_HANDLER( tc0150rod_word_r );
499DECLARE_WRITE16_DEVICE_HANDLER( tc0150rod_word_w );
500500void tc0150rod_draw(device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect, int y_offs, int palette_offs, int type, int road_trans, UINT32 low_priority, UINT32 high_priority);
501501
502502
503503/** TC0110PCR **/
504READ16_DEVICE_HANDLER( tc0110pcr_word_r );
505WRITE16_DEVICE_HANDLER( tc0110pcr_word_w );   /* color index goes up in step of 2 */
506WRITE16_DEVICE_HANDLER( tc0110pcr_step1_word_w );   /* color index goes up in step of 1 */
507WRITE16_DEVICE_HANDLER( tc0110pcr_step1_rbswap_word_w );   /* swaps red and blue components */
508WRITE16_DEVICE_HANDLER( tc0110pcr_step1_4bpg_word_w );   /* only 4 bits per color gun */
504DECLARE_READ16_DEVICE_HANDLER( tc0110pcr_word_r );
505DECLARE_WRITE16_DEVICE_HANDLER( tc0110pcr_word_w );   /* color index goes up in step of 2 */
506DECLARE_WRITE16_DEVICE_HANDLER( tc0110pcr_step1_word_w );   /* color index goes up in step of 1 */
507DECLARE_WRITE16_DEVICE_HANDLER( tc0110pcr_step1_rbswap_word_w );   /* swaps red and blue components */
508DECLARE_WRITE16_DEVICE_HANDLER( tc0110pcr_step1_4bpg_word_w );   /* only 4 bits per color gun */
509509
510510
511511/** TC0180VCU **/
512READ8_DEVICE_HANDLER( tc0180vcu_get_fb_page );
513WRITE8_DEVICE_HANDLER( tc0180vcu_set_fb_page );
514READ8_DEVICE_HANDLER( tc0180vcu_get_videoctrl );
515READ16_DEVICE_HANDLER( tc0180vcu_ctrl_r );
516WRITE16_DEVICE_HANDLER( tc0180vcu_ctrl_w );
517READ16_DEVICE_HANDLER( tc0180vcu_scroll_r );
518WRITE16_DEVICE_HANDLER( tc0180vcu_scroll_w );
519READ16_DEVICE_HANDLER( tc0180vcu_word_r );
520WRITE16_DEVICE_HANDLER( tc0180vcu_word_w );
512DECLARE_READ8_DEVICE_HANDLER( tc0180vcu_get_fb_page );
513DECLARE_WRITE8_DEVICE_HANDLER( tc0180vcu_set_fb_page );
514DECLARE_READ8_DEVICE_HANDLER( tc0180vcu_get_videoctrl );
515DECLARE_READ16_DEVICE_HANDLER( tc0180vcu_ctrl_r );
516DECLARE_WRITE16_DEVICE_HANDLER( tc0180vcu_ctrl_w );
517DECLARE_READ16_DEVICE_HANDLER( tc0180vcu_scroll_r );
518DECLARE_WRITE16_DEVICE_HANDLER( tc0180vcu_scroll_w );
519DECLARE_READ16_DEVICE_HANDLER( tc0180vcu_word_r );
520DECLARE_WRITE16_DEVICE_HANDLER( tc0180vcu_word_w );
521521void tc0180vcu_tilemap_draw(device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect, int tmap_num, int plane);
trunk/src/mame/video/itech8.c
r17961r17962
188188
189189WRITE8_MEMBER(itech8_state::itech8_palette_w)
190190{
191   tlc34076_w(machine().device("tlc34076"), offset/2, data);
191   tlc34076_w(machine().device("tlc34076"), space, offset/2, data);
192192}
193193
194194
trunk/src/mame/video/tia.c
r17961r17962
18041804   case 0x18: /* AUDF1 */
18051805   case 0x19: /* AUDV0 */
18061806   case 0x1A: /* AUDV1 */
1807      tia_sound_w(machine().device("tia"), offset, data);
1807      tia_sound_w(machine().device("tia"), space, offset, data);
18081808      break;
18091809
18101810   case 0x1B:
trunk/src/mame/video/funkyjet.c
r17961r17962
1414SCREEN_UPDATE_IND16( funkyjet )
1515{
1616   funkyjet_state *state = screen.machine().driver_data<funkyjet_state>();
17   UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, 0, 0xffff);
17   address_space &space = screen.machine().driver_data()->generic_space();
18   UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, space, 0, 0xffff);
1819
1920   state->flip_screen_set(BIT(flip, 7));
2021   deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll);
trunk/src/mame/video/atarirle.h
r17961r17962
9797void atarirle_command_w(device_t *device, UINT8 command);
9898
9999/* read/write handlers */
100READ16_DEVICE_HANDLER( atarirle_spriteram_r );
101READ32_DEVICE_HANDLER( atarirle_spriteram32_r );
102WRITE16_DEVICE_HANDLER( atarirle_spriteram_w );
103WRITE32_DEVICE_HANDLER( atarirle_spriteram32_w );
100DECLARE_READ16_DEVICE_HANDLER( atarirle_spriteram_r );
101DECLARE_READ32_DEVICE_HANDLER( atarirle_spriteram32_r );
102DECLARE_WRITE16_DEVICE_HANDLER( atarirle_spriteram_w );
103DECLARE_WRITE32_DEVICE_HANDLER( atarirle_spriteram32_w );
104104
105105/* render helpers */
106106void atarirle_eof(device_t *device);
trunk/src/mame/video/btoads.c
r17961r17962
123123
124124WRITE16_MEMBER( btoads_state::paletteram_w )
125125{
126   tlc34076_w(m_tlc34076, offset/2, data);
126   tlc34076_w(m_tlc34076, space, offset/2, data);
127127}
128128
129129
130130READ16_MEMBER( btoads_state::paletteram_r )
131131{
132   return tlc34076_r(m_tlc34076, offset/2);
132   return tlc34076_r(m_tlc34076, space, offset/2);
133133}
134134
135135
trunk/src/mame/video/dec0.c
r17961r17962
155155   // layer enables seem different... where are they?
156156
157157   // the bootleg doesn't write these registers, I think they're hardcoded?, so fake them for compatibility with our implementation..
158   deco_bac06_pf_control_0_w(state->m_tilegen1,0,0x0003, 0x00ff); // 8x8
159   deco_bac06_pf_control_0_w(state->m_tilegen1,1,0x0003, 0x00ff);
160   deco_bac06_pf_control_0_w(state->m_tilegen1,2,0x0000, 0x00ff);
161   deco_bac06_pf_control_0_w(state->m_tilegen1,3,0x0001, 0x00ff); // dimensions
158   address_space &space = screen.machine().driver_data()->generic_space();
159   deco_bac06_pf_control_0_w(state->m_tilegen1,space,0,0x0003, 0x00ff); // 8x8
160   deco_bac06_pf_control_0_w(state->m_tilegen1,space,1,0x0003, 0x00ff);
161   deco_bac06_pf_control_0_w(state->m_tilegen1,space,2,0x0000, 0x00ff);
162   deco_bac06_pf_control_0_w(state->m_tilegen1,space,3,0x0001, 0x00ff); // dimensions
162163
163   deco_bac06_pf_control_0_w(state->m_tilegen2,0,0x0082, 0x00ff); // 16x16
164   deco_bac06_pf_control_0_w(state->m_tilegen2,1,0x0000, 0x00ff);
165   deco_bac06_pf_control_0_w(state->m_tilegen2,2,0x0000, 0x00ff);
166   deco_bac06_pf_control_0_w(state->m_tilegen2,3,0x0001, 0x00ff); // dimensions
164   deco_bac06_pf_control_0_w(state->m_tilegen2,space,0,0x0082, 0x00ff); // 16x16
165   deco_bac06_pf_control_0_w(state->m_tilegen2,space,1,0x0000, 0x00ff);
166   deco_bac06_pf_control_0_w(state->m_tilegen2,space,2,0x0000, 0x00ff);
167   deco_bac06_pf_control_0_w(state->m_tilegen2,space,3,0x0001, 0x00ff); // dimensions
167168
168   deco_bac06_pf_control_0_w(state->m_tilegen3,0,0x0082, 0x00ff); // 16x16
169   deco_bac06_pf_control_0_w(state->m_tilegen3,1,0x0003, 0x00ff);
170   deco_bac06_pf_control_0_w(state->m_tilegen3,2,0x0000, 0x00ff);
171   deco_bac06_pf_control_0_w(state->m_tilegen3,3,0x0001, 0x00ff); // dimensions
169   deco_bac06_pf_control_0_w(state->m_tilegen3,space,0,0x0082, 0x00ff); // 16x16
170   deco_bac06_pf_control_0_w(state->m_tilegen3,space,1,0x0003, 0x00ff);
171   deco_bac06_pf_control_0_w(state->m_tilegen3,space,2,0x0000, 0x00ff);
172   deco_bac06_pf_control_0_w(state->m_tilegen3,space,3,0x0001, 0x00ff); // dimensions
172173
173174   // scroll registers got written elsewhere, copy them across
174   deco_bac06_pf_control_1_w(state->m_tilegen1,0,0x0000, 0xffff); // no scroll?
175   deco_bac06_pf_control_1_w(state->m_tilegen1,1,0x0000, 0xffff); // no scroll?
175   deco_bac06_pf_control_1_w(state->m_tilegen1,space,0,0x0000, 0xffff); // no scroll?
176   deco_bac06_pf_control_1_w(state->m_tilegen1,space,1,0x0000, 0xffff); // no scroll?
176177
177   deco_bac06_pf_control_1_w(state->m_tilegen2,0,state->m_automat_scroll_regs[3] - 0x010a, 0xffff);
178   deco_bac06_pf_control_1_w(state->m_tilegen2,1,state->m_automat_scroll_regs[2], 0xffff);
178   deco_bac06_pf_control_1_w(state->m_tilegen2,space,0,state->m_automat_scroll_regs[3] - 0x010a, 0xffff);
179   deco_bac06_pf_control_1_w(state->m_tilegen2,space,1,state->m_automat_scroll_regs[2], 0xffff);
179180
180   deco_bac06_pf_control_1_w(state->m_tilegen3,0,state->m_automat_scroll_regs[1] - 0x0108, 0xffff);
181   deco_bac06_pf_control_1_w(state->m_tilegen3,1,state->m_automat_scroll_regs[0], 0xffff);
181   deco_bac06_pf_control_1_w(state->m_tilegen3,space,0,state->m_automat_scroll_regs[1] - 0x0108, 0xffff);
182   deco_bac06_pf_control_1_w(state->m_tilegen3,space,1,state->m_automat_scroll_regs[0], 0xffff);
182183
183184
184185   state->flip_screen_set(state->m_tilegen1->get_flip_state());
r17961r17962
223224   // layer enables seem different... where are they?
224225
225226   // the bootleg doesn't write these registers, I think they're hardcoded?, so fake them for compatibility with our implementation..
226   deco_bac06_pf_control_0_w(state->m_tilegen1,0,0x0003, 0x00ff); // 8x8
227   deco_bac06_pf_control_0_w(state->m_tilegen1,1,0x0003, 0x00ff);
228   deco_bac06_pf_control_0_w(state->m_tilegen1,2,0x0000, 0x00ff);
229   deco_bac06_pf_control_0_w(state->m_tilegen1,3,0x0001, 0x00ff); // dimensions
227   address_space &space = screen.machine().driver_data()->generic_space();
228   deco_bac06_pf_control_0_w(state->m_tilegen1,space,0,0x0003, 0x00ff); // 8x8
229   deco_bac06_pf_control_0_w(state->m_tilegen1,space,1,0x0003, 0x00ff);
230   deco_bac06_pf_control_0_w(state->m_tilegen1,space,2,0x0000, 0x00ff);
231   deco_bac06_pf_control_0_w(state->m_tilegen1,space,3,0x0001, 0x00ff); // dimensions
230232
231   deco_bac06_pf_control_0_w(state->m_tilegen2,0,0x0082, 0x00ff); // 16x16
232   deco_bac06_pf_control_0_w(state->m_tilegen2,1,0x0000, 0x00ff);
233   deco_bac06_pf_control_0_w(state->m_tilegen2,2,0x0000, 0x00ff);
234   deco_bac06_pf_control_0_w(state->m_tilegen2,3,0x0001, 0x00ff); // dimensions
233   deco_bac06_pf_control_0_w(state->m_tilegen2,space,0,0x0082, 0x00ff); // 16x16
234   deco_bac06_pf_control_0_w(state->m_tilegen2,space,1,0x0000, 0x00ff);
235   deco_bac06_pf_control_0_w(state->m_tilegen2,space,2,0x0000, 0x00ff);
236   deco_bac06_pf_control_0_w(state->m_tilegen2,space,3,0x0001, 0x00ff); // dimensions
235237
236   deco_bac06_pf_control_0_w(state->m_tilegen3,0,0x0082, 0x00ff); // 16x16
237   deco_bac06_pf_control_0_w(state->m_tilegen3,1,0x0003, 0x00ff);
238   deco_bac06_pf_control_0_w(state->m_tilegen3,2,0x0000, 0x00ff);
239   deco_bac06_pf_control_0_w(state->m_tilegen3,3,0x0001, 0x00ff); // dimensions
238   deco_bac06_pf_control_0_w(state->m_tilegen3,space,0,0x0082, 0x00ff); // 16x16
239   deco_bac06_pf_control_0_w(state->m_tilegen3,space,1,0x0003, 0x00ff);
240   deco_bac06_pf_control_0_w(state->m_tilegen3,space,2,0x0000, 0x00ff);
241   deco_bac06_pf_control_0_w(state->m_tilegen3,space,3,0x0001, 0x00ff); // dimensions
240242
241243   // scroll registers got written elsewhere, copy them across
242   deco_bac06_pf_control_1_w(state->m_tilegen1,0,0x0000, 0xffff); // no scroll?
243   deco_bac06_pf_control_1_w(state->m_tilegen1,1,0x0000, 0xffff); // no scroll?
244   deco_bac06_pf_control_1_w(state->m_tilegen1,space,0,0x0000, 0xffff); // no scroll?
245   deco_bac06_pf_control_1_w(state->m_tilegen1,space,1,0x0000, 0xffff); // no scroll?
244246
245   deco_bac06_pf_control_1_w(state->m_tilegen2,0,state->m_automat_scroll_regs[3] - 0x010a, 0xffff);
246   deco_bac06_pf_control_1_w(state->m_tilegen2,1,state->m_automat_scroll_regs[2], 0xffff);
247   deco_bac06_pf_control_1_w(state->m_tilegen2,space,0,state->m_automat_scroll_regs[3] - 0x010a, 0xffff);
248   deco_bac06_pf_control_1_w(state->m_tilegen2,space,1,state->m_automat_scroll_regs[2], 0xffff);
247249
248   deco_bac06_pf_control_1_w(state->m_tilegen3,0,state->m_automat_scroll_regs[1] - 0x0108, 0xffff);
249   deco_bac06_pf_control_1_w(state->m_tilegen3,1,state->m_automat_scroll_regs[0], 0xffff);
250   deco_bac06_pf_control_1_w(state->m_tilegen3,space,0,state->m_automat_scroll_regs[1] - 0x0108, 0xffff);
251   deco_bac06_pf_control_1_w(state->m_tilegen3,space,1,state->m_automat_scroll_regs[0], 0xffff);
250252
251253   state->flip_screen_set(state->m_tilegen1->get_flip_state());
252254
trunk/src/mame/video/taitoair.c
r17961r17962
7575       is always 64 pixels. */
7676
7777   taitoair_state *state = machine.driver_data<taitoair_state>();
78   address_space &space = machine.driver_data()->generic_space();
7879   static const int size[] = { 1, 2, 4, 4 };
7980   int x0, y0, x, y, dx, dy, ex, ey, zx, zy;
8081   int ysize;
r17961r17962
8990      if (offs <  0x01b0 && priority == 0)   continue;
9091      if (offs >= 0x01b0 && priority == 1)   continue;
9192
92      x0        =  tc0080vco_sprram_r(state->m_tc0080vco, offs + 1, 0xffff) & 0x3ff;
93      y0        =  tc0080vco_sprram_r(state->m_tc0080vco, offs + 0, 0xffff) & 0x3ff;
94      zoomx     = (tc0080vco_sprram_r(state->m_tc0080vco, offs + 2, 0xffff) & 0x7f00) >> 8;
95      zoomy     = (tc0080vco_sprram_r(state->m_tc0080vco, offs + 2, 0xffff) & 0x007f);
96      tile_offs = (tc0080vco_sprram_r(state->m_tc0080vco, offs + 3, 0xffff) & 0x1fff) << 2;
97      ysize     = size[(tc0080vco_sprram_r(state->m_tc0080vco, offs, 0xffff) & 0x0c00) >> 10];
93      x0        =  tc0080vco_sprram_r(state->m_tc0080vco, space, offs + 1, 0xffff) & 0x3ff;
94      y0        =  tc0080vco_sprram_r(state->m_tc0080vco, space, offs + 0, 0xffff) & 0x3ff;
95      zoomx     = (tc0080vco_sprram_r(state->m_tc0080vco, space, offs + 2, 0xffff) & 0x7f00) >> 8;
96      zoomy     = (tc0080vco_sprram_r(state->m_tc0080vco, space, offs + 2, 0xffff) & 0x007f);
97      tile_offs = (tc0080vco_sprram_r(state->m_tc0080vco, space, offs + 3, 0xffff) & 0x1fff) << 2;
98      ysize     = size[(tc0080vco_sprram_r(state->m_tc0080vco, space, offs, 0xffff) & 0x0c00) >> 10];
9899
99100      if (tile_offs)
100101      {
r17961r17962
153154               {
154155                  int tile, color, flipx, flipy;
155156
156                  tile  = tc0080vco_cram_0_r(state->m_tc0080vco, tile_offs, 0xffff) & 0x7fff;
157                  color = tc0080vco_cram_1_r(state->m_tc0080vco, tile_offs, 0xffff) & 0x001f;
158                  flipx = tc0080vco_cram_1_r(state->m_tc0080vco, tile_offs, 0xffff) & 0x0040;
159                  flipy = tc0080vco_cram_1_r(state->m_tc0080vco, tile_offs, 0xffff) & 0x0080;
157                  tile  = tc0080vco_cram_0_r(state->m_tc0080vco, space, tile_offs, 0xffff) & 0x7fff;
158                  color = tc0080vco_cram_1_r(state->m_tc0080vco, space, tile_offs, 0xffff) & 0x001f;
159                  flipx = tc0080vco_cram_1_r(state->m_tc0080vco, space, tile_offs, 0xffff) & 0x0040;
160                  flipy = tc0080vco_cram_1_r(state->m_tc0080vco, space, tile_offs, 0xffff) & 0x0080;
160161
161162                  if (tc0080vco_flipscreen_r(state->m_tc0080vco))
162163                  {
trunk/src/mame/video/seta001.h
r17961r17962
5757
5858};
5959
60WRITE8_DEVICE_HANDLER( spritebgflag_w8 );
60DECLARE_WRITE8_DEVICE_HANDLER( spritebgflag_w8 );
6161
6262
63READ16_DEVICE_HANDLER( spritectrl_r16 );
64WRITE16_DEVICE_HANDLER( spritectrl_w16 );
65READ8_DEVICE_HANDLER( spritectrl_r8 );
66WRITE8_DEVICE_HANDLER( spritectrl_w8 );
63DECLARE_READ16_DEVICE_HANDLER( spritectrl_r16 );
64DECLARE_WRITE16_DEVICE_HANDLER( spritectrl_w16 );
65DECLARE_READ8_DEVICE_HANDLER( spritectrl_r8 );
66DECLARE_WRITE8_DEVICE_HANDLER( spritectrl_w8 );
6767
68READ16_DEVICE_HANDLER( spriteylow_r16 );
69WRITE16_DEVICE_HANDLER( spriteylow_w16 );
70READ8_DEVICE_HANDLER( spriteylow_r8 );
71WRITE8_DEVICE_HANDLER( spriteylow_w8 );
68DECLARE_READ16_DEVICE_HANDLER( spriteylow_r16 );
69DECLARE_WRITE16_DEVICE_HANDLER( spriteylow_w16 );
70DECLARE_READ8_DEVICE_HANDLER( spriteylow_r8 );
71DECLARE_WRITE8_DEVICE_HANDLER( spriteylow_w8 );
7272
73READ8_DEVICE_HANDLER( spritecodelow_r8 );
74WRITE8_DEVICE_HANDLER( spritecodelow_w8 );
75READ8_DEVICE_HANDLER( spritecodehigh_r8 );
76WRITE8_DEVICE_HANDLER( spritecodehigh_w8 );
77READ16_DEVICE_HANDLER( spritecode_r16 );
78WRITE16_DEVICE_HANDLER( spritecode_w16 );
73DECLARE_READ8_DEVICE_HANDLER( spritecodelow_r8 );
74DECLARE_WRITE8_DEVICE_HANDLER( spritecodelow_w8 );
75DECLARE_READ8_DEVICE_HANDLER( spritecodehigh_r8 );
76DECLARE_WRITE8_DEVICE_HANDLER( spritecodehigh_w8 );
77DECLARE_READ16_DEVICE_HANDLER( spritecode_r16 );
78DECLARE_WRITE16_DEVICE_HANDLER( spritecode_w16 );
7979
8080extern const device_type SETA001_SPRITE;
8181
trunk/src/mame/video/skydiver.c
r17961r17962
144144         output_set_value("lampr", bit);
145145         break;
146146      case (0x0a):
147         discrete_sound_w(discrete, SKYDIVER_OCT1_EN, bit);
147         discrete_sound_w(discrete, space, SKYDIVER_OCT1_EN, bit);
148148         break;
149149      case (0x0c):
150         discrete_sound_w(discrete, SKYDIVER_OCT2_EN, bit);
150         discrete_sound_w(discrete, space, SKYDIVER_OCT2_EN, bit);
151151         break;
152152      case (0x0e):
153         discrete_sound_w(discrete, SKYDIVER_NOISE_RST, bit);
153         discrete_sound_w(discrete, space, SKYDIVER_NOISE_RST, bit);
154154         break;
155155   }
156156}
trunk/src/mame/video/cbuster.c
r17961r17962
5151SCREEN_UPDATE_RGB32( twocrude )
5252{
5353   cbuster_state *state = screen.machine().driver_data<cbuster_state>();
54   UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, 0, 0xffff);
54   address_space &space = screen.machine().driver_data()->generic_space();
55   UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, space, 0, 0xffff);
5556
5657   state->flip_screen_set(!BIT(flip, 7));
5758
trunk/src/mame/video/rohga.c
r17961r17962
6464SCREEN_UPDATE_IND16( rohga )
6565{
6666   rohga_state *state = screen.machine().driver_data<rohga_state>();
67   UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, 0, 0xffff);
68   UINT16 priority = decocomn_priority_r(state->m_decocomn, 0, 0xffff);
67   address_space &space = screen.machine().driver_data()->generic_space();
68   UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, space, 0, 0xffff);
69   UINT16 priority = decocomn_priority_r(state->m_decocomn, space, 0, 0xffff);
6970
7071   /* Update playfields */
7172   state->flip_screen_set(BIT(flip, 7));
r17961r17962
167168SCREEN_UPDATE_RGB32( wizdfire )
168169{
169170   rohga_state *state = screen.machine().driver_data<rohga_state>();
170   UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, 0, 0xffff);
171   UINT16 priority = decocomn_priority_r(state->m_decocomn, 0, 0xffff);
171   address_space &space = screen.machine().driver_data()->generic_space();
172   UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, space, 0, 0xffff);
173   UINT16 priority = decocomn_priority_r(state->m_decocomn, space, 0, 0xffff);
172174
173175   /* draw sprite gfx to temp bitmaps */
174176   screen.machine().device<decospr_device>("spritegen2")->draw_sprites(bitmap, cliprect, state->m_spriteram2->buffer(), 0x400, true);
r17961r17962
203205SCREEN_UPDATE_RGB32( nitrobal )
204206{
205207   rohga_state *state = screen.machine().driver_data<rohga_state>();
206   UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, 0, 0xffff);
208   address_space &space = screen.machine().driver_data()->generic_space();
209   UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, space, 0, 0xffff);
207210
208211   /* draw sprite gfx to temp bitmaps */
209212   screen.machine().device<decospr_device>("spritegen1")->set_alt_format(true);
trunk/src/mame/video/deco16ic.c
r17961r17962
585585
586586READ32_DEVICE_HANDLER ( deco16ic_pf_control_dword_r )
587587{
588   return deco16ic_pf_control_r(device, offset, 0xffff)^0xffff0000;
588   return deco16ic_pf_control_r(device, space, offset, 0xffff)^0xffff0000;
589589}
590590
591591WRITE32_DEVICE_HANDLER( deco16ic_pf_control_dword_w )
592592{
593   deco16ic_pf_control_w(device, offset, data & 0xffff, mem_mask & 0xffff);
593   deco16ic_pf_control_w(device, space, offset, data & 0xffff, mem_mask & 0xffff);
594594}
595595
596596READ32_DEVICE_HANDLER( deco16ic_pf1_data_dword_r )
597597{
598   return deco16ic_pf1_data_r(device, offset, 0xffff)^0xffff0000;
598   return deco16ic_pf1_data_r(device, space, offset, 0xffff)^0xffff0000;
599599}
600600
601601WRITE32_DEVICE_HANDLER( deco16ic_pf1_data_dword_w )
602602{
603   deco16ic_pf1_data_w(device, offset, data & 0xffff, mem_mask & 0xffff);
603   deco16ic_pf1_data_w(device, space, offset, data & 0xffff, mem_mask & 0xffff);
604604}
605605
606606READ32_DEVICE_HANDLER( deco16ic_pf2_data_dword_r )
607607{
608   return deco16ic_pf2_data_r(device, offset, 0xffff)^0xffff0000;
608   return deco16ic_pf2_data_r(device, space, offset, 0xffff)^0xffff0000;
609609}
610610
611611WRITE32_DEVICE_HANDLER( deco16ic_pf2_data_dword_w )
612612{
613   deco16ic_pf2_data_w(device, offset, data & 0xffff, mem_mask & 0xffff);
613   deco16ic_pf2_data_w(device, space, offset, data & 0xffff, mem_mask & 0xffff);
614614}
615615
616616
trunk/src/mame/video/deco16ic.h
r17961r17962
7474    DEVICE I/O FUNCTIONS
7575***************************************************************************/
7676
77WRITE16_DEVICE_HANDLER( deco16ic_pf1_data_w );
78WRITE16_DEVICE_HANDLER( deco16ic_pf2_data_w );
77DECLARE_WRITE16_DEVICE_HANDLER( deco16ic_pf1_data_w );
78DECLARE_WRITE16_DEVICE_HANDLER( deco16ic_pf2_data_w );
7979
80READ16_DEVICE_HANDLER( deco16ic_pf1_data_r );
81READ16_DEVICE_HANDLER( deco16ic_pf2_data_r );
80DECLARE_READ16_DEVICE_HANDLER( deco16ic_pf1_data_r );
81DECLARE_READ16_DEVICE_HANDLER( deco16ic_pf2_data_r );
8282
83WRITE16_DEVICE_HANDLER( deco16ic_pf_control_w );
83DECLARE_WRITE16_DEVICE_HANDLER( deco16ic_pf_control_w );
8484
85READ16_DEVICE_HANDLER( deco16ic_pf_control_r );
85DECLARE_READ16_DEVICE_HANDLER( deco16ic_pf_control_r );
8686
87WRITE32_DEVICE_HANDLER( deco16ic_pf1_data_dword_w );
88WRITE32_DEVICE_HANDLER( deco16ic_pf2_data_dword_w );
87DECLARE_WRITE32_DEVICE_HANDLER( deco16ic_pf1_data_dword_w );
88DECLARE_WRITE32_DEVICE_HANDLER( deco16ic_pf2_data_dword_w );
8989
90READ32_DEVICE_HANDLER( deco16ic_pf1_data_dword_r );
91READ32_DEVICE_HANDLER( deco16ic_pf2_data_dword_r );
90DECLARE_READ32_DEVICE_HANDLER( deco16ic_pf1_data_dword_r );
91DECLARE_READ32_DEVICE_HANDLER( deco16ic_pf2_data_dword_r );
9292
93WRITE32_DEVICE_HANDLER( deco16ic_pf_control_dword_w );
93DECLARE_WRITE32_DEVICE_HANDLER( deco16ic_pf_control_dword_w );
9494
95READ32_DEVICE_HANDLER( deco16ic_pf_control_dword_r );
95DECLARE_READ32_DEVICE_HANDLER( deco16ic_pf_control_dword_r );
9696
9797void deco16ic_print_debug_info(device_t *device, bitmap_ind16 &bitmap);
9898
trunk/src/mame/video/astrocde.c
r17961r17962
598598      case 0x17:   /* noise volume register */
599599      case 0x18:   /* sound block transfer */
600600         if (m_video_config & AC_SOUND_PRESENT)
601            astrocade_sound_w(machine().device("astrocade1"), offset, data);
601            astrocade_sound_w(machine().device("astrocade1"), space, offset, data);
602602         break;
603603
604604      case 0x19:   /* expand register */
trunk/src/mame/video/taito_h.c
r17961r17962
7676       is always 64 pixels. */
7777
7878   taitoh_state *state = machine.driver_data<taitoh_state>();
79   address_space &space = machine.driver_data()->generic_space();
7980   static const int size[] = { 1, 2, 4, 4 };
8081   int x0, y0, x, y, dx, ex, zx;
8182   int ysize;
r17961r17962
8687
8788   for (offs = 0x03f8 / 2; offs >= 0; offs -= 0x008 / 2)
8889   {
89      x0        =  tc0080vco_sprram_r(state->m_tc0080vco, offs + 1, 0xffff) & 0x3ff;
90      y0        =  tc0080vco_sprram_r(state->m_tc0080vco, offs + 0, 0xffff) & 0x3ff;
91      zoomx     = (tc0080vco_sprram_r(state->m_tc0080vco, offs + 2, 0xffff) & 0x7f00) >> 8;
92      tile_offs = (tc0080vco_sprram_r(state->m_tc0080vco, offs + 3, 0xffff) & 0x1fff) << 2;
93      ysize     = size[(tc0080vco_sprram_r(state->m_tc0080vco, offs, 0xffff) & 0x0c00) >> 10];
90      x0        =  tc0080vco_sprram_r(state->m_tc0080vco, space, offs + 1, 0xffff) & 0x3ff;
91      y0        =  tc0080vco_sprram_r(state->m_tc0080vco, space, offs + 0, 0xffff) & 0x3ff;
92      zoomx     = (tc0080vco_sprram_r(state->m_tc0080vco, space, offs + 2, 0xffff) & 0x7f00) >> 8;
93      tile_offs = (tc0080vco_sprram_r(state->m_tc0080vco, space, offs + 3, 0xffff) & 0x1fff) << 2;
94      ysize     = size[(tc0080vco_sprram_r(state->m_tc0080vco, space, offs, 0xffff) & 0x0c00) >> 10];
9495
9596      if (tile_offs)
9697      {
r17961r17962
134135               {
135136                  int tile, color, flipx, flipy;
136137
137                  tile  = tc0080vco_cram_0_r(state->m_tc0080vco, tile_offs, 0xffff) & 0x7fff;
138                  color = tc0080vco_cram_1_r(state->m_tc0080vco, tile_offs, 0xffff) & 0x001f;
139                  flipx = tc0080vco_cram_1_r(state->m_tc0080vco, tile_offs, 0xffff) & 0x0040;
140                  flipy = tc0080vco_cram_1_r(state->m_tc0080vco, tile_offs, 0xffff) & 0x0080;
138                  tile  = tc0080vco_cram_0_r(state->m_tc0080vco, space, tile_offs, 0xffff) & 0x7fff;
139                  color = tc0080vco_cram_1_r(state->m_tc0080vco, space, tile_offs, 0xffff) & 0x001f;
140                  flipx = tc0080vco_cram_1_r(state->m_tc0080vco, space, tile_offs, 0xffff) & 0x0040;
141                  flipy = tc0080vco_cram_1_r(state->m_tc0080vco, space, tile_offs, 0xffff) & 0x0080;
141142
142143                  if (tc0080vco_flipscreen_r(state->m_tc0080vco))
143144                  {
r17961r17962
169170       is always 64 pixels. */
170171
171172   taitoh_state *state = machine.driver_data<taitoh_state>();
173   address_space &space = machine.driver_data()->generic_space();
172174   static const int size[] = { 1, 2, 4, 4 };
173175   int x0, y0, x, y, dx, dy, ex, ey, zx, zy;
174176   int ysize;
r17961r17962
182184      if (offs <  0x01b0 && priority == 0)   continue;
183185      if (offs >= 0x01b0 && priority == 1)   continue;
184186
185      x0        =  tc0080vco_sprram_r(state->m_tc0080vco, offs + 1, 0xffff) & 0x3ff;
186      y0        =  tc0080vco_sprram_r(state->m_tc0080vco, offs + 0, 0xffff) & 0x3ff;
187      zoomx     = (tc0080vco_sprram_r(state->m_tc0080vco, offs + 2, 0xffff) & 0x7f00) >> 8;
188      zoomy     = (tc0080vco_sprram_r(state->m_tc0080vco, offs + 2, 0xffff) & 0x007f);
189      tile_offs = (tc0080vco_sprram_r(state->m_tc0080vco, offs + 3, 0xffff) & 0x1fff) << 2;
190      ysize     = size[(tc0080vco_sprram_r(state->m_tc0080vco, offs, 0xffff) & 0x0c00) >> 10];
187      x0        =  tc0080vco_sprram_r(state->m_tc0080vco, space, offs + 1, 0xffff) & 0x3ff;
188      y0        =  tc0080vco_sprram_r(state->m_tc0080vco, space, offs + 0, 0xffff) & 0x3ff;
189      zoomx     = (tc0080vco_sprram_r(state->m_tc0080vco, space, offs + 2, 0xffff) & 0x7f00) >> 8;
190      zoomy     = (tc0080vco_sprram_r(state->m_tc0080vco, space, offs + 2, 0xffff) & 0x007f);
191      tile_offs = (tc0080vco_sprram_r(state->m_tc0080vco, space, offs + 3, 0xffff) & 0x1fff) << 2;
192      ysize     = size[(tc0080vco_sprram_r(state->m_tc0080vco, space, offs, 0xffff) & 0x0c00) >> 10];
191193
192194      if (tile_offs)
193195      {
r17961r17962
246248               {
247249                  int tile, color, flipx, flipy;
248250
249                  tile  = tc0080vco_cram_0_r(state->m_tc0080vco, tile_offs, 0xffff) & 0x7fff;
250                  color = tc0080vco_cram_1_r(state->m_tc0080vco, tile_offs, 0xffff) & 0x001f;
251                  flipx = tc0080vco_cram_1_r(state->m_tc0080vco, tile_offs, 0xffff) & 0x0040;
252                  flipy = tc0080vco_cram_1_r(state->m_tc0080vco, tile_offs, 0xffff) & 0x0080;
251                  tile  = tc0080vco_cram_0_r(state->m_tc0080vco, space, tile_offs, 0xffff) & 0x7fff;
252                  color = tc0080vco_cram_1_r(state->m_tc0080vco, space, tile_offs, 0xffff) & 0x001f;
253                  flipx = tc0080vco_cram_1_r(state->m_tc0080vco, space, tile_offs, 0xffff) & 0x0040;
254                  flipy = tc0080vco_cram_1_r(state->m_tc0080vco, space, tile_offs, 0xffff) & 0x0080;
253255
254256                  if (tc0080vco_flipscreen_r(state->m_tc0080vco))
255257                  {
r17961r17962
281283       is always 64 pixels. */
282284
283285   taitoh_state *state = machine.driver_data<taitoh_state>();
286   address_space &space = machine.driver_data()->generic_space();
284287   static const int size[] = { 1, 2, 4, 4 };
285288   int x0, y0, x, y, dx, ex, zx;
286289   int ysize;
r17961r17962
292295
293296   for (offs = 0x03f8 / 2; offs >= 0; offs -= 0x008 / 2)
294297   {
295      x0        =  tc0080vco_sprram_r(state->m_tc0080vco, offs + 1, 0xffff) & 0x3ff;
296      y0        =  tc0080vco_sprram_r(state->m_tc0080vco, offs + 0, 0xffff) & 0x3ff;
297      zoomx     = (tc0080vco_sprram_r(state->m_tc0080vco, offs + 2, 0xffff) & 0x7f00) >> 8;
298      tile_offs = (tc0080vco_sprram_r(state->m_tc0080vco, offs + 3, 0xffff) & 0x1fff) << 2;
299      pribit    = (tc0080vco_sprram_r(state->m_tc0080vco, offs + 0, 0xffff) & 0x1000) >> 12;
300      ysize     = size[(tc0080vco_sprram_r(state->m_tc0080vco, offs, 0xffff) & 0x0c00) >> 10];
298      x0        =  tc0080vco_sprram_r(state->m_tc0080vco, space, offs + 1, 0xffff) & 0x3ff;
299      y0        =  tc0080vco_sprram_r(state->m_tc0080vco, space, offs + 0, 0xffff) & 0x3ff;
300      zoomx     = (tc0080vco_sprram_r(state->m_tc0080vco, space, offs + 2, 0xffff) & 0x7f00) >> 8;
301      tile_offs = (tc0080vco_sprram_r(state->m_tc0080vco, space, offs + 3, 0xffff) & 0x1fff) << 2;
302      pribit    = (tc0080vco_sprram_r(state->m_tc0080vco, space, offs + 0, 0xffff) & 0x1000) >> 12;
303      ysize     = size[(tc0080vco_sprram_r(state->m_tc0080vco, space, offs, 0xffff) & 0x0c00) >> 10];
301304
302305      if (tile_offs)
303306      {
r17961r17962
317320            zx = (dx + ex) << 12;
318321         }
319322
320         if (tc0080vco_scrram_r(state->m_tc0080vco, 0x0002, 0xffff) & 0x8000)
323         if (tc0080vco_scrram_r(state->m_tc0080vco, space, 0x0002, 0xffff) & 0x8000)
321324            pribit = 1;
322325
323326         if (x0 >= 0x200) x0 -= 0x400;
r17961r17962
347350                  {
348351                     int tile, color, flipx, flipy;
349352
350                     tile  = tc0080vco_cram_0_r(state->m_tc0080vco, tile_offs, 0xffff) & 0x7fff;
351                     color = tc0080vco_cram_1_r(state->m_tc0080vco, tile_offs, 0xffff) & 0x001f;
352                     flipx = tc0080vco_cram_1_r(state->m_tc0080vco, tile_offs, 0xffff) & 0x0040;
353                     flipy = tc0080vco_cram_1_r(state->m_tc0080vco, tile_offs, 0xffff) & 0x0080;
353                     tile  = tc0080vco_cram_0_r(state->m_tc0080vco, space, tile_offs, 0xffff) & 0x7fff;
354                     color = tc0080vco_cram_1_r(state->m_tc0080vco, space, tile_offs, 0xffff) & 0x001f;
355                     flipx = tc0080vco_cram_1_r(state->m_tc0080vco, space, tile_offs, 0xffff) & 0x0040;
356                     flipy = tc0080vco_cram_1_r(state->m_tc0080vco, space, tile_offs, 0xffff) & 0x0080;
354357
355358
356359                     if (tc0080vco_flipscreen_r(state->m_tc0080vco))
trunk/src/mame/video/slapshot.c
r17961r17962
460460SCREEN_UPDATE_IND16( slapshot )
461461{
462462   slapshot_state *state = screen.machine().driver_data<slapshot_state>();
463   address_space &space = screen.machine().driver_data()->generic_space();
463464   UINT8 layer[5];
464465   UINT8 tilepri[5];
465466   UINT8 spritepri[4];
r17961r17962
509510   layer[3] = (priority & 0x000f) >>  0;   /* tells us which is top */
510511   layer[4] = 4;   /* text layer always over bg layers */
511512
512   tilepri[0] = tc0360pri_r(state->m_tc0360pri, 4) & 0x0f;     /* bg0 */
513   tilepri[1] = tc0360pri_r(state->m_tc0360pri, 4) >> 4;       /* bg1 */
514   tilepri[2] = tc0360pri_r(state->m_tc0360pri, 5) & 0x0f;     /* bg2 */
515   tilepri[3] = tc0360pri_r(state->m_tc0360pri, 5) >> 4;       /* bg3 */
513   tilepri[0] = tc0360pri_r(state->m_tc0360pri, space, 4) & 0x0f;     /* bg0 */
514   tilepri[1] = tc0360pri_r(state->m_tc0360pri, space, 4) >> 4;       /* bg1 */
515   tilepri[2] = tc0360pri_r(state->m_tc0360pri, space, 5) & 0x0f;     /* bg2 */
516   tilepri[3] = tc0360pri_r(state->m_tc0360pri, space, 5) >> 4;       /* bg3 */
516517
517518/* we actually assume text layer is on top of everything anyway, but FWIW... */
518   tilepri[layer[4]] = tc0360pri_r(state->m_tc0360pri, 7) & 0x0f;    /* fg (text layer) */
519   tilepri[layer[4]] = tc0360pri_r(state->m_tc0360pri, space, 7) & 0x0f;    /* fg (text layer) */
519520
520   spritepri[0] = tc0360pri_r(state->m_tc0360pri, 6) & 0x0f;
521   spritepri[1] = tc0360pri_r(state->m_tc0360pri, 6) >> 4;
522   spritepri[2] = tc0360pri_r(state->m_tc0360pri, 7) & 0x0f;
523   spritepri[3] = tc0360pri_r(state->m_tc0360pri, 7) >> 4;
521   spritepri[0] = tc0360pri_r(state->m_tc0360pri, space, 6) & 0x0f;
522   spritepri[1] = tc0360pri_r(state->m_tc0360pri, space, 6) >> 4;
523   spritepri[2] = tc0360pri_r(state->m_tc0360pri, space, 7) & 0x0f;
524   spritepri[3] = tc0360pri_r(state->m_tc0360pri, space, 7) >> 4;
524525
525526   screen.machine().priority_bitmap.fill(0, cliprect);
526527   bitmap.fill(0, cliprect);
trunk/src/mame/video/cninja.c
r17961r17962
127127SCREEN_UPDATE_IND16( cninja )
128128{
129129   cninja_state *state = screen.machine().driver_data<cninja_state>();
130   UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, 0, 0xffff);
130   address_space &space = screen.machine().driver_data()->generic_space();
131   UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, space, 0, 0xffff);
131132
132133   state->flip_screen_set(BIT(flip, 7));
133134   deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll);
r17961r17962
148149SCREEN_UPDATE_IND16( cninjabl )
149150{
150151   cninja_state *state = screen.machine().driver_data<cninja_state>();
151   UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, 0, 0xffff);
152   address_space &space = screen.machine().driver_data()->generic_space();
153   UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, space, 0, 0xffff);
152154
153155   /* force layers to be enabled */
154156   deco16ic_set_enable(state->m_deco_tilegen2, 0, 1 );
r17961r17962
173175SCREEN_UPDATE_IND16( edrandy )
174176{
175177   cninja_state *state = screen.machine().driver_data<cninja_state>();
176   UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, 0, 0xffff);
178   address_space &space = screen.machine().driver_data()->generic_space();
179   UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, space, 0, 0xffff);
177180
178181   state->flip_screen_set(BIT(flip, 7));
179182   deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll);
r17961r17962
192195SCREEN_UPDATE_IND16( robocop2 )
193196{
194197   cninja_state *state = screen.machine().driver_data<cninja_state>();
195   UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, 0, 0xffff);
196   UINT16 priority = decocomn_priority_r(state->m_decocomn, 0, 0xffff);
198   address_space &space = screen.machine().driver_data()->generic_space();
199   UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, space, 0, 0xffff);
200   UINT16 priority = decocomn_priority_r(state->m_decocomn, space, 0, 0xffff);
197201
198202   /* One of the tilemap chips can switch between 2 tilemaps at 4bpp, or 1 at 8bpp */
199203   if (priority & 4)
r17961r17962
249253SCREEN_UPDATE_RGB32( mutantf )
250254{
251255   cninja_state *state = screen.machine().driver_data<cninja_state>();
252   UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, 0, 0xffff);
253   UINT16 priority = decocomn_priority_r(state->m_decocomn, 0, 0xffff);
256   address_space &space = screen.machine().driver_data()->generic_space();
257   UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, space, 0, 0xffff);
258   UINT16 priority = decocomn_priority_r(state->m_decocomn, space, 0, 0xffff);
254259
255260
256261   state->flip_screen_set(BIT(flip, 7));
trunk/src/mame/video/tumblep.c
r17961r17962
2222SCREEN_UPDATE_IND16( tumblep )
2323{
2424   tumblep_state *state = screen.machine().driver_data<tumblep_state>();
25   UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, 0, 0xffff);
25   address_space &space = screen.machine().driver_data()->generic_space();
26   UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, space, 0, 0xffff);
2627
2728   state->flip_screen_set(BIT(flip, 7));
2829   deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll);
trunk/src/mame/video/dietgo.c
r17961r17962
66SCREEN_UPDATE_IND16( dietgo )
77{
88   dietgo_state *state = screen.machine().driver_data<dietgo_state>();
9   UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, 0, 0xffff);
9   address_space &space = screen.machine().driver_data()->generic_space();
10   UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, space, 0, 0xffff);
1011
1112   state->flip_screen_set(BIT(flip, 7));
1213   deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll);
trunk/src/mame/video/dassault.c
r17961r17962
7777SCREEN_UPDATE_RGB32( dassault )
7878{
7979   dassault_state *state = screen.machine().driver_data<dassault_state>();
80   UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, 0, 0xffff);
81   UINT16 priority = decocomn_priority_r(state->m_decocomn, 0, 0xffff);
80   address_space &space = screen.machine().driver_data()->generic_space();
81   UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, space, 0, 0xffff);
82   UINT16 priority = decocomn_priority_r(state->m_decocomn, space, 0, 0xffff);
8283
8384   screen.machine().device<decospr_device>("spritegen2")->draw_sprites(bitmap, cliprect, state->m_spriteram2->buffer(), 0x400, false);
8485   screen.machine().device<decospr_device>("spritegen1")->draw_sprites(bitmap, cliprect, state->m_spriteram->buffer(), 0x400, false);
trunk/src/mame/video/supbtime.c
r17961r17962
2424SCREEN_UPDATE_IND16(supbtime)
2525{
2626   supbtime_state *state = screen.machine().driver_data<supbtime_state>();
27   UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, 0, 0xffff);
27   address_space &space = screen.machine().driver_data()->generic_space();
28   UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, space, 0, 0xffff);
2829
2930   state->flip_screen_set(BIT(flip, 7));
3031   deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll);
trunk/src/mame/video/decocomn.h
r17961r17962
5555    DEVICE I/O FUNCTIONS
5656***************************************************************************/
5757
58WRITE16_DEVICE_HANDLER( decocomn_nonbuffered_palette_w );
59WRITE16_DEVICE_HANDLER( decocomn_buffered_palette_w );
60WRITE16_DEVICE_HANDLER( decocomn_palette_dma_w );
58DECLARE_WRITE16_DEVICE_HANDLER( decocomn_nonbuffered_palette_w );
59DECLARE_WRITE16_DEVICE_HANDLER( decocomn_buffered_palette_w );
60DECLARE_WRITE16_DEVICE_HANDLER( decocomn_palette_dma_w );
6161
62WRITE16_DEVICE_HANDLER( decocomn_priority_w );
63READ16_DEVICE_HANDLER( decocomn_priority_r );
62DECLARE_WRITE16_DEVICE_HANDLER( decocomn_priority_w );
63DECLARE_READ16_DEVICE_HANDLER( decocomn_priority_r );
6464
65READ16_DEVICE_HANDLER( decocomn_71_r );
65DECLARE_READ16_DEVICE_HANDLER( decocomn_71_r );
6666
6767#endif
trunk/src/mame/video/xmen.c
r17961r17962
158158      cliprect.set(0, 64 * 8 - 1, 2 * 8, 30 * 8 - 1);
159159
160160
161      address_space &space = screen.machine().driver_data()->generic_space();
161162      if (screen.machine().primary_screen->frame_number() & 0x01)
162163      {
163164
r17961r17962
171172         for (offset = 0; offset < (0xc000 / 2); offset++)
172173         {
173174   //          K052109_lsb_w
174            k052109_w(state->m_k052109, offset, state->m_xmen6p_tilemapright[offset] & 0x00ff);
175            k052109_w(state->m_k052109, space, offset, state->m_xmen6p_tilemapright[offset] & 0x00ff);
175176         }
176177
177178
r17961r17962
190191         for (offset = 0; offset < (0xc000 / 2); offset++)
191192         {
192193   //          K052109_lsb_w
193            k052109_w(state->m_k052109, offset, state->m_xmen6p_tilemapleft[offset] & 0x00ff);
194            k052109_w(state->m_k052109, space, offset, state->m_xmen6p_tilemapleft[offset] & 0x00ff);
194195         }
195196
196197
trunk/src/mame/video/naughtyb.c
r17961r17962
113113WRITE8_MEMBER(naughtyb_state::naughtyb_videoreg_w)
114114{
115115   // bits 4+5 control the sound circuit
116   pleiads_sound_control_c_w(machine().device("cust"),offset,data);
116   pleiads_sound_control_c_w(machine().device("cust"),space,offset,data);
117117
118118   m_cocktail =
119119      ( ( ioport("DSW0")->read() & 0x80 ) &&   // cabinet == cocktail
r17961r17962
125125WRITE8_MEMBER(naughtyb_state::popflame_videoreg_w)
126126{
127127   // bits 4+5 control the sound circuit
128   pleiads_sound_control_c_w(machine().device("cust"),offset,data);
128   pleiads_sound_control_c_w(machine().device("cust"),space,offset,data);
129129
130130   m_cocktail =
131131      ( ( ioport("DSW0")->read() & 0x80 ) &&   // cabinet == cocktail
trunk/src/mame/video/ultratnk.c
r17961r17962
142142
143143      /* update sound status */
144144
145      discrete_sound_w(discrete, ULTRATNK_MOTOR_DATA_1, videoram[0x391] & 15);
146      discrete_sound_w(discrete, ULTRATNK_MOTOR_DATA_2, videoram[0x393] & 15);
145      address_space &space = screen.machine().driver_data()->generic_space();
146      discrete_sound_w(discrete, space, ULTRATNK_MOTOR_DATA_1, videoram[0x391] & 15);
147      discrete_sound_w(discrete, space, ULTRATNK_MOTOR_DATA_2, videoram[0x393] & 15);
147148   }
148149}
149150
trunk/src/mame/video/phoenix.c
r17961r17962
294294   m_pleiads_protection_question = data & 0xfc;
295295
296296   /* send two bits to sound control C (not sure if they are there) */
297   pleiads_sound_control_c_w(machine().device("cust"), offset, data);
297   pleiads_sound_control_c_w(machine().device("cust"), space, offset, data);
298298}
299299
300300
trunk/src/mame/video/boogwing.c
r17961r17962
2828   bitmap_ind16 *sprite_bitmap1, *sprite_bitmap2;
2929   bitmap_ind8* priority_bitmap;
3030
31   UINT16 priority = decocomn_priority_r(state->m_decocomn, 0, 0xffff);
31   address_space &space = machine.driver_data()->generic_space();
32   UINT16 priority = decocomn_priority_r(state->m_decocomn, space, 0, 0xffff);
3233
3334   sprite_bitmap1 = &machine.device<decospr_device>("spritegen1")->get_sprite_temp_bitmap();
3435   sprite_bitmap2 = &machine.device<decospr_device>("spritegen2")->get_sprite_temp_bitmap();
r17961r17962
180181SCREEN_UPDATE_RGB32( boogwing )
181182{
182183   boogwing_state *state = screen.machine().driver_data<boogwing_state>();
183   UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, 0, 0xffff);
184   UINT16 priority = decocomn_priority_r(state->m_decocomn, 0, 0xffff);
184   address_space &space = screen.machine().driver_data()->generic_space();
185   UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, space, 0, 0xffff);
186   UINT16 priority = decocomn_priority_r(state->m_decocomn, space, 0, 0xffff);
185187
186188   /* Draw sprite planes to bitmaps for later mixing */
187189   screen.machine().device<decospr_device>("spritegen2")->draw_sprites(bitmap, cliprect, state->m_spriteram2->buffer(), 0x400, true);
trunk/src/mame/video/kan_pand.h
r17961r17962
6262void pandora_set_clear_bitmap(device_t *device, int clear);
6363void pandora_set_bg_pen( device_t *device, int pen );
6464
65WRITE8_DEVICE_HANDLER ( pandora_spriteram_w );
66READ8_DEVICE_HANDLER( pandora_spriteram_r );
65DECLARE_WRITE8_DEVICE_HANDLER ( pandora_spriteram_w );
66DECLARE_READ8_DEVICE_HANDLER( pandora_spriteram_r );
6767
68WRITE16_DEVICE_HANDLER( pandora_spriteram_LSB_w );
69READ16_DEVICE_HANDLER( pandora_spriteram_LSB_r );
68DECLARE_WRITE16_DEVICE_HANDLER( pandora_spriteram_LSB_w );
69DECLARE_READ16_DEVICE_HANDLER( pandora_spriteram_LSB_r );
7070
7171#endif /* __KAN_PAND_H__ */
7272
trunk/src/mame/video/gradius3.c
r17961r17962
126126   gradius3_state *state = screen.machine().driver_data<gradius3_state>();
127127
128128   /* TODO: this kludge enforces the char banks. For some reason, they don't work otherwise. */
129   k052109_w(state->m_k052109, 0x1d80, 0x10);
130   k052109_w(state->m_k052109, 0x1f00, 0x32);
129   address_space &space = screen.machine().driver_data()->generic_space();
130   k052109_w(state->m_k052109, space, 0x1d80, 0x10);
131   k052109_w(state->m_k052109, space, 0x1f00, 0x32);
131132
132133   k052109_tilemap_update(state->m_k052109);
133134
trunk/src/mame/video/konicdev.c
r17961r17962
24552455
24562456READ16_DEVICE_HANDLER( k052109_word_r )
24572457{
2458   return k052109_r(device, offset + 0x2000) | (k052109_r(device, offset) << 8);
2458   return k052109_r(device, space, offset + 0x2000) | (k052109_r(device, space, offset) << 8);
24592459}
24602460
24612461WRITE16_DEVICE_HANDLER( k052109_word_w )
24622462{
24632463   if (ACCESSING_BITS_8_15)
2464      k052109_w(device, offset, (data >> 8) & 0xff);
2464      k052109_w(device, space, offset, (data >> 8) & 0xff);
24652465   if (ACCESSING_BITS_0_7)
2466      k052109_w(device, offset + 0x2000, data & 0xff);
2466      k052109_w(device, space, offset + 0x2000, data & 0xff);
24672467}
24682468
24692469READ16_DEVICE_HANDLER( k052109_lsb_r )
24702470{
2471   return k052109_r(device, offset);
2471   return k052109_r(device, space, offset);
24722472}
24732473
24742474WRITE16_DEVICE_HANDLER( k052109_lsb_w )
24752475{
24762476   if(ACCESSING_BITS_0_7)
2477      k052109_w(device, offset, data & 0xff);
2477      k052109_w(device, space, offset, data & 0xff);
24782478}
24792479
24802480void k052109_set_rmrd_line( device_t *device, int state )
r17961r17962
29782978
29792979READ16_DEVICE_HANDLER( k051960_word_r )
29802980{
2981   return k051960_r(device, offset * 2 + 1) | (k051960_r(device, offset * 2) << 8);
2981   return k051960_r(device, space, offset * 2 + 1) | (k051960_r(device, space, offset * 2) << 8);
29822982}
29832983
29842984WRITE16_DEVICE_HANDLER( k051960_word_w )
29852985{
29862986   if (ACCESSING_BITS_8_15)
2987      k051960_w(device, offset * 2, (data >> 8) & 0xff);
2987      k051960_w(device, space, offset * 2, (data >> 8) & 0xff);
29882988   if (ACCESSING_BITS_0_7)
2989      k051960_w(device, offset * 2 + 1, data & 0xff);
2989      k051960_w(device, space, offset * 2 + 1, data & 0xff);
29902990}
29912991
29922992
r17961r17962
30753075
30763076READ16_DEVICE_HANDLER( k051937_word_r )
30773077{
3078   return k051937_r(device, offset * 2 + 1) | (k051937_r(device, offset * 2) << 8);
3078   return k051937_r(device, space, offset * 2 + 1) | (k051937_r(device, space, offset * 2) << 8);
30793079}
30803080
30813081WRITE16_DEVICE_HANDLER( k051937_word_w )
30823082{
30833083   if (ACCESSING_BITS_8_15)
3084      k051937_w(device, offset * 2,(data >> 8) & 0xff);
3084      k051937_w(device, space, offset * 2,(data >> 8) & 0xff);
30853085   if (ACCESSING_BITS_0_7)
3086      k051937_w(device, offset * 2 + 1,data & 0xff);
3086      k051937_w(device, space, offset * 2 + 1,data & 0xff);
30873087}
30883088
30893089/*
r17961r17962
36243624
36253625READ16_DEVICE_HANDLER( k053244_lsb_r )
36263626{
3627   return k053244_r(device, offset);
3627   return k053244_r(device, space, offset);
36283628}
36293629
36303630WRITE16_DEVICE_HANDLER( k053244_lsb_w )
36313631{
36323632   if (ACCESSING_BITS_0_7)
3633      k053244_w(device, offset, data & 0xff);
3633      k053244_w(device, space, offset, data & 0xff);
36343634}
36353635
36363636READ16_DEVICE_HANDLER( k053244_word_r )
36373637{
3638   return (k053244_r(device, offset * 2) << 8) | k053244_r(device, offset * 2 + 1);
3638   return (k053244_r(device, space, offset * 2) << 8) | k053244_r(device, space, offset * 2 + 1);
36393639}
36403640
36413641WRITE16_DEVICE_HANDLER( k053244_word_w )
36423642{
36433643   if (ACCESSING_BITS_8_15)
3644      k053244_w(device, offset * 2, (data >> 8) & 0xff);
3644      k053244_w(device, space, offset * 2, (data >> 8) & 0xff);
36453645   if (ACCESSING_BITS_0_7)
3646      k053244_w(device, offset * 2 + 1, data & 0xff);
3646      k053244_w(device, space, offset * 2 + 1, data & 0xff);
36473647}
36483648
36493649void k053244_bankselect( device_t *device, int bank )
r17961r17962
45744574READ16_DEVICE_HANDLER( k053246_word_r )
45754575{
45764576   offset <<= 1;
4577   return k053246_r(device, offset + 1) | (k053246_r(device, offset) << 8);
4577   return k053246_r(device, space, offset + 1) | (k053246_r(device, space, offset) << 8);
45784578}
45794579
45804580WRITE16_DEVICE_HANDLER( k053246_word_w )
45814581{
45824582   if (ACCESSING_BITS_8_15)
4583      k053246_w(device, offset << 1,(data >> 8) & 0xff);
4583      k053246_w(device, space, offset << 1,(data >> 8) & 0xff);
45844584   if (ACCESSING_BITS_0_7)
4585      k053246_w(device, (offset << 1) + 1,data & 0xff);
4585      k053246_w(device, space, (offset << 1) + 1,data & 0xff);
45864586}
45874587
45884588READ32_DEVICE_HANDLER( k053246_long_r )
45894589{
45904590   offset <<= 1;
4591   return (k053246_word_r(device, offset + 1, 0xffff) | k053246_word_r(device, offset, 0xffff) << 16);
4591   return (k053246_word_r(device, space, offset + 1, 0xffff) | k053246_word_r(device, space, offset, 0xffff) << 16);
45924592}
45934593
45944594WRITE32_DEVICE_HANDLER( k053246_long_w )
45954595{
45964596   offset <<= 1;
4597   k053246_word_w(device, offset, data >> 16, mem_mask >> 16);
4598   k053246_word_w(device, offset + 1, data, mem_mask);
4597   k053246_word_w(device, space, offset, data >> 16, mem_mask >> 16);
4598   k053246_word_w(device, space, offset + 1, data, mem_mask);
45994599}
46004600
46014601void k053246_set_objcha_line( device_t *device, int state )
r17961r17962
60266026WRITE16_DEVICE_HANDLER( k053251_lsb_w )
60276027{
60286028   if (ACCESSING_BITS_0_7)
6029      k053251_w(device, offset, data & 0xff);
6029      k053251_w(device, space, offset, data & 0xff);
60306030}
60316031
60326032WRITE16_DEVICE_HANDLER( k053251_msb_w )
60336033{
60346034   if (ACCESSING_BITS_8_15)
6035      k053251_w(device, offset, (data >> 8) & 0xff);
6035      k053251_w(device, space, offset, (data >> 8) & 0xff);
60366036}
60376037
60386038int k053251_get_priority( device_t *device, int ci )
r17961r17962
62166216
62176217READ16_DEVICE_HANDLER( k054000_lsb_r )
62186218{
6219   return k054000_r(device, offset);
6219   return k054000_r(device, space, offset);
62206220}
62216221
62226222WRITE16_DEVICE_HANDLER( k054000_lsb_w )
62236223{
62246224   if (ACCESSING_BITS_0_7)
6225      k054000_w(device, offset, data & 0xff);
6225      k054000_w(device, space, offset, data & 0xff);
62266226}
62276227
62286228/*****************************************************************************
r17961r17962
69956995READ32_DEVICE_HANDLER( k056832_rom_long_r )
69966996{
69976997   offset <<= 1;
6998   return (k056832_rom_word_r(device, offset + 1, 0xffff) | (k056832_rom_word_r(device, offset, 0xffff) << 16));
6998   return (k056832_rom_word_r(device, space, offset + 1, 0xffff) | (k056832_rom_word_r(device, space, offset, 0xffff) << 16));
69996999}
70007000
70017001/* only one page is mapped to videoram at a time through a window */
r17961r17962
73527352   // if (ACCESSING_xxx) trick.  in particular, 8-bit writes
73537353   // are used to the tilemap bank register.
73547354   offset <<= 1;
7355   k056832_word_w(device, offset, data >> 16, mem_mask >> 16);
7356   k056832_word_w(device, offset + 1, data, mem_mask);
7355   k056832_word_w(device, space, offset, data >> 16, mem_mask >> 16);
7356   k056832_word_w(device, space, offset + 1, data, mem_mask);
73577357}
73587358
73597359WRITE16_DEVICE_HANDLER( k056832_b_word_w )
r17961r17962
73667366{
73677367   if (offset & 1)
73687368   {
7369      k056832_word_w(device, (offset >> 1), data, 0x00ff);
7369      k056832_word_w(device, space, (offset >> 1), data, 0x00ff);
73707370   }
73717371   else
73727372   {
7373      k056832_word_w(device, (offset >> 1), data << 8, 0xff00);
7373      k056832_word_w(device, space, (offset >> 1), data << 8, 0xff00);
73747374   }
73757375}
73767376
r17961r17962
73787378{
73797379   if (offset & 1)
73807380   {
7381      k056832_b_word_w(device, (offset >> 1), data, 0x00ff);
7381      k056832_b_word_w(device, space, (offset >> 1), data, 0x00ff);
73827382   }
73837383   else
73847384   {
7385      k056832_b_word_w(device, (offset >> 1), data<<8, 0xff00);
7385      k056832_b_word_w(device, space, (offset >> 1), data<<8, 0xff00);
73867386   }
73877387}
73887388
r17961r17962
73907390{
73917391   if (ACCESSING_BITS_16_31)
73927392   {
7393      k056832_b_word_w(device, offset << 1, data >> 16, mem_mask >> 16);
7393      k056832_b_word_w(device, space, offset << 1, data >> 16, mem_mask >> 16);
73947394   }
73957395   if (ACCESSING_BITS_0_15)
73967396   {
7397      k056832_b_word_w(device, (offset << 1) + 1, data, mem_mask);
7397      k056832_b_word_w(device, space, (offset << 1) + 1, data, mem_mask);
73987398   }
73997399}
74007400
r17961r17962
86618661WRITE32_DEVICE_HANDLER( k054338_long_w )
86628662{
86638663   offset <<= 1;
8664   k054338_word_w(device, offset, data >> 16, mem_mask >> 16);
8665   k054338_word_w(device, offset + 1, data, mem_mask);
8664   k054338_word_w(device, space, offset, data >> 16, mem_mask >> 16);
8665   k054338_word_w(device, space, offset + 1, data, mem_mask);
86668666}
86678667
86688668// returns a 16-bit '338 register
r17961r17962
1089710897READ32_DEVICE_HANDLER( k056832_long_r )
1089810898{
1089910899   offset <<= 1;
10900   return (k056832_word_r(device, offset + 1, 0xffff) | k056832_word_r(device, offset, 0xffff) << 16);
10900   return (k056832_word_r(device, space, offset + 1, 0xffff) | k056832_word_r(device, space, offset, 0xffff) << 16);
1090110901}
1090210902
1090310903READ32_DEVICE_HANDLER( k053247_reg_long_r )
1090410904{
1090510905   offset <<= 1;
10906   return (k053247_reg_word_r(device, offset + 1, 0xffff) | k053247_reg_word_r(device, offset, 0xffff) << 16);
10906   return (k053247_reg_word_r(device, space, offset + 1, 0xffff) | k053247_reg_word_r(device, space, offset, 0xffff) << 16);
1090710907}
1090810908
1090910909READ32_DEVICE_HANDLER( k055555_long_r )
1091010910{
1091110911   offset <<= 1;
10912   return (k055555_word_r(device, offset + 1, 0xffff) | k055555_word_r(device, offset, 0xffff) << 16);
10912   return (k055555_word_r(device, space, offset + 1, 0xffff) | k055555_word_r(device, space, offset, 0xffff) << 16);
1091310913}
1091410914
1091510915READ16_DEVICE_HANDLER( k053244_reg_word_r )
trunk/src/mame/video/konicdev.h
r17961r17962
713713***************************************************************************/
714714
715715/**  Konami 007121  **/
716READ8_DEVICE_HANDLER( k007121_ctrlram_r );
717WRITE8_DEVICE_HANDLER( k007121_ctrl_w );
716DECLARE_READ8_DEVICE_HANDLER( k007121_ctrlram_r );
717DECLARE_WRITE8_DEVICE_HANDLER( k007121_ctrl_w );
718718
719719/* shall we move source in the interface? */
720720/* also notice that now we directly pass *gfx[chip] instead of **gfx !! */
r17961r17962
723723
724724
725725/**  Konami 007342  **/
726READ8_DEVICE_HANDLER( k007342_r );
727WRITE8_DEVICE_HANDLER( k007342_w );
728READ8_DEVICE_HANDLER( k007342_scroll_r );
729WRITE8_DEVICE_HANDLER( k007342_scroll_w );
730WRITE8_DEVICE_HANDLER( k007342_vreg_w );
726DECLARE_READ8_DEVICE_HANDLER( k007342_r );
727DECLARE_WRITE8_DEVICE_HANDLER( k007342_w );
728DECLARE_READ8_DEVICE_HANDLER( k007342_scroll_r );
729DECLARE_WRITE8_DEVICE_HANDLER( k007342_scroll_w );
730DECLARE_WRITE8_DEVICE_HANDLER( k007342_vreg_w );
731731
732732void k007342_tilemap_update(device_t *device);
733733void k007342_tilemap_draw(device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect, int num, int flags, UINT32 priority);
r17961r17962
737737/**  Konami 007420  **/
738738#define K007420_SPRITERAM_SIZE 0x200
739739
740READ8_DEVICE_HANDLER( k007420_r );
741WRITE8_DEVICE_HANDLER( k007420_w );
740DECLARE_READ8_DEVICE_HANDLER( k007420_r );
741DECLARE_WRITE8_DEVICE_HANDLER( k007420_w );
742742void k007420_sprites_draw(device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect, gfx_element *gfx);
743743
744744
r17961r17962
772772  chip so it must not be set by the callback.
773773*/
774774
775READ8_DEVICE_HANDLER( k052109_r );
776WRITE8_DEVICE_HANDLER( k052109_w );
777READ16_DEVICE_HANDLER( k052109_word_r );
778WRITE16_DEVICE_HANDLER( k052109_word_w );
779READ16_DEVICE_HANDLER( k052109_lsb_r );
780WRITE16_DEVICE_HANDLER( k052109_lsb_w );
775DECLARE_READ8_DEVICE_HANDLER( k052109_r );
776DECLARE_WRITE8_DEVICE_HANDLER( k052109_w );
777DECLARE_READ16_DEVICE_HANDLER( k052109_word_r );
778DECLARE_WRITE16_DEVICE_HANDLER( k052109_word_w );
779DECLARE_READ16_DEVICE_HANDLER( k052109_lsb_r );
780DECLARE_WRITE16_DEVICE_HANDLER( k052109_lsb_w );
781781
782782void k052109_set_rmrd_line(device_t *device, int state);
783783int k052109_get_rmrd_line(device_t *device);
r17961r17962
803803  the game has special treatment (Aliens)
804804*/
805805
806READ8_DEVICE_HANDLER( k051960_r );
807WRITE8_DEVICE_HANDLER( k051960_w );
808READ16_DEVICE_HANDLER( k051960_word_r );
809WRITE16_DEVICE_HANDLER( k051960_word_w );
806DECLARE_READ8_DEVICE_HANDLER( k051960_r );
807DECLARE_WRITE8_DEVICE_HANDLER( k051960_w );
808DECLARE_READ16_DEVICE_HANDLER( k051960_word_r );
809DECLARE_WRITE16_DEVICE_HANDLER( k051960_word_w );
810810
811READ8_DEVICE_HANDLER( k051937_r );
812WRITE8_DEVICE_HANDLER( k051937_w );
813READ16_DEVICE_HANDLER( k051937_word_r );
814WRITE16_DEVICE_HANDLER( k051937_word_w );
811DECLARE_READ8_DEVICE_HANDLER( k051937_r );
812DECLARE_WRITE8_DEVICE_HANDLER( k051937_w );
813DECLARE_READ16_DEVICE_HANDLER( k051937_word_r );
814DECLARE_WRITE16_DEVICE_HANDLER( k051937_word_w );
815815
816816void k051960_sprites_draw(device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect, int min_priority, int max_priority);
817817int k051960_is_irq_enabled(device_t *device);
r17961r17962
826826
827827
828828/**  Konami 053244 / 053245  **/
829READ16_DEVICE_HANDLER( k053245_word_r );
830WRITE16_DEVICE_HANDLER( k053245_word_w );
831READ8_DEVICE_HANDLER( k053245_r );
832WRITE8_DEVICE_HANDLER( k053245_w );
833READ8_DEVICE_HANDLER( k053244_r );
834WRITE8_DEVICE_HANDLER( k053244_w );
835READ16_DEVICE_HANDLER( k053244_lsb_r );
836WRITE16_DEVICE_HANDLER( k053244_lsb_w );
837READ16_DEVICE_HANDLER( k053244_word_r );
838WRITE16_DEVICE_HANDLER( k053244_word_w );
829DECLARE_READ16_DEVICE_HANDLER( k053245_word_r );
830DECLARE_WRITE16_DEVICE_HANDLER( k053245_word_w );
831DECLARE_READ8_DEVICE_HANDLER( k053245_r );
832DECLARE_WRITE8_DEVICE_HANDLER( k053245_w );
833DECLARE_READ8_DEVICE_HANDLER( k053244_r );
834DECLARE_WRITE8_DEVICE_HANDLER( k053244_w );
835DECLARE_READ16_DEVICE_HANDLER( k053244_lsb_r );
836DECLARE_WRITE16_DEVICE_HANDLER( k053244_lsb_w );
837DECLARE_READ16_DEVICE_HANDLER( k053244_word_r );
838DECLARE_WRITE16_DEVICE_HANDLER( k053244_word_w );
839839void k053244_bankselect(device_t *device, int bank);   /* used by TMNT2, Asterix and Premier Soccer for ROM testing */
840840void k053245_sprites_draw(device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect);
841841void k053245_sprites_draw_lethal(device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect); /* for lethal enforcers */
r17961r17962
850850#define K055673_LAYOUT_LE2 2
851851#define K055673_LAYOUT_GX6 3
852852
853READ16_DEVICE_HANDLER( k055673_rom_word_r );
854READ16_DEVICE_HANDLER( k055673_GX6bpp_rom_word_r );
853DECLARE_READ16_DEVICE_HANDLER( k055673_rom_word_r );
854DECLARE_READ16_DEVICE_HANDLER( k055673_GX6bpp_rom_word_r );
855855
856856/*
857857Callback procedures for non-standard shadows:
r17961r17962
863863#define K053247_CUSTOMSHADOW   0x20000000
864864#define K053247_SHDSHIFT      20
865865
866READ8_DEVICE_HANDLER( k053247_r );
867WRITE8_DEVICE_HANDLER( k053247_w );
868READ16_DEVICE_HANDLER( k053247_word_r );
869WRITE16_DEVICE_HANDLER( k053247_word_w );
870READ32_DEVICE_HANDLER( k053247_long_r );
871WRITE32_DEVICE_HANDLER( k053247_long_w );
872WRITE16_DEVICE_HANDLER( k053247_reg_word_w ); // "OBJSET2" registers
873WRITE32_DEVICE_HANDLER( k053247_reg_long_w );
866DECLARE_READ8_DEVICE_HANDLER( k053247_r );
867DECLARE_WRITE8_DEVICE_HANDLER( k053247_w );
868DECLARE_READ16_DEVICE_HANDLER( k053247_word_r );
869DECLARE_WRITE16_DEVICE_HANDLER( k053247_word_w );
870DECLARE_READ32_DEVICE_HANDLER( k053247_long_r );
871DECLARE_WRITE32_DEVICE_HANDLER( k053247_long_w );
872DECLARE_WRITE16_DEVICE_HANDLER( k053247_reg_word_w ); // "OBJSET2" registers
873DECLARE_WRITE32_DEVICE_HANDLER( k053247_reg_long_w );
874874
875875void k053247_sprites_draw(device_t *device, bitmap_ind16 &bitmap,const rectangle &cliprect);
876876void k053247_sprites_draw(device_t *device, bitmap_rgb32 &bitmap,const rectangle &cliprect);
r17961r17962
883883int k053247_get_dx(device_t *device);
884884int k053247_get_dy(device_t *device);
885885
886READ8_DEVICE_HANDLER( k053246_r );
887WRITE8_DEVICE_HANDLER( k053246_w );
888READ16_DEVICE_HANDLER( k053246_word_r );
889WRITE16_DEVICE_HANDLER( k053246_word_w );
890READ32_DEVICE_HANDLER( k053246_long_r );
891WRITE32_DEVICE_HANDLER( k053246_long_w );
886DECLARE_READ8_DEVICE_HANDLER( k053246_r );
887DECLARE_WRITE8_DEVICE_HANDLER( k053246_w );
888DECLARE_READ16_DEVICE_HANDLER( k053246_word_r );
889DECLARE_WRITE16_DEVICE_HANDLER( k053246_word_w );
890DECLARE_READ32_DEVICE_HANDLER( k053246_long_r );
891DECLARE_WRITE32_DEVICE_HANDLER( k053246_long_w );
892892
893893void k053246_set_objcha_line(device_t *device, int state);
894894int k053246_is_irq_enabled(device_t *device);
r17961r17962
907907  structure (e.g. TILE_FLIPX)
908908*/
909909
910READ8_DEVICE_HANDLER( k051316_r );
911WRITE8_DEVICE_HANDLER( k051316_w );
912READ8_DEVICE_HANDLER( k051316_rom_r );
913WRITE8_DEVICE_HANDLER( k051316_ctrl_w );
910DECLARE_READ8_DEVICE_HANDLER( k051316_r );
911DECLARE_WRITE8_DEVICE_HANDLER( k051316_w );
912DECLARE_READ8_DEVICE_HANDLER( k051316_rom_r );
913DECLARE_WRITE8_DEVICE_HANDLER( k051316_ctrl_w );
914914void k051316_zoom_draw(device_t *device, bitmap_ind16 &bitmap,const rectangle &cliprect,int flags,UINT32 priority);
915915void k051316_wraparound_enable(device_t *device, int status);
916916
917917
918918/**  Konami 053936  **/
919WRITE16_DEVICE_HANDLER( k053936_ctrl_w );
920READ16_DEVICE_HANDLER( k053936_ctrl_r );   // FIXME: this is probably unused... to be checked!
921WRITE16_DEVICE_HANDLER( k053936_linectrl_w );
922READ16_DEVICE_HANDLER( k053936_linectrl_r );
919DECLARE_WRITE16_DEVICE_HANDLER( k053936_ctrl_w );
920DECLARE_READ16_DEVICE_HANDLER( k053936_ctrl_r );   // FIXME: this is probably unused... to be checked!
921DECLARE_WRITE16_DEVICE_HANDLER( k053936_linectrl_w );
922DECLARE_READ16_DEVICE_HANDLER( k053936_linectrl_r );
923923void k053936_zoom_draw(device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect, tilemap_t *tmap, int flags, UINT32 priority, int glfgreat_hack);
924924void k053936_wraparound_enable(device_t *device, int status);   // shall we merge this into the configuration intf?
925925void k053936_set_offset(device_t *device, int xoffs, int yoffs);   // shall we merge this into the configuration intf?
r17961r17962
931931  when some palette index changes. If ALL_TILEMAPS is too expensive, use
932932  k053251_set_tilemaps() to indicate which tilemap is associated with each index.
933933 */
934WRITE8_DEVICE_HANDLER( k053251_w );
935WRITE16_DEVICE_HANDLER( k053251_lsb_w );
936WRITE16_DEVICE_HANDLER( k053251_msb_w );
934DECLARE_WRITE8_DEVICE_HANDLER( k053251_w );
935DECLARE_WRITE16_DEVICE_HANDLER( k053251_lsb_w );
936DECLARE_WRITE16_DEVICE_HANDLER( k053251_msb_w );
937937int k053251_get_priority(device_t *device, int ci);
938938int k053251_get_palette_index(device_t *device, int ci);
939939int k053251_get_tmap_dirty(device_t *device, int tmap_num);
r17961r17962
949949};
950950
951951/**  Konami 054000 **/
952WRITE8_DEVICE_HANDLER( k054000_w );
953READ8_DEVICE_HANDLER( k054000_r );
954WRITE16_DEVICE_HANDLER( k054000_lsb_w );
955READ16_DEVICE_HANDLER( k054000_lsb_r );
952DECLARE_WRITE8_DEVICE_HANDLER( k054000_w );
953DECLARE_READ8_DEVICE_HANDLER( k054000_r );
954DECLARE_WRITE16_DEVICE_HANDLER( k054000_lsb_w );
955DECLARE_READ16_DEVICE_HANDLER( k054000_lsb_r );
956956
957957
958958/**  Konami 051733 **/
959WRITE8_DEVICE_HANDLER( k051733_w );
960READ8_DEVICE_HANDLER( k051733_r );
959DECLARE_WRITE8_DEVICE_HANDLER( k051733_w );
960DECLARE_READ8_DEVICE_HANDLER( k051733_r );
961961
962962
963963/**  Konami 056832 **/
964964void k056832_SetExtLinescroll(device_t *device);   /* Lethal Enforcers */
965965
966READ16_DEVICE_HANDLER( k056832_ram_word_r );
967WRITE16_DEVICE_HANDLER( k056832_ram_word_w );
968READ16_DEVICE_HANDLER( k056832_ram_half_word_r );
969WRITE16_DEVICE_HANDLER( k056832_ram_half_word_w );
970READ16_DEVICE_HANDLER( k056832_5bpp_rom_word_r );
971READ32_DEVICE_HANDLER( k056832_5bpp_rom_long_r );
972READ32_DEVICE_HANDLER( k056832_6bpp_rom_long_r );
973READ16_DEVICE_HANDLER( k056832_rom_word_r );
974READ16_DEVICE_HANDLER( k056832_mw_rom_word_r );
975READ16_DEVICE_HANDLER( k056832_bishi_rom_word_r );
976READ16_DEVICE_HANDLER( k056832_old_rom_word_r );
977READ16_DEVICE_HANDLER( k056832_rom_word_8000_r );
978WRITE16_DEVICE_HANDLER( k056832_word_w ); // "VRAM" registers
979WRITE16_DEVICE_HANDLER( k056832_b_word_w );
980READ8_DEVICE_HANDLER( k056832_ram_code_lo_r );
981READ8_DEVICE_HANDLER( k056832_ram_code_hi_r );
982READ8_DEVICE_HANDLER( k056832_ram_attr_lo_r );
983READ8_DEVICE_HANDLER( k056832_ram_attr_hi_r );
984WRITE8_DEVICE_HANDLER( k056832_ram_code_lo_w );
985WRITE8_DEVICE_HANDLER( k056832_ram_code_hi_w );
986WRITE8_DEVICE_HANDLER( k056832_ram_attr_lo_w );
987WRITE8_DEVICE_HANDLER( k056832_ram_attr_hi_w );
988WRITE8_DEVICE_HANDLER( k056832_w );
989WRITE8_DEVICE_HANDLER( k056832_b_w );
966DECLARE_READ16_DEVICE_HANDLER( k056832_ram_word_r );
967DECLARE_WRITE16_DEVICE_HANDLER( k056832_ram_word_w );
968DECLARE_READ16_DEVICE_HANDLER( k056832_ram_half_word_r );
969DECLARE_WRITE16_DEVICE_HANDLER( k056832_ram_half_word_w );
970DECLARE_READ16_DEVICE_HANDLER( k056832_5bpp_rom_word_r );
971DECLARE_READ32_DEVICE_HANDLER( k056832_5bpp_rom_long_r );
972DECLARE_READ32_DEVICE_HANDLER( k056832_6bpp_rom_long_r );
973DECLARE_READ16_DEVICE_HANDLER( k056832_rom_word_r );
974DECLARE_READ16_DEVICE_HANDLER( k056832_mw_rom_word_r );
975DECLARE_READ16_DEVICE_HANDLER( k056832_bishi_rom_word_r );
976DECLARE_READ16_DEVICE_HANDLER( k056832_old_rom_word_r );
977DECLARE_READ16_DEVICE_HANDLER( k056832_rom_word_8000_r );
978DECLARE_WRITE16_DEVICE_HANDLER( k056832_word_w ); // "VRAM" registers
979DECLARE_WRITE16_DEVICE_HANDLER( k056832_b_word_w );
980DECLARE_READ8_DEVICE_HANDLER( k056832_ram_code_lo_r );
981DECLARE_READ8_DEVICE_HANDLER( k056832_ram_code_hi_r );
982DECLARE_READ8_DEVICE_HANDLER( k056832_ram_attr_lo_r );
983DECLARE_READ8_DEVICE_HANDLER( k056832_ram_attr_hi_r );
984DECLARE_WRITE8_DEVICE_HANDLER( k056832_ram_code_lo_w );
985DECLARE_WRITE8_DEVICE_HANDLER( k056832_ram_code_hi_w );
986DECLARE_WRITE8_DEVICE_HANDLER( k056832_ram_attr_lo_w );
987DECLARE_WRITE8_DEVICE_HANDLER( k056832_ram_attr_hi_w );
988DECLARE_WRITE8_DEVICE_HANDLER( k056832_w );
989DECLARE_WRITE8_DEVICE_HANDLER( k056832_b_w );
990990void k056832_mark_plane_dirty(device_t *device, int num);
991991void k056832_mark_all_tmaps_dirty(device_t *device);
992992void k056832_tilemap_draw(device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect, int num, UINT32 flags, UINT32 priority);
r17961r17962
10041004int k056832_get_lookup(device_t *device, int bits);   /* Asterix */
10051005void k056832_set_tile_bank(device_t *device, int bank);   /* Asterix */
10061006
1007READ32_DEVICE_HANDLER( k056832_ram_long_r );
1008READ32_DEVICE_HANDLER( k056832_rom_long_r );
1009WRITE32_DEVICE_HANDLER( k056832_ram_long_w );
1010READ32_DEVICE_HANDLER( k056832_unpaged_ram_long_r );
1011WRITE32_DEVICE_HANDLER( k056832_unpaged_ram_long_w );
1012WRITE32_DEVICE_HANDLER( k056832_long_w );
1013WRITE32_DEVICE_HANDLER( k056832_b_long_w );
1007DECLARE_READ32_DEVICE_HANDLER( k056832_ram_long_r );
1008DECLARE_READ32_DEVICE_HANDLER( k056832_rom_long_r );
1009DECLARE_WRITE32_DEVICE_HANDLER( k056832_ram_long_w );
1010DECLARE_READ32_DEVICE_HANDLER( k056832_unpaged_ram_long_r );
1011DECLARE_WRITE32_DEVICE_HANDLER( k056832_unpaged_ram_long_w );
1012DECLARE_WRITE32_DEVICE_HANDLER( k056832_long_w );
1013DECLARE_WRITE32_DEVICE_HANDLER( k056832_b_long_w );
10141014
10151015/* bit depths for the 56832 */
10161016#define K056832_BPP_4   0
r17961r17962
10231023
10241024/**  Konami 055555  **/
10251025void k055555_write_reg(device_t *device, UINT8 regnum, UINT8 regdat);
1026WRITE16_DEVICE_HANDLER( k055555_word_w );
1027WRITE32_DEVICE_HANDLER( k055555_long_w );
1026DECLARE_WRITE16_DEVICE_HANDLER( k055555_word_w );
1027DECLARE_WRITE32_DEVICE_HANDLER( k055555_long_w );
10281028int k055555_read_register(device_t *device, int regnum);
10291029int k055555_get_palette_index(device_t *device, int idx);
10301030
r17961r17962
10981098/**  Konami 054338  **/
10991099/* mixer/alpha blender */
11001100
1101WRITE16_DEVICE_HANDLER( k054338_word_w ); // "CLCT" registers
1102WRITE32_DEVICE_HANDLER( k054338_long_w );
1101DECLARE_WRITE16_DEVICE_HANDLER( k054338_word_w ); // "CLCT" registers
1102DECLARE_WRITE32_DEVICE_HANDLER( k054338_long_w );
11031103int k054338_register_r(device_t *device, int reg);
11041104void k054338_update_all_shadows(device_t *device, int rushingheroes_hack);         // called at the beginning of SCREEN_UPDATE()
11051105void k054338_fill_solid_bg(device_t *device, bitmap_ind16 &bitmap);            // solid backcolor fill
r17961r17962
11261126/**  Konami 001006  **/
11271127UINT32 k001006_get_palette(device_t *device, int index);
11281128
1129READ32_DEVICE_HANDLER( k001006_r );
1130WRITE32_DEVICE_HANDLER( k001006_w );
1129DECLARE_READ32_DEVICE_HANDLER( k001006_r );
1130DECLARE_WRITE32_DEVICE_HANDLER( k001006_w );
11311131
11321132
11331133/**  Konami 001005  **/
r17961r17962
11351135void k001005_swap_buffers(device_t *device);
11361136void k001005_preprocess_texture_data(UINT8 *rom, int length, int gticlub);
11371137
1138READ32_DEVICE_HANDLER( k001005_r );
1139WRITE32_DEVICE_HANDLER( k001005_w );
1138DECLARE_READ32_DEVICE_HANDLER( k001005_r );
1139DECLARE_WRITE32_DEVICE_HANDLER( k001005_w );
11401140
11411141
11421142/**  Konami 001604  **/
11431143void k001604_draw_back_layer( device_t *device, bitmap_rgb32 &bitmap, const rectangle &cliprect );
11441144void k001604_draw_front_layer( device_t *device, bitmap_rgb32 &bitmap, const rectangle &cliprect );
1145WRITE32_DEVICE_HANDLER( k001604_tile_w );
1146READ32_DEVICE_HANDLER( k001604_tile_r );
1147WRITE32_DEVICE_HANDLER( k001604_char_w );
1148READ32_DEVICE_HANDLER( k001604_char_r );
1149WRITE32_DEVICE_HANDLER( k001604_reg_w );
1150READ32_DEVICE_HANDLER( k001604_reg_r );
1145DECLARE_WRITE32_DEVICE_HANDLER( k001604_tile_w );
1146DECLARE_READ32_DEVICE_HANDLER( k001604_tile_r );
1147DECLARE_WRITE32_DEVICE_HANDLER( k001604_char_w );
1148DECLARE_READ32_DEVICE_HANDLER( k001604_char_r );
1149DECLARE_WRITE32_DEVICE_HANDLER( k001604_reg_w );
1150DECLARE_READ32_DEVICE_HANDLER( k001604_reg_r );
11511151
11521152
11531153/**  Konami 037122  **/
11541154void k037122_tile_draw( device_t *device, bitmap_rgb32 &bitmap, const rectangle &cliprect );
1155READ32_DEVICE_HANDLER( k037122_sram_r );
1156WRITE32_DEVICE_HANDLER( k037122_sram_w );
1157READ32_DEVICE_HANDLER( k037122_char_r );
1158WRITE32_DEVICE_HANDLER( k037122_char_w );
1159READ32_DEVICE_HANDLER( k037122_reg_r );
1160WRITE32_DEVICE_HANDLER( k037122_reg_w );
1155DECLARE_READ32_DEVICE_HANDLER( k037122_sram_r );
1156DECLARE_WRITE32_DEVICE_HANDLER( k037122_sram_w );
1157DECLARE_READ32_DEVICE_HANDLER( k037122_char_r );
1158DECLARE_WRITE32_DEVICE_HANDLER( k037122_char_w );
1159DECLARE_READ32_DEVICE_HANDLER( k037122_reg_r );
1160DECLARE_WRITE32_DEVICE_HANDLER( k037122_reg_w );
11611161
11621162#define K056832_DRAW_FLAG_MIRROR      0x00800000
11631163
11641164// debug handlers
1165READ16_DEVICE_HANDLER( k056832_word_r );        // VACSET
1166READ16_DEVICE_HANDLER( k056832_b_word_r );      // VSCCS  (board dependent)
1167READ16_DEVICE_HANDLER( k053246_reg_word_r );    // OBJSET1
1168READ16_DEVICE_HANDLER( k053247_reg_word_r );    // OBJSET2
1169READ16_DEVICE_HANDLER( k053251_lsb_r );         // PCU1
1170READ16_DEVICE_HANDLER( k053251_msb_r );         // PCU1
1171READ16_DEVICE_HANDLER( k055555_word_r );        // PCU2
1172READ16_DEVICE_HANDLER( k054338_word_r );        // CLTC
1165DECLARE_READ16_DEVICE_HANDLER( k056832_word_r );        // VACSET
1166DECLARE_READ16_DEVICE_HANDLER( k056832_b_word_r );      // VSCCS  (board dependent)
1167DECLARE_READ16_DEVICE_HANDLER( k053246_reg_word_r );    // OBJSET1
1168DECLARE_READ16_DEVICE_HANDLER( k053247_reg_word_r );    // OBJSET2
1169DECLARE_READ16_DEVICE_HANDLER( k053251_lsb_r );         // PCU1
1170DECLARE_READ16_DEVICE_HANDLER( k053251_msb_r );         // PCU1
1171DECLARE_READ16_DEVICE_HANDLER( k055555_word_r );        // PCU2
1172DECLARE_READ16_DEVICE_HANDLER( k054338_word_r );        // CLTC
11731173
1174READ32_DEVICE_HANDLER( k056832_long_r );        // VACSET
1175READ32_DEVICE_HANDLER( k053247_reg_long_r );    // OBJSET2
1176READ32_DEVICE_HANDLER( k055555_long_r );        // PCU2
1174DECLARE_READ32_DEVICE_HANDLER( k056832_long_r );        // VACSET
1175DECLARE_READ32_DEVICE_HANDLER( k053247_reg_long_r );    // OBJSET2
1176DECLARE_READ32_DEVICE_HANDLER( k055555_long_r );        // PCU2
11771177
1178READ16_DEVICE_HANDLER( k053244_reg_word_r );    // OBJSET0
1178DECLARE_READ16_DEVICE_HANDLER( k053244_reg_word_r );    // OBJSET0
11791179
11801180#endif
trunk/src/mame/video/vectrex.c
r17961r17962
4242
4343*********************************************************************/
4444
45static WRITE8_DEVICE_HANDLER (v_via_pa_w);
46static WRITE8_DEVICE_HANDLER(v_via_pb_w);
47static WRITE8_DEVICE_HANDLER (v_via_ca2_w);
48static WRITE8_DEVICE_HANDLER (v_via_cb2_w);
45static DECLARE_WRITE8_DEVICE_HANDLER (v_via_pa_w);
46static DECLARE_WRITE8_DEVICE_HANDLER(v_via_pb_w);
47static DECLARE_WRITE8_DEVICE_HANDLER (v_via_ca2_w);
48static DECLARE_WRITE8_DEVICE_HANDLER (v_via_cb2_w);
4949
5050
5151/*********************************************************************
r17961r17962
399399      device_t *ay8912 = device->machine().device("ay8912");
400400
401401      if (data & 0x08) /* BC1 (do we select a reg or write it ?) */
402         ay8910_address_w(ay8912, 0, state->m_via_out[PORTA]);
402         ay8910_address_w(ay8912, space, 0, state->m_via_out[PORTA]);
403403      else
404         ay8910_data_w(ay8912, 0, state->m_via_out[PORTA]);
404         ay8910_data_w(ay8912, space, 0, state->m_via_out[PORTA]);
405405   }
406406
407407   if (!(data & 0x1) && (state->m_via_out[PORTB] & 0x1))
trunk/src/mame/video/combatsc.c
r17961r17962
115115
116116TILE_GET_INFO_MEMBER(combatsc_state::get_tile_info0)
117117{
118   UINT8 ctrl_6 = k007121_ctrlram_r(m_k007121_1, 6);
118   UINT8 ctrl_6 = k007121_ctrlram_r(m_k007121_1, generic_space(), 6);
119119   UINT8 attributes = m_page[0][tile_index];
120120   int bank = 4 * ((m_vreg & 0x0f) - 1);
121121   int number, color;
r17961r17962
149149
150150TILE_GET_INFO_MEMBER(combatsc_state::get_tile_info1)
151151{
152   UINT8 ctrl_6 = k007121_ctrlram_r(m_k007121_2, 6);
152   UINT8 ctrl_6 = k007121_ctrlram_r(m_k007121_2, generic_space(), 6);
153153   UINT8 attributes = m_page[1][tile_index];
154154   int bank = 4 * ((m_vreg >> 4) - 1);
155155   int number, color;
r17961r17962
350350WRITE8_MEMBER(combatsc_state::combatsc_pf_control_w)
351351{
352352   device_t *k007121 = m_video_circuit ? m_k007121_2 : m_k007121_1;
353   k007121_ctrl_w(k007121, offset, data);
353   k007121_ctrl_w(k007121, space, offset, data);
354354
355355   if (offset == 7)
356356      m_bg_tilemap[m_video_circuit]->set_flip((data & 0x08) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
r17961r17962
386386{
387387   combatsc_state *state = machine.driver_data<combatsc_state>();
388388   device_t *k007121 = circuit ? state->m_k007121_2 : state->m_k007121_1;
389   int base_color = (circuit * 4) * 16 + (k007121_ctrlram_r(k007121, 6) & 0x10) * 2;
389   address_space &space = machine.driver_data()->generic_space();
390   int base_color = (circuit * 4) * 16 + (k007121_ctrlram_r(k007121, space, 6) & 0x10) * 2;
390391
391392   k007121_sprites_draw(k007121, bitmap, cliprect, machine.gfx[circuit], machine.colortable, source, base_color, 0, 0, pri_mask);
392393}
r17961r17962
399400
400401   set_pens(screen.machine());
401402
402   if (k007121_ctrlram_r(state->m_k007121_1, 1) & 0x02)
403   address_space &space = screen.machine().driver_data()->generic_space();
404   if (k007121_ctrlram_r(state->m_k007121_1, space, 1) & 0x02)
403405   {
404406      state->m_bg_tilemap[0]->set_scroll_rows(32);
405407      for (i = 0; i < 32; i++)
r17961r17962
408410   else
409411   {
410412      state->m_bg_tilemap[0]->set_scroll_rows(1);
411      state->m_bg_tilemap[0]->set_scrollx(0, k007121_ctrlram_r(state->m_k007121_1, 0) | ((k007121_ctrlram_r(state->m_k007121_1, 1) & 0x01) << 8));
413      state->m_bg_tilemap[0]->set_scrollx(0, k007121_ctrlram_r(state->m_k007121_1, space, 0) | ((k007121_ctrlram_r(state->m_k007121_1, space, 1) & 0x01) << 8));
412414   }
413415
414   if (k007121_ctrlram_r(state->m_k007121_2, 1) & 0x02)
416   if (k007121_ctrlram_r(state->m_k007121_2, space, 1) & 0x02)
415417   {
416418      state->m_bg_tilemap[1]->set_scroll_rows(32);
417419      for (i = 0; i < 32; i++)
r17961r17962
420422   else
421423   {
422424      state->m_bg_tilemap[1]->set_scroll_rows(1);
423      state->m_bg_tilemap[1]->set_scrollx(0, k007121_ctrlram_r(state->m_k007121_2, 0) | ((k007121_ctrlram_r(state->m_k007121_2, 1) & 0x01) << 8));
425      state->m_bg_tilemap[1]->set_scrollx(0, k007121_ctrlram_r(state->m_k007121_2, space, 0) | ((k007121_ctrlram_r(state->m_k007121_2, space, 1) & 0x01) << 8));
424426   }
425427
426   state->m_bg_tilemap[0]->set_scrolly(0, k007121_ctrlram_r(state->m_k007121_1, 2));
427   state->m_bg_tilemap[1]->set_scrolly(0, k007121_ctrlram_r(state->m_k007121_2, 2));
428   state->m_bg_tilemap[0]->set_scrolly(0, k007121_ctrlram_r(state->m_k007121_1, space, 2));
429   state->m_bg_tilemap[1]->set_scrolly(0, k007121_ctrlram_r(state->m_k007121_2, space, 2));
428430
429431   screen.machine().priority_bitmap.fill(0, cliprect);
430432
r17961r17962
451453      draw_sprites(screen.machine(), bitmap, cliprect, state->m_spriteram[0], 0, 0x4444);
452454   }
453455
454   if (k007121_ctrlram_r(state->m_k007121_1, 1) & 0x08)
456   if (k007121_ctrlram_r(state->m_k007121_1, space, 1) & 0x08)
455457   {
456458      for (i = 0; i < 32; i++)
457459      {
r17961r17962
461463   }
462464
463465   /* chop the extreme columns if necessary */
464   if (k007121_ctrlram_r(state->m_k007121_1, 3) & 0x40)
466   if (k007121_ctrlram_r(state->m_k007121_1, space, 3) & 0x40)
465467   {
466468      rectangle clip;
467469
trunk/src/mame/video/taito_f2.c
r17961r17962
10391039SCREEN_UPDATE_IND16( taitof2_pri )
10401040{
10411041   taitof2_state *state = screen.machine().driver_data<taitof2_state>();
1042   address_space &space = screen.machine().driver_data()->generic_space();
10421043   int layer[3];
10431044
10441045   taitof2_handle_sprite_buffering(screen.machine());
r17961r17962
10481049   layer[0] = tc0100scn_bottomlayer(state->m_tc0100scn);
10491050   layer[1] = layer[0] ^ 1;
10501051   layer[2] = 2;
1051   state->m_tilepri[layer[0]] = tc0360pri_r(state->m_tc0360pri, 5) & 0x0f;
1052   state->m_tilepri[layer[1]] = tc0360pri_r(state->m_tc0360pri, 5) >> 4;
1053   state->m_tilepri[layer[2]] = tc0360pri_r(state->m_tc0360pri, 4) >> 4;
1052   state->m_tilepri[layer[0]] = tc0360pri_r(state->m_tc0360pri, space, 5) & 0x0f;
1053   state->m_tilepri[layer[1]] = tc0360pri_r(state->m_tc0360pri, space, 5) >> 4;
1054   state->m_tilepri[layer[2]] = tc0360pri_r(state->m_tc0360pri, space, 4) >> 4;
10541055
1055   state->m_spritepri[0] = tc0360pri_r(state->m_tc0360pri, 6) & 0x0f;
1056   state->m_spritepri[1] = tc0360pri_r(state->m_tc0360pri, 6) >> 4;
1057   state->m_spritepri[2] = tc0360pri_r(state->m_tc0360pri, 7) & 0x0f;
1058   state->m_spritepri[3] = tc0360pri_r(state->m_tc0360pri, 7) >> 4;
1056   state->m_spritepri[0] = tc0360pri_r(state->m_tc0360pri, space, 6) & 0x0f;
1057   state->m_spritepri[1] = tc0360pri_r(state->m_tc0360pri, space, 6) >> 4;
1058   state->m_spritepri[2] = tc0360pri_r(state->m_tc0360pri, space, 7) & 0x0f;
1059   state->m_spritepri[3] = tc0360pri_r(state->m_tc0360pri, space, 7) >> 4;
10591060
1060   state->m_spriteblendmode = tc0360pri_r(state->m_tc0360pri, 0) & 0xc0;
1061   state->m_spriteblendmode = tc0360pri_r(state->m_tc0360pri, space, 0) & 0xc0;
10611062
10621063   screen.machine().priority_bitmap.fill(0, cliprect);
10631064   bitmap.fill(0, cliprect);   /* wrong color? */
r17961r17962
10861087SCREEN_UPDATE_IND16( taitof2_pri_roz )
10871088{
10881089   taitof2_state *state = screen.machine().driver_data<taitof2_state>();
1090   address_space &space = screen.machine().driver_data()->generic_space();
10891091   int tilepri[3];
10901092   int rozpri;
10911093   int layer[3];
10921094   int drawn;
10931095   int i,j;
1094   int roz_base_color = (tc0360pri_r(state->m_tc0360pri, 1) & 0x3f) << 2;
1096   int roz_base_color = (tc0360pri_r(state->m_tc0360pri, space, 1) & 0x3f) << 2;
10951097
10961098   taitof2_handle_sprite_buffering(screen.machine());
10971099
r17961r17962
11031105
11041106   tc0100scn_tilemap_update(state->m_tc0100scn);
11051107
1106   rozpri = (tc0360pri_r(state->m_tc0360pri, 1) & 0xc0) >> 6;
1107   rozpri = (tc0360pri_r(state->m_tc0360pri, 8 + rozpri / 2) >> 4 * (rozpri & 1)) & 0x0f;
1108   rozpri = (tc0360pri_r(state->m_tc0360pri, space, 1) & 0xc0) >> 6;
1109   rozpri = (tc0360pri_r(state->m_tc0360pri, space, 8 + rozpri / 2) >> 4 * (rozpri & 1)) & 0x0f;
11081110
11091111   layer[0] = tc0100scn_bottomlayer(state->m_tc0100scn);
11101112   layer[1] = layer[0] ^ 1;
11111113   layer[2] = 2;
11121114
1113   tilepri[layer[0]] = tc0360pri_r(state->m_tc0360pri, 5) & 0x0f;
1114   tilepri[layer[1]] = tc0360pri_r(state->m_tc0360pri, 5) >> 4;
1115   tilepri[layer[2]] = tc0360pri_r(state->m_tc0360pri, 4) >> 4;
1115   tilepri[layer[0]] = tc0360pri_r(state->m_tc0360pri, space, 5) & 0x0f;
1116   tilepri[layer[1]] = tc0360pri_r(state->m_tc0360pri, space, 5) >> 4;
1117   tilepri[layer[2]] = tc0360pri_r(state->m_tc0360pri, space, 4) >> 4;
11161118
1117   state->m_spritepri[0] = tc0360pri_r(state->m_tc0360pri, 6) & 0x0f;
1118   state->m_spritepri[1] = tc0360pri_r(state->m_tc0360pri, 6) >> 4;
1119   state->m_spritepri[2] = tc0360pri_r(state->m_tc0360pri, 7) & 0x0f;
1120   state->m_spritepri[3] = tc0360pri_r(state->m_tc0360pri, 7) >> 4;
1119   state->m_spritepri[0] = tc0360pri_r(state->m_tc0360pri, space, 6) & 0x0f;
1120   state->m_spritepri[1] = tc0360pri_r(state->m_tc0360pri, space, 6) >> 4;
1121   state->m_spritepri[2] = tc0360pri_r(state->m_tc0360pri, space, 7) & 0x0f;
1122   state->m_spritepri[3] = tc0360pri_r(state->m_tc0360pri, space, 7) >> 4;
11211123
1122   state->m_spriteblendmode = tc0360pri_r(state->m_tc0360pri, 0) & 0xc0;
1124   state->m_spriteblendmode = tc0360pri_r(state->m_tc0360pri, space, 0) & 0xc0;
11231125
11241126   screen.machine().priority_bitmap.fill(0, cliprect);
11251127   bitmap.fill(0, cliprect);   /* wrong color? */
r17961r17962
11551157SCREEN_UPDATE_IND16( taitof2_thundfox )
11561158{
11571159   taitof2_state *state = screen.machine().driver_data<taitof2_state>();
1160   address_space &space = screen.machine().driver_data()->generic_space();
11581161   int tilepri[2][3];
11591162   int spritepri[4];
11601163   int layer[2][3];
r17961r17962
11681171   layer[0][0] = tc0100scn_bottomlayer(state->m_tc0100scn_1);
11691172   layer[0][1] = layer[0][0] ^ 1;
11701173   layer[0][2] = 2;
1171   tilepri[0][layer[0][0]] = tc0360pri_r(state->m_tc0360pri, 5) & 0x0f;
1172   tilepri[0][layer[0][1]] = tc0360pri_r(state->m_tc0360pri, 5) >> 4;
1173   tilepri[0][layer[0][2]] = tc0360pri_r(state->m_tc0360pri, 4) >> 4;
1174   tilepri[0][layer[0][0]] = tc0360pri_r(state->m_tc0360pri, space, 5) & 0x0f;
1175   tilepri[0][layer[0][1]] = tc0360pri_r(state->m_tc0360pri, space, 5) >> 4;
1176   tilepri[0][layer[0][2]] = tc0360pri_r(state->m_tc0360pri, space, 4) >> 4;
11741177
11751178   layer[1][0] = tc0100scn_bottomlayer(state->m_tc0100scn_2);
11761179   layer[1][1] = layer[1][0] ^ 1;
11771180   layer[1][2] = 2;
1178   tilepri[1][layer[1][0]] = tc0360pri_r(state->m_tc0360pri, 9) & 0x0f;
1179   tilepri[1][layer[1][1]] = tc0360pri_r(state->m_tc0360pri, 9) >> 4;
1180   tilepri[1][layer[1][2]] = tc0360pri_r(state->m_tc0360pri, 8) >> 4;
1181   tilepri[1][layer[1][0]] = tc0360pri_r(state->m_tc0360pri, space, 9) & 0x0f;
1182   tilepri[1][layer[1][1]] = tc0360pri_r(state->m_tc0360pri, space, 9) >> 4;
1183   tilepri[1][layer[1][2]] = tc0360pri_r(state->m_tc0360pri, space, 8) >> 4;
11811184
1182   spritepri[0] = tc0360pri_r(state->m_tc0360pri, 6) & 0x0f;
1183   spritepri[1] = tc0360pri_r(state->m_tc0360pri, 6) >> 4;
1184   spritepri[2] = tc0360pri_r(state->m_tc0360pri, 7) & 0x0f;
1185   spritepri[3] = tc0360pri_r(state->m_tc0360pri, 7) >> 4;
1185   spritepri[0] = tc0360pri_r(state->m_tc0360pri, space, 6) & 0x0f;
1186   spritepri[1] = tc0360pri_r(state->m_tc0360pri, space, 6) >> 4;
1187   spritepri[2] = tc0360pri_r(state->m_tc0360pri, space, 7) & 0x0f;
1188   spritepri[3] = tc0360pri_r(state->m_tc0360pri, space, 7) >> 4;
11861189
11871190   screen.machine().priority_bitmap.fill(0, cliprect);
11881191   bitmap.fill(0, cliprect);   /* wrong color? */
r17961r17962
12921295SCREEN_UPDATE_IND16( taitof2_metalb )
12931296{
12941297   taitof2_state *state = screen.machine().driver_data<taitof2_state>();
1298   address_space &space = screen.machine().driver_data()->generic_space();
12951299   UINT8 layer[5], invlayer[4];
12961300   UINT16 priority;
12971301
r17961r17962
13121316   invlayer[layer[2]] = 2;
13131317   invlayer[layer[3]] = 3;
13141318
1315   state->m_tilepri[invlayer[0]] = tc0360pri_r(state->m_tc0360pri, 4) & 0x0f;   /* bg0 */
1316   state->m_tilepri[invlayer[1]] = tc0360pri_r(state->m_tc0360pri, 4) >> 4;   /* bg1 */
1317   state->m_tilepri[invlayer[2]] = tc0360pri_r(state->m_tc0360pri, 5) & 0x0f;   /* bg2 */
1318   state->m_tilepri[invlayer[3]] = tc0360pri_r(state->m_tc0360pri, 5) >> 4;   /* bg3 */
1319   state->m_tilepri[4] = tc0360pri_r(state->m_tc0360pri, 9) & 0x0f;         /* fg (text layer) */
1319   state->m_tilepri[invlayer[0]] = tc0360pri_r(state->m_tc0360pri, space, 4) & 0x0f;   /* bg0 */
1320   state->m_tilepri[invlayer[1]] = tc0360pri_r(state->m_tc0360pri, space, 4) >> 4;   /* bg1 */
1321   state->m_tilepri[invlayer[2]] = tc0360pri_r(state->m_tc0360pri, space, 5) & 0x0f;   /* bg2 */
1322   state->m_tilepri[invlayer[3]] = tc0360pri_r(state->m_tc0360pri, space, 5) >> 4;   /* bg3 */
1323   state->m_tilepri[4] = tc0360pri_r(state->m_tc0360pri, space, 9) & 0x0f;         /* fg (text layer) */
13201324
1321   state->m_spritepri[0] = tc0360pri_r(state->m_tc0360pri, 6) & 0x0f;
1322   state->m_spritepri[1] = tc0360pri_r(state->m_tc0360pri, 6) >> 4;
1323   state->m_spritepri[2] = tc0360pri_r(state->m_tc0360pri, 7) & 0x0f;
1324   state->m_spritepri[3] = tc0360pri_r(state->m_tc0360pri, 7) >> 4;
1325   state->m_spritepri[0] = tc0360pri_r(state->m_tc0360pri, space, 6) & 0x0f;
1326   state->m_spritepri[1] = tc0360pri_r(state->m_tc0360pri, space, 6) >> 4;
1327   state->m_spritepri[2] = tc0360pri_r(state->m_tc0360pri, space, 7) & 0x0f;
1328   state->m_spritepri[3] = tc0360pri_r(state->m_tc0360pri, space, 7) >> 4;
13251329
1326   state->m_spriteblendmode = tc0360pri_r(state->m_tc0360pri, 0) & 0xc0;
1330   state->m_spriteblendmode = tc0360pri_r(state->m_tc0360pri, space, 0) & 0xc0;
13271331
13281332   screen.machine().priority_bitmap.fill(0, cliprect);
13291333   bitmap.fill(0, cliprect);
r17961r17962
13431347SCREEN_UPDATE_IND16( taitof2_deadconx )
13441348{
13451349   taitof2_state *state = screen.machine().driver_data<taitof2_state>();
1350   address_space &space = screen.machine().driver_data()->generic_space();
13461351   UINT8 layer[5];
13471352   UINT8 tilepri[5];
13481353   UINT8 spritepri[4];
r17961r17962
13601365   layer[3] = (priority & 0x000f) >>  0;   /* tells us which is top */
13611366   layer[4] = 4;   /* text layer always over bg layers */
13621367
1363   tilepri[0] = tc0360pri_r(state->m_tc0360pri, 4) >> 4;      /* bg0 */
1364   tilepri[1] = tc0360pri_r(state->m_tc0360pri, 5) & 0x0f;    /* bg1 */
1365   tilepri[2] = tc0360pri_r(state->m_tc0360pri, 5) >> 4;      /* bg2 */
1366   tilepri[3] = tc0360pri_r(state->m_tc0360pri, 4) & 0x0f;    /* bg3 */
1368   tilepri[0] = tc0360pri_r(state->m_tc0360pri, space, 4) >> 4;      /* bg0 */
1369   tilepri[1] = tc0360pri_r(state->m_tc0360pri, space, 5) & 0x0f;    /* bg1 */
1370   tilepri[2] = tc0360pri_r(state->m_tc0360pri, space, 5) >> 4;      /* bg2 */
1371   tilepri[3] = tc0360pri_r(state->m_tc0360pri, space, 4) & 0x0f;    /* bg3 */
13671372
13681373/* we actually assume text layer is on top of everything anyway, but FWIW... */
1369   tilepri[layer[4]] = tc0360pri_r(state->m_tc0360pri, 7) >> 4;    /* fg (text layer) */
1374   tilepri[layer[4]] = tc0360pri_r(state->m_tc0360pri, space, 7) >> 4;    /* fg (text layer) */
13701375
1371   spritepri[0] = tc0360pri_r(state->m_tc0360pri, 6) & 0x0f;
1372   spritepri[1] = tc0360pri_r(state->m_tc0360pri, 6) >> 4;
1373   spritepri[2] = tc0360pri_r(state->m_tc0360pri, 7) & 0x0f;
1374   spritepri[3] = tc0360pri_r(state->m_tc0360pri, 7) >> 4;
1376   spritepri[0] = tc0360pri_r(state->m_tc0360pri, space, 6) & 0x0f;
1377   spritepri[1] = tc0360pri_r(state->m_tc0360pri, space, 6) >> 4;
1378   spritepri[2] = tc0360pri_r(state->m_tc0360pri, space, 7) & 0x0f;
1379   spritepri[3] = tc0360pri_r(state->m_tc0360pri, space, 7) >> 4;
13751380
13761381   screen.machine().priority_bitmap.fill(0, cliprect);
13771382   bitmap.fill(0, cliprect);
trunk/src/mame/video/groundfx.c
r17961r17962
198198SCREEN_UPDATE_IND16( groundfx )
199199{
200200   groundfx_state *state = screen.machine().driver_data<groundfx_state>();
201   address_space &space = screen.machine().driver_data()->generic_space();
201202   device_t *tc0100scn = screen.machine().device("tc0100scn");
202203   device_t *tc0480scp = screen.machine().device("tc0480scp");
203204   UINT8 layer[5];
r17961r17962
241242        it's contents the usual way.
242243
243244    */
244   if (tc0100scn_long_r(tc0100scn, 0x4090 / 4, 0xffffffff) ||
245         tc0480scp_long_r(tc0480scp, 0x20 / 4, 0xffffffff) == 0x240866)  /* Anything in text layer - really stupid hack */
245   if (tc0100scn_long_r(tc0100scn, space, 0x4090 / 4, 0xffffffff) ||
246         tc0480scp_long_r(tc0480scp, space, 0x20 / 4, 0xffffffff) == 0x240866)  /* Anything in text layer - really stupid hack */
246247   {
247248      tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[1], 0, 2);
248249      tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[2], 0, 4);
r17961r17962
250251
251252      //tc0100scn_tilemap_draw(tc0100scn, bitmap, cliprect, 0, pivlayer[2], 0, 0);
252253
253      if (tc0480scp_long_r(tc0480scp, 0x20 / 4, 0xffffffff) != 0x240866) /* Stupid hack for start of race */
254      if (tc0480scp_long_r(tc0480scp, space, 0x20 / 4, 0xffffffff) != 0x240866) /* Stupid hack for start of race */
254255         tc0480scp_tilemap_draw(tc0480scp, bitmap, state->m_hack_cliprect, layer[0], 0, 0);
255256      draw_sprites(screen.machine(), bitmap, cliprect, 1, 44, -574);
256257   }
trunk/src/mame/video/fastlane.c
r17961r17962
4949
5050TILE_GET_INFO_MEMBER(fastlane_state::get_tile_info0)
5151{
52   UINT8 ctrl_3 = k007121_ctrlram_r(m_k007121, 3);
53   UINT8 ctrl_4 = k007121_ctrlram_r(m_k007121, 4);
54   UINT8 ctrl_5 = k007121_ctrlram_r(m_k007121, 5);
52   UINT8 ctrl_3 = k007121_ctrlram_r(m_k007121, generic_space(), 3);
53   UINT8 ctrl_4 = k007121_ctrlram_r(m_k007121, generic_space(), 4);
54   UINT8 ctrl_5 = k007121_ctrlram_r(m_k007121, generic_space(), 5);
5555   int attr = m_videoram1[tile_index];
5656   int code = m_videoram1[tile_index + 0x400];
5757   int bit0 = (ctrl_5 >> 0) & 0x03;
r17961r17962
7777
7878TILE_GET_INFO_MEMBER(fastlane_state::get_tile_info1)
7979{
80   UINT8 ctrl_3 = k007121_ctrlram_r(m_k007121, 3);
81   UINT8 ctrl_4 = k007121_ctrlram_r(m_k007121, 4);
82   UINT8 ctrl_5 = k007121_ctrlram_r(m_k007121, 5);
80   UINT8 ctrl_3 = k007121_ctrlram_r(m_k007121, generic_space(), 3);
81   UINT8 ctrl_4 = k007121_ctrlram_r(m_k007121, generic_space(), 4);
82   UINT8 ctrl_5 = k007121_ctrlram_r(m_k007121, generic_space(), 5);
8383   int attr = m_videoram2[tile_index];
8484   int code = m_videoram2[tile_index + 0x400];
8585   int bit0 = (ctrl_5 >> 0) & 0x03;
r17961r17962
163163   set_pens(screen.machine());
164164
165165   /* set scroll registers */
166   xoffs = k007121_ctrlram_r(state->m_k007121, 0);
166   address_space &space = screen.machine().driver_data()->generic_space();
167   xoffs = k007121_ctrlram_r(state->m_k007121, space, 0);
167168   for (i = 0; i < 32; i++)
168169      state->m_layer0->set_scrollx(i, state->m_k007121_regs[0x20 + i] + xoffs - 40);
169170
170   state->m_layer0->set_scrolly(0, k007121_ctrlram_r(state->m_k007121, 2));
171   state->m_layer0->set_scrolly(0, k007121_ctrlram_r(state->m_k007121, space, 2));
171172
172173   state->m_layer0->draw(bitmap, finalclip0, 0, 0);
173174   k007121_sprites_draw(state->m_k007121, bitmap, cliprect, screen.machine().gfx[0], screen.machine().colortable, state->m_spriteram, 0, 40, 0, (UINT32)-1);
trunk/src/mame/video/pktgaldx.c
r17961r17962
88SCREEN_UPDATE_IND16( pktgaldx )
99{
1010   pktgaldx_state *state = screen.machine().driver_data<pktgaldx_state>();
11   UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, 0, 0xffff);
11   address_space &space = screen.machine().driver_data()->generic_space();
12   UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, space, 0, 0xffff);
1213
1314   state->flip_screen_set(BIT(flip, 7));
1415   deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll);
trunk/src/mame/video/triplhnt.c
r17961r17962
114114
115115   draw_sprites(screen.machine(), bitmap, cliprect);
116116
117   discrete_sound_w(discrete, TRIPLHNT_BEAR_ROAR_DATA, state->m_playfield_ram[0xfa] & 15);
118   discrete_sound_w(discrete, TRIPLHNT_SHOT_DATA, state->m_playfield_ram[0xfc] & 15);
117   address_space &space = screen.machine().driver_data()->generic_space();
118   discrete_sound_w(discrete, space, TRIPLHNT_BEAR_ROAR_DATA, state->m_playfield_ram[0xfa] & 15);
119   discrete_sound_w(discrete, space, TRIPLHNT_SHOT_DATA, state->m_playfield_ram[0xfc] & 15);
119120   return 0;
120121}
trunk/src/mame/video/subs.c
r17961r17962
114114   }
115115
116116   /* Update sound */
117   discrete_sound_w(discrete, SUBS_LAUNCH_DATA, spriteram[5] & 0x0f);   // Launch data
118   discrete_sound_w(discrete, SUBS_CRASH_DATA, spriteram[5] >> 4);      // Crash/explode data
117   address_space &space = screen.machine().driver_data()->generic_space();
118   discrete_sound_w(discrete, space, SUBS_LAUNCH_DATA, spriteram[5] & 0x0f);   // Launch data
119   discrete_sound_w(discrete, space, SUBS_CRASH_DATA, spriteram[5] >> 4);      // Crash/explode data
119120   return 0;
120121}
121122
trunk/src/mame/video/gp9001.c
r17961r17962
594594   {
595595      case 0x04/2:
596596      case 0x06/2:
597         return gp9001_devvideoram16_r(device, offset-0x04/2, mem_mask);
597         return gp9001_devvideoram16_r(device, space, offset-0x04/2, mem_mask);
598598
599599      case 0x0c/2:
600         return gp9001_vdpstatus_r(device, offset-0x0c/2, mem_mask);
600         return gp9001_vdpstatus_r(device, space, offset-0x0c/2, mem_mask);
601601
602602      default:
603603         logerror("gp9001_vdp_r: read from unhandled offset %04x\n",offset*2);
r17961r17962
611611   switch (offset)
612612   {
613613      case 0x00/2:
614         gp9001_devvoffs_w(device, offset-0x00/2, data, mem_mask);
614         gp9001_devvoffs_w(device, space, offset-0x00/2, data, mem_mask);
615615         break;
616616
617617      case 0x04/2:
618618      case 0x06/2:
619         gp9001_devvideoram16_w(device, offset-0x04/2, data, mem_mask);
619         gp9001_devvideoram16_w(device, space, offset-0x04/2, data, mem_mask);
620620         break;
621621
622622      case 0x08/2:
623         gp9001_scroll_reg_select_w(device, offset-0x08/2, data, mem_mask);
623         gp9001_scroll_reg_select_w(device, space, offset-0x08/2, data, mem_mask);
624624         break;
625625
626626      case 0x0c/2:
627         gp9001_scroll_reg_devvdata_w(device, offset-0x0c/2, data, mem_mask);
627         gp9001_scroll_reg_devvdata_w(device, space, offset-0x0c/2, data, mem_mask);
628628         break;
629629
630630      default:
r17961r17962
639639   switch (offset)
640640   {
641641      case 0x00/2:
642         return gp9001_vdpstatus_r(device, offset-0x0c/2, mem_mask);
642         return gp9001_vdpstatus_r(device, space, offset-0x0c/2, mem_mask);
643643
644644      case 0x08/2:
645645      case 0x0a/2:
646         return gp9001_devvideoram16_r(device, offset-0x04/2, mem_mask);
646         return gp9001_devvideoram16_r(device, space, offset-0x04/2, mem_mask);
647647
648648
649649      default:
r17961r17962
658658   switch (offset)
659659   {
660660      case 0x00/2:
661         gp9001_scroll_reg_devvdata_w(device, offset-0x0c/2, data, mem_mask);
661         gp9001_scroll_reg_devvdata_w(device, space, offset-0x0c/2, data, mem_mask);
662662         break;
663663
664664      case 0x04/2:
665         gp9001_scroll_reg_select_w(device, offset-0x08/2, data, mem_mask);
665         gp9001_scroll_reg_select_w(device, space, offset-0x08/2, data, mem_mask);
666666         break;
667667
668668      case 0x08/2:
669669      case 0x0a/2:
670         gp9001_devvideoram16_w(device, offset-0x04/2, data, mem_mask);
670         gp9001_devvideoram16_w(device, space, offset-0x04/2, data, mem_mask);
671671         break;
672672
673673      case 0x0c/2:
674         gp9001_devvoffs_w(device, offset-0x00/2, data, mem_mask);
674         gp9001_devvoffs_w(device, space, offset-0x00/2, data, mem_mask);
675675         break;
676676
677677      default:
trunk/src/mame/video/gp9001.h
r17961r17962
101101
102102
103103// access to VDP
104READ16_DEVICE_HANDLER( gp9001_vdp_r );
105WRITE16_DEVICE_HANDLER( gp9001_vdp_w );
106READ16_DEVICE_HANDLER( gp9001_vdp_alt_r );
107WRITE16_DEVICE_HANDLER( gp9001_vdp_alt_w );
104DECLARE_READ16_DEVICE_HANDLER( gp9001_vdp_r );
105DECLARE_WRITE16_DEVICE_HANDLER( gp9001_vdp_w );
106DECLARE_READ16_DEVICE_HANDLER( gp9001_vdp_alt_r );
107DECLARE_WRITE16_DEVICE_HANDLER( gp9001_vdp_alt_w );
108108// this bootleg has strange access
109READ16_DEVICE_HANDLER ( pipibibi_bootleg_videoram16_r );
110WRITE16_DEVICE_HANDLER( pipibibi_bootleg_videoram16_w  );
111READ16_DEVICE_HANDLER ( pipibibi_bootleg_spriteram16_r );
112WRITE16_DEVICE_HANDLER( pipibibi_bootleg_spriteram16_w );
113WRITE16_DEVICE_HANDLER( pipibibi_bootleg_scroll_w );
109DECLARE_READ16_DEVICE_HANDLER ( pipibibi_bootleg_videoram16_r );
110DECLARE_WRITE16_DEVICE_HANDLER( pipibibi_bootleg_videoram16_w  );
111DECLARE_READ16_DEVICE_HANDLER ( pipibibi_bootleg_spriteram16_r );
112DECLARE_WRITE16_DEVICE_HANDLER( pipibibi_bootleg_spriteram16_w );
113DECLARE_WRITE16_DEVICE_HANDLER( pipibibi_bootleg_scroll_w );
trunk/src/mame/includes/bzone.h
r17961r17962
3131
3232/*----------- defined in audio/bzone.c -----------*/
3333
34WRITE8_DEVICE_HANDLER( bzone_sounds_w );
34DECLARE_WRITE8_DEVICE_HANDLER( bzone_sounds_w );
3535
3636MACHINE_CONFIG_EXTERN( bzone_audio );
3737
3838/*----------- defined in audio/redbaron.c -----------*/
3939
40WRITE8_DEVICE_HANDLER( redbaron_sounds_w );
40DECLARE_WRITE8_DEVICE_HANDLER( redbaron_sounds_w );
4141
4242class redbaron_sound_device : public device_t,
4343                                  public device_sound_interface
trunk/src/mame/includes/orbit.h
r17961r17962
4848
4949/*----------- defined in audio/orbit.c -----------*/
5050
51WRITE8_DEVICE_HANDLER( orbit_note_w );
52WRITE8_DEVICE_HANDLER( orbit_note_amp_w );
53WRITE8_DEVICE_HANDLER( orbit_noise_amp_w );
54WRITE8_DEVICE_HANDLER( orbit_noise_rst_w );
51DECLARE_WRITE8_DEVICE_HANDLER( orbit_note_w );
52DECLARE_WRITE8_DEVICE_HANDLER( orbit_note_amp_w );
53DECLARE_WRITE8_DEVICE_HANDLER( orbit_noise_amp_w );
54DECLARE_WRITE8_DEVICE_HANDLER( orbit_noise_rst_w );
5555
5656DISCRETE_SOUND_EXTERN( orbit );
5757
trunk/src/mame/includes/system1.h
r17961r17962
113113
114114
115115
116WRITE8_DEVICE_HANDLER( system1_videoram_bank_w );
116DECLARE_WRITE8_DEVICE_HANDLER( system1_videoram_bank_w );
117117
118118
119119
trunk/src/mame/includes/megadriv.h
r17961r17962
7373extern WRITE16_HANDLER( megadriv_68k_io_write );
7474
7575/* These handlers are needed by puckpkmn.c for his memory map */
76extern READ8_DEVICE_HANDLER( megadriv_68k_YM2612_read);
77extern WRITE8_DEVICE_HANDLER( megadriv_68k_YM2612_write);
76extern DECLARE_READ8_DEVICE_HANDLER( megadriv_68k_YM2612_read);
77extern DECLARE_WRITE8_DEVICE_HANDLER( megadriv_68k_YM2612_write);
7878
7979/* These are needed to create external input handlers (see e.g. MESS) */
8080/* Regs are also used by Megaplay! */
trunk/src/mame/includes/zaxxon.h
r17961r17962
7373
7474/*----------- defined in audio/zaxxon.c -----------*/
7575
76WRITE8_DEVICE_HANDLER( zaxxon_sound_a_w );
77WRITE8_DEVICE_HANDLER( zaxxon_sound_b_w );
78WRITE8_DEVICE_HANDLER( zaxxon_sound_c_w );
76DECLARE_WRITE8_DEVICE_HANDLER( zaxxon_sound_a_w );
77DECLARE_WRITE8_DEVICE_HANDLER( zaxxon_sound_b_w );
78DECLARE_WRITE8_DEVICE_HANDLER( zaxxon_sound_c_w );
7979
80WRITE8_DEVICE_HANDLER( congo_sound_b_w );
81WRITE8_DEVICE_HANDLER( congo_sound_c_w );
80DECLARE_WRITE8_DEVICE_HANDLER( congo_sound_b_w );
81DECLARE_WRITE8_DEVICE_HANDLER( congo_sound_c_w );
8282
8383MACHINE_CONFIG_EXTERN( zaxxon_samples );
8484MACHINE_CONFIG_EXTERN( congo_samples );
trunk/src/mame/includes/bsktball.h
r17961r17962
6666
6767/*----------- defined in audio/bsktball.c -----------*/
6868
69WRITE8_DEVICE_HANDLER( bsktball_bounce_w );
70WRITE8_DEVICE_HANDLER( bsktball_note_w );
71WRITE8_DEVICE_HANDLER( bsktball_noise_reset_w );
69DECLARE_WRITE8_DEVICE_HANDLER( bsktball_bounce_w );
70DECLARE_WRITE8_DEVICE_HANDLER( bsktball_note_w );
71DECLARE_WRITE8_DEVICE_HANDLER( bsktball_noise_reset_w );
7272
7373DISCRETE_SOUND_EXTERN( bsktball );
7474
trunk/src/mame/includes/skyraid.h
r17961r17962
3232
3333DISCRETE_SOUND_EXTERN( skyraid );
3434
35WRITE8_DEVICE_HANDLER( skyraid_sound_w );
35DECLARE_WRITE8_DEVICE_HANDLER( skyraid_sound_w );
3636
3737
3838/*----------- defined in video/skyraid.c -----------*/
trunk/src/mame/includes/beezer.h
r17961r17962
5353extern const device_type BEEZER;
5454
5555
56READ8_DEVICE_HANDLER( beezer_sh6840_r );
57WRITE8_DEVICE_HANDLER( beezer_sh6840_w );
58WRITE8_DEVICE_HANDLER( beezer_sfxctrl_w );
59WRITE8_DEVICE_HANDLER( beezer_timer1_w );
60READ8_DEVICE_HANDLER( beezer_noise_r );
56DECLARE_READ8_DEVICE_HANDLER( beezer_sh6840_r );
57DECLARE_WRITE8_DEVICE_HANDLER( beezer_sh6840_w );
58DECLARE_WRITE8_DEVICE_HANDLER( beezer_sfxctrl_w );
59DECLARE_WRITE8_DEVICE_HANDLER( beezer_timer1_w );
60DECLARE_READ8_DEVICE_HANDLER( beezer_noise_r );
6161
6262/*----------- defined in video/beezer.c -----------*/
6363
trunk/src/mame/includes/simpsons.h
r17961r17962
4343
4444/*----------- defined in machine/simpsons.c -----------*/
4545
46READ8_DEVICE_HANDLER( simpsons_sound_r );
46DECLARE_READ8_DEVICE_HANDLER( simpsons_sound_r );
4747
4848
4949
trunk/src/mame/includes/polepos.h
r17961r17962
109109extern const device_type POLEPOS;
110110
111111
112WRITE8_DEVICE_HANDLER( polepos_engine_sound_lsb_w );
113WRITE8_DEVICE_HANDLER( polepos_engine_sound_msb_w );
112DECLARE_WRITE8_DEVICE_HANDLER( polepos_engine_sound_lsb_w );
113DECLARE_WRITE8_DEVICE_HANDLER( polepos_engine_sound_msb_w );
114114
115115DISCRETE_SOUND_EXTERN( polepos );
116116
trunk/src/mame/includes/mw8080bw.h
r17961r17962
199199
200200/*----------- defined in audio/mw8080bw.c -----------*/
201201
202WRITE8_DEVICE_HANDLER( midway_tone_generator_lo_w );
203WRITE8_DEVICE_HANDLER( midway_tone_generator_hi_w );
202DECLARE_WRITE8_DEVICE_HANDLER( midway_tone_generator_lo_w );
203DECLARE_WRITE8_DEVICE_HANDLER( midway_tone_generator_hi_w );
204204
205205MACHINE_CONFIG_EXTERN( seawolf_audio );
206206
207207MACHINE_CONFIG_EXTERN( gunfight_audio );
208208
209209MACHINE_CONFIG_EXTERN( tornbase_audio );
210WRITE8_DEVICE_HANDLER( tornbase_audio_w );
210DECLARE_WRITE8_DEVICE_HANDLER( tornbase_audio_w );
211211
212212MACHINE_CONFIG_EXTERN( zzzap_audio );
213213
r17961r17962
215215void maze_write_discrete(device_t *device, UINT8 maze_tone_timing_state);
216216
217217MACHINE_CONFIG_EXTERN( boothill_audio );
218WRITE8_DEVICE_HANDLER( boothill_audio_w );
218DECLARE_WRITE8_DEVICE_HANDLER( boothill_audio_w );
219219
220220MACHINE_CONFIG_EXTERN( checkmat_audio );
221WRITE8_DEVICE_HANDLER( checkmat_audio_w );
221DECLARE_WRITE8_DEVICE_HANDLER( checkmat_audio_w );
222222
223223MACHINE_CONFIG_EXTERN( desertgu_audio );
224WRITE8_DEVICE_HANDLER( desertgu_audio_1_w );
225WRITE8_DEVICE_HANDLER( desertgu_audio_2_w );
224DECLARE_WRITE8_DEVICE_HANDLER( desertgu_audio_1_w );
225DECLARE_WRITE8_DEVICE_HANDLER( desertgu_audio_2_w );
226226
227227MACHINE_CONFIG_EXTERN( dplay_audio );
228WRITE8_DEVICE_HANDLER( dplay_audio_w );
228DECLARE_WRITE8_DEVICE_HANDLER( dplay_audio_w );
229229
230230MACHINE_CONFIG_EXTERN( gmissile_audio );
231231
232232MACHINE_CONFIG_EXTERN( m4_audio );
233233
234234MACHINE_CONFIG_EXTERN( clowns_audio );
235WRITE8_DEVICE_HANDLER( clowns_audio_2_w );
235DECLARE_WRITE8_DEVICE_HANDLER( clowns_audio_2_w );
236236
237237MACHINE_CONFIG_EXTERN( spacwalk_audio );
238WRITE8_DEVICE_HANDLER( spacwalk_audio_1_w );
239WRITE8_DEVICE_HANDLER( spacwalk_audio_2_w );
238DECLARE_WRITE8_DEVICE_HANDLER( spacwalk_audio_1_w );
239DECLARE_WRITE8_DEVICE_HANDLER( spacwalk_audio_2_w );
240240
241241MACHINE_CONFIG_EXTERN( shuffle_audio );
242WRITE8_DEVICE_HANDLER( shuffle_audio_1_w );
243WRITE8_DEVICE_HANDLER( shuffle_audio_2_w );
242DECLARE_WRITE8_DEVICE_HANDLER( shuffle_audio_1_w );
243DECLARE_WRITE8_DEVICE_HANDLER( shuffle_audio_2_w );
244244
245245MACHINE_CONFIG_EXTERN( dogpatch_audio );
246WRITE8_DEVICE_HANDLER( dogpatch_audio_w );
246DECLARE_WRITE8_DEVICE_HANDLER( dogpatch_audio_w );
247247
248248MACHINE_CONFIG_EXTERN( spcenctr_audio );
249WRITE8_DEVICE_HANDLER( spcenctr_audio_1_w );
250WRITE8_DEVICE_HANDLER( spcenctr_audio_2_w );
251WRITE8_DEVICE_HANDLER( spcenctr_audio_3_w );
249DECLARE_WRITE8_DEVICE_HANDLER( spcenctr_audio_1_w );
250DECLARE_WRITE8_DEVICE_HANDLER( spcenctr_audio_2_w );
251DECLARE_WRITE8_DEVICE_HANDLER( spcenctr_audio_3_w );
252252
253253MACHINE_CONFIG_EXTERN( phantom2_audio );
254254
255255MACHINE_CONFIG_EXTERN( bowler_audio );
256WRITE8_DEVICE_HANDLER( bowler_audio_1_w );
256DECLARE_WRITE8_DEVICE_HANDLER( bowler_audio_1_w );
257257
258258MACHINE_CONFIG_EXTERN( invaders_samples_audio );
259259MACHINE_CONFIG_EXTERN( invaders_audio );
260WRITE8_DEVICE_HANDLER( invaders_audio_1_w );
261WRITE8_DEVICE_HANDLER( invaders_audio_2_w );
260DECLARE_WRITE8_DEVICE_HANDLER( invaders_audio_1_w );
261DECLARE_WRITE8_DEVICE_HANDLER( invaders_audio_2_w );
262262
263263MACHINE_CONFIG_EXTERN( blueshrk_audio );
264WRITE8_DEVICE_HANDLER( blueshrk_audio_w );
264DECLARE_WRITE8_DEVICE_HANDLER( blueshrk_audio_w );
265265
266266MACHINE_CONFIG_EXTERN( invad2ct_audio );
267WRITE8_DEVICE_HANDLER( invad2ct_audio_1_w );
268WRITE8_DEVICE_HANDLER( invad2ct_audio_2_w );
269WRITE8_DEVICE_HANDLER( invad2ct_audio_3_w );
270WRITE8_DEVICE_HANDLER( invad2ct_audio_4_w );
267DECLARE_WRITE8_DEVICE_HANDLER( invad2ct_audio_1_w );
268DECLARE_WRITE8_DEVICE_HANDLER( invad2ct_audio_2_w );
269DECLARE_WRITE8_DEVICE_HANDLER( invad2ct_audio_3_w );
270DECLARE_WRITE8_DEVICE_HANDLER( invad2ct_audio_4_w );
271271
272272/*----------- defined in video/mw8080bw.c -----------*/
273273
trunk/src/mame/includes/suna8.h
r17961r17962
108108
109109/*----------- defined in audio/suna8.c -----------*/
110110
111WRITE8_DEVICE_HANDLER( suna8_play_samples_w );
112WRITE8_DEVICE_HANDLER( rranger_play_samples_w );
113WRITE8_DEVICE_HANDLER( suna8_samples_number_w );
111DECLARE_WRITE8_DEVICE_HANDLER( suna8_play_samples_w );
112DECLARE_WRITE8_DEVICE_HANDLER( rranger_play_samples_w );
113DECLARE_WRITE8_DEVICE_HANDLER( suna8_samples_number_w );
114114SAMPLES_START( suna8_sh_start );
115115
116116
trunk/src/mame/includes/avalnche.h
r17961r17962
3030/*----------- defined in audio/avalnche.c -----------*/
3131
3232DISCRETE_SOUND_EXTERN( avalnche );
33WRITE8_DEVICE_HANDLER( avalnche_noise_amplitude_w );
34WRITE8_DEVICE_HANDLER( avalnche_attract_enable_w );
35WRITE8_DEVICE_HANDLER( avalnche_audio_w );
33DECLARE_WRITE8_DEVICE_HANDLER( avalnche_noise_amplitude_w );
34DECLARE_WRITE8_DEVICE_HANDLER( avalnche_attract_enable_w );
35DECLARE_WRITE8_DEVICE_HANDLER( avalnche_audio_w );
3636
3737WRITE8_HANDLER( catch_audio_w );
trunk/src/mame/includes/leland.h
r17961r17962
177177void leland_init_eeprom(running_machine &machine, UINT8 default_val, const UINT16 *data, UINT8 serial_offset, UINT8 serial_type);
178178void ataxx_init_eeprom(running_machine &machine, const UINT16 *data);
179179
180READ8_DEVICE_HANDLER( ataxx_eeprom_r );
181WRITE8_DEVICE_HANDLER( ataxx_eeprom_w );
180DECLARE_READ8_DEVICE_HANDLER( ataxx_eeprom_r );
181DECLARE_WRITE8_DEVICE_HANDLER( ataxx_eeprom_w );
182182
183183
184184
185185
186186
187READ8_DEVICE_HANDLER( leland_sound_port_r );
188WRITE8_DEVICE_HANDLER( leland_sound_port_w );
187DECLARE_READ8_DEVICE_HANDLER( leland_sound_port_r );
188DECLARE_WRITE8_DEVICE_HANDLER( leland_sound_port_w );
189189
190190
191191
r17961r17962
257257
258258void leland_dac_update(device_t *device, int dacnum, UINT8 sample);
259259
260READ8_DEVICE_HANDLER( leland_80186_response_r );
260DECLARE_READ8_DEVICE_HANDLER( leland_80186_response_r );
261261
262WRITE8_DEVICE_HANDLER( leland_80186_control_w );
263WRITE8_DEVICE_HANDLER( leland_80186_command_lo_w );
264WRITE8_DEVICE_HANDLER( leland_80186_command_hi_w );
265WRITE8_DEVICE_HANDLER( ataxx_80186_control_w );
262DECLARE_WRITE8_DEVICE_HANDLER( leland_80186_control_w );
263DECLARE_WRITE8_DEVICE_HANDLER( leland_80186_command_lo_w );
264DECLARE_WRITE8_DEVICE_HANDLER( leland_80186_command_hi_w );
265DECLARE_WRITE8_DEVICE_HANDLER( ataxx_80186_control_w );
266266
267267ADDRESS_MAP_EXTERN(leland_80186_map_program, 16);
268268ADDRESS_MAP_EXTERN(leland_80186_map_io, 16);
r17961r17962
272272
273273/*----------- defined in video/leland.c -----------*/
274274
275WRITE8_DEVICE_HANDLER( leland_gfx_port_w );
275DECLARE_WRITE8_DEVICE_HANDLER( leland_gfx_port_w );
276276
277277
278278
trunk/src/mame/includes/blockade.h
r17961r17962
4040extern const samples_interface blockade_samples_interface;
4141DISCRETE_SOUND_EXTERN( blockade );
4242
43WRITE8_DEVICE_HANDLER( blockade_sound_freq_w );
43DECLARE_WRITE8_DEVICE_HANDLER( blockade_sound_freq_w );
trunk/src/mame/includes/tiamc1.h
r17961r17962
6262extern const device_type TIAMC1;
6363
6464
65WRITE8_DEVICE_HANDLER( tiamc1_timer0_w );
66WRITE8_DEVICE_HANDLER( tiamc1_timer1_w );
67WRITE8_DEVICE_HANDLER( tiamc1_timer1_gate_w );
65DECLARE_WRITE8_DEVICE_HANDLER( tiamc1_timer0_w );
66DECLARE_WRITE8_DEVICE_HANDLER( tiamc1_timer1_w );
67DECLARE_WRITE8_DEVICE_HANDLER( tiamc1_timer1_gate_w );
6868
6969
7070/*----------- defined in video/tiamc1.c -----------*/
trunk/src/mame/includes/dc.h
r17961r17962
115115WRITE64_HANDLER( dc_modem_w );
116116READ64_HANDLER( dc_rtc_r );
117117WRITE64_HANDLER( dc_rtc_w );
118READ64_DEVICE_HANDLER( dc_aica_reg_r );
119WRITE64_DEVICE_HANDLER( dc_aica_reg_w );
118DECLARE_READ64_DEVICE_HANDLER( dc_aica_reg_r );
119DECLARE_WRITE64_DEVICE_HANDLER( dc_aica_reg_w );
120120
121READ32_DEVICE_HANDLER( dc_arm_aica_r );
122WRITE32_DEVICE_HANDLER( dc_arm_aica_w );
121DECLARE_READ32_DEVICE_HANDLER( dc_arm_aica_r );
122DECLARE_WRITE32_DEVICE_HANDLER( dc_arm_aica_w );
123123
124124
125125
trunk/src/mame/includes/scramble.h
r17961r17962
7272READ8_HANDLER( hunchbks_mirror_r );
7373WRITE8_HANDLER( hunchbks_mirror_w );
7474
75READ8_DEVICE_HANDLER( scramble_protection_r );
76WRITE8_DEVICE_HANDLER( scramble_protection_w );
75DECLARE_READ8_DEVICE_HANDLER( scramble_protection_r );
76DECLARE_WRITE8_DEVICE_HANDLER( scramble_protection_w );
7777
7878
7979/*----------- defined in audio/scramble.c -----------*/
r17961r17962
8282WRITE_LINE_DEVICE_HANDLER( scramble_sh_7474_q_callback );
8383
8484
85READ8_DEVICE_HANDLER( scramble_portB_r );
86READ8_DEVICE_HANDLER( frogger_portB_r );
85DECLARE_READ8_DEVICE_HANDLER( scramble_portB_r );
86DECLARE_READ8_DEVICE_HANDLER( frogger_portB_r );
8787
88READ8_DEVICE_HANDLER( hotshock_soundlatch_r );
88DECLARE_READ8_DEVICE_HANDLER( hotshock_soundlatch_r );
8989
90WRITE8_DEVICE_HANDLER( scramble_sh_irqtrigger_w );
91WRITE8_DEVICE_HANDLER( mrkougar_sh_irqtrigger_w );
90DECLARE_WRITE8_DEVICE_HANDLER( scramble_sh_irqtrigger_w );
91DECLARE_WRITE8_DEVICE_HANDLER( mrkougar_sh_irqtrigger_w );
9292
9393MACHINE_CONFIG_EXTERN( ad2083_audio );
9494
trunk/src/mame/includes/qix.h
r17961r17962
105105
106106
107107
108WRITE8_DEVICE_HANDLER( qix_pia_w );
108DECLARE_WRITE8_DEVICE_HANDLER( qix_pia_w );
109109
110110WRITE_LINE_DEVICE_HANDLER( qix_vsync_changed );
111111
r17961r17962
116116MACHINE_CONFIG_EXTERN( zookeep_video );
117117MACHINE_CONFIG_EXTERN( slither_video );
118118
119WRITE8_DEVICE_HANDLER( qix_flip_screen_w );
119DECLARE_WRITE8_DEVICE_HANDLER( qix_flip_screen_w );
120120
121121
122122/*----------- defined in audio/qix.c -----------*/
trunk/src/mame/includes/cps3.h
r17961r17962
134134extern const device_type CPS3;
135135
136136
137WRITE32_DEVICE_HANDLER( cps3_sound_w );
138READ32_DEVICE_HANDLER( cps3_sound_r );
137DECLARE_WRITE32_DEVICE_HANDLER( cps3_sound_w );
138DECLARE_READ32_DEVICE_HANDLER( cps3_sound_r );
trunk/src/mame/includes/spiders.h
r17961r17962
3434
3535/*----------- defined in audio/spiders.c -----------*/
3636
37WRITE8_DEVICE_HANDLER( spiders_audio_command_w );
38WRITE8_DEVICE_HANDLER( spiders_audio_a_w );
39WRITE8_DEVICE_HANDLER( spiders_audio_b_w );
40WRITE8_DEVICE_HANDLER( spiders_audio_ctrl_w );
37DECLARE_WRITE8_DEVICE_HANDLER( spiders_audio_command_w );
38DECLARE_WRITE8_DEVICE_HANDLER( spiders_audio_a_w );
39DECLARE_WRITE8_DEVICE_HANDLER( spiders_audio_b_w );
40DECLARE_WRITE8_DEVICE_HANDLER( spiders_audio_ctrl_w );
4141
4242MACHINE_CONFIG_EXTERN( spiders_audio );
trunk/src/mame/includes/crbaloon.h
r17961r17962
4141
4242/*----------- defined in audio/crbaloon.c -----------*/
4343
44WRITE8_DEVICE_HANDLER( crbaloon_audio_set_music_freq );
45WRITE8_DEVICE_HANDLER( crbaloon_audio_set_music_enable );
44DECLARE_WRITE8_DEVICE_HANDLER( crbaloon_audio_set_music_freq );
45DECLARE_WRITE8_DEVICE_HANDLER( crbaloon_audio_set_music_enable );
4646void crbaloon_audio_set_explosion_enable(device_t *sn, int enabled);
4747void crbaloon_audio_set_breath_enable(device_t *sn, int enabled);
4848void crbaloon_audio_set_appear_enable(device_t *sn, int enabled);
49WRITE8_DEVICE_HANDLER( crbaloon_audio_set_laugh_enable );
49DECLARE_WRITE8_DEVICE_HANDLER( crbaloon_audio_set_laugh_enable );
5050
5151MACHINE_CONFIG_EXTERN( crbaloon_audio );
5252
trunk/src/mame/includes/sprint8.h
r17961r17962
5656
5757DISCRETE_SOUND_EXTERN( sprint8 );
5858
59WRITE8_DEVICE_HANDLER( sprint8_crash_w );
60WRITE8_DEVICE_HANDLER( sprint8_screech_w );
61WRITE8_DEVICE_HANDLER( sprint8_attract_w );
62WRITE8_DEVICE_HANDLER( sprint8_motor_w );
59DECLARE_WRITE8_DEVICE_HANDLER( sprint8_crash_w );
60DECLARE_WRITE8_DEVICE_HANDLER( sprint8_screech_w );
61DECLARE_WRITE8_DEVICE_HANDLER( sprint8_attract_w );
62DECLARE_WRITE8_DEVICE_HANDLER( sprint8_motor_w );
trunk/src/mame/includes/hanaawas.h
r17961r17962
3535
3636/*----------- defined in video/hanaawas.c -----------*/
3737
38WRITE8_DEVICE_HANDLER( hanaawas_portB_w );
38DECLARE_WRITE8_DEVICE_HANDLER( hanaawas_portB_w );
3939
4040
4141
trunk/src/mame/includes/warpwarp.h
r17961r17962
6262
6363/*----------- defined in audio/geebee.c -----------*/
6464
65WRITE8_DEVICE_HANDLER( geebee_sound_w );
65DECLARE_WRITE8_DEVICE_HANDLER( geebee_sound_w );
6666
6767class geebee_sound_device : public device_t,
6868                                  public device_sound_interface
r17961r17962
9191
9292/*----------- defined in audio/warpwarp.c -----------*/
9393
94WRITE8_DEVICE_HANDLER( warpwarp_sound_w );
95WRITE8_DEVICE_HANDLER( warpwarp_music1_w );
96WRITE8_DEVICE_HANDLER( warpwarp_music2_w );
94DECLARE_WRITE8_DEVICE_HANDLER( warpwarp_sound_w );
95DECLARE_WRITE8_DEVICE_HANDLER( warpwarp_music1_w );
96DECLARE_WRITE8_DEVICE_HANDLER( warpwarp_music2_w );
9797
9898class warpwarp_sound_device : public device_t,
9999                                  public device_sound_interface
trunk/src/mame/includes/turbo.h
r17961r17962
137137MACHINE_CONFIG_EXTERN( subroc3d_samples );
138138MACHINE_CONFIG_EXTERN( buckrog_samples );
139139
140WRITE8_DEVICE_HANDLER( turbo_sound_a_w );
141WRITE8_DEVICE_HANDLER( turbo_sound_b_w );
142WRITE8_DEVICE_HANDLER( turbo_sound_c_w );
140DECLARE_WRITE8_DEVICE_HANDLER( turbo_sound_a_w );
141DECLARE_WRITE8_DEVICE_HANDLER( turbo_sound_b_w );
142DECLARE_WRITE8_DEVICE_HANDLER( turbo_sound_c_w );
143143
144WRITE8_DEVICE_HANDLER( subroc3d_sound_a_w );
145WRITE8_DEVICE_HANDLER( subroc3d_sound_b_w );
146WRITE8_DEVICE_HANDLER( subroc3d_sound_c_w );
144DECLARE_WRITE8_DEVICE_HANDLER( subroc3d_sound_a_w );
145DECLARE_WRITE8_DEVICE_HANDLER( subroc3d_sound_b_w );
146DECLARE_WRITE8_DEVICE_HANDLER( subroc3d_sound_c_w );
147147
148WRITE8_DEVICE_HANDLER( buckrog_sound_a_w );
149WRITE8_DEVICE_HANDLER( buckrog_sound_b_w );
148DECLARE_WRITE8_DEVICE_HANDLER( buckrog_sound_a_w );
149DECLARE_WRITE8_DEVICE_HANDLER( buckrog_sound_b_w );
150150
151151
152152/*----------- defined in video/turbo.c -----------*/
trunk/src/mame/includes/asteroid.h
r17961r17962
4848DISCRETE_SOUND_EXTERN( asteroid );
4949DISCRETE_SOUND_EXTERN( astdelux );
5050
51WRITE8_DEVICE_HANDLER( asteroid_explode_w );
52WRITE8_DEVICE_HANDLER( asteroid_thump_w );
53WRITE8_DEVICE_HANDLER( asteroid_sounds_w );
54WRITE8_DEVICE_HANDLER( asteroid_noise_reset_w );
55WRITE8_DEVICE_HANDLER( astdelux_sounds_w );
51DECLARE_WRITE8_DEVICE_HANDLER( asteroid_explode_w );
52DECLARE_WRITE8_DEVICE_HANDLER( asteroid_thump_w );
53DECLARE_WRITE8_DEVICE_HANDLER( asteroid_sounds_w );
54DECLARE_WRITE8_DEVICE_HANDLER( asteroid_noise_reset_w );
55DECLARE_WRITE8_DEVICE_HANDLER( astdelux_sounds_w );
5656
5757
5858/*----------- defined in audio/llander.c -----------*/
5959
6060DISCRETE_SOUND_EXTERN( llander );
6161
62WRITE8_DEVICE_HANDLER( llander_snd_reset_w );
63WRITE8_DEVICE_HANDLER( llander_sounds_w );
62DECLARE_WRITE8_DEVICE_HANDLER( llander_snd_reset_w );
63DECLARE_WRITE8_DEVICE_HANDLER( llander_sounds_w );
trunk/src/mame/includes/poolshrk.h
r17961r17962
3636
3737/*----------- defined in audio/poolshrk.c -----------*/
3838
39WRITE8_DEVICE_HANDLER( poolshrk_scratch_sound_w );
40WRITE8_DEVICE_HANDLER( poolshrk_score_sound_w );
41WRITE8_DEVICE_HANDLER( poolshrk_click_sound_w );
42WRITE8_DEVICE_HANDLER( poolshrk_bump_sound_w );
39DECLARE_WRITE8_DEVICE_HANDLER( poolshrk_scratch_sound_w );
40DECLARE_WRITE8_DEVICE_HANDLER( poolshrk_score_sound_w );
41DECLARE_WRITE8_DEVICE_HANDLER( poolshrk_click_sound_w );
42DECLARE_WRITE8_DEVICE_HANDLER( poolshrk_bump_sound_w );
4343
4444DISCRETE_SOUND_EXTERN( poolshrk );
4545
trunk/src/mame/includes/gridlee.h
r17961r17962
6060
6161/*----------- defined in audio/gridlee.c -----------*/
6262
63WRITE8_DEVICE_HANDLER( gridlee_sound_w );
63DECLARE_WRITE8_DEVICE_HANDLER( gridlee_sound_w );
6464
6565class gridlee_sound_device : public device_t,
6666                                  public device_sound_interface
trunk/src/mame/includes/flower.h
r17961r17962
4545
4646/*----------- defined in audio/flower.c -----------*/
4747
48WRITE8_DEVICE_HANDLER( flower_sound1_w );
49WRITE8_DEVICE_HANDLER( flower_sound2_w );
48DECLARE_WRITE8_DEVICE_HANDLER( flower_sound1_w );
49DECLARE_WRITE8_DEVICE_HANDLER( flower_sound2_w );
5050
5151class flower_sound_device : public device_t,
5252                                  public device_sound_interface
trunk/src/mame/includes/8080bw.h
r17961r17962
8383
8484extern const samples_interface lrescue_samples_interface;
8585
86WRITE8_DEVICE_HANDLER( indianbt_sh_port_3_w );
86DECLARE_WRITE8_DEVICE_HANDLER( indianbt_sh_port_3_w );
8787DISCRETE_SOUND_EXTERN( indianbt );
8888
89WRITE8_DEVICE_HANDLER( polaris_sh_port_1_w );
90WRITE8_DEVICE_HANDLER( polaris_sh_port_2_w );
91WRITE8_DEVICE_HANDLER( polaris_sh_port_3_w );
89DECLARE_WRITE8_DEVICE_HANDLER( polaris_sh_port_1_w );
90DECLARE_WRITE8_DEVICE_HANDLER( polaris_sh_port_2_w );
91DECLARE_WRITE8_DEVICE_HANDLER( polaris_sh_port_3_w );
9292DISCRETE_SOUND_EXTERN( polaris );
9393
9494
trunk/src/mame/includes/m79amb.h
r17961r17962
55
66DISCRETE_SOUND_EXTERN( m79amb );
77
8WRITE8_DEVICE_HANDLER( m79amb_8000_w );
9WRITE8_DEVICE_HANDLER( m79amb_8003_w );
8DECLARE_WRITE8_DEVICE_HANDLER( m79amb_8000_w );
9DECLARE_WRITE8_DEVICE_HANDLER( m79amb_8003_w );
trunk/src/mame/includes/canyon.h
r17961r17962
4141
4242/*----------- defined in audio/canyon.c -----------*/
4343
44WRITE8_DEVICE_HANDLER( canyon_motor_w );
45WRITE8_DEVICE_HANDLER( canyon_explode_w );
46WRITE8_DEVICE_HANDLER( canyon_attract_w );
47WRITE8_DEVICE_HANDLER( canyon_whistle_w );
44DECLARE_WRITE8_DEVICE_HANDLER( canyon_motor_w );
45DECLARE_WRITE8_DEVICE_HANDLER( canyon_explode_w );
46DECLARE_WRITE8_DEVICE_HANDLER( canyon_attract_w );
47DECLARE_WRITE8_DEVICE_HANDLER( canyon_whistle_w );
4848
4949DISCRETE_SOUND_EXTERN( canyon );
5050
trunk/src/mame/includes/tx1.h
r17961r17962
178178
179179
180180/*----------- defined in audio/tx1.c -----------*/
181READ8_DEVICE_HANDLER( tx1_pit8253_r );
182WRITE8_DEVICE_HANDLER( tx1_pit8253_w );
181DECLARE_READ8_DEVICE_HANDLER( tx1_pit8253_r );
182DECLARE_WRITE8_DEVICE_HANDLER( tx1_pit8253_w );
183183
184WRITE8_DEVICE_HANDLER( bb_ym1_a_w );
185WRITE8_DEVICE_HANDLER( bb_ym2_a_w );
186WRITE8_DEVICE_HANDLER( bb_ym2_b_w );
184DECLARE_WRITE8_DEVICE_HANDLER( bb_ym1_a_w );
185DECLARE_WRITE8_DEVICE_HANDLER( bb_ym2_a_w );
186DECLARE_WRITE8_DEVICE_HANDLER( bb_ym2_b_w );
187187
188188
189WRITE8_DEVICE_HANDLER( tx1_ay8910_a_w );
190WRITE8_DEVICE_HANDLER( tx1_ay8910_b_w );
189DECLARE_WRITE8_DEVICE_HANDLER( tx1_ay8910_a_w );
190DECLARE_WRITE8_DEVICE_HANDLER( tx1_ay8910_b_w );
191191
192192class tx1_sound_device : public device_t,
193193                         public device_sound_interface
trunk/src/mame/includes/tatsumi.h
r17961r17962
126126/*----------- defined in machine/tatsumi.c -----------*/
127127
128128
129READ8_DEVICE_HANDLER(tatsumi_hack_ym2151_r);
130READ8_DEVICE_HANDLER(tatsumi_hack_oki_r);
129DECLARE_READ8_DEVICE_HANDLER(tatsumi_hack_ym2151_r);
130DECLARE_READ8_DEVICE_HANDLER(tatsumi_hack_oki_r);
131131
132132
133133void tatsumi_reset(running_machine &machine);
trunk/src/mame/includes/harddriv.h
r17961r17962
349349
350350
351351
352WRITE16_DEVICE_HANDLER( hdsnddsp_dac_w );
352DECLARE_WRITE16_DEVICE_HANDLER( hdsnddsp_dac_w );
353353
354354
355355
trunk/src/mame/includes/mario.h
r17961r17962
9393
9494/*----------- defined in audio/mario.c -----------*/
9595
96WRITE8_DEVICE_HANDLER( mario_sh1_w );
97WRITE8_DEVICE_HANDLER( mario_sh2_w );
96DECLARE_WRITE8_DEVICE_HANDLER( mario_sh1_w );
97DECLARE_WRITE8_DEVICE_HANDLER( mario_sh2_w );
9898
9999
100100MACHINE_CONFIG_EXTERN( mario_audio );
trunk/src/mame/includes/cd32.h
r17961r17962
4343
4444/*----------- defined in machine/cd32.c -----------*/
4545
46READ32_DEVICE_HANDLER( amiga_akiko32_r );
47WRITE32_DEVICE_HANDLER( amiga_akiko32_w );
46DECLARE_READ32_DEVICE_HANDLER( amiga_akiko32_r );
47DECLARE_WRITE32_DEVICE_HANDLER( amiga_akiko32_w );
4848
4949class akiko_device : public device_t
5050{
trunk/src/mame/includes/micro3d.h
r17961r17962
134134
135135/*----------- defined in audio/micro3d.c -----------*/
136136
137WRITE8_DEVICE_HANDLER( micro3d_upd7759_w );
137DECLARE_WRITE8_DEVICE_HANDLER( micro3d_upd7759_w );
138138
139139void micro3d_noise_sh_w(running_machine &machine, UINT8 data);
140140
trunk/src/mame/includes/phoenix.h
r17961r17962
5555
5656DISCRETE_SOUND_EXTERN( phoenix );
5757
58WRITE8_DEVICE_HANDLER( phoenix_sound_control_a_w );
59WRITE8_DEVICE_HANDLER( phoenix_sound_control_b_w );
58DECLARE_WRITE8_DEVICE_HANDLER( phoenix_sound_control_a_w );
59DECLARE_WRITE8_DEVICE_HANDLER( phoenix_sound_control_b_w );
6060
6161class phoenix_sound_device : public device_t,
6262                                  public device_sound_interface
r17961r17962
9292SCREEN_UPDATE_IND16( phoenix );
9393
9494
95READ8_DEVICE_HANDLER( survival_protection_r );
95DECLARE_READ8_DEVICE_HANDLER( survival_protection_r );
9696
9797READ_LINE_DEVICE_HANDLER( survival_sid_callback );
9898
trunk/src/mame/includes/atari.h
r17961r17962
2020extern const pia6821_interface atarixl_pia_interface;
2121
2222/* These handlers are needed by MESS Atari 8bit drivers (for their custom pia_interface) */
23READ8_DEVICE_HANDLER(atari_pia_pa_r);
24READ8_DEVICE_HANDLER(atari_pia_pb_r);
25WRITE8_DEVICE_HANDLER(a600xl_pia_pb_w);
23DECLARE_READ8_DEVICE_HANDLER(atari_pia_pa_r);
24DECLARE_READ8_DEVICE_HANDLER(atari_pia_pb_r);
25DECLARE_WRITE8_DEVICE_HANDLER(a600xl_pia_pb_w);
2626WRITE_LINE_DEVICE_HANDLER(atari_pia_cb2_w);
2727
2828
trunk/src/mame/includes/gomoku.h
r17961r17962
3030
3131/*----------- defined in audio/gomoku.c -----------*/
3232
33WRITE8_DEVICE_HANDLER( gomoku_sound1_w );
34WRITE8_DEVICE_HANDLER( gomoku_sound2_w );
33DECLARE_WRITE8_DEVICE_HANDLER( gomoku_sound1_w );
34DECLARE_WRITE8_DEVICE_HANDLER( gomoku_sound2_w );
3535
3636class gomoku_sound_device : public device_t,
3737                                  public device_sound_interface
trunk/src/mame/includes/firetrk.h
r17961r17962
106106
107107/*----------- defined in audio/firetrk.c -----------*/
108108
109WRITE8_DEVICE_HANDLER( firetrk_skid_reset_w );
110WRITE8_DEVICE_HANDLER( montecar_skid_reset_w );
111WRITE8_DEVICE_HANDLER( firetrk_crash_snd_w );
112WRITE8_DEVICE_HANDLER( firetrk_skid_snd_w );
113WRITE8_DEVICE_HANDLER( firetrk_motor_snd_w );
114WRITE8_DEVICE_HANDLER( superbug_motor_snd_w );
115WRITE8_DEVICE_HANDLER( firetrk_xtndply_w );
109DECLARE_WRITE8_DEVICE_HANDLER( firetrk_skid_reset_w );
110DECLARE_WRITE8_DEVICE_HANDLER( montecar_skid_reset_w );
111DECLARE_WRITE8_DEVICE_HANDLER( firetrk_crash_snd_w );
112DECLARE_WRITE8_DEVICE_HANDLER( firetrk_skid_snd_w );
113DECLARE_WRITE8_DEVICE_HANDLER( firetrk_motor_snd_w );
114DECLARE_WRITE8_DEVICE_HANDLER( superbug_motor_snd_w );
115DECLARE_WRITE8_DEVICE_HANDLER( firetrk_xtndply_w );
116116
117117DISCRETE_SOUND_EXTERN( firetrk );
118118DISCRETE_SOUND_EXTERN( superbug );
trunk/src/mame/includes/segas16a.h
r17961r17962
9191   DECLARE_WRITE8_MEMBER( n7751_command_w );
9292   DECLARE_WRITE8_MEMBER( n7751_control_w );
9393   DECLARE_WRITE8_MEMBER( n7751_rom_offset_w );
94   static WRITE8_DEVICE_HANDLER( static_n7751_rom_offset_w );
94   static DECLARE_WRITE8_DEVICE_HANDLER( static_n7751_rom_offset_w );
9595
9696   // N7751 sound generator CPU read/write handlers
9797   DECLARE_READ8_MEMBER( n7751_rom_r );
trunk/src/mame/includes/vectrex.h
r17961r17962
7979
8080TIMER_CALLBACK(vectrex_imager_eye);
8181void vectrex_configuration(running_machine &machine);
82READ8_DEVICE_HANDLER (vectrex_via_pa_r);
83READ8_DEVICE_HANDLER(vectrex_via_pb_r );
82DECLARE_READ8_DEVICE_HANDLER (vectrex_via_pa_r);
83DECLARE_READ8_DEVICE_HANDLER(vectrex_via_pb_r );
8484void vectrex_via_irq (device_t *device, int level);
8585
8686
8787/* for spectrum 1+ */
88READ8_DEVICE_HANDLER( vectrex_s1_via_pb_r );
88DECLARE_READ8_DEVICE_HANDLER( vectrex_s1_via_pb_r );
8989
9090
9191/*----------- defined in video/vectrex.c -----------*/
trunk/src/mame/includes/n64.h
r17961r17962
280280extern void dp_full_sync(running_machine &machine);
281281extern void signal_rcp_interrupt(running_machine &machine, int interrupt);
282282
283extern READ32_DEVICE_HANDLER( n64_sp_reg_r );
284extern WRITE32_DEVICE_HANDLER( n64_sp_reg_w );
285extern READ32_DEVICE_HANDLER( n64_dp_reg_r );
286extern WRITE32_DEVICE_HANDLER( n64_dp_reg_w );
283extern DECLARE_READ32_DEVICE_HANDLER( n64_sp_reg_r );
284extern DECLARE_WRITE32_DEVICE_HANDLER( n64_sp_reg_w );
285extern DECLARE_READ32_DEVICE_HANDLER( n64_dp_reg_r );
286extern DECLARE_WRITE32_DEVICE_HANDLER( n64_dp_reg_w );
287287
288288
289289
trunk/src/mame/includes/stfight.h
r17961r17962
5353
5454INTERRUPT_GEN( stfight_vb_interrupt );
5555void stfight_adpcm_int(device_t *device);
56WRITE8_DEVICE_HANDLER( stfight_adpcm_control_w );
56DECLARE_WRITE8_DEVICE_HANDLER( stfight_adpcm_control_w );
5757
5858
5959/*----------- defined in video/stfight.c -----------*/
trunk/src/mame/includes/xxmissio.h
r17961r17962
3636
3737SCREEN_UPDATE_IND16( xxmissio );
3838
39WRITE8_DEVICE_HANDLER( xxmissio_scroll_x_w );
40WRITE8_DEVICE_HANDLER( xxmissio_scroll_y_w );
39DECLARE_WRITE8_DEVICE_HANDLER( xxmissio_scroll_x_w );
40DECLARE_WRITE8_DEVICE_HANDLER( xxmissio_scroll_y_w );
4141
4242
trunk/src/mame/includes/gaelco2.h
r17961r17962
5555/*----------- defined in machine/gaelco2.c -----------*/
5656
5757TIMER_DEVICE_CALLBACK( bang_irq );
58WRITE16_DEVICE_HANDLER( gaelco2_eeprom_cs_w );
59WRITE16_DEVICE_HANDLER( gaelco2_eeprom_sk_w );
60WRITE16_DEVICE_HANDLER( gaelco2_eeprom_data_w );
58DECLARE_WRITE16_DEVICE_HANDLER( gaelco2_eeprom_cs_w );
59DECLARE_WRITE16_DEVICE_HANDLER( gaelco2_eeprom_sk_w );
60DECLARE_WRITE16_DEVICE_HANDLER( gaelco2_eeprom_data_w );
6161
6262/*----------- defined in video/gaelco2.c -----------*/
6363
trunk/src/mame/includes/homerun.h
r17961r17962
5757
5858/*----------- defined in video/homerun.c -----------*/
5959
60WRITE8_DEVICE_HANDLER( homerun_banking_w );
60DECLARE_WRITE8_DEVICE_HANDLER( homerun_banking_w );
6161
6262
6363SCREEN_UPDATE_IND16(homerun);
trunk/src/mame/includes/mcr.h
r17961r17962
105105
106106/*----------- defined in drivers/mcr.c -----------*/
107107
108WRITE8_DEVICE_HANDLER( mcr_ipu_sio_transmit );
108DECLARE_WRITE16_DEVICE_HANDLER( mcr_ipu_sio_transmit );
109109
110110
111111/*----------- defined in machine/mcr.c -----------*/
trunk/src/mame/includes/subs.h
r17961r17962
5353
5454/*----------- defined in audio/subs.c -----------*/
5555
56WRITE8_DEVICE_HANDLER( subs_noise_reset_w );
57WRITE8_DEVICE_HANDLER( subs_sonar2_w );
58WRITE8_DEVICE_HANDLER( subs_sonar1_w );
59WRITE8_DEVICE_HANDLER( subs_crash_w );
60WRITE8_DEVICE_HANDLER( subs_explode_w );
56DECLARE_WRITE8_DEVICE_HANDLER( subs_noise_reset_w );
57DECLARE_WRITE8_DEVICE_HANDLER( subs_sonar2_w );
58DECLARE_WRITE8_DEVICE_HANDLER( subs_sonar1_w );
59DECLARE_WRITE8_DEVICE_HANDLER( subs_crash_w );
60DECLARE_WRITE8_DEVICE_HANDLER( subs_explode_w );
6161
6262DISCRETE_SOUND_EXTERN( subs );
6363
trunk/src/mame/drivers/bfcobra.c
r17961r17962
14711471{
14721472   device_t *device = machine().device("upd");
14731473   upd7759_reset_w(device, data & 0x80);
1474   upd7759_port_w(device, 0, data & 0x3f);
1474   upd7759_port_w(device, space, 0, data & 0x3f);
14751475   upd7759_start_w(device, data & 0x40 ? 0 : 1);
14761476}
14771477
trunk/src/mame/drivers/nycaptor.c
r17961r17962
318318
319319static const msm5232_interface msm5232_config =
320320{
321   { 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6 }   /* 0.65 (???) uF capacitors (match the sample, not verified) */
321   { 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6 },   /* 0.65 (???) uF capacitors (match the sample, not verified) */
322   DEVCB_NULL
322323};
323324
324325
trunk/src/mame/drivers/fgoal.c
r17961r17962
137137{
138138
139139   m_row = data;
140   mb14241_shift_data_w(m_mb14241, 0, 0);
140   mb14241_shift_data_w(m_mb14241, space, 0, 0);
141141}
142142
143143WRITE8_MEMBER(fgoal_state::fgoal_col_w)
144144{
145145
146146   m_col = data;
147   mb14241_shift_count_w(m_mb14241, 0, data);
147   mb14241_shift_count_w(m_mb14241, space, 0, data);
148148}
149149
150150READ8_MEMBER(fgoal_state::fgoal_address_hi_r)
r17961r17962
159159
160160READ8_MEMBER(fgoal_state::fgoal_shifter_r)
161161{
162   UINT8 v = mb14241_shift_result_r(m_mb14241, 0);
162   UINT8 v = mb14241_shift_result_r(m_mb14241, space, 0);
163163
164164   return BITSWAP8(v, 7, 6, 5, 4, 3, 2, 1, 0);
165165}
166166
167167READ8_MEMBER(fgoal_state::fgoal_shifter_reverse_r)
168168{
169   UINT8 v = mb14241_shift_result_r(m_mb14241, 0);
169   UINT8 v = mb14241_shift_result_r(m_mb14241, space, 0);
170170
171171   return BITSWAP8(v, 0, 1, 2, 3, 4, 5, 6, 7);
172172}
trunk/src/mame/drivers/mystston.c
r17961r17962
7777   if (((*m_ay8910_select & 0x20) == 0x20) && ((data & 0x20) == 0x00))
7878   {
7979      /* bit 4 goes to the 8910 #0 BC1 pin */
80      ay8910_data_address_w(machine().device("ay1"), *m_ay8910_select >> 4, *m_ay8910_data);
80      ay8910_data_address_w(machine().device("ay1"), space, *m_ay8910_select >> 4, *m_ay8910_data);
8181   }
8282
8383   /* bit 7 goes to 8910 #1 BDIR pin */
8484   if (((*m_ay8910_select & 0x80) == 0x80) && ((data & 0x80) == 0x00))
8585   {
8686      /* bit 6 goes to the 8910 #1 BC1 pin */
87      ay8910_data_address_w(machine().device("ay2"), *m_ay8910_select >> 6, *m_ay8910_data);
87      ay8910_data_address_w(machine().device("ay2"), space, *m_ay8910_select >> 6, *m_ay8910_data);
8888   }
8989
9090   *m_ay8910_select = data;
trunk/src/mame/drivers/bfm_sc1.c
r17961r17962
602602WRITE8_MEMBER(bfm_sc1_state::nec_latch_w)
603603{
604604   device_t *device = machine().device("upd");
605   upd7759_port_w (device, 0, data&0x3F);   // setup sample
605   upd7759_port_w (device, space, 0, data&0x3F);   // setup sample
606606   upd7759_start_w(device, 0);
607607   upd7759_start_w(device, 1);         // start
608608}
trunk/src/mame/drivers/skeetsht.c
r17961r17962
9393   if (offset & 8)
9494      offset = (offset & ~8) | 4;
9595
96   return tlc34076_r(machine().device("tlc34076"), offset);
96   return tlc34076_r(machine().device("tlc34076"), space, offset);
9797}
9898
9999WRITE16_MEMBER(skeetsht_state::ramdac_w)
r17961r17962
103103   if (offset & 8)
104104      offset = (offset & ~8) | 4;
105105
106   tlc34076_w(machine().device("tlc34076"), offset, data);
106   tlc34076_w(machine().device("tlc34076"), space, offset, data);
107107}
108108
109109
r17961r17962
163163{
164164
165165   if (m_ay_sel)
166      ay8910_data_w(m_ay, 0, data);
166      ay8910_data_w(m_ay, space, 0, data);
167167   else
168      ay8910_address_w(m_ay, 0, data);
168      ay8910_address_w(m_ay, space, 0, data);
169169}
170170
171171
trunk/src/mame/drivers/dblewing.c
r17961r17962
104104static SCREEN_UPDATE_IND16(dblewing)
105105{
106106   dblewing_state *state = screen.machine().driver_data<dblewing_state>();
107   UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, 0, 0xffff);
107   address_space &space = state->generic_space();
108   UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, space, 0, 0xffff);
108109
109110   state->flip_screen_set(BIT(flip, 7));
110111   deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll);
trunk/src/mame/drivers/labyrunr.c
r17961r17962
1919static INTERRUPT_GEN( labyrunr_vblank_interrupt )
2020{
2121   labyrunr_state *state = device->machine().driver_data<labyrunr_state>();
22   if (k007121_ctrlram_r(state->m_k007121, 7) & 0x02)
22   address_space &space = state->generic_space();
23   if (k007121_ctrlram_r(state->m_k007121, space, 7) & 0x02)
2324      device->execute().set_input_line(HD6309_IRQ_LINE, HOLD_LINE);
2425}
2526
2627static INTERRUPT_GEN( labyrunr_timer_interrupt )
2728{
2829   labyrunr_state *state = device->machine().driver_data<labyrunr_state>();
29   if (k007121_ctrlram_r(state->m_k007121, 7) & 0x01)
30   address_space &space = state->generic_space();
31   if (k007121_ctrlram_r(state->m_k007121, space, 7) & 0x01)
3032      device->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
3133}
3234
trunk/src/mame/drivers/hornet.c
r17961r17962
377377READ32_MEMBER(hornet_state::hornet_k037122_sram_r)
378378{
379379   device_t *k037122 = machine().device(get_cgboard_id() ? "k037122_2" : "k037122_1");
380   return k037122_sram_r(k037122, offset, mem_mask);
380   return k037122_sram_r(k037122, space, offset, mem_mask);
381381}
382382
383383WRITE32_MEMBER(hornet_state::hornet_k037122_sram_w)
384384{
385385   device_t *k037122 = machine().device(get_cgboard_id() ? "k037122_2" : "k037122_1");
386   k037122_sram_w(k037122, offset, data, mem_mask);
386   k037122_sram_w(k037122, space, offset, data, mem_mask);
387387}
388388
389389
390390READ32_MEMBER(hornet_state::hornet_k037122_char_r)
391391{
392392   device_t *k037122 = machine().device(get_cgboard_id() ? "k037122_2" : "k037122_1");
393   return k037122_char_r(k037122, offset, mem_mask);
393   return k037122_char_r(k037122, space, offset, mem_mask);
394394}
395395
396396WRITE32_MEMBER(hornet_state::hornet_k037122_char_w)
397397{
398398   device_t *k037122 = machine().device(get_cgboard_id() ? "k037122_2" : "k037122_1");
399   k037122_char_w(k037122, offset, data, mem_mask);
399   k037122_char_w(k037122, space, offset, data, mem_mask);
400400}
401401
402402READ32_MEMBER(hornet_state::hornet_k037122_reg_r)
403403{
404404   device_t *k037122 = machine().device(get_cgboard_id() ? "k037122_2" : "k037122_1");
405   return k037122_reg_r(k037122, offset, mem_mask);
405   return k037122_reg_r(k037122, space, offset, mem_mask);
406406}
407407
408408WRITE32_MEMBER(hornet_state::hornet_k037122_reg_w)
409409{
410410   device_t *k037122 = machine().device(get_cgboard_id() ? "k037122_2" : "k037122_1");
411   k037122_reg_w(k037122, offset, data, mem_mask);
411   k037122_reg_w(k037122, space, offset, data, mem_mask);
412412}
413413
414414static void voodoo_vblank_0(device_t *device, int param)
r17961r17962
490490                0x01 = ADDO (ADC DO)
491491            */
492492         r = 0xf0 | (eeprom->read_bit() << 3);
493         r |= adc1213x_do_r(adc12138, 0) | (adc1213x_eoc_r(adc12138, 0) << 2);
493         r |= adc1213x_do_r(adc12138, space, 0) | (adc1213x_eoc_r(adc12138, space, 0) << 2);
494494         break;
495495
496496      case 4:   /* I/O port 4 - DIP switches */
r17961r17962
544544                0x02 = ADDI (ADC DI)
545545                0x01 = ADDSCLK (ADC SCLK)
546546            */
547         adc1213x_cs_w(adc12138, 0, (data >> 3) & 0x1);
548         adc1213x_conv_w(adc12138, 0, (data >> 2) & 0x1);
549         adc1213x_di_w(adc12138, 0, (data >> 1) & 0x1);
550         adc1213x_sclk_w(adc12138, 0, data & 0x1);
547         adc1213x_cs_w(adc12138, space, 0, (data >> 3) & 0x1);
548         adc1213x_conv_w(adc12138, space, 0, (data >> 2) & 0x1);
549         adc1213x_di_w(adc12138, space, 0, (data >> 1) & 0x1);
550         adc1213x_sclk_w(adc12138, space, 0, data & 0x1);
551551
552552         machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_RESET, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE);
553553         mame_printf_debug("System register 1 = %02X\n", data);
trunk/src/mame/drivers/mediagx.c
r17961r17962
426426READ8_MEMBER(mediagx_state::at_dma8237_2_r)
427427{
428428   device_t *device = machine().device("dma8237_2");
429   return i8237_r(device, offset / 2);
429   return i8237_r(device, space, offset / 2);
430430}
431431
432432WRITE8_MEMBER(mediagx_state::at_dma8237_2_w)
433433{
434434   device_t *device = machine().device("dma8237_2");
435   i8237_w(device, offset / 2, data);
435   i8237_w(device, space, offset / 2, data);
436436}
437437
438438
439439READ32_MEMBER(mediagx_state::ide_r)
440440{
441441   device_t *device = machine().device("ide");
442   return ide_controller32_r(device, 0x1f0/4 + offset, mem_mask);
442   return ide_controller32_r(device, space, 0x1f0/4 + offset, mem_mask);
443443}
444444
445445WRITE32_MEMBER(mediagx_state::ide_w)
446446{
447447   device_t *device = machine().device("ide");
448   ide_controller32_w(device, 0x1f0/4 + offset, data, mem_mask);
448   ide_controller32_w(device, space, 0x1f0/4 + offset, data, mem_mask);
449449}
450450
451451READ32_MEMBER(mediagx_state::fdc_r)
452452{
453453   device_t *device = machine().device("ide");
454   return ide_controller32_r(device, 0x3f0/4 + offset, mem_mask);
454   return ide_controller32_r(device, space, 0x3f0/4 + offset, mem_mask);
455455}
456456
457457WRITE32_MEMBER(mediagx_state::fdc_w)
458458{
459459   device_t *device = machine().device("ide");
460   ide_controller32_w(device, 0x3f0/4 + offset, data, mem_mask);
460   ide_controller32_w(device, space, 0x3f0/4 + offset, data, mem_mask);
461461}
462462
463463
r17961r17962
565565   }
566566   else
567567   {
568      r = pic8259_r(device, offset);
568      r = pic8259_r(device, space, offset);
569569   }
570570   return r;
571571}
r17961r17962
585585   }
586586   else
587587   {
588      pic8259_w(device, offset, data);
588      pic8259_w(device, space, offset, data);
589589   }
590590}
591591
trunk/src/mame/drivers/orbit.c
r17961r17962
6161 *
6262 *************************************/
6363
64static void update_misc_flags(running_machine &machine, UINT8 val)
64static void update_misc_flags(address_space &space, UINT8 val)
6565{
66   orbit_state *state = machine.driver_data<orbit_state>();
66   orbit_state *state = space.machine().driver_data<orbit_state>();
6767
6868   state->m_misc_flags = val;
6969
r17961r17962
7676   /* BIT6 => HYPER LED    */
7777   /* BIT7 => WARNING SND  */
7878
79   discrete_sound_w(state->m_discrete, ORBIT_WARNING_EN, BIT(state->m_misc_flags, 7));
79   discrete_sound_w(state->m_discrete, space, ORBIT_WARNING_EN, BIT(state->m_misc_flags, 7));
8080
81   set_led_status(machine, 0, BIT(state->m_misc_flags, 3));
82   set_led_status(machine, 1, BIT(state->m_misc_flags, 6));
81   set_led_status(space.machine(), 0, BIT(state->m_misc_flags, 3));
82   set_led_status(space.machine(), 1, BIT(state->m_misc_flags, 6));
8383
84   coin_lockout_w(machine, 0, !BIT(state->m_misc_flags, 1));
85   coin_lockout_w(machine, 1, !BIT(state->m_misc_flags, 1));
84   coin_lockout_w(space.machine(), 0, !BIT(state->m_misc_flags, 1));
85   coin_lockout_w(space.machine(), 1, !BIT(state->m_misc_flags, 1));
8686}
8787
8888
r17961r17962
9191   UINT8 bit = offset >> 1;
9292
9393   if (offset & 1)
94      update_misc_flags(machine(), m_misc_flags | (1 << bit));
94      update_misc_flags(space, m_misc_flags | (1 << bit));
9595   else
96      update_misc_flags(machine(), m_misc_flags & ~(1 << bit));
96      update_misc_flags(space, m_misc_flags & ~(1 << bit));
9797}
9898
9999
r17961r17962
283283
284284void orbit_state::machine_reset()
285285{
286
287   update_misc_flags(machine(), 0);
286   update_misc_flags(generic_space(), 0);
288287   m_flip_screen = 0;
289288}
290289
trunk/src/mame/drivers/5clown.c
r17961r17962
686686
687687WRITE8_MEMBER(_5clown_state::fclown_ay8910_w)
688688{
689   ay8910_address_w(m_ay8910, 0, offset);
690   ay8910_data_w(m_ay8910, 0, data);
689   ay8910_address_w(m_ay8910, space, 0, offset);
690   ay8910_data_w(m_ay8910, space, 0, data);
691691}
692692
693693
trunk/src/mame/drivers/sfcbox.c
r17961r17962
171171
172172static READ8_DEVICE_HANDLER( spc_ram_100_r )
173173{
174   return spc_ram_r(device, offset + 0x100);
174   return spc_ram_r(device, space, offset + 0x100);
175175}
176176
177177static WRITE8_DEVICE_HANDLER( spc_ram_100_w )
178178{
179   spc_ram_w(device, offset + 0x100, data);
179   spc_ram_w(device, space, offset + 0x100, data);
180180}
181181
182182static ADDRESS_MAP_START( spc_mem, AS_PROGRAM, 8, sfcbox_state )
trunk/src/mame/drivers/contra.c
r17961r17962
2828static INTERRUPT_GEN( contra_interrupt )
2929{
3030   contra_state *state = device->machine().driver_data<contra_state>();
31   if (k007121_ctrlram_r(state->m_k007121_1, 7) & 0x02)
31   address_space &space = state->generic_space();
32   if (k007121_ctrlram_r(state->m_k007121_1, space, 7) & 0x02)
3233      device->execute().set_input_line(HD6309_IRQ_LINE, HOLD_LINE);
3334}
3435
trunk/src/mame/drivers/zn.c
r17961r17962
12161216READ32_MEMBER(zn_state::taitofx1a_ymsound_r)
12171217{
12181218   device_t *tc0140syt = machine().device("tc0140syt");
1219   return tc0140syt_comm_r(tc0140syt, 0) << 16;
1219   return tc0140syt_comm_r(tc0140syt, space, 0) << 16;
12201220}
12211221
12221222WRITE32_MEMBER(zn_state::taitofx1a_ymsound_w)
r17961r17962
12251225
12261226   if (mem_mask == 0x0000ffff)
12271227   {
1228      tc0140syt_port_w(tc0140syt, 0, data & 0xff);
1228      tc0140syt_port_w(tc0140syt, space, 0, data & 0xff);
12291229   }
12301230   else
12311231   {
1232      tc0140syt_comm_w(tc0140syt, 0, (data >> 16) & 0xff);
1232      tc0140syt_comm_w(tc0140syt, space, 0, (data >> 16) & 0xff);
12331233   }
12341234}
12351235
r17961r17962
14981498
14991499   /* dma size is in 32-bit words, convert to bytes */
15001500   n_size <<= 2;
1501   address_space &space = *state->machine().firstcpu->space(AS_PROGRAM);
15011502   while( n_size > 0 )
15021503   {
1503      psxwritebyte( p_n_psxram, n_address, ide_controller32_r( ide, 0x1f0 / 4, 0x000000ff ) );
1504      psxwritebyte( p_n_psxram, n_address, ide_controller32_r( ide, space, 0x1f0 / 4, 0x000000ff ) );
15041505      n_address++;
15051506      n_size--;
15061507   }
trunk/src/mame/drivers/malzak.c
r17961r17962
7474
7575READ8_MEMBER(malzak_state::fake_VRLE_r)
7676{
77   return (s2636_work_ram_r(m_s2636_0, 0xcb) & 0x3f) + (machine().primary_screen->vblank() * 0x40);
77   return (s2636_work_ram_r(m_s2636_0, space, 0xcb) & 0x3f) + (machine().primary_screen->vblank() * 0x40);
7878}
7979
8080READ8_MEMBER(malzak_state::s2636_portA_r)
trunk/src/mame/drivers/vertigo.c
r17961r17962
3131{
3232   device_t * device = machine().device("pit8254");
3333
34   return pit8253_r( device, offset );
34   return pit8253_r( device, space, offset );
3535}
3636
3737WRITE16_MEMBER(vertigo_state::vertigo_pit8254_lsb_w)
r17961r17962
3939   device_t * device = machine().device("pit8254");
4040
4141   if (ACCESSING_BITS_0_7)
42      pit8253_w(device, offset, data);
42      pit8253_w(device, space, offset, data);
4343}
4444
4545static ADDRESS_MAP_START( vertigo_map, AS_PROGRAM, 16, vertigo_state )
trunk/src/mame/drivers/midzeus.c
r17961r17962
158158READ32_MEMBER(midzeus_state::zeus2_timekeeper_r)
159159{
160160   device_t *device = machine().device("m48t35");
161   return timekeeper_r(device, offset) | 0xffffff00;
161   return timekeeper_r(device, space, offset) | 0xffffff00;
162162}
163163
164164
r17961r17962
166166{
167167   device_t *device = machine().device("m48t35");
168168   if (bitlatch[2] && !cmos_protected)
169      timekeeper_w(device, offset, data);
169      timekeeper_w(device, space, offset, data);
170170   else
171171      logerror("%s:zeus2_timekeeper_w with bitlatch[2] = %d, cmos_protected = %d\n", machine().describe_context(), bitlatch[2], cmos_protected);
172172   cmos_protected = TRUE;
trunk/src/mame/drivers/drw80pkr.c
r17961r17962
195195
196196      // ay8910 control port
197197      if (m_p1 == 0xfc)
198         ay8910_address_w(machine().device("aysnd"), 0, data);
198         ay8910_address_w(machine().device("aysnd"), space, 0, data);
199199
200200      // ay8910_write_port_0_w
201201      if (m_p1 == 0xfe)
202         ay8910_data_w(machine().device("aysnd"), 0, data);
202         ay8910_data_w(machine().device("aysnd"), space, 0, data);
203203   }
204204}
205205
trunk/src/mame/drivers/norautp.c
r17961r17962
669669   output_set_lamp_value(9, (data >> 1) & 1);   /* BET / COLLECT lamp */
670670
671671   /* the 4 MSB are for discrete sound */
672   discrete_sound_w(discrete, NORAUTP_SND_EN, (data >> 7) & 0x01);
673   discrete_sound_w(discrete, NORAUTP_FREQ_DATA, (data >> 4) & 0x07);
672   discrete_sound_w(discrete, space, NORAUTP_SND_EN, (data >> 7) & 0x01);
673   discrete_sound_w(discrete, space, NORAUTP_FREQ_DATA, (data >> 4) & 0x07);
674674
675675//  popmessage("sound bits 4-5-6-7: %02x, %02x, %02x, %02x", ((data >> 4) & 0x01), ((data >> 5) & 0x01), ((data >> 6) & 0x01), ((data >> 7) & 0x01));
676676}
trunk/src/mame/drivers/aliens.c
r17961r17962
9292   if (k052109_get_rmrd_line(m_k052109) == CLEAR_LINE)
9393   {
9494      if (offset >= 0x3800 && offset < 0x3808)
95         return k051937_r(m_k051960, offset - 0x3800);
95         return k051937_r(m_k051960, space, offset - 0x3800);
9696      else if (offset < 0x3c00)
97         return k052109_r(m_k052109, offset);
97         return k052109_r(m_k052109, space, offset);
9898      else
99         return k051960_r(m_k051960, offset - 0x3c00);
99         return k051960_r(m_k051960, space, offset - 0x3c00);
100100   }
101101   else
102      return k052109_r(m_k052109, offset);
102      return k052109_r(m_k052109, space, offset);
103103}
104104
105105WRITE8_MEMBER(aliens_state::k052109_051960_w)
106106{
107107
108108   if (offset >= 0x3800 && offset < 0x3808)
109      k051937_w(m_k051960, offset - 0x3800, data);
109      k051937_w(m_k051960, space, offset - 0x3800, data);
110110   else if (offset < 0x3c00)
111      k052109_w(m_k052109, offset, data);
111      k052109_w(m_k052109, space, offset, data);
112112   else
113      k051960_w(m_k051960, offset - 0x3c00, data);
113      k051960_w(m_k051960, space, offset - 0x3c00, data);
114114}
115115
116116static ADDRESS_MAP_START( aliens_map, AS_PROGRAM, 8, aliens_state )
trunk/src/mame/drivers/88games.c
r17961r17962
3838   else
3939   {
4040      if (m_zoomreadroms)
41         return k051316_rom_r(m_k051316, offset);
41         return k051316_rom_r(m_k051316, space, offset);
4242      else
43         return k051316_r(m_k051316, offset);
43         return k051316_r(m_k051316, space, offset);
4444   }
4545}
4646
r17961r17962
5050   if (m_videobank)
5151      m_ram[offset] = data;
5252   else
53      k051316_w(m_k051316, offset, data);
53      k051316_w(m_k051316, space, offset, data);
5454}
5555
5656WRITE8_MEMBER(_88games_state::k88games_5f84_w)
r17961r17962
8989{
9090   device_t *upd = m_speech_chip ? m_upd_2 : m_upd_1;
9191
92   upd7759_port_w(upd, 0, data);
92   upd7759_port_w(upd, space, 0, data);
9393}
9494
9595/* special handlers to combine 052109 & 051960 */
r17961r17962
9999   if (k052109_get_rmrd_line(m_k052109) == CLEAR_LINE)
100100   {
101101      if (offset >= 0x3800 && offset < 0x3808)
102         return k051937_r(m_k051960, offset - 0x3800);
102         return k051937_r(m_k051960, space, offset - 0x3800);
103103      else if (offset < 0x3c00)
104         return k052109_r(m_k052109, offset);
104         return k052109_r(m_k052109, space, offset);
105105      else
106         return k051960_r(m_k051960, offset - 0x3c00);
106         return k051960_r(m_k051960, space, offset - 0x3c00);
107107   }
108108   else
109      return k052109_r(m_k052109, offset);
109      return k052109_r(m_k052109, space, offset);
110110}
111111
112112WRITE8_MEMBER(_88games_state::k052109_051960_w)
113113{
114114
115115   if (offset >= 0x3800 && offset < 0x3808)
116      k051937_w(m_k051960, offset - 0x3800, data);
116      k051937_w(m_k051960, space, offset - 0x3800, data);
117117   else if (offset < 0x3c00)
118      k052109_w(m_k052109, offset, data);
118      k052109_w(m_k052109, space, offset, data);
119119   else
120      k051960_w(m_k051960, offset - 0x3c00, data);
120      k051960_w(m_k051960, space, offset - 0x3c00, data);
121121}
122122
123123/*************************************
trunk/src/mame/drivers/kaneko16.c
r17961r17962
162162{
163163   device_t *device = machine().device("ay1");
164164   /* Each 2149 register is mapped to a different address */
165   ay8910_address_w(device,0,offset);
166   return ay8910_r(device,0);
165   ay8910_address_w(device,space,0,offset);
166   return ay8910_r(device,space,0);
167167}
168168
169169WRITE16_MEMBER(kaneko16_state::kaneko16_ay1_YM2149_w)
170170{
171171   device_t *device = machine().device("ay1");
172172   /* Each 2149 register is mapped to a different address */
173   ay8910_address_w(device,0,offset);
173   ay8910_address_w(device,space,0,offset);
174174   /* The registers are mapped to odd addresses, except one! */
175   if (ACCESSING_BITS_0_7)   ay8910_data_w(device,0, data       & 0xff);
176   else            ay8910_data_w(device,0,(data >> 8) & 0xff);
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);
177177}
178178
179179READ16_MEMBER(kaneko16_state::kaneko16_ay2_YM2149_r)
180180{
181181   device_t *device = machine().device("ay2");
182182   /* Each 2149 register is mapped to a different address */
183   ay8910_address_w(device,0,offset);
184   return ay8910_r(device,0);
183   ay8910_address_w(device,space,0,offset);
184   return ay8910_r(device,space,0);
185185}
186186
187187WRITE16_MEMBER(kaneko16_state::kaneko16_ay2_YM2149_w)
188188{
189189   device_t *device = machine().device("ay2");
190190   /* Each 2149 register is mapped to a different address */
191   ay8910_address_w(device,0,offset);
191   ay8910_address_w(device,space,0,offset);
192192   /* The registers are mapped to odd addresses, except one! */
193   if (ACCESSING_BITS_0_7)   ay8910_data_w(device,0, data       & 0xff);
194   else            ay8910_data_w(device,0,(data >> 8) & 0xff);
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);
195195}
196196
197197
trunk/src/mame/drivers/cybertnk.c
r17961r17962
821821
822822
823823static const y8950_interface y8950_config = {
824   0 /* TODO */
824   /* TODO */
825   DEVCB_NULL,
826   DEVCB_NULL,
827   DEVCB_NULL,
828   DEVCB_NULL,
829   DEVCB_NULL
825830};
826831
827832static MACHINE_CONFIG_START( cybertnk, cybertnk_state )
trunk/src/mame/drivers/taito_b.c
r17961r17962
478478         return ioport("COIN")->read() << 8;
479479
480480      default:
481         return tc0640fio_r(m_tc0640fio, offset) << 8;
481         return tc0640fio_r(m_tc0640fio, space, offset) << 8;
482482   }
483483}
484484
485485WRITE16_MEMBER(taitob_state::spacedxo_tc0220ioc_w)
486486{
487487   if (ACCESSING_BITS_0_7)
488      tc0220ioc_w(m_tc0220ioc, offset, data & 0xff);
488      tc0220ioc_w(m_tc0220ioc, space, offset, data & 0xff);
489489   else
490490   {
491491      /* &spacedxo also writes here - bug? */
492      tc0220ioc_w(m_tc0220ioc, offset, (data >> 8) & 0xff);
492      tc0220ioc_w(m_tc0220ioc, space, offset, (data >> 8) & 0xff);
493493   }
494494}
495495
r17961r17962
731731   AM_RANGE(0x300000, 0x300001) AM_DEVREADWRITE_LEGACY("hd63484", hd63484_status_r, hd63484_address_w)
732732   AM_RANGE(0x300002, 0x300003) AM_DEVREADWRITE_LEGACY("hd63484", hd63484_data_r, hd63484_data_w)
733733//  AM_RANGE(0x320000, 0x320001) AM_READ_LEGACY(SMH_NOP) // ?
734   AM_RANGE(0x320002, 0x320003) AM_READNOP AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, 0xff00)
734   AM_RANGE(0x320002, 0x320003) AM_READNOP AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_comm_w, 0xff00)
735735ADDRESS_MAP_END
736736
737737static ADDRESS_MAP_START( masterw_sound_map, AS_PROGRAM, 8, taitob_state )
trunk/src/mame/drivers/viper.c
r17961r17962
15271527READ64_MEMBER(viper_state::voodoo3_io_r)
15281528{
15291529   device_t *device = machine().device("voodoo");
1530   return read64be_with_32le_device_handler(banshee_io_r, device, offset, mem_mask);
1530   return read64be_with_32le_device_handler(banshee_io_r, device, space, offset, mem_mask);
15311531}
15321532WRITE64_MEMBER(viper_state::voodoo3_io_w)
15331533{
15341534//  printf("voodoo3_io_w: %08X%08X, %08X at %08X\n", (UINT32)(data >> 32), (UINT32)(data), offset, space.device().safe_pc());
15351535
15361536   device_t *device = machine().device("voodoo");
1537   write64be_with_32le_device_handler(banshee_io_w, device, offset, data, mem_mask);
1537   write64be_with_32le_device_handler(banshee_io_w, device, space, offset, data, mem_mask);
15381538}
15391539
15401540READ64_MEMBER(viper_state::voodoo3_r)
15411541{
15421542   device_t *device = machine().device("voodoo");
1543   return read64be_with_32le_device_handler(banshee_r, device, offset, mem_mask);
1543   return read64be_with_32le_device_handler(banshee_r, device, space, offset, mem_mask);
15441544}
15451545WRITE64_MEMBER(viper_state::voodoo3_w)
15461546{
15471547//  printf("voodoo3_w: %08X%08X, %08X at %08X\n", (UINT32)(data >> 32), (UINT32)(data), offset, space.device().safe_pc());
15481548
15491549   device_t *device = machine().device("voodoo");
1550   write64be_with_32le_device_handler(banshee_w, device, offset, data, mem_mask);
1550   write64be_with_32le_device_handler(banshee_w, device, space, offset, data, mem_mask);
15511551}
15521552
15531553READ64_MEMBER(viper_state::voodoo3_lfb_r)
15541554{
15551555   device_t *device = machine().device("voodoo");
1556   return read64be_with_32le_device_handler(banshee_fb_r, device, offset, mem_mask);
1556   return read64be_with_32le_device_handler(banshee_fb_r, device, space, offset, mem_mask);
15571557}
15581558WRITE64_MEMBER(viper_state::voodoo3_lfb_w)
15591559{
15601560//  printf("voodoo3_lfb_w: %08X%08X, %08X at %08X\n", (UINT32)(data >> 32), (UINT32)(data), offset, space.device().safe_pc());
15611561
15621562   device_t *device = machine().device("voodoo");
1563   write64be_with_32le_device_handler(banshee_fb_w, device, offset, data, mem_mask);
1563   write64be_with_32le_device_handler(banshee_fb_w, device, space, offset, data, mem_mask);
15641564}
15651565
15661566
trunk/src/mame/drivers/mw8080bw.c
r17961r17962
168168
169169READ8_MEMBER(mw8080bw_state::mw8080bw_shift_result_rev_r)
170170{
171   UINT8 ret = mb14241_shift_result_r(m_mb14241, 0);
171   UINT8 ret = mb14241_shift_result_r(m_mb14241, space, 0);
172172
173173   return BITSWAP8(ret,0,1,2,3,4,5,6,7);
174174}
r17961r17962
184184   }
185185   else
186186   {
187      ret = mb14241_shift_result_r(m_mb14241, 0);
187      ret = mb14241_shift_result_r(m_mb14241, space, 0);
188188   }
189189
190190   return ret;
r17961r17962
192192
193193WRITE8_MEMBER(mw8080bw_state::mw8080bw_reversable_shift_count_w)
194194{
195   mb14241_shift_count_w(m_mb14241, offset, data);
195   mb14241_shift_count_w(m_mb14241, space, offset, data);
196196
197197   m_rev_shift_res = data & 0x08;
198198}
r17961r17962
425425      gunfight_audio_w(space, 0, data);
426426
427427   if (offset & 0x02)
428      mb14241_shift_count_w(m_mb14241, 0, data);
428      mb14241_shift_count_w(m_mb14241, space, 0, data);
429429
430430   if (offset & 0x04)
431      mb14241_shift_data_w(m_mb14241, 0, data);
431      mb14241_shift_data_w(m_mb14241, space, 0, data);
432432
433433}
434434
r17961r17962
618618{
619619
620620   if (offset & 0x01)
621      tornbase_audio_w(machine().device("discrete"), 0, data);
621      tornbase_audio_w(machine().device("discrete"), space, 0, data);
622622
623623   if (offset & 0x02)
624      mb14241_shift_count_w(m_mb14241, 0, data);
624      mb14241_shift_count_w(m_mb14241, space, 0, data);
625625
626626   if (offset & 0x04)
627      mb14241_shift_data_w(m_mb14241, 0, data);
627      mb14241_shift_data_w(m_mb14241, space, 0, data);
628628}
629629
630630
r17961r17962
10701070WRITE8_MEMBER(mw8080bw_state::checkmat_io_w)
10711071{
10721072
1073   if (offset & 0x01)  checkmat_audio_w(m_discrete, 0, data);
1073   if (offset & 0x01)  checkmat_audio_w(m_discrete, space, 0, data);
10741074
10751075   if (offset & 0x02)  watchdog_reset_w(space, 0, data);
10761076}
r17961r17962
21652165      watchdog_reset_w(space, 0, data);      /*  -  -  -  -  -  0  1  0 */
21662166
21672167   else if ((offset & 0x5f) == 0x01)
2168      spcenctr_audio_1_w(m_discrete, 0, data);   /*  -  0  -  0  0  0  0  1 */
2168      spcenctr_audio_1_w(m_discrete, space, 0, data);   /*  -  0  -  0  0  0  0  1 */
21692169
21702170   else if ((offset & 0x5f) == 0x09)
2171      spcenctr_audio_2_w(m_discrete, 0, data);   /*  -  0  -  0  1  0  0  1 */
2171      spcenctr_audio_2_w(m_discrete, space, 0, data);   /*  -  0  -  0  1  0  0  1 */
21722172
21732173   else if ((offset & 0x5f) == 0x11)
2174      spcenctr_audio_3_w(m_discrete, 0, data);   /*  -  0  -  1  0  0  0  1 */
2174      spcenctr_audio_3_w(m_discrete, space, 0, data);   /*  -  0  -  1  0  0  0  1 */
21752175
21762176   else if ((offset & 0x07) == 0x03)
21772177   {                                 /*  -  -  -  -  -  0  1  1 */
r17961r17962
23812381       anything unusual on the schematics that would cause
23822382       the bits to flip */
23832383
2384   return ~mb14241_shift_result_r(m_mb14241, 0);
2384   return ~mb14241_shift_result_r(m_mb14241, space, 0);
23852385}
23862386
23872387WRITE8_MEMBER(mw8080bw_state::bowler_lights_1_w)
trunk/src/mame/drivers/namcos86.c
r17961r17962
306306      case 1:
307307      case 2:
308308      case 3:
309         namco_63701x_w(machine().device("namco2"), (offset & 0x1e00) >> 9,data);
309         namco_63701x_w(machine().device("namco2"), space, (offset & 0x1e00) >> 9,data);
310310         break;
311311
312312      case 4:
trunk/src/mame/drivers/mermaid.c
r17961r17962
124124
125125WRITE8_MEMBER(mermaid_state::mermaid_ay8910_write_port_w)
126126{
127   if (m_ay8910_enable[0]) ay8910_data_w(m_ay1, offset, data);
128   if (m_ay8910_enable[1]) ay8910_data_w(m_ay2, offset, data);
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);
129129}
130130
131131WRITE8_MEMBER(mermaid_state::mermaid_ay8910_control_port_w)
132132{
133   if (m_ay8910_enable[0]) ay8910_address_w(m_ay1, offset, data);
134   if (m_ay8910_enable[1]) ay8910_address_w(m_ay2, offset, data);
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);
135135}
136136
137137
trunk/src/mame/drivers/gaelco3d.c
r17961r17962
267267   if (mem_mask == 0xffff0000)
268268      irq_ack_w(space, offset, data, mem_mask >> 16);
269269   else if (ACCESSING_BITS_0_7)
270      gaelco_serial_tr_w(machine().device("serial"), 0, data & 0x01);
270      gaelco_serial_tr_w(machine().device("serial"), space, 0, data & 0x01);
271271   else
272272      logerror("%06X:irq_ack_w(%02X) = %08X & %08X\n", space.device().safe_pc(), offset, data, mem_mask);
273273}
r17961r17962
290290      /* bit 0 is clock */
291291      /* bit 1 active */
292292      result &= ~GAELCOSER_EXT_STATUS_MASK;
293      result |= gaelco_serial_status_r(machine().device("serial"), 0);
293      result |= gaelco_serial_status_r(machine().device("serial"), space, 0);
294294   }
295295
296296   eeprom_device *eeprom = downcast<eeprom_device *>(device);
r17961r17962
307307      return (eeprom_data_r(space, 0, mem_mask >> 16) << 16) | 0xffff;
308308   else if (ACCESSING_BITS_0_7)
309309   {
310      UINT8 data = gaelco_serial_data_r(machine().device("serial"),0);
310      UINT8 data = gaelco_serial_data_r(machine().device("serial"),space,0);
311311      if (LOG)
312312         logerror("%06X:read(%02X) = %08X & %08X\n", machine().device("maincpu")->safe_pc(), offset, data, mem_mask);
313313      return  data | 0xffffff00;
trunk/src/mame/drivers/snk.c
r17961r17962
484484
485485static const y8950_interface y8950_config_2 =
486486{
487   ymirq_callback_2
487   DEVCB_LINE(ymirq_callback_2)
488488};
489489
490490
trunk/src/mame/drivers/highvdeo.c
r17961r17962
266266   if (ACCESSING_BITS_0_7 && okidata != data)
267267   {
268268      okidata = data;
269      okim6376_w(device, 0, data & ~0x80);
269      okim6376_w(device, space, 0, data & ~0x80);
270270      okim6376_st_w (device, data & 0x80);
271271   }
272272}
r17961r17962
340340   static int okidata;
341341   if (ACCESSING_BITS_0_7 && okidata != data) {
342342      okidata = data;
343      okim6376_w(device, 0, data );
343      okim6376_w(device, space, 0, data );
344344   }
345345}
346346
trunk/src/mame/drivers/othello.c
r17961r17962
225225WRITE8_MEMBER(othello_state::ay_address_w)
226226{
227227
228   if (m_ay_select & 1) ay8910_address_w(m_ay1, 0, data);
229   if (m_ay_select & 2) ay8910_address_w(m_ay2, 0, data);
228   if (m_ay_select & 1) ay8910_address_w(m_ay1, space, 0, data);
229   if (m_ay_select & 2) ay8910_address_w(m_ay2, space, 0, data);
230230}
231231
232232WRITE8_MEMBER(othello_state::ay_data_w)
233233{
234234
235   if (m_ay_select & 1) ay8910_data_w(m_ay1, 0, data);
236   if (m_ay_select & 2) ay8910_data_w(m_ay2, 0, data);
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);
237237}
238238
239239static ADDRESS_MAP_START( audio_map, AS_PROGRAM, 8, othello_state )
r17961r17962
300300   device_t *device = machine().device("n7751_8243");
301301
302302   /* write to P2; low 4 bits go to 8243 */
303   i8243_p2_w(device, offset, data & 0x0f);
303   i8243_p2_w(device, space, offset, data & 0x0f);
304304
305305   /* output of bit $80 indicates we are ready (1) or busy (0) */
306306   /* no other outputs are used */
trunk/src/mame/drivers/model2.c
r17961r17962
10141014{
10151015   if (ACCESSING_BITS_0_7 && (offset == 0))
10161016   {
1017      scsp_midi_in(machine().device("scsp"), 0, data&0xff, 0);
1017      scsp_midi_in(machine().device("scsp"), space, 0, data&0xff, 0);
10181018
10191019      // give the 68k time to notice
10201020      space.device().execute().spin_until_time(attotime::from_usec(40));
trunk/src/mame/drivers/4enraya.c
r17961r17962
7272   device_t *device = machine().device("aysnd");
7373
7474   if ((m_last_snd_ctrl & m_snd_latch_bit ) == m_snd_latch_bit && (data & m_snd_latch_bit) == 0x00)
75      ay8910_data_address_w(device, m_last_snd_ctrl, m_soundlatch);
75      ay8910_data_address_w(device, space, m_last_snd_ctrl, m_soundlatch);
7676
7777   m_last_snd_ctrl = data;
7878}
trunk/src/mame/drivers/shanghai.c
r17961r17962
8080   device_t *hd63484 = screen.machine().device("hd63484");
8181   int x, y, b, src;
8282
83   b = ((hd63484_regs_r(hd63484, 0xcc/2, 0xffff) & 0x000f) << 16) + hd63484_regs_r(hd63484, 0xce/2, 0xffff);
83   address_space &space = screen.machine().driver_data()->generic_space();
84   b = ((hd63484_regs_r(hd63484, space, 0xcc/2, 0xffff) & 0x000f) << 16) + hd63484_regs_r(hd63484, space, 0xce/2, 0xffff);
8485   for (y = 0; y < 280; y++)
8586   {
86      for (x = 0 ; x < (hd63484_regs_r(hd63484, 0xca/2, 0xffff) & 0x0fff) * 2 ; x += 2)
87      for (x = 0 ; x < (hd63484_regs_r(hd63484, space, 0xca/2, 0xffff) & 0x0fff) * 2 ; x += 2)
8788      {
8889         b &= (HD63484_RAM_SIZE - 1);
89         src = hd63484_ram_r(hd63484, b, 0xffff);
90         src = hd63484_ram_r(hd63484, space, b, 0xffff);
9091         bitmap.pix16(y, x)     = src & 0x00ff;
9192         bitmap.pix16(y, x + 1) = (src & 0xff00) >> 8;
9293         b++;
9394      }
9495   }
9596
96   if ((hd63484_regs_r(hd63484, 0x06/2, 0xffff) & 0x0300) == 0x0300)
97   if ((hd63484_regs_r(hd63484, space, 0x06/2, 0xffff) & 0x0300) == 0x0300)
9798   {
98      int sy = (hd63484_regs_r(hd63484, 0x94/2, 0xffff) & 0x0fff) - (hd63484_regs_r(hd63484, 0x88/2, 0xffff) >> 8);
99      int h = hd63484_regs_r(hd63484, 0x96/2, 0xffff) & 0x0fff;
100      int sx = ((hd63484_regs_r(hd63484, 0x92/2, 0xffff) >> 8) - (hd63484_regs_r(hd63484, 0x84/2, 0xffff) >> 8)) * 4;
101      int w = (hd63484_regs_r(hd63484, 0x92/2, 0xffff) & 0xff) * 4;
99      int sy = (hd63484_regs_r(hd63484, space, 0x94/2, 0xffff) & 0x0fff) - (hd63484_regs_r(hd63484, space, 0x88/2, 0xffff) >> 8);
100      int h = hd63484_regs_r(hd63484, space, 0x96/2, 0xffff) & 0x0fff;
101      int sx = ((hd63484_regs_r(hd63484, space, 0x92/2, 0xffff) >> 8) - (hd63484_regs_r(hd63484, space, 0x84/2, 0xffff) >> 8)) * 4;
102      int w = (hd63484_regs_r(hd63484, space, 0x92/2, 0xffff) & 0xff) * 4;
102103      if (sx < 0) sx = 0;   // not sure about this (shangha2 title screen)
103104
104      b = (((hd63484_regs_r(hd63484, 0xdc/2, 0xffff) & 0x000f) << 16) + hd63484_regs_r(hd63484, 0xde/2, 0xffff));
105      b = (((hd63484_regs_r(hd63484, space, 0xdc/2, 0xffff) & 0x000f) << 16) + hd63484_regs_r(hd63484, space, 0xde/2, 0xffff));
105106
106107      for (y = sy ; y <= sy + h && y < 280 ; y++)
107108      {
108         for (x = 0 ; x < (hd63484_regs_r(hd63484, 0xca/2, 0xffff) & 0x0fff) * 2 ; x += 2)
109         for (x = 0 ; x < (hd63484_regs_r(hd63484, space, 0xca/2, 0xffff) & 0x0fff) * 2 ; x += 2)
109110         {
110111            b &= (HD63484_RAM_SIZE - 1);
111            src = hd63484_ram_r(hd63484, b, 0xffff);
112            if (x <= w && x + sx >= 0 && x + sx < (hd63484_regs_r(hd63484, 0xca/2, 0xffff) & 0x0fff) * 2)
112            src = hd63484_ram_r(hd63484, space, b, 0xffff);
113            if (x <= w && x + sx >= 0 && x + sx < (hd63484_regs_r(hd63484, space, 0xca/2, 0xffff) & 0x0fff) * 2)
113114            {
114115               bitmap.pix16(y, x + sx)     = src & 0x00ff;
115116               bitmap.pix16(y, x + sx + 1) = (src & 0xff00) >> 8;
trunk/src/mame/drivers/jpmimpct.c
r17961r17962
476476   device_t *device = machine().device("upd");
477477   if (ACCESSING_BITS_0_7)
478478   {
479      upd7759_port_w(device, 0, data);
479      upd7759_port_w(device, space, 0, data);
480480      upd7759_start_w(device, 0);
481481      upd7759_start_w(device, 1);
482482   }
trunk/src/mame/drivers/sigmab52.c
r17961r17962
171171
172172   int x, y, b, src;
173173
174   b = ((hd63484_regs_r(hd63484, 0xcc/2, 0xffff) & 0x000f) << 16) + hd63484_regs_r(hd63484, 0xce/2, 0xffff);
174   address_space &space = screen.machine().driver_data()->generic_space();
175   b = ((hd63484_regs_r(hd63484, space, 0xcc/2, 0xffff) & 0x000f) << 16) + hd63484_regs_r(hd63484, space, 0xce/2, 0xffff);
175176
176177//save vram to file
177178#if 0
r17961r17962
186187
187188   for (y = 0; y < 480; y++)
188189   {
189      for (x = 0; x < (hd63484_regs_r(hd63484, 0xca/2, 0xffff) & 0x0fff) * 4; x += 4)
190      for (x = 0; x < (hd63484_regs_r(hd63484, space, 0xca/2, 0xffff) & 0x0fff) * 4; x += 4)
190191      {
191192
192         src = hd63484_ram_r(hd63484, b & (HD63484_RAM_SIZE - 1), 0xffff);
193         src = hd63484_ram_r(hd63484, space, b & (HD63484_RAM_SIZE - 1), 0xffff);
193194
194195         bitmap.pix16(y, x    ) = ((src & 0x000f) >>  0) << 0;
195196         bitmap.pix16(y, x + 1) = ((src & 0x00f0) >>  4) << 0;
r17961r17962
200201   }
201202
202203if (!screen.machine().input().code_pressed(KEYCODE_O))
203   if ((hd63484_regs_r(hd63484, 0x06/2, 0xffff) & 0x0300) == 0x0300)
204   if ((hd63484_regs_r(hd63484, space, 0x06/2, 0xffff) & 0x0300) == 0x0300)
204205   {
205      int sy = (hd63484_regs_r(hd63484, 0x94/2, 0xffff) & 0x0fff) - (hd63484_regs_r(hd63484, 0x88/2, 0xffff) >> 8);
206      int h = hd63484_regs_r(hd63484, 0x96/2, 0xffff) & 0x0fff;
207      int sx = ((hd63484_regs_r(hd63484, 0x92/2, 0xffff) >> 8) - (hd63484_regs_r(hd63484, 0x84/2, 0xffff) >> 8)) * 4;
208      int w = (hd63484_regs_r(hd63484, 0x92/2, 0xffff) & 0xff) * 2;
206      int sy = (hd63484_regs_r(hd63484, space, 0x94/2, 0xffff) & 0x0fff) - (hd63484_regs_r(hd63484, space, 0x88/2, 0xffff) >> 8);
207      int h = hd63484_regs_r(hd63484, space, 0x96/2, 0xffff) & 0x0fff;
208      int sx = ((hd63484_regs_r(hd63484, space, 0x92/2, 0xffff) >> 8) - (hd63484_regs_r(hd63484, space, 0x84/2, 0xffff) >> 8)) * 4;
209      int w = (hd63484_regs_r(hd63484, space, 0x92/2, 0xffff) & 0xff) * 2;
209210      if (sx < 0) sx = 0;   // not sure about this (shangha2 title screen)
210211
211      b = (((hd63484_regs_r(hd63484, 0xdc/2, 0xffff) & 0x000f) << 16) + hd63484_regs_r(hd63484, 0xde/2, 0xffff));
212      b = (((hd63484_regs_r(hd63484, space, 0xdc/2, 0xffff) & 0x000f) << 16) + hd63484_regs_r(hd63484, space, 0xde/2, 0xffff));
212213
213214
214215      for (y = sy; y <= sy + h && y < 480; y++)
215216      {
216         for (x = 0; x < (hd63484_regs_r(hd63484, 0xca/2, 0xffff) & 0x0fff)* 4; x += 4)
217         for (x = 0; x < (hd63484_regs_r(hd63484, space, 0xca/2, 0xffff) & 0x0fff)* 4; x += 4)
217218         {
218               src = hd63484_ram_r(hd63484, b & (HD63484_RAM_SIZE - 1), 0xffff);
219               src = hd63484_ram_r(hd63484, space, b & (HD63484_RAM_SIZE - 1), 0xffff);
219220
220            if (x <= w && x + sx >= 0 && x + sx < (hd63484_regs_r(hd63484, 0xca/2, 0xffff) & 0x0fff) * 4)
221            if (x <= w && x + sx >= 0 && x + sx < (hd63484_regs_r(hd63484, space, 0xca/2, 0xffff) & 0x0fff) * 4)
221222               {
222223                  bitmap.pix16(y, x + sx    ) = ((src & 0x000f) >>  0) << 0;
223224                  bitmap.pix16(y, x + sx + 1) = ((src & 0x00f0) >>  4) << 0;
r17961r17962
249250   if(!offset)
250251   {
251252      //address select
252      hd63484_address_w(hd63484, 0, data, 0x00ff);
253      hd63484_address_w(hd63484, space, 0, data, 0x00ff);
253254      m_latch = 0;
254255   }
255256   else
r17961r17962
265266         m_acrtc_data <<= 8;
266267         m_acrtc_data |= data;
267268
268         hd63484_data_w(hd63484, 0, m_acrtc_data, 0xffff);
269         hd63484_data_w(hd63484, space, 0, m_acrtc_data, 0xffff);
269270      }
270271
271272      m_latch ^= 1;
r17961r17962
277278   if(offset&1)
278279   {
279280      device_t *hd63484 = machine().device("hd63484");
280      return hd63484_data_r(hd63484, 0, 0xff);
281      return hd63484_data_r(hd63484, space, 0, 0xff);
281282   }
282283
283284   else
r17961r17962
569570
570571      device_t *hd63484 = machine().device("hd63484");
571572
573      address_space &space = generic_space();
572574      for(i = 0; i < 0x40000/2; ++i)
573575      {
574         hd63484_ram_w(hd63484, i + 0x40000/2, rom[i], 0xffff);
576         hd63484_ram_w(hd63484, space, i + 0x40000/2, rom[i], 0xffff);
575577      }
576578   }
577579}
trunk/src/mame/drivers/dynadice.c
r17961r17962
9393
9494*/
9595   if ((data & 7) == 7)
96      ay8910_address_w(device, 0, m_ay_data);
96      ay8910_address_w(device, space, 0, m_ay_data);
9797
9898   if ((data & 7) == 6)
99      ay8910_data_w(device, 0, m_ay_data);
99      ay8910_data_w(device, space, 0, m_ay_data);
100100}
101101
102102
trunk/src/mame/drivers/darius.c
r17961r17962
177177   switch (offset)
178178   {
179179      case 0x01:
180         return (tc0140syt_comm_r(m_tc0140syt, 0) & 0xff);   /* sound interface read */
180         return (tc0140syt_comm_r(m_tc0140syt, space, 0) & 0xff);   /* sound interface read */
181181
182182      case 0x04:
183183         return ioport("P1")->read();
r17961r17962
207207   {
208208      case 0x00:   /* sound interface write */
209209
210         tc0140syt_port_w(m_tc0140syt, 0, data & 0xff);
210         tc0140syt_port_w(m_tc0140syt, space, 0, data & 0xff);
211211         return;
212212
213213      case 0x01:   /* sound interface write */
214214
215         tc0140syt_comm_w(m_tc0140syt, 0, data & 0xff);
215         tc0140syt_comm_w(m_tc0140syt, space, 0, data & 0xff);
216216         return;
217217
218218      case 0x28:   /* unknown, written by both cpus - always 0? */
trunk/src/mame/drivers/kinst.c
r17961r17962
304304READ32_MEMBER(kinst_state::kinst_ide_r)
305305{
306306   device_t *device = machine().device("ide");
307   return midway_ide_asic_r(device, offset / 2, mem_mask);
307   return midway_ide_asic_r(device, space, offset / 2, mem_mask);
308308}
309309
310310
311311WRITE32_MEMBER(kinst_state::kinst_ide_w)
312312{
313313   device_t *device = machine().device("ide");
314   midway_ide_asic_w(device, offset / 2, data, mem_mask);
314   midway_ide_asic_w(device, space, offset / 2, data, mem_mask);
315315}
316316
317317
318318READ32_MEMBER(kinst_state::kinst_ide_extra_r)
319319{
320320   device_t *device = machine().device("ide");
321   return ide_controller32_r(device, 0x3f6/4, 0x00ff0000) >> 16;
321   return ide_controller32_r(device, space, 0x3f6/4, 0x00ff0000) >> 16;
322322}
323323
324324
325325WRITE32_MEMBER(kinst_state::kinst_ide_extra_w)
326326{
327327   device_t *device = machine().device("ide");
328   ide_controller32_w(device, 0x3f6/4, data << 16, 0x00ff0000);
328   ide_controller32_w(device, space, 0x3f6/4, data << 16, 0x00ff0000);
329329}
330330
331331
trunk/src/mame/drivers/snesb.c
r17961r17962
247247
248248static READ8_DEVICE_HANDLER( spc_ram_100_r )
249249{
250   return spc_ram_r(device, offset + 0x100);
250   return spc_ram_r(device, space, offset + 0x100);
251251}
252252
253253static WRITE8_DEVICE_HANDLER( spc_ram_100_w )
254254{
255   spc_ram_w(device, offset + 0x100, data);
255   spc_ram_w(device, space, offset + 0x100, data);
256256}
257257
258258static ADDRESS_MAP_START( spc_mem, AS_PROGRAM, 8, snesb_state )
trunk/src/mame/drivers/toaplan2.c
r17961r17962
855855{
856856   nmk112_device *nmk112 = machine().device<nmk112_device>("nmk112");
857857
858   nmk112_okibank_w(nmk112, offset,     data        & 0x0f);
859   nmk112_okibank_w(nmk112, offset + 1, (data >> 4) & 0x0f);
858   nmk112_okibank_w(nmk112, space, offset,     data        & 0x0f);
859   nmk112_okibank_w(nmk112, space, offset + 1, (data >> 4) & 0x0f);
860860}
861861
862862
trunk/src/mame/drivers/wecleman.c
r17961r17962
707707READ8_MEMBER(wecleman_state::hotchase_1_k007232_r)
708708{
709709   device_t *device = machine().device("konami1");
710   return k007232_r(device, offset ^ 1);
710   return k007232_r(device, space, offset ^ 1);
711711}
712712
713713WRITE8_MEMBER(wecleman_state::hotchase_1_k007232_w)
714714{
715715   device_t *device = machine().device("konami1");
716   k007232_w(device, offset ^ 1, data);
716   k007232_w(device, space, offset ^ 1, data);
717717}
718718
719719READ8_MEMBER(wecleman_state::hotchase_2_k007232_r)
720720{
721721   device_t *device = machine().device("konami2");
722   return k007232_r(device, offset ^ 1);
722   return k007232_r(device, space, offset ^ 1);
723723}
724724
725725WRITE8_MEMBER(wecleman_state::hotchase_2_k007232_w)
726726{
727727   device_t *device = machine().device("konami2");
728   k007232_w(device, offset ^ 1, data);
728   k007232_w(device, space, offset ^ 1, data);
729729}
730730
731731READ8_MEMBER(wecleman_state::hotchase_3_k007232_r)
732732{
733733   device_t *device = machine().device("konami3");
734   return k007232_r(device, offset ^ 1);
734   return k007232_r(device, space, offset ^ 1);
735735}
736736
737737WRITE8_MEMBER(wecleman_state::hotchase_3_k007232_w)
738738{
739739   device_t *device = machine().device("konami3");
740   k007232_w(device, offset ^ 1, data);
740   k007232_w(device, space, offset ^ 1, data);
741741}
742742
743743static ADDRESS_MAP_START( hotchase_sound_map, AS_PROGRAM, 8, wecleman_state )
trunk/src/mame/drivers/crbaloon.c
r17961r17962
167167   machine().sound().system_enable((data & 0x02) ? TRUE : FALSE);
168168
169169   /* D2 - unlabeled - music enable */
170   crbaloon_audio_set_music_enable(discrete, 0, (data & 0x04) ? TRUE : FALSE);
170   crbaloon_audio_set_music_enable(discrete, space, 0, (data & 0x04) ? TRUE : FALSE);
171171
172172   /* D3 - EXPLOSION */
173173   crbaloon_audio_set_explosion_enable(sn, (data & 0x08) ? TRUE : FALSE);
r17961r17962
179179   crbaloon_audio_set_appear_enable(sn, (data & 0x20) ? TRUE : FALSE);
180180
181181   /* D6 - unlabeled - laugh enable */
182   crbaloon_audio_set_laugh_enable(discrete, 0, (data & 0x40) ? TRUE : FALSE);
182   crbaloon_audio_set_laugh_enable(discrete, space, 0, (data & 0x40) ? TRUE : FALSE);
183183
184184   /* D7 - unlabeled - goes to PC3259 pin 16 */
185185
r17961r17962
339339
340340void crbaloon_state::machine_reset()
341341{
342   address_space *space = machine().device("maincpu")->memory().space(AS_IO);
342   address_space &space = *machine().device("maincpu")->memory().space(AS_IO);
343343   device_t *discrete = machine().device("discrete");
344344
345345   pc3092_reset();
346   port_sound_w(*space, 0, 0);
347   crbaloon_audio_set_music_freq(discrete, 0, 0);
346   port_sound_w(space, 0, 0);
347   crbaloon_audio_set_music_freq(discrete, space, 0, 0);
348348}
349349
350350
trunk/src/mame/drivers/munchmo.c
r17961r17962
7474READ8_MEMBER(munchmo_state::munchmo_ay1reset_r)
7575{
7676   device_t *device = machine().device("ay1");
77   ay8910_reset_w(device,0,0);
77   ay8910_reset_w(device,space,0,0);
7878   return 0;
7979}
8080
8181READ8_MEMBER(munchmo_state::munchmo_ay2reset_r)
8282{
8383   device_t *device = machine().device("ay2");
84   ay8910_reset_w(device,0,0);
84   ay8910_reset_w(device,space,0,0);
8585   return 0;
8686}
8787/*************************************
trunk/src/mame/drivers/voyager.c
r17961r17962
7878READ8_MEMBER(voyager_state::at_dma8237_2_r)
7979{
8080   device_t *device = machine().device("dma8237_2");
81   return i8237_r(device, offset / 2);
81   return i8237_r(device, space, offset / 2);
8282}
8383
8484WRITE8_MEMBER(voyager_state::at_dma8237_2_w)
8585{
8686   device_t *device = machine().device("dma8237_2");
87   i8237_w(device, offset / 2, data);
87   i8237_w(device, space, offset / 2, data);
8888}
8989
9090READ8_MEMBER(voyager_state::at_page8_r)
r17961r17962
192192READ32_MEMBER(voyager_state::ide_r)
193193{
194194   device_t *device = machine().device("ide");
195   return ide_controller32_r(device, 0x1f0/4 + offset, mem_mask);
195   return ide_controller32_r(device, space, 0x1f0/4 + offset, mem_mask);
196196}
197197
198198WRITE32_MEMBER(voyager_state::ide_w)
199199{
200200   device_t *device = machine().device("ide");
201   ide_controller32_w(device, 0x1f0/4 + offset, data, mem_mask);
201   ide_controller32_w(device, space, 0x1f0/4 + offset, data, mem_mask);
202202}
203203
204204
r17961r17962
208208READ32_MEMBER(voyager_state::fdc_r)
209209{
210210   device_t *device = machine().device("ide");
211   return ide_controller32_r(device, 0x3f0/4 + offset, mem_mask);
211   return ide_controller32_r(device, space, 0x3f0/4 + offset, mem_mask);
212212}
213213
214214WRITE32_MEMBER(voyager_state::fdc_w)
215215{
216216   device_t *device = machine().device("ide");
217217   //mame_printf_debug("FDC: write %08X, %08X, %08X\n", data, offset, mem_mask);
218   ide_controller32_w(device, 0x3f0/4 + offset, data, mem_mask);
218   ide_controller32_w(device, space, 0x3f0/4 + offset, data, mem_mask);
219219}
220220
221221
trunk/src/mame/drivers/centiped.c
r17961r17962
736736WRITE8_MEMBER(centiped_state::caterplr_AY8910_w)
737737{
738738   device_t *device = machine().device("pokey");
739   ay8910_address_w(device, 0, offset);
740   ay8910_data_w(device, 0, data);
739   ay8910_address_w(device, space, 0, offset);
740   ay8910_data_w(device, space, 0, data);
741741}
742742
743743READ8_MEMBER(centiped_state::caterplr_AY8910_r)
744744{
745745   device_t *device = machine().device("pokey");
746   ay8910_address_w(device, 0, offset);
747   return ay8910_r(device, 0);
746   ay8910_address_w(device, space, 0, offset);
747   return ay8910_r(device, space, 0);
748748}
749749
750750
trunk/src/mame/drivers/wgp.c
r17961r17962
621621{
622622
623623   if (offset == 0)
624      tc0140syt_port_w(m_tc0140syt, 0, data & 0xff);
624      tc0140syt_port_w(m_tc0140syt, space, 0, data & 0xff);
625625   else if (offset == 1)
626      tc0140syt_comm_w(m_tc0140syt, 0, data & 0xff);
626      tc0140syt_comm_w(m_tc0140syt, space, 0, data & 0xff);
627627}
628628
629629READ16_MEMBER(wgp_state::wgp_sound_r)
630630{
631631
632632   if (offset == 1)
633      return ((tc0140syt_comm_r(m_tc0140syt, 0) & 0xff));
633      return ((tc0140syt_comm_r(m_tc0140syt, space, 0) & 0xff));
634634   else
635635      return 0;
636636}
trunk/src/mame/drivers/metro.c
r17961r17962
370370   {
371371      if (!BIT(data, 2))
372372      {
373         ym2413_w(m_ymsnd, BIT(data, 1), m_porta);
373         ym2413_w(m_ymsnd, space, BIT(data, 1), m_porta);
374374      }
375375      m_portb = data;
376376      return;
r17961r17962
412412      if (!BIT(data, 2))
413413      {
414414         /* write */
415         ym2151_w(m_ymsnd, BIT(data, 1), m_porta);
415         ym2151_w(m_ymsnd, space, BIT(data, 1), m_porta);
416416      }
417417
418418      if (!BIT(data, 3))
419419      {
420420         /* read */
421         m_porta = ym2151_r(m_ymsnd, BIT(data, 1));
421         m_porta = ym2151_r(m_ymsnd, space, BIT(data, 1));
422422      }
423423
424424      m_portb = data;
trunk/src/mame/drivers/surpratk.c
r17961r17962
3636         return m_generic_paletteram_8[offset];
3737   }
3838   else if (m_videobank & 0x01)
39      return k053245_r(m_k053244, offset);
39      return k053245_r(m_k053244, space, offset);
4040   else
4141      return m_ram[offset];
4242}
r17961r17962
5252         paletteram_xBBBBBGGGGGRRRRR_byte_be_w(space,offset,data);
5353   }
5454   else if (m_videobank & 0x01)
55      k053245_w(m_k053244, offset, data);
55      k053245_w(m_k053244, space, offset, data);
5656   else
5757      m_ram[offset] = data;
5858}
trunk/src/mame/drivers/zaccaria.c
r17961r17962
112112
113113READ8_MEMBER(zaccaria_state::zaccaria_port0a_r)
114114{
115   return ay8910_r(machine().device((m_active_8910 == 0) ? "ay1" : "ay2"), 0);
115   return ay8910_r(machine().device((m_active_8910 == 0) ? "ay1" : "ay2"), space, 0);
116116}
117117
118118WRITE8_MEMBER(zaccaria_state::zaccaria_port0a_w)
r17961r17962
127127   if ((m_last_port0b & 0x02) == 0x02 && (data & 0x02) == 0x00)
128128   {
129129      /* bit 0 goes to the 8910 #0 BC1 pin */
130      ay8910_data_address_w(machine().device("ay1"), m_last_port0b, m_port0a);
130      ay8910_data_address_w(machine().device("ay1"), space, m_last_port0b, m_port0a);
131131   }
132132   else if ((m_last_port0b & 0x02) == 0x00 && (data & 0x02) == 0x02)
133133   {
r17961r17962
139139   if ((m_last_port0b & 0x08) == 0x08 && (data & 0x08) == 0x00)
140140   {
141141      /* bit 2 goes to the 8910 #1 BC1 pin */
142      ay8910_data_address_w(machine().device("ay2"), m_last_port0b >> 2, m_port0a);
142      ay8910_data_address_w(machine().device("ay2"), space, m_last_port0b >> 2, m_port0a);
143143   }
144144   else if ((m_last_port0b & 0x08) == 0x00 && (data & 0x08) == 0x08)
145145   {
trunk/src/mame/drivers/atarisy2.c
r17961r17962
764764{
765765   if (m_has_tms5220)
766766   {
767      tms5220_data_w(machine().device("tms"), 0, data);
767      tms5220_data_w(machine().device("tms"), space, 0, data);
768768   }
769769}
770770
trunk/src/mame/drivers/skydiver.c
r17961r17962
149149   device_t *discrete = device->machine().device("discrete");
150150
151151   /* Convert range data to divide value and write to sound */
152   discrete_sound_w(discrete, SKYDIVER_RANGE_DATA, (0x01 << (~state->m_videoram[0x394] & 0x07)) & 0xff);   // Range 0-2
152   address_space &space = *device->machine().firstcpu->space(AS_PROGRAM);
153   discrete_sound_w(discrete, space, SKYDIVER_RANGE_DATA, (0x01 << (~state->m_videoram[0x394] & 0x07)) & 0xff);   // Range 0-2
153154
154   discrete_sound_w(discrete, SKYDIVER_RANGE3_EN,  state->m_videoram[0x394] & 0x08);      // Range 3 - note disable
155   discrete_sound_w(discrete, SKYDIVER_NOTE_DATA, ~state->m_videoram[0x395] & 0xff);      // Note - freq
156   discrete_sound_w(discrete, SKYDIVER_NOISE_DATA,  state->m_videoram[0x396] & 0x0f);   // NAM - Noise Amplitude
155   discrete_sound_w(discrete, space, SKYDIVER_RANGE3_EN,  state->m_videoram[0x394] & 0x08);      // Range 3 - note disable
156   discrete_sound_w(discrete, space, SKYDIVER_NOTE_DATA, ~state->m_videoram[0x395] & 0xff);      // Note - freq
157   discrete_sound_w(discrete, space, SKYDIVER_NOISE_DATA,  state->m_videoram[0x396] & 0x0f);   // NAM - Noise Amplitude
157158
158159   if (state->m_nmion)
159160      device->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
r17961r17962
170171WRITE8_MEMBER(skydiver_state::skydiver_sound_enable_w)
171172{
172173   device_t *device = machine().device("discrete");
173   discrete_sound_w(device, SKYDIVER_SOUND_EN, offset);
174   discrete_sound_w(device, space, SKYDIVER_SOUND_EN, offset);
174175}
175176
176177WRITE8_MEMBER(skydiver_state::skydiver_whistle_w)
177178{
178179   device_t *device = machine().device("discrete");
179   discrete_sound_w(device, NODE_RELATIVE(SKYDIVER_WHISTLE1_EN, (offset >> 1)), offset & 0x01);
180   discrete_sound_w(device, space, NODE_RELATIVE(SKYDIVER_WHISTLE1_EN, (offset >> 1)), offset & 0x01);
180181}
181182
182183
trunk/src/mame/drivers/warpwarp.c
r17961r17962
184184         /* n.c. */
185185         break;
186186      case 3:
187         geebee_sound_w(machine().device("geebee"),0,data);
187         geebee_sound_w(machine().device("geebee"),space,0,data);
188188         break;
189189   }
190190}
r17961r17962
268268         m_ball_v = data;
269269         break;
270270      case 2:
271         warpwarp_sound_w(machine().device("warpwarp"),0,data);
271         warpwarp_sound_w(machine().device("warpwarp"),space,0,data);
272272         break;
273273      case 3:
274274         watchdog_reset_w(space,0,data);
trunk/src/mame/drivers/seta.c
r17961r17962
22802280WRITE16_MEMBER(seta_state::setaroul_spriteylow_w)
22812281{
22822282   seta001_device *dev = machine().device<seta001_device>("spritegen");
2283   if ((offset&1)==0) spriteylow_w8(dev, offset>>1, (data & 0xff00) >> 8);
2283   if ((offset&1)==0) spriteylow_w8(dev, space, offset>>1, (data & 0xff00) >> 8);
22842284}
22852285
22862286WRITE16_MEMBER(seta_state::setaroul_spritectrl_w)
22872287{
22882288   seta001_device *dev = machine().device<seta001_device>("spritegen");
2289   if ((offset&1)==0) spritectrl_w8(dev, offset>>1, (data & 0xff00) >> 8);
2289   if ((offset&1)==0) spritectrl_w8(dev, space, offset>>1, (data & 0xff00) >> 8);
22902290}
22912291
22922292WRITE16_MEMBER(seta_state::setaroul_spritecode_w)
22932293{
22942294   seta001_device *dev = machine().device<seta001_device>("spritegen");
2295   if ((offset&1)==1) spritecodelow_w8(dev, offset>>1, (data & 0xff00) >> 8);
2296   if ((offset&1)==0) spritecodehigh_w8(dev, offset>>1, (data & 0xff00) >> 8);
2295   if ((offset&1)==1) spritecodelow_w8(dev, space, offset>>1, (data & 0xff00) >> 8);
2296   if ((offset&1)==0) spritecodehigh_w8(dev, space, offset>>1, (data & 0xff00) >> 8);
22972297}
22982298
22992299READ16_MEMBER(seta_state::setaroul_spritecode_r)
r17961r17962
23012301   UINT16 ret;
23022302   seta001_device *dev = machine().device<seta001_device>("spritegen");
23032303   if ((offset&1)==1)
2304      ret = spritecodelow_r8(dev, offset>>1);
2304      ret = spritecodelow_r8(dev, space, offset>>1);
23052305   else
2306      ret = spritecodehigh_r8(dev, offset>>1);
2306      ret = spritecodehigh_r8(dev, space, offset>>1);
23072307   return ret << 8;
23082308}
23092309
trunk/src/mame/drivers/laserbat.c
r17961r17962
582582READ8_MEMBER(laserbat_state::zaccaria_port0a_r)
583583{
584584   device_t *ay = (m_active_8910 == 0) ? m_ay1 : m_ay2;
585   return ay8910_r(ay, 0);
585   return ay8910_r(ay, space, 0);
586586}
587587
588588WRITE8_MEMBER(laserbat_state::zaccaria_port0a_w)
r17961r17962
596596   if ((m_last_port0b & 0x02) == 0x02 && (data & 0x02) == 0x00)
597597   {
598598      /* bit 0 goes to the 8910 #0 BC1 pin */
599      ay8910_data_address_w(m_ay1, m_last_port0b >> 0, m_port0a);
599      ay8910_data_address_w(m_ay1, space, m_last_port0b >> 0, m_port0a);
600600   }
601601   else if ((m_last_port0b & 0x02) == 0x00 && (data & 0x02) == 0x02)
602602   {
r17961r17962
608608   if ((m_last_port0b & 0x08) == 0x08 && (data & 0x08) == 0x00)
609609   {
610610      /* bit 2 goes to the 8910 #1 BC1 pin */
611      ay8910_data_address_w(m_ay2, m_last_port0b >> 2, m_port0a);
611      ay8910_data_address_w(m_ay2, space, m_last_port0b >> 2, m_port0a);
612612   }
613613   else if ((m_last_port0b & 0x08) == 0x00 && (data & 0x08) == 0x08)
614614   {
trunk/src/mame/drivers/queen.c
r17961r17962
380380READ32_MEMBER(queen_state::ide_r)
381381{
382382   device_t *device = machine().device("ide");
383   return ide_controller32_r(device, 0x1f0/4 + offset, mem_mask);
383   return ide_controller32_r(device, space, 0x1f0/4 + offset, mem_mask);
384384}
385385
386386WRITE32_MEMBER(queen_state::ide_w)
387387{
388388   device_t *device = machine().device("ide");
389   ide_controller32_w(device, 0x1f0/4 + offset, data, mem_mask);
389   ide_controller32_w(device, space, 0x1f0/4 + offset, data, mem_mask);
390390}
391391
392392READ32_MEMBER(queen_state::fdc_r)
393393{
394394   device_t *device = machine().device("ide");
395   return ide_controller32_r(device, 0x3f0/4 + offset, mem_mask);
395   return ide_controller32_r(device, space, 0x3f0/4 + offset, mem_mask);
396396}
397397
398398WRITE32_MEMBER(queen_state::fdc_w)
399399{
400400   device_t *device = machine().device("ide");
401401   //mame_printf_debug("FDC: write %08X, %08X, %08X\n", data, offset, mem_mask);
402   ide_controller32_w(device, 0x3f0/4 + offset, data, mem_mask);
402   ide_controller32_w(device, space, 0x3f0/4 + offset, data, mem_mask);
403403}
404404
405405READ8_MEMBER(queen_state::at_page8_r)
r17961r17962
448448READ8_MEMBER(queen_state::at_dma8237_2_r)
449449{
450450   device_t *device = machine().device("dma8237_2");
451   return i8237_r(device, offset / 2);
451   return i8237_r(device, space, offset / 2);
452452}
453453
454454WRITE8_MEMBER(queen_state::at_dma8237_2_w)
455455{
456456   device_t *device = machine().device("dma8237_2");
457   i8237_w(device, offset / 2, data);
457   i8237_w(device, space, offset / 2, data);
458458}
459459
460460WRITE_LINE_MEMBER(queen_state::pc_dma_hrq_changed)
trunk/src/mame/drivers/bishi.c
r17961r17962
138138   if (m_cur_control2 & 0x1000)
139139      ouroffs += 4;
140140
141   return k056832_bishi_rom_word_r(m_k056832, ouroffs, mem_mask);
141   return k056832_bishi_rom_word_r(m_k056832, space, ouroffs, mem_mask);
142142}
143143
144144static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, bishi_state )
trunk/src/mame/drivers/vmetal.c
r17961r17962
239239    16   002a 000e 0083 00ee 000f 0069 0069   0e832a-0f69ee
240240    */
241241
242   es8712_w(device, offset, data);
242   es8712_w(device, space, offset, data);
243243   logerror("%s:Writing %04x to ES8712 offset %02x\n", machine().describe_context(), data, offset);
244244}
245245
trunk/src/mame/drivers/mainevt.c
r17961r17962
140140   if (k052109_get_rmrd_line(m_k052109) == CLEAR_LINE)
141141   {
142142      if (offset >= 0x3800 && offset < 0x3808)
143         return k051937_r(m_k051960, offset - 0x3800);
143         return k051937_r(m_k051960, space, offset - 0x3800);
144144      else if (offset < 0x3c00)
145         return k052109_r(m_k052109, offset);
145         return k052109_r(m_k052109, space, offset);
146146      else
147         return k051960_r(m_k051960, offset - 0x3c00);
147         return k051960_r(m_k051960, space, offset - 0x3c00);
148148   }
149149   else
150      return k052109_r(m_k052109, offset);
150      return k052109_r(m_k052109, space, offset);
151151}
152152
153153WRITE8_MEMBER(mainevt_state::k052109_051960_w)
154154{
155155
156156   if (offset >= 0x3800 && offset < 0x3808)
157      k051937_w(m_k051960, offset - 0x3800, data);
157      k051937_w(m_k051960, space, offset - 0x3800, data);
158158   else if (offset < 0x3c00)
159      k052109_w(m_k052109, offset, data);
159      k052109_w(m_k052109, space, offset, data);
160160   else
161      k051960_w(m_k051960, offset - 0x3c00, data);
161      k051960_w(m_k051960, space, offset - 0x3c00, data);
162162}
163163
164164
trunk/src/mame/drivers/taito_h.c
r17961r17962
183183{
184184   /* Bypass TC0220IOC controller for analog input */
185185
186   UINT8   port = tc0220ioc_port_r(m_tc0220ioc, 0);   /* read port number */
186   UINT8   port = tc0220ioc_port_r(m_tc0220ioc, space, 0);   /* read port number */
187187
188188   switch( port )
189189   {
r17961r17962
224224            return 0x00;
225225
226226      default:
227         return tc0220ioc_portreg_r(m_tc0220ioc, offset);
227         return tc0220ioc_portreg_r(m_tc0220ioc, space, offset);
228228   }
229229}
230230
trunk/src/mame/drivers/slapshot.c
r17961r17962
198198              (ioport("SERVICE")->read() & 0x10))  << 8;   /* IN3 + service switch */
199199
200200      default:
201         return tc0640fio_r(m_tc0640fio, offset) << 8;
201         return tc0640fio_r(m_tc0640fio, space, offset) << 8;
202202   }
203203}
204204
r17961r17962
259259WRITE16_MEMBER(slapshot_state::slapshot_msb_sound_w)
260260{
261261   if (offset == 0)
262      tc0140syt_port_w(m_tc0140syt, 0, (data >> 8) & 0xff);
262      tc0140syt_port_w(m_tc0140syt, space, 0, (data >> 8) & 0xff);
263263   else if (offset == 1)
264      tc0140syt_comm_w(m_tc0140syt, 0, (data >> 8) & 0xff);
264      tc0140syt_comm_w(m_tc0140syt, space, 0, (data >> 8) & 0xff);
265265
266266#ifdef MAME_DEBUG
267267   if (data & 0xff)
r17961r17962
272272READ16_MEMBER(slapshot_state::slapshot_msb_sound_r)
273273{
274274   if (offset == 1)
275      return ((tc0140syt_comm_r(m_tc0140syt, 0) & 0xff) << 8);
275      return ((tc0140syt_comm_r(m_tc0140syt, space, 0) & 0xff) << 8);
276276   else
277277      return 0;
278278}
trunk/src/mame/drivers/vsnes.c
r17961r17962
196196READ8_MEMBER(vsnes_state::psg1_4015_r)
197197{
198198   device_t *device = machine().device("nes1");
199   return nes_psg_r(device, 0x15);
199   return nes_psg_r(device, space, 0x15);
200200}
201201
202202WRITE8_MEMBER(vsnes_state::psg1_4015_w)
203203{
204204   device_t *device = machine().device("nes1");
205   nes_psg_w(device, 0x15, data);
205   nes_psg_w(device, space, 0x15, data);
206206}
207207
208208WRITE8_MEMBER(vsnes_state::psg1_4017_w)
209209{
210210   device_t *device = machine().device("nes1");
211   nes_psg_w(device, 0x17, data);
211   nes_psg_w(device, space, 0x17, data);
212212}
213213
214214READ8_MEMBER(vsnes_state::psg2_4015_r)
215215{
216216   device_t *device = machine().device("nes2");
217   return nes_psg_r(device, 0x15);
217   return nes_psg_r(device, space, 0x15);
218218}
219219
220220WRITE8_MEMBER(vsnes_state::psg2_4015_w)
221221{
222222   device_t *device = machine().device("nes2");
223   nes_psg_w(device, 0x15, data);
223   nes_psg_w(device, space, 0x15, data);
224224}
225225
226226WRITE8_MEMBER(vsnes_state::psg2_4017_w)
227227{
228228   device_t *device = machine().device("nes2");
229   nes_psg_w(device, 0x17, data);
229   nes_psg_w(device, space, 0x17, data);
230230}
231231static ADDRESS_MAP_START( vsnes_cpu1_map, AS_PROGRAM, 8, vsnes_state )
232232   AM_RANGE(0x0000, 0x07ff) AM_MIRROR(0x1800) AM_RAM AM_SHARE("work_ram")
trunk/src/mame/drivers/cninja.c
r17961r17962
149149WRITE16_MEMBER(cninja_state::cninja_pf12_control_w)
150150{
151151   machine().primary_screen->update_partial(machine().primary_screen->vpos());
152   deco16ic_pf_control_w(m_deco_tilegen1, offset, data, mem_mask);
152   deco16ic_pf_control_w(m_deco_tilegen1, space, offset, data, mem_mask);
153153}
154154
155155
156156WRITE16_MEMBER(cninja_state::cninja_pf34_control_w)
157157{
158158   machine().primary_screen->update_partial(machine().primary_screen->vpos());
159   deco16ic_pf_control_w(m_deco_tilegen2, offset, data, mem_mask);
159   deco16ic_pf_control_w(m_deco_tilegen2, space, offset, data, mem_mask);
160160}
161161
162162
trunk/src/mame/drivers/dogfgt.c
r17961r17962
4646
4747   /* bit 5 goes to 8910 #0 BDIR pin  */
4848   if ((m_last_snd_ctrl & 0x20) == 0x20 && (data & 0x20) == 0x00)
49      ay8910_data_address_w(machine().device("ay1"), m_last_snd_ctrl >> 4, m_soundlatch);
49      ay8910_data_address_w(machine().device("ay1"), space, m_last_snd_ctrl >> 4, m_soundlatch);
5050
5151   /* bit 7 goes to 8910 #1 BDIR pin  */
5252   if ((m_last_snd_ctrl & 0x80) == 0x80 && (data & 0x80) == 0x00)
53      ay8910_data_address_w(machine().device("ay2"), m_last_snd_ctrl >> 6, m_soundlatch);
53      ay8910_data_address_w(machine().device("ay2"), space, m_last_snd_ctrl >> 6, m_soundlatch);
5454
5555   m_last_snd_ctrl = data;
5656}
trunk/src/mame/drivers/m63.c
r17961r17962
390390{
391391
392392   if ((m_p2 & 0xf0) == 0xe0)
393      ay8910_address_w(m_ay1, 0, offset);
393      ay8910_address_w(m_ay1, space, 0, offset);
394394   else if ((m_p2 & 0xf0) == 0xa0)
395      ay8910_data_w(m_ay1, 0, offset);
395      ay8910_data_w(m_ay1, space, 0, offset);
396396   else if (m_ay2 != NULL && (m_p1 & 0xe0) == 0x60)
397      ay8910_address_w(m_ay2, 0, offset);
397      ay8910_address_w(m_ay2, space, 0, offset);
398398   else if (m_ay2 != NULL && (m_p1 & 0xe0) == 0x40)
399       ay8910_data_w(m_ay2, 0, offset);
399       ay8910_data_w(m_ay2, space, 0, offset);
400400   else if ((m_p2 & 0xf0) == 0x70 )
401401      m_sound_status = offset;
402402}
trunk/src/mame/drivers/dambustr.c
r17961r17962
7373   device_t *device = machine().device("GAL_AUDIO");
7474   if (data != m_noise_data) {
7575      m_noise_data = data;
76      galaxian_noise_enable_w(device, offset, data);
76      galaxian_noise_enable_w(device, space, offset, data);
7777   }
7878}
7979
trunk/src/mame/drivers/gbusters.c
r17961r17962
127127   if (k052109_get_rmrd_line(m_k052109) == CLEAR_LINE)
128128   {
129129      if (offset >= 0x3800 && offset < 0x3808)
130         return k051937_r(m_k051960, offset - 0x3800);
130         return k051937_r(m_k051960, space, offset - 0x3800);
131131      else if (offset < 0x3c00)
132         return k052109_r(m_k052109, offset);
132         return k052109_r(m_k052109, space, offset);
133133      else
134         return k051960_r(m_k051960, offset - 0x3c00);
134         return k051960_r(m_k051960, space, offset - 0x3c00);
135135   }
136136   else
137      return k052109_r(m_k052109, offset);
137      return k052109_r(m_k052109, space, offset);
138138}
139139
140140WRITE8_MEMBER(gbusters_state::k052109_051960_w)
141141{
142142
143143   if (offset >= 0x3800 && offset < 0x3808)
144      k051937_w(m_k051960, offset - 0x3800, data);
144      k051937_w(m_k051960, space, offset - 0x3800, data);
145145   else if (offset < 0x3c00)
146      k052109_w(m_k052109, offset, data);
146      k052109_w(m_k052109, space, offset, data);
147147   else
148      k051960_w(m_k051960, offset - 0x3c00, data);
148      k051960_w(m_k051960, space, offset - 0x3c00, data);
149149}
150150
151151
trunk/src/mame/drivers/bogeyman.c
r17961r17962
3434
3535   // bit 5 goes to 8910 #0 BDIR pin
3636   if ((m_last_write & 0x20) == 0x20 && (data & 0x20) == 0x00)
37      ay8910_data_address_w(machine().device("ay1"), m_last_write >> 4, m_psg_latch);
37      ay8910_data_address_w(machine().device("ay1"), space, m_last_write >> 4, m_psg_latch);
3838
3939   // bit 7 goes to 8910 #1 BDIR pin
4040   if ((m_last_write & 0x80) == 0x80 && (data & 0x80) == 0x00)
41      ay8910_data_address_w(machine().device("ay2"), m_last_write >> 6, m_psg_latch);
41      ay8910_data_address_w(machine().device("ay2"), space, m_last_write >> 6, m_psg_latch);
4242
4343   m_last_write = data;
4444}
trunk/src/mame/drivers/m72.c
r17961r17962
437437static INTERRUPT_GEN(fake_nmi)
438438{
439439   m72_state *state = device->machine().driver_data<m72_state>();
440   int sample = m72_sample_r(state->m_audio,0);
440   address_space &space = state->generic_space();
441   int sample = m72_sample_r(state->m_audio,space,0);
441442   if (sample)
442      m72_sample_w(state->m_audio,0,sample);
443      m72_sample_w(state->m_audio,space,0,sample);
443444}
444445
445446
trunk/src/mame/drivers/r2dtank.c
r17961r17962
175175   UINT8 ret = 0;
176176
177177   if (m_AY8910_selected & 0x08)
178      ret = ay8910_r(machine().device("ay1"), 0);
178      ret = ay8910_r(machine().device("ay1"), space, 0);
179179
180180   if (m_AY8910_selected & 0x10)
181      ret = ay8910_r(machine().device("ay2"), 0);
181      ret = ay8910_r(machine().device("ay2"), space, 0);
182182
183183   return ret;
184184}
r17961r17962
187187WRITE8_MEMBER(r2dtank_state::AY8910_port_w)
188188{
189189   if (m_AY8910_selected & 0x08)
190      ay8910_data_address_w(machine().device("ay1"), m_AY8910_selected >> 2, data);
190      ay8910_data_address_w(machine().device("ay1"), space, m_AY8910_selected >> 2, data);
191191
192192   if (m_AY8910_selected & 0x10)
193      ay8910_data_address_w(machine().device("ay2"), m_AY8910_selected >> 2, data);
193      ay8910_data_address_w(machine().device("ay2"), space, m_AY8910_selected >> 2, data);
194194}
195195
196196
r17961r17962
252252   1,               /* A pin - driven by the CRTC */
253253   1,               /* B pin - pulled high */
254254   1,               /* Clear pin - pulled high */
255   ttl74123_output_changed
255   DEVCB_HANDLER(ttl74123_output_changed)
256256};
257257
258258
r17961r17962
387387
388388WRITE_LINE_MEMBER(r2dtank_state::display_enable_changed)
389389{
390   ttl74123_a_w(machine().device("74123"), 0, state);
390   address_space &space = generic_space();
391   ttl74123_a_w(machine().device("74123"), space, 0, state);
391392}
392393
393394
trunk/src/mame/drivers/topspeed.c
r17961r17962
359359
360360READ8_MEMBER(topspeed_state::topspeed_input_bypass_r)
361361{
362   UINT8 port = tc0220ioc_port_r(m_tc0220ioc, 0);   /* read port number */
362   UINT8 port = tc0220ioc_port_r(m_tc0220ioc, space, 0);   /* read port number */
363363   UINT16 steer = 0xff80 + ioport("STEER")->read_safe(0);
364364
365365   switch (port)
r17961r17962
371371         return steer >> 8;
372372
373373      default:
374         return tc0220ioc_portreg_r(m_tc0220ioc, offset);
374         return tc0220ioc_portreg_r(m_tc0220ioc, space, offset);
375375   }
376376}
377377
r17961r17962
424424static WRITE8_DEVICE_HANDLER( topspeed_tc0140syt_comm_w )
425425{
426426   device->machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
427   tc0140syt_comm_w(device, 0, data);
427   tc0140syt_comm_w(device, space, 0, data);
428428}
429429
430430static void topspeed_msm5205_clock( device_t *device, int chip )
trunk/src/mame/drivers/amspdwy.c
r17961r17962
6565READ8_MEMBER(amspdwy_state::amspdwy_sound_r)
6666{
6767   device_t *device = machine().device("ymsnd");
68   return (ym2151_status_port_r(device, 0) & ~ 0x30) | machine().root_device().ioport("IN0")->read();
68   return (ym2151_status_port_r(device, space, 0) & ~ 0x30) | machine().root_device().ioport("IN0")->read();
6969}
7070
7171WRITE8_MEMBER(amspdwy_state::amspdwy_sound_w)
trunk/src/mame/drivers/aristmk4.c
r17961r17962
649649
650650   if (m_ay8910_1&0x03) // SW1 read.
651651   {
652   psg_ret = ay8910_r(machine().device("ay1"), 0);
652   psg_ret = ay8910_r(machine().device("ay1"), space, 0);
653653   //logerror("PSG porta ay1 returned %02X\n",psg_ret);
654654   }
655655
656656   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.
657657   {
658      psg_ret = ay8910_r(machine().device("ay2"), 0);
658      psg_ret = ay8910_r(machine().device("ay2"), space, 0);
659659      //logerror("PSG porta ay2 returned %02X\n",psg_ret);
660660   }
661661   return psg_ret;
r17961r17962
750750      break;
751751   case 0x06:   //WRITE
752752   {
753      ay8910_data_w( machine().device("ay1"), 0 , m_psg_data );
753      ay8910_data_w( machine().device("ay1"), space, 0 , m_psg_data );
754754      //logerror("VIA Port A write data ay1: %02X\n",m_psg_data);
755755      break;
756756   }
757757   case 0x07:   //LATCH Address (set register)
758758   {
759      ay8910_address_w( machine().device("ay1"), 0 , m_psg_data );
759      ay8910_address_w( machine().device("ay1"), space, 0 , m_psg_data );
760760      //logerror("VIA Port B write register ay1: %02X\n",m_psg_data);
761761      break;
762762   }
r17961r17962
777777      break;
778778   case 0x06:   //WRITE
779779   {
780      ay8910_data_w( machine().device("ay2"), 0 , m_psg_data );
780      ay8910_data_w( machine().device("ay2"), space, 0 , m_psg_data );
781781      //logerror("VIA Port A write data ay2: %02X\n",m_psg_data);
782782      break;
783783   }
784784   case 0x07:   //LATCH Address (set register)
785785   {
786      ay8910_address_w( machine().device("ay2"), 0 , m_psg_data );
786      ay8910_address_w( machine().device("ay2"), space, 0 , m_psg_data );
787787      //logerror("VIA Port B write register ay2: %02X\n",m_psg_data);
788788      break;
789789   }
trunk/src/mame/drivers/thunderx.c
r17961r17962
373373   if (k052109_get_rmrd_line(m_k052109) == CLEAR_LINE)
374374   {
375375      if (offset >= 0x3800 && offset < 0x3808)
376         return k051937_r(m_k051960, offset - 0x3800);
376         return k051937_r(m_k051960, space, offset - 0x3800);
377377      else if (offset < 0x3c00)
378         return k052109_r(m_k052109, offset);
378         return k052109_r(m_k052109, space, offset);
379379      else
380         return k051960_r(m_k051960, offset - 0x3c00);
380         return k051960_r(m_k051960, space, offset - 0x3c00);
381381   }
382382   else
383      return k052109_r(m_k052109, offset);
383      return k052109_r(m_k052109, space, offset);
384384}
385385
386386WRITE8_MEMBER(thunderx_state::k052109_051960_w)
387387{
388388
389389   if (offset >= 0x3800 && offset < 0x3808)
390      k051937_w(m_k051960, offset - 0x3800, data);
390      k051937_w(m_k051960, space, offset - 0x3800, data);
391391   else if (offset < 0x3c00)
392      k052109_w(m_k052109, offset, data);
392      k052109_w(m_k052109, space, offset, data);
393393   else
394      k051960_w(m_k051960, offset - 0x3c00, data);
394      k051960_w(m_k051960, space, offset - 0x3c00, data);
395395}
396396
397397/***************************************************************************/
trunk/src/mame/drivers/videopin.c
r17961r17962
155155   coin_lockout_global_w(machine(), ~data & 0x08);
156156
157157   /* Convert octave data to divide value and write to sound */
158   discrete_sound_w(device, VIDEOPIN_OCTAVE_DATA, (0x01 << (~data & 0x07)) & 0xfe);
158   discrete_sound_w(device, space, VIDEOPIN_OCTAVE_DATA, (0x01 << (~data & 0x07)) & 0xfe);
159159}
160160
161161
r17961r17962
173173
174174   coin_counter_w(machine(), 0, data & 0x10);
175175
176   discrete_sound_w(device, VIDEOPIN_BELL_EN, data & 0x40);   // Bell
177   discrete_sound_w(device, VIDEOPIN_BONG_EN, data & 0x20);   // Bong
178   discrete_sound_w(device, VIDEOPIN_ATTRACT_EN, data & 0x80);   // Attract
179   discrete_sound_w(device, VIDEOPIN_VOL_DATA, data & 0x07);      // Vol0,1,2
176   discrete_sound_w(device, space, VIDEOPIN_BELL_EN, data & 0x40);   // Bell
177   discrete_sound_w(device, space, VIDEOPIN_BONG_EN, data & 0x20);   // Bong
178   discrete_sound_w(device, space, VIDEOPIN_ATTRACT_EN, data & 0x80);   // Attract
179   discrete_sound_w(device, space, VIDEOPIN_VOL_DATA, data & 0x07);      // Vol0,1,2
180180}
181181
182182
r17961r17962
184184{
185185   device_t *device = machine().device("discrete");
186186   /* note data */
187   discrete_sound_w(device, VIDEOPIN_NOTE_DATA, ~data &0xff);
187   discrete_sound_w(device, space, VIDEOPIN_NOTE_DATA, ~data &0xff);
188188}
189189
190190
trunk/src/mame/drivers/cd32.c
r17961r17962
9292   /* bit 2 = Power Led on Amiga */
9393   set_led_status(machine(), 0, (data & 2) ? 0 : 1);
9494
95   handle_cd32_joystick_cia(machine(), data, mos6526_r(device, 2));
95   handle_cd32_joystick_cia(machine(), data, mos6526_r(device, space, 2));
9696}
9797
9898/*************************************
trunk/src/mame/drivers/ultratnk.c
r17961r17962
130130WRITE8_MEMBER(ultratnk_state::ultratnk_fire_1_w)
131131{
132132   device_t *device = machine().device("discrete");
133   discrete_sound_w(device, ULTRATNK_FIRE_EN_1, offset & 1);
133   discrete_sound_w(device, space, ULTRATNK_FIRE_EN_1, offset & 1);
134134}
135135WRITE8_MEMBER(ultratnk_state::ultratnk_fire_2_w)
136136{
137137   device_t *device = machine().device("discrete");
138   discrete_sound_w(device, ULTRATNK_FIRE_EN_2, offset & 1);
138   discrete_sound_w(device, space, ULTRATNK_FIRE_EN_2, offset & 1);
139139}
140140WRITE8_MEMBER(ultratnk_state::ultratnk_attract_w)
141141{
142142   device_t *device = machine().device("discrete");
143   discrete_sound_w(device, ULTRATNK_ATTRACT_EN, data & 1);
143   discrete_sound_w(device, space, ULTRATNK_ATTRACT_EN, data & 1);
144144}
145145WRITE8_MEMBER(ultratnk_state::ultratnk_explosion_w)
146146{
147147   device_t *device = machine().device("discrete");
148   discrete_sound_w(device, ULTRATNK_EXPLOSION_DATA, data & 15);
148   discrete_sound_w(device, space, ULTRATNK_EXPLOSION_DATA, data & 15);
149149}
150150
151151
trunk/src/mame/drivers/m90.c
r17961r17962
680680static INTERRUPT_GEN( fake_nmi )
681681{
682682   m90_state *state = device->machine().driver_data<m90_state>();
683   int sample = m72_sample_r(state->m_audio,0);
683   address_space &space = *device->machine().firstcpu->space(AS_PROGRAM);
684   int sample = m72_sample_r(state->m_audio,space,0);
684685   if (sample)
685      m72_sample_w(state->m_audio,0,sample);
686      m72_sample_w(state->m_audio,space,0,sample);
686687}
687688
688689static INTERRUPT_GEN( bomblord_fake_nmi )
689690{
690691   m90_state *state = device->machine().driver_data<m90_state>();
691   int sample = m72_sample_r(state->m_audio,0);
692   address_space &space = *device->machine().firstcpu->space(AS_PROGRAM);
693   int sample = m72_sample_r(state->m_audio,space,0);
692694   if (sample != 0x80)
693      m72_sample_w(state->m_audio,0,sample);
695      m72_sample_w(state->m_audio,space,0,sample);
694696}
695697
696698static INTERRUPT_GEN( m90_interrupt )
trunk/src/mame/drivers/vega.c
r17961r17962
167167      case 1: /* 04-07 */
168168      {
169169         /* AY 3-8910 */
170         ay8910_address_w(m_ay8910, 0, offset);
170         ay8910_address_w(m_ay8910, space, 0, offset);
171171      }
172172      break;
173173
r17961r17962
182182         else
183183         {
184184            //register w ?
185            ins8154_w(m_ins8154,offset&0x7f,data);
185            ins8154_w(m_ins8154,space,offset&0x7f,data);
186186         }
187187      }
188188      break;
r17961r17962
296296      case 1: /* 04-07 */
297297      {
298298         /* AY 3-8910 */
299         ay8910_data_w(m_ay8910, 0, offset);
299         ay8910_data_w(m_ay8910, space, 0, offset);
300300         return 0xff;//mame_rand(space->machine);
301301
302302      }
r17961r17962
313313         else
314314         {
315315            //register r ?
316            return ins8154_r(m_ins8154,offset&0x7f);
316            return ins8154_r(m_ins8154,space,offset&0x7f);
317317         }
318318
319319      }
trunk/src/mame/drivers/bfm_sc4h.c
r17961r17962
192192                     return 0x0000;//space.machine().rand();;
193193
194194                  case 0x1244:
195                     return ymz280b_r(m_ymz,0);
195                     return ymz280b_r(m_ymz,space,0);
196196
197197                  case 0x1246:
198                     return ymz280b_r(m_ymz,1);
198                     return ymz280b_r(m_ymz,space,1);
199199
200200                  default:
201201                     logerror("%08x maincpu read access offset %08x mem_mask %04x cs %d (LAMPS etc.)\n", pc, offset*2, mem_mask, cs);
r17961r17962
215215         if ((offset>=base) && (offset<end))
216216         {
217217            offset-=base;
218            return duart68681_r(m_duart,offset);
218            return duart68681_r(m_duart,space,offset);
219219         }
220220         else
221221         {
r17961r17962
336336                     break;
337337
338338                  case 0x1248:
339                     ymz280b_w(m_ymz,0, data & 0xff);
339                     ymz280b_w(m_ymz,space,0, data & 0xff);
340340                     break;
341341
342342                  case 0x124a:
343                     ymz280b_w(m_ymz,1, data & 0xff);
343                     ymz280b_w(m_ymz,space,1, data & 0xff);
344344                     break;
345345
346346                  case 0x1330:
r17961r17962
367367         if ((offset>=base) && (offset<end))
368368         {
369369            offset-=base;
370            duart68681_w(m_duart,offset,data&0x00ff);
370            duart68681_w(m_duart,space,offset,data&0x00ff);
371371         }
372372         else
373373         {
trunk/src/mame/drivers/djmain.c
r17961r17962
208208{
209209   device_t *k056832 = machine().device("k056832");
210210   UINT8 *mem8 = memregion("gfx2")->base();
211   int bank = k056832_word_r(k056832, 0x34/2, 0xffff);
211   int bank = k056832_word_r(k056832, space, 0x34/2, 0xffff);
212212
213213   offset *= 2;
214214
r17961r17962
280280{
281281   device_t *device = machine().device("ide");
282282   if (ACCESSING_BITS_0_7)
283      return ide_controller16_r(device, IDE_STD_OFFSET + offset, 0xff00) >> 8;
283      return ide_controller16_r(device, space, IDE_STD_OFFSET + offset, 0xff00) >> 8;
284284   else
285      return ide_controller16_r(device, IDE_STD_OFFSET + offset, 0xffff) << 16;
285      return ide_controller16_r(device, space, IDE_STD_OFFSET + offset, 0xffff) << 16;
286286}
287287
288288WRITE32_MEMBER(djmain_state::ide_std_w)
289289{
290290   device_t *device = machine().device("ide");
291291   if (ACCESSING_BITS_0_7)
292      ide_controller16_w(device, IDE_STD_OFFSET + offset, data << 8, 0xff00);
292      ide_controller16_w(device, space, IDE_STD_OFFSET + offset, data << 8, 0xff00);
293293   else
294      ide_controller16_w(device, IDE_STD_OFFSET + offset, data >> 16, 0xffff);
294      ide_controller16_w(device, space, IDE_STD_OFFSET + offset, data >> 16, 0xffff);
295295}
296296
297297
r17961r17962
299299{
300300   device_t *device = machine().device("ide");
301301   if (offset == 0)
302      return ide_controller16_r(device, IDE_ALT_OFFSET, 0x00ff) << 24;
302      return ide_controller16_r(device, space, IDE_ALT_OFFSET, 0x00ff) << 24;
303303
304304   return 0;
305305}
r17961r17962
308308{
309309   device_t *device = machine().device("ide");
310310   if (offset == 0 && ACCESSING_BITS_16_23)
311      ide_controller16_w(device, IDE_ALT_OFFSET, data >> 24, 0x00ff);
311      ide_controller16_w(device, space, IDE_ALT_OFFSET, data >> 24, 0x00ff);
312312}
313313
314314
trunk/src/mame/drivers/segas16a.c
r17961r17962
455455{
456456   // read from P2 - 8255's PC0-2 connects to 7751's S0-2 (P24-P26 on an 8048)
457457   // bit 0x80 is an alternate way to control the sample on/off; doesn't appear to be used
458   return 0x80 | ((m_n7751_command & 0x07) << 4) | (i8243_p2_r(m_n7751_i8243, offset) & 0x0f);
458   return 0x80 | ((m_n7751_command & 0x07) << 4) | (i8243_p2_r(m_n7751_i8243, space, offset) & 0x0f);
459459}
460460
461461
r17961r17962
466466WRITE8_MEMBER( segas16a_state::n7751_p2_w )
467467{
468468   // write to P2; low 4 bits go to 8243
469   i8243_p2_w(m_n7751_i8243, offset, data & 0x0f);
469   i8243_p2_w(m_n7751_i8243, space, offset, data & 0x0f);
470470
471471   // output of bit $80 indicates we are ready (1) or busy (0)
472472   // no other outputs are used
trunk/src/mame/drivers/neogeo.c
r17961r17962
426426   case 0x00: select_controller(machine(), data & 0x00ff); break;
427427   case 0x18: set_output_latch(machine(), data & 0x00ff); break;
428428   case 0x20: set_output_data(machine(), data & 0x00ff); break;
429   case 0x28: upd4990a_control_16_w(m_upd4990a, 0, data, mem_mask); break;
429   case 0x28: upd4990a_control_16_w(m_upd4990a, space, 0, data, mem_mask); break;
430430//  case 0x30: break; // coin counters
431431//  case 0x31: break; // coin counters
432432//  case 0x32: break; // coin lockout
r17961r17962
476476
477477CUSTOM_INPUT_MEMBER(neogeo_state::get_calendar_status)
478478{
479   return (upd4990a_databit_r(m_upd4990a, 0) << 1) | upd4990a_testbit_r(m_upd4990a, 0);
479   return (upd4990a_databit_r(m_upd4990a, generic_space(), 0) << 1) | upd4990a_testbit_r(m_upd4990a, generic_space(), 0);
480480}
481481
482482
trunk/src/mame/drivers/icecold.c
r17961r17962
221221WRITE8_MEMBER( icecold_state::snd_ctrl_w )
222222{
223223   if (m_ay_ctrl & ~data & 0x04)
224      ay8910_data_address_w(m_ay8910_0, m_ay_ctrl & 0x01, m_sound_latch);
224      ay8910_data_address_w(m_ay8910_0, space, m_ay_ctrl & 0x01, m_sound_latch);
225225   if (m_ay_ctrl & ~data & 0x20)
226      ay8910_data_address_w(m_ay8910_1, (m_ay_ctrl>>3) & 0x01, m_sound_latch);
226      ay8910_data_address_w(m_ay8910_1, space, (m_ay_ctrl>>3) & 0x01, m_sound_latch);
227227
228228   m_ay_ctrl = data;
229229}
r17961r17962
236236READ8_MEMBER( icecold_state::ay_r )
237237{
238238   if (m_ay_ctrl & 0x02)
239      return ay8910_r(m_ay8910_0, 0);
239      return ay8910_r(m_ay8910_0, space, 0);
240240   if (m_ay_ctrl & 0x10)
241      return ay8910_r(m_ay8910_1, 0);
241      return ay8910_r(m_ay8910_1, space, 0);
242242
243243   return 0;
244244}
trunk/src/mame/drivers/buggychl.c
r17961r17962
352352
353353static const msm5232_interface msm5232_config =
354354{
355   { 0.39e-6, 0.39e-6, 0.39e-6, 0.39e-6, 0.39e-6, 0.39e-6, 0.39e-6, 0.39e-6 }   /* default 0.39 uF capacitors (not verified) */
355   { 0.39e-6, 0.39e-6, 0.39e-6, 0.39e-6, 0.39e-6, 0.39e-6, 0.39e-6, 0.39e-6 },   /* default 0.39 uF capacitors (not verified) */
356   DEVCB_NULL
356357};
357358
358359
trunk/src/mame/drivers/starshp1.c
r17961r17962
3030   {
3131   case 0:
3232      m_attract = data;
33      discrete_sound_w(device, STARSHP1_ATTRACT, data);
33      discrete_sound_w(device, space, STARSHP1_ATTRACT, data);
3434      break;
3535   case 1:
3636      m_phasor = data;
37      discrete_sound_w(device, STARSHP1_PHASOR_ON, data);
37      discrete_sound_w(device, space, STARSHP1_PHASOR_ON, data);
3838      break;
3939   case 2:
40      discrete_sound_w(device, STARSHP1_KICKER, data);
40      discrete_sound_w(device, space, STARSHP1_KICKER, data);
4141      break;
4242   case 3:
43      discrete_sound_w(device, STARSHP1_SL1, data);
43      discrete_sound_w(device, space, STARSHP1_SL1, data);
4444      break;
4545   case 4:
46      discrete_sound_w(device, STARSHP1_SL2, data);
46      discrete_sound_w(device, space, STARSHP1_SL2, data);
4747      break;
4848   case 5:
49      discrete_sound_w(device, STARSHP1_MOLVL, data);
49      discrete_sound_w(device, space, STARSHP1_MOLVL, data);
5050      break;
5151   case 6:
52      discrete_sound_w(device, STARSHP1_NOISE_FREQ, data);
52      discrete_sound_w(device, space, STARSHP1_NOISE_FREQ, data);
5353      break;
5454   }
5555
r17961r17962
109109      m_ship_size = data;
110110      break;
111111   case 2:
112      discrete_sound_w(device, STARSHP1_NOISE_AMPLITUDE, data);
112      discrete_sound_w(device, space, STARSHP1_NOISE_AMPLITUDE, data);
113113      break;
114114   case 3:
115      discrete_sound_w(device, STARSHP1_TONE_PITCH, data);
115      discrete_sound_w(device, space, STARSHP1_TONE_PITCH, data);
116116      break;
117117   case 4:
118      discrete_sound_w(device, STARSHP1_MOTOR_SPEED, data);
118      discrete_sound_w(device, space, STARSHP1_MOTOR_SPEED, data);
119119      break;
120120   case 5:
121121      m_circle_hpos = data;
trunk/src/mame/drivers/asterix.c
r17961r17962
6767READ8_MEMBER(asterix_state::asterix_sound_r)
6868{
6969   device_t *device = machine().device("k053260");
70   return k053260_r(device, 2 + offset);
70   return k053260_r(device, space, 2 + offset);
7171}
7272
7373static TIMER_CALLBACK( nmi_callback )
trunk/src/mame/drivers/ppmast93.c
r17961r17962
217217   switch(offset&0xff)
218218   {
219219      case 0:
220      case 1: ym2413_w(machine().device("ymsnd"),offset,data); break;
220      case 1: ym2413_w(machine().device("ymsnd"),space,offset,data); break;
221221      case 2: machine().device<dac_device>("dac")->write_unsigned8(data);break;
222222      default: logerror("%x %x - %x\n",offset,data,space.device().safe_pcbase());
223223   }
trunk/src/mame/drivers/goldnpkr.c
r17961r17962
12721272{
12731273   if (wcfalcon_flag == 0)
12741274   {
1275      ay8910_data_address_w(machine().device("ay8910"), 0, data);
1275      ay8910_data_address_w(machine().device("ay8910"), space, 0, data);
12761276   }
12771277   else
12781278   {
1279      ay8910_data_address_w(machine().device("ay8910"), 1, data);
1279      ay8910_data_address_w(machine().device("ay8910"), space, 1, data);
12801280   }
12811281
12821282   wcfalcon_flag = wcfalcon_flag ^ 1;
r17961r17962
13611361   logerror("Sound Data: %2x\n",data & 0x0f);
13621362
13631363   /* discrete sound is connected to PIA1, portA: bits 0-3 */
1364   discrete_sound_w(device, NODE_01, data >> 3 & 0x01);
1365   discrete_sound_w(device, NODE_10, data & 0x07);
1364   discrete_sound_w(device, space, NODE_01, data >> 3 & 0x01);
1365   discrete_sound_w(device, space, NODE_10, data & 0x07);
13661366}
13671367
13681368
trunk/src/mame/drivers/taito_l.c
r17961r17962
487487{
488488   device_t *device = machine().device("ymsnd");
489489   m_extport = (offset >> 1) & 1;
490   return ym2203_r(device, offset & 1);
490   return ym2203_r(device, space, offset & 1);
491491}
492492
493493WRITE8_MEMBER(taitol_state::mcu_data_w)
trunk/src/mame/drivers/multigam.c
r17961r17962
242242READ8_MEMBER(multigam_state::psg_4015_r)
243243{
244244   device_t *device = machine().device("nes");
245   return nes_psg_r(device, 0x15);
245   return nes_psg_r(device, space, 0x15);
246246}
247247
248248WRITE8_MEMBER(multigam_state::psg_4015_w)
249249{
250250   device_t *device = machine().device("nes");
251   nes_psg_w(device, 0x15, data);
251   nes_psg_w(device, space, 0x15, data);
252252}
253253
254254WRITE8_MEMBER(multigam_state::psg_4017_w)
255255{
256256   device_t *device = machine().device("nes");
257   nes_psg_w(device, 0x17, data);
257   nes_psg_w(device, space, 0x17, data);
258258}
259259
260260/******************************************************
trunk/src/mame/drivers/mcr.c
r17961r17962
651651 *
652652 *************************************/
653653
654WRITE8_DEVICE_HANDLER( mcr_ipu_sio_transmit )
654WRITE16_DEVICE_HANDLER( mcr_ipu_sio_transmit )
655655{
656656   logerror("ipu_sio_transmit: %02X\n", data);
657657
trunk/src/mame/drivers/cham24.c
r17961r17962
148148READ8_MEMBER(cham24_state::psg_4015_r)
149149{
150150   device_t *device = machine().device("nes");
151   return nes_psg_r(device,0x15);
151   return nes_psg_r(device,space,0x15);
152152}
153153
154154WRITE8_MEMBER(cham24_state::psg_4015_w)
155155{
156156   device_t *device = machine().device("nes");
157   nes_psg_w(device,0x15, data);
157   nes_psg_w(device,space,0x15, data);
158158}
159159
160160WRITE8_MEMBER(cham24_state::psg_4017_w)
161161{
162162   device_t *device = machine().device("nes");
163   nes_psg_w(device,0x17, data);
163   nes_psg_w(device,space,0x17, data);
164164}
165165
166166
trunk/src/mame/drivers/rbmk.c
r17961r17962
141141{
142142   if(m_mux_data & 8)
143143   {
144      return ym2151_r(machine().device("ymsnd"), offset & 1);
144      return ym2151_r(machine().device("ymsnd"), space, offset & 1);
145145   }
146146   else if(m_mux_data & 4)
147147   {
r17961r17962
157157
158158WRITE8_MEMBER(rbmk_state::rbmk_mcu_io_w)
159159{
160   if(m_mux_data & 8) { ym2151_w(machine().device("ymsnd"), offset & 1, data); }
160   if(m_mux_data & 8) { ym2151_w(machine().device("ymsnd"), space, offset & 1, data); }
161161   else if(m_mux_data & 4)
162162   {
163163      //printf("%02x %02x W\n",offset,data);
trunk/src/mame/drivers/rpunch.c
r17961r17962
209209WRITE8_MEMBER(rpunch_state::upd_data_w)
210210{
211211   device_t *device = machine().device("upd");
212   upd7759_port_w(device, 0, data);
212   upd7759_port_w(device, space, 0, data);
213213   upd7759_start_w(device, 0);
214214   upd7759_start_w(device, 1);
215215}
trunk/src/mame/drivers/cubeqst.c
r17961r17962
393393
394394READ16_MEMBER(cubeqst_state::read_rotram)
395395{
396   return cubeqcpu_rotram_r(machine().device("rotate_cpu"), offset, mem_mask);
396   return cubeqcpu_rotram_r(machine().device("rotate_cpu"), space, offset, mem_mask);
397397}
398398
399399WRITE16_MEMBER(cubeqst_state::write_rotram)
400400{
401   cubeqcpu_rotram_w(machine().device("rotate_cpu"), offset, data, mem_mask);
401   cubeqcpu_rotram_w(machine().device("rotate_cpu"), space, offset, data, mem_mask);
402402}
403403
404404READ16_MEMBER(cubeqst_state::read_sndram)
405405{
406   return cubeqcpu_sndram_r(machine().device("sound_cpu"), offset, mem_mask);
406   return cubeqcpu_sndram_r(machine().device("sound_cpu"), space, offset, mem_mask);
407407}
408408
409409WRITE16_MEMBER(cubeqst_state::write_sndram)
410410{
411   cubeqcpu_sndram_w(machine().device("sound_cpu"), offset, data, mem_mask);
411   cubeqcpu_sndram_w(machine().device("sound_cpu"), space, offset, data, mem_mask);
412412}
413413
414414static ADDRESS_MAP_START( m68k_program_map, AS_PROGRAM, 16, cubeqst_state )
trunk/src/mame/drivers/savquest.c
r17961r17962
257257READ32_MEMBER(savquest_state::ide_r)
258258{
259259   device_t *device = machine().device("ide");
260   return ide_controller32_r(device, 0x1f0/4 + offset, mem_mask);
260   return ide_controller32_r(device, space, 0x1f0/4 + offset, mem_mask);
261261}
262262
263263WRITE32_MEMBER(savquest_state::ide_w)
264264{
265265   device_t *device = machine().device("ide");
266   ide_controller32_w(device, 0x1f0/4 + offset, data, mem_mask);
266   ide_controller32_w(device, space, 0x1f0/4 + offset, data, mem_mask);
267267}
268268
269269READ32_MEMBER(savquest_state::fdc_r)
270270{
271271   device_t *device = machine().device("ide");
272   return ide_controller32_r(device, 0x3f0/4 + offset, mem_mask);
272   return ide_controller32_r(device, space, 0x3f0/4 + offset, mem_mask);
273273}
274274
275275WRITE32_MEMBER(savquest_state::fdc_w)
276276{
277277   device_t *device = machine().device("ide");
278278   //mame_printf_debug("FDC: write %08X, %08X, %08X\n", data, offset, mem_mask);
279   ide_controller32_w(device, 0x3f0/4 + offset, data, mem_mask);
279   ide_controller32_w(device, space, 0x3f0/4 + offset, data, mem_mask);
280280}
281281
282282READ8_MEMBER(savquest_state::at_page8_r)
r17961r17962
325325READ8_MEMBER(savquest_state::at_dma8237_2_r)
326326{
327327   device_t *device = machine().device("dma8237_2");
328   return i8237_r(device, offset / 2);
328   return i8237_r(device, space, offset / 2);
329329}
330330
331331WRITE8_MEMBER(savquest_state::at_dma8237_2_w)
332332{
333333   device_t *device = machine().device("dma8237_2");
334   i8237_w(device, offset / 2, data);
334   i8237_w(device, space, offset / 2, data);
335335}
336336
337337WRITE_LINE_MEMBER(savquest_state::pc_dma_hrq_changed)
trunk/src/mame/drivers/mpu4hw.c
r17961r17962
11191119*/
11201120
11211121/* PSG function selected */
1122static void update_ay(device_t *device)
1122static void update_ay(device_t *device, address_space &space)
11231123{
11241124   device_t *ay = device->machine().device("ay8913");
11251125   if (!ay) return;
r17961r17962
11451145         {/* CA2 = 0 CB2 = 1? : Write to selected PSG register and write data to Port A */
11461146            pia6821_device *pia_ic6 = device->machine().device<pia6821_device>("pia_ic6");
11471147            device_t *ay = device->machine().device("ay8913");
1148            ay8910_data_w(ay, 0, pia_ic6->a_output());
1148            ay8910_data_w(ay, space, 0, pia_ic6->a_output());
11491149            LOG(("AY Chip Write \n"));
11501150            break;
11511151         }
r17961r17962
11541154             The register will remain selected until another is chosen.*/
11551155            pia6821_device *pia_ic6 = device->machine().device<pia6821_device>("pia_ic6");
11561156            device_t *ay = device->machine().device("ay8913");
1157            ay8910_address_w(ay, 0, pia_ic6->a_output());
1157            ay8910_address_w(ay, space, 0, pia_ic6->a_output());
11581158            LOG(("AY Chip Select \n"));
11591159            break;
11601160         }
r17961r17962
11701170WRITE_LINE_MEMBER(mpu4_state::pia_ic5_cb2_w)
11711171{
11721172   device_t *device = machine().device("pia_ic5");
1173   update_ay(device);
1173   update_ay(device, generic_space());
11741174}
11751175
11761176
r17961r17962
12291229   if (m_mod_number <4)
12301230   {
12311231      m_ay_data = data;
1232      update_ay(device);
1232      update_ay(device, space);
12331233   }
12341234}
12351235
r17961r17962
12421242   {
12431243      if ( state ) m_ay8913_address |=  0x01;
12441244      else         m_ay8913_address &= ~0x01;
1245      update_ay(device);
1245      update_ay(device, generic_space());
12461246   }
12471247}
12481248
r17961r17962
12551255   {
12561256      if ( state ) m_ay8913_address |=  0x02;
12571257      else         m_ay8913_address &= ~0x02;
1258      update_ay(device);
1258      update_ay(device, generic_space());
12591259   }
12601260}
12611261
r17961r17962
14611461{
14621462   device_t *msm6376 = machine().device("msm6376");
14631463   LOG_SS(("%s: GAMEBOARD: PIA Port A Set to %2x\n", machine().describe_context(),data));
1464   okim6376_w(msm6376, 0, data);
1464   okim6376_w(msm6376, space, 0, data);
14651465}
14661466
14671467WRITE8_MEMBER(mpu4_state::pia_gb_portb_w)
r17961r17962
22922292WRITE8_MEMBER(mpu4_state::mpu4_ym2413_w)
22932293{
22942294   device_t *ym = machine().device("ym2413");
2295   if (ym) ym2413_w(ym,offset,data);
2295   if (ym) ym2413_w(ym,space,offset,data);
22962296}
22972297
22982298READ8_MEMBER(mpu4_state::mpu4_ym2413_r)
trunk/src/mame/drivers/famibox.c
r17961r17962
180180READ8_MEMBER(famibox_state::psg_4015_r)
181181{
182182   device_t *device = machine().device("nes");
183   return nes_psg_r(device, 0x15);
183   return nes_psg_r(device, space, 0x15);
184184}
185185
186186WRITE8_MEMBER(famibox_state::psg_4015_w)
187187{
188188   device_t *device = machine().device("nes");
189   nes_psg_w(device, 0x15, data);
189   nes_psg_w(device, space, 0x15, data);
190190}
191191
192192WRITE8_MEMBER(famibox_state::psg_4017_w)
193193{
194194   device_t *device = machine().device("nes");
195   nes_psg_w(device, 0x17, data);
195   nes_psg_w(device, space, 0x17, data);
196196}
197197
198198/******************************************************
trunk/src/mame/drivers/ultrsprt.c
r17961r17962
136136   UINT16 r = 0;
137137
138138   if (ACCESSING_BITS_8_15)
139      r |= k056800_sound_r(k056800, (offset*2)+0, 0xffff) << 8;
139      r |= k056800_sound_r(k056800, space, (offset*2)+0, 0xffff) << 8;
140140
141141   if (ACCESSING_BITS_0_7)
142      r |= k056800_sound_r(k056800, (offset*2)+1, 0xffff) << 0;
142      r |= k056800_sound_r(k056800, space, (offset*2)+1, 0xffff) << 0;
143143
144144   return r;
145145}
r17961r17962
149149   device_t *k056800 = machine().device("k056800");
150150
151151   if (ACCESSING_BITS_8_15)
152      k056800_sound_w(k056800, (offset*2)+0, (data >> 8) & 0xff, 0x00ff);
152      k056800_sound_w(k056800, space, (offset*2)+0, (data >> 8) & 0xff, 0x00ff);
153153
154154   if (ACCESSING_BITS_0_7)
155      k056800_sound_w(k056800, (offset*2)+1, (data >> 0) & 0xff, 0x00ff);
155      k056800_sound_w(k056800, space, (offset*2)+1, (data >> 0) & 0xff, 0x00ff);
156156}
157157
158158static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 16, ultrsprt_state )
trunk/src/mame/drivers/hitme.c
r17961r17962
194194   attotime duration = attotime(0, ATTOSECONDS_PER_SECOND * 0.45 * 6.8e-6 * resistance * (data + 1));
195195   m_timeout_time = machine().time() + duration;
196196
197   discrete_sound_w(device, HITME_DOWNCOUNT_VAL, data);
198   discrete_sound_w(device, HITME_OUT0, 1);
197   discrete_sound_w(device, space, HITME_DOWNCOUNT_VAL, data);
198   discrete_sound_w(device, space, HITME_OUT0, 1);
199199}
200200
201201
202202WRITE8_MEMBER(hitme_state::output_port_1_w)
203203{
204204   device_t *device = machine().device("discrete");
205   discrete_sound_w(device, HITME_ENABLE_VAL, data);
206   discrete_sound_w(device, HITME_OUT1, 1);
205   discrete_sound_w(device, space, HITME_ENABLE_VAL, data);
206   discrete_sound_w(device, space, HITME_OUT1, 1);
207207}
208208
209209
trunk/src/mame/drivers/maygay1b.c
r17961r17962
841841WRITE8_MEMBER(maygay1b_state::latch_ch2_w)
842842{
843843   device_t *msm6376 = machine().device("msm6376");
844   okim6376_w(msm6376, 0, data&0x7f);
844   okim6376_w(msm6376, space, 0, data&0x7f);
845845   okim6376_ch2_w(msm6376,data&0x80);
846846}
847847
trunk/src/mame/drivers/bzone.c
r17961r17962
286286{
287287   device_t *device = machine().device("custom");
288288   m_rb_input_select = data & 1;
289   redbaron_sounds_w(device, offset, data);
289   redbaron_sounds_w(device, space, offset, data);
290290}
291291
292292
trunk/src/mame/drivers/cliffhgr.c
r17961r17962
172172{
173173   device_t *device = machine().device("discrete");
174174   /* audio */
175   discrete_sound_w(device, CLIFF_ENABLE_SND_1, data & 1);
176   discrete_sound_w(device, CLIFF_ENABLE_SND_2, (data >> 1) & 1);
175   discrete_sound_w(device, space, CLIFF_ENABLE_SND_1, data & 1);
176   discrete_sound_w(device, space, CLIFF_ENABLE_SND_2, (data >> 1) & 1);
177177
178178   // bit 4 (data & 0x10) is overlay related?
179179}
trunk/src/mame/drivers/multfish.c
r17961r17962
363363READ8_MEMBER(multfish_state::multfish_timekeeper_r)
364364{
365365   device_t *device = machine().device("m48t35");
366   return timekeeper_r(device, offset + 0x6000);
366   return timekeeper_r(device, space, offset + 0x6000);
367367}
368368
369369WRITE8_MEMBER(multfish_state::multfish_timekeeper_w)
370370{
371371   device_t *device = machine().device("m48t35");
372   timekeeper_w(device, offset + 0x6000, data);
372   timekeeper_w(device, space, offset + 0x6000, data);
373373}
374374
375375READ8_MEMBER(multfish_state::bankedram_r)
r17961r17962
377377
378378   if ((m_rambk & 0x80) == 0x00)
379379   {
380      return timekeeper_r(machine().device("m48t35"), offset + 0x2000*(m_rambk & 0x03));
380      return timekeeper_r(machine().device("m48t35"), space, offset + 0x2000*(m_rambk & 0x03));
381381   }
382382   else
383383   {
r17961r17962
391391
392392   if ((m_rambk & 0x80) == 0x00)
393393   {
394      timekeeper_w(machine().device("m48t35"), offset + 0x2000*(m_rambk & 0x03), data);
394      timekeeper_w(machine().device("m48t35"), space, offset + 0x2000*(m_rambk & 0x03), data);
395395   }
396396   else
397397   {
r17961r17962
11311131   multfish_state::machine_reset();
11321132
11331133   // this set needs preprogrammed data in timekeeper
1134   timekeeper_w(machine().device("m48t35"), 0x2003 , 0x01);
1135   timekeeper_w(machine().device("m48t35"), 0x4003 , 0x02);
1134   timekeeper_w(machine().device("m48t35"), generic_space(), 0x2003 , 0x01);
1135   timekeeper_w(machine().device("m48t35"), generic_space(), 0x4003 , 0x02);
11361136}
11371137static MACHINE_CONFIG_DERIVED( island2a, multfish )
11381138
trunk/src/mame/drivers/sprint2.c
r17961r17962
102102      }
103103   }
104104
105   discrete_sound_w(discrete, SPRINT2_MOTORSND1_DATA, state->m_video_ram[0x394] & 15);   // also DOMINOS_FREQ_DATA
106   discrete_sound_w(discrete, SPRINT2_MOTORSND2_DATA, state->m_video_ram[0x395] & 15);
107   discrete_sound_w(discrete, SPRINT2_CRASHSND_DATA, state->m_video_ram[0x396] & 15);   // also DOMINOS_AMP_DATA
105   address_space &space = *device->machine().firstcpu->space(AS_PROGRAM);
106   discrete_sound_w(discrete, space, SPRINT2_MOTORSND1_DATA, state->m_video_ram[0x394] & 15);   // also DOMINOS_FREQ_DATA
107   discrete_sound_w(discrete, space, SPRINT2_MOTORSND2_DATA, state->m_video_ram[0x395] & 15);
108   discrete_sound_w(discrete, space, SPRINT2_CRASHSND_DATA, state->m_video_ram[0x396] & 15);   // also DOMINOS_AMP_DATA
108109
109110   /* interrupts and watchdog are disabled during service mode */
110111
r17961r17962
212213   m_attract = offset & 1;
213214
214215   // also DOMINOS_ATTRACT_EN
215   discrete_sound_w(device, SPRINT2_ATTRACT_EN, m_attract);
216   discrete_sound_w(device, space, SPRINT2_ATTRACT_EN, m_attract);
216217}
217218
218219
219220WRITE8_MEMBER(sprint2_state::sprint2_noise_reset_w)
220221{
221222   device_t *device = machine().device("discrete");
222   discrete_sound_w(device, SPRINT2_NOISE_RESET, 0);
223   discrete_sound_w(device, space, SPRINT2_NOISE_RESET, 0);
223224}
224225
225226
r17961r17962
227228{
228229   device_t *device = machine().device("discrete");
229230   // also DOMINOS_TUMBLE_EN
230   discrete_sound_w(device, SPRINT2_SKIDSND1_EN, offset & 1);
231   discrete_sound_w(device, space, SPRINT2_SKIDSND1_EN, offset & 1);
231232}
232233
233234WRITE8_MEMBER(sprint2_state::sprint2_skid2_w)
234235{
235236   device_t *device = machine().device("discrete");
236   discrete_sound_w(device, SPRINT2_SKIDSND2_EN, offset & 1);
237   discrete_sound_w(device, space, SPRINT2_SKIDSND2_EN, offset & 1);
237238}
238239
239240
trunk/src/mame/drivers/midqslvr.c
r17961r17962
396396READ32_MEMBER(midqslvr_state::ide_r)
397397{
398398   device_t *device = machine().device("ide");
399   return ide_controller32_r(device, 0x1f0/4 + offset, mem_mask);
399   return ide_controller32_r(device, space, 0x1f0/4 + offset, mem_mask);
400400}
401401
402402WRITE32_MEMBER(midqslvr_state::ide_w)
403403{
404404   device_t *device = machine().device("ide");
405   ide_controller32_w(device, 0x1f0/4 + offset, data, mem_mask);
405   ide_controller32_w(device, space, 0x1f0/4 + offset, data, mem_mask);
406406}
407407
408408READ32_MEMBER(midqslvr_state::fdc_r)
409409{
410410   device_t *device = machine().device("ide");
411   return ide_controller32_r(device, 0x3f0/4 + offset, mem_mask);
411   return ide_controller32_r(device, space, 0x3f0/4 + offset, mem_mask);
412412}
413413
414414WRITE32_MEMBER(midqslvr_state::fdc_w)
415415{
416416   device_t *device = machine().device("ide");
417417   //mame_printf_debug("FDC: write %08X, %08X, %08X\n", data, offset, mem_mask);
418   ide_controller32_w(device, 0x3f0/4 + offset, data, mem_mask);
418   ide_controller32_w(device, space, 0x3f0/4 + offset, data, mem_mask);
419419}
420420
421421READ8_MEMBER(midqslvr_state::at_page8_r)
r17961r17962
463463READ8_MEMBER(midqslvr_state::at_dma8237_2_r)
464464{
465465   device_t *device = machine().device("dma8237_2");
466   return i8237_r(device, offset / 2);
466   return i8237_r(device, space, offset / 2);
467467}
468468
469469WRITE8_MEMBER(midqslvr_state::at_dma8237_2_w)
470470{
471471   device_t *device = machine().device("dma8237_2");
472   i8237_w(device, offset / 2, data);
472   i8237_w(device, space, offset / 2, data);
473473}
474474
475475WRITE_LINE_MEMBER(midqslvr_state::pc_dma_hrq_changed)
trunk/src/mame/drivers/exterm.c
r17961r17962
207207{
208208   device_t *device = machine().device("ymsnd");
209209   /* bit 7 of the sound control selects which port */
210   ym2151_w(device, m_sound_control >> 7, data);
210   ym2151_w(device, space, m_sound_control >> 7, data);
211211}
212212
213213
trunk/src/mame/drivers/dragrace.c
r17961r17962
3333}
3434
3535
36static void dragrace_update_misc_flags( running_machine &machine )
36static void dragrace_update_misc_flags( address_space &space )
3737{
38   dragrace_state *state = machine.driver_data<dragrace_state>();
38   dragrace_state *state = space.machine().driver_data<dragrace_state>();
3939   /* 0x0900 = set 3SPEED1         0x00000001
4040     * 0x0901 = set 4SPEED1         0x00000002
4141     * 0x0902 = set 5SPEED1         0x00000004
r17961r17962
6767     * 0x091f = set Player 2 Start Lamp 0x80000000
6868     * 0x0938 = clear 0x0918 - 0x091f
6969     */
70   set_led_status(machine, 0, state->m_misc_flags & 0x00008000);
71   set_led_status(machine, 1, state->m_misc_flags & 0x80000000);
70   set_led_status(space.machine(), 0, state->m_misc_flags & 0x00008000);
71   set_led_status(space.machine(), 1, state->m_misc_flags & 0x80000000);
7272
73   discrete_sound_w(state->m_discrete, DRAGRACE_MOTOR1_DATA,  ~state->m_misc_flags & 0x0000001f);      // Speed1 data*
74   discrete_sound_w(state->m_discrete, DRAGRACE_EXPLODE1_EN, (state->m_misc_flags & 0x00000020) ? 1: 0);   // Explosion1 enable
75   discrete_sound_w(state->m_discrete, DRAGRACE_SCREECH1_EN, (state->m_misc_flags & 0x00000040) ? 1: 0);   // Screech1 enable
76   discrete_sound_w(state->m_discrete, DRAGRACE_KLEXPL1_EN, (state->m_misc_flags & 0x00000200) ? 1: 0);   // KLEXPL1 enable
77   discrete_sound_w(state->m_discrete, DRAGRACE_MOTOR1_EN, (state->m_misc_flags & 0x00000800) ? 1: 0);   // Motor1 enable
73   discrete_sound_w(state->m_discrete, space, DRAGRACE_MOTOR1_DATA,  ~state->m_misc_flags & 0x0000001f);      // Speed1 data*
74   discrete_sound_w(state->m_discrete, space, DRAGRACE_EXPLODE1_EN, (state->m_misc_flags & 0x00000020) ? 1: 0);   // Explosion1 enable
75   discrete_sound_w(state->m_discrete, space, DRAGRACE_SCREECH1_EN, (state->m_misc_flags & 0x00000040) ? 1: 0);   // Screech1 enable
76   discrete_sound_w(state->m_discrete, space, DRAGRACE_KLEXPL1_EN, (state->m_misc_flags & 0x00000200) ? 1: 0);   // KLEXPL1 enable
77   discrete_sound_w(state->m_discrete, space, DRAGRACE_MOTOR1_EN, (state->m_misc_flags & 0x00000800) ? 1: 0);   // Motor1 enable
7878
79   discrete_sound_w(state->m_discrete, DRAGRACE_MOTOR2_DATA, (~state->m_misc_flags & 0x001f0000) >> 0x10);   // Speed2 data*
80   discrete_sound_w(state->m_discrete, DRAGRACE_EXPLODE2_EN, (state->m_misc_flags & 0x00200000) ? 1: 0);   // Explosion2 enable
81   discrete_sound_w(state->m_discrete, DRAGRACE_SCREECH2_EN, (state->m_misc_flags & 0x00400000) ? 1: 0);   // Screech2 enable
82   discrete_sound_w(state->m_discrete, DRAGRACE_KLEXPL2_EN, (state->m_misc_flags & 0x02000000) ? 1: 0);   // KLEXPL2 enable
83   discrete_sound_w(state->m_discrete, DRAGRACE_MOTOR2_EN, (state->m_misc_flags & 0x08000000) ? 1: 0);   // Motor2 enable
79   discrete_sound_w(state->m_discrete, space, DRAGRACE_MOTOR2_DATA, (~state->m_misc_flags & 0x001f0000) >> 0x10);   // Speed2 data*
80   discrete_sound_w(state->m_discrete, space, DRAGRACE_EXPLODE2_EN, (state->m_misc_flags & 0x00200000) ? 1: 0);   // Explosion2 enable
81   discrete_sound_w(state->m_discrete, space, DRAGRACE_SCREECH2_EN, (state->m_misc_flags & 0x00400000) ? 1: 0);   // Screech2 enable
82   discrete_sound_w(state->m_discrete, space, DRAGRACE_KLEXPL2_EN, (state->m_misc_flags & 0x02000000) ? 1: 0);   // KLEXPL2 enable
83   discrete_sound_w(state->m_discrete, space, DRAGRACE_MOTOR2_EN, (state->m_misc_flags & 0x08000000) ? 1: 0);   // Motor2 enable
8484
85   discrete_sound_w(state->m_discrete, DRAGRACE_ATTRACT_EN, (state->m_misc_flags & 0x00001000) ? 1: 0);   // Attract enable
86   discrete_sound_w(state->m_discrete, DRAGRACE_LOTONE_EN, (state->m_misc_flags & 0x00002000) ? 1: 0);   // LoTone enable
87   discrete_sound_w(state->m_discrete, DRAGRACE_HITONE_EN, (state->m_misc_flags & 0x20000000) ? 1: 0);   // HiTone enable
85   discrete_sound_w(state->m_discrete, space, DRAGRACE_ATTRACT_EN, (state->m_misc_flags & 0x00001000) ? 1: 0);   // Attract enable
86   discrete_sound_w(state->m_discrete, space, DRAGRACE_LOTONE_EN, (state->m_misc_flags & 0x00002000) ? 1: 0);   // LoTone enable
87   discrete_sound_w(state->m_discrete, space, DRAGRACE_HITONE_EN, (state->m_misc_flags & 0x20000000) ? 1: 0);   // HiTone enable
8888}
8989
9090WRITE8_MEMBER(dragrace_state::dragrace_misc_w)
r17961r17962
9797   else
9898      m_misc_flags &= (~mask);
9999   logerror("Set   %#6x, Mask=%#10x, Flag=%#10x, Data=%x\n", 0x0900 + offset, mask, m_misc_flags, data & 0x01);
100   dragrace_update_misc_flags(machine());
100   dragrace_update_misc_flags(space);
101101}
102102
103103WRITE8_MEMBER(dragrace_state::dragrace_misc_clear_w)
r17961r17962
107107   UINT32 mask = 0xff << (((offset >> 3) & 0x03) * 8);
108108   m_misc_flags &= (~mask);
109109   logerror("Clear %#6x, Mask=%#10x, Flag=%#10x, Data=%x\n", 0x0920 + offset, mask, m_misc_flags, data & 0x01);
110   dragrace_update_misc_flags(machine());
110   dragrace_update_misc_flags(space);
111111}
112112
113113READ8_MEMBER(dragrace_state::dragrace_input_r)
trunk/src/mame/drivers/sauro.c
r17961r17962
161161WRITE8_MEMBER(sauro_state::adpcm_w)
162162{
163163   device_t *device = machine().device("speech");
164   sp0256_ALD_w(device, 0, data);
164   sp0256_ALD_w(device, space, 0, data);
165165}
166166
167167static ADDRESS_MAP_START( sauro_map, AS_PROGRAM, 8, sauro_state )
trunk/src/mame/drivers/system1.c
r17961r17962
481481   machine().device("soundcpu")->execute().set_input_line(INPUT_LINE_NMI, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE);
482482
483483   /* remaining bits are used for video RAM banking */
484   system1_videoram_bank_w(device, offset, data);
484   system1_videoram_bank_w(device, space, offset, data);
485485}
486486
487487
trunk/src/mame/drivers/bfm_sc2.c
r17961r17962
731731
732732   upd7759_set_bank_base(device, bank*0x20000);
733733
734   upd7759_port_w(device, 0, data&0x3F);   // setup sample
734   upd7759_port_w(device, space, 0, data&0x3F);   // setup sample
735735   upd7759_start_w(device, 0);
736736   upd7759_start_w(device, 1);
737737}
trunk/src/mame/drivers/dynax.c
r17961r17962
16361636         case 0x8050:   // CRT controller
16371637         case 0x8051:   return;
16381638
1639         case 0x8070:   ym2413_register_port_w(m_ymsnd, 0, data);   return;
1640         case 0x8071:   ym2413_data_port_w(m_ymsnd, 0, data);   return;
1639         case 0x8070:   ym2413_register_port_w(m_ymsnd, space, 0, data);   return;
1640         case 0x8071:   ym2413_data_port_w(m_ymsnd, space, 0, data);   return;
16411641
16421642         case 0x8060:   m_keyb = data;   return;
16431643
trunk/src/mame/drivers/mexico86.c
r17961r17962
6666READ8_MEMBER(mexico86_state::kiki_ym2203_r)
6767{
6868   device_t *device = machine().device("ymsnd");
69   UINT8 result = ym2203_r(device, offset);
69   UINT8 result = ym2203_r(device, space, offset);
7070
7171   if (offset == 0)
7272      result &= 0x7f;
trunk/src/mame/drivers/calchase.c
r17961r17962
184184READ8_MEMBER(calchase_state::at_dma8237_2_r)
185185{
186186   device_t *device = machine().device("dma8237_2");
187   return i8237_r(device, offset / 2);
187   return i8237_r(device, space, offset / 2);
188188}
189189
190190WRITE8_MEMBER(calchase_state::at_dma8237_2_w)
191191{
192192   device_t *device = machine().device("dma8237_2");
193   i8237_w(device, offset / 2, data);
193   i8237_w(device, space, offset / 2, data);
194194}
195195
196196READ8_MEMBER(calchase_state::at_page8_r)
r17961r17962
298298READ32_MEMBER(calchase_state::ide_r)
299299{
300300   device_t *device = machine().device("ide");
301   return ide_controller32_r(device, 0x1f0/4 + offset, mem_mask);
301   return ide_controller32_r(device, space, 0x1f0/4 + offset, mem_mask);
302302}
303303
304304WRITE32_MEMBER(calchase_state::ide_w)
305305{
306306   device_t *device = machine().device("ide");
307   ide_controller32_w(device, 0x1f0/4 + offset, data, mem_mask);
307   ide_controller32_w(device, space, 0x1f0/4 + offset, data, mem_mask);
308308}
309309
310310
r17961r17962
314314READ32_MEMBER(calchase_state::fdc_r)
315315{
316316   device_t *device = machine().device("ide");
317   return ide_controller32_r(device, 0x3f0/4 + offset, mem_mask);
317   return ide_controller32_r(device, space, 0x3f0/4 + offset, mem_mask);
318318}
319319
320320WRITE32_MEMBER(calchase_state::fdc_w)
321321{
322322   device_t *device = machine().device("ide");
323323   //mame_printf_debug("FDC: write %08X, %08X, %08X\n", data, offset, mem_mask);
324   ide_controller32_w(device, 0x3f0/4 + offset, data, mem_mask);
324   ide_controller32_w(device, space, 0x3f0/4 + offset, data, mem_mask);
325325}
326326
327327
trunk/src/mame/drivers/grchamp.c
r17961r17962
305305         /* bit 2-4: ATTACK UP 1-3 */
306306         /* bit 5-6: SIFT 1-2 */
307307         /* bit 7:   ENGINE CS */
308         discrete_sound_w(discrete, GRCHAMP_ENGINE_CS_EN, data & 0x80);
309         discrete_sound_w(discrete, GRCHAMP_SIFT_DATA, (data >> 5) & 0x03);
310         discrete_sound_w(discrete, GRCHAMP_ATTACK_UP_DATA, (data >> 2) & 0x07);
311         discrete_sound_w(discrete, GRCHAMP_IDLING_EN, data & 0x02);
312         discrete_sound_w(discrete, GRCHAMP_FOG_EN, data & 0x01);
308         discrete_sound_w(discrete, space, GRCHAMP_ENGINE_CS_EN, data & 0x80);
309         discrete_sound_w(discrete, space, GRCHAMP_SIFT_DATA, (data >> 5) & 0x03);
310         discrete_sound_w(discrete, space, GRCHAMP_ATTACK_UP_DATA, (data >> 2) & 0x07);
311         discrete_sound_w(discrete, space, GRCHAMP_IDLING_EN, data & 0x02);
312         discrete_sound_w(discrete, space, GRCHAMP_FOG_EN, data & 0x01);
313313         break;
314314
315315      case 0x0d: /* OUTD */
316316         /* bit 0-3: ATTACK SPEED 1-4 */
317317         /* bit 4-7: PLAYER SPEED 1-4 */
318         discrete_sound_w(discrete, GRCHAMP_PLAYER_SPEED_DATA, (data >> 4) & 0x0f);
319         discrete_sound_w(discrete, GRCHAMP_ATTACK_SPEED_DATA,  data & 0x0f);
318         discrete_sound_w(discrete, space, GRCHAMP_PLAYER_SPEED_DATA, (data >> 4) & 0x0f);
319         discrete_sound_w(discrete, space, GRCHAMP_ATTACK_SPEED_DATA,  data & 0x0f);
320320         break;
321321
322322      default:
r17961r17962
416416WRITE8_MEMBER(grchamp_state::grchamp_portA_0_w)
417417{
418418   device_t *device = machine().device("discrete");
419   discrete_sound_w(device, GRCHAMP_A_DATA, data);
419   discrete_sound_w(device, space, GRCHAMP_A_DATA, data);
420420}
421421
422422WRITE8_MEMBER(grchamp_state::grchamp_portB_0_w)
423423{
424424   device_t *device = machine().device("discrete");
425   discrete_sound_w(device, GRCHAMP_B_DATA, 255-data);
425   discrete_sound_w(device, space, GRCHAMP_B_DATA, 255-data);
426426}
427427
428428WRITE8_MEMBER(grchamp_state::grchamp_portA_2_w)
trunk/src/mame/drivers/vegas.c
r17961r17962
14641464
14651465static READ32_DEVICE_HANDLER( ide_main_r )
14661466{
1467   return ide_controller32_r(device, 0x1f0/4 + offset, mem_mask);
1467   return ide_controller32_r(device, space, 0x1f0/4 + offset, mem_mask);
14681468}
14691469
14701470
14711471static WRITE32_DEVICE_HANDLER( ide_main_w )
14721472{
1473   ide_controller32_w(device, 0x1f0/4 + offset, data, mem_mask);
1473   ide_controller32_w(device, space, 0x1f0/4 + offset, data, mem_mask);
14741474}
14751475
14761476
14771477static READ32_DEVICE_HANDLER( ide_alt_r )
14781478{
1479   return ide_controller32_r(device, 0x3f4/4 + offset, mem_mask);
1479   return ide_controller32_r(device, space, 0x3f4/4 + offset, mem_mask);
14801480}
14811481
14821482
14831483static WRITE32_DEVICE_HANDLER( ide_alt_w )
14841484{
1485   ide_controller32_w(device, 0x3f4/4 + offset, data, mem_mask);
1485   ide_controller32_w(device, space, 0x3f4/4 + offset, data, mem_mask);
14861486}
14871487
14881488
r17961r17962
14901490{
14911491   UINT32 result = 0;
14921492   if (ACCESSING_BITS_0_15)
1493      result |= smc91c9x_r(device, offset * 2 + 0, mem_mask);
1493      result |= smc91c9x_r(device, space, offset * 2 + 0, mem_mask);
14941494   if (ACCESSING_BITS_16_31)
1495      result |= smc91c9x_r(device, offset * 2 + 1, mem_mask >> 16) << 16;
1495      result |= smc91c9x_r(device, space, offset * 2 + 1, mem_mask >> 16) << 16;
14961496   return result;
14971497}
14981498
r17961r17962
15001500static WRITE32_DEVICE_HANDLER( ethernet_w )
15011501{
15021502   if (ACCESSING_BITS_0_15)
1503      smc91c9x_w(device, offset * 2 + 0, data, mem_mask);
1503      smc91c9x_w(device, space, offset * 2 + 0, data, mem_mask);
15041504   if (ACCESSING_BITS_16_31)
1505      smc91c9x_w(device, offset * 2 + 1, data >> 16, mem_mask >> 16);
1505      smc91c9x_w(device, space, offset * 2 + 1, data >> 16, mem_mask >> 16);
15061506}
15071507
15081508
trunk/src/mame/drivers/xtom3d.c
r17961r17962
386386   device_t *device = machine().device("ide");
387387   return -1; // crashes otherwise
388388
389   return ide_controller32_r(device, 0x1f0/4 + offset, mem_mask);
389   return ide_controller32_r(device, space, 0x1f0/4 + offset, mem_mask);
390390}
391391
392392WRITE32_MEMBER(xtom3d_state::ide_w)
393393{
394394   device_t *device = machine().device("ide");
395395   if(0) // crashes otherwise
396      ide_controller32_w(device, 0x1f0/4 + offset, data, mem_mask);
396      ide_controller32_w(device, space, 0x1f0/4 + offset, data, mem_mask);
397397}
398398
399399READ32_MEMBER(xtom3d_state::fdc_r)
400400{
401401   device_t *device = machine().device("ide");
402   return ide_controller32_r(device, 0x3f0/4 + offset, mem_mask);
402   return ide_controller32_r(device, space, 0x3f0/4 + offset, mem_mask);
403403}
404404
405405WRITE32_MEMBER(xtom3d_state::fdc_w)
406406{
407407   device_t *device = machine().device("ide");
408408   //mame_printf_debug("FDC: write %08X, %08X, %08X\n", data, offset, mem_mask);
409   ide_controller32_w(device, 0x3f0/4 + offset, data, mem_mask);
409   ide_controller32_w(device, space, 0x3f0/4 + offset, data, mem_mask);
410410}
411411
412412READ8_MEMBER(xtom3d_state::at_page8_r)
r17961r17962
455455READ8_MEMBER(xtom3d_state::at_dma8237_2_r)
456456{
457457   device_t *device = machine().device("dma8237_2");
458   return i8237_r(device, offset / 2);
458   return i8237_r(device, space, offset / 2);
459459}
460460
461461WRITE8_MEMBER(xtom3d_state::at_dma8237_2_w)
462462{
463463   device_t *device = machine().device("dma8237_2");
464   i8237_w(device, offset / 2, data);
464   i8237_w(device, space, offset / 2, data);
465465}
466466
467467WRITE_LINE_MEMBER(xtom3d_state::pc_dma_hrq_changed)
trunk/src/mame/drivers/videopkr.c
r17961r17962
921921      case 0x00:   break;
922922      case 0x01:   break;
923923      case 0x02:   break;
924      case 0x03:   ay8910_data_w(device, 1, m_sbp0); break;
924      case 0x03:   ay8910_data_w(device, space, 1, m_sbp0); break;
925925      case 0x04:   break;
926      case 0x05:   m_sbp0 = ay8910_r(device, m_sbp0); break;
926      case 0x05:   m_sbp0 = ay8910_r(device, space, m_sbp0); break;
927927      case 0x06:   break;
928      case 0x07:   ay8910_address_w(device, 0, m_sbp0); break;
928      case 0x07:   ay8910_address_w(device, space, 0, m_sbp0); break;
929929   }
930930}
931931
trunk/src/mame/drivers/gticlub.c
r17961r17962
286286READ32_MEMBER(gticlub_state::gticlub_k001604_tile_r)
287287{
288288   device_t *k001604 = machine().device(get_cgboard_id() ? "k001604_2" : "k001604_1");
289   return k001604_tile_r(k001604, offset, mem_mask);
289   return k001604_tile_r(k001604, space, offset, mem_mask);
290290}
291291
292292WRITE32_MEMBER(gticlub_state::gticlub_k001604_tile_w)
293293{
294294   device_t *k001604 = machine().device(get_cgboard_id() ? "k001604_2" : "k001604_1");
295   k001604_tile_w(k001604, offset, data, mem_mask);
295   k001604_tile_w(k001604, space, offset, data, mem_mask);
296296}
297297
298298
299299READ32_MEMBER(gticlub_state::gticlub_k001604_char_r)
300300{
301301   device_t *k001604 = machine().device(get_cgboard_id() ? "k001604_2" : "k001604_1");
302   return k001604_char_r(k001604, offset, mem_mask);
302   return k001604_char_r(k001604, space, offset, mem_mask);
303303}
304304
305305WRITE32_MEMBER(gticlub_state::gticlub_k001604_char_w)
306306{
307307   device_t *k001604 = machine().device(get_cgboard_id() ? "k001604_2" : "k001604_1");
308   k001604_char_w(k001604, offset, data, mem_mask);
308   k001604_char_w(k001604, space, offset, data, mem_mask);
309309}
310310
311311READ32_MEMBER(gticlub_state::gticlub_k001604_reg_r)
312312{
313313   device_t *k001604 = machine().device(get_cgboard_id() ? "k001604_2" : "k001604_1");
314   return k001604_reg_r(k001604, offset, mem_mask);
314   return k001604_reg_r(k001604, space, offset, mem_mask);
315315}
316316
317317WRITE32_MEMBER(gticlub_state::gticlub_k001604_reg_w)
318318{
319319   device_t *k001604 = machine().device(get_cgboard_id() ? "k001604_2" : "k001604_1");
320   k001604_reg_w(k001604, offset, data, mem_mask);
320   k001604_reg_w(k001604, space, offset, data, mem_mask);
321321}
322322
323323
trunk/src/mame/drivers/namcona1.c
r17961r17962
806806{
807807   device_t *device = machine().device("c140");
808808   /* can't use DEVREADWRITE8 for this because it is opposite endianness to the CPU for some reason */
809   return c140_r(device,offset*2+1) | c140_r(device,offset*2)<<8;
809   return c140_r(device,space,offset*2+1) | c140_r(device,space,offset*2)<<8;
810810}
811811
812812WRITE16_MEMBER(namcona1_state::snd_w)
r17961r17962
815815   /* can't use DEVREADWRITE8 for this because it is opposite endianness to the CPU for some reason */
816816   if (ACCESSING_BITS_0_7)
817817   {
818      c140_w(device,(offset*2)+1, data);
818      c140_w(device,space,(offset*2)+1, data);
819819   }
820820
821821   if (ACCESSING_BITS_8_15)
822822   {
823      c140_w(device,(offset*2), data>>8);
823      c140_w(device,space,(offset*2), data>>8);
824824   }
825825}
826826
trunk/src/mame/drivers/dkong.c
r17961r17962
568568READ8_MEMBER(dkong_state::dkong_in2_r)
569569{
570570   /* mcu status (sound feedback) is inverted bit4 from port B (8039) */
571   UINT8 mcustatus = latch8_bit4_q_r(m_dev_vp2, 0);
571   UINT8 mcustatus = latch8_bit4_q_r(m_dev_vp2, space, 0);
572572   UINT8 r;
573573
574574   r = (ioport("IN2")->read() & 0xBF) | (mcustatus << 6);
trunk/src/mame/drivers/sprint4.c
r17961r17962
187187WRITE8_MEMBER(sprint4_state::sprint4_screech_1_w)
188188{
189189   device_t *device = machine().device("discrete");
190   discrete_sound_w(device, SPRINT4_SCREECH_EN_1, offset & 1);
190   discrete_sound_w(device, space, SPRINT4_SCREECH_EN_1, offset & 1);
191191}
192192
193193
194194WRITE8_MEMBER(sprint4_state::sprint4_screech_2_w)
195195{
196196   device_t *device = machine().device("discrete");
197   discrete_sound_w(device, SPRINT4_SCREECH_EN_2, offset & 1);
197   discrete_sound_w(device, space, SPRINT4_SCREECH_EN_2, offset & 1);
198198}
199199
200200
201201WRITE8_MEMBER(sprint4_state::sprint4_screech_3_w)
202202{
203203   device_t *device = machine().device("discrete");
204   discrete_sound_w(device, SPRINT4_SCREECH_EN_3, offset & 1);
204   discrete_sound_w(device, space, SPRINT4_SCREECH_EN_3, offset & 1);
205205}
206206
207207
208208WRITE8_MEMBER(sprint4_state::sprint4_screech_4_w)
209209{
210210   device_t *device = machine().device("discrete");
211   discrete_sound_w(device, SPRINT4_SCREECH_EN_4, offset & 1);
211   discrete_sound_w(device, space, SPRINT4_SCREECH_EN_4, offset & 1);
212212}
213213
214214
r17961r17962
217217WRITE8_MEMBER(sprint4_state::sprint4_bang_w)
218218{
219219   device_t *device = machine().device("discrete");
220   discrete_sound_w(device, SPRINT4_BANG_DATA, data & 0x0f);
220   discrete_sound_w(device, space, SPRINT4_BANG_DATA, data & 0x0f);
221221}
222222
223223
224224WRITE8_MEMBER(sprint4_state::sprint4_attract_w)
225225{
226226   device_t *device = machine().device("discrete");
227   discrete_sound_w(device, SPRINT4_ATTRACT_EN, data & 1);
227   discrete_sound_w(device, space, SPRINT4_ATTRACT_EN, data & 1);
228228}
229229
230230
trunk/src/mame/drivers/nyny.c
r17961r17962
277277   1,               /* A pin - driven by the CRTC */
278278   1,               /* B pin - pulled high */
279279   1,               /* Clear pin - pulled high */
280   ic48_1_74123_output_changed
280   DEVCB_HANDLER(ic48_1_74123_output_changed)
281281};
282282
283283
r17961r17962
420420
421421WRITE_LINE_MEMBER(nyny_state::display_enable_changed)
422422{
423   ttl74123_a_w(m_ic48_1, 0, state);
423   ttl74123_a_w(m_ic48_1, generic_space(), 0, state);
424424}
425425
426426
trunk/src/mame/drivers/prehisle.c
r17961r17962
4242WRITE8_MEMBER(prehisle_state::D7759_write_port_0_w)
4343{
4444   device_t *device = machine().device("upd");
45   upd7759_port_w(device, 0, data);
45   upd7759_port_w(device, space, 0, data);
4646   upd7759_start_w(device, 0);
4747   upd7759_start_w(device, 1);
4848}
trunk/src/mame/drivers/polepos.c
r17961r17962
303303         polepos_sound_enable(machine().device("namco"),bit);
304304         if (!bit)
305305         {
306            polepos_engine_sound_lsb_w(machine().device("polepos"), 0, 0);
307            polepos_engine_sound_msb_w(machine().device("polepos"), 0, 0);
306            polepos_engine_sound_lsb_w(machine().device("polepos"), space, 0, 0);
307            polepos_engine_sound_msb_w(machine().device("polepos"), space, 0, 0);
308308         }
309309         break;
310310
trunk/src/mame/drivers/tank8.c
r17961r17962
4747WRITE8_MEMBER(tank8_state::tank8_crash_w)
4848{
4949   device_t *device = machine().device("discrete");
50   discrete_sound_w(device, TANK8_CRASH_EN, data);
50   discrete_sound_w(device, space, TANK8_CRASH_EN, data);
5151}
5252
5353WRITE8_MEMBER(tank8_state::tank8_explosion_w)
5454{
5555   device_t *device = machine().device("discrete");
56   discrete_sound_w(device, TANK8_EXPLOSION_EN, data);
56   discrete_sound_w(device, space, TANK8_EXPLOSION_EN, data);
5757}
5858
5959WRITE8_MEMBER(tank8_state::tank8_bugle_w)
6060{
6161   device_t *device = machine().device("discrete");
62   discrete_sound_w(device, TANK8_BUGLE_EN, data);
62   discrete_sound_w(device, space, TANK8_BUGLE_EN, data);
6363}
6464
6565WRITE8_MEMBER(tank8_state::tank8_bug_w)
r17961r17962
6868   /* D0 and D1 determine the on/off time off the square wave */
6969   switch(data & 3) {
7070      case 0:
71         discrete_sound_w(device, TANK8_BUGLE_DATA1,8.0);
72         discrete_sound_w(device, TANK8_BUGLE_DATA2,4.0);
71         discrete_sound_w(device, space, TANK8_BUGLE_DATA1,8.0);
72         discrete_sound_w(device, space, TANK8_BUGLE_DATA2,4.0);
7373         break;
7474      case 1:
75         discrete_sound_w(device, TANK8_BUGLE_DATA1,8.0);
76         discrete_sound_w(device, TANK8_BUGLE_DATA2,7.0);
75         discrete_sound_w(device, space, TANK8_BUGLE_DATA1,8.0);
76         discrete_sound_w(device, space, TANK8_BUGLE_DATA2,7.0);
7777         break;
7878      case 2:
79         discrete_sound_w(device, TANK8_BUGLE_DATA1,8.0);
80         discrete_sound_w(device, TANK8_BUGLE_DATA2,2.0);
79         discrete_sound_w(device, space, TANK8_BUGLE_DATA1,8.0);
80         discrete_sound_w(device, space, TANK8_BUGLE_DATA2,2.0);
8181         break;
8282      case 3:
83         discrete_sound_w(device, TANK8_BUGLE_DATA1,16.0);
84         discrete_sound_w(device, TANK8_BUGLE_DATA2,4.0);
83         discrete_sound_w(device, space, TANK8_BUGLE_DATA1,16.0);
84         discrete_sound_w(device, space, TANK8_BUGLE_DATA2,4.0);
8585         break;
8686   }
8787
r17961r17962
9090WRITE8_MEMBER(tank8_state::tank8_attract_w)
9191{
9292   device_t *device = machine().device("discrete");
93   discrete_sound_w(device, TANK8_ATTRACT_EN, data);
93   discrete_sound_w(device, space, TANK8_ATTRACT_EN, data);
9494}
9595
9696WRITE8_MEMBER(tank8_state::tank8_motor_w)
9797{
9898   device_t *device = machine().device("discrete");
99   discrete_sound_w(device, NODE_RELATIVE(TANK8_MOTOR1_EN, offset), data);
99   discrete_sound_w(device, space, NODE_RELATIVE(TANK8_MOTOR1_EN, offset), data);
100100}
101101
102102static ADDRESS_MAP_START( tank8_cpu_map, AS_PROGRAM, 8, tank8_state )
trunk/src/mame/drivers/qdrmfgp.c
r17961r17962
120120{
121121   device_t *k056832 = machine().device("k056832");
122122   UINT8 *mem8 = memregion("gfx1")->base();
123   int bank = k056832_word_r(k056832, 0x34/2, 0xffff);
123   int bank = k056832_word_r(k056832, space, 0x34/2, 0xffff);
124124
125125   offset += bank * 0x800 * 4;
126126
r17961r17962
136136   device_t *k056832 = machine().device("k056832");
137137
138138   if (offset < 0x1000 / 2)
139      return k056832_ram_word_r(k056832, offset * 2 + 1, mem_mask);
139      return k056832_ram_word_r(k056832, space, offset * 2 + 1, mem_mask);
140140   else
141      return k056832_ram_word_r(k056832, (offset - 0x1000 / 2) * 2, mem_mask);
141      return k056832_ram_word_r(k056832, space, (offset - 0x1000 / 2) * 2, mem_mask);
142142}
143143
144144READ16_MEMBER(qdrmfgp_state::gp2_vram_mirror_r)
r17961r17962
146146   device_t *k056832 = machine().device("k056832");
147147
148148   if (offset < 0x1000 / 2)
149      return k056832_ram_word_r(k056832, offset * 2, mem_mask);
149      return k056832_ram_word_r(k056832, space, offset * 2, mem_mask);
150150   else
151      return k056832_ram_word_r(k056832, (offset - 0x1000 / 2) * 2 + 1, mem_mask);
151      return k056832_ram_word_r(k056832, space, (offset - 0x1000 / 2) * 2 + 1, mem_mask);
152152}
153153
154154WRITE16_MEMBER(qdrmfgp_state::gp2_vram_w)
r17961r17962
156156   device_t *k056832 = machine().device("k056832");
157157
158158   if (offset < 0x1000 / 2)
159      k056832_ram_word_w(k056832, offset * 2 + 1, data, mem_mask);
159      k056832_ram_word_w(k056832, space, offset * 2 + 1, data, mem_mask);
160160   else
161      k056832_ram_word_w(k056832, (offset - 0x1000 / 2) * 2, data, mem_mask);
161      k056832_ram_word_w(k056832, space, (offset - 0x1000 / 2) * 2, data, mem_mask);
162162}
163163
164164WRITE16_MEMBER(qdrmfgp_state::gp2_vram_mirror_w)
r17961r17962
166166   device_t *k056832 = machine().device("k056832");
167167
168168   if (offset < 0x1000 / 2)
169      k056832_ram_word_w(k056832, offset * 2, data, mem_mask);
169      k056832_ram_word_w(k056832, space, offset * 2, data, mem_mask);
170170   else
171      k056832_ram_word_w(k056832, (offset - 0x1000 / 2) * 2 + 1, data, mem_mask);
171      k056832_ram_word_w(k056832, space, (offset - 0x1000 / 2) * 2 + 1, data, mem_mask);
172172}
173173
174174
r17961r17962
201201{
202202   device_t *device = machine().device("ide");
203203   if (offset & 0x01)
204      return ide_controller16_r(device, IDE_STD_OFFSET + offset/2, 0xff00) >> 8;
204      return ide_controller16_r(device, space, IDE_STD_OFFSET + offset/2, 0xff00) >> 8;
205205   else
206      return ide_controller16_r(device, IDE_STD_OFFSET + offset/2, 0xffff);
206      return ide_controller16_r(device, space, IDE_STD_OFFSET + offset/2, 0xffff);
207207}
208208
209209WRITE16_MEMBER(qdrmfgp_state::ide_std_w)
210210{
211211   device_t *device = machine().device("ide");
212212   if (offset & 0x01)
213      ide_controller16_w(device, IDE_STD_OFFSET + offset/2, data << 8, 0xff00);
213      ide_controller16_w(device, space, IDE_STD_OFFSET + offset/2, data << 8, 0xff00);
214214   else
215      ide_controller16_w(device, IDE_STD_OFFSET + offset/2, data, 0xffff);
215      ide_controller16_w(device, space, IDE_STD_OFFSET + offset/2, data, 0xffff);
216216}
217217
218218READ16_MEMBER(qdrmfgp_state::ide_alt_r)
219219{
220220   device_t *device = machine().device("ide");
221221   if (offset == 0)
222      return ide_controller16_r(device, IDE_ALT_OFFSET, 0x00ff);
222      return ide_controller16_r(device, space, IDE_ALT_OFFSET, 0x00ff);
223223
224224   return 0;
225225}
r17961r17962
228228{
229229   device_t *device = machine().device("ide");
230230   if (offset == 0)
231      ide_controller16_w(device, IDE_ALT_OFFSET, data, 0x00ff);
231      ide_controller16_w(device, space, IDE_ALT_OFFSET, data, 0x00ff);
232232}
233233
234234
r17961r17962
251251               break;
252252         }
253253      }
254      return ide_controller16_r(device, IDE_STD_OFFSET + offset/2, 0xff00) >> 8;
254      return ide_controller16_r(device, space, IDE_STD_OFFSET + offset/2, 0xff00) >> 8;
255255   } else {
256      return ide_controller16_r(device, IDE_STD_OFFSET + offset/2, 0xffff);
256      return ide_controller16_r(device, space, IDE_STD_OFFSET + offset/2, 0xffff);
257257   }
258258}
259259
trunk/src/mame/drivers/wiz.c
r17961r17962
185185
186186      // explosion sound trigger(analog?)
187187      case 0x08:
188         discrete_sound_w(discrete, STINGER_BOOM_EN1, m_dsc1);
189         discrete_sound_w(discrete, STINGER_BOOM_EN2, m_dsc1^=1);
188         discrete_sound_w(discrete, space, STINGER_BOOM_EN1, m_dsc1);
189         discrete_sound_w(discrete, space, STINGER_BOOM_EN2, m_dsc1^=1);
190190      break;
191191
192192      // player shot sound trigger(analog?)
193193      case 0x0a:
194         discrete_sound_w(discrete, STINGER_SHOT_EN1, m_dsc0);
195         discrete_sound_w(discrete, STINGER_SHOT_EN2, m_dsc0^=1);
194         discrete_sound_w(discrete, space, STINGER_SHOT_EN1, m_dsc0);
195         discrete_sound_w(discrete, space, STINGER_SHOT_EN2, m_dsc0^=1);
196196      break;
197197   }
198198}
trunk/src/mame/drivers/galaxian.c
r17961r17962
515515{
516516   /* the decoding here is very simplistic, and you can address both simultaneously */
517517   UINT8 result = 0xff;
518   if (offset & 0x20) result &= ay8910_r(machine().device("8910.1"), 0);
519   if (offset & 0x80) result &= ay8910_r(machine().device("8910.0"), 0);
518   if (offset & 0x20) result &= ay8910_r(machine().device("8910.1"), space, 0);
519   if (offset & 0x80) result &= ay8910_r(machine().device("8910.0"), space, 0);
520520   return result;
521521}
522522
r17961r17962
526526   /* AV 4,5 ==> AY8910 #2 */
527527   /* the decoding here is very simplistic, and you can address two simultaneously */
528528   if (offset & 0x10)
529      ay8910_address_w(machine().device("8910.1"), 0, data);
529      ay8910_address_w(machine().device("8910.1"), space, 0, data);
530530   else if (offset & 0x20)
531      ay8910_data_w(machine().device("8910.1"), 0, data);
531      ay8910_data_w(machine().device("8910.1"), space, 0, data);
532532   /* AV6,7 ==> AY8910 #1 */
533533   if (offset & 0x40)
534      ay8910_address_w(machine().device("8910.0"), 0, data);
534      ay8910_address_w(machine().device("8910.0"), space, 0, data);
535535   else if (offset & 0x80)
536      ay8910_data_w(machine().device("8910.0"), 0, data);
536      ay8910_data_w(machine().device("8910.0"), space, 0, data);
537537}
538538
539539
r17961r17962
604604
605605            /* low bit goes to 0.22uF capacitor = 220000pF  */
606606            /* high bit goes to 0.047uF capacitor = 47000pF */
607            discrete_sound_w(discrete, NODE(3 * which + chan + 11), bits);
607            discrete_sound_w(discrete, space, NODE(3 * which + chan + 11), bits);
608608         }
609609}
610610
r17961r17962
906906{
907907   /* the decoding here is very simplistic */
908908   UINT8 result = 0xff;
909   if (offset & 0x40) result &= ay8910_r(machine().device("8910.0"), 0);
909   if (offset & 0x40) result &= ay8910_r(machine().device("8910.0"), space, 0);
910910   return result;
911911}
912912
r17961r17962
916916   /* the decoding here is very simplistic */
917917   /* AV6,7 ==> AY8910 #1 */
918918   if (offset & 0x40)
919      ay8910_data_w(machine().device("8910.0"), 0, data);
919      ay8910_data_w(machine().device("8910.0"), space, 0, data);
920920   else if (offset & 0x80)
921      ay8910_address_w(machine().device("8910.0"), 0, data);
921      ay8910_address_w(machine().device("8910.0"), space, 0, data);
922922}
923923
924924
r17961r17962
985985{
986986   /* the decoding here is very simplistic, and you can address both simultaneously */
987987   UINT8 result = 0xff;
988   if (offset & 0x08) result &= ay8910_r(machine().device("8910.2"), 0);
989   if (offset & 0x20) result &= ay8910_r(machine().device("8910.1"), 0);
990   if (offset & 0x80) result &= ay8910_r(machine().device("8910.0"), 0);
988   if (offset & 0x08) result &= ay8910_r(machine().device("8910.2"), space, 0);
989   if (offset & 0x20) result &= ay8910_r(machine().device("8910.1"), space, 0);
990   if (offset & 0x80) result &= ay8910_r(machine().device("8910.0"), space, 0);
991991   return result;
992992}
993993
r17961r17962
995995WRITE8_MEMBER(galaxian_state::scorpion_ay8910_w)
996996{
997997   /* the decoding here is very simplistic, and you can address all six simultaneously */
998   if (offset & 0x04) ay8910_address_w(machine().device("8910.2"), 0, data);
999   if (offset & 0x08) ay8910_data_w(machine().device("8910.2"), 0, data);
1000   if (offset & 0x10) ay8910_address_w(machine().device("8910.1"), 0, data);
1001   if (offset & 0x20) ay8910_data_w(machine().device("8910.1"), 0, data);
1002   if (offset & 0x40) ay8910_address_w(machine().device("8910.0"), 0, data);
1003   if (offset & 0x80) ay8910_data_w(machine().device("8910.0"), 0, data);
998   if (offset & 0x04) ay8910_address_w(machine().device("8910.2"), space, 0, data);
999   if (offset & 0x08) ay8910_data_w(machine().device("8910.2"), space, 0, data);
1000   if (offset & 0x10) ay8910_address_w(machine().device("8910.1"), space, 0, data);
1001   if (offset & 0x20) ay8910_data_w(machine().device("8910.1"), space, 0, data);
1002   if (offset & 0x40) ay8910_address_w(machine().device("8910.0"), space, 0, data);
1003   if (offset & 0x80) ay8910_data_w(machine().device("8910.0"), space, 0, data);
10041004}
10051005
10061006
r17961r17962
11151115         /* bit 0 = WRITE */
11161116         /* bit 1 = C/D */
11171117         if ((offset & 1) != 0)
1118            ay8910_data_address_w(machine().device("aysnd"), offset >> 1, m_zigzag_ay8910_latch);
1118            ay8910_data_address_w(machine().device("aysnd"), space, offset >> 1, m_zigzag_ay8910_latch);
11191119         break;
11201120
11211121      case 0x100:
r17961r17962
12081208WRITE8_MEMBER(galaxian_state::mshuttle_ay8910_control_w)
12091209{
12101210   if (!m_mshuttle_ay8910_cs)
1211      ay8910_address_w(machine().device("aysnd"), offset, data);
1211      ay8910_address_w(machine().device("aysnd"), space, offset, data);
12121212}
12131213
12141214
12151215WRITE8_MEMBER(galaxian_state::mshuttle_ay8910_data_w)
12161216{
12171217   if (!m_mshuttle_ay8910_cs)
1218      ay8910_data_w(machine().device("aysnd"), offset, data);
1218      ay8910_data_w(machine().device("aysnd"), space, offset, data);
12191219}
12201220
12211221
12221222READ8_MEMBER(galaxian_state::mshuttle_ay8910_data_r)
12231223{
12241224   if (!m_mshuttle_ay8910_cs)
1225      return ay8910_r(machine().device("aysnd"), offset);
1225      return ay8910_r(machine().device("aysnd"), space, offset);
12261226   return 0xff;
12271227}
12281228
trunk/src/mame/drivers/flstory.c
r17961r17962
997997
998998static const msm5232_interface msm5232_config =
999999{
1000   { 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6 }   /* 1.0 uF capacitors (verified on real PCB) */
1000   { 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6 },   /* 1.0 uF capacitors (verified on real PCB) */
1001   DEVCB_NULL
10011002};
10021003
10031004
trunk/src/mame/drivers/segag80r.c
r17961r17962
188188WRITE8_MEMBER(segag80r_state::monsterb_vidram_w){ monsterb_videoram_w(space, decrypt_offset(&space, offset), data); }
189189WRITE8_MEMBER(segag80r_state::pignewt_vidram_w){ pignewt_videoram_w(space, decrypt_offset(&space, offset), data); }
190190WRITE8_MEMBER(segag80r_state::sindbadm_vidram_w){ sindbadm_videoram_w(space, decrypt_offset(&space, offset), data); }
191WRITE8_MEMBER(segag80r_state::usb_ram_w){ device_t *device = machine().device("usbsnd"); sega_usb_ram_w(device, decrypt_offset(machine().device("maincpu")->memory().space(AS_PROGRAM), offset), data); }
191WRITE8_MEMBER(segag80r_state::usb_ram_w){ device_t *device = machine().device("usbsnd"); sega_usb_ram_w(device, space, decrypt_offset(machine().device("maincpu")->memory().space(AS_PROGRAM), offset), data); }
192192
193193
194194
trunk/src/mame/drivers/tmnt.c
r17961r17962
8686   /* some games have the A12 line not connected, so the chip spans */
8787   /* twice the memory range, with mirroring */
8888   offset = ((offset & 0x3000) >> 1) | (offset & 0x07ff);
89   return k052109_word_r(m_k052109, offset, mem_mask);
89   return k052109_word_r(m_k052109, space, offset, mem_mask);
9090}
9191
9292WRITE16_MEMBER(tmnt_state::k052109_word_noA12_w)
r17961r17962
9595   /* some games have the A12 line not connected, so the chip spans */
9696   /* twice the memory range, with mirroring */
9797   offset = ((offset & 0x3000) >> 1) | (offset & 0x07ff);
98   k052109_word_w(m_k052109, offset, data, mem_mask);
98   k052109_word_w(m_k052109, space, offset, data, mem_mask);
9999}
100100
101101WRITE16_MEMBER(tmnt_state::punkshot_k052109_word_w)
r17961r17962
104104   /* it seems that a word write is supposed to affect only the MSB. The */
105105   /* "ROUND 1" text in punkshtj goes lost otherwise. */
106106   if (ACCESSING_BITS_8_15)
107      k052109_w(m_k052109, offset, (data >> 8) & 0xff);
107      k052109_w(m_k052109, space, offset, (data >> 8) & 0xff);
108108   else if (ACCESSING_BITS_0_7)
109      k052109_w(m_k052109, offset + 0x2000, data & 0xff);
109      k052109_w(m_k052109, space, offset + 0x2000, data & 0xff);
110110}
111111
112112WRITE16_MEMBER(tmnt_state::punkshot_k052109_word_noA12_w)
r17961r17962
129129   else
130130   {
131131      offset = ((offset & 0x000e) >> 1) | ((offset & 0x1fc0) >> 3);
132      return k053245_word_r(m_k053245, offset, mem_mask);
132      return k053245_word_r(m_k053245, space, offset, mem_mask);
133133   }
134134}
135135
r17961r17962
141141   if (!(offset & 0x0031))
142142   {
143143      offset = ((offset & 0x000e) >> 1) | ((offset & 0x1fc0) >> 3);
144      k053245_word_w(m_k053245, offset, data, mem_mask);
144      k053245_word_w(m_k053245, space, offset, data, mem_mask);
145145   }
146146}
147147
r17961r17962
150150
151151   offset &= ~1;   /* handle mirror address */
152152
153   return k053244_r(m_k053245, offset + 1) | (k053244_r(m_k053245, offset) << 8);
153   return k053244_r(m_k053245, space, offset + 1) | (k053244_r(m_k053245, space, offset) << 8);
154154}
155155
156156WRITE16_MEMBER(tmnt_state::k053244_word_noA1_w)
r17961r17962
159159   offset &= ~1;   /* handle mirror address */
160160
161161   if (ACCESSING_BITS_8_15)
162      k053244_w(m_k053245, offset, (data >> 8) & 0xff);
162      k053244_w(m_k053245, space, offset, (data >> 8) & 0xff);
163163   if (ACCESSING_BITS_0_7)
164      k053244_w(m_k053245, offset + 1, data & 0xff);
164      k053244_w(m_k053245, space, offset + 1, data & 0xff);
165165}
166166
167167static INTERRUPT_GEN(cuebrick_interrupt)
r17961r17962
201201   device_t *device = machine().device("k053260");
202202   /* If the sound CPU is running, read the status, otherwise
203203       just make it pass the test */
204   return k053260_r(device, 2 + offset);
204   return k053260_r(device, space, 2 + offset);
205205}
206206
207207WRITE8_MEMBER(tmnt_state::glfgreat_sound_w)
208208{
209209   device_t *device = machine().device("k053260");
210   k053260_w(device, offset, data);
210   k053260_w(device, space, offset, data);
211211
212212   if (offset)
213213      m_audiocpu->set_input_line_and_vector(0, HOLD_LINE, 0xff);
r17961r17962
376376         data = -space.read_word(0x105818);
377377         data = ((data / 8 - 4) & 0x1f) * 0x40;
378378         data += ((space.read_word(0x105cb0) +
379                  256 * k052109_r(m_k052109, 0x1a01) + k052109_r(m_k052109, 0x1a00) - 6) / 8 + 12) & 0x3f;
379                  256 * k052109_r(m_k052109, space, 0x1a01) + k052109_r(m_k052109, space, 0x1a00) - 6) / 8 + 12) & 0x3f;
380380         return data;
381381
382382      default:
r17961r17962
403403         {
404404            if ((space.read_word(0x180006 + 128 * i) >> 8) == logical_pri)
405405            {
406               k053245_word_w(m_k053245, 8 * i, hardware_pri, 0x00ff);
406               k053245_word_w(m_k053245, space, 8 * i, hardware_pri, 0x00ff);
407407               hardware_pri++;
408408            }
409409         }
r17961r17962
697697
698698   if (ACCESSING_BITS_8_15)
699699   {
700      k053251_w(m_k053251, offset, (data >> 8) & 0xff);
700      k053251_w(m_k053251, space, offset, (data >> 8) & 0xff);
701701
702702      /* FIXME: in the old code k052109 tilemaps were tilemaps 2,3,4 for k053251
703703        and got marked as dirty in the write above... how was the original hardware working?!? */
r17961r17962
785785      if (!(offs & 0x0031))
786786      {
787787         offs = ((offs & 0x000e) >> 1) | ((offs & 0x1fc0) >> 3);
788         k053245_word_w(state->m_k053245, offs, data, 0xffff);
788         k053245_word_w(state->m_k053245, *space, offs, data, 0xffff);
789789      }
790790   }
791791   else if (addr >= 0x104000 / 2 && addr <= 0x107fff / 2)
trunk/src/mame/drivers/berzerk.c
r17961r17962
548548
549549   /* offset 6 writes to the sfxcontrol latch */
550550   case 6:
551      exidy_sfxctrl_w(machine().device("exidy"), data >> 6, data);
551      exidy_sfxctrl_w(machine().device("exidy"), space, data >> 6, data);
552552      break;
553553
554554   /* everything else writes to the 6840 */
555555   default:
556      exidy_sh6840_w(machine().device("exidy"), offset, data);
556      exidy_sh6840_w(machine().device("exidy"), space, offset, data);
557557      break;
558558
559559   }
r17961r17962
574574      return 0;
575575   /* everything else reads from the 6840 */
576576   default:
577      return exidy_sh6840_r(machine().device("exidy"), offset);
577      return exidy_sh6840_r(machine().device("exidy"), space, offset);
578578   }
579579}
580580
trunk/src/mame/drivers/spy.c
r17961r17962
356356   if (k052109_get_rmrd_line(m_k052109) == CLEAR_LINE)
357357   {
358358      if (offset >= 0x3800 && offset < 0x3808)
359         return k051937_r(m_k051960, offset - 0x3800);
359         return k051937_r(m_k051960, space, offset - 0x3800);
360360      else if (offset < 0x3c00)
361         return k052109_r(m_k052109, offset);
361         return k052109_r(m_k052109, space, offset);
362362      else
363         return k051960_r(m_k051960, offset - 0x3c00);
363         return k051960_r(m_k051960, space, offset - 0x3c00);
364364   }
365365   else
366      return k052109_r(m_k052109, offset);
366      return k052109_r(m_k052109, space, offset);
367367}
368368
369369WRITE8_MEMBER(spy_state::k052109_051960_w)
370370{
371371
372372   if (offset >= 0x3800 && offset < 0x3808)
373      k051937_w(m_k051960, offset - 0x3800, data);
373      k051937_w(m_k051960, space, offset - 0x3800, data);
374374   else if (offset < 0x3c00)
375      k052109_w(m_k052109, offset, data);
375      k052109_w(m_k052109, space, offset, data);
376376   else
377      k051960_w(m_k051960, offset - 0x3c00, data);
377      k051960_w(m_k051960, space, offset - 0x3c00, data);
378378}
379379
380380static ADDRESS_MAP_START( spy_map, AS_PROGRAM, 8, spy_state )
trunk/src/mame/drivers/model3.c
r17961r17962
16381638         model3_set_irq_line(machine(), 0x40, CLEAR_LINE);
16391639
16401640         // send to the sound board
1641         scsp_midi_in(machine().device("scsp1"), 0, data, 0);
1641         scsp_midi_in(machine().device("scsp1"), space, 0, data, 0);
16421642
16431643         if (m_sound_irq_enable)
16441644         {
trunk/src/mame/drivers/ironhors.c
r17961r17962
4646WRITE8_MEMBER(ironhors_state::ironhors_filter_w)
4747{
4848   device_t *device = machine().device("disc_ih");
49   discrete_sound_w(device, NODE_11, (data & 0x04) >> 2);
50   discrete_sound_w(device, NODE_12, (data & 0x02) >> 1);
51   discrete_sound_w(device, NODE_13, (data & 0x01) >> 0);
49   discrete_sound_w(device, space, NODE_11, (data & 0x04) >> 2);
50   discrete_sound_w(device, space, NODE_12, (data & 0x02) >> 1);
51   discrete_sound_w(device, space, NODE_13, (data & 0x01) >> 0);
5252}
5353
5454/*************************************
trunk/src/mame/drivers/spiders.c
r17961r17962
387387   1,               /* A pin - driven by the CRTC */
388388   1,               /* B pin - pulled high */
389389   1,               /* Clear pin - pulled high */
390   ic60_74123_output_changed
390   DEVCB_HANDLER(ic60_74123_output_changed)
391391};
392392
393393
r17961r17962
500500
501501WRITE_LINE_MEMBER(spiders_state::display_enable_changed)
502502{
503   ttl74123_a_w(machine().device("ic60"), 0, state);
503   address_space &space = generic_space();
504   ttl74123_a_w(machine().device("ic60"), space, 0, state);
504505}
505506
506507
trunk/src/mame/drivers/mlanding.c
r17961r17962
348348{
349349   device_t *tc0140syt = machine().device("tc0140syt");
350350   if (offset == 0)
351      tc0140syt_port_w(tc0140syt, 0, data & 0xff);
351      tc0140syt_port_w(tc0140syt, space, 0, data & 0xff);
352352   else if (offset == 1)
353353   {
354354      //machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
355      tc0140syt_comm_w(tc0140syt, 0, data & 0xff);
355      tc0140syt_comm_w(tc0140syt, space, 0, data & 0xff);
356356   }
357357}
358358
r17961r17962
360360{
361361   device_t *tc0140syt = machine().device("tc0140syt");
362362   if (offset == 0)
363      tc0140syt_slave_port_w(tc0140syt, 0, data & 0xff);
363      tc0140syt_slave_port_w(tc0140syt, space, 0, data & 0xff);
364364   else if (offset == 1)
365365   {
366366      //machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_NMI, CLEAR_LINE);
367      tc0140syt_slave_comm_w(tc0140syt, 0, data & 0xff);
367      tc0140syt_slave_comm_w(tc0140syt, space, 0, data & 0xff);
368368   }
369369}
370370
trunk/src/mame/drivers/neoprint.c
r17961r17962
136136   //if(space.device().safe_pc() != 0x4b38 )//&& space.device().safe_pc() != 0x5f86 && space.device().safe_pc() != 0x5f90)
137137   //  printf("%08x\n",space.device().safe_pc());
138138
139   return (upd4990a_databit_r(machine().device("upd4990a"), 0) << 15);
139   return (upd4990a_databit_r(machine().device("upd4990a"), space, 0) << 15);
140140}
141141
142142WRITE16_MEMBER(neoprint_state::neoprint_calendar_w)
143143{
144    upd4990a_control_16_w(machine().device("upd4990a"), 0, ((data >> 8) & 7), mem_mask);
144    upd4990a_control_16_w(machine().device("upd4990a"), space, 0, ((data >> 8) & 7), mem_mask);
145145}
146146
147147READ8_MEMBER(neoprint_state::neoprint_unk_r)
trunk/src/mame/drivers/seattle.c
r17961r17962
10681068            }
10691069
10701070            /* write the data and advance */
1071            voodoo_w(state->m_voodoo, (dstaddr & 0xffffff) / 4, space->read_dword(srcaddr), 0xffffffff);
1071            voodoo_w(state->m_voodoo, *space, (dstaddr & 0xffffff) / 4, space->read_dword(srcaddr), 0xffffffff);
10721072            srcaddr += srcinc;
10731073            dstaddr += dstinc;
10741074            bytesleft -= 4;
r17961r17962
13531353   /* if we're not stalled, just write and get out */
13541354   if (!m_voodoo_stalled)
13551355   {
1356      voodoo_w(m_voodoo, offset, data, mem_mask);
1356      voodoo_w(m_voodoo, space, offset, data, mem_mask);
13571357      return;
13581358   }
13591359
r17961r17962
14191419      {
14201420         /* if the CPU had a pending write, do it now */
14211421         if (state->m_cpu_stalled_on_voodoo)
1422            voodoo_w(device, state->m_cpu_stalled_offset, state->m_cpu_stalled_data, state->m_cpu_stalled_mem_mask);
1422         {
1423            address_space &space = *device->machine().firstcpu->space(AS_PROGRAM);
1424            voodoo_w(device, space, state->m_cpu_stalled_offset, state->m_cpu_stalled_data, state->m_cpu_stalled_mem_mask);
1425         }
14231426         state->m_cpu_stalled_on_voodoo = FALSE;
14241427
14251428         /* resume CPU execution */
r17961r17962
15231526{
15241527   device_t *device = machine().device("ethernet");
15251528   if (!(offset & 8))
1526      return smc91c9x_r(device, offset & 7, mem_mask & 0xffff);
1529      return smc91c9x_r(device, space, offset & 7, mem_mask & 0xffff);
15271530   else
1528      return smc91c9x_r(device, offset & 7, mem_mask & 0x00ff);
1531      return smc91c9x_r(device, space, offset & 7, mem_mask & 0x00ff);
15291532}
15301533
15311534
r17961r17962
15331536{
15341537   device_t *device = machine().device("ethernet");
15351538   if (!(offset & 8))
1536      smc91c9x_w(device, offset & 7, data & 0xffff, mem_mask | 0xffff);
1539      smc91c9x_w(device, space, offset & 7, data & 0xffff, mem_mask | 0xffff);
15371540   else
1538      smc91c9x_w(device, offset & 7, data & 0x00ff, mem_mask | 0x00ff);
1541      smc91c9x_w(device, space, offset & 7, data & 0x00ff, mem_mask | 0x00ff);
15391542}
15401543
15411544
r17961r17962
15891592         break;
15901593
15911594      case WREG_ETHER_DATA:
1592         result = smc91c9x_r(device, m_widget.ethernet_addr & 7, mem_mask & 0xffff);
1595         result = smc91c9x_r(device, space, m_widget.ethernet_addr & 7, mem_mask & 0xffff);
15931596         break;
15941597   }
15951598
r17961r17962
16211624         break;
16221625
16231626      case WREG_ETHER_DATA:
1624         smc91c9x_w(device, m_widget.ethernet_addr & 7, data & 0xffff, mem_mask & 0xffff);
1627         smc91c9x_w(device, space, m_widget.ethernet_addr & 7, data & 0xffff, mem_mask & 0xffff);
16251628         break;
16261629   }
16271630}
r17961r17962
17841787   /* note that blitz times out if we don't have this cycle stealing */
17851788   if (offset == 0x3f6/4)
17861789      machine().device("maincpu")->execute().eat_cycles(100);
1787   return ide_controller32_r(device, offset, mem_mask);
1790   return ide_controller32_r(device, space, offset, mem_mask);
17881791}
17891792
17901793static ADDRESS_MAP_START( seattle_map, AS_PROGRAM, 32, seattle_state )
trunk/src/mame/drivers/atarisy1.c
r17961r17962
402402WRITE8_MEMBER(atarisy1_state::via_pa_w)
403403{
404404   device_t *device = machine().device("tms");
405   tms5220_data_w(device, 0, data);
405   tms5220_data_w(device, space, 0, data);
406406}
407407
408408
409409READ8_MEMBER(atarisy1_state::via_pa_r)
410410{
411411   device_t *device = machine().device("tms");
412   return tms5220_status_r(device, 0);
412   return tms5220_status_r(device, space, 0);
413413}
414414
415415
trunk/src/mame/drivers/circusc.c
r17961r17962
128128
129129      /* CS6 */
130130      case 4:
131         discrete_sound_w(m_discrete, NODE_05, (offset & 0x20) >> 5);
132         discrete_sound_w(m_discrete, NODE_06, (offset & 0x18) >> 3);
133         discrete_sound_w(m_discrete, NODE_07, (offset & 0x40) >> 6);
131         discrete_sound_w(m_discrete, space, NODE_05, (offset & 0x20) >> 5);
132         discrete_sound_w(m_discrete, space, NODE_06, (offset & 0x18) >> 3);
133         discrete_sound_w(m_discrete, space, NODE_07, (offset & 0x40) >> 6);
134134         break;
135135   }
136136}
trunk/src/mame/drivers/bagman.c
r17961r17962
8181      case 0:
8282      case 1:
8383      case 2:
84         tmsprom_bit_w(device, 0, 7 - ((m_ls259_buf[0]<<2) | (m_ls259_buf[1]<<1) | (m_ls259_buf[2]<<0)));
84         tmsprom_bit_w(device, space, 0, 7 - ((m_ls259_buf[0]<<2) | (m_ls259_buf[1]<<1) | (m_ls259_buf[2]<<0)));
8585         break;
8686      case 3:
8787         tmsprom_enable_w(device, m_ls259_buf[offset]);
8888         break;
8989      case 4:
90         tmsprom_rom_csq_w(device, 0, m_ls259_buf[offset]);
90         tmsprom_rom_csq_w(device, space, 0, m_ls259_buf[offset]);
9191         break;
9292      case 5:
93         tmsprom_rom_csq_w(device, 1, m_ls259_buf[offset]);
93         tmsprom_rom_csq_w(device, space, 1, m_ls259_buf[offset]);
9494         break;
9595      }
9696   }
trunk/src/mame/drivers/bigevglf.c
r17961r17962
413413
414414static const msm5232_interface msm5232_config =
415415{
416   { 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6 }   /* 0.65 (???) uF capacitors */
416   { 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6 },   /* 0.65 (???) uF capacitors */
417   DEVCB_NULL
417418};
418419
419420void bigevglf_state::machine_start()
trunk/src/mame/drivers/ghosteo.c
r17961r17962
557557
558558READ32_MEMBER(ghosteo_state::bballoon_speedup_r)
559559{
560   UINT32 ret = s3c2410_lcd_r(s3c2410, offset+0x10/4, mem_mask);
560   UINT32 ret = s3c2410_lcd_r(s3c2410, space, offset+0x10/4, mem_mask);
561561
562562
563563   int pc = space.device().safe_pc();
trunk/src/mame/drivers/kncljoe.c
r17961r17962
7676   {
7777      /* control or data port? */
7878      if (m_port2 & 0x08)
79         ay8910_data_address_w(device, m_port2 >> 2, m_port1);
79         ay8910_data_address_w(device, space, m_port2 >> 2, m_port1);
8080   }
8181   m_port2 = data;
8282}
r17961r17962
8686   device_t *device = machine().device("aysnd");
8787
8888   if (m_port2 & 0x08)
89      return ay8910_r(device, 0);
89      return ay8910_r(device, space, 0);
9090   return 0xff;
9191}
9292
trunk/src/mame/drivers/cvs.c
r17961r17962
156156   if (*m_fo_state)
157157      return m_character_ram[(0 * 0x800) | 0x400 | m_character_ram_page_start | offset];
158158   else
159      return s2636_work_ram_r(m_s2636_0, offset);
159      return s2636_work_ram_r(m_s2636_0, space, offset);
160160}
161161
162162WRITE8_MEMBER(cvs_state::cvs_s2636_0_or_character_ram_w)
r17961r17962
169169      machine().gfx[1]->mark_dirty((offset / 8) % 256);
170170   }
171171   else
172      s2636_work_ram_w(m_s2636_0, offset, data);
172      s2636_work_ram_w(m_s2636_0, space, offset, data);
173173}
174174
175175
r17961r17962
179179   if (*m_fo_state)
180180      return m_character_ram[(1 * 0x800) | 0x400 | m_character_ram_page_start | offset];
181181   else
182      return s2636_work_ram_r(m_s2636_1, offset);
182      return s2636_work_ram_r(m_s2636_1, space, offset);
183183}
184184
185185WRITE8_MEMBER(cvs_state::cvs_s2636_1_or_character_ram_w)
r17961r17962
192192      machine().gfx[1]->mark_dirty((offset / 8) % 256);
193193   }
194194   else
195      s2636_work_ram_w(m_s2636_1, offset, data);
195      s2636_work_ram_w(m_s2636_1, space, offset, data);
196196}
197197
198198
r17961r17962
202202   if (*m_fo_state)
203203      return m_character_ram[(2 * 0x800) | 0x400 | m_character_ram_page_start | offset];
204204   else
205      return s2636_work_ram_r(m_s2636_2, offset);
205      return s2636_work_ram_r(m_s2636_2, space, offset);
206206}
207207
208208WRITE8_MEMBER(cvs_state::cvs_s2636_2_or_character_ram_w)
r17961r17962
215215      machine().gfx[1]->mark_dirty((offset / 8) % 256);
216216   }
217217   else
218      s2636_work_ram_w(m_s2636_2, offset, data);
218      s2636_work_ram_w(m_s2636_2, space, offset, data);
219219}
220220
221221
r17961r17962
290290READ8_MEMBER(cvs_state::tms_clock_r)
291291{
292292   device_t *device = machine().device("tms");
293   return tms5110_romclk_hack_r(device, 0) ? 0x80 : 0;
293   return tms5110_romclk_hack_r(device, space, 0) ? 0x80 : 0;
294294}
295295
296296static TIMER_CALLBACK( cvs_393hz_timer_cb )
r17961r17962
390390
391391   /* FIXME: this was by observation on board ???
392392     *          -bit 7 is TMS status (active LO) */
393   return ((tms5110_ctl_r(m_tms, 0) ^ 1) << 7) | (soundlatch_byte_r(space, 0) & 0x7f);
393   return ((tms5110_ctl_r(m_tms, space, 0) ^ 1) << 7) | (soundlatch_byte_r(space, 0) & 0x7f);
394394}
395395
396396
r17961r17962
409409        (m_tms5110_ctl_data[1] << 3);   /* CTL8 */
410410
411411   LOG(("CVS: Speech CTL = %04x %02x %02x\n",  ctl, offset, data));
412   tms5110_ctl_w(device, 0, ctl);
412   tms5110_ctl_w(device, space, 0, ctl);
413413}
414414
415415
trunk/src/mame/drivers/warriorb.c
r17961r17962
181181{
182182
183183   if (offset == 0)
184      tc0140syt_port_w(m_tc0140syt, 0, data & 0xff);
184      tc0140syt_port_w(m_tc0140syt, space, 0, data & 0xff);
185185   else if (offset == 1)
186      tc0140syt_comm_w(m_tc0140syt, 0, data & 0xff);
186      tc0140syt_comm_w(m_tc0140syt, space, 0, data & 0xff);
187187}
188188
189189READ16_MEMBER(warriorb_state::warriorb_sound_r)
190190{
191191
192192   if (offset == 1)
193      return ((tc0140syt_comm_r(m_tc0140syt, 0) & 0xff));
193      return ((tc0140syt_comm_r(m_tc0140syt, space, 0) & 0xff));
194194   else
195195      return 0;
196196}
r17961r17962
218218WRITE16_MEMBER(warriorb_state::tc0100scn_dual_screen_w)
219219{
220220
221   tc0100scn_word_w(m_tc0100scn_1, offset, data, mem_mask);
222   tc0100scn_word_w(m_tc0100scn_2, offset, data, mem_mask);
221   tc0100scn_word_w(m_tc0100scn_1, space, offset, data, mem_mask);
222   tc0100scn_word_w(m_tc0100scn_2, space, offset, data, mem_mask);
223223}
224224
225225/***********************************************************
trunk/src/mame/drivers/blockhl.c
r17961r17962
6969   if (k052109_get_rmrd_line(m_k052109) == CLEAR_LINE)
7070   {
7171      if (offset >= 0x3800 && offset < 0x3808)
72         return k051937_r(m_k051960, offset - 0x3800);
72         return k051937_r(m_k051960, space, offset - 0x3800);
7373      else if (offset < 0x3c00)
74         return k052109_r(m_k052109, offset);
74         return k052109_r(m_k052109, space, offset);
7575      else
76         return k051960_r(m_k051960, offset - 0x3c00);
76         return k051960_r(m_k051960, space, offset - 0x3c00);
7777   }
7878   else
79      return k052109_r(m_k052109, offset);
79      return k052109_r(m_k052109, space, offset);
8080}
8181
8282WRITE8_MEMBER(blockhl_state::k052109_051960_w)
8383{
8484
8585   if (offset >= 0x3800 && offset < 0x3808)
86      k051937_w(m_k051960, offset - 0x3800, data);
86      k051937_w(m_k051960, space, offset - 0x3800, data);
8787   else if (offset < 0x3c00)
88      k052109_w(m_k052109, offset, data);
88      k052109_w(m_k052109, space, offset, data);
8989   else
90      k051960_w(m_k051960, offset - 0x3c00, data);
90      k051960_w(m_k051960, space, offset - 0x3c00, data);
9191}
9292
9393
trunk/src/mame/drivers/segag80v.c
r17961r17962
202202   m_mainram[decrypt_offset(&space, offset)] = data;
203203}
204204
205WRITE8_MEMBER(segag80v_state::usb_ram_w){ sega_usb_ram_w(m_usb, decrypt_offset(machine().device("maincpu")->memory().space(AS_PROGRAM), offset), data); }
205WRITE8_MEMBER(segag80v_state::usb_ram_w){ sega_usb_ram_w(m_usb, space, decrypt_offset(machine().device("maincpu")->memory().space(AS_PROGRAM), offset), data); }
206206WRITE8_MEMBER(segag80v_state::vectorram_w)
207207{
208208   m_vectorram[decrypt_offset(&space, offset)] = data;
trunk/src/mame/drivers/bottom9.c
r17961r17962
3434   if (k052109_get_rmrd_line(m_k052109) == CLEAR_LINE)
3535   {
3636      if (offset >= 0x3800 && offset < 0x3808)
37         return k051937_r(m_k051960, offset - 0x3800);
37         return k051937_r(m_k051960, space, offset - 0x3800);
3838      else if (offset < 0x3c00)
39         return k052109_r(m_k052109, offset);
39         return k052109_r(m_k052109, space, offset);
4040      else
41         return k051960_r(m_k051960, offset - 0x3c00);
41         return k051960_r(m_k051960, space, offset - 0x3c00);
4242   }
4343   else
44      return k052109_r(m_k052109, offset);
44      return k052109_r(m_k052109, space, offset);
4545}
4646
4747WRITE8_MEMBER(bottom9_state::k052109_051960_w)
4848{
4949
5050   if (offset >= 0x3800 && offset < 0x3808)
51      k051937_w(m_k051960, offset - 0x3800, data);
51      k051937_w(m_k051960, space, offset - 0x3800, data);
5252   else if (offset < 0x3c00)
53      k052109_w(m_k052109, offset, data);
53      k052109_w(m_k052109, space, offset, data);
5454   else
55      k051960_w(m_k051960, offset - 0x3c00, data);
55      k051960_w(m_k051960, space, offset - 0x3c00, data);
5656}
5757
5858READ8_MEMBER(bottom9_state::bottom9_bankedram1_r)
r17961r17962
6363   else
6464   {
6565      if (m_zoomreadroms)
66         return k051316_rom_r(m_k051316, offset);
66         return k051316_rom_r(m_k051316, space, offset);
6767      else
68         return k051316_r(m_k051316, offset);
68         return k051316_r(m_k051316, space, offset);
6969   }
7070}
7171
r17961r17962
7575   if (m_k052109_selected)
7676      k052109_051960_w(space, offset, data);
7777   else
78      k051316_w(m_k051316, offset, data);
78      k051316_w(m_k051316, space, offset, data);
7979}
8080
8181READ8_MEMBER(bottom9_state::bottom9_bankedram2_r)
trunk/src/mame/drivers/40love.c
r17961r17962
968968
969969static const msm5232_interface msm5232_config =
970970{
971   { 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6 }   /* 1.0 uF capacitors (verified on real PCB) */
971   { 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6 },   /* 1.0 uF capacitors (verified on real PCB) */
972   DEVCB_NULL
972973};
973974
974975/*******************************************************************************/
trunk/src/mame/drivers/proconn.c
r17961r17962
3535
3636   optional_device<roc10937_t> m_vfd;
3737
38   DECLARE_WRITE8_MEMBER( ay_w0 ) { ay8910_address_data_w(m_ay, 0, data); }
39   DECLARE_WRITE8_MEMBER( ay_w1 ) { ay8910_address_data_w(m_ay, 1, data); }
38   DECLARE_WRITE8_MEMBER( ay_w0 ) { ay8910_address_data_w(m_ay, space, 0, data); }
39   DECLARE_WRITE8_MEMBER( ay_w1 ) { ay8910_address_data_w(m_ay, space, 1, data); }
4040
4141   DECLARE_WRITE8_MEMBER( ctc_w0 ) { m_z80ctc->write(space, 0, data); }
4242   DECLARE_WRITE8_MEMBER( ctc_w1 ) { m_z80ctc->write(space, 1, data); }
r17961r17962
7373   DECLARE_WRITE8_MEMBER( pio5_w2 ) { m_z80pio_5->write(space, 2, data); }
7474   DECLARE_WRITE8_MEMBER( pio5_w3 ) { m_z80pio_5->write(space, 3, data); }
7575
76   DECLARE_READ8_MEMBER( ay_r0 ) { return ay8910_r(m_ay, 0); }
76   DECLARE_READ8_MEMBER( ay_r0 ) { return ay8910_r(m_ay, space, 0); }
7777
7878   DECLARE_READ8_MEMBER( ctc_r0 ) { return m_z80ctc->read(space, 0); }
7979   DECLARE_READ8_MEMBER( ctc_r1 ) { return m_z80ctc->read(space, 1); }
r17961r17962
307307   DEVCB_NULL               // ZC/TO2 callback
308308};
309309
310static WRITE8_DEVICE_HANDLER( serial_transmit )
310static WRITE16_DEVICE_HANDLER( serial_transmit )
311311{
312312   proconn_state *state = device->machine().driver_data<proconn_state>();
313313
r17961r17962
324324}
325325
326326
327static int serial_receive(device_t *device, int channel)
327static READ16_DEVICE_HANDLER( serial_receive )
328328{
329   return 0xff;
329   return -1;
330330}
331331
332332
333333static const z80sio_interface sio_intf =
334334{
335   0,               /* interrupt handler */
336   0,               /* DTR changed handler */
337   0,               /* RTS changed handler */
338   0,               /* BREAK changed handler */
339   serial_transmit,   /* transmit handler */
340   serial_receive      /* receive handler */
335   DEVCB_NULL,               /* interrupt handler */
336   DEVCB_NULL,               /* DTR changed handler */
337   DEVCB_NULL,               /* RTS changed handler */
338   DEVCB_NULL,               /* BREAK changed handler */
339   DEVCB_HANDLER(serial_transmit),   /* transmit handler */
340   DEVCB_HANDLER(serial_receive)      /* receive handler */
341341};
342342
343343static const ay8910_interface ay8910_config =
trunk/src/mame/drivers/othunder.c
r17961r17962
340340            break;
341341
342342         default:
343            tc0220ioc_w(m_tc0220ioc, offset, data & 0xff);
343            tc0220ioc_w(m_tc0220ioc, space, offset, data & 0xff);
344344      }
345345   }
346346}
r17961r17962
359359         return (m_eeprom->read_bit() & 1) << 7;
360360
361361      default:
362         return tc0220ioc_r(m_tc0220ioc, offset);
362         return tc0220ioc_r(m_tc0220ioc, space, offset);
363363   }
364364}
365365
r17961r17962
406406WRITE16_MEMBER(othunder_state::othunder_sound_w)
407407{
408408   if (offset == 0)
409      tc0140syt_port_w(m_tc0140syt, 0, data & 0xff);
409      tc0140syt_port_w(m_tc0140syt, space, 0, data & 0xff);
410410   else if (offset == 1)
411      tc0140syt_comm_w(m_tc0140syt, 0, data & 0xff);
411      tc0140syt_comm_w(m_tc0140syt, space, 0, data & 0xff);
412412}
413413
414414READ16_MEMBER(othunder_state::othunder_sound_r)
415415{
416416   if (offset == 1)
417      return ((tc0140syt_comm_r(m_tc0140syt, 0) & 0xff));
417      return ((tc0140syt_comm_r(m_tc0140syt, space, 0) & 0xff));
418418   else
419419      return 0;
420420}
trunk/src/mame/drivers/nss.c
r17961r17962
354354
355355static READ8_DEVICE_HANDLER( spc_ram_100_r )
356356{
357   return spc_ram_r(device, offset + 0x100);
357   return spc_ram_r(device, space, offset + 0x100);
358358}
359359
360360static WRITE8_DEVICE_HANDLER( spc_ram_100_w )
361361{
362   spc_ram_w(device, offset + 0x100, data);
362   spc_ram_w(device, space, offset + 0x100, data);
363363}
364364
365365static ADDRESS_MAP_START( spc_mem, AS_PROGRAM, 8, nss_state )
r17961r17962
465465
466466   if (m_cart_sel == 0)
467467   {
468      rp5h01_enable_w(m_rp5h01, 0, 0);
469      data |= ((~rp5h01_counter_r(m_rp5h01, 0)) << 4) & 0x10;   /* D4 */
470      data |= ((rp5h01_data_r(m_rp5h01, 0)) << 3) & 0x08;      /* D3 */
471      rp5h01_enable_w(m_rp5h01, 0, 1);
468      rp5h01_enable_w(m_rp5h01, space, 0, 0);
469      data |= ((~rp5h01_counter_r(m_rp5h01, space, 0)) << 4) & 0x10;   /* D4 */
470      data |= ((rp5h01_data_r(m_rp5h01, space, 0)) << 3) & 0x08;      /* D3 */
471      rp5h01_enable_w(m_rp5h01, space, 0, 1);
472472   }
473473   else
474      rp5h01_enable_w(m_rp5h01, 0, 1);
474      rp5h01_enable_w(m_rp5h01, space, 0, 1);
475475
476476   return data;
477477}
r17961r17962
480480{
481481   if (m_cart_sel == 0)
482482   {
483      rp5h01_enable_w(m_rp5h01, 0, 0);
484      rp5h01_test_w(m_rp5h01, 0, data & 0x10);      /* D4 */
485      rp5h01_clock_w(m_rp5h01, 0, data & 0x08);      /* D3 */
486      rp5h01_cs_w(m_rp5h01, 0, ~data & 0x01);
487      rp5h01_enable_w(m_rp5h01, 0, 1);
483      rp5h01_enable_w(m_rp5h01, space, 0, 0);
484      rp5h01_test_w(m_rp5h01, space, 0, data & 0x10);      /* D4 */
485      rp5h01_clock_w(m_rp5h01, space, 0, data & 0x08);      /* D3 */
486      rp5h01_cs_w(m_rp5h01, space, 0, ~data & 0x01);
487      rp5h01_enable_w(m_rp5h01, space, 0, 1);
488488   }
489489   else
490      rp5h01_enable_w(m_rp5h01, 0, 1);
490      rp5h01_enable_w(m_rp5h01, space, 0, 1);
491491
492492   ioport("EEPROMOUT")->write(data, 0xff);
493493}
trunk/src/mame/drivers/mirage.c
r17961r17962
8787static SCREEN_UPDATE_RGB32( mirage )
8888{
8989   miragemi_state *state = screen.machine().driver_data<miragemi_state>();
90   UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, 0, 0xffff);
90   address_space &space = screen.machine().driver_data()->generic_space();
91   UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, space, 0, 0xffff);
9192
9293   state->flip_screen_set(BIT(flip, 7));
9394
trunk/src/mame/drivers/ladyfrog.c
r17961r17962
119119
120120static const msm5232_interface msm5232_config =
121121{
122   { 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6 }
122   { 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6 },
123   DEVCB_NULL
123124};
124125
125126READ8_MEMBER(ladyfrog_state::snd_flag_r)
trunk/src/mame/drivers/esripsys.c
r17961r17962
524524   {
525525      /* TMS5220 core returns status bits in D7-D6 */
526526      device_t *tms = machine().device("tms5220nl");
527      UINT8 status = tms5220_status_r(tms, 0);
527      UINT8 status = tms5220_status_r(tms, space, 0);
528528
529529      status = ((status & 0x80) >> 5) | ((status & 0x40) >> 5) | ((status & 0x20) >> 5);
530530      return (tms5220_readyq_r(tms) << 7) | (tms5220_intq_r(tms) << 6) | status;
r17961r17962
540540   if (offset == 0)
541541   {
542542      m_tms_data = data;
543      tms5220_data_w(tms, 0, m_tms_data);
543      tms5220_data_w(tms, space, 0, m_tms_data);
544544   }
545545#if 0
546546   if (offset == 1)
547547   {
548      tms5220_data_w(tms, 0, m_tms_data);
548      tms5220_data_w(tms, space, 0, m_tms_data);
549549   }
550550#endif
551551}
trunk/src/mame/drivers/ettrivia.c
r17961r17962
115115      /* special case to return the value written to 0xb000 */
116116      /* does it reset the chips too ? */
117117      case 0:   break;
118      case 0xc4: m_b000_ret = ay8910_r(machine().device("ay1"), 0);   break;
119      case 0x94: m_b000_ret = ay8910_r(machine().device("ay2"), 0);   break;
120      case 0x86: m_b000_ret = ay8910_r(machine().device("ay3"), 0);   break;
118      case 0xc4: m_b000_ret = ay8910_r(machine().device("ay1"), space, 0);   break;
119      case 0x94: m_b000_ret = ay8910_r(machine().device("ay2"), space, 0);   break;
120      case 0x86: m_b000_ret = ay8910_r(machine().device("ay3"), space, 0);   break;
121121
122122      case 0x80:
123123         switch(m_b800_prev)
124124         {
125            case 0xe0: ay8910_address_w(machine().device("ay1"),0,m_b000_val);   break;
126            case 0x98: ay8910_address_w(machine().device("ay2"),0,m_b000_val);   break;
127            case 0x83: ay8910_address_w(machine().device("ay3"),0,m_b000_val);   break;
125            case 0xe0: ay8910_address_w(machine().device("ay1"),space,0,m_b000_val);   break;
126            case 0x98: ay8910_address_w(machine().device("ay2"),space,0,m_b000_val);   break;
127            case 0x83: ay8910_address_w(machine().device("ay3"),space,0,m_b000_val);   break;
128128
129            case 0xa0: ay8910_data_w(machine().device("ay1"),0,m_b000_val);   break;
130            case 0x88: ay8910_data_w(machine().device("ay2"),0,m_b000_val);   break;
131            case 0x81: ay8910_data_w(machine().device("ay3"),0,m_b000_val);   break;
129            case 0xa0: ay8910_data_w(machine().device("ay1"),space,0,m_b000_val);   break;
130            case 0x88: ay8910_data_w(machine().device("ay2"),space,0,m_b000_val);   break;
131            case 0x81: ay8910_data_w(machine().device("ay3"),space,0,m_b000_val);   break;
132132
133133         }
134134      break;
trunk/src/mame/drivers/snk68.c
r17961r17962
165165WRITE8_MEMBER(snk68_state::D7759_write_port_0_w)
166166{
167167   device_t *device = machine().device("upd");
168   upd7759_port_w(device, 0, data);
168   upd7759_port_w(device, space, 0, data);
169169   upd7759_start_w(device, 0);
170170   upd7759_start_w(device, 1);
171171}
trunk/src/mame/drivers/madalien.c
r17961r17962
6969WRITE8_MEMBER(madalien_state::madalien_portA_w)
7070{
7171   device_t *device = machine().device("discrete");
72   discrete_sound_w(device, MADALIEN_8910_PORTA, data);
72   discrete_sound_w(device, space, MADALIEN_8910_PORTA, data);
7373}
7474WRITE8_MEMBER(madalien_state::madalien_portB_w)
7575{
7676   device_t *device = machine().device("discrete");
77   discrete_sound_w(device, MADALIEN_8910_PORTB, data);
77   discrete_sound_w(device, space, MADALIEN_8910_PORTB, data);
7878}
7979
8080
trunk/src/mame/drivers/ksys573.c
r17961r17962
14841484   switch (offset)
14851485   {
14861486   case 0x26:
1487      upd4701_y_add(upd4701, 0, ioport("uPD4701_y")->read_safe(0), 0xffff);
1488      upd4701_switches_set(upd4701, 0, ioport("uPD4701_switches")->read_safe(0));
1487      upd4701_y_add(upd4701, space, 0, ioport("uPD4701_y")->read_safe(0), 0xffff);
1488      upd4701_switches_set(upd4701, space, 0, ioport("uPD4701_switches")->read_safe(0));
14891489
1490      upd4701_cs_w(upd4701, 0, 0);
1491      upd4701_xy_w(upd4701, 0, 1);
1490      upd4701_cs_w(upd4701, space, 0, 0);
1491      upd4701_xy_w(upd4701, space, 0, 1);
14921492
14931493      if (ACCESSING_BITS_0_7)
14941494      {
1495         upd4701_ul_w(upd4701, 0, 0);
1496         data |= upd4701_d_r(upd4701, 0, 0xffff) << 0;
1495         upd4701_ul_w(upd4701, space, 0, 0);
1496         data |= upd4701_d_r(upd4701, space, 0, 0xffff) << 0;
14971497      }
14981498
14991499      if (ACCESSING_BITS_16_23)
15001500      {
1501         upd4701_ul_w(upd4701, 0, 1);
1502         data |= upd4701_d_r(upd4701, 0, 0xffff) << 16;
1501         upd4701_ul_w(upd4701, space, 0, 1);
1502         data |= upd4701_d_r(upd4701, space, 0, 0xffff) << 16;
15031503      }
15041504
1505      upd4701_cs_w(upd4701, 0, 1);
1505      upd4701_cs_w(upd4701, space, 0, 1);
15061506      break;
15071507
15081508   default:
r17961r17962
15391539   case 0x28:
15401540      if (ACCESSING_BITS_0_7)
15411541      {
1542         upd4701_resety_w(upd4701, 0, 1);
1543         upd4701_resety_w(upd4701, 0, 0);
1542         upd4701_resety_w(upd4701, space, 0, 1);
1543         upd4701_resety_w(upd4701, space, 0, 0);
15441544      }
15451545      break;
15461546
trunk/src/mame/drivers/overdriv.c
r17961r17962
137137READ8_MEMBER(overdriv_state::overdriv_1_sound_r)
138138{
139139   device_t *device = machine().device("k053260_1");
140   return k053260_r(device, 2 + offset);
140   return k053260_r(device, space, 2 + offset);
141141}
142142
143143READ8_MEMBER(overdriv_state::overdriv_2_sound_r)
144144{
145145   device_t *device = machine().device("k053260_2");
146   return k053260_r(device, 2 + offset);
146   return k053260_r(device, space, 2 + offset);
147147}
148148
149149WRITE16_MEMBER(overdriv_state::overdriv_soundirq_w)
trunk/src/mame/drivers/gsword.c
r17961r17962
293293WRITE8_MEMBER(gsword_state::gsword_AY8910_control_port_0_w)
294294{
295295   device_t *device = machine().device("ay1");
296   ay8910_address_w(device,offset,data);
296   ay8910_address_w(device,space,offset,data);
297297   m_fake8910_0 = data;
298298}
299299WRITE8_MEMBER(gsword_state::gsword_AY8910_control_port_1_w)
300300{
301301   device_t *device = machine().device("ay2");
302   ay8910_address_w(device,offset,data);
302   ay8910_address_w(device,space,offset,data);
303303   m_fake8910_1 = data;
304304}
305305
trunk/src/mame/drivers/lethal.c
r17961r17962
266266            case 0x4d:
267267            case 0x4e:
268268            case 0x4f:
269               return k053244_r(m_k053244, offset - 0x40);
269               return k053244_r(m_k053244, space, offset - 0x40);
270270
271271            case 0x80:
272272            case 0x81:
r17961r17962
300300            case 0x9d:
301301            case 0x9e:
302302            case 0x9f:
303               return k054000_r(m_k054000, offset - 0x80);
303               return k054000_r(m_k054000, space, offset - 0x80);
304304
305305            case 0xca:
306306               return sound_status_r(space, 0);
307307         }
308308      }
309309      else if (offset < 0x1800)
310         return k053245_r(m_k053244, (offset - 0x0800) & 0x07ff);
310         return k053245_r(m_k053244, space, (offset - 0x0800) & 0x07ff);
311311      else if (offset < 0x2000)
312         return k056832_ram_code_lo_r(m_k056832, offset - 0x1800);
312         return k056832_ram_code_lo_r(m_k056832, space, offset - 0x1800);
313313      else if (offset < 0x2800)
314         return k056832_ram_code_hi_r(m_k056832, offset - 0x2000);
314         return k056832_ram_code_hi_r(m_k056832, space, offset - 0x2000);
315315      else if (offset < 0x3000)
316         return k056832_ram_attr_lo_r(m_k056832, offset - 0x2800);
316         return k056832_ram_attr_lo_r(m_k056832, space, offset - 0x2800);
317317      else // (offset < 0x3800)
318         return k056832_ram_attr_hi_r(m_k056832, offset - 0x3000);
318         return k056832_ram_attr_hi_r(m_k056832, space, offset - 0x3000);
319319   }
320320
321321   return 0;
r17961r17962
358358            case 0x4d:
359359            case 0x4e:
360360            case 0x4f:
361               k053244_w(m_k053244, offset - 0x40, data);
361               k053244_w(m_k053244, space, offset - 0x40, data);
362362               break;
363363
364364            case 0x80:
r17961r17962
393393            case 0x9d:
394394            case 0x9e:
395395            case 0x9f:
396               k054000_w(m_k054000, offset - 0x80, data);
396               k054000_w(m_k054000, space, offset - 0x80, data);
397397               break;
398398
399399            default:
r17961r17962
402402         }
403403      }
404404      else if (offset < 0x1800)
405         k053245_w(m_k053244, (offset - 0x0800) & 0x07ff, data);
405         k053245_w(m_k053244, space, (offset - 0x0800) & 0x07ff, data);
406406      else if (offset < 0x2000)
407         k056832_ram_code_lo_w(m_k056832, offset - 0x1800, data);
407         k056832_ram_code_lo_w(m_k056832, space, offset - 0x1800, data);
408408      else if (offset < 0x2800)
409         k056832_ram_code_hi_w(m_k056832, offset - 0x2000, data);
409         k056832_ram_code_hi_w(m_k056832, space, offset - 0x2000, data);
410410      else if (offset < 0x3000)
411         k056832_ram_attr_lo_w(m_k056832, offset - 0x2800, data);
411         k056832_ram_attr_lo_w(m_k056832, space, offset - 0x2800, data);
412412      else // (offset < 0x3800)
413         k056832_ram_attr_hi_w(m_k056832, offset - 0x3000, data);
413         k056832_ram_attr_hi_w(m_k056832, space, offset - 0x3000, data);
414414   }
415415}
416416
trunk/src/mame/drivers/taitowlf.c
r17961r17962
119119READ8_MEMBER(taitowlf_state::at_dma8237_2_r)
120120{
121121   device_t *device = machine().device("dma8237_2");
122   return i8237_r(device, offset / 2);
122   return i8237_r(device, space, offset / 2);
123123}
124124
125125WRITE8_MEMBER(taitowlf_state::at_dma8237_2_w)
126126{
127127   device_t *device = machine().device("dma8237_2");
128   i8237_w(device, offset / 2, data);
128   i8237_w(device, space, offset / 2, data);
129129}
130130
131131// Intel 82439TX System Controller (MXTC)
r17961r17962
295295READ32_MEMBER(taitowlf_state::ide_r)
296296{
297297   device_t *device = machine().device("ide");
298   return ide_controller32_r(device, 0x1f0/4 + offset, mem_mask);
298   return ide_controller32_r(device, space, 0x1f0/4 + offset, mem_mask);
299299}
300300
301301WRITE32_MEMBER(taitowlf_state::ide_w)
302302{
303303   device_t *device = machine().device("ide");
304   ide_controller32_w(device, 0x1f0/4 + offset, data, mem_mask);
304   ide_controller32_w(device, space, 0x1f0/4 + offset, data, mem_mask);
305305}
306306
307307READ32_MEMBER(taitowlf_state::fdc_r)
308308{
309309   device_t *device = machine().device("ide");
310   return ide_controller32_r(device, 0x3f0/4 + offset, mem_mask);
310   return ide_controller32_r(device, space, 0x3f0/4 + offset, mem_mask);
311311}
312312
313313WRITE32_MEMBER(taitowlf_state::fdc_w)
314314{
315315   device_t *device = machine().device("ide");
316316   //mame_printf_debug("FDC: write %08X, %08X, %08X\n", data, offset, mem_mask);
317   ide_controller32_w(device, 0x3f0/4 + offset, data, mem_mask);
317   ide_controller32_w(device, space, 0x3f0/4 + offset, data, mem_mask);
318318}
319319
320320
trunk/src/mame/drivers/taitogn.c
r17961r17962
424424WRITE32_MEMBER(taitogn_state::rf5c296_io_w)
425425{
426426   if(offset < 2) {
427      ide_controller32_pcmcia_w(machine().device(":card"), offset, data, mem_mask);
427      ide_controller32_pcmcia_w(machine().device(":card"), space, offset, data, mem_mask);
428428      return;
429429   }
430430
r17961r17962
439439READ32_MEMBER(taitogn_state::rf5c296_io_r)
440440{
441441   if(offset < 2)
442      return ide_controller32_pcmcia_r(machine().device(":card"), offset, mem_mask);
442      return ide_controller32_pcmcia_r(machine().device(":card"), space, offset, mem_mask);
443443
444444   offset *= 4;
445445
trunk/src/mame/drivers/taito_z.c
r17961r17962
11061106         break;
11071107
11081108      default:
1109         tc0220ioc_w(m_tc0220ioc, offset, data);   /* might be a 510NIO ! */
1109         tc0220ioc_w(m_tc0220ioc, space, offset, data);   /* might be a 510NIO ! */
11101110   }
11111111}
11121112
r17961r17962
11271127{
11281128   /* Bypass TC0220IOC controller for analog input */
11291129
1130   UINT8 port = tc0220ioc_port_r(m_tc0220ioc, 0);   /* read port number */
1130   UINT8 port = tc0220ioc_port_r(m_tc0220ioc, space, 0);   /* read port number */
11311131   UINT16 steer = 0xff80 + ioport("STEER")->read_safe(0x80);
11321132
11331133   switch (port)
r17961r17962
11391139         return steer >> 8;
11401140
11411141      default:
1142         return tc0220ioc_portreg_r(m_tc0220ioc, offset);
1142         return tc0220ioc_portreg_r(m_tc0220ioc, space, offset);
11431143   }
11441144}
11451145
r17961r17962
11481148{
11491149   /* Bypass TC0220IOC controller for extra inputs */
11501150
1151   UINT8 port = tc0220ioc_port_r(m_tc0220ioc, 0);   /* read port number */
1151   UINT8 port = tc0220ioc_port_r(m_tc0220ioc, space, 0);   /* read port number */
11521152   UINT16 steer = 0xff80 + ioport("STEER")->read_safe(0x80);
11531153
11541154   switch (port)
r17961r17962
11721172         return steer >> 8;
11731173
11741174      default:
1175         return tc0220ioc_portreg_r(m_tc0220ioc, offset);
1175         return tc0220ioc_portreg_r(m_tc0220ioc, space, offset);
11761176   }
11771177}
11781178
r17961r17962
12611261         return m_eeprom->read_bit() << 7;
12621262
12631263      default:
1264         return tc0220ioc_r(m_tc0220ioc, offset);   /* might be a 510NIO ! */
1264         return tc0220ioc_r(m_tc0220ioc, space, offset);   /* might be a 510NIO ! */
12651265   }
12661266}
12671267
r17961r17962
14221422WRITE16_MEMBER(taitoz_state::taitoz_sound_w)
14231423{
14241424   if (offset == 0)
1425      tc0140syt_port_w(m_tc0140syt, 0, data & 0xff);
1425      tc0140syt_port_w(m_tc0140syt, space, 0, data & 0xff);
14261426   else if (offset == 1)
1427      tc0140syt_comm_w(m_tc0140syt, 0, data & 0xff);
1427      tc0140syt_comm_w(m_tc0140syt, space, 0, data & 0xff);
14281428
14291429#ifdef MAME_DEBUG
14301430//  if (data & 0xff00)
r17961r17962
14401440READ16_MEMBER(taitoz_state::taitoz_sound_r)
14411441{
14421442   if (offset == 1)
1443      return (tc0140syt_comm_r(m_tc0140syt, 0) & 0xff);
1443      return (tc0140syt_comm_r(m_tc0140syt, space, 0) & 0xff);
14441444   else
14451445      return 0;
14461446}
trunk/src/mame/drivers/msisaac.c
r17961r17962
424424
425425static const msm5232_interface msm5232_config =
426426{
427   { 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6 }   /* 0.65 (???) uF capacitors (match the sample, not verified) */
427   { 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6 },   /* 0.65 (???) uF capacitors (match the sample, not verified) */
428   DEVCB_NULL
428429};
429430
430431
trunk/src/mame/drivers/playch10.c
r17961r17962
350350READ8_MEMBER(playch10_state::psg_4015_r)
351351{
352352   device_t *device = machine().device("nes");
353   return nes_psg_r(device, 0x15);
353   return nes_psg_r(device, space, 0x15);
354354}
355355
356356WRITE8_MEMBER(playch10_state::psg_4015_w)
357357{
358358   device_t *device = machine().device("nes");
359   nes_psg_w(device, 0x15, data);
359   nes_psg_w(device, space, 0x15, data);
360360}
361361
362362WRITE8_MEMBER(playch10_state::psg_4017_w)
363363{
364364   device_t *device = machine().device("nes");
365   nes_psg_w(device, 0x17, data);
365   nes_psg_w(device, space, 0x17, data);
366366}
367367
368368/******************************************************************************/
trunk/src/mame/drivers/uapce.c
r17961r17962
157157      752 Hz (D-3) square wave to be output on the common audio path.
158158      (1= Tone output ON, 0= Tone output OFF) */
159159
160   discrete_sound_w(machine().device("discrete"), UAPCE_SOUND_EN, BIT(data,3));
160   discrete_sound_w(machine().device("discrete"), space, UAPCE_SOUND_EN, BIT(data,3));
161161
162162/* D2 : Not latched, though software writes to this bit like it is. */
163163
trunk/src/mame/drivers/funkball.c
r17961r17962
247247READ32_MEMBER(funkball_state::ide_r)
248248{
249249   device_t *device = machine().device("ide");
250   return ide_controller32_r(device, 0x1f0/4 + offset, mem_mask);
250   return ide_controller32_r(device, space, 0x1f0/4 + offset, mem_mask);
251251}
252252
253253WRITE32_MEMBER(funkball_state::ide_w)
254254{
255255   device_t *device = machine().device("ide");
256   ide_controller32_w(device, 0x1f0/4 + offset, data, mem_mask);
256   ide_controller32_w(device, space, 0x1f0/4 + offset, data, mem_mask);
257257}
258258
259259READ32_MEMBER(funkball_state::fdc_r)
260260{
261261   device_t *device = machine().device("ide");
262   return ide_controller32_r(device, 0x3f0/4 + offset, mem_mask);
262   return ide_controller32_r(device, space, 0x3f0/4 + offset, mem_mask);
263263}
264264
265265WRITE32_MEMBER(funkball_state::fdc_w)
266266{
267267   device_t *device = machine().device("ide");
268268   //mame_printf_debug("FDC: write %08X, %08X, %08X\n", data, offset, mem_mask);
269   ide_controller32_w(device, 0x3f0/4 + offset, data, mem_mask);
269   ide_controller32_w(device, space, 0x3f0/4 + offset, data, mem_mask);
270270}
271271#endif
272272
r17961r17962
337337READ8_MEMBER(funkball_state::at_dma8237_2_r)
338338{
339339   device_t *device = machine().device("dma8237_2");
340   return i8237_r(device, offset / 2);
340   return i8237_r(device, space, offset / 2);
341341}
342342
343343WRITE8_MEMBER(funkball_state::at_dma8237_2_w)
344344{
345345   device_t *device = machine().device("dma8237_2");
346   i8237_w(device, offset / 2, data);
346   i8237_w(device, space, offset / 2, data);
347347}
348348
349349WRITE_LINE_MEMBER(funkball_state::pc_dma_hrq_changed)
r17961r17962
436436   }
437437   else
438438   {
439      r = pic8259_r(device, offset);
439      r = pic8259_r(device, space, offset);
440440   }
441441   return r;
442442}
r17961r17962
456456   }
457457   else
458458   {
459      pic8259_w(device, offset, data);
459      pic8259_w(device, space, offset, data);
460460   }
461461}
462462
trunk/src/mame/drivers/equites.c
r17961r17962
566566   equites_update_dac(machine());
567567}
568568
569static void equites_msm5232_gate( device_t *device, int state )
569static WRITE_LINE_DEVICE_HANDLER( equites_msm5232_gate )
570570{
571571}
572572
r17961r17962
11131113static const msm5232_interface equites_5232intf =
11141114{
11151115   { 0.47e-6, 0.47e-6, 0.47e-6, 0.47e-6, 0.47e-6, 0.47e-6, 0.47e-6, 0.47e-6 }, // verified
1116   equites_msm5232_gate
1116   DEVCB_LINE(equites_msm5232_gate)
11171117};
11181118
11191119
trunk/src/mame/drivers/mirax.c
r17961r17962
242242WRITE8_MEMBER(mirax_state::ay1_sel)
243243{
244244   device_t *device = machine().device("ay1");
245   ay8910_address_w(device,0,m_nAyCtrl);
246   ay8910_data_w(device,0,data);
245   ay8910_address_w(device,space,0,m_nAyCtrl);
246   ay8910_data_w(device,space,0,data);
247247}
248248
249249WRITE8_MEMBER(mirax_state::ay2_sel)
250250{
251251   device_t *device = machine().device("ay2");
252   ay8910_address_w(device,0,m_nAyCtrl);
253   ay8910_data_w(device,0,data);
252   ay8910_address_w(device,space,0,m_nAyCtrl);
253   ay8910_data_w(device,space,0,data);
254254}
255255
256256WRITE8_MEMBER(mirax_state::nmi_mask_w)
trunk/src/mame/drivers/gradius3.c
r17961r17962
2929
3030READ16_MEMBER(gradius3_state::k052109_halfword_r)
3131{
32   return k052109_r(m_k052109, offset);
32   return k052109_r(m_k052109, space, offset);
3333}
3434
3535WRITE16_MEMBER(gradius3_state::k052109_halfword_w)
3636{
3737
3838   if (ACCESSING_BITS_0_7)
39      k052109_w(m_k052109, offset, data & 0xff);
39      k052109_w(m_k052109, space, offset, data & 0xff);
4040
4141   /* is this a bug in the game or something else? */
4242   if (!ACCESSING_BITS_0_7)
43      k052109_w(m_k052109, offset, (data >> 8) & 0xff);
43      k052109_w(m_k052109, space, offset, (data >> 8) & 0xff);
4444//      logerror("%06x half %04x = %04x\n",space.device().safe_pc(),offset,data);
4545}
4646
4747READ16_MEMBER(gradius3_state::k051937_halfword_r)
4848{
49   return k051937_r(m_k051960, offset);
49   return k051937_r(m_k051960, space, offset);
5050}
5151
5252WRITE16_MEMBER(gradius3_state::k051937_halfword_w)
5353{
5454
5555   if (ACCESSING_BITS_0_7)
56      k051937_w(m_k051960, offset, data & 0xff);
56      k051937_w(m_k051960, space, offset, data & 0xff);
5757}
5858
5959READ16_MEMBER(gradius3_state::k051960_halfword_r)
6060{
61   return k051960_r(m_k051960, offset);
61   return k051960_r(m_k051960, space, offset);
6262}
6363
6464WRITE16_MEMBER(gradius3_state::k051960_halfword_w)
6565{
6666   if (ACCESSING_BITS_0_7)
67      k051960_w(m_k051960, offset, data & 0xff);
67      k051960_w(m_k051960, space, offset, data & 0xff);
6868}
6969
7070WRITE16_MEMBER(gradius3_state::cpuA_ctrl_w)
trunk/src/mame/drivers/dlair.c
r17961r17962
148148 *
149149 *************************************/
150150
151static void dleuro_interrupt(device_t *device, int state)
151static WRITE_LINE_DEVICE_HANDLER( dleuro_interrupt )
152152{
153153   device->machine().device("maincpu")->execute().set_input_line(0, state);
154154}
155155
156156
157static WRITE8_DEVICE_HANDLER( serial_transmit )
157static WRITE16_DEVICE_HANDLER( serial_transmit )
158158{
159159   dlair_state *state = device->machine().driver_data<dlair_state>();
160160   state->laserdisc_data_w(data);
161161}
162162
163163
164static int serial_receive(device_t *device, int channel)
164static READ16_DEVICE_HANDLER( serial_receive )
165165{
166166   dlair_state *state = device->machine().driver_data<dlair_state>();
167167   /* if we still have data to send, do it now */
168   if (channel == 0 && state->laserdisc_data_available_r() == ASSERT_LINE)
168   if (offset == 0 && state->laserdisc_data_available_r() == ASSERT_LINE)
169169      return state->laserdisc_data_r();
170170
171171   return -1;
r17961r17962
183183
184184static const z80sio_interface sio_intf =
185185{
186   dleuro_interrupt,   /* interrupt handler */
187   0,               /* DTR changed handler */
188   0,               /* RTS changed handler */
189   0,               /* BREAK changed handler */
190   serial_transmit,   /* transmit handler */
191   serial_receive      /* receive handler */
186   DEVCB_LINE(dleuro_interrupt),   /* interrupt handler */
187   DEVCB_NULL,               /* DTR changed handler */
188   DEVCB_NULL,               /* RTS changed handler */
189   DEVCB_NULL,               /* BREAK changed handler */
190   DEVCB_HANDLER(serial_transmit),   /* transmit handler */
191   DEVCB_HANDLER(serial_receive)      /* receive handler */
192192};
193193
194194
trunk/src/mame/drivers/firetrk.c
r17961r17962
3636INPUT_CHANGED_MEMBER(firetrk_state::firetrk_horn_changed)
3737{
3838   device_t *discrete = machine().device("discrete");
39   discrete_sound_w(discrete, FIRETRUCK_HORN_EN, newval);
39   discrete_sound_w(discrete, generic_space(), FIRETRUCK_HORN_EN, newval);
4040}
4141
4242
r17961r17962
9090   set_led_status(machine(), 3, !(data & 0x08));
9191
9292   /* BIT4 => ATTRACT     */
93   discrete_sound_w(discrete, FIRETRUCK_ATTRACT_EN, data & 0x10);
93   discrete_sound_w(discrete, space, FIRETRUCK_ATTRACT_EN, data & 0x10);
9494   coin_lockout_w(machine(), 0, !(data & 0x10));
9595   coin_lockout_w(machine(), 1, !(data & 0x10));
9696
r17961r17962
100100   /* BIT6 => UNUSED      */
101101
102102   /* BIT7 => BELL OUT    */
103   discrete_sound_w(discrete, FIRETRUCK_BELL_EN, data & 0x80);
103   discrete_sound_w(discrete, space, FIRETRUCK_BELL_EN, data & 0x80);
104104}
105105
106106
r17961r17962
112112   set_led_status(machine(), 0, offset & 0x01);
113113
114114   /* BIT1 => ATTRACT    */
115   discrete_sound_w(discrete, SUPERBUG_ATTRACT_EN, offset & 0x02);
115   discrete_sound_w(discrete, space, SUPERBUG_ATTRACT_EN, offset & 0x02);
116116   coin_lockout_w(machine(), 0, !(offset & 0x02));
117117   coin_lockout_w(machine(), 1, !(offset & 0x02));
118118
r17961r17962
135135   set_led_status(machine(), 1, !(data & 0x02));
136136
137137   /* BIT2 => ATTRACT       */
138   discrete_sound_w(discrete, MONTECAR_ATTRACT_INV, data & 0x04);
138   discrete_sound_w(discrete, space, MONTECAR_ATTRACT_INV, data & 0x04);
139139
140140   /* BIT3 => UNUSED        */
141141   /* BIT4 => UNUSED        */
r17961r17962
157157
158158   m_flash = data & 0x80;
159159
160   discrete_sound_w(discrete, MONTECAR_BEEPER_EN, data & 0x10);
161   discrete_sound_w(discrete, MONTECAR_DRONE_LOUD_DATA, data & 0x0f);
160   discrete_sound_w(discrete, space, MONTECAR_BEEPER_EN, data & 0x10);
161   discrete_sound_w(discrete, space, MONTECAR_DRONE_LOUD_DATA, data & 0x0f);
162162}
163163
164164
trunk/src/mame/drivers/parodius.c
r17961r17962
5858{
5959
6060   if (m_videobank & 0x02)
61      return k053245_r(m_k053245, offset);
61      return k053245_r(m_k053245, space, offset);
6262   else
63      return k052109_r(m_k052109, offset);
63      return k052109_r(m_k052109, space, offset);
6464}
6565
6666WRITE8_MEMBER(parodius_state::parodius_052109_053245_w)
6767{
6868
6969   if (m_videobank & 0x02)
70      k053245_w(m_k053245, offset, data);
70      k053245_w(m_k053245, space, offset, data);
7171   else
72      k052109_w(m_k052109, offset, data);
72      k052109_w(m_k052109, space, offset, data);
7373}
7474
7575WRITE8_MEMBER(parodius_state::parodius_videobank_w)
r17961r17962
103103READ8_MEMBER(parodius_state::parodius_sound_r)
104104{
105105   device_t *device = machine().device("k053260");
106   return k053260_r(device, 2 + offset);
106   return k053260_r(device, space, 2 + offset);
107107}
108108
109109WRITE8_MEMBER(parodius_state::parodius_sh_irqtrigger_w)
trunk/src/mame/drivers/segac2.c
r17961r17962
174174   /* only works if we're accessing the low byte */
175175   if (ACCESSING_BITS_0_7)
176176   {
177      upd7759_port_w(device, 0, data & 0xff);
177      upd7759_port_w(device, space, 0, data & 0xff);
178178      upd7759_start_w(device, 0);
179179      upd7759_start_w(device, 1);
180180   }
trunk/src/mame/drivers/homedata.c
r17961r17962
359359   coin_counter_w(machine(), 0, ~data & 0x80);
360360
361361   if (BIT(m_upd7807_portc, 5) && !BIT(data, 5))   /* write clock 1->0 */
362      ym2203_w(m_ym, BIT(data, 3), m_upd7807_porta);
362      ym2203_w(m_ym, space, BIT(data, 3), m_upd7807_porta);
363363
364364   if (BIT(m_upd7807_portc, 4) && !BIT(data, 4))   /* read clock 1->0 */
365      m_upd7807_porta = ym2203_r(m_ym, BIT(data, 3));
365      m_upd7807_porta = ym2203_r(m_ym, space, BIT(data, 3));
366366
367367   m_upd7807_portc = data;
368368}
trunk/src/mame/drivers/gyruss.c
r17961r17962
113113
114114WRITE8_MEMBER(gyruss_state::gyruss_dac_w)
115115{
116   discrete_sound_w(m_discrete, NODE(16), data);
116   discrete_sound_w(m_discrete, space, NODE(16), data);
117117}
118118
119119WRITE8_MEMBER(gyruss_state::gyruss_irq_clear_w)
r17961r17962
130130   {
131131      /* low bit: 47000pF = 0.047uF */
132132      /* high bit: 220000pF = 0.22uF */
133      discrete_sound_w(device, NODE(3 * chip + i + 21), data & 3);
133      address_space &space = device->machine().driver_data()->generic_space();
134      discrete_sound_w(device, space, NODE(3 * chip + i + 21), data & 3);
134135      data >>= 2;
135136   }
136137}
trunk/src/mame/drivers/fastlane.c
r17961r17962
2121   fastlane_state *state = timer.machine().driver_data<fastlane_state>();
2222   int scanline = param;
2323
24   if(scanline == 240 && k007121_ctrlram_r(state->m_k007121, 7) & 0x02) // vblank irq
24   address_space &space = state->generic_space();
25   if(scanline == 240 && k007121_ctrlram_r(state->m_k007121, space, 7) & 0x02) // vblank irq
2526      state->m_maincpu->set_input_line(HD6309_IRQ_LINE, HOLD_LINE);
26   else if(((scanline % 32) == 0) && k007121_ctrlram_r(state->m_k007121, 7) & 0x01) // timer irq
27   else if(((scanline % 32) == 0) && k007121_ctrlram_r(state->m_k007121, space, 7) & 0x01) // timer irq
2728      state->m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
2829}
2930
r17961r17962
3233{
3334
3435   if (offset < 8)
35      k007121_ctrl_w(m_k007121, offset, data);
36      k007121_ctrl_w(m_k007121, space, offset, data);
3637   else   /* scroll registers */
3738      m_k007121_regs[offset] = data;
3839}
r17961r17962
5960READ8_MEMBER(fastlane_state::fastlane_k1_k007232_r)
6061{
6162   device_t *device = machine().device("konami1");
62   return k007232_r(device, offset ^ 1);
63   return k007232_r(device, space, offset ^ 1);
6364}
6465
6566WRITE8_MEMBER(fastlane_state::fastlane_k1_k007232_w)
6667{
6768   device_t *device = machine().device("konami1");
68   k007232_w(device, offset ^ 1, data);
69   k007232_w(device, space, offset ^ 1, data);
6970}
7071
7172READ8_MEMBER(fastlane_state::fastlane_k2_k007232_r)
7273{
7374   device_t *device = machine().device("konami2");
74   return k007232_r(device, offset ^ 1);
75   return k007232_r(device, space, offset ^ 1);
7576}
7677
7778WRITE8_MEMBER(fastlane_state::fastlane_k2_k007232_w)
7879{
7980   device_t *device = machine().device("konami2");
80   k007232_w(device, offset ^ 1, data);
81   k007232_w(device, space, offset ^ 1, data);
8182}
8283static ADDRESS_MAP_START( fastlane_map, AS_PROGRAM, 8, fastlane_state )
8384   AM_RANGE(0x0000, 0x005f) AM_RAM_WRITE(k007121_registers_w) AM_SHARE("k007121_regs")   /* 007121 registers */
trunk/src/mame/drivers/gamecstl.c
r17961r17962
192192READ8_MEMBER(gamecstl_state::at_dma8237_2_r)
193193{
194194   device_t *device = machine().device("dma8237_2");
195   return i8237_r(device, offset / 2);
195   return i8237_r(device, space, offset / 2);
196196}
197197
198198WRITE8_MEMBER(gamecstl_state::at_dma8237_2_w)
199199{
200200   device_t *device = machine().device("dma8237_2");
201   i8237_w(device, offset / 2, data);
201   i8237_w(device, space, offset / 2, data);
202202}
203203
204204// Intel 82439TX System Controller (MXTC)
r17961r17962
367367READ32_MEMBER(gamecstl_state::ide_r)
368368{
369369   device_t *device = machine().device("ide");
370   return ide_controller32_r(device, 0x1f0/4 + offset, mem_mask);
370   return ide_controller32_r(device, space, 0x1f0/4 + offset, mem_mask);
371371}
372372
373373WRITE32_MEMBER(gamecstl_state::ide_w)
374374{
375375   device_t *device = machine().device("ide");
376   ide_controller32_w(device, 0x1f0/4 + offset, data, mem_mask);
376   ide_controller32_w(device, space, 0x1f0/4 + offset, data, mem_mask);
377377}
378378
379379READ32_MEMBER(gamecstl_state::fdc_r)
380380{
381381   device_t *device = machine().device("ide");
382   return ide_controller32_r(device, 0x3f0/4 + offset, mem_mask);
382   return ide_controller32_r(device, space, 0x3f0/4 + offset, mem_mask);
383383}
384384
385385WRITE32_MEMBER(gamecstl_state::fdc_w)
386386{
387387   device_t *device = machine().device("ide");
388388   //mame_printf_debug("FDC: write %08X, %08X, %08X\n", data, offset, mem_mask);
389   ide_controller32_w(device, 0x3f0/4 + offset, data, mem_mask);
389   ide_controller32_w(device, space, 0x3f0/4 + offset, data, mem_mask);
390390}
391391
392392
trunk/src/mame/drivers/cidelsa.c
r17961r17962
6464   switch (data)
6565   {
6666   case 0x01:
67      ay8910_data_w(m_psg, 0, m_psg_latch);
67      ay8910_data_w(m_psg, space, 0, m_psg_latch);
6868      break;
6969
7070   case 0x02:
71      m_psg_latch = ay8910_r(m_psg, 0);
71      m_psg_latch = ay8910_r(m_psg, space, 0);
7272      break;
7373
7474   case 0x03:
75      ay8910_address_w(m_psg, 0, m_psg_latch);
75      ay8910_address_w(m_psg, space, 0, m_psg_latch);
7676      break;
7777   }
7878}
trunk/src/mame/drivers/vendetta.c
r17961r17962
145145
146146READ8_MEMBER(vendetta_state::vendetta_K052109_r)
147147{
148   return k052109_r(m_k052109, offset + 0x2000);
148   return k052109_r(m_k052109, space, offset + 0x2000);
149149}
150150
151151WRITE8_MEMBER(vendetta_state::vendetta_K052109_w)
r17961r17962
156156   // *  Tilemap MASK-ROM Test       (0x1d80<->0x3d80, 0x1e00<->0x3e00, 0x1f00<->0x3f00)  *
157157   // *************************************************************************************
158158   if ((offset == 0x1d80) || (offset == 0x1e00) || (offset == 0x1f00))
159      k052109_w(m_k052109, offset, data);
160   k052109_w(m_k052109, offset + 0x2000, data);
159      k052109_w(m_k052109, space, offset, data);
160   k052109_w(m_k052109, space, offset + 0x2000, data);
161161}
162162
163163
r17961r17962
225225READ8_MEMBER(vendetta_state::vendetta_sound_r)
226226{
227227   device_t *device = machine().device("k053260");
228   return k053260_r(device, 2 + offset);
228   return k053260_r(device, space, 2 + offset);
229229}
230230
231231/********************************************/
trunk/src/mame/drivers/segas16b.c
r17961r17962
11701170
11711171WRITE16_MEMBER( segas16b_state::atomicp_sound_w )
11721172{
1173   ym2413_w(m_ym2413, offset, data >> 8);
1173   ym2413_w(m_ym2413, space, offset, data >> 8);
11741174}
11751175
11761176
trunk/src/mame/drivers/nwk-tr.c
r17961r17962
315315      }
316316      if (ACCESSING_BITS_0_7)
317317      {
318         r |= adc1213x_do_r(adc12138, 0) | (adc1213x_eoc_r(adc12138, 0) << 2);
318         r |= adc1213x_do_r(adc12138, space, 0) | (adc1213x_eoc_r(adc12138, space, 0) << 2);
319319      }
320320   }
321321   else if (offset == 1)
r17961r17962
352352         int di = (data >> 25) & 0x1;
353353         int sclk = (data >> 24) & 0x1;
354354
355         adc1213x_cs_w(adc12138, 0, cs);
356         adc1213x_conv_w(adc12138, 0, conv);
357         adc1213x_di_w(adc12138, 0, di);
358         adc1213x_sclk_w(adc12138, 0, sclk);
355         adc1213x_cs_w(adc12138, space, 0, cs);
356         adc1213x_conv_w(adc12138, space, 0, conv);
357         adc1213x_di_w(adc12138, space, 0, di);
358         adc1213x_sclk_w(adc12138, space, 0, sclk);
359359      }
360360      if (ACCESSING_BITS_0_7)
361361      {
trunk/src/mame/drivers/jpmsys5.c
r17961r17962
316316   {
317317      case 0:
318318      {
319         upd7759_port_w(device, 0, data & 0xff);
319         upd7759_port_w(device, space, 0, data & 0xff);
320320         upd7759_start_w(device, 0);
321321         upd7759_start_w(device, 1);
322322         break;
trunk/src/mame/drivers/homerun.c
r17961r17962
9797   m_sample = data;
9898
9999   if (m_d7756 != NULL)
100      upd7759_port_w(m_d7756, 0, data);
100      upd7759_port_w(m_d7756, space, 0, data);
101101}
102102
103103static ADDRESS_MAP_START( homerun_memmap, AS_PROGRAM, 8, homerun_state )
trunk/src/mame/drivers/ninjaw.c
r17961r17962
369369{
370370
371371   if (offset == 0)
372      tc0140syt_port_w(m_tc0140syt, 0, data & 0xff);
372      tc0140syt_port_w(m_tc0140syt, space, 0, data & 0xff);
373373   else if (offset == 1)
374      tc0140syt_comm_w(m_tc0140syt, 0, data & 0xff);
374      tc0140syt_comm_w(m_tc0140syt, space, 0, data & 0xff);
375375
376376#ifdef MAME_DEBUG
377377   if (data & 0xff00)
r17961r17962
383383{
384384
385385   if (offset == 1)
386      return ((tc0140syt_comm_r(m_tc0140syt, 0) & 0xff));
386      return ((tc0140syt_comm_r(m_tc0140syt, space, 0) & 0xff));
387387   else
388388      return 0;
389389}
r17961r17962
413413WRITE16_MEMBER(ninjaw_state::tc0100scn_triple_screen_w)
414414{
415415
416   tc0100scn_word_w(m_tc0100scn_1, offset, data, mem_mask);
417   tc0100scn_word_w(m_tc0100scn_2, offset, data, mem_mask);
418   tc0100scn_word_w(m_tc0100scn_3, offset, data, mem_mask);
416   tc0100scn_word_w(m_tc0100scn_1, space, offset, data, mem_mask);
417   tc0100scn_word_w(m_tc0100scn_2, space, offset, data, mem_mask);
418   tc0100scn_word_w(m_tc0100scn_3, space, offset, data, mem_mask);
419419}
420420
421421/***********************************************************
trunk/src/mame/drivers/pacman.c
r17961r17962
537537   /* since the sound region in Ali Baba is not contiguous, translate the
538538       offset into the 0-0x1f range */
539539   if (offset < 0x10)
540      pacman_sound_w(machine().device("namco"), offset, data);
540      pacman_sound_w(machine().device("namco"), space, offset, data);
541541   else if (offset < 0x20)
542542      m_spriteram2[offset - 0x10] = data;
543543   else
544      pacman_sound_w(machine().device("namco"), offset - 0x10, data);
544      pacman_sound_w(machine().device("namco"), space, offset - 0x10, data);
545545}
546546
547547READ8_MEMBER(pacman_state::alibaba_mystery_1_r)
trunk/src/mame/drivers/igs011.c
r17961r17962
24612461   ics2115_device* ics2115 = machine().device<ics2115_device>("ics");
24622462   switch(offset)
24632463   {
2464      case 0:   return ics2115_device::read(ics2115, (offs_t)0);
2465      case 1:   return ics2115_device::read(ics2115, (offs_t)1);
2466      case 2:   return (ics2115_device::read(ics2115, (offs_t)3) << 8) | ics2115_device::read(ics2115, (offs_t)2);
2464      case 0:   return ics2115_device::read(ics2115, space, (offs_t)0);
2465      case 1:   return ics2115_device::read(ics2115, space, (offs_t)1);
2466      case 2:   return (ics2115_device::read(ics2115, space, (offs_t)3) << 8) | ics2115_device::read(ics2115, space, (offs_t)2);
24672467   }
24682468   return 0xff;
24692469}
r17961r17962
24742474   switch(offset)
24752475   {
24762476      case 1:
2477         if (ACCESSING_BITS_0_7)      ics2115_device::write(ics2115,1,data);
2477         if (ACCESSING_BITS_0_7)      ics2115_device::write(ics2115,space, 1,data);
24782478         break;
24792479      case 2:
2480         if (ACCESSING_BITS_0_7)      ics2115_device::write(ics2115,2,data);
2481         if (ACCESSING_BITS_8_15)   ics2115_device::write(ics2115,3,data>>8);
2480         if (ACCESSING_BITS_0_7)      ics2115_device::write(ics2115,space, 2,data);
2481         if (ACCESSING_BITS_8_15)   ics2115_device::write(ics2115,space, 3,data>>8);
24822482         break;
24832483   }
24842484}
trunk/src/mame/drivers/fuukifg3.c
r17961r17962
283283
284284WRITE8_MEMBER(fuuki32_state::snd_ymf278b_w)
285285{
286   ymf278b_w(machine().device("ymf1"), offset, data);
286   ymf278b_w(machine().device("ymf1"), space, offset, data);
287287
288288   // also write to ymf262
289289   if (offset < 4)
290      ymf262_w(machine().device("ymf2"), offset, data);
290      ymf262_w(machine().device("ymf2"), space, offset, data);
291291}
292292
293293static ADDRESS_MAP_START( fuuki32_sound_map, AS_PROGRAM, 8, fuuki32_state )
trunk/src/mame/drivers/crimfght.c
r17961r17962
6060   if (k052109_get_rmrd_line(m_k052109) == CLEAR_LINE)
6161   {
6262      if (offset >= 0x3800 && offset < 0x3808)
63         return k051937_r(m_k051960, offset - 0x3800);
63         return k051937_r(m_k051960, space, offset - 0x3800);
6464      else if (offset < 0x3c00)
65         return k052109_r(m_k052109, offset);
65         return k052109_r(m_k052109, space, offset);
6666      else
67         return k051960_r(m_k051960, offset - 0x3c00);
67         return k051960_r(m_k051960, space, offset - 0x3c00);
6868   }
6969   else
70      return k052109_r(m_k052109, offset);
70      return k052109_r(m_k052109, space, offset);
7171}
7272
7373WRITE8_MEMBER(crimfght_state::k052109_051960_w)
7474{
7575
7676   if (offset >= 0x3800 && offset < 0x3808)
77      k051937_w(m_k051960, offset - 0x3800, data);
77      k051937_w(m_k051960, space, offset - 0x3800, data);
7878   else if (offset < 0x3c00)
79      k052109_w(m_k052109, offset, data);
79      k052109_w(m_k052109, space, offset, data);
8080   else
81      k051960_w(m_k051960, offset - 0x3c00, data);
81      k051960_w(m_k051960, space, offset - 0x3c00, data);
8282}
8383
8484/********************************************/
trunk/src/mame/drivers/triplhnt.c
r17961r17962
3232}
3333
3434
35static void triplhnt_update_misc(running_machine &machine, int offset)
35static void triplhnt_update_misc(address_space &space, int offset)
3636{
37   triplhnt_state *state = machine.driver_data<triplhnt_state>();
38   samples_device *samples = machine.device<samples_device>("samples");
39   device_t *discrete = machine.device("discrete");
37   triplhnt_state *state = space.machine().driver_data<triplhnt_state>();
38   samples_device *samples = space.machine().device<samples_device>("samples");
39   device_t *discrete = space.machine().device("discrete");
4040   UINT8 is_witch_hunt;
4141   UINT8 bit = offset >> 1;
4242
r17961r17962
6666   state->m_sprite_zoom = (state->m_misc_flags >> 4) & 1;
6767   state->m_sprite_bank = (state->m_misc_flags >> 7) & 1;
6868
69   set_led_status(machine, 0, state->m_misc_flags & 0x02);
69   set_led_status(space.machine(), 0, state->m_misc_flags & 0x02);
7070
71   coin_lockout_w(machine, 0, !(state->m_misc_flags & 0x08));
72   coin_lockout_w(machine, 1, !(state->m_misc_flags & 0x08));
71   coin_lockout_w(space.machine(), 0, !(state->m_misc_flags & 0x08));
72   coin_lockout_w(space.machine(), 1, !(state->m_misc_flags & 0x08));
7373
74   discrete_sound_w(discrete, TRIPLHNT_SCREECH_EN, state->m_misc_flags & 0x04);   // screech
75   discrete_sound_w(discrete, TRIPLHNT_LAMP_EN, state->m_misc_flags & 0x02);   // Lamp is used to reset noise
76   discrete_sound_w(discrete, TRIPLHNT_BEAR_EN, state->m_misc_flags & 0x80);   // bear
74   discrete_sound_w(discrete, space, TRIPLHNT_SCREECH_EN, state->m_misc_flags & 0x04);   // screech
75   discrete_sound_w(discrete, space, TRIPLHNT_LAMP_EN, state->m_misc_flags & 0x02);   // Lamp is used to reset noise
76   discrete_sound_w(discrete, space, TRIPLHNT_BEAR_EN, state->m_misc_flags & 0x80);   // bear
7777
78   is_witch_hunt = machine.root_device().ioport("0C09")->read() == 0x40;
78   is_witch_hunt = space.machine().root_device().ioport("0C09")->read() == 0x40;
7979   bit = ~state->m_misc_flags & 0x40;
8080
8181   /* if we're not playing the sample yet, start it */
r17961r17962
9292
9393WRITE8_MEMBER(triplhnt_state::triplhnt_misc_w)
9494{
95   triplhnt_update_misc(machine(), offset);
95   triplhnt_update_misc(space, offset);
9696}
9797
9898
r17961r17962
113113
114114READ8_MEMBER(triplhnt_state::triplhnt_misc_r)
115115{
116   triplhnt_update_misc(machine(), offset);
116   triplhnt_update_misc(space, offset);
117117   return ioport("VBLANK")->read() | m_hit_code;
118118}
119119
trunk/src/mame/drivers/rollerg.c
r17961r17962
4343{
4444
4545   if (m_readzoomroms)
46      return k051316_rom_r(m_k051316, offset);
46      return k051316_rom_r(m_k051316, space, offset);
4747   else
48      return k051316_r(m_k051316, offset);
48      return k051316_r(m_k051316, space, offset);
4949}
5050
5151READ8_MEMBER(rollerg_state::rollerg_sound_r)
r17961r17962
5353   device_t *device = machine().device("k053260");
5454   /* If the sound CPU is running, read the status, otherwise
5555       just make it pass the test */
56   return k053260_r(device, 2 + offset);
56   return k053260_r(device, space, 2 + offset);
5757}
5858
5959WRITE8_MEMBER(rollerg_state::soundirq_w)
trunk/src/mame/drivers/royalmah.c
r17961r17962
894894   {
895895      case 0x8000:   return ioport("DSW4")->read();      // dsw 4
896896      case 0x8200:   return ioport("DSW3")->read();      // dsw 3
897      case 0x9001:   return ay8910_r(machine().device("aysnd"), 0);   // inputs
897      case 0x9001:   return ay8910_r(machine().device("aysnd"), space, 0);   // inputs
898898      case 0x9011:   return ioport("SYSTEM")->read();
899899   }
900900
r17961r17962
916916   switch(offset)
917917   {
918918      case 0x8e00:   m_palette_base = data & 0x1f;   return;
919      case 0x9002:   ay8910_data_w(machine().device("aysnd"),0,data);         return;
920      case 0x9003:   ay8910_address_w(machine().device("aysnd"),0,data);      return;
919      case 0x9002:   ay8910_data_w(machine().device("aysnd"),space,0,data);         return;
920      case 0x9003:   ay8910_address_w(machine().device("aysnd"),space,0,data);      return;
921921      case 0x9010:
922922         mjifb_coin_counter_w(space,0,data);
923923         return;
r17961r17962
10031003   {
10041004      case 0x8000:   return ioport("DSW2")->read();      // dsw 2
10051005      case 0x8001:   return ioport("DSW1")->read();      // dsw 1
1006      case 0x9001:   return ay8910_r(machine().device("aysnd"), 0);   // inputs
1006      case 0x9001:   return ay8910_r(machine().device("aysnd"), space, 0);   // inputs
10071007      case 0x9011:   return ioport("SYSTEM")->read();
10081008   }
10091009
r17961r17962
10241024   switch(offset)
10251025   {
10261026      case 0x8802:   m_palette_base = data & 0x1f;               return;
1027      case 0x9002:   ay8910_data_w(machine().device("aysnd"),0,data);      return;
1028      case 0x9003:   ay8910_address_w(machine().device("aysnd"),0,data);   return;
1027      case 0x9002:   ay8910_data_w(machine().device("aysnd"),space,0,data);      return;
1028      case 0x9003:   ay8910_address_w(machine().device("aysnd"),space,0,data);   return;
10291029      case 0x9010:   mjifb_coin_counter_w(space,0,data);      return;
10301030      case 0x9011:   input_port_select_w(space,0,data);      return;
10311031      case 0x9013:
trunk/src/mame/drivers/m10.c
r17961r17962
141141
142142   /* written from /Q to A with slight delight */
143143   LOG(("ic8j2: %d\n", data));
144   ttl74123_a_w(device, 0, data);
145   ttl74123_a_w(state->m_ic8j1, 0, data);
144   ttl74123_a_w(device, space, 0, data);
145   ttl74123_a_w(state->m_ic8j1, space, 0, data);
146146}
147147
148148static const ttl74123_interface ic8j1_intf =
r17961r17962
154154   1,               /* A pin - driven by the CRTC */
155155   1,               /* B pin - pulled high */
156156   1,               /* Clear pin - pulled high */
157   ic8j1_output_changed
157   DEVCB_HANDLER(ic8j1_output_changed)
158158};
159159
160160static const ttl74123_interface ic8j2_intf =
r17961r17962
166166   1,               /* A pin - driven by the CRTC */
167167   1,               /* B pin - pulled high */
168168   1,               /* Clear pin - pulled high */
169   ic8j2_output_changed
169   DEVCB_HANDLER(ic8j2_output_changed)
170170};
171171
172172/*************************************
r17961r17962
476476{
477477   //LOG(("rd:%d\n",machine().primary_screen->vpos()));
478478   LOG(("clear\n"));
479   ttl74123_clear_w(m_ic8j1, 0, 0);
480   ttl74123_clear_w(m_ic8j1, 0, 1);
479   ttl74123_clear_w(m_ic8j1, space, 0, 0);
480   ttl74123_clear_w(m_ic8j1, space, 0, 1);
481481   return 0x00;
482482}
483483
r17961r17962
486486   //LOG(("rd:%d\n",machine().primary_screen->vpos()));
487487   //m_maincpu->set_input_line(0, CLEAR_LINE);
488488   LOG(("clear\n"));
489   ttl74123_clear_w(m_ic8j1, 0, 0);
490   ttl74123_clear_w(m_ic8j1, 0, 1);
489   ttl74123_clear_w(m_ic8j1, space, 0, 0);
490   ttl74123_clear_w(m_ic8j1, space, 0, 1);
491491   return 0x00;
492492}
493493
trunk/src/emu/cpu/tms0980/tms0980.c
r17961r17962
766766   case 0x008:
767767      if ( cpustate->config->read_k )
768768      {
769         cpustate->cki_bus = cpustate->config->read_k( device, 0 );
769         cpustate->cki_bus = cpustate->config->read_k( device, *cpustate->program, 0, 0xff );
770770      }
771771      else
772772      {
r17961r17962
930930               cpustate->r = cpustate->r | ( 1 << cpustate->y );
931931               if ( cpustate->config->write_r )
932932               {
933                  cpustate->config->write_r( device, 0, cpustate->r & cpustate->r_mask, 0xffff );
933                  cpustate->config->write_r( device, *cpustate->program, 0, cpustate->r & cpustate->r_mask, 0xffff );
934934               }
935935            }
936936            if ( cpustate->decode & F_RSTR )
r17961r17962
938938               cpustate->r = cpustate->r & ( ~( 1 << cpustate->y ) );
939939               if ( cpustate->config->write_r )
940940               {
941                  cpustate->config->write_r( device, 0, cpustate->r & cpustate->r_mask, 0xffff );
941                  cpustate->config->write_r( device, *cpustate->program, 0, cpustate->r & cpustate->r_mask, 0xffff );
942942               }
943943            }
944944            if ( cpustate->decode & F_TDO )
r17961r17962
957957
958958               if ( cpustate->config->write_o )
959959               {
960                  cpustate->config->write_o( device, 0, cpustate->o & cpustate->o_mask, 0xffff );
960                  cpustate->config->write_o( device, *cpustate->program, 0, cpustate->o & cpustate->o_mask, 0xffff );
961961               }
962962            }
963963            if ( cpustate->decode & F_CLO )
r17961r17962
965965               cpustate->o = 0;
966966               if ( cpustate->config->write_o )
967967               {
968                  cpustate->config->write_o( device, 0, cpustate->o & cpustate->o_mask, 0xffff );
968                  cpustate->config->write_o( device, *cpustate->program, 0, cpustate->o & cpustate->o_mask, 0xffff );
969969               }
970970            }
971971            if ( cpustate->decode & F_LDX )
trunk/src/emu/cpu/m68000/68307ser.c
r17961r17962
2424      // if we're piggybacking on the existing 68681 implementation...
2525      if (serial->m_duart68681)
2626      {
27         if (offset&1) return duart68681_r(serial->m_duart68681, offset>>1);
27         if (offset&1) return duart68681_r(serial->m_duart68681, *m68k->program, offset>>1);
2828      }
2929      else
3030      {
r17961r17962
104104      // if we're piggybacking on the existing 68681 implementation...
105105      if (serial->m_duart68681)
106106      {
107         if (offset&1) duart68681_w(serial->m_duart68681, offset>>1, data);
107         if (offset&1) duart68681_w(serial->m_duart68681, *m68k->program, offset>>1, data);
108108      }
109109      else
110110      {
trunk/src/emu/cpu/cubeqcpu/cubeqcpu.h
r17961r17962
139139    PUBLIC FUNCTIONS
140140***************************************************************************/
141141
142extern READ16_DEVICE_HANDLER( cubeqcpu_sndram_r );
143extern WRITE16_DEVICE_HANDLER( cubeqcpu_sndram_w );
142extern DECLARE_READ16_DEVICE_HANDLER( cubeqcpu_sndram_r );
143extern DECLARE_WRITE16_DEVICE_HANDLER( cubeqcpu_sndram_w );
144144
145extern READ16_DEVICE_HANDLER( cubeqcpu_rotram_r );
146extern WRITE16_DEVICE_HANDLER( cubeqcpu_rotram_w );
145extern DECLARE_READ16_DEVICE_HANDLER( cubeqcpu_rotram_r );
146extern DECLARE_WRITE16_DEVICE_HANDLER( cubeqcpu_rotram_w );
147147
148148void cubeqcpu_swap_line_banks(device_t *device);
149149
trunk/src/emu/cpu/rsp/rspdrc.c
r17961r17962
472472   {
473473      if(dest)
474474      {
475         rsp->r[dest] = (rsp->config->sp_reg_r)(rsp->device, reg, 0x00000000);
475         rsp->r[dest] = (rsp->config->sp_reg_r)(rsp->device, *rsp->program, reg, 0x00000000);
476476      }
477477   }
478478   else if (reg >= 8 && reg < 16)
479479   {
480480      if(dest)
481481      {
482         rsp->r[dest] = (rsp->config->dp_reg_r)(rsp->device, reg - 8, 0x00000000);
482         rsp->r[dest] = (rsp->config->dp_reg_r)(rsp->device, *rsp->program, reg - 8, 0x00000000);
483483      }
484484   }
485485   else
r17961r17962
496496
497497   if (reg >= 0 && reg < 8)
498498   {
499      (rsp->config->sp_reg_w)(rsp->device, reg, data, 0x00000000);
499      (rsp->config->sp_reg_w)(rsp->device, *rsp->program, reg, data, 0x00000000);
500500   }
501501   else if (reg >= 8 && reg < 16)
502502   {
503      (rsp->config->dp_reg_w)(rsp->device, reg - 8, data, 0x00000000);
503      (rsp->config->dp_reg_w)(rsp->device, *rsp->program, reg - 8, data, 0x00000000);
504504   }
505505   else
506506   {
trunk/src/emu/cpu/powerpc/ppccom.c
r17961r17962
11211121      else
11221122         ppc->param1 = 0;
11231123   } else {
1124      ppc->param1 = ppc->dcr_read_func(ppc->device,ppc->param0,0xffffffff);
1124      ppc->param1 = ppc->dcr_read_func(ppc->device,*ppc->program,ppc->param0,0xffffffff);
11251125   }
11261126}
11271127
r17961r17962
12111211      if (ppc->param0 < ARRAY_LENGTH(ppc->dcr))
12121212         ppc->dcr[ppc->param0] = ppc->param1;
12131213   } else {
1214      ppc->dcr_write_func(ppc->device,ppc->param0,ppc->param1,0xffffffff);
1214      ppc->dcr_write_func(ppc->device,*ppc->program,ppc->param0,ppc->param1,0xffffffff);
12151215   }
12161216}
12171217
trunk/src/emu/cpu/esrip/esrip.c
r17961r17962
17011701
17021702         /* FDT RAM: /Enable, Direction and /RAM OE */
17031703         else if (!bl44 && !_BIT(cpustate->l2, 3) && bl46)
1704            y_bus = cpustate->fdt_r(device, cpustate->fdt_cnt, 0);
1704            y_bus = cpustate->fdt_r(device, *cpustate->program, cpustate->fdt_cnt, 0);
17051705
17061706         /* IPT RAM: /Enable and /READ */
17071707         else if (!_BIT(cpustate->l2, 6) && !_BIT(cpustate->l4, 5))
r17961r17962
17281728
17291729      /* FDT RAM */
17301730      if (!bl44)
1731         x_bus = cpustate->fdt_r(device, cpustate->fdt_cnt, 0);
1731         x_bus = cpustate->fdt_r(device, *cpustate->program, cpustate->fdt_cnt, 0);
17321732
17331733      /* Buffer is enabled - write direction */
17341734      else if (!BIT(cpustate->l2, 3) && !bl46)
r17961r17962
17531753
17541754      /* Write FDT RAM: /Enable, Direction and WRITE */
17551755      if (!BIT(cpustate->l2, 3) && !bl46 && !BIT(cpustate->l4, 3))
1756         cpustate->fdt_w(device, cpustate->fdt_cnt, x_bus, 0);
1756         cpustate->fdt_w(device, *cpustate->program, cpustate->fdt_cnt, x_bus, 0);
17571757
17581758      /* Write IPT RAM: /Enable and /WR */
17591759      if (!BIT(cpustate->l2, 7) && !BIT(cpustate->l4, 5))
trunk/src/emu/cpu/arm7/arm7.c
r17961r17962
4343
4444
4545/* prototypes of coprocessor functions */
46static WRITE32_DEVICE_HANDLER(arm7_do_callback);
47static READ32_DEVICE_HANDLER(arm7_rt_r_callback);
48static WRITE32_DEVICE_HANDLER(arm7_rt_w_callback);
46static DECLARE_WRITE32_DEVICE_HANDLER(arm7_do_callback);
47static DECLARE_READ32_DEVICE_HANDLER(arm7_rt_r_callback);
48static DECLARE_WRITE32_DEVICE_HANDLER(arm7_rt_w_callback);
4949void arm7_dt_r_callback(arm_state *cpustate, UINT32 insn, UINT32 *prn, UINT32 (*read32)(arm_state *cpustate, UINT32 addr));
5050void arm7_dt_w_callback(arm_state *cpustate, UINT32 insn, UINT32 *prn, void (*write32)(arm_state *cpustate, UINT32 addr, UINT32 data));
5151
trunk/src/emu/cpu/arm7/arm7ops.c
r17961r17962
283283{
284284    // This instruction simply instructs the co-processor to do something, no data is returned to ARM7 core
285285    if (arm7_coproc_do_callback)
286        arm7_coproc_do_callback(cpustate->device, insn, 0, 0);    // simply pass entire opcode to callback - since data format is actually dependent on co-proc implementation
286        arm7_coproc_do_callback(cpustate->device, *cpustate->program, insn, 0, 0);    // simply pass entire opcode to callback - since data format is actually dependent on co-proc implementation
287287    else
288288        LOG(("%08x: Co-Processor Data Operation executed, but no callback defined!\n", R15));
289289}
r17961r17962
299299    {
300300        if (arm7_coproc_rt_r_callback)
301301        {
302            UINT32 res = arm7_coproc_rt_r_callback(cpustate->device, insn, 0);   // RT Read handler must parse opcode & return appropriate result
302            UINT32 res = arm7_coproc_rt_r_callback(cpustate->device, *cpustate->program, insn, 0);   // RT Read handler must parse opcode & return appropriate result
303303            if (cpustate->pendingUnd == 0)
304304           {
305305              SET_REGISTER(cpustate, (insn >> 12) & 0xf, res);
r17961r17962
312312    else
313313    {
314314        if (arm7_coproc_rt_w_callback)
315            arm7_coproc_rt_w_callback(cpustate->device, insn, GET_REGISTER(cpustate, (insn >> 12) & 0xf), 0);
315            arm7_coproc_rt_w_callback(cpustate->device, *cpustate->program, insn, GET_REGISTER(cpustate, (insn >> 12) & 0xf), 0);
316316        else
317317            LOG(("%08x: Co-Processor Register Transfer executed, but no RT Write callback defined!\n", R15));
318318    }
trunk/src/emu/devcb.c
r17961r17962
232232
233233int devcb_resolved_read_line::from_read8()
234234{
235   return ((*m_helper.read8_device)(m_object.device, 0) & 1) ? ASSERT_LINE : CLEAR_LINE;
235   return ((*m_helper.read8_device)(m_object.device, m_object.device->machine().driver_data()->generic_space(), 0, 0xff) & 1) ? ASSERT_LINE : CLEAR_LINE;
236236}
237237
238238
r17961r17962
336336
337337void devcb_resolved_write_line::to_write8(int state)
338338{
339   (*m_helper.write8_device)(m_object.device, 0, state);
339   (*m_helper.write8_device)(m_object.device, m_object.device->machine().driver_data()->generic_space(), 0, state, 0xff);
340340}
341341
342342
r17961r17962
391391      case DEVCB_TYPE_DEVICE:
392392         m_object.device = devcb_resolver::resolve_device(desc.index, desc.tag, device);
393393         if (desc.readdevice != NULL)
394            *static_cast<devcb_read8_delegate *>(this) = devcb_read8_delegate(desc.readdevice, desc.name, m_object.device);
394         {
395             m_helper.read8_device = desc.readdevice;
396            *static_cast<devcb_read8_delegate *>(this) = devcb_read8_delegate(&devcb_resolved_read8::from_read8, desc.name, this);
397         }
395398         else
396399         {
397400            m_helper.read_line = desc.readline;
r17961r17962
428431//  line read value to an 8-bit value
429432//-------------------------------------------------
430433
434UINT8 devcb_resolved_read8::from_read8(offs_t offset)
435{
436   return (*m_helper.read8_device)(m_object.device, m_object.device->machine().driver_data()->generic_space(), offset, 0xff);
437}
438
439
440//-------------------------------------------------
441//  from_readline - helper to convert from a device
442//  line read value to an 8-bit value
443//-------------------------------------------------
444
431445UINT8 devcb_resolved_read8::from_readline(offs_t offset)
432446{
433447   return (*m_helper.read_line)(m_object.device);
r17961r17962
484498      case DEVCB_TYPE_DEVICE:
485499         m_object.device = devcb_resolver::resolve_device(desc.index, desc.tag, device);
486500         if (desc.writedevice != NULL)
487            *static_cast<devcb_write8_delegate *>(this) = devcb_write8_delegate(desc.writedevice, desc.name, m_object.device);
501         {
502            m_helper.write8_device = desc.writedevice;
503            *static_cast<devcb_write8_delegate *>(this) = devcb_write8_delegate(&devcb_resolved_write8::to_write8, desc.name, this);
504         }
488505         else
489506         {
490507            m_helper.write_line = desc.writeline;
r17961r17962
531548//  memory read value from a line value
532549//-------------------------------------------------
533550
551void devcb_resolved_write8::to_write8(offs_t offset, UINT8 data)
552{
553   (*m_helper.write8_device)(m_object.device, m_object.device->machine().driver_data()->generic_space(), offset, data, 0xff);
554}
555
556
557//-------------------------------------------------
558//  to_write8 - helper to convert to an 8-bit
559//  memory read value from a line value
560//-------------------------------------------------
561
534562void devcb_resolved_write8::to_writeline(offs_t offset, UINT8 data)
535563{
536564   (*m_helper.write_line)(m_object.device, (data & 1) ? ASSERT_LINE : CLEAR_LINE);
r17961r17962
588616      case DEVCB_TYPE_DEVICE:
589617         m_object.device = devcb_resolver::resolve_device(desc.index, desc.tag, device);
590618         if (desc.readdevice != NULL)
591            *static_cast<devcb_read16_delegate *>(this) = devcb_read16_delegate(desc.readdevice, desc.name, m_object.device);
619         {
620            m_helper.read16_device = desc.readdevice;
621            *static_cast<devcb_read16_delegate *>(this) = devcb_read16_delegate(&devcb_resolved_read16::from_read16, desc.name, this);
622         }
592623         else
593624         {
594625            m_helper.read_line = desc.readline;
r17961r17962
625656//  line read value to a 16-bit value
626657//-------------------------------------------------
627658
659UINT16 devcb_resolved_read16::from_read16(offs_t offset, UINT16 mask)
660{
661   return (*m_helper.read16_device)(m_object.device, m_object.device->machine().driver_data()->generic_space(), offset, mask);
662}
663
664
665//-------------------------------------------------
666//  from_read16 - helper to convert from a device
667//  line read value to a 16-bit value
668//-------------------------------------------------
669
628670UINT16 devcb_resolved_read16::from_readline(offs_t offset, UINT16 mask)
629671{
630672   return (*m_helper.read_line)(m_object.device);
r17961r17962
681723      case DEVCB_TYPE_DEVICE:
682724         m_object.device = devcb_resolver::resolve_device(desc.index, desc.tag, device);
683725         if (desc.writedevice != NULL)
684            *static_cast<devcb_write16_delegate *>(this) = devcb_write16_delegate(desc.writedevice, desc.name, m_object.device);
726         {
727            m_helper.write16_device = desc.writedevice;
728            *static_cast<devcb_write16_delegate *>(this) = devcb_write16_delegate(&devcb_resolved_write16::to_write16, desc.name, this);
729         }
685730         else
686731         {
687732            m_helper.write_line = desc.writeline;
r17961r17962
728773//  memory read value from a line value
729774//-------------------------------------------------
730775
776void devcb_resolved_write16::to_write16(offs_t offset, UINT16 data, UINT16 mask)
777{
778   (*m_helper.write16_device)(m_object.device, m_object.device->machine().driver_data()->generic_space(), offset, data, mask);
779}
780
781
782//-------------------------------------------------
783//  to_write16 - helper to convert to a 16-bit
784//  memory read value from a line value
785//-------------------------------------------------
786
731787void devcb_resolved_write16::to_writeline(offs_t offset, UINT16 data, UINT16 mask)
732788{
733789   (*m_helper.write_line)(m_object.device, (data & 1) ? ASSERT_LINE : CLEAR_LINE);
trunk/src/emu/video/hd63484.h
r17961r17962
5555    DEVICE I/O FUNCTIONS
5656***************************************************************************/
5757
58READ16_DEVICE_HANDLER( hd63484_status_r );
59WRITE16_DEVICE_HANDLER( hd63484_address_w );
60WRITE16_DEVICE_HANDLER( hd63484_data_w );
61READ16_DEVICE_HANDLER( hd63484_data_r );
58DECLARE_READ16_DEVICE_HANDLER( hd63484_status_r );
59DECLARE_WRITE16_DEVICE_HANDLER( hd63484_address_w );
60DECLARE_WRITE16_DEVICE_HANDLER( hd63484_data_w );
61DECLARE_READ16_DEVICE_HANDLER( hd63484_data_r );
6262
63READ16_DEVICE_HANDLER( hd63484_ram_r );
64READ16_DEVICE_HANDLER( hd63484_regs_r );
65WRITE16_DEVICE_HANDLER( hd63484_ram_w );
66WRITE16_DEVICE_HANDLER( hd63484_regs_w );
63DECLARE_READ16_DEVICE_HANDLER( hd63484_ram_r );
64DECLARE_READ16_DEVICE_HANDLER( hd63484_regs_r );
65DECLARE_WRITE16_DEVICE_HANDLER( hd63484_ram_w );
66DECLARE_WRITE16_DEVICE_HANDLER( hd63484_regs_w );
6767
6868#endif /* __HD63484_H__ */
6969
trunk/src/emu/video/tlc34076.h
r17961r17962
5959    DEVICE I/O FUNCTIONS
6060***************************************************************************/
6161
62WRITE8_DEVICE_HANDLER( tlc34076_w );
63READ8_DEVICE_HANDLER( tlc34076_r );
62DECLARE_WRITE8_DEVICE_HANDLER( tlc34076_w );
63DECLARE_READ8_DEVICE_HANDLER( tlc34076_r );
trunk/src/emu/video/voodoo.c
r17961r17962
40644064      flush_fifos(v, device->machine().time());
40654065
40664066   if (offset < 0x80000/4)
4067      result = banshee_io_r(device, offset, mem_mask);
4067      result = banshee_io_r(device, space, offset, mem_mask);
40684068   else if (offset < 0x100000/4)
4069      result = banshee_agp_r(device, offset, mem_mask);
4069      result = banshee_agp_r(device, space, offset, mem_mask);
40704070   else if (offset < 0x200000/4)
40714071      logerror("%s:banshee_r(2D:%X)\n", device->machine().describe_context(), (offset*4) & 0xfffff);
40724072   else if (offset < 0x600000/4)
r17961r17962
42324232      case io_vgad0:   case io_vgad4:   case io_vgad8:   case io_vgadc:
42334233         result = 0;
42344234         if (ACCESSING_BITS_0_7)
4235            result |= banshee_vga_r(device, offset*4+0) << 0;
4235            result |= banshee_vga_r(device, space, offset*4+0, mem_mask >> 0) << 0;
42364236         if (ACCESSING_BITS_8_15)
4237            result |= banshee_vga_r(device, offset*4+1) << 8;
4237            result |= banshee_vga_r(device, space, offset*4+1, mem_mask >> 8) << 8;
42384238         if (ACCESSING_BITS_16_23)
4239            result |= banshee_vga_r(device, offset*4+2) << 16;
4239            result |= banshee_vga_r(device, space, offset*4+2, mem_mask >> 16) << 16;
42404240         if (ACCESSING_BITS_24_31)
4241            result |= banshee_vga_r(device, offset*4+3) << 24;
4241            result |= banshee_vga_r(device, space, offset*4+3, mem_mask >> 24) << 24;
42424242         break;
42434243
42444244      default:
r17961r17962
46064606      flush_fifos(v, device->machine().time());
46074607
46084608   if (offset < 0x80000/4)
4609      banshee_io_w(device, offset, data, mem_mask);
4609      banshee_io_w(device, space, offset, data, mem_mask);
46104610   else if (offset < 0x100000/4)
4611      banshee_agp_w(device, offset, data, mem_mask);
4611      banshee_agp_w(device, space, offset, data, mem_mask);
46124612   else if (offset < 0x200000/4)
46134613      logerror("%s:banshee_w(2D:%X) = %08X & %08X\n", device->machine().describe_context(), (offset*4) & 0xfffff, data, mem_mask);
46144614   else if (offset < 0x600000/4)
r17961r17962
47804780      case io_vgac0:   case io_vgac4:   case io_vgac8:   case io_vgacc:
47814781      case io_vgad0:   case io_vgad4:   case io_vgad8:   case io_vgadc:
47824782         if (ACCESSING_BITS_0_7)
4783            banshee_vga_w(device, offset*4+0, data >> 0);
4783            banshee_vga_w(device, space, offset*4+0, data >> 0, mem_mask >> 0);
47844784         if (ACCESSING_BITS_8_15)
4785            banshee_vga_w(device, offset*4+1, data >> 8);
4785            banshee_vga_w(device, space, offset*4+1, data >> 8, mem_mask >> 8);
47864786         if (ACCESSING_BITS_16_23)
4787            banshee_vga_w(device, offset*4+2, data >> 16);
4787            banshee_vga_w(device, space, offset*4+2, data >> 16, mem_mask >> 16);
47884788         if (ACCESSING_BITS_24_31)
4789            banshee_vga_w(device, offset*4+3, data >> 24);
4789            banshee_vga_w(device, space, offset*4+3, data >> 24, mem_mask >> 24);
47904790         break;
47914791
47924792      default:
trunk/src/emu/video/voodoo.h
r17961r17962
113113int voodoo_is_stalled(device_t *device);
114114void voodoo_set_init_enable(device_t *device, UINT32 newval);
115115
116READ32_DEVICE_HANDLER( voodoo_r );
117WRITE32_DEVICE_HANDLER( voodoo_w );
116DECLARE_READ32_DEVICE_HANDLER( voodoo_r );
117DECLARE_WRITE32_DEVICE_HANDLER( voodoo_w );
118118
119READ32_DEVICE_HANDLER( banshee_r );
120WRITE32_DEVICE_HANDLER( banshee_w );
121READ32_DEVICE_HANDLER( banshee_fb_r );
122WRITE32_DEVICE_HANDLER( banshee_fb_w );
123READ32_DEVICE_HANDLER( banshee_io_r );
124WRITE32_DEVICE_HANDLER( banshee_io_w );
125READ32_DEVICE_HANDLER( banshee_rom_r );
119DECLARE_READ32_DEVICE_HANDLER( banshee_r );
120DECLARE_WRITE32_DEVICE_HANDLER( banshee_w );
121DECLARE_READ32_DEVICE_HANDLER( banshee_fb_r );
122DECLARE_WRITE32_DEVICE_HANDLER( banshee_fb_w );
123DECLARE_READ32_DEVICE_HANDLER( banshee_io_r );
124DECLARE_WRITE32_DEVICE_HANDLER( banshee_io_w );
125DECLARE_READ32_DEVICE_HANDLER( banshee_rom_r );
126126
127127
128128/* ----- device interface ----- */
trunk/src/emu/video/i8275.h
r17961r17962
6565***************************************************************************/
6666
6767/* register access */
68READ8_DEVICE_HANDLER ( i8275_r );
69WRITE8_DEVICE_HANDLER ( i8275_w );
68DECLARE_READ8_DEVICE_HANDLER ( i8275_r );
69DECLARE_WRITE8_DEVICE_HANDLER ( i8275_w );
7070
7171/* updates the screen */
7272void i8275_update(device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect);
7373
74WRITE8_DEVICE_HANDLER( i8275_dack_w );
74DECLARE_WRITE8_DEVICE_HANDLER( i8275_dack_w );
7575
7676/***************************************************************************
7777    DEVICE CONFIGURATION MACROS
trunk/src/emu/video/s2636.h
r17961r17962
7171   D3 indicates whether the S2636 drew this pixel - 0 = not drawn, 1 = drawn */
7272
7373bitmap_ind16 &s2636_update( device_t *device, const rectangle &cliprect );
74WRITE8_DEVICE_HANDLER( s2636_work_ram_w );
75READ8_DEVICE_HANDLER( s2636_work_ram_r );
74DECLARE_WRITE8_DEVICE_HANDLER( s2636_work_ram_w );
75DECLARE_READ8_DEVICE_HANDLER( s2636_work_ram_r );
7676
7777
7878#endif /* __S2636_H__ */
trunk/src/emu/video/tms9927.c
r17961r17962
7373}
7474
7575
76static void generic_access(device_t *device, offs_t offset)
76static void generic_access(device_t *device, address_space &space, offs_t offset)
7777{
7878   tms9927_state *tms = get_safe_token(device);
7979
r17961r17962
8686            int cur;
8787
8888            for (cur = 0; cur < 7; cur++)
89               tms9927_w(device, cur, tms->selfload[cur]);
89               tms9927_w(device, space, cur, tms->selfload[cur]);
9090            for (cur = 0; cur < 1; cur++)
91               tms9927_w(device, cur + 0xc, tms->selfload[cur + 7]);
91               tms9927_w(device, space, cur + 0xc, tms->selfload[cur + 7]);
9292         }
9393         else
9494            popmessage("tms9927: self-load initiated with no PROM!");
r17961r17962
149149         break;
150150
151151      default:
152         generic_access(device, offset);
152         generic_access(device, space, offset);
153153         break;
154154   }
155155}
r17961r17962
166166         return tms->reg[offset - 0x08 + 7];
167167
168168      default:
169         generic_access(device, offset);
169         generic_access(device, space, offset);
170170         break;
171171   }
172172   return 0xff;
trunk/src/emu/video/tms9927.h
r17961r17962
8484
8585
8686/* basic read/write handlers */
87WRITE8_DEVICE_HANDLER( tms9927_w );
88READ8_DEVICE_HANDLER( tms9927_r );
87DECLARE_WRITE8_DEVICE_HANDLER( tms9927_w );
88DECLARE_READ8_DEVICE_HANDLER( tms9927_r );
8989
9090/* other queries */
9191int tms9927_screen_reset(device_t *device);
trunk/src/emu/video/pc_vga.h
r17961r17962
9999WRITE8_HANDLER(s3_mem_w);
100100
101101READ8_HANDLER( ati_port_03c0_r );
102READ8_DEVICE_HANDLER(ati_port_ext_r);
103WRITE8_DEVICE_HANDLER(ati_port_ext_w);
102DECLARE_READ8_DEVICE_HANDLER(ati_port_ext_r);
103DECLARE_WRITE8_DEVICE_HANDLER(ati_port_ext_w);
104104READ16_HANDLER(ibm8514_gpstatus_r);
105105WRITE16_HANDLER(ibm8514_cmd_w);
106106READ16_HANDLER(mach8_ext_fifo_r);
trunk/src/emu/devcb.h
r17961r17962
109109
110110// static template for a read8 stub function that calls through a given READ8_MEMBER
111111template<class _Class, UINT8 (_Class::*_Function)(address_space &, offs_t, UINT8)>
112UINT8 devcb_stub(device_t *device, offs_t offset)
112UINT8 devcb_stub(device_t *device, address_space &space, offs_t offset, UINT8 mem_mask)
113113{
114114   _Class *target = downcast<_Class *>(device);
115   return (target->*_Function)(*device->machine().memory().first_space(), offset, 0xff);
115   return (target->*_Function)(space, offset, mem_mask);
116116}
117117
118118// static template for a read16 stub function that calls through a given READ16_MEMBER
119119template<class _Class, UINT16 (_Class::*_Function)(address_space &, offs_t, UINT16)>
120UINT16 devcb_stub16(device_t *device, offs_t offset, UINT16 mask)
120UINT16 devcb_stub16(device_t *device, address_space &space, offs_t offset, UINT16 mem_mask)
121121{
122122   _Class *target = downcast<_Class *>(device);
123   return (target->*_Function)(*device->machine().memory().first_space(), offset, mask);
123   return (target->*_Function)(space, offset, mem_mask);
124124}
125125
126126// static template for a write_line stub function that calls through a given WRITE_LINE_MEMBER
r17961r17962
133133
134134// static template for a write8 stub function that calls through a given WRITE8_MEMBER
135135template<class _Class, void (_Class::*_Function)(address_space &, offs_t, UINT8, UINT8)>
136void devcb_stub(device_t *device, offs_t offset, UINT8 data)
136void devcb_stub(device_t *device, address_space &space, offs_t offset, UINT8 data, UINT8 mem_mask)
137137{
138138   _Class *target = downcast<_Class *>(device);
139   (target->*_Function)(*device->machine().memory().first_space(), offset, data, 0xff);
139   (target->*_Function)(space, offset, data, mem_mask);
140140}
141141
142142// static template for a write16 stub function that calls through a given WRITE16_MEMBER
143143template<class _Class, void (_Class::*_Function)(address_space &, offs_t, UINT16, UINT16)>
144void devcb_stub16(device_t *device, offs_t offset, UINT16 data, UINT16 mask)
144void devcb_stub16(device_t *device, address_space &space, offs_t offset, UINT16 data, UINT16 mem_mask)
145145{
146146   _Class *target = downcast<_Class *>(device);
147   (target->*_Function)(*device->machine().memory().first_space(), offset, data, mask);
147   (target->*_Function)(space, offset, data, mem_mask);
148148}
149149
150150#define DEVCB_NULL                        { DEVCB_TYPE_NULL }
r17961r17962
374374private:
375375   // internal helpers
376376   UINT8 from_port(offs_t offset);
377   UINT8 from_read8(offs_t offset);
377378   UINT8 from_readline(offs_t offset);
378379   UINT8 from_constant(offs_t offset);
379380
r17961r17962
424425   // internal helpers
425426   void to_null(offs_t offset, UINT8 data);
426427   void to_port(offs_t offset, UINT8 data);
428   void to_write8(offs_t offset, UINT8 data);
427429   void to_writeline(offs_t offset, UINT8 data);
428430   void to_input(offs_t offset, UINT8 data);
429431
r17961r17962
473475private:
474476   // internal helpers
475477   UINT16 from_port(offs_t offset, UINT16 mask);
478   UINT16 from_read16(offs_t offset, UINT16 mask);
476479   UINT16 from_readline(offs_t offset, UINT16 mask);
477480   UINT16 from_constant(offs_t offset, UINT16 mask);
478481
r17961r17962
523526   // internal helpers
524527   void to_null(offs_t offset, UINT16 data, UINT16 mask);
525528   void to_port(offs_t offset, UINT16 data, UINT16 mask);
529   void to_write16(offs_t offset, UINT16 data, UINT16 mask);
526530   void to_writeline(offs_t offset, UINT16 data, UINT16 mask);
527531   void to_input(offs_t offset, UINT16 data, UINT16 mask);
528532
trunk/src/emu/sound/es8712.h
r17961r17962
1111void es8712_set_bank_base(device_t *device, int base);
1212void es8712_set_frequency(device_t *device, int frequency);
1313
14WRITE8_DEVICE_HANDLER( es8712_w );
14DECLARE_WRITE8_DEVICE_HANDLER( es8712_w );
1515
1616class es8712_device : public device_t,
1717                                  public device_sound_interface
trunk/src/emu/sound/sp0256.c
r17961r17962
13171317
13181318   if( offset == 0 )
13191319   {
1320      sp0256_ALD_w( device, 0, data & 0xff );
1320      sp0256_ALD_w( device, space, 0, data & 0xff );
13211321      return;
13221322   }
13231323
trunk/src/emu/sound/nes_apu.h
r17961r17962
4242   const char *cpu_tag;  /* CPU tag */
4343};
4444
45READ8_DEVICE_HANDLER( nes_psg_r );
46WRITE8_DEVICE_HANDLER( nes_psg_w );
45DECLARE_READ8_DEVICE_HANDLER( nes_psg_r );
46DECLARE_WRITE8_DEVICE_HANDLER( nes_psg_w );
4747
4848class nesapu_device : public device_t,
4949                                  public device_sound_interface
trunk/src/emu/sound/262intf.h
r17961r17962
1212};
1313
1414
15READ8_DEVICE_HANDLER( ymf262_r );
16WRITE8_DEVICE_HANDLER( ymf262_w );
15DECLARE_READ8_DEVICE_HANDLER( ymf262_r );
16DECLARE_WRITE8_DEVICE_HANDLER( ymf262_w );
1717
18READ8_DEVICE_HANDLER ( ymf262_status_r );
19WRITE8_DEVICE_HANDLER( ymf262_register_a_w );
20WRITE8_DEVICE_HANDLER( ymf262_register_b_w );
21WRITE8_DEVICE_HANDLER( ymf262_data_a_w );
22WRITE8_DEVICE_HANDLER( ymf262_data_b_w );
18DECLARE_READ8_DEVICE_HANDLER ( ymf262_status_r );
19DECLARE_WRITE8_DEVICE_HANDLER( ymf262_register_a_w );
20DECLARE_WRITE8_DEVICE_HANDLER( ymf262_register_b_w );
21DECLARE_WRITE8_DEVICE_HANDLER( ymf262_data_a_w );
22DECLARE_WRITE8_DEVICE_HANDLER( ymf262_data_b_w );
2323
2424
2525class ymf262_device : public device_t,
trunk/src/emu/sound/sp0256.h
r17961r17962
6262
6363void sp0256_set_clock(device_t *device, int clock);
6464
65WRITE8_DEVICE_HANDLER( sp0256_ALD_w );
65DECLARE_WRITE8_DEVICE_HANDLER( sp0256_ALD_w );
6666
6767READ_LINE_DEVICE_HANDLER( sp0256_lrq_r );
6868READ_LINE_DEVICE_HANDLER( sp0256_sby_r );
6969
70READ16_DEVICE_HANDLER( spb640_r );
71WRITE16_DEVICE_HANDLER( spb640_w );
70DECLARE_READ16_DEVICE_HANDLER( spb640_r );
71DECLARE_WRITE16_DEVICE_HANDLER( spb640_w );
7272
7373class sp0256_device : public device_t,
7474                                  public device_sound_interface
trunk/src/emu/sound/2612intf.c
r17961r17962
146146}
147147
148148
149READ8_DEVICE_HANDLER( ym2612_status_port_a_r ) { return ym2612_r(device, 0); }
150READ8_DEVICE_HANDLER( ym2612_status_port_b_r ) { return ym2612_r(device, 2); }
151READ8_DEVICE_HANDLER( ym2612_data_port_a_r ) { return ym2612_r(device, 1); }
152READ8_DEVICE_HANDLER( ym2612_data_port_b_r ) { return ym2612_r(device, 3); }
149READ8_DEVICE_HANDLER( ym2612_status_port_a_r ) { return ym2612_r(device, space, 0); }
150READ8_DEVICE_HANDLER( ym2612_status_port_b_r ) { return ym2612_r(device, space, 2); }
151READ8_DEVICE_HANDLER( ym2612_data_port_a_r ) { return ym2612_r(device, space, 1); }
152READ8_DEVICE_HANDLER( ym2612_data_port_b_r ) { return ym2612_r(device, space, 3); }
153153
154WRITE8_DEVICE_HANDLER( ym2612_control_port_a_w ) { ym2612_w(device, 0, data); }
155WRITE8_DEVICE_HANDLER( ym2612_control_port_b_w ) { ym2612_w(device, 2, data); }
156WRITE8_DEVICE_HANDLER( ym2612_data_port_a_w ) { ym2612_w(device, 1, data); }
157WRITE8_DEVICE_HANDLER( ym2612_data_port_b_w ) { ym2612_w(device, 3, data); }
154WRITE8_DEVICE_HANDLER( ym2612_control_port_a_w ) { ym2612_w(device, space, 0, data); }
155WRITE8_DEVICE_HANDLER( ym2612_control_port_b_w ) { ym2612_w(device, space, 2, data); }
156WRITE8_DEVICE_HANDLER( ym2612_data_port_a_w ) { ym2612_w(device, space, 1, data); }
157WRITE8_DEVICE_HANDLER( ym2612_data_port_b_w ) { ym2612_w(device, space, 3, data); }
158158
159159const device_type YM2612 = &device_creator<ym2612_device>;
160160
trunk/src/emu/sound/iremga20.h
r17961r17962
1010
1111#include "devlegcy.h"
1212
13WRITE8_DEVICE_HANDLER( irem_ga20_w );
14READ8_DEVICE_HANDLER( irem_ga20_r );
13DECLARE_WRITE8_DEVICE_HANDLER( irem_ga20_w );
14DECLARE_READ8_DEVICE_HANDLER( irem_ga20_r );
1515
1616class iremga20_device : public device_t,
1717                                  public device_sound_interface
trunk/src/emu/sound/tms5110.h
r17961r17962
3838   devcb_write_line romclk_func;   /* rom clock - Only used to drive the data lines */
3939};
4040
41WRITE8_DEVICE_HANDLER( tms5110_ctl_w );
42READ8_DEVICE_HANDLER( tms5110_ctl_r );
41DECLARE_WRITE8_DEVICE_HANDLER( tms5110_ctl_w );
42DECLARE_READ8_DEVICE_HANDLER( tms5110_ctl_r );
4343WRITE_LINE_DEVICE_HANDLER( tms5110_pdc_w );
4444
4545/* this is only used by cvs.c
4646 * it is not related at all to the speech generation
4747 * and conflicts with the new rom controller interface.
4848 */
49READ8_DEVICE_HANDLER( tms5110_romclk_hack_r );
49DECLARE_READ8_DEVICE_HANDLER( tms5110_romclk_hack_r );
5050
5151/* m58817 status line */
52READ8_DEVICE_HANDLER( m58817_status_r );
52DECLARE_READ8_DEVICE_HANDLER( m58817_status_r );
5353
5454int tms5110_ready_r(device_t *device);
5555
r17961r17962
188188READ_LINE_DEVICE_HANDLER( tmsprom_data_r );
189189
190190/* offset is rom # */
191WRITE8_DEVICE_HANDLER( tmsprom_rom_csq_w );
192WRITE8_DEVICE_HANDLER( tmsprom_bit_w );
191DECLARE_WRITE8_DEVICE_HANDLER( tmsprom_rom_csq_w );
192DECLARE_WRITE8_DEVICE_HANDLER( tmsprom_bit_w );
193193WRITE_LINE_DEVICE_HANDLER( tmsprom_enable_w );
194194
195195class tmsprom_device : public device_t
trunk/src/emu/sound/3526intf.c
r17961r17962
138138   ym3526_write(info->chip, offset & 1, data);
139139}
140140
141READ8_DEVICE_HANDLER( ym3526_status_port_r ) { return ym3526_r(device, 0); }
142READ8_DEVICE_HANDLER( ym3526_read_port_r ) { return ym3526_r(device, 1); }
143WRITE8_DEVICE_HANDLER( ym3526_control_port_w ) { ym3526_w(device, 0, data); }
144WRITE8_DEVICE_HANDLER( ym3526_write_port_w ) { ym3526_w(device, 1, data); }
141READ8_DEVICE_HANDLER( ym3526_status_port_r ) { return ym3526_r(device, space, 0); }
142READ8_DEVICE_HANDLER( ym3526_read_port_r ) { return ym3526_r(device, space, 1); }
143WRITE8_DEVICE_HANDLER( ym3526_control_port_w ) { ym3526_w(device, space, 0, data); }
144WRITE8_DEVICE_HANDLER( ym3526_write_port_w ) { ym3526_w(device, space, 1, data); }
145145
146146
147147const device_type YM3526 = &device_creator<ym3526_device>;
trunk/src/emu/sound/2612intf.h
r17961r17962
1212   void (*handler)(device_t *device, int irq);
1313};
1414
15READ8_DEVICE_HANDLER( ym2612_r );
16WRITE8_DEVICE_HANDLER( ym2612_w );
15DECLARE_READ8_DEVICE_HANDLER( ym2612_r );
16DECLARE_WRITE8_DEVICE_HANDLER( ym2612_w );
1717
18READ8_DEVICE_HANDLER( ym2612_status_port_a_r );
19READ8_DEVICE_HANDLER( ym2612_status_port_b_r );
20READ8_DEVICE_HANDLER( ym2612_data_port_a_r );
21READ8_DEVICE_HANDLER( ym2612_data_port_b_r );
18DECLARE_READ8_DEVICE_HANDLER( ym2612_status_port_a_r );
19DECLARE_READ8_DEVICE_HANDLER( ym2612_status_port_b_r );
20DECLARE_READ8_DEVICE_HANDLER( ym2612_data_port_a_r );
21DECLARE_READ8_DEVICE_HANDLER( ym2612_data_port_b_r );
2222
23WRITE8_DEVICE_HANDLER( ym2612_control_port_a_w );
24WRITE8_DEVICE_HANDLER( ym2612_control_port_b_w );
25WRITE8_DEVICE_HANDLER( ym2612_data_port_a_w );
26WRITE8_DEVICE_HANDLER( ym2612_data_port_b_w );
23DECLARE_WRITE8_DEVICE_HANDLER( ym2612_control_port_a_w );
24DECLARE_WRITE8_DEVICE_HANDLER( ym2612_control_port_b_w );
25DECLARE_WRITE8_DEVICE_HANDLER( ym2612_data_port_a_w );
26DECLARE_WRITE8_DEVICE_HANDLER( ym2612_data_port_b_w );
2727
2828
2929class ym2612_device : public device_t,
trunk/src/emu/sound/k051649.c
r17961r17962
276276READ8_DEVICE_HANDLER ( k051649_test_r )
277277{
278278   /* reading the test register sets it to $ff! */
279   k051649_test_w(device, offset, 0xff);
279   k051649_test_w(device, space, offset, 0xff);
280280   return 0xff;
281281}
282282
trunk/src/emu/sound/3526intf.h
r17961r17962
1010   devcb_write_line out_int_func;
1111};
1212
13READ8_DEVICE_HANDLER( ym3526_r );
14WRITE8_DEVICE_HANDLER( ym3526_w );
13DECLARE_READ8_DEVICE_HANDLER( ym3526_r );
14DECLARE_WRITE8_DEVICE_HANDLER( ym3526_w );
1515
16READ8_DEVICE_HANDLER( ym3526_status_port_r );
17READ8_DEVICE_HANDLER( ym3526_read_port_r );
18WRITE8_DEVICE_HANDLER( ym3526_control_port_w );
19WRITE8_DEVICE_HANDLER( ym3526_write_port_w );
16DECLARE_READ8_DEVICE_HANDLER( ym3526_status_port_r );
17DECLARE_READ8_DEVICE_HANDLER( ym3526_read_port_r );
18DECLARE_WRITE8_DEVICE_HANDLER( ym3526_control_port_w );
19DECLARE_WRITE8_DEVICE_HANDLER( ym3526_write_port_w );
2020
2121class ym3526_device : public device_t,
2222                                  public device_sound_interface
trunk/src/emu/sound/k051649.h
r17961r17962
55
66#include "devlegcy.h"
77
8WRITE8_DEVICE_HANDLER( k051649_waveform_w );
9READ8_DEVICE_HANDLER ( k051649_waveform_r );
10WRITE8_DEVICE_HANDLER( k051649_volume_w );
11WRITE8_DEVICE_HANDLER( k051649_frequency_w );
12WRITE8_DEVICE_HANDLER( k051649_keyonoff_w );
13WRITE8_DEVICE_HANDLER( k051649_test_w );
14READ8_DEVICE_HANDLER ( k051649_test_r );
8DECLARE_WRITE8_DEVICE_HANDLER( k051649_waveform_w );
9DECLARE_READ8_DEVICE_HANDLER ( k051649_waveform_r );
10DECLARE_WRITE8_DEVICE_HANDLER( k051649_volume_w );
11DECLARE_WRITE8_DEVICE_HANDLER( k051649_frequency_w );
12DECLARE_WRITE8_DEVICE_HANDLER( k051649_keyonoff_w );
13DECLARE_WRITE8_DEVICE_HANDLER( k051649_test_w );
14DECLARE_READ8_DEVICE_HANDLER ( k051649_test_r );
1515
16WRITE8_DEVICE_HANDLER( k052539_waveform_w );
17READ8_DEVICE_HANDLER ( k052539_waveform_r );
16DECLARE_WRITE8_DEVICE_HANDLER( k052539_waveform_w );
17DECLARE_READ8_DEVICE_HANDLER ( k052539_waveform_r );
1818
1919class k051649_device : public device_t,
2020                                  public device_sound_interface
trunk/src/emu/sound/c140.h
r17961r17962
77
88#include "devlegcy.h"
99
10READ8_DEVICE_HANDLER( c140_r );
11WRITE8_DEVICE_HANDLER( c140_w );
10DECLARE_READ8_DEVICE_HANDLER( c140_r );
11DECLARE_WRITE8_DEVICE_HANDLER( c140_w );
1212
1313void c140_set_base(device_t *device, void *base);
1414
trunk/src/emu/sound/3812intf.c
r17961r17962
134134   ym3812_write(info->chip, offset & 1, data);
135135}
136136
137READ8_DEVICE_HANDLER( ym3812_status_port_r ) { return ym3812_r(device, 0); }
138READ8_DEVICE_HANDLER( ym3812_read_port_r ) { return ym3812_r(device, 1); }
139WRITE8_DEVICE_HANDLER( ym3812_control_port_w ) { ym3812_w(device, 0, data); }
140WRITE8_DEVICE_HANDLER( ym3812_write_port_w ) { ym3812_w(device, 1, data); }
137READ8_DEVICE_HANDLER( ym3812_status_port_r ) { return ym3812_r(device, space, 0); }
138READ8_DEVICE_HANDLER( ym3812_read_port_r ) { return ym3812_r(device, space, 1); }
139WRITE8_DEVICE_HANDLER( ym3812_control_port_w ) { ym3812_w(device, space, 0, data); }
140WRITE8_DEVICE_HANDLER( ym3812_write_port_w ) { ym3812_w(device, space, 1, data); }
141141
142142
143143const device_type YM3812 = &device_creator<ym3812_device>;
trunk/src/emu/sound/qsound.h
r17961r17962
1313
1414#define QSOUND_CLOCK    4000000   /* default 4MHz clock */
1515
16WRITE8_DEVICE_HANDLER( qsound_w );
17READ8_DEVICE_HANDLER( qsound_r );
16DECLARE_WRITE8_DEVICE_HANDLER( qsound_w );
17DECLARE_READ8_DEVICE_HANDLER( qsound_r );
1818
1919class qsound_device : public device_t,
2020                                  public device_sound_interface
trunk/src/emu/sound/3812intf.h
r17961r17962
1010   void (*handler)(device_t *device, int linestate);
1111};
1212
13READ8_DEVICE_HANDLER( ym3812_r );
14WRITE8_DEVICE_HANDLER( ym3812_w );
13DECLARE_READ8_DEVICE_HANDLER( ym3812_r );
14DECLARE_WRITE8_DEVICE_HANDLER( ym3812_w );
1515
16READ8_DEVICE_HANDLER( ym3812_status_port_r );
17READ8_DEVICE_HANDLER( ym3812_read_port_r );
18WRITE8_DEVICE_HANDLER( ym3812_control_port_w );
19WRITE8_DEVICE_HANDLER( ym3812_write_port_w );
16DECLARE_READ8_DEVICE_HANDLER( ym3812_status_port_r );
17DECLARE_READ8_DEVICE_HANDLER( ym3812_read_port_r );
18DECLARE_WRITE8_DEVICE_HANDLER( ym3812_control_port_w );
19DECLARE_WRITE8_DEVICE_HANDLER( ym3812_write_port_w );
2020
2121class ym3812_device : public device_t,
2222                                  public device_sound_interface
trunk/src/emu/sound/snkwave.h
r17961r17962
55
66#include "devlegcy.h"
77
8WRITE8_DEVICE_HANDLER( snkwave_w );
8DECLARE_WRITE8_DEVICE_HANDLER( snkwave_w );
99
1010class snkwave_device : public device_t,
1111                                  public device_sound_interface
trunk/src/emu/sound/rf5c400.h
r17961r17962
77
88#include "devlegcy.h"
99
10READ16_DEVICE_HANDLER( rf5c400_r );
11WRITE16_DEVICE_HANDLER( rf5c400_w );
10DECLARE_READ16_DEVICE_HANDLER( rf5c400_r );
11DECLARE_WRITE16_DEVICE_HANDLER( rf5c400_w );
1212
1313class rf5c400_device : public device_t,
1414                                  public device_sound_interface
trunk/src/emu/sound/saa1099.h
r17961r17962
99    Philips SAA1099 Sound driver
1010**********************************************/
1111
12WRITE8_DEVICE_HANDLER( saa1099_control_w );
13WRITE8_DEVICE_HANDLER( saa1099_data_w );
12DECLARE_WRITE8_DEVICE_HANDLER( saa1099_control_w );
13DECLARE_WRITE8_DEVICE_HANDLER( saa1099_data_w );
1414
1515class saa1099_device : public device_t,
1616                                  public device_sound_interface
trunk/src/emu/sound/digitalk.h
r17961r17962
77void digitalker_0_cms_w(device_t *device, int line);
88void digitalker_0_wr_w(device_t *device, int line);
99int digitalker_0_intr_r(device_t *device);
10WRITE8_DEVICE_HANDLER(digitalker_data_w);
10DECLARE_WRITE8_DEVICE_HANDLER(digitalker_data_w);
1111
1212class digitalker_device : public device_t,
1313                                  public device_sound_interface
trunk/src/emu/sound/ymz280b.h
r17961r17962
2020   devcb_write8 ext_write;      /* external RAM write */
2121};
2222
23READ8_DEVICE_HANDLER ( ymz280b_r );
24WRITE8_DEVICE_HANDLER( ymz280b_w );
23DECLARE_READ8_DEVICE_HANDLER ( ymz280b_r );
24DECLARE_WRITE8_DEVICE_HANDLER( ymz280b_w );
2525
2626class ymz280b_device : public device_t,
2727                                  public device_sound_interface
trunk/src/emu/sound/rf5c68.h
r17961r17962
1010#include "devlegcy.h"
1111
1212/******************************************/
13READ8_DEVICE_HANDLER( rf5c68_r );
14WRITE8_DEVICE_HANDLER( rf5c68_w );
13DECLARE_READ8_DEVICE_HANDLER( rf5c68_r );
14DECLARE_WRITE8_DEVICE_HANDLER( rf5c68_w );
1515
16READ8_DEVICE_HANDLER( rf5c68_mem_r );
17WRITE8_DEVICE_HANDLER( rf5c68_mem_w );
16DECLARE_READ8_DEVICE_HANDLER( rf5c68_mem_r );
17DECLARE_WRITE8_DEVICE_HANDLER( rf5c68_mem_w );
1818
1919struct rf5c68_interface
2020{
trunk/src/emu/sound/k005289.h
r17961r17962
55
66#include "devlegcy.h"
77
8WRITE8_DEVICE_HANDLER( k005289_control_A_w );
9WRITE8_DEVICE_HANDLER( k005289_control_B_w );
10WRITE8_DEVICE_HANDLER( k005289_pitch_A_w );
11WRITE8_DEVICE_HANDLER( k005289_pitch_B_w );
12WRITE8_DEVICE_HANDLER( k005289_keylatch_A_w );
13WRITE8_DEVICE_HANDLER( k005289_keylatch_B_w );
8DECLARE_WRITE8_DEVICE_HANDLER( k005289_control_A_w );
9DECLARE_WRITE8_DEVICE_HANDLER( k005289_control_B_w );
10DECLARE_WRITE8_DEVICE_HANDLER( k005289_pitch_A_w );
11DECLARE_WRITE8_DEVICE_HANDLER( k005289_pitch_B_w );
12DECLARE_WRITE8_DEVICE_HANDLER( k005289_keylatch_A_w );
13DECLARE_WRITE8_DEVICE_HANDLER( k005289_keylatch_B_w );
1414
1515class k005289_device : public device_t,
1616                                  public device_sound_interface
trunk/src/emu/sound/aica.c
r17961r17962
681681   }
682682}
683683
684static void AICA_UpdateReg(aica_state *AICA, int reg)
684static void AICA_UpdateReg(aica_state *AICA, address_space &space, int reg)
685685{
686686   switch(reg&0xff)
687687   {
r17961r17962
702702         break;
703703      case 0x8:
704704      case 0x9:
705         aica_midi_in(AICA->device, 0, AICA->udata.data[0x8/2]&0xff, 0xffff);
705         aica_midi_in(AICA->device, space, 0, AICA->udata.data[0x8/2]&0xff, 0xffff);
706706         break;
707707      case 0x12:
708708      case 0x13:
r17961r17962
823823
824824}
825825
826static void AICA_UpdateRegR(aica_state *AICA, int reg)
826static void AICA_UpdateRegR(aica_state *AICA, address_space &space, int reg)
827827{
828828   switch(reg&0xff)
829829   {
r17961r17962
894894   }
895895}
896896
897static void AICA_w16(aica_state *AICA,unsigned int addr,unsigned short val)
897static void AICA_w16(aica_state *AICA,address_space &space,unsigned int addr,unsigned short val)
898898{
899899   addr&=0xffff;
900900   if(addr<0x2000)
r17961r17962
919919      {
920920//          printf("%x to AICA global @ %x\n", val, addr & 0xff);
921921         *((unsigned short *) (AICA->udata.datab+((addr&0xff)))) = val;
922         AICA_UpdateReg(AICA, addr&0xff);
922         AICA_UpdateReg(AICA, space, addr&0xff);
923923      }
924924      else if (addr == 0x2d00)
925925      {
r17961r17962
954954   }
955955}
956956
957static unsigned short AICA_r16(aica_state *AICA, unsigned int addr)
957static unsigned short AICA_r16(aica_state *AICA, address_space &space, unsigned int addr)
958958{
959959   unsigned short v=0;
960960   addr&=0xffff;
r17961r17962
973973      }
974974      else if (addr < 0x28be)
975975      {
976         AICA_UpdateRegR(AICA, addr&0xff);
976         AICA_UpdateRegR(AICA, space, addr&0xff);
977977         v= *((unsigned short *) (AICA->udata.datab+((addr&0xff))));
978978         if((addr&0xfffe)==0x2810) AICA->udata.data[0x10/2] &= 0x7FFF;   // reset LP on read
979979      }
r17961r17962
13231323READ16_DEVICE_HANDLER( aica_r )
13241324{
13251325   aica_state *AICA = get_safe_token(device);
1326   return AICA_r16(AICA, offset*2);
1326   return AICA_r16(AICA, space,offset*2);
13271327}
13281328
13291329WRITE16_DEVICE_HANDLER( aica_w )
r17961r17962
13311331   aica_state *AICA = get_safe_token(device);
13321332   UINT16 tmp;
13331333
1334   tmp = AICA_r16(AICA, offset*2);
1334   tmp = AICA_r16(AICA, space, offset*2);
13351335   COMBINE_DATA(&tmp);
1336   AICA_w16(AICA, offset*2, tmp);
1336   AICA_w16(AICA, space, offset*2, tmp);
13371337}
13381338
13391339WRITE16_DEVICE_HANDLER( aica_midi_in )
trunk/src/emu/sound/aica.h
r17961r17962
1818void aica_set_ram_base(device_t *device, void *base, int size);
1919
2020// AICA register access
21READ16_DEVICE_HANDLER( aica_r );
22WRITE16_DEVICE_HANDLER( aica_w );
21DECLARE_READ16_DEVICE_HANDLER( aica_r );
22DECLARE_WRITE16_DEVICE_HANDLER( aica_w );
2323
2424// MIDI I/O access
25WRITE16_DEVICE_HANDLER( aica_midi_in );
26READ16_DEVICE_HANDLER( aica_midi_out_r );
25DECLARE_WRITE16_DEVICE_HANDLER( aica_midi_in );
26DECLARE_READ16_DEVICE_HANDLER( aica_midi_out_r );
2727
2828class aica_device : public device_t,
2929                                  public device_sound_interface
trunk/src/emu/sound/sn76496.h
r17961r17962
66#include "devlegcy.h"
77
88READ_LINE_DEVICE_HANDLER( sn76496_ready_r );
9WRITE8_DEVICE_HANDLER( sn76496_w );
10WRITE8_DEVICE_HANDLER( sn76496_stereo_w );
9DECLARE_WRITE8_DEVICE_HANDLER( sn76496_w );
10DECLARE_WRITE8_DEVICE_HANDLER( sn76496_stereo_w );
1111
1212class sn76496_device : public device_t,
1313                                  public device_sound_interface
trunk/src/emu/sound/x1_010.c
r17961r17962
269269   UINT16   ret;
270270
271271   ret = info->HI_WORD_BUF[offset]<<8;
272   ret += (seta_sound_r( device, offset )&0xff);
272   ret += (seta_sound_r( device, space, offset )&0xff);
273273   LOG_REGISTER_READ(( "%s: Read X1-010 Offset:%04X Data:%04X\n", device->machine().describe_context(), offset, ret ));
274274   return ret;
275275}
r17961r17962
278278{
279279   x1_010_state *info = get_safe_token(device);
280280   info->HI_WORD_BUF[offset] = (data>>8)&0xff;
281   seta_sound_w( device, offset, data&0xff );
281   seta_sound_w( device, space, offset, data&0xff );
282282   LOG_REGISTER_WRITE(( "%s: Write X1-010 Offset:%04X Data:%04X\n", device->machine().describe_context(), offset, data ));
283283}
284284
trunk/src/emu/sound/astrocde.h
r17961r17962
55
66#include "devlegcy.h"
77
8WRITE8_DEVICE_HANDLER( astrocade_sound_w );
8DECLARE_WRITE8_DEVICE_HANDLER( astrocade_sound_w );
99
1010class astrocade_device : public device_t,
1111                                  public device_sound_interface
trunk/src/emu/sound/x1_010.h
r17961r17962
1212};
1313
1414
15READ8_DEVICE_HANDLER ( seta_sound_r );
16WRITE8_DEVICE_HANDLER( seta_sound_w );
15DECLARE_READ8_DEVICE_HANDLER ( seta_sound_r );
16DECLARE_WRITE8_DEVICE_HANDLER( seta_sound_w );
1717
18READ16_DEVICE_HANDLER ( seta_sound_word_r );
19WRITE16_DEVICE_HANDLER( seta_sound_word_w );
18DECLARE_READ16_DEVICE_HANDLER ( seta_sound_word_r );
19DECLARE_WRITE16_DEVICE_HANDLER( seta_sound_word_w );
2020
2121void seta_sound_enable_w(device_t *device, int data);
2222
trunk/src/emu/sound/k056800.h
r17961r17962
5757    DEVICE I/O FUNCTIONS
5858***************************************************************************/
5959
60READ32_DEVICE_HANDLER( k056800_host_r );
61WRITE32_DEVICE_HANDLER( k056800_host_w );
62READ16_DEVICE_HANDLER( k056800_sound_r );
63WRITE16_DEVICE_HANDLER( k056800_sound_w );
60DECLARE_READ32_DEVICE_HANDLER( k056800_host_r );
61DECLARE_WRITE32_DEVICE_HANDLER( k056800_host_w );
62DECLARE_READ16_DEVICE_HANDLER( k056800_sound_r );
63DECLARE_WRITE16_DEVICE_HANDLER( k056800_sound_w );
6464
6565
6666#endif /* __K056800_H__ */
trunk/src/emu/sound/upd7759.h
r17961r17962
2525void upd7759_reset_w(device_t *device, UINT8 data);
2626void upd7759_start_w(device_t *device, UINT8 data);
2727int upd7759_busy_r(device_t *device);
28WRITE8_DEVICE_HANDLER( upd7759_port_w );
28DECLARE_WRITE8_DEVICE_HANDLER( upd7759_port_w );
2929
3030class upd7759_device : public device_t,
3131                                  public device_sound_interface
trunk/src/emu/sound/ymf271.h
r17961r17962
1313   void (*irq_callback)(device_t *device, int state);   /* irq callback */
1414};
1515
16READ8_DEVICE_HANDLER( ymf271_r );
17WRITE8_DEVICE_HANDLER( ymf271_w );
16DECLARE_READ8_DEVICE_HANDLER( ymf271_r );
17DECLARE_WRITE8_DEVICE_HANDLER( ymf271_w );
1818
1919class ymf271_device : public device_t,
2020                                  public device_sound_interface
trunk/src/emu/sound/n63701x.h
r17961r17962
55
66#include "devlegcy.h"
77
8WRITE8_DEVICE_HANDLER( namco_63701x_w );
8DECLARE_WRITE8_DEVICE_HANDLER( namco_63701x_w );
99
1010class namco_63701x_device : public device_t,
1111                                  public device_sound_interface
trunk/src/emu/sound/ay8910.c
r17961r17962
10001000#if ENABLE_REGISTER_TEST
10011001   return;
10021002#else
1003   ay8910_data_address_w(device, 1, data);
1003   ay8910_data_address_w(device, space, 1, data);
10041004#endif
10051005}
10061006
r17961r17962
10091009#if ENABLE_REGISTER_TEST
10101010   return;
10111011#else
1012   ay8910_data_address_w(device, 0, data);
1012   ay8910_data_address_w(device, space, 0, data);
10131013#endif
10141014}
10151015
r17961r17962
10231023READ8_DEVICE_HANDLER( ay8914_r )
10241024{
10251025   UINT16 rv;
1026   ay8910_address_w(device, 0, mapping8914to8910[offset & 0xff]);
1027   rv = (UINT16)ay8910_r(device, 0);
1026   ay8910_address_w(device, space, 0, mapping8914to8910[offset & 0xff]);
1027   rv = (UINT16)ay8910_r(device, space, 0);
10281028   return rv;
10291029}
10301030
10311031WRITE8_DEVICE_HANDLER( ay8914_w )
10321032{
1033   ay8910_address_w(device, 0, mapping8914to8910[offset & 0xff]);
1034   ay8910_data_w(device, 0, data & 0xff);
1033   ay8910_address_w(device, space, 0, mapping8914to8910[offset & 0xff]);
1034   ay8910_data_w(device, space, 0, data & 0xff);
10351035}
10361036
10371037
trunk/src/emu/sound/ym2151.c
r17961r17962
163163   UINT32      noise_tab[32];         /* 17bit Noise Generator periods */
164164
165165   void (*irqhandler)(device_t *device, int irq);      /* IRQ function handler */
166   write8_device_func porthandler;      /* port write function handler */
166   void (*porthandler)(device_t *, offs_t, UINT8);      /* port write function handler */
167167
168168   device_t *device;
169169   unsigned int clock;               /* chip clock in Hz (passed from 2151intf.c) */
r17961r17962
24922492   PSG->irqhandler = handler;
24932493}
24942494
2495void ym2151_set_port_write_handler(void *chip, write8_device_func handler)
2495void ym2151_set_port_write_handler(void *chip, void (*handler)(device_t *, offs_t, UINT8))
24962496{
24972497   YM2151 *PSG = (YM2151 *)chip;
24982498   PSG->porthandler = handler;
trunk/src/emu/sound/sp0250.h
r17961r17962
99   void (*drq_callback)(device_t *device, int state);
1010};
1111
12WRITE8_DEVICE_HANDLER( sp0250_w );
12DECLARE_WRITE8_DEVICE_HANDLER( sp0250_w );
1313UINT8 sp0250_drq_r(device_t *device);
1414
1515class sp0250_device : public device_t,
trunk/src/emu/sound/ay8910.h
r17961r17962
9090
9191void ay8910_set_volume(device_t *device,int channel,int volume);
9292
93READ8_DEVICE_HANDLER( ay8910_r );
94WRITE8_DEVICE_HANDLER( ay8910_address_w );
95WRITE8_DEVICE_HANDLER( ay8910_data_w );
93DECLARE_READ8_DEVICE_HANDLER( ay8910_r );
94DECLARE_WRITE8_DEVICE_HANDLER( ay8910_address_w );
95DECLARE_WRITE8_DEVICE_HANDLER( ay8910_data_w );
9696
9797/* /RES */
98WRITE8_DEVICE_HANDLER( ay8910_reset_w );
98DECLARE_WRITE8_DEVICE_HANDLER( ay8910_reset_w );
9999
100100/* use this when BC1 == A0; here, BC1=0 selects 'data' and BC1=1 selects 'latch address' */
101WRITE8_DEVICE_HANDLER( ay8910_data_address_w );
101DECLARE_WRITE8_DEVICE_HANDLER( ay8910_data_address_w );
102102
103103/* use this when BC1 == !A0; here, BC1=0 selects 'latch address' and BC1=1 selects 'data' */
104WRITE8_DEVICE_HANDLER( ay8910_address_data_w );
104DECLARE_WRITE8_DEVICE_HANDLER( ay8910_address_data_w );
105105
106106/* AY8914 handlers needed due to different register map */
107READ8_DEVICE_HANDLER( ay8914_r );
108WRITE8_DEVICE_HANDLER( ay8914_w );
107DECLARE_READ8_DEVICE_HANDLER( ay8914_r );
108DECLARE_WRITE8_DEVICE_HANDLER( ay8914_w );
109109
110110
111111/*********** An interface for SSG of YM2203 ***********/
trunk/src/emu/sound/st0016.h
r17961r17962
1010   UINT8 **p_soundram;
1111};
1212
13READ8_DEVICE_HANDLER( st0016_snd_r );
14WRITE8_DEVICE_HANDLER( st0016_snd_w );
13DECLARE_READ8_DEVICE_HANDLER( st0016_snd_r );
14DECLARE_WRITE8_DEVICE_HANDLER( st0016_snd_w );
1515
1616class st0016_device : public device_t,
1717                                  public device_sound_interface
trunk/src/emu/sound/tiaintf.h
r17961r17962
55
66#include "devlegcy.h"
77
8WRITE8_DEVICE_HANDLER( tia_sound_w );
8DECLARE_WRITE8_DEVICE_HANDLER( tia_sound_w );
99
1010class tia_device : public device_t,
1111                                  public device_sound_interface
trunk/src/emu/sound/ym2151.h
r17961r17962
8181void ym2151_set_irq_handler(void *chip, void (*handler)(device_t *device, int irq));
8282
8383/* set port write handler on YM2151 chip number 'n'*/
84void ym2151_set_port_write_handler(void *chip, write8_device_func handler);
84void ym2151_set_port_write_handler(void *chip, void (*handler)(device_t *, offs_t, UINT8));
8585
8686#endif /*__YM2151_H__*/
trunk/src/emu/sound/c6280.h
r17961r17962
1111};
1212
1313/* Function prototypes */
14WRITE8_DEVICE_HANDLER( c6280_w );
15READ8_DEVICE_HANDLER( c6280_r );
14DECLARE_WRITE8_DEVICE_HANDLER( c6280_w );
15DECLARE_READ8_DEVICE_HANDLER( c6280_r );
1616
1717class c6280_device : public device_t,
1818                                  public device_sound_interface
trunk/src/emu/sound/discrete.h
r17961r17962
42564256 *
42574257 *************************************/
42584258
4259WRITE8_DEVICE_HANDLER( discrete_sound_w );
4260READ8_DEVICE_HANDLER( discrete_sound_r );
4259DECLARE_WRITE8_DEVICE_HANDLER( discrete_sound_w );
4260DECLARE_READ8_DEVICE_HANDLER( discrete_sound_r );
42614261
42624262//**************************************************************************
42634263//  INTERFACE CONFIGURATION MACROS
trunk/src/emu/sound/scsp.c
r17961r17962
230230   device_t *device;
231231};
232232
233static void dma_scsp(address_space *space, scsp_state *scsp);      /*state DMA transfer function*/
233static void dma_scsp(address_space &space, scsp_state *scsp);      /*state DMA transfer function*/
234234#define   scsp_dgate      scsp->scsp_dmactrl & 0x4000
235235#define   scsp_ddir      scsp->scsp_dmactrl & 0x2000
236236#define scsp_dexe      scsp->scsp_dmactrl & 0x1000
r17961r17962
698698   }
699699}
700700
701static void SCSP_UpdateReg(scsp_state *scsp, int reg)
701static void SCSP_UpdateReg(scsp_state *scsp, address_space &space, int reg)
702702{
703   /* temporary hack until this is converted to a device */
704   address_space *space = scsp->device->machine().firstcpu->space(AS_PROGRAM);
705
706703   switch(reg&0x3f)
707704   {
708705      case 0x0:
r17961r17962
726723         break;
727724      case 0x6:
728725      case 0x7:
729         scsp_midi_in(space->machine().device("scsp"), 0, scsp->udata.data[0x6/2]&0xff, 0);
726         scsp_midi_in(space.machine().device("scsp"), space, 0, scsp->udata.data[0x6/2]&0xff, 0);
730727         break;
731728      case 0x12:
732729      case 0x13:
r17961r17962
837834
838835}
839836
840static void SCSP_UpdateRegR(scsp_state *scsp, int reg)
837static void SCSP_UpdateRegR(scsp_state *scsp, address_space &space, int reg)
841838{
842839   switch(reg&0x3f)
843840   {
r17961r17962
885882   }
886883}
887884
888static void SCSP_w16(scsp_state *scsp,unsigned int addr,unsigned short val)
885static void SCSP_w16(scsp_state *scsp,address_space &space,unsigned int addr,unsigned short val)
889886{
890887   addr&=0xffff;
891888   if(addr<0x400)
r17961r17962
900897      if (addr < 0x430)
901898      {
902899         *((unsigned short *) (scsp->udata.datab+((addr&0x3f)))) = val;
903         SCSP_UpdateReg(scsp, addr&0x3f);
900         SCSP_UpdateReg(scsp, space, addr&0x3f);
904901      }
905902   }
906903   else if(addr<0x700)
r17961r17962
924921   }
925922}
926923
927static unsigned short SCSP_r16(scsp_state *scsp, unsigned int addr)
924static unsigned short SCSP_r16(scsp_state *scsp, address_space &space, unsigned int addr)
928925{
929926   unsigned short v=0;
930927   addr&=0xffff;
r17961r17962
941938   {
942939      if (addr < 0x430)
943940      {
944         SCSP_UpdateRegR(scsp, addr&0x3f);
941         SCSP_UpdateRegR(scsp, space, addr&0x3f);
945942         v= *((unsigned short *) (scsp->udata.datab+((addr&0x3f))));
946943      }
947944   }
r17961r17962
11801177}
11811178
11821179/* TODO: this needs to be timer-ized */
1183static void dma_scsp(address_space *space, scsp_state *scsp)
1180static void dma_scsp(address_space &space, scsp_state *scsp)
11841181{
11851182   static UINT16 tmp_dma[3];
11861183   int i;
r17961r17962
12121209   {
12131210      for(i=0;i < scsp->scsp_dtlg;i+=2)
12141211      {
1215         space->write_word(scsp->scsp_dmea, space->read_word(0x100000|scsp->scsp_drga));
1212         space.write_word(scsp->scsp_dmea, space.read_word(0x100000|scsp->scsp_drga));
12161213         scsp->scsp_dmea+=2;
12171214         scsp->scsp_drga+=2;
12181215      }
r17961r17962
12211218   {
12221219      for(i=0;i < scsp->scsp_dtlg;i+=2)
12231220      {
1224         space->write_word(0x100000|scsp->scsp_drga,space->read_word(scsp->scsp_dmea));
1221         space.write_word(0x100000|scsp->scsp_drga,space.read_word(scsp->scsp_dmea));
12251222         scsp->scsp_dmea+=2;
12261223         scsp->scsp_drga+=2;
12271224      }
r17961r17962
12401237   if(scsp->udata.data[0x1e/2] & 0x10)
12411238   {
12421239      popmessage("SCSP DMA IRQ triggered, contact MAMEdev");
1243      space->machine().device("audiocpu")->execute().set_input_line(DecodeSCI(scsp,SCIDMA),HOLD_LINE);
1240      space.machine().device("audiocpu")->execute().set_input_line(DecodeSCI(scsp,SCIDMA),HOLD_LINE);
12441241   }
12451242}
12461243
r17961r17962
13021299
13031300   scsp->stream->update();
13041301
1305   return SCSP_r16(scsp, offset*2);
1302   return SCSP_r16(scsp, space, offset*2);
13061303}
13071304
13081305WRITE16_DEVICE_HANDLER( scsp_w )
r17961r17962
13121309
13131310   scsp->stream->update();
13141311
1315   tmp = SCSP_r16(scsp, offset*2);
1312   tmp = SCSP_r16(scsp, space, offset*2);
13161313   COMBINE_DATA(&tmp);
1317   SCSP_w16(scsp,offset*2, tmp);
1314   SCSP_w16(scsp,space,offset*2, tmp);
13181315
13191316   switch(offset*2)
13201317   {
r17961r17962
13241321      case 0x416:
13251322         COMBINE_DATA(&scsp->dma_regs[((offset-0x412)/2) & 3]);
13261323         if(ACCESSING_BITS_8_15 && offset*2 == 0x416)
1327            dma_scsp(device->machine().firstcpu->space(AS_PROGRAM), scsp);
1324            dma_scsp(space, scsp);
13281325         break;
13291326      case 0x42a:      //check main cpu IRQ
13301327         scsp->main_irq(1);
trunk/src/emu/sound/msm5232.c
r17961r17962
6969
7070   double   external_capacity[8]; /* in Farads, eg 0.39e-6 = 0.36 uF (microFarads) */
7171   device_t *device;
72   void (*gate_handler)(device_t *device, int state);   /* callback called when the GATE output pin changes state */
72   devcb_resolved_write_line gate_handler;/* callback called when the GATE output pin changes state */
7373
7474};
7575
r17961r17962
260260{
261261   int new_state = (chip->control2 & 0x20) ? chip->voi[7].GF : 0;
262262
263   if (chip->gate != new_state && chip->gate_handler)
263   if (chip->gate != new_state && !chip->gate_handler.isnull())
264264   {
265265      chip->gate = new_state;
266      (*chip->gate_handler)(chip->device, new_state);
266      chip->gate_handler(new_state);
267267   }
268268}
269269
r17961r17962
275275
276276   for (i=0; i<8; i++)
277277   {
278      msm5232_w(device,i,0x80);
279      msm5232_w(device,i,0x00);
278      msm5232_w(device,device->machine().driver_data()->generic_space(),i,0x80);
279      msm5232_w(device,device->machine().driver_data()->generic_space(),i,0x00);
280280   }
281281   chip->noise_cnt      = 0;
282282   chip->noise_rng      = 1;
r17961r17962
309309      chip->external_capacity[j] = intf->capacity[j];
310310   }
311311
312   chip->gate_handler = intf->gate_handler;
312   chip->gate_handler.resolve(intf->gate_handler_cb, *chip->device);
313313
314314   msm5232_init_tables( chip );
315315
trunk/src/emu/sound/2610intf.c
r17961r17962
207207}
208208
209209
210READ8_DEVICE_HANDLER( ym2610_status_port_a_r ) { return ym2610_r(device, 0); }
211READ8_DEVICE_HANDLER( ym2610_status_port_b_r ) { return ym2610_r(device, 2); }
212READ8_DEVICE_HANDLER( ym2610_read_port_r ) { return ym2610_r(device, 1); }
210READ8_DEVICE_HANDLER( ym2610_status_port_a_r ) { return ym2610_r(device, space, 0); }
211READ8_DEVICE_HANDLER( ym2610_status_port_b_r ) { return ym2610_r(device, space, 2); }
212READ8_DEVICE_HANDLER( ym2610_read_port_r ) { return ym2610_r(device, space, 1); }
213213
214WRITE8_DEVICE_HANDLER( ym2610_control_port_a_w ) { ym2610_w(device, 0, data); }
215WRITE8_DEVICE_HANDLER( ym2610_control_port_b_w ) { ym2610_w(device, 2, data); }
216WRITE8_DEVICE_HANDLER( ym2610_data_port_a_w ) { ym2610_w(device, 1, data); }
217WRITE8_DEVICE_HANDLER( ym2610_data_port_b_w ) { ym2610_w(device, 3, data); }
214WRITE8_DEVICE_HANDLER( ym2610_control_port_a_w ) { ym2610_w(device, space, 0, data); }
215WRITE8_DEVICE_HANDLER( ym2610_control_port_b_w ) { ym2610_w(device, space, 2, data); }
216WRITE8_DEVICE_HANDLER( ym2610_data_port_a_w ) { ym2610_w(device, space, 1, data); }
217WRITE8_DEVICE_HANDLER( ym2610_data_port_b_w ) { ym2610_w(device, space, 3, data); }
218218
219219const device_type YM2610 = &device_creator<ym2610_device>;
220220
trunk/src/emu/sound/scsp.h
r17961r17962
1919void scsp_set_ram_base(device_t *device, void *base);
2020
2121// SCSP register access
22READ16_DEVICE_HANDLER( scsp_r );
23WRITE16_DEVICE_HANDLER( scsp_w );
22DECLARE_READ16_DEVICE_HANDLER( scsp_r );
23DECLARE_WRITE16_DEVICE_HANDLER( scsp_w );
2424
2525// MIDI I/O access (used for comms on Model 2/3)
26WRITE16_DEVICE_HANDLER( scsp_midi_in );
27READ16_DEVICE_HANDLER( scsp_midi_out_r );
26DECLARE_WRITE16_DEVICE_HANDLER( scsp_midi_in );
27DECLARE_READ16_DEVICE_HANDLER( scsp_midi_out_r );
2828
2929extern UINT32* stv_scu;
3030
trunk/src/emu/sound/msm5232.h
r17961r17962
88struct msm5232_interface
99{
1010   double capacity[8];   /* in Farads, capacitors connected to pins: 24,25,26,27 and 37,38,39,40 */
11   void (*gate_handler)(device_t *device, int state);   /* callback called when the GATE output pin changes state */
11   devcb_write_line gate_handler_cb; /* callback called when the GATE output pin changes state */
1212};
1313
14WRITE8_DEVICE_HANDLER( msm5232_w );
14DECLARE_WRITE8_DEVICE_HANDLER( msm5232_w );
1515
1616void msm5232_set_clock(device_t *device, int clock);
1717
trunk/src/emu/sound/2610intf.h
r17961r17962
1414   void ( *handler )( device_t *device, int irq );   /* IRQ handler for the YM2610 */
1515};
1616
17READ8_DEVICE_HANDLER( ym2610_r );
18WRITE8_DEVICE_HANDLER( ym2610_w );
17DECLARE_READ8_DEVICE_HANDLER( ym2610_r );
18DECLARE_WRITE8_DEVICE_HANDLER( ym2610_w );
1919
20READ8_DEVICE_HANDLER( ym2610_status_port_a_r );
21READ8_DEVICE_HANDLER( ym2610_status_port_b_r );
22READ8_DEVICE_HANDLER( ym2610_read_port_r );
20DECLARE_READ8_DEVICE_HANDLER( ym2610_status_port_a_r );
21DECLARE_READ8_DEVICE_HANDLER( ym2610_status_port_b_r );
22DECLARE_READ8_DEVICE_HANDLER( ym2610_read_port_r );
2323
24WRITE8_DEVICE_HANDLER( ym2610_control_port_a_w );
25WRITE8_DEVICE_HANDLER( ym2610_control_port_b_w );
26WRITE8_DEVICE_HANDLER( ym2610_data_port_a_w );
27WRITE8_DEVICE_HANDLER( ym2610_data_port_b_w );
24DECLARE_WRITE8_DEVICE_HANDLER( ym2610_control_port_a_w );
25DECLARE_WRITE8_DEVICE_HANDLER( ym2610_control_port_b_w );
26DECLARE_WRITE8_DEVICE_HANDLER( ym2610_data_port_a_w );
27DECLARE_WRITE8_DEVICE_HANDLER( ym2610_data_port_b_w );
2828
2929
3030class ym2610_device : public device_t,
trunk/src/emu/sound/ics2115.h
r17961r17962
9898   // inline configuration helpers
9999   static void static_set_irqf(device_t &device, void (*irqf)(device_t *device, int state));
100100
101   static READ8_DEVICE_HANDLER(read);
102    static WRITE8_DEVICE_HANDLER(write);
101   static DECLARE_READ8_DEVICE_HANDLER(read);
102    static DECLARE_WRITE8_DEVICE_HANDLER(write);
103103   //UINT8 read(offs_t offset);
104104   //void write(offs_t offset, UINT8 data);
105105    static TIMER_CALLBACK(timer_cb_0);
trunk/src/emu/sound/gaelco.h
r17961r17962
1111   int banks[4];         /* start of each ROM bank */
1212};
1313
14WRITE16_DEVICE_HANDLER( gaelcosnd_w );
15READ16_DEVICE_HANDLER( gaelcosnd_r );
14DECLARE_WRITE16_DEVICE_HANDLER( gaelcosnd_w );
15DECLARE_READ16_DEVICE_HANDLER( gaelcosnd_r );
1616
1717class gaelco_gae1_device : public device_t,
1818                                  public device_sound_interface
trunk/src/emu/sound/2608intf.c
r17961r17962
194194   ym2608_write(info->chip, offset & 3, data);
195195}
196196
197READ8_DEVICE_HANDLER( ym2608_read_port_r ) { return ym2608_r(device, 1); }
198READ8_DEVICE_HANDLER( ym2608_status_port_a_r ) { return ym2608_r(device, 0); }
199READ8_DEVICE_HANDLER( ym2608_status_port_b_r ) { return ym2608_r(device, 2); }
197READ8_DEVICE_HANDLER( ym2608_read_port_r ) { return ym2608_r(device, space, 1); }
198READ8_DEVICE_HANDLER( ym2608_status_port_a_r ) { return ym2608_r(device, space, 0); }
199READ8_DEVICE_HANDLER( ym2608_status_port_b_r ) { return ym2608_r(device, space, 2); }
200200
201WRITE8_DEVICE_HANDLER( ym2608_control_port_a_w ) { ym2608_w(device, 0, data); }
202WRITE8_DEVICE_HANDLER( ym2608_control_port_b_w ) { ym2608_w(device, 2, data); }
203WRITE8_DEVICE_HANDLER( ym2608_data_port_a_w ) { ym2608_w(device, 1, data); }
204WRITE8_DEVICE_HANDLER( ym2608_data_port_b_w ) { ym2608_w(device, 3, data); }
201WRITE8_DEVICE_HANDLER( ym2608_control_port_a_w ) { ym2608_w(device, space, 0, data); }
202WRITE8_DEVICE_HANDLER( ym2608_control_port_b_w ) { ym2608_w(device, space, 2, data); }
203WRITE8_DEVICE_HANDLER( ym2608_data_port_a_w ) { ym2608_w(device, space, 1, data); }
204WRITE8_DEVICE_HANDLER( ym2608_data_port_b_w ) { ym2608_w(device, space, 3, data); }
205205
206206const device_type YM2608 = &device_creator<ym2608_device>;
207207
trunk/src/emu/sound/2608intf.h
r17961r17962
1616   void ( *handler )( device_t *device, int irq );   /* IRQ handler for the YM2608 */
1717};
1818
19READ8_DEVICE_HANDLER( ym2608_r );
20WRITE8_DEVICE_HANDLER( ym2608_w );
19DECLARE_READ8_DEVICE_HANDLER( ym2608_r );
20DECLARE_WRITE8_DEVICE_HANDLER( ym2608_w );
2121
22READ8_DEVICE_HANDLER( ym2608_read_port_r );
23READ8_DEVICE_HANDLER( ym2608_status_port_a_r );
24READ8_DEVICE_HANDLER( ym2608_status_port_b_r );
22DECLARE_READ8_DEVICE_HANDLER( ym2608_read_port_r );
23DECLARE_READ8_DEVICE_HANDLER( ym2608_status_port_a_r );
24DECLARE_READ8_DEVICE_HANDLER( ym2608_status_port_b_r );
2525
26WRITE8_DEVICE_HANDLER( ym2608_control_port_a_w );
27WRITE8_DEVICE_HANDLER( ym2608_control_port_b_w );
28WRITE8_DEVICE_HANDLER( ym2608_data_port_a_w );
29WRITE8_DEVICE_HANDLER( ym2608_data_port_b_w );
26DECLARE_WRITE8_DEVICE_HANDLER( ym2608_control_port_a_w );
27DECLARE_WRITE8_DEVICE_HANDLER( ym2608_control_port_b_w );
28DECLARE_WRITE8_DEVICE_HANDLER( ym2608_data_port_a_w );
29DECLARE_WRITE8_DEVICE_HANDLER( ym2608_data_port_b_w );
3030
3131class ym2608_device : public device_t,
3232                                  public device_sound_interface
trunk/src/emu/sound/zsg2.h
r17961r17962
77#ifndef __ZSG2_H__
88#define __ZSG2_H__
99
10READ16_DEVICE_HANDLER( zsg2_r );
11WRITE16_DEVICE_HANDLER( zsg2_w );
10DECLARE_READ16_DEVICE_HANDLER( zsg2_r );
11DECLARE_WRITE16_DEVICE_HANDLER( zsg2_w );
1212
1313struct zsg2_interface
1414{
trunk/src/emu/sound/okim6376.h
r17961r17962
77
88/* an interface for the OKIM6376 and similar chips (CPU interface only) */
99
10READ8_DEVICE_HANDLER( okim6376_r );
11WRITE8_DEVICE_HANDLER( okim6376_w );
10DECLARE_READ8_DEVICE_HANDLER( okim6376_r );
11DECLARE_WRITE8_DEVICE_HANDLER( okim6376_w );
1212
1313class okim6376_device : public device_t,
1414                                  public device_sound_interface
trunk/src/emu/sound/es5506.h
r17961r17962
2020   UINT16 (*read_port)(device_t *device);         /* input port read */
2121};
2222
23READ16_DEVICE_HANDLER( es5505_r );
24WRITE16_DEVICE_HANDLER( es5505_w );
23DECLARE_READ16_DEVICE_HANDLER( es5505_r );
24DECLARE_WRITE16_DEVICE_HANDLER( es5505_w );
2525void es5505_voice_bank_w(device_t *device, int voice, int bank);
2626
2727class es5506_device : public device_t,
r17961r17962
6262   UINT16 (*read_port)(device_t *device);         /* input port read */
6363};
6464
65READ8_DEVICE_HANDLER( es5506_r );
66WRITE8_DEVICE_HANDLER( es5506_w );
65DECLARE_READ8_DEVICE_HANDLER( es5506_r );
66DECLARE_WRITE8_DEVICE_HANDLER( es5506_w );
6767void es5506_voice_bank_w(device_t *device, int voice, int bank);
6868
6969class es5505_device : public es5506_device
trunk/src/emu/sound/ymf278b.h
r17961r17962
1313   void (*irq_callback)(device_t *device, int state);   /* irq callback */
1414};
1515
16READ8_DEVICE_HANDLER( ymf278b_r );
17WRITE8_DEVICE_HANDLER( ymf278b_w );
16DECLARE_READ8_DEVICE_HANDLER( ymf278b_r );
17DECLARE_WRITE8_DEVICE_HANDLER( ymf278b_w );
1818
1919class ymf278b_device : public device_t,
2020                                  public device_sound_interface
trunk/src/emu/sound/2151intf.c
r17961r17962
112112}
113113
114114
115READ8_DEVICE_HANDLER( ym2151_status_port_r ) { return ym2151_r(device, 1); }
115READ8_DEVICE_HANDLER( ym2151_status_port_r ) { return ym2151_r(device, space, 1); }
116116
117WRITE8_DEVICE_HANDLER( ym2151_register_port_w ) { ym2151_w(device, 0, data); }
118WRITE8_DEVICE_HANDLER( ym2151_data_port_w ) { ym2151_w(device, 1, data); }
117WRITE8_DEVICE_HANDLER( ym2151_register_port_w ) { ym2151_w(device, space, 0, data); }
118WRITE8_DEVICE_HANDLER( ym2151_data_port_w ) { ym2151_w(device, space, 1, data); }
119119
120120
121121const device_type YM2151 = &device_creator<ym2151_device>;
trunk/src/emu/sound/2413intf.c
r17961r17962
111111   ym2413_write(info->chip, offset & 1, data);
112112}
113113
114WRITE8_DEVICE_HANDLER( ym2413_register_port_w ) { ym2413_w(device, 0, data); }
115WRITE8_DEVICE_HANDLER( ym2413_data_port_w ) { ym2413_w(device, 1, data); }
114WRITE8_DEVICE_HANDLER( ym2413_register_port_w ) { ym2413_w(device, space, 0, data); }
115WRITE8_DEVICE_HANDLER( ym2413_data_port_w ) { ym2413_w(device, space, 1, data); }
116116
117117const device_type YM2413 = &device_creator<ym2413_device>;
118118
trunk/src/emu/sound/2151intf.h
r17961r17962
1111   devcb_write8 portwritehandler;
1212};
1313
14READ8_DEVICE_HANDLER( ym2151_r );
15WRITE8_DEVICE_HANDLER( ym2151_w );
14DECLARE_READ8_DEVICE_HANDLER( ym2151_r );
15DECLARE_WRITE8_DEVICE_HANDLER( ym2151_w );
1616
17READ8_DEVICE_HANDLER( ym2151_status_port_r );
18WRITE8_DEVICE_HANDLER( ym2151_register_port_w );
19WRITE8_DEVICE_HANDLER( ym2151_data_port_w );
17DECLARE_READ8_DEVICE_HANDLER( ym2151_status_port_r );
18DECLARE_WRITE8_DEVICE_HANDLER( ym2151_register_port_w );
19DECLARE_WRITE8_DEVICE_HANDLER( ym2151_data_port_w );
2020
2121class ym2151_device : public device_t,
2222                                  public device_sound_interface
trunk/src/emu/sound/2413intf.h
r17961r17962
55
66#include "devlegcy.h"
77
8WRITE8_DEVICE_HANDLER( ym2413_w );
8DECLARE_WRITE8_DEVICE_HANDLER( ym2413_w );
99
10WRITE8_DEVICE_HANDLER( ym2413_register_port_w );
11WRITE8_DEVICE_HANDLER( ym2413_data_port_w );
10DECLARE_WRITE8_DEVICE_HANDLER( ym2413_register_port_w );
11DECLARE_WRITE8_DEVICE_HANDLER( ym2413_data_port_w );
1212
1313class ym2413_device : public device_t,
1414                                  public device_sound_interface
trunk/src/emu/sound/k053260.h
r17961r17962
1717};
1818
1919
20WRITE8_DEVICE_HANDLER( k053260_w );
21READ8_DEVICE_HANDLER( k053260_r );
20DECLARE_WRITE8_DEVICE_HANDLER( k053260_w );
21DECLARE_READ8_DEVICE_HANDLER( k053260_r );
2222
2323class k053260_device : public device_t,
2424                                  public device_sound_interface
trunk/src/emu/sound/segapcm.h
r17961r17962
2121   int  bank;
2222};
2323
24WRITE8_DEVICE_HANDLER( sega_pcm_w );
25READ8_DEVICE_HANDLER( sega_pcm_r );
24DECLARE_WRITE8_DEVICE_HANDLER( sega_pcm_w );
25DECLARE_READ8_DEVICE_HANDLER( sega_pcm_r );
2626
2727class segapcm_device : public device_t,
2828                                  public device_sound_interface
trunk/src/emu/sound/8950intf.c
r17961r17962
2828   emu_timer *      timer[2];
2929   void *         chip;
3030   const y8950_interface *intf;
31   device_t *device;
31   y8950_device *device;
3232};
3333
3434
r17961r17962
4343static void IRQHandler(void *param,int irq)
4444{
4545   y8950_state *info = (y8950_state *)param;
46   if (info->intf->handler) (info->intf->handler)(info->device, irq ? ASSERT_LINE : CLEAR_LINE);
46   if (!info->device->m_handler.isnull()) info->device->m_handler(irq ? ASSERT_LINE : CLEAR_LINE);
4747}
4848static TIMER_CALLBACK( timer_callback_0 )
4949{
r17961r17962
7272static unsigned char Y8950PortHandler_r(void *param)
7373{
7474   y8950_state *info = (y8950_state *)param;
75   if (info->intf->portread)
76      return info->intf->portread(info->device,0);
75   if (!info->device->m_portread.isnull())
76      return info->device->m_portread(0);
7777   return 0;
7878}
7979
8080static void Y8950PortHandler_w(void *param,unsigned char data)
8181{
8282   y8950_state *info = (y8950_state *)param;
83   if (info->intf->portwrite)
84      info->intf->portwrite(info->device,0,data);
83   if (!info->device->m_portwrite.isnull())
84      info->device->m_portwrite(0,data);
8585}
8686
8787static unsigned char Y8950KeyboardHandler_r(void *param)
8888{
8989   y8950_state *info = (y8950_state *)param;
90   if (info->intf->keyboardread)
91      return info->intf->keyboardread(info->device,0);
90   if (!info->device->m_keyboardread.isnull())
91      return info->device->m_keyboardread(0);
9292   return 0;
9393}
9494
9595static void Y8950KeyboardHandler_w(void *param,unsigned char data)
9696{
9797   y8950_state *info = (y8950_state *)param;
98   if (info->intf->keyboardwrite)
99      info->intf->keyboardwrite(info->device,0,data);
98   if (!info->device->m_keyboardwrite.isnull())
99      info->device->m_keyboardwrite(0,data);
100100}
101101
102102static STREAM_UPDATE( y8950_stream_update )
r17961r17962
114114
115115static DEVICE_START( y8950 )
116116{
117   static const y8950_interface dummy = { 0 };
117   static const y8950_interface dummy = { DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL };
118118   y8950_state *info = get_safe_token(device);
119119   int rate = device->clock()/72;
120120
121121   info->intf = device->static_config() ? (const y8950_interface *)device->static_config() : &dummy;
122   info->device = device;
122   info->device = downcast<y8950_device *>(device);
123123
124124   /* stream system initialize */
125125   info->chip = y8950_init(device,device->clock(),rate);
r17961r17962
167167   y8950_write(info->chip, offset & 1, data);
168168}
169169
170READ8_DEVICE_HANDLER( y8950_status_port_r ) { return y8950_r(device, 0); }
171READ8_DEVICE_HANDLER( y8950_read_port_r ) { return y8950_r(device, 1); }
172WRITE8_DEVICE_HANDLER( y8950_control_port_w ) { y8950_w(device, 0, data); }
173WRITE8_DEVICE_HANDLER( y8950_write_port_w ) { y8950_w(device, 1, data); }
170READ8_DEVICE_HANDLER( y8950_status_port_r ) { return y8950_r(device, space, 0); }
171READ8_DEVICE_HANDLER( y8950_read_port_r ) { return y8950_r(device, space, 1); }
172WRITE8_DEVICE_HANDLER( y8950_control_port_w ) { y8950_w(device, space, 0, data); }
173WRITE8_DEVICE_HANDLER( y8950_write_port_w ) { y8950_w(device, space, 1, data); }
174174
175175
176176const device_type Y8950 = &device_creator<y8950_device>;
r17961r17962
198198
199199void y8950_device::device_start()
200200{
201   const y8950_interface *intf = (const y8950_interface *)static_config();
202   if (intf != NULL)
203   {
204      m_handler.resolve(intf->handler_cb, *this);
205      m_keyboardread.resolve(intf->keyboardread_cb, *this);
206      m_keyboardwrite.resolve(intf->keyboardwrite_cb, *this);
207      m_portread.resolve(intf->portread_cb, *this);
208      m_portwrite.resolve(intf->portwrite_cb, *this);
209   }
210
201211   DEVICE_START_NAME( y8950 )(this);
202212}
203213
trunk/src/emu/sound/vrender0.h
r17961r17962
1313
1414void vr0_snd_set_areas(device_t *device,UINT32 *texture,UINT32 *frame);
1515
16READ32_DEVICE_HANDLER( vr0_snd_read );
17WRITE32_DEVICE_HANDLER( vr0_snd_write );
16DECLARE_READ32_DEVICE_HANDLER( vr0_snd_read );
17DECLARE_WRITE32_DEVICE_HANDLER( vr0_snd_write );
1818
1919class vrender0_device : public device_t,
2020                                  public device_sound_interface
trunk/src/emu/sound/8950intf.h
r17961r17962
77
88struct y8950_interface
99{
10   void (*handler)(device_t *device, int linestate);
11
12   read8_device_func keyboardread;
13   write8_device_func keyboardwrite;
14   read8_device_func portread;
15   write8_device_func portwrite;
10   devcb_write_line handler_cb;
11   devcb_read8 keyboardread_cb;
12   devcb_write8 keyboardwrite_cb;
13   devcb_read8 portread_cb;
14   devcb_write8 portwrite_cb;
1615};
1716
18READ8_DEVICE_HANDLER( y8950_r );
19WRITE8_DEVICE_HANDLER( y8950_w );
17DECLARE_READ8_DEVICE_HANDLER( y8950_r );
18DECLARE_WRITE8_DEVICE_HANDLER( y8950_w );
2019
21READ8_DEVICE_HANDLER( y8950_status_port_r );
22READ8_DEVICE_HANDLER( y8950_read_port_r );
23WRITE8_DEVICE_HANDLER( y8950_control_port_w );
24WRITE8_DEVICE_HANDLER( y8950_write_port_w );
20DECLARE_READ8_DEVICE_HANDLER( y8950_status_port_r );
21DECLARE_READ8_DEVICE_HANDLER( y8950_read_port_r );
22DECLARE_WRITE8_DEVICE_HANDLER( y8950_control_port_w );
23DECLARE_WRITE8_DEVICE_HANDLER( y8950_write_port_w );
2524
2625class y8950_device : public device_t,
2726                                  public device_sound_interface
r17961r17962
4443private:
4544   // internal state
4645   void *m_token;
46public:
47   devcb_resolved_write_line m_handler;
48   devcb_resolved_read8 m_keyboardread;
49   devcb_resolved_write8 m_keyboardwrite;
50   devcb_resolved_read8 m_portread;
51   devcb_resolved_write8 m_portwrite;
4752};
4853
4954extern const device_type Y8950;
trunk/src/emu/sound/namco.c
r17961r17962
638638   chip->sound_enable = enable;
639639}
640640
641static DECLARE_WRITE8_DEVICE_HANDLER( namco_15xx_w );
641642static WRITE8_DEVICE_HANDLER( namco_15xx_w )
642643{
643644   namco_sound *chip = get_safe_token(device);
r17961r17962
704705    0x3c        ch 0    noise sw
705706*/
706707
708static DECLARE_WRITE8_DEVICE_HANDLER( namcos1_sound_w );
707709static WRITE8_DEVICE_HANDLER( namcos1_sound_w )
708710{
709711   namco_sound *chip = get_safe_token(device);
r17961r17962
781783      }
782784   }
783785   else if (offset < 0x140)
784      namcos1_sound_w(device, offset - 0x100,data);
786      namcos1_sound_w(device, space, offset - 0x100,data);
785787   else
786788      chip->wavedata[offset] = data;
787789}
r17961r17962
803805WRITE8_DEVICE_HANDLER( namco_snd_sharedram_w )
804806{
805807   if (offset < 0x40)
806      namco_15xx_w(device, offset, data);
808      namco_15xx_w(device, space, offset, data);
807809   else
808810   {
809811      namco_sound *chip = get_safe_token(device);
trunk/src/emu/sound/t6w28.h
r17961r17962
55
66#include "devlegcy.h"
77
8WRITE8_DEVICE_HANDLER( t6w28_w );
8DECLARE_WRITE8_DEVICE_HANDLER( t6w28_w );
99
1010class t6w28_device : public device_t,
1111                                  public device_sound_interface
trunk/src/emu/sound/multipcm.h
r17961r17962
55
66#include "devlegcy.h"
77
8WRITE8_DEVICE_HANDLER( multipcm_w );
9READ8_DEVICE_HANDLER( multipcm_r );
8DECLARE_WRITE8_DEVICE_HANDLER( multipcm_w );
9DECLARE_READ8_DEVICE_HANDLER( multipcm_r );
1010
1111void multipcm_set_bank(device_t *device, UINT32 leftoffs, UINT32 rightoffs);
1212
trunk/src/emu/sound/namco.h
r17961r17962
1111   int stereo;      /* set to 1 to indicate stereo (e.g., System 1) */
1212};
1313
14WRITE8_DEVICE_HANDLER( pacman_sound_enable_w );
15WRITE8_DEVICE_HANDLER( pacman_sound_w );
14DECLARE_WRITE8_DEVICE_HANDLER( pacman_sound_enable_w );
15DECLARE_WRITE8_DEVICE_HANDLER( pacman_sound_w );
1616
1717void polepos_sound_enable(device_t *device, int enable);
18READ8_DEVICE_HANDLER( polepos_sound_r );
19WRITE8_DEVICE_HANDLER( polepos_sound_w );
18DECLARE_READ8_DEVICE_HANDLER( polepos_sound_r );
19DECLARE_WRITE8_DEVICE_HANDLER( polepos_sound_w );
2020
2121void mappy_sound_enable(device_t *device, int enable);
2222
23WRITE8_DEVICE_HANDLER( namcos1_cus30_w );   /* wavedata + sound registers + RAM */
24READ8_DEVICE_HANDLER( namcos1_cus30_r );
23DECLARE_WRITE8_DEVICE_HANDLER( namcos1_cus30_w );   /* wavedata + sound registers + RAM */
24DECLARE_READ8_DEVICE_HANDLER( namcos1_cus30_r );
2525
26READ8_DEVICE_HANDLER( namco_snd_sharedram_r );
27WRITE8_DEVICE_HANDLER( namco_snd_sharedram_w );
26DECLARE_READ8_DEVICE_HANDLER( namco_snd_sharedram_r );
27DECLARE_WRITE8_DEVICE_HANDLER( namco_snd_sharedram_w );
2828
2929class namco_device : public device_t,
3030                                  public device_sound_interface
trunk/src/emu/sound/2203intf.c
r17961r17962
175175}
176176
177177
178READ8_DEVICE_HANDLER( ym2203_status_port_r ) { return ym2203_r(device, 0); }
179READ8_DEVICE_HANDLER( ym2203_read_port_r ) { return ym2203_r(device, 1); }
180WRITE8_DEVICE_HANDLER( ym2203_control_port_w ) { ym2203_w(device, 0, data); }
181WRITE8_DEVICE_HANDLER( ym2203_write_port_w ) { ym2203_w(device, 1, data); }
178READ8_DEVICE_HANDLER( ym2203_status_port_r ) { return ym2203_r(device, space, 0); }
179READ8_DEVICE_HANDLER( ym2203_read_port_r ) { return ym2203_r(device, space, 1); }
180WRITE8_DEVICE_HANDLER( ym2203_control_port_w ) { ym2203_w(device, space, 0, data); }
181WRITE8_DEVICE_HANDLER( ym2203_write_port_w ) { ym2203_w(device, space, 1, data); }
182182
183183const device_type YM2203 = &device_creator<ym2203_device>;
184184
trunk/src/emu/sound/vlm5030.h
r17961r17962
1616/* get BSY pin level */
1717int vlm5030_bsy(device_t *device);
1818/* latch contoll data */
19WRITE8_DEVICE_HANDLER( vlm5030_data_w );
19DECLARE_WRITE8_DEVICE_HANDLER( vlm5030_data_w );
2020/* set RST pin level : reset / set table address A8-A15 */
2121void vlm5030_rst (device_t *device, int pin );
2222/* set VCU pin level : ?? unknown */
trunk/src/emu/sound/2203intf.h
r17961r17962
1515   devcb_write_line irqhandler;
1616};
1717
18READ8_DEVICE_HANDLER( ym2203_r );
19WRITE8_DEVICE_HANDLER( ym2203_w );
18DECLARE_READ8_DEVICE_HANDLER( ym2203_r );
19DECLARE_WRITE8_DEVICE_HANDLER( ym2203_w );
2020
21READ8_DEVICE_HANDLER( ym2203_status_port_r );
22READ8_DEVICE_HANDLER( ym2203_read_port_r );
23WRITE8_DEVICE_HANDLER( ym2203_control_port_w );
24WRITE8_DEVICE_HANDLER( ym2203_write_port_w );
21DECLARE_READ8_DEVICE_HANDLER( ym2203_status_port_r );
22DECLARE_READ8_DEVICE_HANDLER( ym2203_read_port_r );
23DECLARE_WRITE8_DEVICE_HANDLER( ym2203_control_port_w );
24DECLARE_WRITE8_DEVICE_HANDLER( ym2203_write_port_w );
2525
2626class ym2203_device : public device_t,
2727                                  public device_sound_interface
trunk/src/emu/sound/k007232.h
r17961r17962
1414   void (*portwritehandler)(device_t *, int);
1515};
1616
17WRITE8_DEVICE_HANDLER( k007232_w );
18READ8_DEVICE_HANDLER( k007232_r );
17DECLARE_WRITE8_DEVICE_HANDLER( k007232_w );
18DECLARE_READ8_DEVICE_HANDLER( k007232_r );
1919
2020void k007232_set_bank( device_t *device, int chABank, int chBBank );
2121
trunk/src/emu/sound/tms5220.h
r17961r17962
3030WRITE_LINE_DEVICE_HANDLER( tms5220_rsq_w );
3131WRITE_LINE_DEVICE_HANDLER( tms5220_wsq_w );
3232
33WRITE8_DEVICE_HANDLER( tms5220_data_w );
34READ8_DEVICE_HANDLER( tms5220_status_r );
33DECLARE_WRITE8_DEVICE_HANDLER( tms5220_data_w );
34DECLARE_READ8_DEVICE_HANDLER( tms5220_status_r );
3535
3636READ_LINE_DEVICE_HANDLER( tms5220_readyq_r );
3737READ_LINE_DEVICE_HANDLER( tms5220_intq_r );
trunk/src/emu/sound/okim6258.h
r17961r17962
2929void okim6258_set_clock(device_t *device, int val);
3030int okim6258_get_vclk(device_t *device);
3131
32READ8_DEVICE_HANDLER( okim6258_status_r );
33WRITE8_DEVICE_HANDLER( okim6258_data_w );
34WRITE8_DEVICE_HANDLER( okim6258_ctrl_w );
32DECLARE_READ8_DEVICE_HANDLER( okim6258_status_r );
33DECLARE_WRITE8_DEVICE_HANDLER( okim6258_data_w );
34DECLARE_WRITE8_DEVICE_HANDLER( okim6258_ctrl_w );
3535
3636class okim6258_device : public device_t,
3737                                  public device_sound_interface
trunk/src/emu/sound/262intf.c
r17961r17962
124124   ymf262_write(info->chip, offset & 3, data);
125125}
126126
127READ8_DEVICE_HANDLER ( ymf262_status_r ) { return ymf262_r(device, 0); }
128WRITE8_DEVICE_HANDLER( ymf262_register_a_w ) { ymf262_w(device, 0, data); }
129WRITE8_DEVICE_HANDLER( ymf262_register_b_w ) { ymf262_w(device, 2, data); }
130WRITE8_DEVICE_HANDLER( ymf262_data_a_w ) { ymf262_w(device, 1, data); }
131WRITE8_DEVICE_HANDLER( ymf262_data_b_w ) { ymf262_w(device, 3, data); }
127READ8_DEVICE_HANDLER ( ymf262_status_r ) { return ymf262_r(device, space, 0); }
128WRITE8_DEVICE_HANDLER( ymf262_register_a_w ) { ymf262_w(device, space, 0, data); }
129WRITE8_DEVICE_HANDLER( ymf262_register_b_w ) { ymf262_w(device, space, 2, data); }
130WRITE8_DEVICE_HANDLER( ymf262_data_a_w ) { ymf262_w(device, space, 1, data); }
131WRITE8_DEVICE_HANDLER( ymf262_data_b_w ) { ymf262_w(device, space, 3, data); }
132132
133133const device_type YMF262 = &device_creator<ymf262_device>;
134134
trunk/src/emu/sound/nile.h
r17961r17962
55
66#include "devlegcy.h"
77
8WRITE16_DEVICE_HANDLER( nile_snd_w );
9READ16_DEVICE_HANDLER( nile_snd_r );
10WRITE16_DEVICE_HANDLER( nile_sndctrl_w );
11READ16_DEVICE_HANDLER( nile_sndctrl_r );
8DECLARE_WRITE16_DEVICE_HANDLER( nile_snd_w );
9DECLARE_READ16_DEVICE_HANDLER( nile_snd_r );
10DECLARE_WRITE16_DEVICE_HANDLER( nile_sndctrl_w );
11DECLARE_READ16_DEVICE_HANDLER( nile_sndctrl_r );
1212
1313class nile_device : public device_t,
1414                                  public device_sound_interface
trunk/src/emu/devconv.h
r17961r17962
8585 *
8686 *************************************/
8787
88INLINE UINT16 read16be_with_read8_device_handler(read8_device_func handler, device_t *device, offs_t offset, UINT16 mem_mask)
88INLINE UINT16 read16be_with_read8_device_handler(read8_device_func handler, device_t *device, address_space &space, offs_t offset, UINT16 mem_mask)
8989{
9090   UINT16 result = 0;
9191   if (ACCESSING_BITS_8_15)
92      result |= ((UINT16)(*handler)(device, offset * 2 + 0)) << 8;
92      result |= ((UINT16)(*handler)(device, space, offset * 2 + 0, mem_mask >> 8)) << 8;
9393   if (ACCESSING_BITS_0_7)
94      result |= ((UINT16)(*handler)(device, offset * 2 + 1)) << 0;
94      result |= ((UINT16)(*handler)(device, space, offset * 2 + 1, mem_mask >> 0)) << 0;
9595   return result;
9696}
9797
9898
99INLINE void write16be_with_write8_device_handler(write8_device_func handler, device_t *device, offs_t offset, UINT16 data, UINT16 mem_mask)
99INLINE void write16be_with_write8_device_handler(write8_device_func handler, device_t *device, address_space &space, offs_t offset, UINT16 data, UINT16 mem_mask)
100100{
101101   if (ACCESSING_BITS_8_15)
102      (*handler)(device, offset * 2 + 0, data >> 8);
102      (*handler)(device, space, offset * 2 + 0, data >> 8, mem_mask >> 8);
103103   if (ACCESSING_BITS_0_7)
104      (*handler)(device, offset * 2 + 1, data >> 0);
104      (*handler)(device, space, offset * 2 + 1, data >> 0, mem_mask >> 0);
105105}
106106
107107
r17961r17962
111111 *
112112 *************************************/
113113
114INLINE UINT16 read16le_with_read8_device_handler(read8_device_func handler, device_t *device, offs_t offset, UINT16 mem_mask)
114INLINE UINT16 read16le_with_read8_device_handler(read8_device_func handler, device_t *device, address_space &space, offs_t offset, UINT16 mem_mask)
115115{
116116   UINT16 result = 0;
117117   if (ACCESSING_BITS_0_7)
118      result |= ((UINT16) (*handler)(device, offset * 2 + 0)) << 0;
118      result |= ((UINT16) (*handler)(device, space, offset * 2 + 0, mem_mask >> 0)) << 0;
119119   if (ACCESSING_BITS_8_15)
120      result |= ((UINT16) (*handler)(device, offset * 2 + 1)) << 8;
120      result |= ((UINT16) (*handler)(device, space, offset * 2 + 1, mem_mask >> 8)) << 8;
121121   return result;
122122}
123123
124124
125INLINE void write16le_with_write8_device_handler(write8_device_func handler, device_t *device, offs_t offset, UINT16 data, UINT16 mem_mask)
125INLINE void write16le_with_write8_device_handler(write8_device_func handler, device_t *device, address_space &space, offs_t offset, UINT16 data, UINT16 mem_mask)
126126{
127127   if (ACCESSING_BITS_0_7)
128      (*handler)(device, offset * 2 + 0, data >> 0);
128      (*handler)(device, space, offset * 2 + 0, data >> 0, mem_mask >> 0);
129129   if (ACCESSING_BITS_8_15)
130      (*handler)(device, offset * 2 + 1, data >> 8);
130      (*handler)(device, space, offset * 2 + 1, data >> 8, mem_mask >> 8);
131131}
132132
133133
r17961r17962
137137 *
138138 *************************************/
139139
140INLINE UINT32 read32be_with_read8_device_handler(read8_device_func handler, device_t *device, offs_t offset, UINT32 mem_mask)
140INLINE UINT32 read32be_with_read8_device_handler(read8_device_func handler, device_t *device, address_space &space, offs_t offset, UINT32 mem_mask)
141141{
142142   UINT32 result = 0;
143143   if (ACCESSING_BITS_16_31)
144      result |= read16be_with_read8_device_handler(handler, device, offset * 2 + 0, mem_mask >> 16) << 16;
144      result |= read16be_with_read8_device_handler(handler, device, space, offset * 2 + 0, mem_mask >> 16) << 16;
145145   if (ACCESSING_BITS_0_15)
146      result |= read16be_with_read8_device_handler(handler, device, offset * 2 + 1, mem_mask) << 0;
146      result |= read16be_with_read8_device_handler(handler, device, space, offset * 2 + 1, mem_mask) << 0;
147147   return result;
148148}
149149
150150
151INLINE void write32be_with_write8_device_handler(write8_device_func handler, device_t *device, offs_t offset, UINT32 data, UINT32 mem_mask)
151INLINE void write32be_with_write8_device_handler(write8_device_func handler, device_t *device, address_space &space, offs_t offset, UINT32 data, UINT32 mem_mask)
152152{
153153   if (ACCESSING_BITS_16_31)
154      write16be_with_write8_device_handler(handler, device, offset * 2 + 0, data >> 16, mem_mask >> 16);
154      write16be_with_write8_device_handler(handler, device, space, offset * 2 + 0, data >> 16, mem_mask >> 16);
155155   if (ACCESSING_BITS_0_15)
156      write16be_with_write8_device_handler(handler, device, offset * 2 + 1, data, mem_mask);
156      write16be_with_write8_device_handler(handler, device, space, offset * 2 + 1, data, mem_mask);
157157}
158158
159159
r17961r17962
163163 *
164164 *************************************/
165165
166INLINE UINT32 read32le_with_read8_device_handler(read8_device_func handler, device_t *device, offs_t offset, UINT32 mem_mask)
166INLINE UINT32 read32le_with_read8_device_handler(read8_device_func handler, device_t *device, address_space &space, offs_t offset, UINT32 mem_mask)
167167{
168168   UINT32 result = 0;
169169   if (ACCESSING_BITS_0_15)
170      result |= read16le_with_read8_device_handler(handler, device, offset * 2 + 0, mem_mask) << 0;
170      result |= read16le_with_read8_device_handler(handler, device, space, offset * 2 + 0, mem_mask) << 0;
171171   if (ACCESSING_BITS_16_31)
172      result |= read16le_with_read8_device_handler(handler, device, offset * 2 + 1, mem_mask >> 16) << 16;
172      result |= read16le_with_read8_device_handler(handler, device, space, offset * 2 + 1, mem_mask >> 16) << 16;
173173   return result;
174174}
175175
176176
177INLINE void write32le_with_write8_device_handler(write8_device_func handler, device_t *device, offs_t offset, UINT32 data, UINT32 mem_mask)
177INLINE void write32le_with_write8_device_handler(write8_device_func handler, device_t *device, address_space &space, offs_t offset, UINT32 data, UINT32 mem_mask)
178178{
179179   if (ACCESSING_BITS_0_15)
180      write16le_with_write8_device_handler(handler, device, offset * 2 + 0, data, mem_mask);
180      write16le_with_write8_device_handler(handler, device, space, offset * 2 + 0, data, mem_mask);
181181   if (ACCESSING_BITS_16_31)
182      write16le_with_write8_device_handler(handler, device, offset * 2 + 1, data >> 16, mem_mask >> 16);
182      write16le_with_write8_device_handler(handler, device, space, offset * 2 + 1, data >> 16, mem_mask >> 16);
183183}
184184
185185
r17961r17962
189189 *
190190 *************************************/
191191
192INLINE UINT32 read32be_with_16be_device_handler(read16_device_func handler, device_t *device, offs_t offset, UINT32 mem_mask)
192INLINE UINT32 read32be_with_16be_device_handler(read16_device_func handler, device_t *device, address_space &space, offs_t offset, UINT32 mem_mask)
193193{
194194   UINT32 result = 0;
195195   if (ACCESSING_BITS_16_31)
196      result |= (*handler)(device, offset * 2 + 0, mem_mask >> 16) << 16;
196      result |= (*handler)(device, space, offset * 2 + 0, mem_mask >> 16) << 16;
197197   if (ACCESSING_BITS_0_15)
198      result |= (*handler)(device, offset * 2 + 1, mem_mask) << 0;
198      result |= (*handler)(device, space, offset * 2 + 1, mem_mask) << 0;
199199   return result;
200200}
201201
202202
203INLINE void write32be_with_16be_device_handler(write16_device_func handler, device_t *device, offs_t offset, UINT32 data, UINT32 mem_mask)
203INLINE void write32be_with_16be_device_handler(write16_device_func handler, device_t *device, address_space &space, offs_t offset, UINT32 data, UINT32 mem_mask)
204204{
205205   if (ACCESSING_BITS_16_31)
206      (*handler)(device, offset * 2 + 0, data >> 16, mem_mask >> 16);
206      (*handler)(device, space, offset * 2 + 0, data >> 16, mem_mask >> 16);
207207   if (ACCESSING_BITS_0_15)
208      (*handler)(device, offset * 2 + 1, data, mem_mask);
208      (*handler)(device, space, offset * 2 + 1, data, mem_mask);
209209}
210210
211211
r17961r17962
215215 *
216216 *************************************/
217217
218INLINE UINT32 read32le_with_16le_device_handler(read16_device_func handler, device_t *device, offs_t offset, UINT32 mem_mask)
218INLINE UINT32 read32le_with_16le_device_handler(read16_device_func handler, device_t *device, address_space &space, offs_t offset, UINT32 mem_mask)
219219{
220220   UINT32 result = 0;
221221   if (ACCESSING_BITS_0_15)
222      result |= (*handler)(device, offset * 2 + 0, mem_mask) << 0;
222      result |= (*handler)(device, space, offset * 2 + 0, mem_mask) << 0;
223223   if (ACCESSING_BITS_16_31)
224      result |= (*handler)(device, offset * 2 + 1, mem_mask >> 16) << 16;
224      result |= (*handler)(device, space, offset * 2 + 1, mem_mask >> 16) << 16;
225225   return result;
226226}
227227
228228
229INLINE void write32le_with_16le_device_handler(write16_device_func handler, device_t *device, offs_t offset, UINT32 data, UINT32 mem_mask)
229INLINE void write32le_with_16le_device_handler(write16_device_func handler, device_t *device, address_space &space, offs_t offset, UINT32 data, UINT32 mem_mask)
230230{
231231   if (ACCESSING_BITS_0_15)
232      (*handler)(device, offset * 2 + 0, data, mem_mask);
232      (*handler)(device, space, offset * 2 + 0, data, mem_mask);
233233   if (ACCESSING_BITS_16_31)
234      (*handler)(device, offset * 2 + 1, data >> 16, mem_mask >> 16);
234      (*handler)(device, space, offset * 2 + 1, data >> 16, mem_mask >> 16);
235235}
236236
237237
r17961r17962
241241 *
242242 *************************************/
243243
244INLINE UINT32 read32be_with_16le_device_handler(read16_device_func handler, device_t *device, offs_t offset, UINT32 mem_mask)
244INLINE UINT32 read32be_with_16le_device_handler(read16_device_func handler, device_t *device, address_space &space, offs_t offset, UINT32 mem_mask)
245245{
246246   UINT32 result = 0;
247247   mem_mask = FLIPENDIAN_INT32(mem_mask);
248   result = read32le_with_16le_device_handler(handler, device, offset, mem_mask);
248   result = read32le_with_16le_device_handler(handler, device, space, offset, mem_mask);
249249   return FLIPENDIAN_INT32(result);
250250}
251251
252252
253INLINE void write32be_with_16le_device_handler(write16_device_func handler, device_t *device, offs_t offset, UINT32 data, UINT32 mem_mask)
253INLINE void write32be_with_16le_device_handler(write16_device_func handler, device_t *device, address_space &space, offs_t offset, UINT32 data, UINT32 mem_mask)
254254{
255255   data = FLIPENDIAN_INT32(data);
256256   mem_mask = FLIPENDIAN_INT32(mem_mask);
257   write32le_with_16le_device_handler(handler, device, offset, data, mem_mask);
257   write32le_with_16le_device_handler(handler, device, space, offset, data, mem_mask);
258258}
259259
260260
r17961r17962
264264 *
265265 *************************************/
266266
267INLINE UINT32 read32le_with_16be_device_handler(read16_device_func handler, device_t *device, offs_t offset, UINT32 mem_mask)
267INLINE UINT32 read32le_with_16be_device_handler(read16_device_func handler, device_t *device, address_space &space, offs_t offset, UINT32 mem_mask)
268268{
269269   UINT32 result = 0;
270270   mem_mask = FLIPENDIAN_INT32(mem_mask);
271   result = read32be_with_16be_device_handler(handler, device, offset, mem_mask);
271   result = read32be_with_16be_device_handler(handler, device, space, offset, mem_mask);
272272   return FLIPENDIAN_INT32(result);
273273}
274274
275275
276INLINE void write32le_with_16be_device_handler(write16_device_func handler, device_t *device, offs_t offset, UINT32 data, UINT32 mem_mask)
276INLINE void write32le_with_16be_device_handler(write16_device_func handler, device_t *device, address_space &space, offs_t offset, UINT32 data, UINT32 mem_mask)
277277{
278278   data = FLIPENDIAN_INT32(data);
279279   mem_mask = FLIPENDIAN_INT32(mem_mask);
280   write32be_with_16be_device_handler(handler, device, offset, data, mem_mask);
280   write32be_with_16be_device_handler(handler, device, space, offset, data, mem_mask);
281281}
282282
283283
r17961r17962
287287 *
288288 *************************************/
289289
290INLINE UINT64 read64be_with_read8_device_handler(read8_device_func handler, device_t *device, offs_t offset, UINT64 mem_mask)
290INLINE UINT64 read64be_with_read8_device_handler(read8_device_func handler, device_t *device, address_space &space, offs_t offset, UINT64 mem_mask)
291291{
292292   UINT64 result = 0;
293293   if (ACCESSING_BITS_32_63)
294      result |= (UINT64)read32be_with_read8_device_handler(handler, device, offset * 2 + 0, mem_mask >> 32) << 32;
294      result |= (UINT64)read32be_with_read8_device_handler(handler, device, space, offset * 2 + 0, mem_mask >> 32) << 32;
295295   if (ACCESSING_BITS_0_31)
296      result |= (UINT64)read32be_with_read8_device_handler(handler, device, offset * 2 + 1, mem_mask) << 0;
296      result |= (UINT64)read32be_with_read8_device_handler(handler, device, space, offset * 2 + 1, mem_mask) << 0;
297297   return result;
298298}
299299
300300
301INLINE void write64be_with_write8_device_handler(write8_device_func handler, device_t *device, offs_t offset, UINT64 data, UINT64 mem_mask)
301INLINE void write64be_with_write8_device_handler(write8_device_func handler, device_t *device, address_space &space, offs_t offset, UINT64 data, UINT64 mem_mask)
302302{
303303   if (ACCESSING_BITS_32_63)
304      write32be_with_write8_device_handler(handler, device, offset * 2 + 0, data >> 32, mem_mask >> 32);
304      write32be_with_write8_device_handler(handler, device, space, offset * 2 + 0, data >> 32, mem_mask >> 32);
305305   if (ACCESSING_BITS_0_31)
306      write32be_with_write8_device_handler(handler, device, offset * 2 + 1, data, mem_mask);
306      write32be_with_write8_device_handler(handler, device, space, offset * 2 + 1, data, mem_mask);
307307}
308308
309309
r17961r17962
313313 *
314314 *************************************/
315315
316INLINE UINT64 read64le_with_read8_device_handler(read8_device_func handler, device_t *device, offs_t offset, UINT64 mem_mask)
316INLINE UINT64 read64le_with_read8_device_handler(read8_device_func handler, device_t *device, address_space &space, offs_t offset, UINT64 mem_mask)
317317{
318318   UINT64 result = 0;
319319   if (ACCESSING_BITS_0_31)
320      result |= (UINT64)read32le_with_read8_device_handler(handler, device, offset * 2 + 0, mem_mask >> 0) << 0;
320      result |= (UINT64)read32le_with_read8_device_handler(handler, device, space, offset * 2 + 0, mem_mask >> 0) << 0;
321321   if (ACCESSING_BITS_32_63)
322      result |= (UINT64)read32le_with_read8_device_handler(handler, device, offset * 2 + 1, mem_mask >> 32) << 32;
322      result |= (UINT64)read32le_with_read8_device_handler(handler, device, space, offset * 2 + 1, mem_mask >> 32) << 32;
323323   return result;
324324}
325325
326326
327INLINE void write64le_with_write8_device_handler(write8_device_func handler, device_t *device, offs_t offset, UINT64 data, UINT64 mem_mask)
327INLINE void write64le_with_write8_device_handler(write8_device_func handler, device_t *device, address_space &space, offs_t offset, UINT64 data, UINT64 mem_mask)
328328{
329329   if (ACCESSING_BITS_0_31)
330      write32le_with_write8_device_handler(handler, device, offset * 2 + 0, data >> 0, mem_mask >> 0);
330      write32le_with_write8_device_handler(handler, device, space, offset * 2 + 0, data >> 0, mem_mask >> 0);
331331   if (ACCESSING_BITS_32_63)
332      write32le_with_write8_device_handler(handler, device, offset * 2 + 1, data >> 32, mem_mask >> 32);
332      write32le_with_write8_device_handler(handler, device, space, offset * 2 + 1, data >> 32, mem_mask >> 32);
333333}
334334
335335
r17961r17962
339339 *
340340 *************************************/
341341
342INLINE UINT32 read64be_with_16be_device_handler(read16_device_func handler, device_t *device, offs_t offset, UINT64 mem_mask)
342INLINE UINT32 read64be_with_16be_device_handler(read16_device_func handler, device_t *device, address_space &space, offs_t offset, UINT64 mem_mask)
343343{
344344   UINT64 result = 0;
345345   if (ACCESSING_BITS_32_63)
346      result |= (UINT64)read32be_with_16be_device_handler(handler, device, offset * 2 + 0, mem_mask >> 32) << 32;
346      result |= (UINT64)read32be_with_16be_device_handler(handler, device, space, offset * 2 + 0, mem_mask >> 32) << 32;
347347   if (ACCESSING_BITS_0_31)
348      result |= (UINT64)read32be_with_16be_device_handler(handler, device, offset * 2 + 1, mem_mask >> 0) << 0;
348      result |= (UINT64)read32be_with_16be_device_handler(handler, device, space, offset * 2 + 1, mem_mask >> 0) << 0;
349349   return result;
350350}
351351
352352
353INLINE void write64be_with_16be_device_handler(write16_device_func handler, device_t *device, offs_t offset, UINT64 data, UINT64 mem_mask)
353INLINE void write64be_with_16be_device_handler(write16_device_func handler, device_t *device, address_space &space, offs_t offset, UINT64 data, UINT64 mem_mask)
354354{
355355   if (ACCESSING_BITS_32_63)
356      write32be_with_16be_device_handler(handler, device, offset * 2 + 0, data >> 32, mem_mask >> 32);
356      write32be_with_16be_device_handler(handler, device, space, offset * 2 + 0, data >> 32, mem_mask >> 32);
357357   if (ACCESSING_BITS_0_31)
358      write32be_with_16be_device_handler(handler, device, offset * 2 + 1, data >> 0, mem_mask >> 0);
358      write32be_with_16be_device_handler(handler, device, space, offset * 2 + 1, data >> 0, mem_mask >> 0);
359359}
360360
361361
r17961r17962
365365 *
366366 *************************************/
367367
368INLINE UINT32 read64le_with_16le_device_handler(read16_device_func handler, device_t *device, offs_t offset, UINT64 mem_mask)
368INLINE UINT32 read64le_with_16le_device_handler(read16_device_func handler, device_t *device, address_space &space, offs_t offset, UINT64 mem_mask)
369369{
370370   UINT64 result = 0;
371371   if (ACCESSING_BITS_0_31)
372      result |= (UINT64)read32le_with_16le_device_handler(handler, device, offset * 2 + 0, mem_mask >> 0) << 0;
372      result |= (UINT64)read32le_with_16le_device_handler(handler, device, space, offset * 2 + 0, mem_mask >> 0) << 0;
373373   if (ACCESSING_BITS_32_63)
374      result |= (UINT64)read32le_with_16le_device_handler(handler, device, offset * 2 + 1, mem_mask >> 32) << 32;
374      result |= (UINT64)read32le_with_16le_device_handler(handler, device, space, offset * 2 + 1, mem_mask >> 32) << 32;
375375   return result;
376376}
377377
378378
379INLINE void write64le_with_16le_device_handler(write16_device_func handler, device_t *device, offs_t offset, UINT64 data, UINT64 mem_mask)
379INLINE void write64le_with_16le_device_handler(write16_device_func handler, device_t *device, address_space &space, offs_t offset, UINT64 data, UINT64 mem_mask)
380380{
381381   if (ACCESSING_BITS_0_31)
382      write32le_with_16le_device_handler(handler, device, offset * 2 + 0, data >> 0, mem_mask >> 0);
382      write32le_with_16le_device_handler(handler, device, space, offset * 2 + 0, data >> 0, mem_mask >> 0);
383383   if (ACCESSING_BITS_32_63)
384      write32le_with_16le_device_handler(handler, device, offset * 2 + 1, data >> 32, mem_mask >> 32);
384      write32le_with_16le_device_handler(handler, device, space, offset * 2 + 1, data >> 32, mem_mask >> 32);
385385}
386386
387387
r17961r17962
391391 *
392392 *************************************/
393393
394INLINE UINT32 read64be_with_16le_device_handler(read16_device_func handler, device_t *device, offs_t offset, UINT64 mem_mask)
394INLINE UINT32 read64be_with_16le_device_handler(read16_device_func handler, device_t *device, address_space &space, offs_t offset, UINT64 mem_mask)
395395{
396396   UINT64 result = 0;
397397   if (ACCESSING_BITS_32_63)
398      result |= (UINT64)read32be_with_16le_device_handler(handler, device, offset * 2 + 0, mem_mask >> 32) << 32;
398      result |= (UINT64)read32be_with_16le_device_handler(handler, device, space, offset * 2 + 0, mem_mask >> 32) << 32;
399399   if (ACCESSING_BITS_0_31)
400      result |= (UINT64)read32be_with_16le_device_handler(handler, device, offset * 2 + 1, mem_mask >> 0) << 0;
400      result |= (UINT64)read32be_with_16le_device_handler(handler, device, space, offset * 2 + 1, mem_mask >> 0) << 0;
401401   return result;
402402}
403403
404404
405INLINE void write64be_with_16le_device_handler(write16_device_func handler, device_t *device, offs_t offset, UINT64 data, UINT64 mem_mask)
405INLINE void write64be_with_16le_device_handler(write16_device_func handler, device_t *device, address_space &space, offs_t offset, UINT64 data, UINT64 mem_mask)
406406{
407407   if (ACCESSING_BITS_32_63)
408      write32be_with_16le_device_handler(handler, device, offset * 2 + 0, data >> 32, mem_mask >> 32);
408      write32be_with_16le_device_handler(handler, device, space, offset * 2 + 0, data >> 32, mem_mask >> 32);
409409   if (ACCESSING_BITS_0_31)
410      write32be_with_16le_device_handler(handler, device, offset * 2 + 1, data >> 0, mem_mask >> 0);
410      write32be_with_16le_device_handler(handler, device, space, offset * 2 + 1, data >> 0, mem_mask >> 0);
411411}
412412
413413
r17961r17962
417417 *
418418 *************************************/
419419
420INLINE UINT32 read64le_with_16be_device_handler(read16_device_func handler, device_t *device, offs_t offset, UINT64 mem_mask)
420INLINE UINT32 read64le_with_16be_device_handler(read16_device_func handler, device_t *device, address_space &space, offs_t offset, UINT64 mem_mask)
421421{
422422   UINT64 result = 0;
423423   if (ACCESSING_BITS_0_31)
424      result |= (UINT64)read32le_with_16be_device_handler(handler, device, offset * 2 + 0, mem_mask >> 0) << 0;
424      result |= (UINT64)read32le_with_16be_device_handler(handler, device, space, offset * 2 + 0, mem_mask >> 0) << 0;
425425   if (ACCESSING_BITS_32_63)
426      result |= (UINT64)read32le_with_16be_device_handler(handler, device, offset * 2 + 1, mem_mask >> 32) << 32;
426      result |= (UINT64)read32le_with_16be_device_handler(handler, device, space, offset * 2 + 1, mem_mask >> 32) << 32;
427427   return result;
428428}
429429
430430
431INLINE void write64le_with_16be_device_handler(write16_device_func handler, device_t *device, offs_t offset, UINT64 data, UINT64 mem_mask)
431INLINE void write64le_with_16be_device_handler(write16_device_func handler, device_t *device, address_space &space, offs_t offset, UINT64 data, UINT64 mem_mask)
432432{
433433   if (ACCESSING_BITS_0_31)
434      write32le_with_16be_device_handler(handler, device, offset * 2 + 0, data >> 0, mem_mask >> 0);
434      write32le_with_16be_device_handler(handler, device, space, offset * 2 + 0, data >> 0, mem_mask >> 0);
435435   if (ACCESSING_BITS_32_63)
436      write32le_with_16be_device_handler(handler, device, offset * 2 + 1, data >> 32, mem_mask >> 32);
436      write32le_with_16be_device_handler(handler, device, space, offset * 2 + 1, data >> 32, mem_mask >> 32);
437437}
438438
439439
r17961r17962
443443 *
444444 *************************************/
445445
446INLINE UINT64 read64be_with_32be_device_handler(read32_device_func handler, device_t *device, offs_t offset, UINT64 mem_mask)
446INLINE UINT64 read64be_with_32be_device_handler(read32_device_func handler, device_t *device, address_space &space, offs_t offset, UINT64 mem_mask)
447447{
448448   UINT64 result = 0;
449449   if (ACCESSING_BITS_32_63)
450      result |= (UINT64)(*handler)(device, offset * 2 + 0, mem_mask >> 32) << 32;
450      result |= (UINT64)(*handler)(device, space, offset * 2 + 0, mem_mask >> 32) << 32;
451451   if (ACCESSING_BITS_0_31)
452      result |= (UINT64)(*handler)(device, offset * 2 + 1, mem_mask >> 0) << 0;
452      result |= (UINT64)(*handler)(device, space, offset * 2 + 1, mem_mask >> 0) << 0;
453453   return result;
454454}
455455
456456
457INLINE void write64be_with_32be_device_handler(write32_device_func handler, device_t *device, offs_t offset, UINT64 data, UINT64 mem_mask)
457INLINE void write64be_with_32be_device_handler(write32_device_func handler, device_t *device, address_space &space, offs_t offset, UINT64 data, UINT64 mem_mask)
458458{
459459   if (ACCESSING_BITS_32_63)
460      (*handler)(device, offset * 2 + 0, data >> 32, mem_mask >> 32);
460      (*handler)(device, space, offset * 2 + 0, data >> 32, mem_mask >> 32);
461461   if (ACCESSING_BITS_0_31)
462      (*handler)(device, offset * 2 + 1, data >>  0, mem_mask >>  0);
462      (*handler)(device, space, offset * 2 + 1, data >>  0, mem_mask >>  0);
463463}
464464
465465
r17961r17962
469469 *
470470 *************************************/
471471
472INLINE UINT64 read64le_with_32le_device_handler(read32_device_func handler, device_t *device, offs_t offset, UINT64 mem_mask)
472INLINE UINT64 read64le_with_32le_device_handler(read32_device_func handler, device_t *device, address_space &space, offs_t offset, UINT64 mem_mask)
473473{
474474   UINT64 result = 0;
475475   if (ACCESSING_BITS_0_31)
476      result |= (UINT64)(*handler)(device, offset * 2 + 0, mem_mask >> 0) << 0;
476      result |= (UINT64)(*handler)(device, space, offset * 2 + 0, mem_mask >> 0) << 0;
477477   if (ACCESSING_BITS_32_63)
478      result |= (UINT64)(*handler)(device, offset * 2 + 1, mem_mask >> 32) << 32;
478      result |= (UINT64)(*handler)(device, space, offset * 2 + 1, mem_mask >> 32) << 32;
479479   return result;
480480}
481481
482482
483INLINE void write64le_with_32le_device_handler(write32_device_func handler, device_t *device, offs_t offset, UINT64 data, UINT64 mem_mask)
483INLINE void write64le_with_32le_device_handler(write32_device_func handler, device_t *device, address_space &space, offs_t offset, UINT64 data, UINT64 mem_mask)
484484{
485485   if (ACCESSING_BITS_0_31)
486      (*handler)(device, offset * 2 + 0, data >> 0, mem_mask >> 0);
486      (*handler)(device, space, offset * 2 + 0, data >> 0, mem_mask >> 0);
487487   if (ACCESSING_BITS_32_63)
488      (*handler)(device, offset * 2 + 1, data >> 32, mem_mask >> 32);
488      (*handler)(device, space, offset * 2 + 1, data >> 32, mem_mask >> 32);
489489}
490490
491491
r17961r17962
495495 *
496496 *************************************/
497497
498INLINE UINT64 read64be_with_32le_device_handler(read32_device_func handler, device_t *device, offs_t offset, UINT64 mem_mask)
498INLINE UINT64 read64be_with_32le_device_handler(read32_device_func handler, device_t *device, address_space &space, offs_t offset, UINT64 mem_mask)
499499{
500500   UINT64 result;
501501   mem_mask = FLIPENDIAN_INT64(mem_mask);
502   result = read64le_with_32le_device_handler(handler, device, offset, mem_mask);
502   result = read64le_with_32le_device_handler(handler, device, space, offset, mem_mask);
503503   return FLIPENDIAN_INT64(result);
504504}
505505
506506
507INLINE void write64be_with_32le_device_handler(write32_device_func handler, device_t *device, offs_t offset, UINT64 data, UINT64 mem_mask)
507INLINE void write64be_with_32le_device_handler(write32_device_func handler, device_t *device, address_space &space, offs_t offset, UINT64 data, UINT64 mem_mask)
508508{
509509   data = FLIPENDIAN_INT64(data);
510510   mem_mask = FLIPENDIAN_INT64(mem_mask);
511   write64le_with_32le_device_handler(handler, device, offset, data, mem_mask);
511   write64le_with_32le_device_handler(handler, device, space, offset, data, mem_mask);
512512}
513513
514514
r17961r17962
518518 *
519519 *************************************/
520520
521INLINE UINT64 read64le_with_32be_device_handler(read32_device_func handler, device_t *device, offs_t offset, UINT64 mem_mask)
521INLINE UINT64 read64le_with_32be_device_handler(read32_device_func handler, device_t *device, address_space &space, offs_t offset, UINT64 mem_mask)
522522{
523523   UINT64 result;
524524   mem_mask = FLIPENDIAN_INT64(mem_mask);
525   result = read64be_with_32be_device_handler(handler, device, offset, mem_mask);
525   result = read64be_with_32be_device_handler(handler, device, space, offset, mem_mask);
526526   return FLIPENDIAN_INT64(result);
527527}
528528
529529
530INLINE void write64le_with_32be_device_handler(write32_device_func handler, device_t *device, offs_t offset, UINT64 data, UINT64 mem_mask)
530INLINE void write64le_with_32be_device_handler(write32_device_func handler, device_t *device, address_space &space, offs_t offset, UINT64 data, UINT64 mem_mask)
531531{
532532   data = FLIPENDIAN_INT64(data);
533533   mem_mask = FLIPENDIAN_INT64(mem_mask);
534   write64be_with_32be_device_handler(handler, device, offset, data, mem_mask);
534   write64be_with_32be_device_handler(handler, device, space, offset, data, mem_mask);
535535}
536536
537537
r17961r17962
545545#define DEV_READ_TEMPLATE(bits, name, handler, func)            \
546546READ##bits##_DEVICE_HANDLER( name##_r )                        \
547547{                                                   \
548   return func(handler, device, offset, mem_mask);               \
548   return func(handler, device, space, offset, mem_mask);         \
549549}
550550
551551#define DEV_READ_TEMPLATE_COND(bits, name, handler, func, cond)      \
552552READ##bits##_DEVICE_HANDLER( name##_r )                        \
553553{                                                   \
554554   if (cond)                                          \
555      return func(handler, device, offset, mem_mask);            \
555      return func(handler, device, space, offset, mem_mask);      \
556556   return 0;                                          \
557557}
558558
559559#define DEV_WRITE_TEMPLATE(bits, name, handler, func)            \
560560WRITE##bits##_DEVICE_HANDLER( name##_w )                     \
561561{                                                   \
562   func(handler, device, offset, data, mem_mask);               \
562   func(handler, device, space, offset, data, mem_mask);         \
563563}
564564
565565#define DEV_WRITE_TEMPLATE_COND(bits, name, handler, func, cond)   \
566566WRITE##bits##_DEVICE_HANDLER( name##_w )                     \
567567{                                                   \
568568   if (cond)                                          \
569      func(handler, device, offset, data, mem_mask);            \
569      func(handler, device, space, offset, data, mem_mask);      \
570570}
571571
572572
trunk/src/emu/imagedev/flopdrv.h
r17961r17962
155155WRITE_LINE_DEVICE_HANDLER( floppy_ds1_w );
156156WRITE_LINE_DEVICE_HANDLER( floppy_ds2_w );
157157WRITE_LINE_DEVICE_HANDLER( floppy_ds3_w );
158WRITE8_DEVICE_HANDLER( floppy_ds_w );
158DECLARE_WRITE8_DEVICE_HANDLER( floppy_ds_w );
159159
160160WRITE_LINE_DEVICE_HANDLER( floppy_mon_w );
161161WRITE_LINE_DEVICE_HANDLER( floppy_drtn_w );
trunk/src/emu/memory.c
r17961r17962
19981998            }
19991999         break;
20002000
2001      case AMH_LEGACY_DEVICE_HANDLER:
2002         target_device = device().siblingdevice(data.m_tag);
2003         if (target_device == NULL)
2004            fatalerror("Attempted to map a non-existent device '%s' in space %s of device '%s'\n", data.m_tag.cstr(), m_name, m_device.tag());
2005
2006         if (readorwrite == ROW_READ)
2007            switch (data.m_bits)
2008            {
2009               case 8:      install_legacy_read_handler(*target_device, entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, entry.m_rdevice8, data.m_name, data.m_mask);   break;
2010               case 16:   install_legacy_read_handler(*target_device, entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, entry.m_rdevice16, data.m_name, data.m_mask);   break;
2011               case 32:   install_legacy_read_handler(*target_device, entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, entry.m_rdevice32, data.m_name, data.m_mask);   break;
2012               case 64:   install_legacy_read_handler(*target_device, entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, entry.m_rdevice64, data.m_name, data.m_mask);   break;
2013            }
2014         else
2015            switch (data.m_bits)
2016            {
2017               case 8:      install_legacy_write_handler(*target_device, entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, entry.m_wdevice8, data.m_name, data.m_mask);   break;
2018               case 16:   install_legacy_write_handler(*target_device, entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, entry.m_wdevice16, data.m_name, data.m_mask);   break;
2019               case 32:   install_legacy_write_handler(*target_device, entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, entry.m_wdevice32, data.m_name, data.m_mask);   break;
2020               case 64:   install_legacy_write_handler(*target_device, entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, entry.m_wdevice64, data.m_name, data.m_mask);   break;
2021            }
2022         break;
2023
20242001      case AMH_PORT:
20252002         install_readwrite_port(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror,
20262003                     (readorwrite == ROW_READ) ? data.m_tag.cstr() : NULL,
trunk/src/emu/memory.h
r17961r17962
122122typedef void   (*write64_space_func)(ATTR_UNUSED address_space *space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT64 data, ATTR_UNUSED UINT64 mem_mask);
123123
124124// legacy device read/write handlers
125typedef UINT8   (*read8_device_func)  (ATTR_UNUSED device_t *device, ATTR_UNUSED offs_t offset);
126typedef void   (*write8_device_func) (ATTR_UNUSED device_t *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT8 data);
127typedef UINT16   (*read16_device_func) (ATTR_UNUSED device_t *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16 mem_mask);
128typedef void   (*write16_device_func)(ATTR_UNUSED device_t *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16 data, ATTR_UNUSED UINT16 mem_mask);
129typedef UINT32   (*read32_device_func) (ATTR_UNUSED device_t *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT32 mem_mask);
130typedef void   (*write32_device_func)(ATTR_UNUSED device_t *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT32 data, ATTR_UNUSED UINT32 mem_mask);
131typedef UINT64   (*read64_device_func) (ATTR_UNUSED device_t *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT64 mem_mask);
132typedef void   (*write64_device_func)(ATTR_UNUSED device_t *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT64 data, ATTR_UNUSED UINT64 mem_mask);
125typedef UINT8   (*read8_device_func)  (ATTR_UNUSED device_t *device, ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT8 mem_mask);
126typedef void   (*write8_device_func) (ATTR_UNUSED device_t *device, ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT8 data, ATTR_UNUSED UINT8 mem_mask);
127typedef UINT16   (*read16_device_func) (ATTR_UNUSED device_t *device, ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16 mem_mask);
128typedef void   (*write16_device_func)(ATTR_UNUSED device_t *device, ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16 data, ATTR_UNUSED UINT16 mem_mask);
129typedef UINT32   (*read32_device_func) (ATTR_UNUSED device_t *device, ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT32 mem_mask);
130typedef void   (*write32_device_func)(ATTR_UNUSED device_t *device, ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT32 data, ATTR_UNUSED UINT32 mem_mask);
131typedef UINT64   (*read64_device_func) (ATTR_UNUSED device_t *device, ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT64 mem_mask);
132typedef void   (*write64_device_func)(ATTR_UNUSED device_t *device, ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT64 data, ATTR_UNUSED UINT64 mem_mask);
133133
134134
135135// struct with function pointers for accessors; use is generally discouraged unless necessary
r17961r17962
887887
888888
889889// device read/write handler function macros
890#define READ8_DEVICE_HANDLER(name)      UINT8  name(ATTR_UNUSED device_t *device, ATTR_UNUSED offs_t offset)
891#define WRITE8_DEVICE_HANDLER(name)    void   name(ATTR_UNUSED device_t *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT8 data)
892#define READ16_DEVICE_HANDLER(name)      UINT16 name(ATTR_UNUSED device_t *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16 mem_mask)
893#define WRITE16_DEVICE_HANDLER(name)   void   name(ATTR_UNUSED device_t *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16 data, ATTR_UNUSED UINT16 mem_mask)
894#define READ32_DEVICE_HANDLER(name)      UINT32 name(ATTR_UNUSED device_t *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT32 mem_mask)
895#define WRITE32_DEVICE_HANDLER(name)   void   name(ATTR_UNUSED device_t *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT32 data, ATTR_UNUSED UINT32 mem_mask)
896#define READ64_DEVICE_HANDLER(name)      UINT64 name(ATTR_UNUSED device_t *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT64 mem_mask)
897#define WRITE64_DEVICE_HANDLER(name)   void   name(ATTR_UNUSED device_t *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT64 data, ATTR_UNUSED UINT64 mem_mask)
890#define READ8_DEVICE_HANDLER(name)      UINT8  name(ATTR_UNUSED device_t *device, ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT8 mem_mask)
891#define WRITE8_DEVICE_HANDLER(name)    void   name(ATTR_UNUSED device_t *device, ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT8 data, ATTR_UNUSED UINT8 mem_mask)
892#define READ16_DEVICE_HANDLER(name)      UINT16 name(ATTR_UNUSED device_t *device, ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16 mem_mask)
893#define WRITE16_DEVICE_HANDLER(name)   void   name(ATTR_UNUSED device_t *device, ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16 data, ATTR_UNUSED UINT16 mem_mask)
894#define READ32_DEVICE_HANDLER(name)      UINT32 name(ATTR_UNUSED device_t *device, ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT32 mem_mask)
895#define WRITE32_DEVICE_HANDLER(name)   void   name(ATTR_UNUSED device_t *device, ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT32 data, ATTR_UNUSED UINT32 mem_mask)
896#define READ64_DEVICE_HANDLER(name)      UINT64 name(ATTR_UNUSED device_t *device, ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT64 mem_mask)
897#define WRITE64_DEVICE_HANDLER(name)   void   name(ATTR_UNUSED device_t *device, ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT64 data, ATTR_UNUSED UINT64 mem_mask)
898898
899#define DECLARE_READ8_DEVICE_HANDLER(name)      UINT8  name(ATTR_UNUSED device_t *device, ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT8 mem_mask = 0xff)
900#define DECLARE_WRITE8_DEVICE_HANDLER(name)    void   name(ATTR_UNUSED device_t *device, ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT8 data, ATTR_UNUSED UINT8 mem_mask = 0xff)
901#define DECLARE_READ16_DEVICE_HANDLER(name)      UINT16 name(ATTR_UNUSED device_t *device, ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16 mem_mask = 0xffff)
902#define DECLARE_WRITE16_DEVICE_HANDLER(name)   void   name(ATTR_UNUSED device_t *device, ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16 data, ATTR_UNUSED UINT16 mem_mask = 0xffff)
903#define DECLARE_READ32_DEVICE_HANDLER(name)      UINT32 name(ATTR_UNUSED device_t *device, ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT32 mem_mask = 0xffffffff)
904#define DECLARE_WRITE32_DEVICE_HANDLER(name)   void   name(ATTR_UNUSED device_t *device, ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT32 data, ATTR_UNUSED UINT32 mem_mask = 0xffffffff)
905#define DECLARE_READ64_DEVICE_HANDLER(name)      UINT64 name(ATTR_UNUSED device_t *device, ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT64 mem_mask = U64(0xffffffffffffffff))
906#define DECLARE_WRITE64_DEVICE_HANDLER(name)   void   name(ATTR_UNUSED device_t *device, ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT64 data, ATTR_UNUSED UINT64 mem_mask = U64(0xffffffffffffffff))
899907
908
900909// space read/write handler function macros
901910#define READ8_MEMBER(name)            UINT8  name(ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT8 mem_mask)
902911#define WRITE8_MEMBER(name)            void   name(ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT8 data, ATTR_UNUSED UINT8 mem_mask)
trunk/src/emu/machine/timekpr.h
r17961r17962
154154//  READ/WRITE HANDLERS
155155//**************************************************************************
156156
157WRITE8_DEVICE_HANDLER( timekeeper_w );
158READ8_DEVICE_HANDLER( timekeeper_r );
157DECLARE_WRITE8_DEVICE_HANDLER( timekeeper_w );
158DECLARE_READ8_DEVICE_HANDLER( timekeeper_r );
159159
160160#endif // __TIMEKPR_H__
trunk/src/emu/machine/adc1213x.h
r17961r17962
8282    PROTOTYPES
8383***************************************************************************/
8484
85extern WRITE8_DEVICE_HANDLER( adc1213x_di_w );
86extern WRITE8_DEVICE_HANDLER( adc1213x_cs_w );
87extern WRITE8_DEVICE_HANDLER( adc1213x_sclk_w );
88extern WRITE8_DEVICE_HANDLER( adc1213x_conv_w );
89extern READ8_DEVICE_HANDLER( adc1213x_do_r );
90extern READ8_DEVICE_HANDLER( adc1213x_eoc_r );
85extern DECLARE_WRITE8_DEVICE_HANDLER( adc1213x_di_w );
86extern DECLARE_WRITE8_DEVICE_HANDLER( adc1213x_cs_w );
87extern DECLARE_WRITE8_DEVICE_HANDLER( adc1213x_sclk_w );
88extern DECLARE_WRITE8_DEVICE_HANDLER( adc1213x_conv_w );
89extern DECLARE_READ8_DEVICE_HANDLER( adc1213x_do_r );
90extern DECLARE_READ8_DEVICE_HANDLER( adc1213x_eoc_r );
9191
9292#endif   /* __ADC1213X_H__ */
trunk/src/emu/machine/z80dma.h
r17961r17962
168168//**************************************************************************
169169
170170// register access
171READ8_DEVICE_HANDLER( z80dma_r );
172WRITE8_DEVICE_HANDLER( z80dma_w );
171DECLARE_READ8_DEVICE_HANDLER( z80dma_r );
172DECLARE_WRITE8_DEVICE_HANDLER( z80dma_w );
173173
174174// ready
175175WRITE_LINE_DEVICE_HANDLER( z80dma_rdy_w );
trunk/src/emu/machine/tms6100.h
r17961r17962
1010WRITE_LINE_DEVICE_HANDLER( tms6100_m0_w );
1111WRITE_LINE_DEVICE_HANDLER( tms6100_m1_w );
1212WRITE_LINE_DEVICE_HANDLER( tms6100_romclock_w );
13WRITE8_DEVICE_HANDLER( tms6100_addr_w );
13DECLARE_WRITE8_DEVICE_HANDLER( tms6100_addr_w );
1414
1515READ_LINE_DEVICE_HANDLER( tms6100_data_r );
1616
trunk/src/emu/machine/ins8154.h
r17961r17962
116116    PROTOTYPES
117117***************************************************************************/
118118
119READ8_DEVICE_HANDLER( ins8154_r );
120WRITE8_DEVICE_HANDLER( ins8154_w );
119DECLARE_READ8_DEVICE_HANDLER( ins8154_r );
120DECLARE_WRITE8_DEVICE_HANDLER( ins8154_w );
121121
122WRITE8_DEVICE_HANDLER( ins8154_porta_w );
123WRITE8_DEVICE_HANDLER( ins8154_portb_w );
122DECLARE_WRITE8_DEVICE_HANDLER( ins8154_porta_w );
123DECLARE_WRITE8_DEVICE_HANDLER( ins8154_portb_w );
124124
125125
126126#endif /* __INS8154_H__ */
trunk/src/emu/machine/smc91c9x.h
r17961r17962
4444    FUNCTION PROTOTYPES
4545***************************************************************************/
4646
47READ16_DEVICE_HANDLER( smc91c9x_r );
48WRITE16_DEVICE_HANDLER( smc91c9x_w );
47DECLARE_READ16_DEVICE_HANDLER( smc91c9x_r );
48DECLARE_WRITE16_DEVICE_HANDLER( smc91c9x_w );
4949
5050
5151/* ----- device interface ----- */
trunk/src/emu/machine/z80sti.h
r17961r17962
183183//**************************************************************************
184184
185185// register access
186READ8_DEVICE_HANDLER( z80sti_r );
187WRITE8_DEVICE_HANDLER( z80sti_w );
186DECLARE_READ8_DEVICE_HANDLER( z80sti_r );
187DECLARE_WRITE8_DEVICE_HANDLER( z80sti_w );
188188
189189// receive clock
190190WRITE_LINE_DEVICE_HANDLER( z80sti_rc_w );
trunk/src/emu/machine/f3853.h
r17961r17962
120120    PROTOTYPES
121121***************************************************************************/
122122
123READ8_DEVICE_HANDLER( f3853_r );
124WRITE8_DEVICE_HANDLER( f3853_w );
123DECLARE_READ8_DEVICE_HANDLER( f3853_r );
124DECLARE_WRITE8_DEVICE_HANDLER( f3853_w );
125125
126126void f3853_set_external_interrupt_in_line(device_t *device, int level);
127127void f3853_set_priority_in_line(device_t *device, int level);
trunk/src/emu/machine/i8243.h
r17961r17962
8888    PROTOTYPES
8989***************************************************************************/
9090
91READ8_DEVICE_HANDLER( i8243_p2_r );
92WRITE8_DEVICE_HANDLER( i8243_p2_w );
91DECLARE_READ8_DEVICE_HANDLER( i8243_p2_r );
92DECLARE_WRITE8_DEVICE_HANDLER( i8243_p2_w );
9393
94WRITE8_DEVICE_HANDLER( i8243_prog_w );
94DECLARE_WRITE8_DEVICE_HANDLER( i8243_prog_w );
9595
9696
9797#endif  /* __I8243_H__ */
trunk/src/emu/machine/k056230.h
r17961r17962
8080    PROTOTYPES
8181***************************************************************************/
8282
83extern READ32_DEVICE_HANDLER( lanc_ram_r );
84extern WRITE32_DEVICE_HANDLER( lanc_ram_w );
85extern READ8_DEVICE_HANDLER( k056230_r );
86extern WRITE8_DEVICE_HANDLER( k056230_w );
83extern DECLARE_READ32_DEVICE_HANDLER( lanc_ram_r );
84extern DECLARE_WRITE32_DEVICE_HANDLER( lanc_ram_w );
85extern DECLARE_READ8_DEVICE_HANDLER( k056230_r );
86extern DECLARE_WRITE8_DEVICE_HANDLER( k056230_w );
8787
8888
8989#endif   /* __K056230_H__ */
trunk/src/emu/machine/z80dart.c
r17961r17962
14521452
14531453READ8_DEVICE_HANDLER( z80dart_cd_ba_r )
14541454{
1455   return (offset & 2) ? z80dart_c_r(device, offset & 1) : z80dart_d_r(device, offset & 1);
1455   return (offset & 2) ? z80dart_c_r(device, space, offset & 1) : z80dart_d_r(device, space, offset & 1);
14561456}
14571457
14581458WRITE8_DEVICE_HANDLER( z80dart_cd_ba_w )
14591459{
14601460   if (offset & 2)
1461      z80dart_c_w(device, offset & 1, data);
1461      z80dart_c_w(device, space, offset & 1, data);
14621462   else
1463      z80dart_d_w(device, offset & 1, data);
1463      z80dart_d_w(device, space, offset & 1, data);
14641464}
14651465
14661466READ8_DEVICE_HANDLER( z80dart_ba_cd_r )
14671467{
14681468   int channel = BIT(offset, 1);
14691469
1470   return (offset & 1) ? z80dart_c_r(device, channel) : z80dart_d_r(device, channel);
1470   return (offset & 1) ? z80dart_c_r(device, space, channel) : z80dart_d_r(device, space, channel);
14711471}
14721472
14731473WRITE8_DEVICE_HANDLER( z80dart_ba_cd_w )
r17961r17962
14751475   int channel = BIT(offset, 1);
14761476
14771477   if (offset & 1)
1478      z80dart_c_w(device, channel, data);
1478      z80dart_c_w(device, space, channel, data);
14791479   else
1480      z80dart_d_w(device, channel, data);
1480      z80dart_d_w(device, space, channel, data);
14811481}
trunk/src/emu/machine/z80dart.h
r17961r17962
341341//**************************************************************************
342342
343343// register access
344READ8_DEVICE_HANDLER( z80dart_cd_ba_r );
345WRITE8_DEVICE_HANDLER( z80dart_cd_ba_w );
344DECLARE_READ8_DEVICE_HANDLER( z80dart_cd_ba_r );
345DECLARE_WRITE8_DEVICE_HANDLER( z80dart_cd_ba_w );
346346
347READ8_DEVICE_HANDLER( z80dart_ba_cd_r );
348WRITE8_DEVICE_HANDLER( z80dart_ba_cd_w );
347DECLARE_READ8_DEVICE_HANDLER( z80dart_ba_cd_r );
348DECLARE_WRITE8_DEVICE_HANDLER( z80dart_ba_cd_w );
349349
350350// control register access
351WRITE8_DEVICE_HANDLER( z80dart_c_w );
352READ8_DEVICE_HANDLER( z80dart_c_r );
351DECLARE_WRITE8_DEVICE_HANDLER( z80dart_c_w );
352DECLARE_READ8_DEVICE_HANDLER( z80dart_c_r );
353353
354354// data register access
355WRITE8_DEVICE_HANDLER( z80dart_d_w );
356READ8_DEVICE_HANDLER( z80dart_d_r );
355DECLARE_WRITE8_DEVICE_HANDLER( z80dart_d_w );
356DECLARE_READ8_DEVICE_HANDLER( z80dart_d_r );
357357
358358// serial clocks
359359WRITE_LINE_DEVICE_HANDLER( z80dart_rxca_w );
trunk/src/emu/machine/pic8259.h
r17961r17962
7474
7575
7676/* device interface */
77READ8_DEVICE_HANDLER( pic8259_r );
78WRITE8_DEVICE_HANDLER( pic8259_w );
77DECLARE_READ8_DEVICE_HANDLER( pic8259_r );
78DECLARE_WRITE8_DEVICE_HANDLER( pic8259_w );
7979int pic8259_acknowledge(device_t *device);
8080
8181/* interrupt requests */
trunk/src/emu/machine/upd4701.h
r17961r17962
4444    PROTOTYPES
4545***************************************************************************/
4646
47extern WRITE8_DEVICE_HANDLER( upd4701_cs_w );
48extern WRITE8_DEVICE_HANDLER( upd4701_xy_w );
49extern WRITE8_DEVICE_HANDLER( upd4701_ul_w );
50extern WRITE8_DEVICE_HANDLER( upd4701_resetx_w );
51extern WRITE8_DEVICE_HANDLER( upd4701_resety_w );
52extern WRITE16_DEVICE_HANDLER( upd4701_x_add );
53extern WRITE16_DEVICE_HANDLER( upd4701_y_add );
54extern WRITE8_DEVICE_HANDLER( upd4701_switches_set );
47extern DECLARE_WRITE8_DEVICE_HANDLER( upd4701_cs_w );
48extern DECLARE_WRITE8_DEVICE_HANDLER( upd4701_xy_w );
49extern DECLARE_WRITE8_DEVICE_HANDLER( upd4701_ul_w );
50extern DECLARE_WRITE8_DEVICE_HANDLER( upd4701_resetx_w );
51extern DECLARE_WRITE8_DEVICE_HANDLER( upd4701_resety_w );
52extern DECLARE_WRITE16_DEVICE_HANDLER( upd4701_x_add );
53extern DECLARE_WRITE16_DEVICE_HANDLER( upd4701_y_add );
54extern DECLARE_WRITE8_DEVICE_HANDLER( upd4701_switches_set );
5555
56extern READ16_DEVICE_HANDLER( upd4701_d_r );
57extern READ8_DEVICE_HANDLER( upd4701_cf_r );
58extern READ8_DEVICE_HANDLER( upd4701_sf_r );
56extern DECLARE_READ16_DEVICE_HANDLER( upd4701_d_r );
57extern DECLARE_READ8_DEVICE_HANDLER( upd4701_cf_r );
58extern DECLARE_READ8_DEVICE_HANDLER( upd4701_sf_r );
5959
6060
6161#endif   /* __UPD4701_H__ */
trunk/src/emu/machine/at28c16.h
r17961r17962
8484//  READ/WRITE HANDLERS
8585//**************************************************************************
8686
87WRITE8_DEVICE_HANDLER( at28c16_w );
88READ8_DEVICE_HANDLER( at28c16_r );
87DECLARE_WRITE8_DEVICE_HANDLER( at28c16_w );
88DECLARE_READ8_DEVICE_HANDLER( at28c16_r );
8989WRITE_LINE_DEVICE_HANDLER( at28c16_a9_12v );
9090WRITE_LINE_DEVICE_HANDLER( at28c16_oe_12v );
9191
trunk/src/emu/machine/wd17xx.c
r17961r17962
19931993
19941994   switch (offset & 0x03)
19951995   {
1996   case 0: data = wd17xx_status_r(device, 0); break;
1997   case 1:   data = wd17xx_track_r(device, 0); break;
1998   case 2:   data = wd17xx_sector_r(device, 0); break;
1999   case 3:   data = wd17xx_data_r(device, 0); break;
1996   case 0: data = wd17xx_status_r(device, device->machine().driver_data()->generic_space(), 0); break;
1997   case 1:   data = wd17xx_track_r(device, device->machine().driver_data()->generic_space(), 0); break;
1998   case 2:   data = wd17xx_sector_r(device, device->machine().driver_data()->generic_space(), 0); break;
1999   case 3:   data = wd17xx_data_r(device, device->machine().driver_data()->generic_space(), 0); break;
20002000   }
20012001
20022002   return data;
r17961r17962
20062006{
20072007   switch (offset & 0x03)
20082008   {
2009   case 0: wd17xx_command_w(device, 0, data); break;
2010   case 1:   wd17xx_track_w(device, 0, data);   break;
2011   case 2: wd17xx_sector_w(device, 0, data);  break;
2012   case 3: wd17xx_data_w(device, 0, data);    break;
2009   case 0: wd17xx_command_w(device, device->machine().driver_data()->generic_space(), 0, data); break;
2010   case 1:   wd17xx_track_w(device, device->machine().driver_data()->generic_space(), 0, data);   break;
2011   case 2: wd17xx_sector_w(device, device->machine().driver_data()->generic_space(), 0, data);  break;
2012   case 3: wd17xx_data_w(device, device->machine().driver_data()->generic_space(), 0, data);    break;
20132013   }
20142014}
20152015
trunk/src/emu/machine/wd17xx.h
r17961r17962
255255void wd17xx_set_pause_time(device_t *device, int usec);       /* default is 40 usec if not set */
256256void wd17xx_index_pulse_callback(device_t *controller, device_t *img, int state);
257257
258READ8_DEVICE_HANDLER( wd17xx_status_r );
259READ8_DEVICE_HANDLER( wd17xx_track_r );
260READ8_DEVICE_HANDLER( wd17xx_sector_r );
261READ8_DEVICE_HANDLER( wd17xx_data_r );
258DECLARE_READ8_DEVICE_HANDLER( wd17xx_status_r );
259DECLARE_READ8_DEVICE_HANDLER( wd17xx_track_r );
260DECLARE_READ8_DEVICE_HANDLER( wd17xx_sector_r );
261DECLARE_READ8_DEVICE_HANDLER( wd17xx_data_r );
262262
263WRITE8_DEVICE_HANDLER( wd17xx_command_w );
264WRITE8_DEVICE_HANDLER( wd17xx_track_w );
265WRITE8_DEVICE_HANDLER( wd17xx_sector_w );
266WRITE8_DEVICE_HANDLER( wd17xx_data_w );
263DECLARE_WRITE8_DEVICE_HANDLER( wd17xx_command_w );
264DECLARE_WRITE8_DEVICE_HANDLER( wd17xx_track_w );
265DECLARE_WRITE8_DEVICE_HANDLER( wd17xx_sector_w );
266DECLARE_WRITE8_DEVICE_HANDLER( wd17xx_data_w );
267267
268READ8_DEVICE_HANDLER( wd17xx_r );
269WRITE8_DEVICE_HANDLER( wd17xx_w );
268DECLARE_READ8_DEVICE_HANDLER( wd17xx_r );
269DECLARE_WRITE8_DEVICE_HANDLER( wd17xx_w );
270270
271271WRITE_LINE_DEVICE_HANDLER( wd17xx_mr_w );
272272WRITE_LINE_DEVICE_HANDLER( wd17xx_rdy_w );
trunk/src/emu/machine/s3c24xx.c
r17961r17962
26862686   s3c24xx_t *s3c24xx = get_token( device);
26872687   if (s3c24xx->iface->i2s.data_w)
26882688   {
2689      (s3c24xx->iface->i2s.data_w)( device, ch, data, 0);
2689      (s3c24xx->iface->i2s.data_w)( device, device->machine().driver_data()->generic_space(), ch, data, 0);
26902690   }
26912691}
26922692
r17961r17962
29492949         offs += 2;
29502950      }
29512951      #endif
2952      return (s3c24xx->iface->adc.data_r)( device, offs, 0);
2952      return (s3c24xx->iface->adc.data_r)( device, device->machine().driver_data()->generic_space(), offs, 0);
29532953   }
29542954   else
29552955   {
r17961r17962
31813181   s3c24xx_t *s3c24xx = get_token( device);
31823182   if (s3c24xx->iface->nand.command_w)
31833183   {
3184      (s3c24xx->iface->nand.command_w)( device, 0, data);
3184      (s3c24xx->iface->nand.command_w)( device, device->machine().driver_data()->generic_space(), 0, data, 0xff);
31853185   }
31863186}
31873187
r17961r17962
31903190   s3c24xx_t *s3c24xx = get_token( device);
31913191   if (s3c24xx->iface->nand.address_w)
31923192   {
3193      (s3c24xx->iface->nand.address_w)( device, 0, data);
3193      (s3c24xx->iface->nand.address_w)( device, device->machine().driver_data()->generic_space(), 0, data, 0xff);
31943194   }
31953195}
31963196
r17961r17962
31993199   s3c24xx_t *s3c24xx = get_token( device);
32003200   if (s3c24xx->iface->nand.data_r)
32013201   {
3202      return (s3c24xx->iface->nand.data_r)( device, 0);
3202      return (s3c24xx->iface->nand.data_r)( device, device->machine().driver_data()->generic_space(), 0, 0xff);
32033203   }
32043204   else
32053205   {
r17961r17962
32123212   s3c24xx_t *s3c24xx = get_token( device);
32133213   if (s3c24xx->iface->nand.data_w)
32143214   {
3215      (s3c24xx->iface->nand.data_w)( device, 0, data);
3215      (s3c24xx->iface->nand.data_w)( device, device->machine().driver_data()->generic_space(), 0, data, 0xff);
32163216   }
32173217}
32183218
trunk/src/emu/machine/latch8.c
r17961r17962
4242      UINT8 changed = old_val ^ latch8->value;
4343      for (i=0; i<8; i++)
4444         if (((changed & (1<<i)) != 0) && latch8->intf->node_map[i] != 0)
45            discrete_sound_w(device->machine().device(latch8->intf->node_device[i]), latch8->intf->node_map[i] , (latch8->value >> i) & 1);
45            discrete_sound_w(device->machine().device(latch8->intf->node_device[i]), device->machine().driver_data()->generic_space(), latch8->intf->node_map[i] , (latch8->value >> i) & 1);
4646   }
4747}
4848
r17961r17962
7474         if (read_dev != NULL)
7575         {
7676            res &= ~( 1 << i);
77            res |= ((latch8->intf->devread[i].devread_handler(read_dev, 0) >> latch8->intf->devread[i].from_bit) & 0x01) << i;
77            res |= ((latch8->intf->devread[i].devread_handler(read_dev, device->machine().driver_data()->generic_space(), 0, 0xff) >> latch8->intf->devread[i].from_bit) & 0x01) << i;
7878         }
7979      }
8080   }
8181   if (latch8->has_read)
8282   {
8383      /*  temporary hack until all relevant systems are devices */
84      address_space *space = device->machine().firstcpu->space(AS_PROGRAM);
84      address_space *space = &device->machine().driver_data()->generic_space();
8585      int i;
8686      for (i=0; i<8; i++)
8787      {
trunk/src/emu/machine/latch8.h
r17961r17962
126126
127127/* write & read full byte */
128128
129READ8_DEVICE_HANDLER( latch8_r );
130WRITE8_DEVICE_HANDLER( latch8_w );
129DECLARE_READ8_DEVICE_HANDLER( latch8_r );
130DECLARE_WRITE8_DEVICE_HANDLER( latch8_w );
131131
132132/* reset the latch */
133133
134WRITE8_DEVICE_HANDLER( latch8_reset );
134DECLARE_WRITE8_DEVICE_HANDLER( latch8_reset );
135135
136136/* read bit x                 */
137137/* return (latch >> x) & 0x01 */
138138
139READ8_DEVICE_HANDLER( latch8_bit0_r );
140READ8_DEVICE_HANDLER( latch8_bit1_r );
141READ8_DEVICE_HANDLER( latch8_bit2_r );
142READ8_DEVICE_HANDLER( latch8_bit3_r );
143READ8_DEVICE_HANDLER( latch8_bit4_r );
144READ8_DEVICE_HANDLER( latch8_bit5_r );
145READ8_DEVICE_HANDLER( latch8_bit6_r );
146READ8_DEVICE_HANDLER( latch8_bit7_r );
139DECLARE_READ8_DEVICE_HANDLER( latch8_bit0_r );
140DECLARE_READ8_DEVICE_HANDLER( latch8_bit1_r );
141DECLARE_READ8_DEVICE_HANDLER( latch8_bit2_r );
142DECLARE_READ8_DEVICE_HANDLER( latch8_bit3_r );
143DECLARE_READ8_DEVICE_HANDLER( latch8_bit4_r );
144DECLARE_READ8_DEVICE_HANDLER( latch8_bit5_r );
145DECLARE_READ8_DEVICE_HANDLER( latch8_bit6_r );
146DECLARE_READ8_DEVICE_HANDLER( latch8_bit7_r );
147147
148148/* read inverted bit x        */
149149/* return (latch >> x) & 0x01 */
150150
151READ8_DEVICE_HANDLER( latch8_bit0_q_r );
152READ8_DEVICE_HANDLER( latch8_bit1_q_r );
153READ8_DEVICE_HANDLER( latch8_bit2_q_r );
154READ8_DEVICE_HANDLER( latch8_bit3_q_r );
155READ8_DEVICE_HANDLER( latch8_bit4_q_r );
156READ8_DEVICE_HANDLER( latch8_bit5_q_r );
157READ8_DEVICE_HANDLER( latch8_bit6_q_r );
158READ8_DEVICE_HANDLER( latch8_bit7_q_r );
151DECLARE_READ8_DEVICE_HANDLER( latch8_bit0_q_r );
152DECLARE_READ8_DEVICE_HANDLER( latch8_bit1_q_r );
153DECLARE_READ8_DEVICE_HANDLER( latch8_bit2_q_r );
154DECLARE_READ8_DEVICE_HANDLER( latch8_bit3_q_r );
155DECLARE_READ8_DEVICE_HANDLER( latch8_bit4_q_r );
156DECLARE_READ8_DEVICE_HANDLER( latch8_bit5_q_r );
157DECLARE_READ8_DEVICE_HANDLER( latch8_bit6_q_r );
158DECLARE_READ8_DEVICE_HANDLER( latch8_bit7_q_r );
159159
160160/* write bit x from data into bit determined by offset */
161161/* latch = (latch & ~(1<<offset)) | (((data >> x) & 0x01) << offset) */
162162
163WRITE8_DEVICE_HANDLER( latch8_bit0_w );
164WRITE8_DEVICE_HANDLER( latch8_bit1_w );
165WRITE8_DEVICE_HANDLER( latch8_bit2_w );
166WRITE8_DEVICE_HANDLER( latch8_bit3_w );
167WRITE8_DEVICE_HANDLER( latch8_bit4_w );
168WRITE8_DEVICE_HANDLER( latch8_bit5_w );
169WRITE8_DEVICE_HANDLER( latch8_bit6_w );
170WRITE8_DEVICE_HANDLER( latch8_bit7_w );
163DECLARE_WRITE8_DEVICE_HANDLER( latch8_bit0_w );
164DECLARE_WRITE8_DEVICE_HANDLER( latch8_bit1_w );
165DECLARE_WRITE8_DEVICE_HANDLER( latch8_bit2_w );
166DECLARE_WRITE8_DEVICE_HANDLER( latch8_bit3_w );
167DECLARE_WRITE8_DEVICE_HANDLER( latch8_bit4_w );
168DECLARE_WRITE8_DEVICE_HANDLER( latch8_bit5_w );
169DECLARE_WRITE8_DEVICE_HANDLER( latch8_bit6_w );
170DECLARE_WRITE8_DEVICE_HANDLER( latch8_bit7_w );
171171
172172#endif /* __LATCH8_H_ */
trunk/src/emu/machine/mb14241.h
r17961r17962
4343    DEVICE I/O FUNCTIONS
4444***************************************************************************/
4545
46WRITE8_DEVICE_HANDLER ( mb14241_shift_count_w );
47WRITE8_DEVICE_HANDLER ( mb14241_shift_data_w );
48READ8_DEVICE_HANDLER( mb14241_shift_result_r );
46DECLARE_WRITE8_DEVICE_HANDLER ( mb14241_shift_count_w );
47DECLARE_WRITE8_DEVICE_HANDLER ( mb14241_shift_data_w );
48DECLARE_READ8_DEVICE_HANDLER( mb14241_shift_result_r );
4949
5050
5151#endif /* __MB14241_H__ */
trunk/src/emu/machine/74123.c
r17961r17962
5555      m_a = 0;
5656      m_b = 0;
5757      m_clear = 0;
58       memset(&m_output_changed_cb, 0, sizeof(m_output_changed_cb));
5958   }
6059}
6160
r17961r17962
6665
6766void ttl74123_device::device_start()
6867{
68   m_output_changed.resolve(m_output_changed_cb, *this);
69
6970   m_timer = machine().scheduler().timer_alloc(FUNC(clear_callback), (void *)this);
7071
7172   /* register for state saving */
r17961r17962
145146
146147void ttl74123_device::output(INT32 param)
147148{
148   m_output_changed_cb(this, 0, param);
149   m_output_changed(0, param);
149150}
150151
151152
r17961r17962
177178{
178179   int output = timer_running();
179180
180   m_output_changed_cb(this, 0, output);
181   m_output_changed(0, output);
181182}
182183
183184
trunk/src/emu/machine/6526cia.h
r17961r17962
268268***************************************************************************/
269269
270270/* register access */
271READ8_DEVICE_HANDLER( mos6526_r );
272WRITE8_DEVICE_HANDLER( mos6526_w );
271DECLARE_READ8_DEVICE_HANDLER( mos6526_r );
272DECLARE_WRITE8_DEVICE_HANDLER( mos6526_w );
273273
274274/* port access */
275READ8_DEVICE_HANDLER( mos6526_pa_r );
276READ8_DEVICE_HANDLER( mos6526_pb_r );
275DECLARE_READ8_DEVICE_HANDLER( mos6526_pa_r );
276DECLARE_READ8_DEVICE_HANDLER( mos6526_pb_r );
277277
278278/* interrupt request */
279279READ_LINE_DEVICE_HANDLER( mos6526_irq_r );
trunk/src/emu/machine/k033906.h
r17961r17962
8181    PROTOTYPES
8282***************************************************************************/
8383
84extern READ32_DEVICE_HANDLER( k033906_r );
85extern WRITE32_DEVICE_HANDLER( k033906_w );
84extern DECLARE_READ32_DEVICE_HANDLER( k033906_r );
85extern DECLARE_WRITE32_DEVICE_HANDLER( k033906_w );
8686extern WRITE_LINE_DEVICE_HANDLER( k033906_set_reg );
8787
8888
trunk/src/emu/machine/74123.h
r17961r17962
8282    int m_a;                /* initial/constant value of the A pin */
8383    int m_b;                /* initial/constant value of the B pin */
8484    int m_clear;            /* initial/constant value of the Clear pin */
85    write8_device_func  m_output_changed_cb;
85    devcb_write8  m_output_changed_cb;
8686};
8787
8888
r17961r17962
122122    void clear();
123123
124124    emu_timer *m_timer;
125    devcb_resolved_write8 m_output_changed;
125126};
126127
127128
r17961r17962
134135    PROTOTYPES
135136***************************************************************************/
136137
137WRITE8_DEVICE_HANDLER( ttl74123_a_w );
138WRITE8_DEVICE_HANDLER( ttl74123_b_w );
139WRITE8_DEVICE_HANDLER( ttl74123_clear_w );
140WRITE8_DEVICE_HANDLER( ttl74123_reset_w ); /* reset the latch */
138DECLARE_WRITE8_DEVICE_HANDLER( ttl74123_a_w );
139DECLARE_WRITE8_DEVICE_HANDLER( ttl74123_b_w );
140DECLARE_WRITE8_DEVICE_HANDLER( ttl74123_clear_w );
141DECLARE_WRITE8_DEVICE_HANDLER( ttl74123_reset_w ); /* reset the latch */
141142
142143#endif
trunk/src/emu/machine/idectrl.h
r17961r17962
172172UINT32 ide_controller_r(device_t *config, int reg, int size);
173173void ide_controller_w(device_t *config, int reg, int size, UINT32 data);
174174
175READ32_DEVICE_HANDLER( ide_controller32_r );
176WRITE32_DEVICE_HANDLER( ide_controller32_w );
177READ32_DEVICE_HANDLER( ide_controller32_pcmcia_r );
178WRITE32_DEVICE_HANDLER( ide_controller32_pcmcia_w );
179READ32_DEVICE_HANDLER( ide_bus_master32_r );
180WRITE32_DEVICE_HANDLER( ide_bus_master32_w );
175DECLARE_READ32_DEVICE_HANDLER( ide_controller32_r );
176DECLARE_WRITE32_DEVICE_HANDLER( ide_controller32_w );
177DECLARE_READ32_DEVICE_HANDLER( ide_controller32_pcmcia_r );
178DECLARE_WRITE32_DEVICE_HANDLER( ide_controller32_pcmcia_w );
179DECLARE_READ32_DEVICE_HANDLER( ide_bus_master32_r );
180DECLARE_WRITE32_DEVICE_HANDLER( ide_bus_master32_w );
181181
182READ16_DEVICE_HANDLER( ide_controller16_r );
183WRITE16_DEVICE_HANDLER( ide_controller16_w );
182DECLARE_READ16_DEVICE_HANDLER( ide_controller16_r );
183DECLARE_WRITE16_DEVICE_HANDLER( ide_controller16_w );
184184
185185
186186/* ----- device interface ----- */
trunk/src/emu/machine/68681.h
r17961r17962
4040   MCFG_DEVICE_CONFIG(_config)
4141
4242
43READ8_DEVICE_HANDLER(duart68681_r);
44WRITE8_DEVICE_HANDLER(duart68681_w);
43DECLARE_READ8_DEVICE_HANDLER(duart68681_r);
44DECLARE_WRITE8_DEVICE_HANDLER(duart68681_w);
4545
4646void duart68681_rx_data( device_t* device, int ch, UINT8 data );
4747
trunk/src/emu/machine/6532riot.h
r17961r17962
121121    PROTOTYPES
122122***************************************************************************/
123123
124READ8_DEVICE_HANDLER( riot6532_r );
125WRITE8_DEVICE_HANDLER( riot6532_w );
124DECLARE_READ8_DEVICE_HANDLER( riot6532_r );
125DECLARE_WRITE8_DEVICE_HANDLER( riot6532_w );
126126
127127void riot6532_porta_in_set(device_t *device, UINT8 data, UINT8 mask);
128128void riot6532_portb_in_set(device_t *device, UINT8 data, UINT8 mask);
trunk/src/emu/machine/pd4990a.h
r17961r17962
4848/* this should be refactored, once RTCs get unified */
4949extern void upd4990a_addretrace( device_t *device );
5050
51extern READ8_DEVICE_HANDLER( upd4990a_testbit_r );
52extern READ8_DEVICE_HANDLER( upd4990a_databit_r );
53extern WRITE16_DEVICE_HANDLER( upd4990a_control_16_w );
51extern DECLARE_READ8_DEVICE_HANDLER( upd4990a_testbit_r );
52extern DECLARE_READ8_DEVICE_HANDLER( upd4990a_databit_r );
53extern DECLARE_WRITE16_DEVICE_HANDLER( upd4990a_control_16_w );
5454
5555
5656#endif   /*__PD4990A_H__*/
trunk/src/emu/machine/rp5h01.h
r17961r17962
4848    PROTOTYPES
4949***************************************************************************/
5050
51WRITE8_DEVICE_HANDLER( rp5h01_enable_w );   /* /CE */
52WRITE8_DEVICE_HANDLER( rp5h01_reset_w );   /* RESET */
53WRITE8_DEVICE_HANDLER( rp5h01_cs_w );   /* CS */
54WRITE8_DEVICE_HANDLER( rp5h01_clock_w );   /* DATA CLOCK (active low) */
55WRITE8_DEVICE_HANDLER( rp5h01_test_w );      /* TEST */
56READ8_DEVICE_HANDLER( rp5h01_counter_r );   /* COUNTER OUT */
57READ8_DEVICE_HANDLER( rp5h01_data_r );      /* DATA */
51DECLARE_WRITE8_DEVICE_HANDLER( rp5h01_enable_w );   /* /CE */
52DECLARE_WRITE8_DEVICE_HANDLER( rp5h01_reset_w );   /* RESET */
53DECLARE_WRITE8_DEVICE_HANDLER( rp5h01_cs_w );   /* CS */
54DECLARE_WRITE8_DEVICE_HANDLER( rp5h01_clock_w );   /* DATA CLOCK (active low) */
55DECLARE_WRITE8_DEVICE_HANDLER( rp5h01_test_w );      /* TEST */
56DECLARE_READ8_DEVICE_HANDLER( rp5h01_counter_r );   /* COUNTER OUT */
57DECLARE_READ8_DEVICE_HANDLER( rp5h01_data_r );      /* DATA */
5858
5959#endif /* __RP5H01_H__ */
trunk/src/emu/machine/8257dma.h
r17961r17962
147147***************************************************************************/
148148
149149/* register access */
150READ8_DEVICE_HANDLER( i8257_r );
151WRITE8_DEVICE_HANDLER( i8257_w );
150DECLARE_READ8_DEVICE_HANDLER( i8257_r );
151DECLARE_WRITE8_DEVICE_HANDLER( i8257_w );
152152
153153/* hold acknowledge */
154154WRITE_LINE_DEVICE_HANDLER( i8257_hlda_w );
trunk/src/emu/machine/s3c2410.h
r17961r17962
6363extern const device_type S3C2410;
6464
6565
66READ32_DEVICE_HANDLER( s3c2410_lcd_r );
66DECLARE_READ32_DEVICE_HANDLER( s3c2410_lcd_r );
6767
6868/*******************************************************************************
6969    TYPE DEFINITIONS
trunk/src/emu/machine/6525tpi.h
r17961r17962
8686    FUNCTION PROTOTYPES
8787***************************************************************************/
8888
89READ8_DEVICE_HANDLER( tpi6525_r );
90WRITE8_DEVICE_HANDLER( tpi6525_w );
89DECLARE_READ8_DEVICE_HANDLER( tpi6525_r );
90DECLARE_WRITE8_DEVICE_HANDLER( tpi6525_w );
9191
92READ8_DEVICE_HANDLER( tpi6525_porta_r );
93WRITE8_DEVICE_HANDLER( tpi6525_porta_w );
92DECLARE_READ8_DEVICE_HANDLER( tpi6525_porta_r );
93DECLARE_WRITE8_DEVICE_HANDLER( tpi6525_porta_w );
9494
95READ8_DEVICE_HANDLER( tpi6525_portb_r );
96WRITE8_DEVICE_HANDLER( tpi6525_portb_w );
95DECLARE_READ8_DEVICE_HANDLER( tpi6525_portb_r );
96DECLARE_WRITE8_DEVICE_HANDLER( tpi6525_portb_w );
9797
98READ8_DEVICE_HANDLER( tpi6525_portc_r );
99WRITE8_DEVICE_HANDLER( tpi6525_portc_w );
98DECLARE_READ8_DEVICE_HANDLER( tpi6525_portc_r );
99DECLARE_WRITE8_DEVICE_HANDLER( tpi6525_portc_w );
100100
101101WRITE_LINE_DEVICE_HANDLER( tpi6525_i0_w );
102102WRITE_LINE_DEVICE_HANDLER( tpi6525_i1_w );
trunk/src/emu/machine/8237dma.h
r17961r17962
189189***************************************************************************/
190190
191191/* register access */
192READ8_DEVICE_HANDLER( i8237_r );
193WRITE8_DEVICE_HANDLER( i8237_w );
192DECLARE_READ8_DEVICE_HANDLER( i8237_r );
193DECLARE_WRITE8_DEVICE_HANDLER( i8237_w );
194194
195195/* hold acknowledge */
196196WRITE_LINE_DEVICE_HANDLER( i8237_hlda_w );
trunk/src/emu/machine/z80sio.c
r17961r17962
243243inline void z80sio_device::update_interrupt_state()
244244{
245245   // if we have a callback, update it with the current state
246   if (m_irq_cb != NULL)
247      (*m_irq_cb)(this, (z80daisy_irq_state() & Z80_DAISY_INT) ? ASSERT_LINE : CLEAR_LINE);
246   if (!m_irq.isnull())
247      m_irq((z80daisy_irq_state() & Z80_DAISY_INT) ? ASSERT_LINE : CLEAR_LINE);
248248}
249249
250250
r17961r17962
318318   const z80sio_interface *intf = reinterpret_cast<const z80sio_interface *>(static_config());
319319   if (intf != NULL)
320320      *static_cast<z80sio_interface *>(this) = *intf;
321
322   // or initialize to defaults if none provided
323   else
324   {
325      m_irq_cb = NULL;
326      m_dtr_changed_cb = NULL;
327      m_rts_changed_cb = NULL;
328      m_break_changed_cb = NULL;
329      m_transmit_cb = NULL;
330      m_receive_poll_cb = NULL;
331   }
332321}
333322
334323
r17961r17962
338327
339328void z80sio_device::device_start()
340329{
330   m_irq.resolve(m_irq_cb, *this);
331   m_dtr_changed.resolve(m_dtr_changed_cb, *this);
332   m_rts_changed.resolve(m_rts_changed_cb, *this);
333   m_break_changed.resolve(m_break_changed_cb, *this);
334   m_transmit.resolve(m_transmit_cb, *this);
335   m_received_poll.resolve(m_received_poll_cb, *this);
336
341337   m_channel[0].start(this, 0);
342338   m_channel[1].start(this, 1);
343339}
r17961r17962
566562
567563      // SIO write register 5
568564      case 5:
569         if (((old ^ data) & SIO_WR5_DTR) && m_device->m_dtr_changed_cb)
570            (*m_device->m_dtr_changed_cb)(m_device, m_index, (data & SIO_WR5_DTR) != 0);
571         if (((old ^ data) & SIO_WR5_SEND_BREAK) && m_device->m_break_changed_cb)
572            (*m_device->m_break_changed_cb)(m_device, m_index, (data & SIO_WR5_SEND_BREAK) != 0);
573         if (((old ^ data) & SIO_WR5_RTS) && m_device->m_rts_changed_cb)
574            (*m_device->m_rts_changed_cb)(m_device, m_index, (data & SIO_WR5_RTS) != 0);
565         if (((old ^ data) & SIO_WR5_DTR) && !m_device->m_dtr_changed.isnull())
566            m_device->m_dtr_changed(m_index, (data & SIO_WR5_DTR) != 0);
567         if (((old ^ data) & SIO_WR5_SEND_BREAK) && !m_device->m_break_changed.isnull())
568            m_device->m_break_changed(m_index, (data & SIO_WR5_SEND_BREAK) != 0);
569         if (((old ^ data) & SIO_WR5_RTS) && !m_device->m_rts_changed.isnull())
570            m_device->m_rts_changed(m_index, (data & SIO_WR5_RTS) != 0);
575571         break;
576572   }
577573}
r17961r17962
741737      VPRINTF(("serial_callback(%c): Transmitting %02x\n", 'A' + m_index, m_outbuf));
742738
743739      // actually transmit the character
744      if (m_device->m_transmit_cb != NULL)
745         (*m_device->m_transmit_cb)(m_device, m_index, m_outbuf);
740      if (!m_device->m_transmit.isnull())
741         m_device->m_transmit(m_index, m_outbuf, 0xffff);
746742
747743      // update the status register
748744      m_status[0] |= SIO_RR0_TX_BUFFER_EMPTY;
r17961r17962
756752   }
757753
758754   // ask the polling callback if there is data to receive
759   if (m_device->m_receive_poll_cb != NULL)
760      data = (*m_device->m_receive_poll_cb)(m_device, m_index);
755   if (!m_device->m_received_poll.isnull())
756      data = INT16(m_device->m_received_poll(m_index, 0xffff));
761757
762758   // if we have buffered data, pull it
763759   if (m_receive_inptr != m_receive_outptr)
trunk/src/emu/machine/z80sio.h
r17961r17962
3232
3333struct z80sio_interface
3434{
35   void (*m_irq_cb)(device_t *device, int state);
36   write8_device_func m_dtr_changed_cb;
37   write8_device_func m_rts_changed_cb;
38   write8_device_func m_break_changed_cb;
39   write8_device_func m_transmit_cb;
40   int (*m_receive_poll_cb)(device_t *device, int channel);
35   devcb_write_line m_irq_cb;
36   devcb_write8 m_dtr_changed_cb;
37   devcb_write8 m_rts_changed_cb;
38   devcb_write8 m_break_changed_cb;
39   devcb_write16 m_transmit_cb;
40   devcb_read16 m_received_poll_cb;
4141};
4242
4343
r17961r17962
140140   sio_channel               m_channel[2];         // 2 channels
141141   UINT8                  m_int_state[8];         // interrupt states
142142
143   // callbacks
144   devcb_resolved_write_line m_irq;
145   devcb_resolved_write8 m_dtr_changed;
146   devcb_resolved_write8 m_rts_changed;
147   devcb_resolved_write8 m_break_changed;
148   devcb_resolved_write16 m_transmit;
149   devcb_resolved_read16 m_received_poll;
150
143151   static const UINT8 k_int_priority[];
144152};
145153
trunk/src/emu/machine/k053252.h
r17961r17962
4949
5050/**  Konami 053252  **/
5151/* CRT and interrupt control unit */
52READ8_DEVICE_HANDLER( k053252_r );   // CCU registers
53WRITE8_DEVICE_HANDLER( k053252_w );
52DECLARE_READ8_DEVICE_HANDLER( k053252_r );   // CCU registers
53DECLARE_WRITE8_DEVICE_HANDLER( k053252_w );
5454
5555
5656
trunk/src/emu/machine/pit8253.h
r17961r17962
8585   MCFG_DEVICE_CONFIG(_intrf)
8686
8787
88READ8_DEVICE_HANDLER( pit8253_r );
89WRITE8_DEVICE_HANDLER( pit8253_w );
88DECLARE_READ8_DEVICE_HANDLER( pit8253_r );
89DECLARE_WRITE8_DEVICE_HANDLER( pit8253_w );
9090
9191WRITE_LINE_DEVICE_HANDLER( pit8253_clk0_w );
9292WRITE_LINE_DEVICE_HANDLER( pit8253_clk1_w );
trunk/src/emu/machine/ds2404.h
r17961r17962
128128***************************************************************************/
129129
130130/* 1-wire interface reset */
131WRITE8_DEVICE_HANDLER( ds2404_1w_reset_w );
131DECLARE_WRITE8_DEVICE_HANDLER( ds2404_1w_reset_w );
132132
133133/* 3-wire interface reset  */
134WRITE8_DEVICE_HANDLER( ds2404_3w_reset_w );
134DECLARE_WRITE8_DEVICE_HANDLER( ds2404_3w_reset_w );
135135
136READ8_DEVICE_HANDLER( ds2404_data_r );
137WRITE8_DEVICE_HANDLER( ds2404_data_w );
138WRITE8_DEVICE_HANDLER( ds2404_clk_w );
136DECLARE_READ8_DEVICE_HANDLER( ds2404_data_r );
137DECLARE_WRITE8_DEVICE_HANDLER( ds2404_data_w );
138DECLARE_WRITE8_DEVICE_HANDLER( ds2404_clk_w );
139139
140140#endif
trunk/src/emu/addrmap.c
r17961r17962
6666     m_rspace16(NULL),
6767     m_rspace32(NULL),
6868     m_rspace64(NULL),
69     m_rdevice8(NULL),
70     m_rdevice16(NULL),
71     m_rdevice32(NULL),
72     m_rdevice64(NULL),
7369     m_wspace8(NULL),
7470     m_wspace16(NULL),
7571     m_wspace32(NULL),
7672     m_wspace64(NULL),
77     m_wdevice8(NULL),
78     m_wdevice16(NULL),
79     m_wdevice32(NULL),
80     m_wdevice64(NULL),
8173     m_memory(NULL),
8274     m_bytestart(0),
8375     m_byteend(0),
r17961r17962
234226}
235227
236228
237void address_map_entry::internal_set_handler(const device_t &device, const char *tag, read8_device_func func, const char *string, UINT64 unitmask)
238{
239   assert(func != NULL);
240   assert(unitmask_is_appropriate(8, unitmask, string));
241   m_read.m_type = AMH_LEGACY_DEVICE_HANDLER;
242   m_read.m_bits = 8;
243   m_read.m_mask = unitmask;
244   m_read.m_name = string;
245   device.subtag(m_read.m_tag, tag);
246   m_rdevice8 = func;
247}
248
249
250void address_map_entry::internal_set_handler(const device_t &device, const char *tag, write8_device_func func, const char *string, UINT64 unitmask)
251{
252   assert(func != NULL);
253   assert(unitmask_is_appropriate(8, unitmask, string));
254   m_write.m_type = AMH_LEGACY_DEVICE_HANDLER;
255   m_write.m_bits = 8;
256   m_write.m_mask = unitmask;
257   m_write.m_name = string;
258   device.subtag(m_write.m_tag, tag);
259   m_wdevice8 = func;
260}
261
262
263void address_map_entry::internal_set_handler(const device_t &device, const char *tag, read8_device_func rfunc, const char *rstring, write8_device_func wfunc, const char *wstring, UINT64 unitmask)
264{
265   internal_set_handler(device, tag, rfunc, rstring, unitmask);
266   internal_set_handler(device, tag, wfunc, wstring, unitmask);
267}
268
269
270229void address_map_entry::internal_set_handler(const device_t &device, const char *tag, read8_delegate func, UINT64 unitmask)
271230{
272231   assert(!func.isnull());
r17961r17962
336295}
337296
338297
339void address_map_entry::internal_set_handler(const device_t &device, const char *tag, read16_device_func func, const char *string, UINT64 unitmask)
340{
341   assert(func != NULL);
342   assert(unitmask_is_appropriate(16, unitmask, string));
343   m_read.m_type = AMH_LEGACY_DEVICE_HANDLER;
344   m_read.m_bits = 16;
345   m_read.m_mask = unitmask;
346   m_read.m_name = string;
347   device.subtag(m_read.m_tag, tag);
348   m_rdevice16 = func;
349}
350
351
352void address_map_entry::internal_set_handler(const device_t &device, const char *tag, write16_device_func func, const char *string, UINT64 unitmask)
353{
354   assert(func != NULL);
355   assert(unitmask_is_appropriate(16, unitmask, string));
356   m_write.m_type = AMH_LEGACY_DEVICE_HANDLER;
357   m_write.m_bits = 16;
358   m_write.m_mask = unitmask;
359   m_write.m_name = string;
360   device.subtag(m_write.m_tag, tag);
361   m_wdevice16 = func;
362}
363
364
365void address_map_entry::internal_set_handler(const device_t &device, const char *tag, read16_device_func rfunc, const char *rstring, write16_device_func wfunc, const char *wstring, UINT64 unitmask)
366{
367   internal_set_handler(device, tag, rfunc, rstring, unitmask);
368   internal_set_handler(device, tag, wfunc, wstring, unitmask);
369}
370
371
372298void address_map_entry::internal_set_handler(const device_t &device, const char *tag, read16_delegate func, UINT64 unitmask)
373299{
374300   assert(!func.isnull());
r17961r17962
438364}
439365
440366
441void address_map_entry::internal_set_handler(const device_t &device, const char *tag, read32_device_func func, const char *string, UINT64 unitmask)
442{
443   assert(func != NULL);
444   assert(unitmask_is_appropriate(32, unitmask, string));
445   m_read.m_type = AMH_LEGACY_DEVICE_HANDLER;
446   m_read.m_bits = 32;
447   m_read.m_mask = unitmask;
448   m_read.m_name = string;
449   device.subtag(m_read.m_tag, tag);
450   m_rdevice32 = func;
451}
452
453
454void address_map_entry::internal_set_handler(const device_t &device, const char *tag, write32_device_func func, const char *string, UINT64 unitmask)
455{
456   assert(func != NULL);
457   assert(unitmask_is_appropriate(32, unitmask, string));
458   m_write.m_type = AMH_LEGACY_DEVICE_HANDLER;
459   m_write.m_bits = 32;
460   m_write.m_mask = unitmask;
461   m_write.m_name = string;
462   device.subtag(m_write.m_tag, tag);
463   m_wdevice32 = func;
464}
465
466
467void address_map_entry::internal_set_handler(const device_t &device, const char *tag, read32_device_func rfunc, const char *rstring, write32_device_func wfunc, const char *wstring, UINT64 unitmask)
468{
469   internal_set_handler(device, tag, rfunc, rstring, unitmask);
470   internal_set_handler(device, tag, wfunc, wstring, unitmask);
471}
472
473
474367void address_map_entry::internal_set_handler(const device_t &device, const char *tag, read32_delegate func, UINT64 unitmask)
475368{
476369   assert(!func.isnull());
r17961r17962
540433}
541434
542435
543void address_map_entry::internal_set_handler(const device_t &device, const char *tag, read64_device_func func, const char *string, UINT64 unitmask)
544{
545   assert(func != NULL);
546   assert(unitmask_is_appropriate(64, unitmask, string));
547   m_read.m_type = AMH_LEGACY_DEVICE_HANDLER;
548   m_read.m_bits = 64;
549   m_read.m_mask = 0;
550   m_read.m_name = string;
551   device.subtag(m_read.m_tag, tag);
552   m_rdevice64 = func;
553}
554
555
556void address_map_entry::internal_set_handler(const device_t &device, const char *tag, write64_device_func func, const char *string, UINT64 unitmask)
557{
558   assert(func != NULL);
559   assert(unitmask_is_appropriate(64, unitmask, string));
560   m_write.m_type = AMH_LEGACY_DEVICE_HANDLER;
561   m_write.m_bits = 64;
562   m_write.m_mask = 0;
563   m_write.m_name = string;
564   device.subtag(m_write.m_tag, tag);
565   m_wdevice64 = func;
566}
567
568
569void address_map_entry::internal_set_handler(const device_t &device, const char *tag, read64_device_func rfunc, const char *rstring, write64_device_func wfunc, const char *wstring, UINT64 unitmask)
570{
571   internal_set_handler(device, tag, rfunc, rstring, unitmask);
572   internal_set_handler(device, tag, wfunc, wstring, unitmask);
573}
574
575
576436void address_map_entry::internal_set_handler(const device_t &device, const char *tag, read64_delegate func, UINT64 unitmask)
577437{
578438   assert(!func.isnull());
trunk/src/emu/addrmap.h
r17961r17962
6262   AMH_UNMAP,
6363   AMH_DEVICE_DELEGATE,
6464   AMH_LEGACY_SPACE_HANDLER,
65   AMH_LEGACY_DEVICE_HANDLER,
6665   AMH_PORT,
6766   AMH_BANK,
6867   AMH_DEVICE_SUBMAP
r17961r17962
160159   read16_space_func      m_rspace16;            // 16-bit legacy address space handler
161160   read32_space_func      m_rspace32;            // 32-bit legacy address space handler
162161   read64_space_func      m_rspace64;            // 64-bit legacy address space handler
163   read8_device_func      m_rdevice8;            // 8-bit legacy device handler
164   read16_device_func      m_rdevice16;         // 16-bit legacy device handler
165   read32_device_func      m_rdevice32;         // 32-bit legacy device handler
166   read64_device_func      m_rdevice64;         // 64-bit legacy device handler
167162   write8_delegate         m_wproto8;            // 8-bit write proto-delegate
168163   write16_delegate      m_wproto16;            // 16-bit write proto-delegate
169164   write32_delegate      m_wproto32;            // 32-bit write proto-delegate
r17961r17962
172167   write16_space_func      m_wspace16;            // 16-bit legacy address space handler
173168   write32_space_func      m_wspace32;            // 32-bit legacy address space handler
174169   write64_space_func      m_wspace64;            // 64-bit legacy address space handler
175   write8_device_func      m_wdevice8;            // 8-bit legacy device handler
176   write16_device_func      m_wdevice16;         // 16-bit legacy device handler
177   write32_device_func      m_wdevice32;         // 32-bit legacy device handler
178   write64_device_func      m_wdevice64;         // 64-bit legacy device handler
179170
180171   address_map_delegate   m_submap_delegate;
181172   int                  m_submap_bits;
r17961r17962
195186   void internal_set_handler(read8_space_func func, const char *string, UINT64 mask);
196187   void internal_set_handler(write8_space_func func, const char *string, UINT64 mask);
197188   void internal_set_handler(read8_space_func rfunc, const char *rstring, write8_space_func wfunc,  const char *wstring, UINT64 mask);
198   void internal_set_handler(const device_t &device, const char *tag, read8_device_func func, const char *string, UINT64 mask);
199   void internal_set_handler(const device_t &device, const char *tag, write8_device_func func, const char *string, UINT64 mask);
200   void internal_set_handler(const device_t &device, const char *tag, read8_device_func rfunc, const char *rstring, write8_device_func wfunc, const char *wstring, UINT64 mask);
201189   void internal_set_handler(const device_t &device, const char *tag, read8_delegate func, UINT64 mask);
202190   void internal_set_handler(const device_t &device, const char *tag, write8_delegate func, UINT64 mask);
203191   void internal_set_handler(const device_t &device, const char *tag, read8_delegate rfunc, write8_delegate wfunc, UINT64 mask);
r17961r17962
206194   void internal_set_handler(read16_space_func func, const char *string, UINT64 mask);
207195   void internal_set_handler(write16_space_func func, const char *string, UINT64 mask);
208196   void internal_set_handler(read16_space_func rfunc, const char *rstring, write16_space_func wfunc, const char *wstring, UINT64 mask);
209   void internal_set_handler(const device_t &device, const char *tag, read16_device_func func, const char *string, UINT64 mask);
210   void internal_set_handler(const device_t &device, const char *tag, write16_device_func func, const char *string, UINT64 mask);
211   void internal_set_handler(const device_t &device, const char *tag, read16_device_func rfunc, const char *rstring, write16_device_func wfunc, const char *wstring, UINT64 mask);
212197   void internal_set_handler(const device_t &device, const char *tag, read16_delegate func, UINT64 mask);
213198   void internal_set_handler(const device_t &device, const char *tag, write16_delegate func, UINT64 mask);
214199   void internal_set_handler(const device_t &device, const char *tag, read16_delegate rfunc, write16_delegate wfunc, UINT64 mask);
r17961r17962
217202   void internal_set_handler(read32_space_func func, const char *string, UINT64 mask);
218203   void internal_set_handler(write32_space_func func, const char *string, UINT64 mask);
219204   void internal_set_handler(read32_space_func rfunc, const char *rstring, write32_space_func wfunc, const char *wstring, UINT64 mask);
220   void internal_set_handler(const device_t &device, const char *tag, read32_device_func func, const char *string, UINT64 mask);
221   void internal_set_handler(const device_t &device, const char *tag, write32_device_func func, const char *string, UINT64 mask);
222   void internal_set_handler(const device_t &device, const char *tag, read32_device_func rfunc, const char *rstring, write32_device_func wfunc, const char *wstring, UINT64 mask);
223205   void internal_set_handler(const device_t &device, const char *tag, read32_delegate func, UINT64 mask);
224206   void internal_set_handler(const device_t &device, const char *tag, write32_delegate func, UINT64 mask);
225207   void internal_set_handler(const device_t &device, const char *tag, read32_delegate rfunc, write32_delegate wfunc, UINT64 mask);
r17961r17962
228210   void internal_set_handler(read64_space_func func, const char *string, UINT64 mask);
229211   void internal_set_handler(write64_space_func func, const char *string, UINT64 mask);
230212   void internal_set_handler(read64_space_func rfunc, const char *rstring, write64_space_func wfunc, const char *wstring, UINT64 mask);
231   void internal_set_handler(const device_t &device, const char *tag, read64_device_func func, const char *string, UINT64 mask);
232   void internal_set_handler(const device_t &device, const char *tag, write64_device_func func, const char *string, UINT64 mask);
233   void internal_set_handler(const device_t &device, const char *tag, read64_device_func rfunc, const char *rstring, write64_device_func wfunc, const char *wstring, UINT64 mask);
234213   void internal_set_handler(const device_t &device, const char *tag, read64_delegate func, UINT64 mask);
235214   void internal_set_handler(const device_t &device, const char *tag, write64_delegate func, UINT64 mask);
236215   void internal_set_handler(const device_t &device, const char *tag, read64_delegate rfunc, write64_delegate wfunc, UINT64 mask);
r17961r17962
255234   void set_handler(read8_space_func func, const char *string) { internal_set_handler(func, string, 0); }
256235   void set_handler(write8_space_func func, const char *string) { internal_set_handler(func, string, 0); }
257236   void set_handler(read8_space_func rfunc, const char *rstring, write8_space_func wfunc, const char *wstring) { internal_set_handler(rfunc, rstring, wfunc, wstring, 0); }
258   void set_handler(const device_t &device, const char *tag, read8_device_func func, const char *string) { internal_set_handler(device, tag, func, string, 0); }
259   void set_handler(const device_t &device, const char *tag, write8_device_func func, const char *string) { internal_set_handler(device, tag, func, string, 0); }
260   void set_handler(const device_t &device, const char *tag, read8_device_func rfunc, const char *rstring, write8_device_func wfunc, const char *wstring) { internal_set_handler(device, tag, rfunc, rstring, wfunc, wstring, 0); }
261237   void set_handler(const device_t &device, const char *tag, read8_delegate func) { internal_set_handler(device, tag, func, 0); }
262238   void set_handler(const device_t &device, const char *tag, write8_delegate func) { internal_set_handler(device, tag, func, 0); }
263239   void set_handler(const device_t &device, const char *tag, read8_delegate rfunc, write8_delegate wfunc) { internal_set_handler(device, tag, rfunc, wfunc, 0); }
r17961r17962
278254   void set_handler(read16_space_func func, const char *string) { internal_set_handler(func, string, 0); }
279255   void set_handler(write16_space_func func, const char *string) { internal_set_handler(func, string, 0); }
280256   void set_handler(read16_space_func rfunc, const char *rstring, write16_space_func wfunc, const char *wstring) { internal_set_handler(rfunc, rstring, wfunc, wstring, 0); }
281   void set_handler(const device_t &device, const char *tag, read16_device_func func, const char *string) { internal_set_handler(device, tag, func, string, 0); }
282   void set_handler(const device_t &device, const char *tag, write16_device_func func, const char *string) { internal_set_handler(device, tag, func, string, 0); }
283   void set_handler(const device_t &device, const char *tag, read16_device_func rfunc, const char *rstring, write16_device_func wfunc, const char *wstring) { internal_set_handler(device, tag, rfunc, rstring, wfunc, wstring, 0); }
284257   void set_handler(const device_t &device, const char *tag, read16_delegate func) { internal_set_handler(device, tag, func, 0); }
285258   void set_handler(const device_t &device, const char *tag, write16_delegate func) { internal_set_handler(device, tag, func, 0); }
286259   void set_handler(const device_t &device, const char *tag, read16_delegate rfunc, write16_delegate wfunc) { internal_set_handler(device, tag, rfunc, wfunc, 0); }
r17961r17962
289262   void set_handler(read8_space_func func, const char *string, UINT16 mask) { internal_set_handler(func, string, mask); }
290263   void set_handler(write8_space_func func, const char *string, UINT16 mask) { internal_set_handler(func, string, mask); }
291264   void set_handler(read8_space_func rfunc, const char *rstring, write8_space_func wfunc, const char *wstring, UINT16 mask) { internal_set_handler(rfunc, rstring, wfunc, wstring, mask); }
292   void set_handler(const device_t &device, const char *tag, read8_device_func func, const char *string, UINT16 mask) { internal_set_handler(device, tag, func, string, mask); }
293   void set_handler(const device_t &device, const char *tag, write8_device_func func, const char *string, UINT16 mask) { internal_set_handler(device, tag, func, string, mask); }
294   void set_handler(const device_t &device, const char *tag, read8_device_func rfunc, const char *rstring, write8_device_func wfunc, const char *wstring, UINT16 mask) { internal_set_handler(device, tag, rfunc, rstring, wfunc, wstring, mask); }
295265   void set_handler(const device_t &device, const char *tag, read8_delegate func, UINT16 mask) { internal_set_handler(device, tag, func, mask); }
296266   void set_handler(const device_t &device, const char *tag, write8_delegate func, UINT16 mask) { internal_set_handler(device, tag, func, mask); }
297267   void set_handler(const device_t &device, const char *tag, read8_delegate rfunc, write8_delegate wfunc, UINT16 mask) { internal_set_handler(device, tag, rfunc, wfunc, mask); }
r17961r17962
312282   void set_handler(read32_space_func func, const char *string) { internal_set_handler(func, string, 0); }
313283   void set_handler(write32_space_func func, const char *string) { internal_set_handler(func, string, 0); }
314284   void set_handler(read32_space_func rfunc, const char *rstring, write32_space_func wfunc, const char *wstring) { internal_set_handler(rfunc, rstring, wfunc, wstring, 0); }
315   void set_handler(const device_t &device, const char *tag, read32_device_func func, const char *string) { internal_set_handler(device, tag, func, string, 0); }
316   void set_handler(const device_t &device, const char *tag, write32_device_func func, const char *string) { internal_set_handler(device, tag, func, string, 0); }
317   void set_handler(const device_t &device, const char *tag, read32_device_func rfunc, const char *rstring, write32_device_func wfunc, const char *wstring) { internal_set_handler(device, tag, rfunc, rstring, wfunc, wstring, 0); }
318285   void set_handler(const device_t &device, const char *tag, read32_delegate func) { internal_set_handler(device, tag, func, 0); }
319286   void set_handler(const device_t &device, const char *tag, write32_delegate func) { internal_set_handler(device, tag, func, 0); }
320287   void set_handler(const device_t &device, const char *tag, read32_delegate rfunc, write32_delegate wfunc) { internal_set_handler(device, tag, rfunc, wfunc, 0); }
r17961r17962
323290   void set_handler(read16_space_func func, const char *string, UINT32 mask) { internal_set_handler(func, string, mask); }
324291   void set_handler(write16_space_func func, const char *string, UINT32 mask) { internal_set_handler(func, string, mask); }
325292   void set_handler(read16_space_func rfunc, const char *rstring, write16_space_func wfunc, const char *wstring, UINT32 mask) { internal_set_handler(rfunc, rstring, wfunc, wstring, mask); }
326   void set_handler(const device_t &device, const char *tag, read16_device_func func, const char *string, UINT32 mask) { internal_set_handler(device, tag, func, string, mask); }
327   void set_handler(const device_t &device, const char *tag, write16_device_func func, const char *string, UINT32 mask) { internal_set_handler(device, tag, func, string, mask); }
328   void set_handler(const device_t &device, const char *tag, read16_device_func rfunc, const char *rstring, write16_device_func wfunc, const char *wstring, UINT32 mask) { internal_set_handler(device, tag, rfunc, rstring, wfunc, wstring, mask); }
329293   void set_handler(const device_t &device, const char *tag, read16_delegate func, UINT32 mask) { internal_set_handler(device, tag, func, mask); }
330294   void set_handler(const device_t &device, const char *tag, write16_delegate func, UINT32 mask) { internal_set_handler(device, tag, func, mask); }
331295   void set_handler(const device_t &device, const char *tag, read16_delegate rfunc, write16_delegate wfunc, UINT32 mask) { internal_set_handler(device, tag, rfunc, wfunc, mask); }
r17961r17962
334298   void set_handler(read8_space_func func, const char *string, UINT32 mask) { internal_set_handler(func, string, mask); }
335299   void set_handler(write8_space_func func, const char *string, UINT32 mask) { internal_set_handler(func, string, mask); }
336300   void set_handler(read8_space_func rfunc, const char *rstring, write8_space_func wfunc, const char *wstring, UINT32 mask) { internal_set_handler(rfunc, rstring, wfunc, wstring, mask); }
337   void set_handler(const device_t &device, const char *tag, read8_device_func func, const char *string, UINT32 mask) { internal_set_handler(device, tag, func, string, mask); }
338   void set_handler(const device_t &device, const char *tag, write8_device_func func, const char *string, UINT32 mask) { internal_set_handler(device, tag, func, string, mask); }
339   void set_handler(const device_t &device, const char *tag, read8_device_func rfunc, const char *rstring, write8_device_func wfunc, const char *wstring, UINT32 mask) { internal_set_handler(device, tag, rfunc, rstring, wfunc, wstring, mask); }
340301   void set_handler(const device_t &device, const char *tag, read8_delegate func, UINT32 mask) { internal_set_handler(device, tag, func, mask); }
341302   void set_handler(const device_t &device, const char *tag, write8_delegate func, UINT32 mask) { internal_set_handler(device, tag, func, mask); }
342303   void set_handler(const device_t &device, const char *tag, read8_delegate rfunc, write8_delegate wfunc, UINT32 mask) { internal_set_handler(device, tag, rfunc, wfunc, mask); }
r17961r17962
357318   void set_handler(read64_space_func func, const char *string) { internal_set_handler(func, string, 0); }
358319   void set_handler(write64_space_func func, const char *string) { internal_set_handler(func, string, 0); }
359320   void set_handler(read64_space_func rfunc, const char *rstring, write64_space_func wfunc, const char *wstring) { internal_set_handler(rfunc, rstring, wfunc, wstring, 0); }
360   void set_handler(const device_t &device, const char *tag, read64_device_func func, const char *string) { internal_set_handler(device, tag, func, string, 0); }
361   void set_handler(const device_t &device, const char *tag, write64_device_func func, const char *string) { internal_set_handler(device, tag, func, string, 0); }
362   void set_handler(const device_t &device, const char *tag, read64_device_func rfunc, const char *rstring, write64_device_func wfunc, const char *wstring) { internal_set_handler(device, tag, rfunc, rstring, wfunc, wstring, 0); }
363321   void set_handler(const device_t &device, const char *tag, read64_delegate func) { internal_set_handler(device, tag, func, 0); }
364322   void set_handler(const device_t &device, const char *tag, write64_delegate func) { internal_set_handler(device, tag, func, 0); }
365323   void set_handler(const device_t &device, const char *tag, read64_delegate rfunc, write64_delegate wfunc) { internal_set_handler(device, tag, rfunc, wfunc, 0); }
r17961r17962
368326   void set_handler(read32_space_func func, const char *string, UINT64 mask) { internal_set_handler(func, string, mask); }
369327   void set_handler(write32_space_func func, const char *string, UINT64 mask) { internal_set_handler(func, string, mask); }
370328   void set_handler(read32_space_func rfunc, const char *rstring, write32_space_func wfunc, const char *wstring, UINT64 mask) { internal_set_handler(rfunc, rstring, wfunc, wstring, mask); }
371   void set_handler(const device_t &device, const char *tag, read32_device_func func, const char *string, UINT64 mask) { internal_set_handler(device, tag, func, string, mask); }
372   void set_handler(const device_t &device, const char *tag, write32_device_func func, const char *string, UINT64 mask) { internal_set_handler(device, tag, func, string, mask); }
373   void set_handler(const device_t &device, const char *tag, read32_device_func rfunc, const char *rstring, write32_device_func wfunc, const char *wstring, UINT64 mask) { internal_set_handler(device, tag, rfunc, rstring, wfunc, wstring, mask); }
374329   void set_handler(const device_t &device, const char *tag, read32_delegate func, UINT64 mask) { internal_set_handler(device, tag, func, mask); }
375330   void set_handler(const device_t &device, const char *tag, write32_delegate func, UINT64 mask) { internal_set_handler(device, tag, func, mask); }
376331   void set_handler(const device_t &device, const char *tag, read32_delegate rfunc, write32_delegate wfunc, UINT64 mask) { internal_set_handler(device, tag, rfunc, wfunc, mask); }
r17961r17962
379334   void set_handler(read16_space_func func, const char *string, UINT64 mask) { internal_set_handler(func, string, mask); }
380335   void set_handler(write16_space_func func, const char *string, UINT64 mask) { internal_set_handler(func, string, mask); }
381336   void set_handler(read16_space_func rfunc, const char *rstring, write16_space_func wfunc, const char *wstring, UINT64 mask) { internal_set_handler(rfunc, rstring, wfunc, wstring, mask); }
382   void set_handler(const device_t &device, const char *tag, read16_device_func func, const char *string, UINT64 mask) { internal_set_handler(device, tag, func, string, mask); }
383   void set_handler(const device_t &device, const char *tag, write16_device_func func, const char *string, UINT64 mask) { internal_set_handler(device, tag, func, string, mask); }
384   void set_handler(const device_t &device, const char *tag, read16_device_func rfunc, const char *rstring, write16_device_func wfunc, const char *wstring, UINT64 mask) { internal_set_handler(device, tag, rfunc, rstring, wfunc, wstring, mask); }
385337   void set_handler(const device_t &device, const char *tag, read16_delegate func, UINT64 mask) { internal_set_handler(device, tag, func, mask); }
386338   void set_handler(const device_t &device, const char *tag, write16_delegate func, UINT64 mask) { internal_set_handler(device, tag, func, mask); }
387339   void set_handler(const device_t &device, const char *tag, read16_delegate rfunc, write16_delegate wfunc, UINT64 mask) { internal_set_handler(device, tag, rfunc, wfunc, mask); }
r17961r17962
390342   void set_handler(read8_space_func func, const char *string, UINT64 mask) { internal_set_handler(func, string, mask); }
391343   void set_handler(write8_space_func func, const char *string, UINT64 mask) { internal_set_handler(func, string, mask); }
392344   void set_handler(read8_space_func rfunc, const char *rstring, write8_space_func wfunc, const char *wstring, UINT64 mask) { internal_set_handler(rfunc, rstring, wfunc, wstring, mask); }
393   void set_handler(const device_t &device, const char *tag, read8_device_func func, const char *string, UINT64 mask) { internal_set_handler(device, tag, func, string, mask); }
394   void set_handler(const device_t &device, const char *tag, write8_device_func func, const char *string, UINT64 mask) { internal_set_handler(device, tag, func, string, mask); }
395   void set_handler(const device_t &device, const char *tag, read8_device_func rfunc, const char *rstring, write8_device_func wfunc, const char *wstring, UINT64 mask) { internal_set_handler(device, tag, rfunc, rstring, wfunc, wstring, mask); }
396345   void set_handler(const device_t &device, const char *tag, read8_delegate func, UINT64 mask) { internal_set_handler(device, tag, func, mask); }
397346   void set_handler(const device_t &device, const char *tag, write8_delegate func, UINT64 mask) { internal_set_handler(device, tag, func, mask); }
398347   void set_handler(const device_t &device, const char *tag, read8_delegate rfunc, write8_delegate wfunc, UINT64 mask) { internal_set_handler(device, tag, rfunc, wfunc, mask); }
r17961r17962
546495
547496// legacy device reads
548497#define AM_DEVREAD_LEGACY(_tag, _handler) \
549   curentry->set_handler(device, _tag, _handler, #_handler); \
498   curentry->set_handler(device, _tag, read_delegate(&_handler, #_handler, (device_t *)0)); \
550499
551500#define AM_DEVREAD8_LEGACY(_tag, _handler, _unitmask) \
552   curentry->set_handler(device, _tag, _handler, #_handler, _unitmask); \
501   curentry->set_handler(device, _tag, read8_delegate(&_handler, #_handler, (device_t *)0), _unitmask); \
553502
554503
555504
556505
557506// legacy device writes
558507#define AM_DEVWRITE_LEGACY(_tag, _handler) \
559   curentry->set_handler(device, _tag, _handler, #_handler); \
508   curentry->set_handler(device, _tag, write_delegate(&_handler, #_handler, (device_t *)0)); \
560509
561510#define AM_DEVWRITE8_LEGACY(_tag, _handler, _unitmask) \
562   curentry->set_handler(device, _tag, _handler, #_handler, _unitmask); \
511   curentry->set_handler(device, _tag, write8_delegate(&_handler, #_handler, (device_t *)0), _unitmask); \
563512
564513#define AM_DEVWRITE16_LEGACY(_tag, _handler, _unitmask) \
565   curentry->set_handler(device, _tag, _handler, #_handler, _unitmask); \
514   curentry->set_handler(device, _tag, write16_delegate(&_handler, #_handler, (device_t *)0), _unitmask); \
566515
567516
568517
569518// legacy device reads/writes
570519#define AM_DEVREADWRITE_LEGACY(_tag, _rhandler, _whandler) \
571   curentry->set_handler(device, _tag, _rhandler, #_rhandler, _whandler, #_whandler); \
520   curentry->set_handler(device, _tag, read_delegate(&_rhandler, #_rhandler, (device_t *)0), write_delegate(&_whandler, #_whandler, (device_t *)0)); \
572521
573522#define AM_DEVREADWRITE8_LEGACY(_tag, _rhandler, _whandler, _unitmask) \
574   curentry->set_handler(device, _tag, _rhandler, #_rhandler, _whandler, #_whandler, _unitmask); \
523   curentry->set_handler(device, _tag, read8_delegate(&_rhandler, #_rhandler, (device_t *)0), write8_delegate(&_whandler, #_whandler, (device_t *)0), _unitmask); \
575524
576525#define AM_DEVREADWRITE16_LEGACY(_tag, _rhandler, _whandler, _unitmask) \
577   curentry->set_handler(device, _tag, _rhandler, #_rhandler, _whandler, #_whandler, _unitmask); \
526   curentry->set_handler(device, _tag, read16_delegate(&_rhandler, #_rhandler, (device_t *)0), write16_delegate(&_whandler, #_whandler, (device_t *)0), _unitmask); \
578527
579528#define AM_DEVREADWRITE32_LEGACY(_tag, _rhandler, _whandler, _unitmask) \
580   curentry->set_handler(device, _tag, _rhandler, #_rhandler, _whandler, #_whandler, _unitmask); \
529   curentry->set_handler(device, _tag, read32_delegate(&_rhandler, #_rhandler, (device_t *)0), write32_delegate(&_whandler, #_whandler, (device_t *)0), _unitmask); \
581530
582531
583532// driver data reads
trunk/src/emu/driver.c
r17961r17962
5151
5252driver_device::driver_device(const machine_config &mconfig, device_type type, const char *tag)
5353   : device_t(mconfig, type, "Driver Device", tag, NULL, 0),
54     device_memory_interface(mconfig, *this),
5455     m_generic_paletteram_8(*this, "paletteram"),
5556     m_generic_paletteram2_8(*this, "paletteram2"),
5657     m_generic_paletteram_16(*this, "paletteram"),
r17961r17962
5859     m_generic_paletteram_32(*this, "paletteram"),
5960     m_generic_paletteram2_32(*this, "paletteram2"),
6061     m_system(NULL),
62     m_generic_space_config("generic", ENDIANNESS_LITTLE, 8, 8),
6163     m_latch_clear_value(0),
6264     m_flip_screen_x(0),
6365     m_flip_screen_y(0)
r17961r17962
313315}
314316
315317
318//-------------------------------------------------
319//  memory_space_config - return a description of
320//  any address spaces owned by this device
321//-------------------------------------------------
316322
323const address_space_config *driver_device::memory_space_config(address_spacenum spacenum) const
324{
325   return (spacenum == 0) ? &m_generic_space_config : NULL;
326}
327
328
329
317330//**************************************************************************
318331//  INTERRUPT ENABLE AND VECTOR HELPERS
319332//**************************************************************************
trunk/src/emu/driver.h
r17961r17962
166166// ======================> driver_device
167167
168168// base class for machine driver-specific devices
169class driver_device : public device_t
169class driver_device :    public device_t,
170                  public device_memory_interface
170171{
171172public:
172173   // construction/destruction
r17961r17962
201202      (machine.driver_data<_DriverClass>()->*_Function)();
202203   }
203204
204   void init_0() {};
205   // dummy driver_init callbacks
206   void init_0() { }
207   
208   // memory helpers
209   address_space &generic_space() const { return *space(AS_PROGRAM); }
205210
206211   // generic interrupt generators
207212   void generic_pulse_irq_line(device_execute_interface &exec, int irqline, int cycles);
r17961r17962
399404   virtual void device_start();
400405   virtual void device_reset_after_children();
401406
407   // device_memory_interface overrides
408   virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const;
409
402410   // internal helpers
403411   inline UINT16 paletteram16_le(offs_t offset) const { return m_generic_paletteram_8[offset & ~1] | (m_generic_paletteram_8[offset |  1] << 8); }
404412   inline UINT16 paletteram16_be(offs_t offset) const { return m_generic_paletteram_8[offset |  1] | (m_generic_paletteram_8[offset & ~1] << 8); }
r17961r17962
425433   driver_callback_delegate m_callbacks[CB_COUNT];      // start/reset callbacks
426434   legacy_callback_func   m_legacy_callbacks[CB_COUNT]; // legacy start/reset callbacks
427435
436   // memory state
437   address_space_config   m_generic_space_config;
438
428439   // generic audio
429440   UINT16               m_latch_clear_value;
430441   UINT16               m_latched_value[4];
trunk/src/emu/dimemory.c
r17961r17962
323323            }
324324
325325            // make sure all devices exist
326            if (entry->m_read.m_type == AMH_LEGACY_DEVICE_HANDLER && entry->m_read.m_tag && device().siblingdevice(entry->m_read.m_tag) == NULL)
326            if (entry->m_read.m_type == AMH_DEVICE_DELEGATE && entry->m_read.m_tag && device().siblingdevice(entry->m_read.m_tag) == NULL)
327327               mame_printf_error("%s space memory map entry references nonexistant device '%s'\n", spaceconfig->m_name, entry->m_read.m_tag.cstr());
328            if (entry->m_write.m_type == AMH_LEGACY_DEVICE_HANDLER && entry->m_write.m_tag && device().siblingdevice(entry->m_write.m_tag) == NULL)
328            if (entry->m_write.m_type == AMH_DEVICE_DELEGATE && entry->m_write.m_tag && device().siblingdevice(entry->m_write.m_tag) == NULL)
329329               mame_printf_error("%s space memory map entry references nonexistant device '%s'\n", spaceconfig->m_name, entry->m_write.m_tag.cstr());
330330
331331            // make sure ports exist
trunk/src/mess/audio/mea8000.c
r17961r17962
102102
103103   emu_timer *timer;
104104
105   devcb_resolved_write8 req_out;
105106};
106107
107108
r17961r17962
206207       buffer contains a complete frame and the CPU nees to wait for the next
207208       frame end to compose a new frame.
208209    */
209   if (mea8000->iface->req_out_func)
210      mea8000->iface->req_out_func( device, 0, mea8000_accept_byte( mea8000 ) );
210   if (!mea8000->req_out.isnull())
211      mea8000->req_out( 0, mea8000_accept_byte( mea8000 ) );
211212}
212213
213214
r17961r17962
668669   mea8000_t* mea8000 = get_safe_token( device );
669670   int i;
670671   mea8000->iface = (const mea8000_interface*)device->static_config();
672   mea8000->req_out.resolve(mea8000->iface->req_out_func, *device);
671673
672674   mea8000_init_tables(device->machine());
673675
trunk/src/mess/audio/upd1771.h
r17961r17962
5454    PROTOTYPES
5555***************************************************************************/
5656
57WRITE8_DEVICE_HANDLER( upd1771_w );
57DECLARE_WRITE8_DEVICE_HANDLER( upd1771_w );
5858WRITE_LINE_DEVICE_HANDLER( upd1771_pcm_w );
5959
6060#endif /* __UPD1771_H__ */
trunk/src/mess/audio/mea8000.h
r17961r17962
4040   const char *           channel;
4141
4242   /* 1-bit 'ready' output, not negated */
43   write8_device_func req_out_func;
43   devcb_write8 req_out_func;
4444};
4545
4646
r17961r17962
4949   MCFG_DEVICE_CONFIG(_intrf)
5050
5151/* interface to CPU via address/data bus*/
52extern READ8_DEVICE_HANDLER  ( mea8000_r );
53extern WRITE8_DEVICE_HANDLER ( mea8000_w );
52extern DECLARE_READ8_DEVICE_HANDLER  ( mea8000_r );
53extern DECLARE_WRITE8_DEVICE_HANDLER ( mea8000_w );
5454
5555#endif
trunk/src/mess/audio/dave.c
r17961r17962
183183   for (i = 0; i < 32; i++)
184184      dave->Regs[i] = 0;
185185
186   dave_reg_w(device, 0x10, 0);
187   dave_reg_w(device, 0x11, 0);
188   dave_reg_w(device, 0x12, 0);
189   dave_reg_w(device, 0x13, 0);
186   address_space &space = device->machine().driver_data()->generic_space();
187   dave_reg_w(device, space, 0x10, 0);
188   dave_reg_w(device, space, 0x11, 0);
189   dave_reg_w(device, space, 0x12, 0);
190   dave_reg_w(device, space, 0x13, 0);
190191
191192}
192193
r17961r17962
615616
616617   logerror("dave w: %04x %02x\n",offset,data);
617618
618   dave_sound_w(device, offset, data);
619   dave_sound_w(device, space, offset, data, mem_mask);
619620
620621   dave->Regs[offset & 0x01f] = data;
621622
trunk/src/mess/audio/dave.h
r17961r17962
7373***************************************************************************/
7474void dave_set_reg(device_t *device, offs_t offset, UINT8 data);
7575
76READ8_DEVICE_HANDLER ( dave_reg_r );
77WRITE8_DEVICE_HANDLER ( dave_reg_w );
76DECLARE_READ8_DEVICE_HANDLER ( dave_reg_r );
77DECLARE_WRITE8_DEVICE_HANDLER ( dave_reg_w );
7878
7979#endif /* __DAVE_H__ */
trunk/src/mess/audio/t6721.h
r17961r17962
3939
4040/*----------- defined in audio/t6721.c -----------*/
4141
42WRITE8_DEVICE_HANDLER(t6721_speech_w);
43READ8_DEVICE_HANDLER(t6721_speech_r);
42DECLARE_WRITE8_DEVICE_HANDLER(t6721_speech_w);
43DECLARE_READ8_DEVICE_HANDLER(t6721_speech_r);
4444
4545
4646#endif /* __TED7360_H__ */
trunk/src/mess/audio/gb.h
r17961r17962
2222extern const device_type GAMEBOY;
2323
2424
25READ8_DEVICE_HANDLER( gb_sound_r );
26WRITE8_DEVICE_HANDLER( gb_sound_w );
27READ8_DEVICE_HANDLER( gb_wave_r );
28WRITE8_DEVICE_HANDLER( gb_wave_w );
25DECLARE_READ8_DEVICE_HANDLER( gb_sound_r );
26DECLARE_WRITE8_DEVICE_HANDLER( gb_sound_w );
27DECLARE_READ8_DEVICE_HANDLER( gb_wave_r );
28DECLARE_WRITE8_DEVICE_HANDLER( gb_wave_w );
trunk/src/mess/machine/omti8621.h
r17961r17962
3939 FUNCTION PROTOTYPES
4040 ***************************************************************************/
4141
42READ16_DEVICE_HANDLER( omti8621_r );
43WRITE16_DEVICE_HANDLER( omti8621_w );
42DECLARE_READ16_DEVICE_HANDLER( omti8621_r );
43DECLARE_WRITE16_DEVICE_HANDLER( omti8621_w );
4444
4545void omti8621_set_verbose(int on_off);
4646
trunk/src/mess/machine/dgn_beta.c
r17961r17962
113113
114114/* Debugging variables */
115115
116static READ8_DEVICE_HANDLER(d_pia0_pa_r);
117static WRITE8_DEVICE_HANDLER(d_pia0_pa_w);
118static READ8_DEVICE_HANDLER(d_pia0_pb_r);
119static WRITE8_DEVICE_HANDLER(d_pia0_pb_w);
120static WRITE8_DEVICE_HANDLER(d_pia0_cb2_w);
116static DECLARE_READ8_DEVICE_HANDLER(d_pia0_pa_r);
117static DECLARE_WRITE8_DEVICE_HANDLER(d_pia0_pa_w);
118static DECLARE_READ8_DEVICE_HANDLER(d_pia0_pb_r);
119static DECLARE_WRITE8_DEVICE_HANDLER(d_pia0_pb_w);
120static DECLARE_WRITE8_DEVICE_HANDLER(d_pia0_cb2_w);
121121static WRITE_LINE_DEVICE_HANDLER(d_pia0_irq_a);
122122static WRITE_LINE_DEVICE_HANDLER(d_pia0_irq_b);
123static READ8_DEVICE_HANDLER(d_pia1_pa_r);
124static WRITE8_DEVICE_HANDLER(d_pia1_pa_w);
125static READ8_DEVICE_HANDLER(d_pia1_pb_r);
126static WRITE8_DEVICE_HANDLER(d_pia1_pb_w);
123static DECLARE_READ8_DEVICE_HANDLER(d_pia1_pa_r);
124static DECLARE_WRITE8_DEVICE_HANDLER(d_pia1_pa_w);
125static DECLARE_READ8_DEVICE_HANDLER(d_pia1_pb_r);
126static DECLARE_WRITE8_DEVICE_HANDLER(d_pia1_pb_w);
127127static WRITE_LINE_DEVICE_HANDLER(d_pia1_irq_a);
128128static WRITE_LINE_DEVICE_HANDLER(d_pia1_irq_b);
129static READ8_DEVICE_HANDLER(d_pia2_pa_r);
130static WRITE8_DEVICE_HANDLER(d_pia2_pa_w);
131static READ8_DEVICE_HANDLER(d_pia2_pb_r);
132static WRITE8_DEVICE_HANDLER(d_pia2_pb_w);
129static DECLARE_READ8_DEVICE_HANDLER(d_pia2_pa_r);
130static DECLARE_WRITE8_DEVICE_HANDLER(d_pia2_pa_w);
131static DECLARE_READ8_DEVICE_HANDLER(d_pia2_pb_r);
132static DECLARE_WRITE8_DEVICE_HANDLER(d_pia2_pb_w);
133133static WRITE_LINE_DEVICE_HANDLER(d_pia2_irq_a);
134134static WRITE_LINE_DEVICE_HANDLER(d_pia2_irq_b);
135135
r17961r17962
939939   switch(offset & 0x03)
940940   {
941941      case 0:
942         result = wd17xx_status_r(fdc, 0);
942         result = wd17xx_status_r(fdc, *space, 0);
943943         LOG_DISK(("Disk status=%2.2X\n",result));
944944         break;
945945      case 1:
946         result = wd17xx_track_r(fdc, 0);
946         result = wd17xx_track_r(fdc, *space, 0);
947947         break;
948948      case 2:
949         result = wd17xx_sector_r(fdc, 0);
949         result = wd17xx_sector_r(fdc, *space, 0);
950950         break;
951951      case 3:
952         result = wd17xx_data_r(fdc, 0);
952         result = wd17xx_data_r(fdc, *space, 0);
953953         break;
954954      default:
955955         break;
r17961r17962
972972         /* But only for Type 3/4 commands */
973973         if(data & 0x80)
974974            wd17xx_set_side(fdc,(data & 0x02) ? 1 : 0);
975         wd17xx_command_w(fdc, 0, data);
975         wd17xx_command_w(fdc, *space, 0, data);
976976         break;
977977      case 1:
978         wd17xx_track_w(fdc, 0, data);
978         wd17xx_track_w(fdc, *space, 0, data);
979979         break;
980980      case 2:
981         wd17xx_sector_w(fdc, 0, data);
981         wd17xx_sector_w(fdc, *space, 0, data);
982982         break;
983983      case 3:
984         wd17xx_data_w(fdc, 0, data);
984         wd17xx_data_w(fdc, *space, 0, data);
985985         break;
986986   };
987987}
trunk/src/mess/machine/s100_wunderbus.c
r17961r17962
327327//  s100_sinp_r - I/O read
328328//-------------------------------------------------
329329
330UINT8 s100_wunderbus_device::s100_sinp_r(offs_t offset)
330UINT8 s100_wunderbus_device::s100_sinp_r(address_space &space, offs_t offset)
331331{
332332   UINT8 address = (ioport("7C")->read() & 0x3e) << 2;
333333   if ((offset & 0xf8) != address) return 0;
r17961r17962
406406
407407         case 4: // 8259 0 register
408408         case 5: // 8259 1 register
409            data = pic8259_r(m_pic, offset & 0x01);
409            data = pic8259_r(m_pic, space, offset & 0x01);
410410            break;
411411
412412         case 6: // not used
r17961r17962
436436//  s100_sout_w - I/O write
437437//-------------------------------------------------
438438
439void s100_wunderbus_device::s100_sout_w(offs_t offset, UINT8 data)
439void s100_wunderbus_device::s100_sout_w(address_space &space, offs_t offset, UINT8 data)
440440{
441441   UINT8 address = (ioport("7C")->read() & 0x3e) << 2;
442442   if ((offset & 0xf8) != address) return;
r17961r17962
515515
516516         case 4: // 8259 0 register
517517         case 5: // 8259 1 register
518            pic8259_w(m_pic, offset & 0x01, data);
518            pic8259_w(m_pic, space, offset & 0x01, data);
519519            break;
520520
521521         case 6: // Par. port cntrl.
trunk/src/mess/machine/a2mockingboard.c
r17961r17962
300300{
301301    if (!(data & 4))
302302    {
303        ay8910_reset_w(m_ay1, 0, 0);
303        ay8910_reset_w(m_ay1, space, 0, 0);
304304        if (m_isPhasor && m_PhasorNative)
305305        {
306            ay8910_reset_w(m_ay2, 0, 0);
306            ay8910_reset_w(m_ay2, space, 0, 0);
307307        }
308308    }
309309    else
r17961r17962
316316                    break;
317317
318318                case 1: // BDIR=0, BC1=1 (read PSG)
319                    m_porta1 = ay8910_r(m_ay1, 0);
319                    m_porta1 = ay8910_r(m_ay1, space, 0);
320320                    break;
321321
322322                case 2: // BDIR=1, BC1=0 (write PSG)
323                    ay8910_data_w(m_ay1, 0, m_porta1);
323                    ay8910_data_w(m_ay1, space, 0, m_porta1);
324324                    break;
325325
326326                case 3: // BDIR=1, BC1=1 (latch)
327                    ay8910_address_w(m_ay1, 0, m_porta1);
327                    ay8910_address_w(m_ay1, space, 0, m_porta1);
328328                    break;
329329            }
330330        }
r17961r17962
350350                case 1: // BDIR=0, BC1=1 (read PSG)
351351                    if (chipSel & 1)
352352                    {
353                        m_porta1 = ay8910_r(m_ay1, 0);
353                        m_porta1 = ay8910_r(m_ay1, space, 0);
354354                    }
355355                    if (chipSel & 2)
356356                    {
357                        m_porta1 = ay8910_r(m_ay2, 0);
357                        m_porta1 = ay8910_r(m_ay2, space, 0);
358358                    }
359359                    break;
360360
361361                case 2: // BDIR=1, BC1=0 (write PSG)
362362                    if (chipSel & 1)
363363                    {
364                        ay8910_data_w(m_ay1, 0, m_porta1);
364                        ay8910_data_w(m_ay1, space, 0, m_porta1);
365365                    }
366366                    if (chipSel & 2)
367367                    {
368                        ay8910_data_w(m_ay2, 0, m_porta1);
368                        ay8910_data_w(m_ay2, space, 0, m_porta1);
369369                    }
370370                    break;
371371
372372                case 3: // BDIR=1, BC1=1 (latch)
373373                    if (chipSel & 1)
374374                    {
375                        ay8910_address_w(m_ay1, 0, m_porta1);
375                        ay8910_address_w(m_ay1, space, 0, m_porta1);
376376                    }
377377                    if (chipSel & 2)
378378                    {
379                        ay8910_address_w(m_ay2, 0, m_porta1);
379                        ay8910_address_w(m_ay2, space, 0, m_porta1);
380380                    }
381381                    break;
382382            }
r17961r17962
405405    {
406406        if (m_isPhasor && m_PhasorNative)
407407        {
408            ay8910_reset_w(m_ay3, 0, 0);
409            ay8910_reset_w(m_ay4, 0, 0);
408            ay8910_reset_w(m_ay3, space, 0, 0);
409            ay8910_reset_w(m_ay4, space, 0, 0);
410410        }
411411        else
412412        {
413            ay8910_reset_w(m_ay2, 0, 0);
413            ay8910_reset_w(m_ay2, space, 0, 0);
414414        }
415415    }
416416    else
r17961r17962
423423                    break;
424424
425425                case 1: // BDIR=0, BC1=1 (read PSG)
426                    m_porta2 = ay8910_r(m_ay2, 0);
426                    m_porta2 = ay8910_r(m_ay2, space, 0);
427427                    break;
428428
429429                case 2: // BDIR=1, BC1=0 (write PSG)
430                    ay8910_data_w(m_ay2, 0, m_porta2);
430                    ay8910_data_w(m_ay2, space, 0, m_porta2);
431431                    break;
432432
433433                case 3: // BDIR=1, BC1=1 (latch)
434                    ay8910_address_w(m_ay2, 0, m_porta2);
434                    ay8910_address_w(m_ay2, space, 0, m_porta2);
435435                    break;
436436            }
437437        }
r17961r17962
457457                case 1: // BDIR=0, BC1=1 (read PSG)
458458                    if (chipSel & 1)
459459                    {
460                        m_porta2 = ay8910_r(m_ay3, 0);
460                        m_porta2 = ay8910_r(m_ay3, space, 0);
461461                    }
462462                    if (chipSel & 2)
463463                    {
464                        m_porta2 = ay8910_r(m_ay4, 0);
464                        m_porta2 = ay8910_r(m_ay4, space, 0);
465465                    }
466466                    break;
467467
468468                case 2: // BDIR=1, BC1=0 (write PSG)
469469                    if (chipSel & 1)
470470                    {
471                        ay8910_data_w(m_ay3, 0, m_porta2);
471                        ay8910_data_w(m_ay3, space, 0, m_porta2);
472472                    }
473473                    if (chipSel & 2)
474474                    {
475                        ay8910_data_w(m_ay4, 0, m_porta2);
475                        ay8910_data_w(m_ay4, space, 0, m_porta2);
476476                    }
477477                    break;
478478
479479                case 3: // BDIR=1, BC1=1 (latch)
480480                    if (chipSel & 1)
481481                    {
482                        ay8910_address_w(m_ay3, 0, m_porta2);
482                        ay8910_address_w(m_ay3, space, 0, m_porta2);
483483                    }
484484                    if (chipSel & 2)
485485                    {
486                        ay8910_address_w(m_ay4, 0, m_porta2);
486                        ay8910_address_w(m_ay4, space, 0, m_porta2);
487487                    }
488488                    break;
489489            }
trunk/src/mess/machine/apple3.c
r17961r17962
171171      case 0xE4: case 0xE5: case 0xE6: case 0xE7:
172172      case 0xE8: case 0xE9: case 0xEA: case 0xEB:
173173      case 0xEC: case 0xED: case 0xEE: case 0xEF:
174         result = applefdc_r(fdc, offset);
174         result = applefdc_r(fdc, space, offset);
175175         break;
176176
177177      case 0xF0:
r17961r17962
234234      case 0xE4: case 0xE5: case 0xE6: case 0xE7:
235235      case 0xE8: case 0xE9: case 0xEA: case 0xEB:
236236      case 0xEC: case 0xED: case 0xEE: case 0xEF:
237         applefdc_w(fdc, offset, data);
237         applefdc_w(fdc, space, offset, data);
238238         break;
239239
240240      case 0xF0:
trunk/src/mess/machine/s100_wunderbus.h
r17961r17962
5656   virtual void s100_vi0_w(int state);
5757   virtual void s100_vi1_w(int state);
5858   virtual void s100_vi2_w(int state);
59   virtual UINT8 s100_sinp_r(offs_t offset);
60   virtual void s100_sout_w(offs_t offset, UINT8 data);
59   virtual UINT8 s100_sinp_r(address_space &space, offs_t offset);
60   virtual void s100_sout_w(address_space &space, offs_t offset, UINT8 data);
6161   virtual bool s100_has_terminal() { return true; }
6262   virtual void s100_terminal_w(UINT8 data);
6363
trunk/src/mess/machine/isa_fdc.c
r17961r17962
1111#include "formats/pc_dsk.h"
1212#include "machine/idectrl.h"
1313
14static READ8_DEVICE_HANDLER ( pc_fdc_r );
15static WRITE8_DEVICE_HANDLER ( pc_fdc_w );
14static DECLARE_READ8_DEVICE_HANDLER ( pc_fdc_r );
15static DECLARE_WRITE8_DEVICE_HANDLER ( pc_fdc_w );
1616
1717/* if not 1, DACK and TC inputs to FDC are disabled, and DRQ and IRQ are held
1818 * at high impedance i.e they are not affective */
r17961r17962
353353      case 3: /* tape drive select? */
354354         break;
355355      case 4:
356         data = upd765_status_r(fdc->m_upd765, 0);
356         data = upd765_status_r(fdc->m_upd765, space, 0);
357357         break;
358358      case 5:
359         data = upd765_data_r(fdc->m_upd765, offset);
359         data = upd765_data_r(fdc->m_upd765, space, offset);
360360         break;
361361      case 6: /* FDC reserved */
362362         hdd = device->machine().device(":board3:ide:ide");
363363         if (hdd)
364            data = ide_controller16_r(hdd, 0x3f6/2, 0x00ff);
364            data = ide_controller16_r(hdd, space, 0x3f6/2, 0x00ff);
365365         break;
366366      case 7:
367367         device_t *dev = get_floppy_subdevice(device, fdc->digital_output_register & 0x03);
r17961r17962
392392      case 1:   /* n/a */
393393         break;
394394      case 2:
395         pc_fdc_dor_w(device, 0, data);
395         pc_fdc_dor_w(device, space, 0, data, mem_mask);
396396         break;
397397      case 3:
398398         /* tape drive select? */
399399         break;
400400      case 4:
401         pc_fdc_data_rate_w(device, 0, data);
401         pc_fdc_data_rate_w(device, space, 0, data, mem_mask);
402402         break;
403403      case 5:
404         upd765_data_w(fdc->m_upd765, 0, data);
404         upd765_data_w(fdc->m_upd765, space, 0, data);
405405         break;
406406      case 6:
407407         /* FDC reserved */
408408         hdd = device->machine().device(":board3:ide:ide");
409409         if (hdd)
410            ide_controller16_w(hdd, 0x3f6/2, data, 0x00ff);
410            ide_controller16_w(hdd, space, 0x3f6/2, data, 0x00ff);
411411         break;
412412      case 7:
413413         /* Configuration Control Register
r17961r17962
419419             *      1 0      250 kbps
420420             *      1 1     1000 kbps
421421             */
422         pc_fdc_data_rate_w(device, 0, data & 3);
422         pc_fdc_data_rate_w(device, space, 0, data & 3, mem_mask);
423423         break;
424424   }
425425}
r17961r17962
432432   /* if dma is not enabled, dacks are not acknowledged */
433433   if ((digital_output_register & PC_FDC_FLAGS_DOR_DMA_ENABLED)!=0)
434434   {
435      data = upd765_dack_r(m_upd765, 0);
435      data = upd765_dack_r(m_upd765, machine().driver_data()->generic_space(), 0);
436436   }
437437
438438   return data;
r17961r17962
444444   if ((digital_output_register & PC_FDC_FLAGS_DOR_DMA_ENABLED)!=0)
445445   {
446446      /* dma acknowledge - and send byte to fdc */
447      upd765_dack_w(m_upd765, 0,data);
447      upd765_dack_w(m_upd765, machine().driver_data()->generic_space(), 0,data);
448448   }
449449}
450450void isa8_fdc_device::eop_w(int state)
trunk/src/mess/machine/dai.c
r17961r17962
225225
226226READ8_MEMBER(dai_state::dai_pit_r)
227227{
228   return pit8253_r(m_pit, (offset>>1) & 3);
228   return pit8253_r(m_pit, space, (offset>>1) & 3);
229229}
230230
231231WRITE8_MEMBER(dai_state::dai_pit_w)
232232{
233   pit8253_w(m_pit, (offset>>1) & 3, data);
233   pit8253_w(m_pit, space, (offset>>1) & 3, data);
234234}
235235
236236/***************************************************************************
trunk/src/mess/machine/ataridev.h
r17961r17962
6767/***************************************************************************
6868    FUNCTION PROTOTYPES
6969***************************************************************************/
70READ8_DEVICE_HANDLER( atari_serin_r );
71WRITE8_DEVICE_HANDLER( atari_serout_w );
70DECLARE_READ8_DEVICE_HANDLER( atari_serin_r );
71DECLARE_WRITE8_DEVICE_HANDLER( atari_serout_w );
7272WRITE_LINE_DEVICE_HANDLER( atarifdc_pia_cb2_w );
7373
7474#endif /* _ATARIDEV_H */
trunk/src/mess/machine/msx_slot.c
r17961r17962
3131static void msx_cpu_setbank (running_machine &machine, int page, UINT8 *mem)
3232{
3333   msx_state *state = machine.driver_data<msx_state>();
34   address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
34   address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
3535   switch (page)
3636   {
3737   case 1:
r17961r17962
4646   case 4:
4747      state->membank ("bank4")->set_base (mem);
4848      state->membank ("bank5")->set_base (mem + 0x1ff8);
49      space->install_read_bank(0x7ff8, 0x7fff, "bank5");
49      space.install_read_bank(0x7ff8, 0x7fff, "bank5");
5050      break;
5151   case 5:
5252      state->membank ("bank6")->set_base (mem);
5353      state->membank ("bank7")->set_base (mem + 0x1800);
54      space->install_read_bank(0x9800, 0x9fff, "bank7");
54      space.install_read_bank(0x9800, 0x9fff, "bank7");
5555      break;
5656   case 6:
5757      state->membank ("bank8")->set_base (mem);
5858      state->membank ("bank9")->set_base (mem + 0x1800);
59      space->install_read_bank(0xb800, 0xbfff, "bank9");
59      space.install_read_bank(0xb800, 0xbfff, "bank9");
6060      break;
6161   case 7:
6262      state->membank ("bank10")->set_base (mem);
r17961r17962
353353   {
354354      if ((offset & 0xff) >= 0xe0)
355355      {
356         return k051649_test_r (space->machine().device("k051649"), offset & 0xff);
356         return k051649_test_r (space->machine().device("k051649"), *space, offset & 0xff);
357357      }
358358      return 0xff;
359359   }
360360   else
361361   {
362      return k051649_waveform_r (space->machine().device("k051649"), offset & 0x7f);
362      return k051649_waveform_r (space->machine().device("k051649"), *space, offset & 0x7f);
363363   }
364364}
365365
r17961r17962
393393MSX_SLOT_WRITE(konami_scc)
394394{
395395   msx_state *drvstate = machine.driver_data<msx_state>();
396   address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
396   address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
397397   if (addr >= 0x5000 && addr < 0x5800)
398398   {
399399      state->m_banks[0] = val & state->m_bank_mask;
r17961r17962
424424   }
425425   else if (state->m_cart.scc.active && addr >= 0x9800 && addr < 0xa000)
426426   {
427      device_t *k051649 = space->machine().device("k051649");
427      device_t *k051649 = space.machine().device("k051649");
428428      int offset = addr & 0xff;
429429
430430      if (offset < 0x80)
431431      {
432         k051649_waveform_w (k051649, offset, val);
432         k051649_waveform_w (k051649, space, offset, val);
433433      }
434434      else if (offset < 0xa0)
435435      {
436436         offset &= 0xf;
437437         if (offset < 0xa)
438438         {
439            k051649_frequency_w (k051649, offset, val);
439            k051649_frequency_w (k051649, space, offset, val);
440440         }
441441         else if (offset < 0xf)
442442         {
443            k051649_volume_w (k051649, offset - 0xa, val);
443            k051649_volume_w (k051649, space, offset - 0xa, val);
444444         }
445445         else
446446         {
447            k051649_keyonoff_w (k051649, 0, val);
447            k051649_keyonoff_w (k051649, space, 0, val);
448448         }
449449      }
450450      else if (offset >= 0xe0)
451451      {
452         k051649_test_w (k051649, offset, val);
452         k051649_test_w (k051649, space, offset, val);
453453      }
454454   }
455455   else if (addr >= 0xb000 && addr < 0xb800)
r17961r17962
12381238   device_t *fdc = space->machine().device("wd179x");
12391239   switch (offset)
12401240   {
1241   case 0: return wd17xx_status_r (fdc, 0);
1242   case 1: return wd17xx_track_r (fdc, 0);
1243   case 2: return wd17xx_sector_r (fdc, 0);
1244   case 3: return wd17xx_data_r (fdc, 0);
1241   case 0: return wd17xx_status_r (fdc, *space, 0);
1242   case 1: return wd17xx_track_r (fdc, *space, 0);
1243   case 2: return wd17xx_sector_r (fdc, *space, 0);
1244   case 3: return wd17xx_data_r (fdc, *space, 0);
12451245   case 7: return state->m_dsk_stat;
12461246   default:
12471247      return state->m_state[1]->m_mem[offset + 0x3ff8];
r17961r17962
12571257      switch (offset)
12581258      {
12591259      case 0x7f8:
1260         return wd17xx_status_r (fdc, 0);
1260         return wd17xx_status_r (fdc, *space, 0);
12611261      case 0x7f9:
1262         return wd17xx_track_r (fdc, 0);
1262         return wd17xx_track_r (fdc, *space, 0);
12631263      case 0x7fa:
1264         return wd17xx_sector_r (fdc, 0);
1264         return wd17xx_sector_r (fdc, *space, 0);
12651265      case 0x7fb:
1266         return wd17xx_data_r (fdc, 0);
1266         return wd17xx_data_r (fdc, *space, 0);
12671267      case 0x7ff:
12681268         return state->m_dsk_stat;
12691269      default:
r17961r17962
12791279MSX_SLOT_MAP(diskrom)
12801280{
12811281   msx_state *drvstate = machine.driver_data<msx_state>();
1282   address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
1282   address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
12831283   switch (page)
12841284   {
12851285   case 0:
r17961r17962
12891289   case 1:
12901290      msx_cpu_setbank (machine, 3, state->m_mem);
12911291      msx_cpu_setbank (machine, 4, state->m_mem + 0x2000);
1292      space->install_legacy_read_handler(0x7ff8, 0x7fff, FUNC(msx_diskrom_page1_r));
1292      space.install_legacy_read_handler(0x7ff8, 0x7fff, FUNC(msx_diskrom_page1_r));
12931293      break;
12941294   case 2:
12951295      msx_cpu_setbank (machine, 5, drvstate->m_empty);
12961296      msx_cpu_setbank (machine, 6, drvstate->m_empty);
1297      space->install_legacy_read_handler(0xb800, 0xbfff, FUNC(msx_diskrom_page2_r));
1297      space.install_legacy_read_handler(0xb800, 0xbfff, FUNC(msx_diskrom_page2_r));
12981298      break;
12991299   case 3:
13001300      msx_cpu_setbank (machine, 7, drvstate->m_empty);
r17961r17962
13061306MSX_SLOT_WRITE(diskrom)
13071307{
13081308   device_t *fdc = machine.device("wd179x");
1309   address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
13091310   if (addr >= 0xa000 && addr < 0xc000)
13101311   {
13111312      addr -= 0x4000;
r17961r17962
13131314   switch (addr)
13141315   {
13151316   case 0x7ff8:
1316      wd17xx_command_w (fdc, 0, val);
1317      wd17xx_command_w (fdc, space, 0, val);
13171318      break;
13181319   case 0x7ff9:
1319      wd17xx_track_w (fdc, 0, val);
1320      wd17xx_track_w (fdc, space, 0, val);
13201321      break;
13211322   case 0x7ffa:
1322      wd17xx_sector_w (fdc, 0, val);
1323      wd17xx_sector_w (fdc, space, 0, val);
13231324      break;
13241325   case 0x7ffb:
1325      wd17xx_data_w (fdc, 0, val);
1326      wd17xx_data_w (fdc, space, 0, val);
13261327      break;
13271328   case 0x7ffc:
13281329      wd17xx_set_side (fdc,val & 1);
r17961r17962
13661367   device_t *fdc = space->machine().device("wd179x");
13671368   switch (offset)
13681369   {
1369   case 0: return wd17xx_status_r(fdc, 0);
1370   case 1: return wd17xx_track_r(fdc, 0);
1371   case 2: return wd17xx_sector_r(fdc, 0);
1372   case 3: return wd17xx_data_r(fdc, 0);
1370   case 0: return wd17xx_status_r(fdc, *space, 0);
1371   case 1: return wd17xx_track_r(fdc, *space, 0);
1372   case 2: return wd17xx_sector_r(fdc, *space, 0);
1373   case 3: return wd17xx_data_r(fdc, *space, 0);
13731374   case 4: return state->m_dsk_stat;
13741375   default:
13751376      return state->m_state[1]->m_mem[offset + 0x3ff8];
r17961r17962
13851386      switch (offset)
13861387      {
13871388      case 0x7b8:
1388         return wd17xx_status_r (fdc, 0);
1389         return wd17xx_status_r (fdc, *space, 0);
13891390      case 0x7b9:
1390         return wd17xx_track_r (fdc, 0);
1391         return wd17xx_track_r (fdc, *space, 0);
13911392      case 0x7ba:
1392         return wd17xx_sector_r (fdc, 0);
1393         return wd17xx_sector_r (fdc, *space, 0);
13931394      case 0x7bb:
1394         return wd17xx_data_r (fdc, 0);
1395         return wd17xx_data_r (fdc, *space, 0);
13951396      case 0x7bc:
13961397         return state->m_dsk_stat;
13971398      default:
r17961r17962
14071408MSX_SLOT_MAP(diskrom2)
14081409{
14091410   msx_state *drvstate = machine.driver_data<msx_state>();
1410   address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
1411   address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
14111412   switch (page)
14121413   {
14131414   case 0:
r17961r17962
14171418   case 1:
14181419      msx_cpu_setbank (machine, 3, state->m_mem);
14191420      msx_cpu_setbank (machine, 4, state->m_mem + 0x2000);
1420      space->install_legacy_read_handler(0x7fb8, 0x7fbc, FUNC(msx_diskrom2_page1_r));
1421      space.install_legacy_read_handler(0x7fb8, 0x7fbc, FUNC(msx_diskrom2_page1_r));
14211422      break;
14221423   case 2:
14231424      msx_cpu_setbank (machine, 5, drvstate->m_empty);
14241425      msx_cpu_setbank (machine, 6, drvstate->m_empty);
1425      space->install_legacy_read_handler(0xb800, 0xbfbc, FUNC(msx_diskrom2_page2_r));
1426      space.install_legacy_read_handler(0xb800, 0xbfbc, FUNC(msx_diskrom2_page2_r));
14261427      break;
14271428   case 3:
14281429      msx_cpu_setbank (machine, 7, drvstate->m_empty);
r17961r17962
14331434MSX_SLOT_WRITE(diskrom2)
14341435{
14351436   device_t *fdc = machine.device("wd179x");
1437   address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
14361438   if (addr >= 0xa000 && addr < 0xc000)
14371439   {
14381440      addr -= 0x4000;
r17961r17962
14401442   switch (addr)
14411443   {
14421444   case 0x7fb8:
1443      wd17xx_command_w (fdc, 0, val);
1445      wd17xx_command_w (fdc, space, 0, val);
14441446      break;
14451447   case 0x7fb9:
1446      wd17xx_track_w (fdc, 0, val);
1448      wd17xx_track_w (fdc, space, 0, val);
14471449      break;
14481450   case 0x7fba:
1449      wd17xx_sector_w (fdc, 0, val);
1451      wd17xx_sector_w (fdc, space, 0, val);
14501452      break;
14511453   case 0x7fbb:
1452      wd17xx_data_w (fdc, 0, val);
1454      wd17xx_data_w (fdc, space, 0, val);
14531455      break;
14541456   case 0x7fbc:
14551457      wd17xx_set_side (fdc,val & 1);
r17961r17962
16831685MSX_SLOT_WRITE(fmpac)
16841686{
16851687   msx_state *drvstate = machine.driver_data<msx_state>();
1686   address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
1688   address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
16871689   int i, data;
16881690
16891691   if (addr >= 0x4000 && addr < 0x6000 && state->m_cart.fmpac.sram_support)
r17961r17962
17031705   case 0x7ff4:
17041706      if (state->m_cart.fmpac.opll_active)
17051707      {
1706         ym2413_w (space->machine().device("ay8910"), 0, val);
1708         ym2413_w (space.machine().device("ay8910"), space, 0, val);
17071709      }
17081710      break;
17091711   case 0x7ff5:
17101712      if (state->m_cart.fmpac.opll_active)
17111713      {
1712         ym2413_w (space->machine().device("ay8910"), 1, val);
1714         ym2413_w (space.machine().device("ay8910"), space, 1, val);
17131715      }
17141716      break;
17151717   case 0x7ff6:
r17961r17962
21962198
21972199   if (reg < 0x80)
21982200   {
2199      return k051649_waveform_r (space->machine().device("k051649"), reg);
2201      return k051649_waveform_r (space->machine().device("k051649"), *space, reg);
22002202   }
22012203   else if (reg < 0xa0)
22022204   {
r17961r17962
22052207   else if (reg < 0xc0)
22062208   {
22072209      /* read wave 5 */
2208      return k051649_waveform_r (space->machine().device("k051649"), 0x80 + (reg & 0x1f));
2210      return k051649_waveform_r (space->machine().device("k051649"), *space, 0x80 + (reg & 0x1f));
22092211   }
22102212   else if (reg < 0xe0)
22112213   {
2212      return k051649_test_r (space->machine().device("k051649"), reg);
2214      return k051649_test_r (space->machine().device("k051649"), *space, reg);
22132215   }
22142216
22152217   return 0xff;
r17961r17962
22302232
22312233   if (reg < 0xa0)
22322234   {
2233      return k052539_waveform_r (space->machine().device("k051649"), reg);
2235      return k052539_waveform_r (space->machine().device("k051649"), *space, reg);
22342236   }
22352237   else if (reg >= 0xc0 && reg < 0xe0)
22362238   {
2237      return k051649_test_r (space->machine().device("k051649"), reg);
2239      return k051649_test_r (space->machine().device("k051649"), *space, reg);
22382240   }
22392241
22402242   return 0xff;
r17961r17962
22422244
22432245MSX_SLOT_MAP(soundcartridge)
22442246{
2245   address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
2247   address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
22462248   switch (page)
22472249   {
22482250   case 0:
r17961r17962
22572259      msx_cpu_setbank (machine, 5, state->m_mem + state->m_banks[2] * 0x2000);
22582260      msx_cpu_setbank (machine, 6, state->m_mem + state->m_banks[3] * 0x2000);
22592261      if (state->m_cart.sccp.scc_active) {
2260         space->install_legacy_read_handler(0x9800, 0x9fff, FUNC(soundcartridge_scc));
2262         space.install_legacy_read_handler(0x9800, 0x9fff, FUNC(soundcartridge_scc));
22612263      } else {
2262         space->install_read_bank(0x9800, 0x9fff, "bank7");
2264         space.install_read_bank(0x9800, 0x9fff, "bank7");
22632265      }
22642266      if (state->m_cart.sccp.scc_active) {
2265         space->install_legacy_read_handler(0xb800, 0xbfff, FUNC(soundcartridge_sccp));
2267         space.install_legacy_read_handler(0xb800, 0xbfff, FUNC(soundcartridge_sccp));
22662268      } else {
2267         space->install_read_bank(0xb800, 0xbfff, "bank9");
2269         space.install_read_bank(0xb800, 0xbfff, "bank9");
22682270      }
22692271      break;
22702272   case 3:
r17961r17962
22772279MSX_SLOT_WRITE(soundcartridge)
22782280{
22792281   msx_state *drvstate = machine.driver_data<msx_state>();
2280   address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
2282   address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
22812283   int i;
22822284
22832285   if (addr < 0x4000)
r17961r17962
23392341      }
23402342      else if (addr >= 0x9800 && state->m_cart.sccp.scc_active)
23412343      {
2342         device_t *k051649 = space->machine().device("k051649");
2344         device_t *k051649 = space.machine().device("k051649");
23432345         int offset = addr & 0xff;
23442346
23452347         if (offset < 0x80)
23462348         {
2347            k051649_waveform_w (k051649, offset, val);
2349            k051649_waveform_w (k051649, space, offset, val);
23482350         }
23492351         else if (offset < 0xa0)
23502352         {
r17961r17962
23522354
23532355            if (offset < 0xa)
23542356            {
2355               k051649_frequency_w (k051649, offset, val);
2357               k051649_frequency_w (k051649, space, offset, val);
23562358            }
23572359            else if (offset < 0x0f)
23582360            {
2359               k051649_volume_w (k051649, offset - 0xa, val);
2361               k051649_volume_w (k051649, space, offset - 0xa, val);
23602362            }
23612363            else if (offset == 0x0f)
23622364            {
2363               k051649_keyonoff_w (k051649, 0, val);
2365               k051649_keyonoff_w (k051649, space, 0, val);
23642366            }
23652367         }
23662368         else if (offset < 0xe0)
23672369         {
2368            k051649_test_w (k051649, offset, val);
2370            k051649_test_w (k051649, space, offset, val);
23692371         }
23702372      }
23712373   }
r17961r17962
23892391      }
23902392      else if (addr >= 0xb800 && state->m_cart.sccp.sccp_active)
23912393      {
2392         device_t *k051649 = space->machine().device("k051649");
2394         device_t *k051649 = space.machine().device("k051649");
23932395         int offset = addr & 0xff;
23942396
23952397         if (offset < 0xa0)
23962398         {
2397            k052539_waveform_w (k051649, offset, val);
2399            k052539_waveform_w (k051649, space, offset, val);
23982400         }
23992401         else if (offset < 0xc0)
24002402         {
r17961r17962
24022404
24032405            if (offset < 0x0a)
24042406            {
2405               k051649_frequency_w (k051649, offset, val);
2407               k051649_frequency_w (k051649, space, offset, val);
24062408            }
24072409            else if (offset < 0x0f)
24082410            {
2409               k051649_volume_w (k051649, offset - 0x0a, val);
2411               k051649_volume_w (k051649, space, offset - 0x0a, val);
24102412            }
24112413            else if (offset == 0x0f)
24122414            {
2413               k051649_keyonoff_w (k051649, 0, val);
2415               k051649_keyonoff_w (k051649, space, 0, val);
24142416            }
24152417         }
24162418         else if (offset < 0xe0)
24172419         {
2418            k051649_test_w (k051649, offset, val);
2420            k051649_test_w (k051649, space, offset, val);
24192421         }
24202422      }
24212423   }
trunk/src/mess/machine/mos6530.h
r17961r17962
8282    PROTOTYPES
8383***************************************************************************/
8484
85READ8_DEVICE_HANDLER( mos6530_r );
86WRITE8_DEVICE_HANDLER( mos6530_w );
85DECLARE_READ8_DEVICE_HANDLER( mos6530_r );
86DECLARE_WRITE8_DEVICE_HANDLER( mos6530_w );
8787
8888void mos6530_porta_in_set(device_t *device, UINT8 data, UINT8 mask);
8989void mos6530_portb_in_set(device_t *device, UINT8 data, UINT8 mask);
trunk/src/mess/machine/mc6854.h
r17961r17962
8080
8181/* ---------- functions ------------ */
8282/* interface to CPU via address/data bus*/
83extern READ8_DEVICE_HANDLER  ( mc6854_r );
84extern WRITE8_DEVICE_HANDLER ( mc6854_w );
83extern DECLARE_READ8_DEVICE_HANDLER  ( mc6854_r );
84extern DECLARE_WRITE8_DEVICE_HANDLER ( mc6854_w );
8585
8686/* low-level, bit-based interface */
8787WRITE_LINE_DEVICE_HANDLER( mc6854_set_rx );
trunk/src/mess/machine/tvc_hbf.c
r17961r17962
154154   switch((offset>>2) & 0x03)
155155   {
156156      case 0x00:
157         return wd17xx_r(m_fdc, offset & 3);
157         return wd17xx_r(m_fdc, space, offset & 3);
158158      case 0x01:
159159         return (wd17xx_drq_r(m_fdc)<<7) | wd17xx_intrq_r(m_fdc);
160160      default:
r17961r17962
171171   switch((offset>>2) & 0x03)
172172   {
173173      case 0x00:
174         wd17xx_w(m_fdc, offset & 3, data);
174         wd17xx_w(m_fdc, space, offset & 3, data);
175175         break;
176176      case 0x01:
177177         // bit 0-3   drive select
trunk/src/mess/machine/mc6846.c
r17961r17962
5959   emu_timer *interval; /* interval programmable timer */
6060   emu_timer *one_shot; /* 1-us x factor one-shot timer */
6161
62   /* CPU write to the outside through chip */
63   devcb_resolved_write8 out_port;  /* 8-bit output */
64   devcb_resolved_write8 out_cp1;   /* 1-bit output */
65   devcb_resolved_write8 out_cp2;   /* 1-bit output */
66
67   /* CPU read from the outside through chip */
68   devcb_resolved_read8 in_port; /* 8-bit input */
69
70   /* asynchronous timer output to outside world */
71   devcb_resolved_write8 out_cto; /* 1-bit output */
72
73   /* timer interrupt */
74   devcb_resolved_write_line irq;
75
6276   int old_cif;
6377   int old_cto;
6478};
r17961r17962
7185
7286#define PORT                        \
7387   ((mc6846->pdr & mc6846->ddr) |               \
74    ((mc6846->iface->in_port_func ? mc6846->iface->in_port_func( device, 0 ) : 0) & \
88    ((!mc6846->in_port.isnull() ? mc6846->in_port( 0 ) : 0) & \
7589     ~mc6846->ddr))
7690
7791#define CTO                        \
r17961r17962
124138   if ( cif )
125139   {
126140      mc6846->csr |= 0x80;
127      if ( mc6846->iface->irq_func )
128         mc6846->iface->irq_func( device, 1 );
141      if ( !mc6846->irq.isnull() )
142         mc6846->irq( 1 );
129143   }
130144   else
131145   {
132146      mc6846->csr &= ~0x80;
133      if ( mc6846->iface->irq_func )
134         mc6846->iface->irq_func( device, 0 );
147      if ( !mc6846->irq.isnull() )
148         mc6846->irq( 0 );
135149   }
136150}
137151
r17961r17962
146160      LOG (( "%f: mc6846 CTO set to %i\n", device->machine().time().as_double(), cto ));
147161      mc6846->old_cto = cto;
148162   }
149   if ( mc6846->iface->out_cto_func )
150      mc6846->iface->out_cto_func( device, 0, cto );
163   if ( !mc6846->out_cto.isnull() )
164      mc6846->out_cto( 0, cto );
151165}
152166
153167
r17961r17962
372386      if (data & 0x10)
373387      {
374388         mc6846->cp2_cpu = (data >> 3) & 1;
375         if ( mc6846->iface->out_cp2_func )
376            mc6846->iface->out_cp2_func( device, 0, mc6846->cp2_cpu );
389         if ( !mc6846->out_cp2.isnull() )
390            mc6846->out_cp2( 0, mc6846->cp2_cpu );
377391      }
378392      else
379393         logerror( "$%04x mc6846 acknowledge not implemented\n", device->machine().firstcpu->pcbase( ) );
r17961r17962
385399      if ( ! (mc6846->pcr & 0x80) )
386400      {
387401         mc6846->ddr = data;
388         if ( mc6846->iface->out_port_func )
389            mc6846->iface->out_port_func( device, 0, mc6846->pdr & mc6846->ddr );
402         if ( !mc6846->out_port.isnull() )
403            mc6846->out_port( 0, mc6846->pdr & mc6846->ddr );
390404      }
391405      break;
392406
r17961r17962
395409      if ( ! (mc6846->pcr & 0x80) )
396410      {
397411         mc6846->pdr = data;
398         if ( mc6846->iface->out_port_func )
399            mc6846->iface->out_port_func( device, 0, mc6846->pdr & mc6846->ddr );
412         if ( !mc6846->out_port.isnull() )
413            mc6846->out_port( 0, mc6846->pdr & mc6846->ddr );
400414         if ( mc6846->csr1_to_be_cleared && (mc6846->csr & 2) )
401415         {
402416            mc6846->csr &= ~2;
r17961r17962
590604   mc6846->interval = device->machine().scheduler().timer_alloc(FUNC(mc6846_timer_expire), (void*) device );
591605   mc6846->one_shot = device->machine().scheduler().timer_alloc(FUNC(mc6846_timer_one_shot), (void*) device );
592606
607   mc6846->out_port.resolve(mc6846->iface->out_port_func, *device);  /* 8-bit output */
608   mc6846->out_cp1.resolve(mc6846->iface->out_cp1_func, *device);   /* 1-bit output */
609   mc6846->out_cp2.resolve(mc6846->iface->out_cp2_func, *device);   /* 1-bit output */
610
611   /* CPU read from the outside through chip */
612   mc6846->in_port.resolve(mc6846->iface->in_port_func, *device); /* 8-bit input */
613
614   /* asynchronous timer output to outside world */
615   mc6846->out_cto.resolve(mc6846->iface->out_cto_func, *device); /* 1-bit output */
616
617   /* timer interrupt */
618   mc6846->irq.resolve(mc6846->iface->irq_func, *device);
619
593620   state_save_register_item( device->machine(), "mc6846", device->tag(), 0, mc6846->csr );
594621   state_save_register_item( device->machine(), "mc6846", device->tag(), 0, mc6846->pcr );
595622   state_save_register_item( device->machine(), "mc6846", device->tag(), 0, mc6846->ddr );
trunk/src/mess/machine/mc6846.h
r17961r17962
3535struct mc6846_interface
3636{
3737  /* CPU write to the outside through chip */
38  write8_device_func out_port_func;  /* 8-bit output */
39  write8_device_func out_cp1_func;   /* 1-bit output */
40  write8_device_func out_cp2_func;   /* 1-bit output */
38  devcb_write8 out_port_func;  /* 8-bit output */
39  devcb_write8 out_cp1_func;   /* 1-bit output */
40  devcb_write8 out_cp2_func;   /* 1-bit output */
4141
4242  /* CPU read from the outside through chip */
43  read8_device_func in_port_func; /* 8-bit input */
43  devcb_read8 in_port_func; /* 8-bit input */
4444
4545  /* asynchronous timer output to outside world */
46  write8_device_func out_cto_func; /* 1-bit output */
46  devcb_write8 out_cto_func; /* 1-bit output */
4747
4848  /* timer interrupt */
49  void ( * irq_func ) ( device_t *device, int state );
49  devcb_write_line irq_func;
5050};
5151
5252
r17961r17962
6464
6565/* ---------- functions ------------ */
6666/* interface to CPU via address/data bus*/
67extern READ8_DEVICE_HANDLER  ( mc6846_r );
68extern WRITE8_DEVICE_HANDLER ( mc6846_w );
67extern DECLARE_READ8_DEVICE_HANDLER  ( mc6846_r );
68extern DECLARE_WRITE8_DEVICE_HANDLER ( mc6846_w );
6969
7070/* asynchronous write from outside world into interrupt-generating pins */
7171extern void mc6846_set_input_cp1 ( device_t *device, int data );
trunk/src/mess/machine/pmd85.c
r17961r17962
568568                        case 0x40:      /* 8255 (GPIO/0, GPIO/1) */
569569                              return machine().device<i8255_device>("ppi8255_1")->read(space, offset & 0x03);
570570                        case 0x50:   /* 8253 */
571                              return pit8253_r( machine().device("pit8253"), offset & 0x03);
571                              return pit8253_r( machine().device("pit8253"), space, offset & 0x03);
572572                        case 0x70:   /* 8255 (IMS-2) */
573573                              return machine().device<i8255_device>("ppi8255_2")->read(space, offset & 0x03);
574574                     }
r17961r17962
645645                              machine().device<i8255_device>("ppi8255_1")->write(space, offset & 0x03, data);
646646                              break;
647647                        case 0x50:   /* 8253 */
648                              pit8253_w(machine().device("pit8253"), offset & 0x03, data);
648                              pit8253_w(machine().device("pit8253"), space, offset & 0x03, data);
649649                              logerror ("8253 writing. Address: %02x, Data: %02x\n", offset, data);
650650                              break;
651651                        case 0x70:   /* 8255 (IMS-2) */
trunk/src/mess/machine/upd71071.c
r17961r17962
416416   }
417417}
418418
419READ8_DEVICE_HANDLER(upd71071_r) { return upd71071_read(device,offset); }
420WRITE8_DEVICE_HANDLER(upd71071_w) { upd71071_write(device,offset,data); }
419READ8_DEVICE_HANDLER(upd71071_r) { return upd71071_read(device,space,offset,mem_mask); }
420WRITE8_DEVICE_HANDLER(upd71071_w) { upd71071_write(device,space,offset,data,mem_mask); }
421421
422422const device_type UPD71071 = &device_creator<upd71071_device>;
423423
trunk/src/mess/machine/upd71071.h
r17961r17962
3737   MCFG_DEVICE_ADD(_tag, UPD71071, 0) \
3838   MCFG_DEVICE_CONFIG(_config)
3939
40READ8_DEVICE_HANDLER(upd71071_r);
41WRITE8_DEVICE_HANDLER(upd71071_w);
40DECLARE_READ8_DEVICE_HANDLER(upd71071_r);
41DECLARE_WRITE8_DEVICE_HANDLER(upd71071_w);
4242
4343#endif /*UPD71071_H_*/
trunk/src/mess/machine/c64_sfx_sound_expander.c
r17961r17962
257257      }
258258      else if (BIT(offset, 5))
259259      {
260         data = ym3526_r(m_opl, BIT(offset, 4));
260         data = ym3526_r(m_opl, space, BIT(offset, 4));
261261      }
262262   }
263263
r17961r17962
273273{
274274   if (!io2 && BIT(offset, 5))
275275   {
276      ym3526_w(m_opl, BIT(offset, 4), data);
276      ym3526_w(m_opl, space, BIT(offset, 4), data);
277277   }
278278
279279   m_exp->cd_w(space, offset, data, ba, roml, romh, io1, io2);
trunk/src/mess/machine/orion.c
r17961r17962
181181   switch(offset)
182182   {
183183      case 0x0   :
184      case 0x10 : return wd17xx_status_r(fdc,0);
184      case 0x10 : return wd17xx_status_r(fdc,space, 0);
185185      case 0x1   :
186      case 0x11 : return wd17xx_track_r(fdc,0);
186      case 0x11 : return wd17xx_track_r(fdc,space, 0);
187187      case 0x2  :
188      case 0x12 : return wd17xx_sector_r(fdc,0);
188      case 0x12 : return wd17xx_sector_r(fdc,space, 0);
189189      case 0x3  :
190      case 0x13 : return wd17xx_data_r(fdc,0);
190      case 0x13 : return wd17xx_data_r(fdc,space, 0);
191191   }
192192   return 0xff;
193193}
r17961r17962
199199   switch(offset)
200200   {
201201      case 0x0   :
202      case 0x10 : wd17xx_command_w(fdc,0,data); break;
202      case 0x10 : wd17xx_command_w(fdc,space, 0,data); break;
203203      case 0x1   :
204      case 0x11 : wd17xx_track_w(fdc,0,data);break;
204      case 0x11 : wd17xx_track_w(fdc,space, 0,data);break;
205205      case 0x2  :
206      case 0x12 : wd17xx_sector_w(fdc,0,data);break;
206      case 0x12 : wd17xx_sector_w(fdc,space, 0,data);break;
207207      case 0x3  :
208      case 0x13 : wd17xx_data_w(fdc,0,data);break;
208      case 0x13 : wd17xx_data_w(fdc,space, 0,data);break;
209209      case 0x4  :
210210      case 0x14 :
211211      case 0x20 : orion_disk_control_w(space, offset, data);break;
r17961r17962
378378{
379379   if (offset == 0xFFFD)
380380   {
381      return ay8910_r (machine().device("ay8912"), 0);
381      return ay8910_r (machine().device("ay8912"), space, 0);
382382   }
383383   return 0xff;
384384}
r17961r17962
396396   }
397397   switch(offset)
398398   {
399      case 0xfffd : ay8910_address_w(machine().device("ay8912"), 0, data);
399      case 0xfffd : ay8910_address_w(machine().device("ay8912"), space, 0, data);
400400                 break;
401401      case 0xbffd :
402      case 0xbefd : ay8910_data_w(machine().device("ay8912"), 0, data);
402      case 0xbefd : ay8910_data_w(machine().device("ay8912"), space, 0, data);
403403                 break;
404404   }
405405}
r17961r17962
556556      case 0x08 : return m_orionpro_page;
557557      case 0x09 : return m_orionpro_rom2_segment;
558558      case 0x0a : return m_orionpro_dispatcher;
559      case 0x10 : return wd17xx_status_r(fdc,0);
560      case 0x11 : return wd17xx_track_r(fdc,0);
561      case 0x12 : return wd17xx_sector_r(fdc,0);
562      case 0x13 : return wd17xx_data_r(fdc,0);
559      case 0x10 : return wd17xx_status_r(fdc,space, 0);
560      case 0x11 : return wd17xx_track_r(fdc,space, 0);
561      case 0x12 : return wd17xx_sector_r(fdc,space, 0);
562      case 0x13 : return wd17xx_data_r(fdc,space, 0);
563563      case 0x18 :
564564      case 0x19 :
565565      case 0x1a :
r17961r17962
572572   }
573573   if (offset == 0xFFFD)
574574   {
575      return ay8910_r (machine().device("ay8912"), 0);
575      return ay8910_r (machine().device("ay8912"), space, 0);
576576   }
577577   return 0xff;
578578}
r17961r17962
589589      case 0x08 : m_orionpro_page = data;        orionpro_bank_switch(machine()); break;
590590      case 0x09 : m_orionpro_rom2_segment = data; orionpro_bank_switch(machine()); break;
591591      case 0x0a : m_orionpro_dispatcher = data;   orionpro_bank_switch(machine()); break;
592      case 0x10 : wd17xx_command_w(fdc,0,data); break;
593      case 0x11 : wd17xx_track_w(fdc,0,data);break;
594      case 0x12 : wd17xx_sector_w(fdc,0,data);break;
595      case 0x13 : wd17xx_data_w(fdc,0,data);break;
592      case 0x10 : wd17xx_command_w(fdc,space, 0,data); break;
593      case 0x11 : wd17xx_track_w(fdc,space, 0,data);break;
594      case 0x12 : wd17xx_sector_w(fdc,space, 0,data);break;
595      case 0x13 : wd17xx_data_w(fdc,space, 0,data);break;
596596      case 0x14 : orion_disk_control_w(space, 9, data);break;
597597      case 0x18 :
598598      case 0x19 :
r17961r17962
612612   }
613613   switch(offset)
614614   {
615      case 0xfffd : ay8910_address_w(machine().device("ay8912"), 0, data);
615      case 0xfffd : ay8910_address_w(machine().device("ay8912"), space, 0, data);
616616                 break;
617617      case 0xbffd :
618      case 0xbefd : ay8910_data_w(machine().device("ay8912"), 0, data);
618      case 0xbefd : ay8910_data_w(machine().device("ay8912"), space, 0, data);
619619                 break;
620620   }
621621}
trunk/src/mess/machine/cpc_ssa1.c
r17961r17962
4545
4646WRITE8_MEMBER(cpc_ssa1_device::ssa1_w)
4747{
48   sp0256_ALD_w(m_sp0256_device,0,data);
48   sp0256_ALD_w(m_sp0256_device,space, 0,data);
4949}
5050
5151READ8_MEMBER(cpc_dkspeech_device::dkspeech_r)
r17961r17962
6262
6363WRITE8_MEMBER(cpc_dkspeech_device::dkspeech_w)
6464{
65   sp0256_ALD_w(m_sp0256_device,0,data & 0x3f);
65   sp0256_ALD_w(m_sp0256_device,space, 0,data & 0x3f);
6666}
6767
6868WRITE_LINE_MEMBER(cpc_ssa1_device::lrq_cb)
trunk/src/mess/machine/a7800.c
r17961r17962
525525      }
526526      break;
527527   }
528   tia_sound_w(machine().device("tia"), offset, data);
528   tia_sound_w(machine().device("tia"), space, offset, data);
529529   m_ROM[offset] = data;
530530}
trunk/src/mess/machine/e05a03.h
r17961r17962
2828/***************************************************************************
2929    FUNCTION PROTOTYPES
3030***************************************************************************/
31WRITE8_DEVICE_HANDLER( e05a03_w );
32READ8_DEVICE_HANDLER( e05a03_r );
31DECLARE_WRITE8_DEVICE_HANDLER( e05a03_w );
32DECLARE_READ8_DEVICE_HANDLER( e05a03_r );
3333
3434WRITE_LINE_DEVICE_HANDLER( e05a03_home_w ); /* home position signal */
3535WRITE_LINE_DEVICE_HANDLER( e05a03_fire_w ); /* printhead solenoids trigger */
trunk/src/mess/machine/hecdisk2.c
r17961r17962
248248   hec2hrp_state *state = space->machine().driver_data<hec2hrp_state>();
249249   UINT8 data;
250250   device_t *fdc = space->machine().device("upd765");
251   data = upd765_data_r(fdc,0); //Get the result
251   data = upd765_data_r(fdc,*space, 0); //Get the result
252252
253253// if ST0 == 0x28 (drive A:) or 0x29 (drive B:) => add 0x40
254254// and correct the ST1 and ST2 (patch)
r17961r17962
309309#endif
310310
311311   device_t *fdc = space->machine().device("upd765");
312   upd765_data_w(fdc,0, data);
312   upd765_data_w(fdc,*space, 0, data);
313313}
314314
315315//  AM_RANGE(0x070,0x07f) AM_DEVREADWRITE("upd765",upd765_dack_r,upd765_dack_w)
r17961r17962
317317{
318318   UINT8 data;
319319   device_t *fdc = space->machine().device("upd765");
320   data = upd765_dack_r(fdc,0);
320   data = upd765_dack_r(fdc,*space, 0);
321321   return data;
322322}
323323WRITE8_HANDLER( hector_disc2_io70_port_w)
324324{
325325   device_t *fdc = space->machine().device("upd765");
326   upd765_dack_w(fdc,0, data);
326   upd765_dack_w(fdc,*space, 0, data);
327327}
trunk/src/mess/machine/dgnalpha.c
r17961r17962
144144         break;
145145
146146      case 12:
147         result = wd17xx_data_r(m_fdc, 0);
147         result = wd17xx_data_r(m_fdc, space, 0);
148148         break;
149149
150150      case 13:
151         result = wd17xx_sector_r(m_fdc, 0);
151         result = wd17xx_sector_r(m_fdc, space, 0);
152152         break;
153153
154154      case 14:
155         result = wd17xx_track_r(m_fdc, 0);
155         result = wd17xx_track_r(m_fdc, space, 0);
156156         break;
157157
158158      case 15:
159         result = wd17xx_status_r(m_fdc, 0);
159         result = wd17xx_status_r(m_fdc, space, 0);
160160         break;
161161   }
162162   return result;
r17961r17962
185185         break;
186186
187187      case 12:
188         wd17xx_data_w(m_fdc, 0, data);
188         wd17xx_data_w(m_fdc, space, 0, data);
189189         break;
190190      case 13:
191         wd17xx_sector_w(m_fdc, 0, data);
191         wd17xx_sector_w(m_fdc, space, 0, data);
192192         break;
193193      case 14:
194         wd17xx_track_w(m_fdc, 0, data);
194         wd17xx_track_w(m_fdc, space, 0, data);
195195         break;
196196      case 15:
197            wd17xx_command_w(m_fdc, 0, data);
197            wd17xx_command_w(m_fdc, space, 0, data);
198198
199199         /* disk head is encoded in the command byte */
200200         wd17xx_set_side(m_fdc,(data & 0x02) ? 1 : 0);
r17961r17962
236236      case 0x00:      /* Inactive, do nothing */
237237         break;
238238      case 0x01:      /* Write to selected port */
239         ay8910_data_w(m_ay8912, 0, m_pia_2->b_output());
239         ay8910_data_w(m_ay8912, space, 0, m_pia_2->b_output());
240240         break;
241241      case 0x02:      /* Read from selected port */
242         m_pia_2->portb_w(ay8910_r(m_ay8912, 0));
242         m_pia_2->portb_w(ay8910_r(m_ay8912, space, 0));
243243         break;
244244      case 0x03:      /* Select port to write to */
245         ay8910_address_w(m_ay8912, 0, m_pia_2->b_output());
245         ay8910_address_w(m_ay8912, space, 0, m_pia_2->b_output());
246246         break;
247247   }
248248}
trunk/src/mess/machine/comx_fd.c
r17961r17962
275275      }
276276      else
277277      {
278         data = wd17xx_r(m_fdc, m_addr);
278         data = wd17xx_r(m_fdc, machine().driver_data()->generic_space(), m_addr);
279279      }
280280   }
281281
r17961r17962
326326      else
327327      {
328328         // write data to WD1770
329         wd17xx_w(m_fdc, m_addr, data);
329         wd17xx_w(m_fdc, machine().driver_data()->generic_space(), m_addr, data);
330330      }
331331   }
332332}
trunk/src/mess/machine/trs80.c
r17961r17962
704704{
705705   UINT8 data = 0xff;
706706   if (BIT(ioport("CONFIG")->read(), 7))
707      data = wd17xx_status_r(m_fdc, offset);
707      data = wd17xx_status_r(m_fdc, space, offset);
708708
709709   return data;
710710}
trunk/src/mess/machine/svi318.c
r17961r17962
803803
804804   case 0x30:
805805      device = machine().device("wd179x");
806      data = wd17xx_status_r(device, 0);
806      data = wd17xx_status_r(device, space, 0);
807807      break;
808808   case 0x31:
809809      device = machine().device("wd179x");
810      data = wd17xx_track_r(device, 0);
810      data = wd17xx_track_r(device, space, 0);
811811      break;
812812   case 0x32:
813813      device = machine().device("wd179x");
814      data = wd17xx_sector_r(device, 0);
814      data = wd17xx_sector_r(device, space, 0);
815815      break;
816816   case 0x33:
817817      device = machine().device("wd179x");
818      data = wd17xx_data_r(device, 0);
818      data = wd17xx_data_r(device, space, 0);
819819      break;
820820   case 0x34:
821821      data = svi318_fdc_irqdrq_r(space, 0);
r17961r17962
876876
877877   case 0x30:
878878      device = machine().device("wd179x");
879      wd17xx_command_w(device, 0, data);
879      wd17xx_command_w(device, space, 0, data);
880880      break;
881881   case 0x31:
882882      device = machine().device("wd179x");
883      wd17xx_track_w(device, 0, data);
883      wd17xx_track_w(device, space, 0, data);
884884      break;
885885   case 0x32:
886886      device = machine().device("wd179x");
887      wd17xx_sector_w(device, 0, data);
887      wd17xx_sector_w(device, space, 0, data);
888888      break;
889889   case 0x33:
890890      device = machine().device("wd179x");
891      wd17xx_data_w(device, 0, data);
891      wd17xx_data_w(device, space, 0, data);
892892      break;
893893   case 0x34:
894894      svi318_fdc_drive_motor_w(space, 0, data);
trunk/src/mess/machine/amstr_pc.c
r17961r17962
201201READ8_HANDLER( pc200_port378_r )
202202{
203203   device_t *lpt = space->machine().device("lpt_1");
204   UINT8 data = pc_lpt_r(lpt, offset);
204   UINT8 data = pc_lpt_r(lpt, *space, offset);
205205
206206   if (offset == 1)
207207      data = (data & ~7) | (space->machine().root_device().ioport("DSW0")->read() & 7);
r17961r17962
214214READ8_HANDLER( pc200_port278_r )
215215{
216216   device_t *lpt = space->machine().device("lpt_2");
217   UINT8 data = pc_lpt_r(lpt, offset);
217   UINT8 data = pc_lpt_r(lpt, *space, offset);
218218
219219   if (offset == 1)
220220      data = (data & ~7) | (space->machine().root_device().ioport("DSW0")->read() & 7);
r17961r17962
228228READ8_HANDLER( pc1640_port378_r )
229229{
230230    device_t *lpt = space->machine().device("lpt_1");
231    UINT8 data = pc_lpt_r(lpt, offset);
231    UINT8 data = pc_lpt_r(lpt, *space, offset);
232232
233233   if (offset == 1)
234234      data=(data & ~7) | (space->machine().root_device().ioport("DSW0")->read() & 7);
trunk/src/mess/machine/wswan.c
r17961r17962
835835                   Bit 0-3 - Master volume
836836                   Bit 4-7 - Unknown
837837                */
838         wswan_sound_port_w( machine().device("custom"), offset, data );
838         wswan_sound_port_w( machine().device("custom"), space, offset, data );
839839         break;
840840      case 0xa0:   /* Hardware type - this is probably read only
841841                   Bit 0   - Enable cartridge slot and/or disable bios
trunk/src/mess/machine/z80ne.c
r17961r17962
632632{
633633   UINT8 data;
634634
635   data = kr2376_data_r(m_lx388_kr2376, 0) & 0x7f;
635   data = kr2376_data_r(m_lx388_kr2376, space, 0) & 0x7f;
636636   data |= kr2376_get_output_pin(m_lx388_kr2376, KR2376_SO) << 7;
637637   return data;
638638}
r17961r17962
725725   switch(offset)
726726   {
727727   case 0:
728      d = wd17xx_status_r(device, 0) ^ 0xff;
728      d = wd17xx_status_r(device, space, 0) ^ 0xff;
729729      LOG(("lx390_fdc_r, WD17xx status: %02x\n", d));
730730      break;
731731   case 1:
732      d = wd17xx_track_r(device, 0) ^ 0xff;
732      d = wd17xx_track_r(device, space, 0) ^ 0xff;
733733      LOG(("lx390_fdc_r, WD17xx track:  %02x\n", d));
734734      break;
735735   case 2:
736      d = wd17xx_sector_r(device, 0) ^ 0xff;
736      d = wd17xx_sector_r(device, space, 0) ^ 0xff;
737737      LOG(("lx390_fdc_r, WD17xx sector: %02x\n", d));
738738      break;
739739   case 3:
740      d = wd17xx_data_r(device, 0) ^ 0xff;
740      d = wd17xx_data_r(device, space, 0) ^ 0xff;
741741      LOG(("lx390_fdc_r, WD17xx data3:  %02x\n", d));
742742      break;
743743   case 6:
744744      d = 0xff;
745      lx390_reset_bank(device, 0);
745      lx390_reset_bank(device, space, 0);
746746      break;
747747   case 7:
748      d = wd17xx_data_r(device, 3) ^ 0xff;
748      d = wd17xx_data_r(device, space, 3) ^ 0xff;
749749      LOG(("lx390_fdc_r, WD17xx data7, force:  %02x\n", d));
750750      break;
751751   default:
r17961r17962
764764   {
765765   case 0:
766766      LOG(("lx390_fdc_w, WD17xx command: %02x\n", d));
767      wd17xx_command_w(device, offset, d ^ 0xff);
767      wd17xx_command_w(device, space, offset, d ^ 0xff);
768768      if (state->m_wd17xx_state.drive & 1)
769769         output_set_value("drv0", 2);
770770      else if (state->m_wd17xx_state.drive & 2)
r17961r17962
772772      break;
773773   case 1:
774774      LOG(("lx390_fdc_w, WD17xx track:   %02x\n", d));
775      wd17xx_track_w(device, offset, d ^ 0xff);
775      wd17xx_track_w(device, space, offset, d ^ 0xff);
776776      break;
777777   case 2:
778778      LOG(("lx390_fdc_w, WD17xx sector:  %02x\n", d));
779      wd17xx_sector_w(device, offset, d ^ 0xff);
779      wd17xx_sector_w(device, space, offset, d ^ 0xff);
780780      break;
781781   case 3:
782      wd17xx_data_w(device, 0, d ^ 0xff);
782      wd17xx_data_w(device, space, 0, d ^ 0xff);
783783      LOG(("lx390_fdc_w, WD17xx data3:   %02x\n", d));
784784      break;
785785   case 6:
786786      LOG(("lx390_fdc_w, motor_w:   %02x\n", d));
787      lx390_motor_w(device, 0, d);
787      lx390_motor_w(device, space, 0, d);
788788      break;
789789   case 7:
790790      LOG(("lx390_fdc_w, WD17xx data7, force:   %02x\n", d));
791      wd17xx_data_w(device, 3, d ^ 0xff);
791      wd17xx_data_w(device, space, 3, d ^ 0xff);
792792      break;
793793   }
794794}
trunk/src/mess/machine/apollo_kbd.c
r17961r17962
9898   m_device = this;
9999   LOG1(("start apollo_kbd"));
100100
101   m_putchar.resolve(apollo_kbd_putchar_cb, *this);
102   m_has_beeper.resolve(apollo_kbd_has_beeper_cb, *this);
103   m_is_german.resolve(apollo_kbd_is_german_cb, *this);
104
101105   m_beeper.start(this);
102106   m_mouse.start(this);
103107   m_tx_fifo.start(this);
r17961r17962
200204
201205int apollo_kbd_device::beeper::keyboard_has_beeper()
202206{
203   return m_device->apollo_kbd_has_beeper ?
204         (m_device->apollo_kbd_has_beeper)(m_device, 0) : 0;
207   return !m_device->m_has_beeper.isnull() ?
208         m_device->m_has_beeper(0) : 0;
205209}
206210
207211void apollo_kbd_device::beeper::beeper_callback()
r17961r17962
395399   {
396400      m_tx_pending = 1;
397401
398      if (m_device->apollo_kbd_putchar)
399         (m_device->apollo_kbd_putchar)(m_device, 0, getchar());
402      if (!m_device->m_putchar.isnull())
403         m_device->m_putchar(0, getchar());
400404      // 11 = one start, 8 data, one parity (even), one stop bit
401405      m_timer->adjust(attotime::from_hz(m_baud_rate / 11), 0);
402406   }
r17961r17962
525529
526530int apollo_kbd_device::keyboard_is_german()
527531{
528   return apollo_kbd_is_german ?
529         (*apollo_kbd_is_german)(this, 0) : 0;
532   return !m_is_german.isnull() ?
533         m_is_german(0) : 0;
530534}
531535
532536/*-------------------------------------------------
trunk/src/mess/machine/apollo_kbd.h
r17961r17962
5151
5252struct apollo_kbd_interface
5353{
54   write8_device_func apollo_kbd_putchar;
55   read8_device_func apollo_kbd_has_beeper;
56   read8_device_func apollo_kbd_is_german;
54   devcb_write8 apollo_kbd_putchar_cb;
55   devcb_read8 apollo_kbd_has_beeper_cb;
56   devcb_read8 apollo_kbd_is_german_cb;
5757};
5858
5959#define APOLLO_KBD_INTERFACE(name) const struct apollo_kbd_interface (name)
r17961r17962
192192   int m_keytime[0x80];    // time until next key press (1 ms)
193193   UINT8 m_keyon[0x80];    // is 1 if key is pressed
194194
195   devcb_resolved_write8 m_putchar;
196   devcb_resolved_read8 m_has_beeper;
197   devcb_resolved_read8 m_is_german;
198
195199   static UINT16 m_code_table[];
196200};
197201
trunk/src/mess/machine/apple2gs.c
r17961r17962
10521052        case 0xe8: case 0xe9: case 0xea: case 0xeb: case 0xec: case 0xed: case 0xee: case 0xef:
10531053         if ((m_sltromsel & (1 << 6)) == 0)
10541054         {
1055                result = applefdc_r(m_fdc, offset);
1055                result = applefdc_r(m_fdc, space, offset);
10561056            }
10571057            else
10581058            {
r17961r17962
12081208        case 0xe8: case 0xe9: case 0xea: case 0xeb: case 0xec: case 0xed: case 0xee: case 0xef:
12091209            if ((m_sltromsel & (1 << 6)) == 0)
12101210            {
1211                applefdc_w(m_fdc, offset, data);
1211                applefdc_w(m_fdc, space, offset, data);
12121212            }
12131213            else
12141214            {
trunk/src/mess/machine/isa_hdc.c
r17961r17962
110110   NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL  /* 0xF8-0xFF */
111111};
112112
113static READ8_DEVICE_HANDLER(pc_HDC_r);
114static WRITE8_DEVICE_HANDLER(pc_HDC_w);
113static DECLARE_READ8_DEVICE_HANDLER(pc_HDC_r);
114static DECLARE_WRITE8_DEVICE_HANDLER(pc_HDC_w);
115115
116116static MACHINE_CONFIG_FRAGMENT( hdc_config )
117117   MCFG_HARDDISK_ADD("primary")
trunk/src/mess/machine/a2echoii.c
r17961r17962
8181    switch (offset)
8282    {
8383        case 0:
84            return 0x1f | tms5220_status_r(m_tms, 0);
84            return 0x1f | tms5220_status_r(m_tms, space, 0);
8585            break;
8686    }
8787
r17961r17962
9393    switch (offset)
9494    {
9595        case 0:
96            tms5220_data_w(m_tms, offset, data);
96            tms5220_data_w(m_tms, space, offset, data);
9797            break;
9898    }
9999}
trunk/src/mess/machine/990_tap.h
r17961r17962
11/*
22    990_tap.h: include file for 990_tap.c
33*/
4extern READ16_DEVICE_HANDLER(ti990_tpc_r);
5extern WRITE16_DEVICE_HANDLER(ti990_tpc_w);
4extern DECLARE_READ16_DEVICE_HANDLER(ti990_tpc_r);
5extern DECLARE_WRITE16_DEVICE_HANDLER(ti990_tpc_w);
66
77/***************************************************************************
88    TYPE DEFINITIONS
trunk/src/mess/machine/apollo.c
r17961r17962
369369
370370WRITE8_MEMBER(apollo_state::apollo_dma_1_w){
371371   SLOG1(("apollo_dma_1_w: writing DMA Controller 1 at offset %02x = %02x", offset, data));
372   i8237_w(get_device_dma8237_1(&space.device()), offset, data);
372   i8237_w(get_device_dma8237_1(&space.device()), space, offset, data);
373373}
374374
375375READ8_MEMBER(apollo_state::apollo_dma_1_r){
376   UINT8 data = i8237_r(get_device_dma8237_1(&space.device()), offset);
376   UINT8 data = i8237_r(get_device_dma8237_1(&space.device()), space, offset);
377377   SLOG1(("apollo_dma_1_r: reading DMA Controller 1 at offset %02x = %02x", offset, data));
378378   return data;
379379}
r17961r17962
384384
385385WRITE8_MEMBER(apollo_state::apollo_dma_2_w){
386386   SLOG1(("apollo_dma_2_w: writing DMA Controller 2 at offset %02x = %02x", offset/2, data));
387   i8237_w(get_device_dma8237_2(&space.device()), offset / 2, data);
387   i8237_w(get_device_dma8237_2(&space.device()), space, offset / 2, data);
388388}
389389
390390READ8_MEMBER(apollo_state::apollo_dma_2_r){
391   UINT8 data = i8237_r(get_device_dma8237_2(&space.device()), offset / 2);
391   UINT8 data = i8237_r(get_device_dma8237_2(&space.device()), space, offset / 2);
392392   SLOG1(("apollo_dma_2_r: reading DMA Controller 2 at offset %02x = %02x", offset/2, data));
393393   return data;
394394}
r17961r17962
526526}
527527
528528static READ8_DEVICE_HANDLER( apollo_dma8237_fdc_dack_r ) {
529   UINT8 data = pc_fdc_dack_r(device->machine());
529   UINT8 data = pc_fdc_dack_r(device->machine(), space);
530530   //  DLOG2(("dma fdc dack read %02x",data));
531531
532532   // hack for DN3000: select appropriate DMA channel No.
r17961r17962
537537
538538static WRITE8_DEVICE_HANDLER( apollo_dma8237_fdc_dack_w ) {
539539   // DLOG2(("dma fdc dack write %02x", data));
540   pc_fdc_dack_w(device->machine(), data);
540   pc_fdc_dack_w(device->machine(), space, data);
541541
542542   // hack for DN3000: select appropriate DMA channel No.
543543   // Note: too late for this byte, but next bytes will be ok
r17961r17962
623623
624624WRITE8_DEVICE_HANDLER(apollo_pic8259_master_w ) {
625625   DLOG1(("writing %s at offset %X = %02x", device->tag(), offset, data));
626   pic8259_w(device, offset, data);
626   pic8259_w(device, space, offset, data);
627627}
628628
629629READ8_DEVICE_HANDLER( apollo_pic8259_master_r ) {
630   UINT8 data = pic8259_r(device, offset);
630   UINT8 data = pic8259_r(device, space, offset);
631631   DLOG1(("reading %s at offset %X = %02x", device->tag(), offset, data));
632632   return data;
633633}
r17961r17962
638638
639639WRITE8_DEVICE_HANDLER(apollo_pic8259_slave_w ) {
640640   DLOG1(("writing %s at offset %X = %02x", device->tag(), offset, data));
641   pic8259_w(device, offset, data);
641   pic8259_w(device, space, offset, data);
642642}
643643
644644READ8_DEVICE_HANDLER( apollo_pic8259_slave_r ) {
645   UINT8 data = pic8259_r(device, offset);
645   UINT8 data = pic8259_r(device, space, offset);
646646   DLOG1(("reading %s at offset %X = %02x", device->tag(), offset, data));
647647   return data;
648648}
r17961r17962
10261026         "1X/16X Test", "RHRB", "IVR", "Input Ports", "Start Counter",
10271027         "Stop Counter" };
10281028
1029   int data = duart68681_r(device, offset / 2);
1029   int data = duart68681_r(device, space, offset / 2);
10301030
10311031   if (sio_irq_line) {
10321032      apollo_pic_set_irq_line(device, APOLLO_IRQ_SIO1, 0);
r17961r17962
10891089      }
10901090      break;
10911091   }
1092   duart68681_w(device, offset / 2, data);
1092   duart68681_w(device, space, offset / 2, data);
10931093}
10941094
10951095/*-------------------------------------------------
r17961r17962
11061106#define SRA 0x01
11071107#define SRB 0x09
11081108
1109   if (!(duart68681_r(device, SRB) & 0x02))
1109   if (!(duart68681_r(device, space, SRB) & 0x02))
11101110   {
11111111      // Channel B FIFO not yet full (STATUS_FIFO_FULL)
11121112      if (read(STDIN_FILENO, &data, 1) == 1)
r17961r17962
11161116         // stop sleeping to reduce CPU usage
11171117         sio_sleep(0);
11181118      }
1119      else if (input_from_stdin && (duart68681_r(device, SRB) & 0x0c) == 0x0c)
1119      else if (input_from_stdin && (duart68681_r(device, space, SRB) & 0x0c) == 0x0c)
11201120      {
11211121         // we reduce the CPU usage, if SRB is being polled for input
11221122         // but only as long as the transmitter is empty and ready
r17961r17962
12211221
12221222   apollo_pic_set_irq_line(device, APOLLO_IRQ_SIO2, 0);
12231223
1224   int data = duart68681_r(device, offset / 2);
1224   int data = duart68681_r(device, space, offset / 2);
12251225
12261226   DLOG2(("reading 2681 reg %x (%s) returned %02x",
12271227            offset, duart68681_reg_read_names[offset/2], data ));
r17961r17962
12471247      break;
12481248   }
12491249
1250   duart68681_w(device, offset / 2, data);
1250   duart68681_w(device, space, offset / 2, data);
12511251}
12521252
12531253/*-------------------------------------------------
trunk/src/mess/machine/3c505.h
r17961r17962
2828 FUNCTION PROTOTYPES
2929 ***************************************************************************/
3030
31READ8_DEVICE_HANDLER( threecom3c505_r );
32WRITE8_DEVICE_HANDLER( threecom3c505_w );
31DECLARE_READ8_DEVICE_HANDLER( threecom3c505_r );
32DECLARE_WRITE8_DEVICE_HANDLER( threecom3c505_w );
3333
3434int threecom3c505_receive(device_t *device, const UINT8 *data, int length);
3535
trunk/src/mess/machine/kaypro.c
r17961r17962
1313
1414************************************************************/
1515
16static void kaypro_interrupt(device_t *device, int state)
16static WRITE_LINE_DEVICE_HANDLER( kaypro_interrupt )
1717{
1818   device->machine().device("maincpu")->execute().set_input_line(0, state);
1919}
r17961r17962
227227
228228const z80sio_interface kaypro_sio_intf =
229229{
230   kaypro_interrupt,   /* interrupt handler */
231   0,         /* DTR changed handler */
232   0,         /* RTS changed handler */
233   0,         /* BREAK changed handler */
234   0,         /* transmit handler - which channel is this for? */
235   0         /* receive handler - which channel is this for? */
230   DEVCB_LINE(kaypro_interrupt),   /* interrupt handler */
231   DEVCB_NULL,         /* DTR changed handler */
232   DEVCB_NULL,         /* RTS changed handler */
233   DEVCB_NULL,         /* BREAK changed handler */
234   DEVCB_NULL,         /* transmit handler - which channel is this for? */
235   DEVCB_NULL         /* receive handler - which channel is this for? */
236236};
237237
238238READ8_DEVICE_HANDLER( kaypro_sio_r )
trunk/src/mess/machine/isa_sblaster.c
r17961r17962
129129   UINT8 retVal = 0xff;
130130   switch(offset)
131131   {
132      case 0 : retVal = ym3812_status_port_r( device, offset ); break;
132      case 0 : retVal = ym3812_status_port_r( device, space, offset ); break;
133133   }
134134   return retVal;
135135}
r17961r17962
138138{
139139   switch(offset)
140140   {
141      case 0 : ym3812_control_port_w( device, offset, data ); break;
142      case 1 : ym3812_write_port_w( device, offset, data ); break;
141      case 0 : ym3812_control_port_w( device, space, offset, data ); break;
142      case 1 : ym3812_write_port_w( device, space, offset, data ); break;
143143   }
144144}
145145
r17961r17962
152152{
153153   switch(offset)
154154   {
155      case 0 : saa1099_control_w( device, offset, data ); break;
156      case 1 : saa1099_data_w( device, offset, data ); break;
155      case 0 : saa1099_control_w( device, space, offset, data ); break;
156      case 1 : saa1099_data_w( device, space, offset, data ); break;
157157   }
158158}
159159
trunk/src/mess/machine/pc_lpt.c
r17961r17962
204204{
205205   switch (offset)
206206   {
207   case 0: return pc_lpt_data_r(device, 0);
208   case 1: return pc_lpt_status_r(device, 0);
209   case 2: return pc_lpt_control_r(device, 0);
207   case 0: return pc_lpt_data_r(device, space, 0);
208   case 1: return pc_lpt_status_r(device, space, 0);
209   case 2: return pc_lpt_control_r(device, space, 0);
210210   }
211211
212212   /* if we reach this its an error */
r17961r17962
220220{
221221   switch (offset)
222222   {
223   case 0: pc_lpt_data_w(device, 0, data); break;
223   case 0: pc_lpt_data_w(device, space, 0, data); break;
224224   case 1: break;
225   case 2:   pc_lpt_control_w(device, 0, data); break;
225   case 2:   pc_lpt_control_w(device, space, 0, data); break;
226226   }
227227}
228228
trunk/src/mess/machine/s3c44b0.c
r17961r17962
16011601
16021602/* IIS */
16031603
1604INLINE void iface_i2s_data_w( device_t *device, int ch, UINT16 data)
1604INLINE void iface_i2s_data_w( device_t *device, address_space &space, int ch, UINT16 data)
16051605{
16061606   s3c44b0_t *s3c44b0 = get_token( device);
16071607   if (s3c44b0->iface->i2s.data_w)
16081608   {
1609      (s3c44b0->iface->i2s.data_w)( device, ch, data, 0);
1609      (s3c44b0->iface->i2s.data_w)( device, space, ch, data, 0);
16101610   }
16111611}
16121612
r17961r17962
16771677         if (s3c44b0->iis.fifo_index == 2)
16781678         {
16791679            s3c44b0->iis.fifo_index = 0;
1680            iface_i2s_data_w( device, 0, s3c44b0->iis.fifo[0]);
1681            iface_i2s_data_w( device, 1, s3c44b0->iis.fifo[1]);
1680            iface_i2s_data_w( device, space, 0, s3c44b0->iis.fifo[0]);
1681            iface_i2s_data_w( device, space, 1, s3c44b0->iis.fifo[1]);
16821682         }
16831683      }
16841684      break;
trunk/src/mess/machine/ds1315.h
r17961r17962
5252    FUNCTION PROTOTYPES
5353***************************************************************************/
5454
55READ8_DEVICE_HANDLER( ds1315_r_0 );
56READ8_DEVICE_HANDLER( ds1315_r_1 );
57READ8_DEVICE_HANDLER( ds1315_r_data );
58WRITE8_DEVICE_HANDLER( ds1315_w_data );
55DECLARE_READ8_DEVICE_HANDLER( ds1315_r_0 );
56DECLARE_READ8_DEVICE_HANDLER( ds1315_r_1 );
57DECLARE_READ8_DEVICE_HANDLER( ds1315_r_data );
58DECLARE_WRITE8_DEVICE_HANDLER( ds1315_w_data );
5959
6060#endif /* __DS1315_H__ */
trunk/src/mess/machine/pc_lpt.h
r17961r17962
2424/***************************************************************************
2525    FUNCTION PROTOTYPES
2626***************************************************************************/
27READ8_DEVICE_HANDLER( pc_lpt_r );
28WRITE8_DEVICE_HANDLER( pc_lpt_w );
27DECLARE_READ8_DEVICE_HANDLER( pc_lpt_r );
28DECLARE_WRITE8_DEVICE_HANDLER( pc_lpt_w );
2929
30READ8_DEVICE_HANDLER( pc_lpt_data_r );
31WRITE8_DEVICE_HANDLER( pc_lpt_data_w );
32READ8_DEVICE_HANDLER( pc_lpt_status_r );
33READ8_DEVICE_HANDLER( pc_lpt_control_r );
34WRITE8_DEVICE_HANDLER( pc_lpt_control_w );
30DECLARE_READ8_DEVICE_HANDLER( pc_lpt_data_r );
31DECLARE_WRITE8_DEVICE_HANDLER( pc_lpt_data_w );
32DECLARE_READ8_DEVICE_HANDLER( pc_lpt_status_r );
33DECLARE_READ8_DEVICE_HANDLER( pc_lpt_control_r );
34DECLARE_WRITE8_DEVICE_HANDLER( pc_lpt_control_w );
3535
3636
3737/***************************************************************************
trunk/src/mess/machine/mc68328.c
r17961r17962
317317
318318    mc68328->regs.pwmc ^= PWMC_PIN;
319319
320    if( mc68328->iface->out_pwm_func )
320    if( !mc68328->out_pwm.isnull() )
321321    {
322        (mc68328->iface->out_pwm_func)( device, 0, (mc68328->regs.pwmc & PWMC_PIN) ? 1 : 0 );
322        mc68328->out_pwm( 0, (mc68328->regs.pwmc & PWMC_PIN) ? 1 : 0 );
323323    }
324324}
325325
r17961r17962
779779            {
780780                verboselog(device->machine(), 2, "mc68328_w: PADATA = %02x\n", data & 0x00ff);
781781                mc68328->regs.padata = data & 0x00ff;
782                if(mc68328->iface->out_port_a_func)
782                if(!mc68328->out_port_a.isnull())
783783                {
784                    (mc68328->iface->out_port_a_func)( device, 0, data & 0x00ff );
784                    mc68328->out_port_a( 0, data & 0x00ff );
785785                }
786786            }
787787            else
r17961r17962
808808            {
809809                verboselog(device->machine(), 2, "mc68328_w: PBDATA = %02x\n", data & 0x00ff);
810810                mc68328->regs.pbdata = data & 0x00ff;
811                if(mc68328->iface->out_port_b_func)
811                if(!mc68328->out_port_b.isnull())
812812                {
813                    (mc68328->iface->out_port_b_func)( device, 0, data & 0x00ff );
813                    mc68328->out_port_b( 0, data & 0x00ff );
814814                }
815815            }
816816            else
r17961r17962
837837            {
838838                verboselog(device->machine(), 2, "mc68328_w: PCDATA = %02x\n", data & 0x00ff);
839839                mc68328->regs.pcdata = data & 0x00ff;
840                if(mc68328->iface->out_port_c_func)
840                if(!mc68328->out_port_c.isnull())
841841                {
842                    (mc68328->iface->out_port_c_func)( device, 0, data & 0x00ff );
842                    mc68328->out_port_c( 0, data & 0x00ff );
843843                }
844844            }
845845            else
r17961r17962
920920            {
921921                verboselog(device->machine(), 2, "mc68328_w: PEDATA = %02x\n", data & 0x00ff);
922922                mc68328->regs.pedata = data & 0x00ff;
923                if(mc68328->iface->out_port_e_func)
923                if(!mc68328->out_port_e.isnull())
924924                {
925                    (mc68328->iface->out_port_e_func)( device, 0, data & 0x00ff );
925                    mc68328->out_port_e( 0, data & 0x00ff );
926926                }
927927            }
928928            else
r17961r17962
951951            {
952952                verboselog(device->machine(), 2, "mc68328_w: PFDATA = %02x\n", data & 0x00ff);
953953                mc68328->regs.pfdata = data & 0x00ff;
954                if(mc68328->iface->out_port_f_func)
954                if(!mc68328->out_port_f.isnull())
955955                {
956                    (mc68328->iface->out_port_f_func)( device, 0, data & 0x00ff );
956                    mc68328->out_port_f( 0, data & 0x00ff );
957957                }
958958            }
959959            else
r17961r17962
981981            {
982982                verboselog(device->machine(), 2, "mc68328_w: PGDATA = %02x\n", data & 0x00ff);
983983                mc68328->regs.pgdata = data & 0x00ff;
984                if(mc68328->iface->out_port_g_func)
984                if(!mc68328->out_port_g.isnull())
985985                {
986                    (mc68328->iface->out_port_g_func)( device, 0, data & 0x00ff );
986                    mc68328->out_port_g( 0, data & 0x00ff );
987987                }
988988            }
989989            else
r17961r17962
10111011            {
10121012                verboselog(device->machine(), 2, "mc68328_w: PJDATA = %02x\n", data & 0x00ff);
10131013                mc68328->regs.pjdata = data & 0x00ff;
1014                if(mc68328->iface->out_port_j_func)
1014                if(!mc68328->out_port_j.isnull())
10151015                {
1016                    (mc68328->iface->out_port_j_func)( device, 0, data & 0x00ff );
1016                    mc68328->out_port_j( 0, data & 0x00ff );
10171017                }
10181018            }
10191019            else
r17961r17962
10401040            {
10411041                verboselog(device->machine(), 2, "mc68328_w: PKDATA = %02x\n", data & 0x00ff);
10421042                mc68328->regs.pkdata = data & 0x00ff;
1043                if(mc68328->iface->out_port_k_func)
1043                if(!mc68328->out_port_k.isnull())
10441044                {
1045                    (mc68328->iface->out_port_k_func)( device, 0, data & 0x00ff );
1045                    mc68328->out_port_k( 0, data & 0x00ff );
10461046                }
10471047            }
10481048            else
r17961r17962
10701070            {
10711071                verboselog(device->machine(), 2, "mc68328_w: PMDATA = %02x\n", data & 0x00ff);
10721072                mc68328->regs.pmdata = data & 0x00ff;
1073                if(mc68328->iface->out_port_m_func)
1073                if(!mc68328->out_port_m.isnull())
10741074                {
1075                    (mc68328->iface->out_port_m_func)( device, 0, data & 0x00ff );
1075                    mc68328->out_port_m( 0, data & 0x00ff );
10761076                }
10771077            }
10781078            else
r17961r17962
12491249
12501250        case 0x800:
12511251            verboselog(device->machine(), 2, "mc68328_w: SPIMDATA = %04x\n", data);
1252            if(mc68328->iface->out_spim_func)
1252            if(!mc68328->out_spim.isnull())
12531253            {
1254                (mc68328->iface->out_spim_func)( device, 0, data, 0xffff );
1254                mc68328->out_spim( 0, data, 0xffff );
12551255            }
12561256            else
12571257            {
r17961r17962
18541854            if( mem_mask & 0x00ff )
18551855            {
18561856                verboselog(device->machine(), 2, "mc68328_r (%04x): PADATA = %02x\n", mem_mask, mc68328->regs.padata);
1857                if(mc68328->iface->in_port_a_func)
1857                if(!mc68328->in_port_a.isnull())
18581858                {
1859                    return (mc68328->iface->in_port_a_func)( device, 0 );
1859                    return mc68328->in_port_a( 0 );
18601860                }
18611861                else
18621862                {
r17961r17962
18861886            if( mem_mask & 0x00ff )
18871887            {
18881888                verboselog(device->machine(), 2, "mc68328_r (%04x): PBDATA = %02x\n", mem_mask, mc68328->regs.pbdata);
1889                if(mc68328->iface->in_port_b_func)
1889                if(!mc68328->in_port_b.isnull())
18901890                {
1891                    return (mc68328->iface->in_port_b_func)( device, 0 );
1891                    return mc68328->in_port_b( 0 );
18921892                }
18931893                else
18941894                {
r17961r17962
19181918            if( mem_mask & 0x00ff )
19191919            {
19201920                verboselog(device->machine(), 2, "mc68328_r (%04x): PCDATA = %02x\n", mem_mask, mc68328->regs.pcdata);
1921                if(mc68328->iface->in_port_c_func)
1921                if(!mc68328->in_port_c.isnull())
19221922                {
1923                    return (mc68328->iface->in_port_c_func)( device, 0 );
1923                    return mc68328->in_port_c( 0 );
19241924                }
19251925                else
19261926                {
r17961r17962
19501950            if( mem_mask & 0x00ff )
19511951            {
19521952                verboselog(device->machine(), 2, "mc68328_r (%04x): PDDATA = %02x\n", mem_mask, mc68328->regs.pddata);
1953                if(mc68328->iface->in_port_d_func)
1953                if(!mc68328->in_port_d.isnull())
19541954                {
1955                    return (mc68328->iface->in_port_d_func)( device, 0 );
1955                    return mc68328->in_port_d( 0 );
19561956                }
19571957                else
19581958                {
r17961r17962
20072007            if( mem_mask & 0x00ff )
20082008            {
20092009                verboselog(device->machine(), 2, "mc68328_r (%04x): PEDATA = %02x\n", mem_mask, mc68328->regs.pedata);
2010                if(mc68328->iface->in_port_e_func)
2010                if(!mc68328->in_port_e.isnull())
20112011                {
2012                    return (mc68328->iface->in_port_e_func)( device, 0 );
2012                    return mc68328->in_port_e( 0 );
20132013                }
20142014                else
20152015                {
r17961r17962
20402040            if( mem_mask & 0x00ff )
20412041            {
20422042                verboselog(device->machine(), 2, "mc68328_r (%04x): PFDATA = %02x\n", mem_mask, mc68328->regs.pfdata);
2043                if(mc68328->iface->in_port_f_func)
2043                if(!mc68328->in_port_f.isnull())
20442044                {
2045                    return (mc68328->iface->in_port_f_func)( device, 0 );
2045                    return mc68328->in_port_f( 0 );
20462046                }
20472047                else
20482048                {
r17961r17962
20732073            if( mem_mask & 0x00ff )
20742074            {
20752075                verboselog(device->machine(), 2, "mc68328_r (%04x): PGDATA = %02x\n", mem_mask, mc68328->regs.pgdata);
2076                if(mc68328->iface->in_port_g_func)
2076                if(!mc68328->in_port_g.isnull())
20772077                {
2078                    return (mc68328->iface->in_port_g_func)( device, 0 );
2078                    return mc68328->in_port_g( 0 );
20792079                }
20802080                else
20812081                {
r17961r17962
21062106            if( mem_mask & 0x00ff )
21072107            {
21082108                verboselog(device->machine(), 2, "mc68328_r (%04x): PJDATA = %02x\n", mem_mask, mc68328->regs.pjdata);
2109                if(mc68328->iface->in_port_j_func)
2109                if(!mc68328->in_port_j.isnull())
21102110                {
2111                    return (mc68328->iface->in_port_j_func)( device, 0 );
2111                    return mc68328->in_port_j( 0 );
21122112                }
21132113                else
21142114                {
r17961r17962
21382138            if( mem_mask & 0x00ff )
21392139            {
21402140                verboselog(device->machine(), 2, "mc68328_r (%04x): PKDATA = %02x\n", mem_mask, mc68328->regs.pkdata);
2141                if(mc68328->iface->in_port_k_func)
2141                if(!mc68328->in_port_k.isnull())
21422142                {
2143                    return (mc68328->iface->in_port_k_func)( device, 0 );
2143                    return mc68328->in_port_k( 0 );
21442144                }
21452145                else
21462146                {
r17961r17962
21712171            if( mem_mask & 0x00ff )
21722172            {
21732173                verboselog(device->machine(), 2, "mc68328_r (%04x): PMDATA = %02x\n", mem_mask, mc68328->regs.pmdata);
2174                if(mc68328->iface->in_port_m_func)
2174                if(!mc68328->in_port_m.isnull())
21752175                {
2176                    return (mc68328->iface->in_port_m_func)( device, 0 );
2176                    return mc68328->in_port_m( 0 );
21772177                }
21782178                else
21792179                {
r17961r17962
22902290
22912291        case 0x800:
22922292            verboselog(device->machine(), 2, "mc68328_r (%04x): SPIMDATA = %04x\n", mem_mask, mc68328->regs.spimdata);
2293            if(mc68328->iface->in_spim_func)
2293            if(!mc68328->in_spim.isnull())
22942294            {
2295                return (mc68328->iface->in_spim_func)( device, 0, 0xffff );
2295                return mc68328->in_spim( 0, 0xffff );
22962296            }
22972297            return mc68328->regs.spimdata;
22982298
r17961r17962
28002800
28012801    mc68328->iface = (const mc68328_interface*)device->static_config();
28022802
2803    mc68328->out_port_a.resolve(mc68328->iface->out_port_a_func, *device);
2804    mc68328->out_port_b.resolve(mc68328->iface->out_port_b_func, *device);
2805    mc68328->out_port_c.resolve(mc68328->iface->out_port_c_func, *device);
2806    mc68328->out_port_d.resolve(mc68328->iface->out_port_d_func, *device);
2807    mc68328->out_port_e.resolve(mc68328->iface->out_port_e_func, *device);
2808    mc68328->out_port_f.resolve(mc68328->iface->out_port_f_func, *device);
2809    mc68328->out_port_g.resolve(mc68328->iface->out_port_g_func, *device);
2810    mc68328->out_port_j.resolve(mc68328->iface->out_port_j_func, *device);
2811    mc68328->out_port_k.resolve(mc68328->iface->out_port_k_func, *device);
2812    mc68328->out_port_m.resolve(mc68328->iface->out_port_m_func, *device);
2813
2814    mc68328->in_port_a.resolve(mc68328->iface->in_port_a_func, *device);
2815    mc68328->in_port_b.resolve(mc68328->iface->in_port_b_func, *device);
2816    mc68328->in_port_c.resolve(mc68328->iface->in_port_c_func, *device);
2817    mc68328->in_port_d.resolve(mc68328->iface->in_port_d_func, *device);
2818    mc68328->in_port_e.resolve(mc68328->iface->in_port_e_func, *device);
2819    mc68328->in_port_f.resolve(mc68328->iface->in_port_f_func, *device);
2820    mc68328->in_port_g.resolve(mc68328->iface->in_port_g_func, *device);
2821    mc68328->in_port_j.resolve(mc68328->iface->in_port_j_func, *device);
2822    mc68328->in_port_k.resolve(mc68328->iface->in_port_k_func, *device);
2823    mc68328->in_port_m.resolve(mc68328->iface->in_port_m_func, *device);
2824
2825    mc68328->out_pwm.resolve(mc68328->iface->out_pwm_func, *device);
2826
2827    mc68328->out_spim.resolve(mc68328->iface->out_spim_func, *device);
2828    mc68328->in_spim.resolve(mc68328->iface->in_spim_func, *device);
2829
28032830    mc68328->gptimer[0] = device->machine().scheduler().timer_alloc(FUNC(mc68328_timer1_hit));
28042831    mc68328->gptimer[1] = device->machine().scheduler().timer_alloc(FUNC(mc68328_timer2_hit));
28052832    mc68328->rtc = device->machine().scheduler().timer_alloc(FUNC(mc68328_rtc_tick));
trunk/src/mess/machine/partner.c
r17961r17962
8484
8585   if (offset<0x100) {
8686      switch(offset & 3) {
87         case 0x00 : return wd17xx_status_r(fdc,0);
88         case 0x01 : return wd17xx_track_r(fdc,0);
89         case 0x02 : return wd17xx_sector_r(fdc,0);
87         case 0x00 : return wd17xx_status_r(fdc,space, 0);
88         case 0x01 : return wd17xx_track_r(fdc,space, 0);
89         case 0x02 : return wd17xx_sector_r(fdc,space, 0);
9090         default   :
91                  return wd17xx_data_r(fdc,0);
91                  return wd17xx_data_r(fdc,space, 0);
9292      }
9393   } else {
9494      return 0;
r17961r17962
100100
101101   if (offset<0x100) {
102102      switch(offset & 3) {
103         case 0x00 : wd17xx_command_w(fdc,0,data); break;
104         case 0x01 : wd17xx_track_w(fdc,0,data);break;
105         case 0x02 : wd17xx_sector_w(fdc,0,data);break;
106         default   : wd17xx_data_w(fdc,0,data);break;
103         case 0x00 : wd17xx_command_w(fdc,space, 0,data); break;
104         case 0x01 : wd17xx_track_w(fdc,space, 0,data);break;
105         case 0x02 : wd17xx_sector_w(fdc,space, 0,data);break;
106         default   : wd17xx_data_w(fdc,space, 0,data);break;
107107      }
108108   } else {
109109      floppy_mon_w(floppy_get_device(machine(), 0), 1);
trunk/src/mess/machine/pc_fdc.c
r17961r17962
194194
195195
196196
197int   pc_fdc_dack_r(running_machine &machine)
197int   pc_fdc_dack_r(running_machine &machine, address_space &space)
198198{
199199   int data;
200200
r17961r17962
204204   /* if dma is not enabled, dacks are not acknowledged */
205205   if ((fdc->digital_output_register & PC_FDC_FLAGS_DOR_DMA_ENABLED)!=0)
206206   {
207      data = upd765_dack_r(pc_get_device(machine), 0);
207      data = upd765_dack_r(pc_get_device(machine), space, 0);
208208   }
209209
210210   return data;
r17961r17962
212212
213213
214214
215void pc_fdc_dack_w(running_machine &machine, int data)
215void pc_fdc_dack_w(running_machine &machine, address_space &space, int data)
216216{
217217   /* if dma is not enabled, dacks are not issued */
218218   if ((fdc->digital_output_register & PC_FDC_FLAGS_DOR_DMA_ENABLED)!=0)
219219   {
220220      /* dma acknowledge - and send byte to fdc */
221      upd765_dack_w(pc_get_device(machine), 0,data);
221      upd765_dack_w(pc_get_device(machine), space, 0,data);
222222   }
223223}
224224
r17961r17962
270270     `------------------ 1 = turn floppy drive D motor on
271271 */
272272
273static void pc_fdc_dor_w(running_machine &machine, UINT8 data)
273static WRITE8_HANDLER( pc_fdc_dor_w )
274274{
275275   int selected_drive;
276276   int floppy_count;
277277
278   floppy_count = floppy_get_count(machine);
278   floppy_count = floppy_get_count(space->machine());
279279
280280   if (floppy_count > (fdc->digital_output_register & 0x03))
281      floppy_drive_set_ready_state(floppy_get_device(machine, fdc->digital_output_register & 0x03), 1, 0);
281      floppy_drive_set_ready_state(floppy_get_device(space->machine(), fdc->digital_output_register & 0x03), 1, 0);
282282
283283   fdc->digital_output_register = data;
284284
r17961r17962
286286
287287   /* set floppy drive motor state */
288288   if (floppy_count > 0)
289      floppy_mon_w(floppy_get_device(machine, 0), !BIT(data, 4));
289      floppy_mon_w(floppy_get_device(space->machine(), 0), !BIT(data, 4));
290290   if (floppy_count > 1)
291      floppy_mon_w(floppy_get_device(machine, 1), !BIT(data, 5));
291      floppy_mon_w(floppy_get_device(space->machine(), 1), !BIT(data, 5));
292292   if (floppy_count > 2)
293      floppy_mon_w(floppy_get_device(machine, 2), !BIT(data, 6));
293      floppy_mon_w(floppy_get_device(space->machine(), 2), !BIT(data, 6));
294294   if (floppy_count > 3)
295      floppy_mon_w(floppy_get_device(machine, 3), !BIT(data, 7));
295      floppy_mon_w(floppy_get_device(space->machine(), 3), !BIT(data, 7));
296296
297297   if ((data>>4) & (1<<selected_drive))
298298   {
299299      if (floppy_count > selected_drive)
300         floppy_drive_set_ready_state(floppy_get_device(machine, selected_drive), 1, 0);
300         floppy_drive_set_ready_state(floppy_get_device(space->machine(), selected_drive), 1, 0);
301301   }
302302
303303   /* changing the DMA enable bit, will affect the terminal count state
304304    from reaching the fdc - if dma is enabled this will send it through
305305    otherwise it will be ignored */
306   pc_fdc_set_tc_state(machine, fdc->tc_state);
306   pc_fdc_set_tc_state(space->machine(), fdc->tc_state);
307307
308308   /* changing the DMA enable bit, will affect the dma drq state
309309    from reaching us - if dma is enabled this will send it through
310310    otherwise it will be ignored */
311   pc_fdc_hw_dma_drq(pc_get_device(machine), fdc->dma_state);
311   pc_fdc_hw_dma_drq(pc_get_device(space->machine()), fdc->dma_state);
312312
313313   /* changing the DMA enable bit, will affect the irq state
314314    from reaching us - if dma is enabled this will send it through
315315    otherwise it will be ignored */
316   pc_fdc_hw_interrupt(pc_get_device(machine), fdc->int_state);
316   pc_fdc_hw_interrupt(pc_get_device(space->machine()), fdc->int_state);
317317
318318   /* reset? */
319319   if ((fdc->digital_output_register & PC_FDC_FLAGS_DOR_FDC_ENABLED)==0)
r17961r17962
336336        what is not yet clear is if this is a result of the drives ready state
337337        changing...
338338        */
339         upd765_ready_w(pc_get_device(machine),1);
339         upd765_ready_w(pc_get_device(space->machine()),1);
340340
341341      /* set FDC at reset */
342      upd765_reset_w(pc_get_device(machine), 1);
342      upd765_reset_w(pc_get_device(space->machine()), 1);
343343   }
344344   else
345345   {
346      pc_fdc_set_tc_state(machine, 0);
346      pc_fdc_set_tc_state(space->machine(), 0);
347347
348348      /* release reset on fdc */
349      upd765_reset_w(pc_get_device(machine), 0);
349      upd765_reset_w(pc_get_device(space->machine()), 0);
350350   }
351351}
352352
r17961r17962
377377   }
378378}
379379
380static void pcjr_fdc_dor_w(running_machine &machine, UINT8 data)
380static WRITE8_HANDLER( pcjr_fdc_dor_w )
381381{
382382   int floppy_count;
383383
384   floppy_count = floppy_get_count(machine);
384   floppy_count = floppy_get_count(space->machine());
385385
386386   /* set floppy drive motor state */
387387   if (floppy_count > 0)
388      floppy_mon_w(floppy_get_device(machine, 0), BIT(data, 0) ? CLEAR_LINE : ASSERT_LINE);
388      floppy_mon_w(floppy_get_device(space->machine(), 0), BIT(data, 0) ? CLEAR_LINE : ASSERT_LINE);
389389
390390   if ( data & 0x01 )
391391   {
392392      if ( floppy_count )
393         floppy_drive_set_ready_state(floppy_get_device(machine, 0), 1, 0);
393         floppy_drive_set_ready_state(floppy_get_device(space->machine(), 0), 1, 0);
394394   }
395395
396396   /* Is the watchdog timer disabled */
r17961r17962
399399      fdc->watchdog->adjust( attotime::never );
400400      if ( fdc->fdc_interface.pc_fdc_interrupt )
401401      {
402         fdc->fdc_interface.pc_fdc_interrupt(machine, 0 );
402         fdc->fdc_interface.pc_fdc_interrupt(space->machine(), 0 );
403403      }
404404   } else {
405405      /* Check for 1->0 watchdog trigger */
r17961r17962
431431        what is not yet clear is if this is a result of the drives ready state
432432        changing...
433433        */
434         upd765_ready_w(pc_get_device(machine),1);
434         upd765_ready_w(pc_get_device(space->machine()),1);
435435
436436      /* set FDC at reset */
437      upd765_reset_w(pc_get_device(machine), 1);
437      upd765_reset_w(pc_get_device(space->machine()), 1);
438438   }
439439   else
440440   {
441      pc_fdc_set_tc_state(machine, 0);
441      pc_fdc_set_tc_state(space->machine(), 0);
442442
443443      /* release reset on fdc */
444      upd765_reset_w(pc_get_device(machine), 0);
444      upd765_reset_w(pc_get_device(space->machine()), 0);
445445   }
446446
447447   logerror("pcjr_fdc_dor_w: changing dor from %02x to %02x\n", fdc->digital_output_register, data);
r17961r17962
498498      case 3: /* tape drive select? */
499499         break;
500500      case 4:
501         data = upd765_status_r(pc_get_device(space->machine()), 0);
501         data = upd765_status_r(pc_get_device(space->machine()), *space, 0);
502502         break;
503503      case 5:
504         data = upd765_data_r(pc_get_device(space->machine()), offset);
504         data = upd765_data_r(pc_get_device(space->machine()), *space, offset);
505505         break;
506506      case 6: /* FDC reserved */
507507         break;
r17961r17962
531531      case 1:   /* n/a */
532532         break;
533533      case 2:
534         pc_fdc_dor_w(space->machine(), data);
534         pc_fdc_dor_w(space, 0, data);
535535         break;
536536      case 3:
537537         /* tape drive select? */
r17961r17962
540540         pc_fdc_data_rate_w(space->machine(), data);
541541         break;
542542      case 5:
543         upd765_data_w(pc_get_device(space->machine()), 0, data);
543         upd765_data_w(pc_get_device(space->machine()), *space, 0, data);
544544         break;
545545      case 6:
546546         /* FDC reserved */
r17961r17962
568568   switch(offset)
569569   {
570570      case 2:
571         pcjr_fdc_dor_w( space->machine(), data );
571         pcjr_fdc_dor_w( space, 0, data );
572572         break;
573573      case 4:
574574      case 7:
trunk/src/mess/machine/mc68328.h
r17961r17962
212212    emu_timer *gptimer[2];
213213    emu_timer *rtc;
214214    emu_timer *pwm;
215
216    devcb_resolved_write8  out_port_a;    /* 8-bit output */
217    devcb_resolved_write8  out_port_b;    /* 8-bit output */
218    devcb_resolved_write8  out_port_c;    /* 8-bit output */
219    devcb_resolved_write8  out_port_d;    /* 8-bit output */
220    devcb_resolved_write8  out_port_e;    /* 8-bit output */
221    devcb_resolved_write8  out_port_f;    /* 8-bit output */
222    devcb_resolved_write8  out_port_g;    /* 8-bit output */
223    devcb_resolved_write8  out_port_j;    /* 8-bit output */
224    devcb_resolved_write8  out_port_k;    /* 8-bit output */
225    devcb_resolved_write8  out_port_m;    /* 8-bit output */
226
227    devcb_resolved_read8   in_port_a;     /* 8-bit input */
228    devcb_resolved_read8   in_port_b;     /* 8-bit input */
229    devcb_resolved_read8   in_port_c;     /* 8-bit input */
230    devcb_resolved_read8   in_port_d;     /* 8-bit input */
231    devcb_resolved_read8   in_port_e;     /* 8-bit input */
232    devcb_resolved_read8   in_port_f;     /* 8-bit input */
233    devcb_resolved_read8   in_port_g;     /* 8-bit input */
234    devcb_resolved_read8   in_port_j;     /* 8-bit input */
235    devcb_resolved_read8   in_port_k;     /* 8-bit input */
236    devcb_resolved_read8   in_port_m;     /* 8-bit input */
237
238    devcb_resolved_write8  out_pwm;       /* 1-bit output */
239
240    devcb_resolved_write16 out_spim;      /* 16-bit output */
241    devcb_resolved_read16  in_spim;       /* 16-bit input */
215242};
216243
217244#define SCR_BETO                0x80
trunk/src/mess/machine/sc499.h
r17961r17962
2020 FUNCTION PROTOTYPES
2121 ***************************************************************************/
2222
23READ8_DEVICE_HANDLER( sc499_r );
24WRITE8_DEVICE_HANDLER( sc499_w );
23DECLARE_READ8_DEVICE_HANDLER( sc499_r );
24DECLARE_WRITE8_DEVICE_HANDLER( sc499_w );
2525
2626void sc499_set_tc_state(running_machine *machine, int state);
2727UINT8 sc499_dack_r(running_machine *machine);
trunk/src/mess/machine/pc_fdc.h
r17961r17962
4040void pc_fdc_reset(running_machine &machine);
4141void pc_fdc_init(running_machine &machine, const struct pc_fdc_interface *iface);
4242void pc_fdc_set_tc_state(running_machine &machine, int state);
43int   pc_fdc_dack_r(running_machine &machine);
44void pc_fdc_dack_w(running_machine &machine, int);
43int   pc_fdc_dack_r(running_machine &machine, address_space &space);
44void pc_fdc_dack_w(running_machine &machine, address_space &space, int data);
4545
4646READ8_HANDLER(pc_fdc_r);
4747WRITE8_HANDLER(pc_fdc_w);
trunk/src/mess/machine/c64_ieee488.c
r17961r17962
290290   }
291291   else if (!io2)
292292   {
293      data |= tpi6525_r(m_tpi, offset & 0x07);
293      data |= tpi6525_r(m_tpi, space, offset & 0x07);
294294   }
295295
296296   return data;
r17961r17962
305305{
306306   if (!io2)
307307   {
308      tpi6525_w(m_tpi, offset & 0x07, data);
308      tpi6525_w(m_tpi, space, offset & 0x07, data);
309309   }
310310
311311   m_exp->cd_w(space, offset, data, ba, roml, romh, io1, io2);
trunk/src/mess/machine/hec2hrp.c
r17961r17962
131131   {
132132      /* minidisc floppy disc interface */
133133      case 0x04:
134         data = wd17xx_status_r(fdc, 0);
134         data = wd17xx_status_r(fdc, space, 0);
135135         break;
136136      case 0x05:
137         data = wd17xx_track_r(fdc, 0);
137         data = wd17xx_track_r(fdc, space, 0);
138138         break;
139139      case 0x06:
140         data = wd17xx_sector_r(fdc, 0);
140         data = wd17xx_sector_r(fdc, space, 0);
141141         break;
142142      case 0x07:
143         data = wd17xx_data_r(fdc, 0);
143         data = wd17xx_data_r(fdc, space, 0);
144144         break;
145145      default:
146146         break;
r17961r17962
155155   {
156156      /* minidisc floppy disc interface */
157157      case 0x04:
158         wd17xx_command_w(fdc, 0, data);
158         wd17xx_command_w(fdc, space, 0, data);
159159         break;
160160      case 0x05:
161         wd17xx_track_w(fdc, 0, data);
161         wd17xx_track_w(fdc, space, 0, data);
162162         break;
163163      case 0x06:
164         wd17xx_sector_w(fdc, 0, data);
164         wd17xx_sector_w(fdc, space, 0, data);
165165         break;
166166      case 0x07:
167167         /*write into command register*/
168         wd17xx_data_w(fdc, 0, data);
168         wd17xx_data_w(fdc, space, 0, data);
169169         break;
170170      case 0x08:
171171         /*General purpose port (0x08) for the minidisk I/O */
r17961r17962
429429   if (data & 0x40) m_hector_color[2] |= 8; else m_hector_color[2] &= 7;
430430
431431   /* Play bit*/
432   discrete_sound_w(discrete, NODE_01,  (data & 0x80) ? 0:1 );
432   discrete_sound_w(discrete, space, NODE_01,  (data & 0x80) ? 0:1 );
433433}
434434
435435
trunk/src/mess/machine/bebox.c
r17961r17962
696696
697697
698698static READ8_DEVICE_HANDLER( bebox_dma8237_fdc_dack_r ) {
699   return pc_fdc_dack_r(device->machine());
699   return pc_fdc_dack_r(device->machine(),space);
700700}
701701
702702
703703static WRITE8_DEVICE_HANDLER( bebox_dma8237_fdc_dack_w ) {
704   pc_fdc_dack_w( device->machine(), data );
704   pc_fdc_dack_w( device->machine(), space, data );
705705}
706706
707707
trunk/src/mess/machine/micropolis.c
r17961r17962
306306
307307   switch (offset & 0x03)
308308   {
309   case 0: data = micropolis_status_r(device, 0); break;
310   case 1:   data = micropolis_status_r(device, 1); break;
309   case 0: data = micropolis_status_r(device, space, 0); break;
310   case 1:   data = micropolis_status_r(device, space, 1); break;
311311   case 2:
312   case 3:   data = micropolis_data_r(device, 0); break;
312   case 3:   data = micropolis_data_r(device, space, 0); break;
313313   }
314314
315315   return data;
r17961r17962
320320   switch (offset & 0x03)
321321   {
322322   case 0:
323   case 1:   micropolis_command_w(device, 0, data); break;
323   case 1:   micropolis_command_w(device, space, 0, data); break;
324324   case 2:
325   case 3: micropolis_data_w(device, 0, data);    break;
325   case 3: micropolis_data_w(device, space, 0, data);    break;
326326   }
327327}
328328
trunk/src/mess/machine/s100.c
r17961r17962
181181
182182   while (entry)
183183   {
184      data |= entry->s100_smemr_r(offset);
184      data |= entry->s100_smemr_r(space, offset);
185185      entry = entry->next();
186186   }
187187
r17961r17962
199199
200200   while (entry)
201201   {
202      entry->s100_mwrt_w(offset, data);
202      entry->s100_mwrt_w(space, offset, data);
203203      entry = entry->next();
204204   }
205205}
r17961r17962
217217
218218   while (entry)
219219   {
220      data |= entry->s100_sinp_r(offset);
220      data |= entry->s100_sinp_r(space, offset);
221221      entry = entry->next();
222222   }
223223
r17961r17962
235235
236236   while (entry)
237237   {
238      entry->s100_sout_w(offset, data);
238      entry->s100_sout_w(space, offset, data);
239239      entry = entry->next();
240240   }
241241}
trunk/src/mess/machine/micropolis.h
r17961r17962
6161
6262void micropolis_set_drive(device_t *device, UINT8); // set current drive (0-3)
6363
64READ8_DEVICE_HANDLER( micropolis_status_r );
65READ8_DEVICE_HANDLER( micropolis_data_r );
64DECLARE_READ8_DEVICE_HANDLER( micropolis_status_r );
65DECLARE_READ8_DEVICE_HANDLER( micropolis_data_r );
6666
67WRITE8_DEVICE_HANDLER( micropolis_command_w );
68WRITE8_DEVICE_HANDLER( micropolis_data_w );
67DECLARE_WRITE8_DEVICE_HANDLER( micropolis_command_w );
68DECLARE_WRITE8_DEVICE_HANDLER( micropolis_data_w );
6969
70READ8_DEVICE_HANDLER( micropolis_r );
71WRITE8_DEVICE_HANDLER( micropolis_w );
70DECLARE_READ8_DEVICE_HANDLER( micropolis_r );
71DECLARE_WRITE8_DEVICE_HANDLER( micropolis_w );
7272
7373extern const micropolis_interface default_micropolis_interface;
7474
trunk/src/mess/machine/s100.h
r17961r17962
266266   virtual void s100_vi7_w(int state) { };
267267
268268   // memory access
269   virtual UINT8 s100_smemr_r(offs_t offset) { return 0; };
270   virtual void s100_mwrt_w(offs_t offset, UINT8 data) { };
269   virtual UINT8 s100_smemr_r(address_space &space, offs_t offset) { return 0; };
270   virtual void s100_mwrt_w(address_space &space, offs_t offset, UINT8 data) { };
271271
272272   // I/O access
273   virtual UINT8 s100_sinp_r(offs_t offset) { return 0; };
274   virtual void s100_sout_w(offs_t offset, UINT8 data) { };
273   virtual UINT8 s100_sinp_r(address_space &space, offs_t offset) { return 0; };
274   virtual void s100_sout_w(address_space &space, offs_t offset, UINT8 data) { };
275275
276276   // configuration access
277277   virtual void s100_phlda_w(int state) { }
trunk/src/mess/machine/a2diskii.c
r17961r17962
138138
139139UINT8 a2bus_floppy_device::read_c0nx(address_space &space, UINT8 offset)
140140{
141   return applefdc_r(m_fdc, offset);
141   return applefdc_r(m_fdc, space, offset);
142142}
143143
144144
r17961r17962
148148
149149void a2bus_floppy_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data)
150150{
151    applefdc_w(m_fdc, offset, data);
151    applefdc_w(m_fdc, space, offset, data);
152152}
153153
154154/*-------------------------------------------------
trunk/src/mess/machine/abc77.c
r17961r17962
589589   }
590590
591591   // beep
592   discrete_sound_w(m_discrete, NODE_01, BIT(data, 4));
592   discrete_sound_w(m_discrete, space, NODE_01, BIT(data, 4));
593593
594594   // transmit data
595595   serial_output(BIT(data, 5));
trunk/src/mess/machine/c64.c
r17961r17962
8080
8181static READ8_DEVICE_HANDLER( c64_cia0_port_a_r )
8282{
83   UINT8 cia0portb = mos6526_pb_r(device->machine().device("cia_0"), 0);
83   UINT8 cia0portb = mos6526_pb_r(device->machine().device("cia_0"), space, 0);
8484
8585   return cbm_common_cia0_port_a_r(device, cia0portb);
8686}
8787
8888static READ8_DEVICE_HANDLER( c64_cia0_port_b_r )
8989{
90   UINT8 cia0porta = mos6526_pa_r(device->machine().device("cia_0"), 0);
90   UINT8 cia0porta = mos6526_pa_r(device->machine().device("cia_0"), space, 0);
9191
9292   return cbm_common_cia0_port_b_r(device, cia0porta);
9393}
r17961r17962
256256
257257   state->m_io_mirror[offset] = data;
258258   if (offset < 0x400)
259      vic2_port_w(vic2, offset & 0x3ff, data);
259      vic2_port_w(vic2, *space, offset & 0x3ff, data);
260260   else if (offset < 0x800)
261261      sid->write(*space, offset & 0x3ff, data);
262262   else if (offset < 0xc00)
263263      state->m_colorram[offset & 0x3ff] = data | 0xf0;
264264   else if (offset < 0xd00)
265      mos6526_w(cia_0, offset, data);
265      mos6526_w(cia_0, *space, offset, data);
266266   else if (offset < 0xe00)
267267   {
268268      if (state->m_cia1_on)
269         mos6526_w(cia_1, offset, data);
269         mos6526_w(cia_1, *space, offset, data);
270270      else
271271         DBG_LOG(space->machine(), 1, "io write", ("%.3x %.2x\n", offset, data));
272272   }
r17961r17962
294294   device_t *vic2 = space->machine().device("vic2");
295295
296296   if (offset < 0x400)
297      return vic2_port_r(vic2, offset & 0x3ff);
297      return vic2_port_r(vic2, *space, offset & 0x3ff);
298298
299299   else if (offset < 0x800)
300300      return sid->read(*space, offset & 0x3ff);
r17961r17962
309309         else
310310            cia_set_port_mask_value(cia_0, 0, state->ioport("CTRLSEL")->read() & 0x80 ? c64_keyline[8] : c64_keyline[9] );
311311
312         return mos6526_r(cia_0, offset);
312         return mos6526_r(cia_0, *space, offset);
313313      }
314314
315315   else if (state->m_cia1_on && (offset < 0xe00))
316      return mos6526_r(cia_1, offset);
316      return mos6526_r(cia_1, *space, offset);
317317
318318   DBG_LOG(space->machine(), 1, "io read", ("%.3x\n", offset));
319319
r17961r17962
611611}
612612
613613
614int c64_paddle_read( device_t *device, int which )
614int c64_paddle_read( device_t *device, address_space &space, int which )
615615{
616616   running_machine &machine = device->machine();
617617   int pot1 = 0xff, pot2 = 0xff, pot3 = 0xff, pot4 = 0xff, temp;
618   UINT8 cia0porta = mos6526_pa_r(machine.device("cia_0"), 0);
618   UINT8 cia0porta = mos6526_pa_r(machine.device("cia_0"), space, 0);
619619   int controller1 = machine.root_device().ioport("CTRLSEL")->read() & 0x07;
620620   int controller2 = machine.root_device().ioport("CTRLSEL")->read() & 0x70;
621621   /* Notice that only a single input is defined for Mouse & Lightpen in both ports */
trunk/src/mess/machine/pc.c
r17961r17962
200200
201201static READ8_DEVICE_HANDLER( pc_dma8237_fdc_dack_r )
202202{
203   return pc_fdc_dack_r(device->machine());
203   return pc_fdc_dack_r(device->machine(), space);
204204}
205205
206206
r17961r17962
212212
213213static WRITE8_DEVICE_HANDLER( pc_dma8237_fdc_dack_w )
214214{
215   pc_fdc_dack_w( device->machine(), data );
215   pc_fdc_dack_w( device->machine(), space, data );
216216}
217217
218218
trunk/src/mess/machine/hd63450.h
r17961r17962
4747   MCFG_DEVICE_ADD(_tag, HD63450, 0) \
4848   MCFG_DEVICE_CONFIG(_config)
4949
50READ16_DEVICE_HANDLER( hd63450_r );
51WRITE16_DEVICE_HANDLER( hd63450_w );
50DECLARE_READ16_DEVICE_HANDLER( hd63450_r );
51DECLARE_WRITE16_DEVICE_HANDLER( hd63450_w );
trunk/src/mess/machine/bbc.c
r17961r17962
573573            return acia->data_read(space,0);
574574      }
575575      if ((myo>=0x10) && (myo<=0x17)) return 0xfe;                  /* Serial System Chip */
576      if ((myo>=0x18) && (myo<=0x1f)) return uPD7002_r(machine().device("upd7002"), myo-0x18);         /* A to D converter */
576      if ((myo>=0x18) && (myo<=0x1f)) return uPD7002_r(machine().device("upd7002"), space, myo-0x18);         /* A to D converter */
577577      if ((myo>=0x20) && (myo<=0x23)) return 0xfe;                  /* VideoULA */
578578      if ((myo>=0x24) && (myo<=0x27)) return bbcm_wd1770l_read(space, myo-0x24); /* 1770 */
579579      if ((myo>=0x28) && (myo<=0x2f)) return bbcm_wd1770_read(space, myo-0x28);  /* disc control latch */
r17961r17962
583583      if ((myo>=0x40) && (myo<=0x5f)) return via_0->read(space,myo-0x40);
584584      if ((myo>=0x60) && (myo<=0x7f)) return via_1->read(space,myo-0x60);
585585      if ((myo>=0x80) && (myo<=0x9f)) return 0xfe;
586      if ((myo>=0xa0) && (myo<=0xbf)) return mc6854_r(adlc, myo & 0x03);
586      if ((myo>=0xa0) && (myo<=0xbf)) return mc6854_r(adlc, space, myo & 0x03);
587587      if ((myo>=0xc0) && (myo<=0xdf)) return 0xfe;
588588      if ((myo>=0xe0) && (myo<=0xff)) return 0xfe;
589589   }
r17961r17962
613613            acia->data_write(space, 0, data);
614614      }
615615      if ((myo>=0x10) && (myo<=0x17)) bbc_SerialULA_w(space, myo-0x10,data);      /* Serial System Chip */
616      if ((myo>=0x18) && (myo<=0x1f)) uPD7002_w(machine().device("upd7002"),myo-0x18,data);         /* A to D converter */
616      if ((myo>=0x18) && (myo<=0x1f)) uPD7002_w(machine().device("upd7002"),space,myo-0x18,data);         /* A to D converter */
617617      if ((myo>=0x20) && (myo<=0x23)) bbc_videoULA_w(space, myo-0x20,data);         /* VideoULA */
618618      if ((myo>=0x24) && (myo<=0x27)) bbcm_wd1770l_write(space, myo-0x24,data);   /* 1770 */
619619      if ((myo>=0x28) && (myo<=0x2f)) bbcm_wd1770_write(space, myo-0x28,data);   /* disc control latch */
r17961r17962
623623      if ((myo>=0x40) && (myo<=0x5f)) via_0->write(space,myo-0x40, data);
624624      if ((myo>=0x60) && (myo<=0x7f)) via_1->write(space,myo-0x60, data);
625625      //if ((myo>=0x80) && (myo<=0x9f))
626      if ((myo>=0xa0) && (myo<=0xbf)) mc6854_w(adlc, myo & 0x03, data);
626      if ((myo>=0xa0) && (myo<=0xbf)) mc6854_w(adlc, space, myo & 0x03, data);
627627      //if ((myo>=0xc0) && (myo<=0xdf))
628628      //if ((myo>=0xe0) && (myo<=0xff))
629629   }
r17961r17962
814814
815815
816816
817static int bbc_keyboard(address_space *space, int data)
817static int bbc_keyboard(address_space &space, int data)
818818{
819   bbc_state *state = space->machine().driver_data<bbc_state>();
819   bbc_state *state = space.machine().driver_data<bbc_state>();
820820   int bit;
821821   int row;
822822   int res;
r17961r17962
824824      "COL0", "COL1", "COL2", "COL3", "COL4",
825825      "COL5", "COL6", "COL7", "COL8", "COL9"
826826   };
827   via6522_device *via_0 = space->machine().device<via6522_device>("via6522_0");
827   via6522_device *via_0 = space.machine().device<via6522_device>("via6522_0");
828828
829829   state->m_column = data & 0x0f;
830830   row = (data>>4) & 0x07;
r17961r17962
833833
834834   if (state->m_column < 10)
835835   {
836      res = space->machine().root_device().ioport(colnames[state->m_column])->read();
836      res = space.machine().root_device().ioport(colnames[state->m_column])->read();
837837   }
838838   else
839839   {
r17961r17962
874874
875875
876876/* This the BBC Masters Real Time Clock and NVRam IC */
877static void MC146818_set(address_space *space)
877static void MC146818_set(address_space &space)
878878{
879   bbc_state *state = space->machine().driver_data<bbc_state>();
879   bbc_state *state = space.machine().driver_data<bbc_state>();
880880   logerror ("146181 WR=%d DS=%d AS=%d CE=%d \n",state->m_MC146818_WR,state->m_MC146818_DS,state->m_MC146818_AS,state->m_MC146818_CE);
881   mc146818_device *rtc = space->machine().device<mc146818_device>("rtc");
881   mc146818_device *rtc = space.machine().device<mc146818_device>("rtc");
882882
883883   // if chip enabled
884884   if (state->m_MC146818_CE)
r17961r17962
888888      {
889889         if (state->m_MC146818_WR)
890890         {
891            state->m_via_system_porta=rtc->read(*space, 1);
891            state->m_via_system_porta=rtc->read(space, 1);
892892            //logerror("read 146818 data %d \n",state->m_via_system_porta);
893893         }
894894         else
895895         {
896            rtc->write(*space, 1, state->m_via_system_porta);
896            rtc->write(space, 1, state->m_via_system_porta);
897897            //logerror("write 146818 data %d \n",state->m_via_system_porta);
898898         }
899899      }
r17961r17962
901901      // if address select is set then set the address in the 146818
902902      if (state->m_MC146818_AS)
903903      {
904         rtc->write(*space, 0, state->m_via_system_porta);
904         rtc->write(space, 0, state->m_via_system_porta);
905905         //logerror("write 146818 address %d \n",state->m_via_system_porta);
906906      }
907907   }
r17961r17962
911911static WRITE8_DEVICE_HANDLER( bbcb_via_system_write_porta )
912912{
913913   bbc_state *state = device->machine().driver_data<bbc_state>();
914   address_space *space = device->machine().device("maincpu")->memory().space(AS_PROGRAM);
915914   //logerror("SYSTEM write porta %d\n",data);
916915
917916   state->m_via_system_porta = data;
918917   if (state->m_b0_sound == 0)
919918   {
920919      //logerror("Doing an unsafe write to the sound chip %d \n",data);
921      state->m_sn->write(*device->machine().device<legacy_cpu_device>("maincpu")->space(), 0,state->m_via_system_porta);
920      state->m_sn->write(space, 0,state->m_via_system_porta);
922921   }
923922   if (state->m_b3_keyboard == 0)
924923   {
r17961r17962
932931static WRITE8_DEVICE_HANDLER( bbcb_via_system_write_portb )
933932{
934933   bbc_state *state = device->machine().driver_data<bbc_state>();
935   address_space *space = device->machine().device("maincpu")->memory().space(AS_PROGRAM);
936934   int bit, value;
937935   bit = data & 0x07;
938936   value = (data >> 3) & 0x01;
r17961r17962
10301028         if (state->m_b0_sound == 1)
10311029         {
10321030            state->m_b0_sound = 0;
1033            state->m_sn->write(*device->machine().device<legacy_cpu_device>("maincpu")->space(), 0, state->m_via_system_porta);
1031            state->m_sn->write(space, 0, state->m_via_system_porta);
10341032         }
10351033         break;
10361034      case 1:
r17961r17962
11761174/* joystick EOC */
11771175static READ8_DEVICE_HANDLER( bbcb_via_system_read_cb1 )
11781176{
1179   return uPD7002_EOC_r(device->machine().device("upd7002"),0);
1177   return uPD7002_EOC_r(device->machine().device("upd7002"),space,0);
11801178}
11811179
11821180
r17961r17962
14531451      case 2:
14541452      case 3:
14551453         /* 8271 registers */
1456         ret=i8271_r(i8271, offset);
1454         ret=i8271_r(i8271, space, offset);
14571455         logerror("  %d\n",ret);
14581456         break;
14591457      case 4:
1460         ret=i8271_data_r(i8271, offset);
1458         ret=i8271_data_r(i8271, space, offset);
14611459         logerror("  %d\n",ret);
14621460         break;
14631461      default:
r17961r17962
14801478      case 2:
14811479      case 3:
14821480         /* 8271 registers */
1483         i8271_w(i8271, offset, data);
1481         i8271_w(i8271, space, offset, data);
14841482         return;
14851483      case 4:
1486         i8271_data_w(i8271, offset, data);
1484         i8271_data_w(i8271, space, offset, data);
14871485         return;
14881486      default:
14891487         break;
r17961r17962
16171615   switch (offset)
16181616   {
16191617   case 4:
1620      retval=wd17xx_status_r(fdc, 0);
1618      retval=wd17xx_status_r(fdc, space, 0);
16211619      break;
16221620   case 5:
1623      retval=wd17xx_track_r(fdc, 0);
1621      retval=wd17xx_track_r(fdc, space, 0);
16241622      break;
16251623   case 6:
1626      retval=wd17xx_sector_r(fdc, 0);
1624      retval=wd17xx_sector_r(fdc, space, 0);
16271625      break;
16281626   case 7:
1629      retval=wd17xx_data_r(fdc, 0);
1627      retval=wd17xx_data_r(fdc, space, 0);
16301628      break;
16311629   default:
16321630      break;
r17961r17962
16461644      bbc_wd177x_status_w(space, 0, data);
16471645      break;
16481646   case 4:
1649      wd17xx_command_w(fdc, 0, data);
1647      wd17xx_command_w(fdc, space, 0, data);
16501648      break;
16511649   case 5:
1652      wd17xx_track_w(fdc, 0, data);
1650      wd17xx_track_w(fdc, space, 0, data);
16531651      break;
16541652   case 6:
1655      wd17xx_sector_w(fdc, 0, data);
1653      wd17xx_sector_w(fdc, space, 0, data);
16561654      break;
16571655   case 7:
1658      wd17xx_data_w(fdc, 0, data);
1656      wd17xx_data_w(fdc, space, 0, data);
16591657      break;
16601658   default:
16611659      break;
r17961r17962
17301728         switch (offset)
17311729         {
17321730            case 0xf8:
1733               return wd17xx_status_r(fdc, 0);
1731               return wd17xx_status_r(fdc, space, 0);
17341732            case 0xf9:
1735               return wd17xx_track_r(fdc, 0);
1733               return wd17xx_track_r(fdc, space, 0);
17361734            case 0xfa:
1737               return wd17xx_sector_r(fdc, 0);
1735               return wd17xx_sector_r(fdc, space, 0);
17381736            case 0xfb:
1739               return wd17xx_data_r(fdc, 0);
1737               return wd17xx_data_r(fdc, space, 0);
17401738         }
17411739
17421740      }
r17961r17962
17601758         switch (offset)
17611759         {
17621760            case 0xf8:
1763               wd17xx_command_w(fdc, 0, data);
1761               wd17xx_command_w(fdc, space, 0, data);
17641762               break;
17651763            case 0xf9:
1766               wd17xx_track_w(fdc, 0, data);
1764               wd17xx_track_w(fdc, space, 0, data);
17671765               break;
17681766            case 0xfa:
1769               wd17xx_sector_w(fdc, 0, data);
1767               wd17xx_sector_w(fdc, space, 0, data);
17701768               break;
17711769            case 0xfb:
1772               wd17xx_data_w(fdc, 0, data);
1770               wd17xx_data_w(fdc, space, 0, data);
17731771               break;
17741772            case 0xfc:
17751773               bbc_opus_status_w(space, 0,data);
r17961r17962
18021800   switch (offset)
18031801   {
18041802   case 0:
1805      retval=wd17xx_status_r(fdc, 0);
1803      retval=wd17xx_status_r(fdc, space, 0);
18061804      break;
18071805   case 1:
1808      retval=wd17xx_track_r(fdc, 0);
1806      retval=wd17xx_track_r(fdc, space, 0);
18091807      break;
18101808   case 2:
1811      retval=wd17xx_sector_r(fdc, 0);
1809      retval=wd17xx_sector_r(fdc, space, 0);
18121810      break;
18131811   case 3:
1814      retval=wd17xx_data_r(fdc, 0);
1812      retval=wd17xx_data_r(fdc, space, 0);
18151813      break;
18161814   default:
18171815      break;
r17961r17962
18271825   switch (offset)
18281826   {
18291827   case 0:
1830      wd17xx_command_w(fdc, 0, data);
1828      wd17xx_command_w(fdc, space, 0, data);
18311829      break;
18321830   case 1:
1833      wd17xx_track_w(fdc, 0, data);
1831      wd17xx_track_w(fdc, space, 0, data);
18341832      break;
18351833   case 2:
1836      wd17xx_sector_w(fdc, 0, data);
1834      wd17xx_sector_w(fdc, space, 0, data);
18371835      break;
18381836   case 3:
1839      wd17xx_data_w(fdc, 0, data);
1837      wd17xx_data_w(fdc, space, 0, data);
18401838      break;
18411839   default:
18421840      break;
trunk/src/mess/machine/kr2376.c
r17961r17962
8080
8181   /* timers */
8282   emu_timer *scan_timer;         /* keyboard scan timer */
83   devcb_resolved_write_line on_strobe_changed;
8384};
8485
8586INLINE kr2376_t *get_safe_token(device_t *device)
r17961r17962
133134         kr2376->pins[KR2376_PO] = kr2376->parity ^ kr2376->pins[KR2376_PII];
134135      }
135136      kr2376->pins[KR2376_SO] = kr2376->strobe ^ kr2376->pins[KR2376_DSII];
136      if (kr2376->intf->on_strobe_changed)
137         kr2376->intf->on_strobe_changed(device, 0, kr2376->strobe ^ kr2376->pins[KR2376_DSII]);
137      if (!kr2376->on_strobe_changed.isnull())
138         kr2376->on_strobe_changed(kr2376->strobe ^ kr2376->pins[KR2376_DSII]);
138139   }
139140}
140141
r17961r17962
343344   assert(device->tag() != NULL);
344345
345346   kr2376->intf = (const kr2376_interface*)device->static_config();
346
347   
347348   assert(kr2376->intf != NULL);
348349   assert(kr2376->intf->clock > 0);
349350
351   kr2376->on_strobe_changed.resolve(kr2376->intf->on_strobe_changed_cb, *device);
352
350353   /* set initial values */
351354   kr2376->ring11 = 0;
352355   kr2376->ring8 = 0;
trunk/src/mess/machine/kr2376.h
r17961r17962
8585   int clock;
8686
8787   /* This will be called for every change of the strobe pin (pin 16). Optional */
88//  kr2376_on_strobe_changed_func       on_strobe_changed;
89   write8_device_func   on_strobe_changed;
88   devcb_write_line on_strobe_changed_cb;
9089};
9190#define KR2376_INTERFACE(name) const kr2376_interface (name)=
9291/* keyboard matrix */
9392INPUT_PORTS_EXTERN( kr2376 );
9493
9594/* keyboard data */
96READ8_DEVICE_HANDLER( kr2376_data_r );
95DECLARE_READ8_DEVICE_HANDLER( kr2376_data_r );
9796
9897/* Set an input pin */
9998void kr2376_set_input_pin( device_t *device, kr2376_input_pin_t pin, int data );
trunk/src/mess/machine/applefdc.h
r17961r17962
102102    PROTOTYPES
103103***************************************************************************/
104104/* read/write handlers */
105READ8_DEVICE_HANDLER(applefdc_r);
106WRITE8_DEVICE_HANDLER(applefdc_w);
105DECLARE_READ8_DEVICE_HANDLER(applefdc_r);
106DECLARE_WRITE8_DEVICE_HANDLER(applefdc_w);
107107
108108/* accessor */
109109UINT8 applefdc_get_lines(device_t *device);
trunk/src/mess/machine/upd765.c
r17961r17962
22632263   upd765_set_dma_drq(device, CLEAR_LINE);
22642264
22652265   /* write data */
2266   upd765_data_w(device, offset, data);
2266   upd765_data_w(device, space, offset, data);
22672267}
22682268
22692269READ8_DEVICE_HANDLER(upd765_dack_r)
r17961r17962
22722272   upd765_set_dma_drq(device,CLEAR_LINE);
22732273
22742274   /* read data */
2275   return upd765_data_r(device, offset);
2275   return upd765_data_r(device, space, offset);
22762276}
22772277
22782278static TIMER_CALLBACK( interrupt_callback )
trunk/src/mess/machine/macpci.c
r17961r17962
2626
2727/* VIA1 Handlers */
2828
29static READ8_DEVICE_HANDLER(mac_via_in_a);
30static READ8_DEVICE_HANDLER(mac_via_in_b);
31static READ8_DEVICE_HANDLER(mac_adb_via_in_cb2);
32static WRITE8_DEVICE_HANDLER(mac_via_out_a);
33static WRITE8_DEVICE_HANDLER(mac_via_out_b);
34static WRITE8_DEVICE_HANDLER(mac_adb_via_out_cb2);
29static DECLARE_READ8_DEVICE_HANDLER(mac_via_in_a);
30static DECLARE_READ8_DEVICE_HANDLER(mac_via_in_b);
31static DECLARE_READ8_DEVICE_HANDLER(mac_adb_via_in_cb2);
32static DECLARE_WRITE8_DEVICE_HANDLER(mac_via_out_a);
33static DECLARE_WRITE8_DEVICE_HANDLER(mac_via_out_b);
34static DECLARE_WRITE8_DEVICE_HANDLER(mac_adb_via_out_cb2);
3535static void mac_via_irq(device_t *device, int state);
3636
3737const via6522_interface pcimac_via6522_intf =
trunk/src/mess/machine/c65.c
r17961r17962
7272
7373static READ8_DEVICE_HANDLER( c65_cia0_port_a_r )
7474{
75   UINT8 cia0portb = mos6526_pb_r(device->machine().device("cia_0"), 0);
75   UINT8 cia0portb = mos6526_pb_r(device->machine().device("cia_0"), space, 0);
7676
7777   return cbm_common_cia0_port_a_r(device, cia0portb);
7878}
r17961r17962
8181{
8282   c65_state *state = device->machine().driver_data<c65_state>();
8383   UINT8 value = 0xff;
84   UINT8 cia0porta = mos6526_pa_r(device->machine().device("cia_0"), 0);
84   UINT8 cia0porta = mos6526_pa_r(device->machine().device("cia_0"), space, 0);
8585
8686   value &= cbm_common_cia0_port_b_r(device, cia0porta);
8787
r17961r17962
654654   {
655655   case 0x000:
656656      if (offset < 0x80)
657         vic3_port_w(vic3, offset & 0x7f, data);
657         vic3_port_w(vic3, *space, offset & 0x7f, data);
658658      else if (offset < 0xa0)
659659         c65_fdc_w(space->machine(), offset&0x1f,data);
660660      else
r17961r17962
666666   case 0x100:
667667   case 0x200:
668668   case 0x300:
669      vic3_palette_w(vic3, offset - 0x100, data);
669      vic3_palette_w(vic3, *space, offset - 0x100, data);
670670      break;
671671   case 0x400:
672672      if (offset<0x420) /* maybe 0x20 */
r17961r17962
696696   switch (offset & 0xf00)
697697   {
698698   case 0x000:
699      mos6526_w(cia_0, offset, data);
699      mos6526_w(cia_0, *space, offset, data);
700700      break;
701701   case 0x100:
702      mos6526_w(cia_1, offset, data);
702      mos6526_w(cia_1, *space, offset, data);
703703      break;
704704   case 0x200:
705705   case 0x300:
r17961r17962
718718   {
719719   case 0x000:
720720      if (offset < 0x80)
721         return vic3_port_r(vic3, offset & 0x7f);
721         return vic3_port_r(vic3, *space, offset & 0x7f);
722722      if (offset < 0xa0)
723723         return c65_fdc_r(space->machine(), offset&0x1f);
724724      else
r17961r17962
759759   switch (offset & 0x300)
760760   {
761761   case 0x000:
762      return mos6526_r(cia_0, offset);
762      return mos6526_r(cia_0, *space, offset);
763763   case 0x100:
764      return mos6526_r(cia_1, offset);
764      return mos6526_r(cia_1, *space, offset);
765765   case 0x200:
766766   case 0x300:
767767      DBG_LOG(space->machine(), 1, "io read", ("%.3x\n", offset+0xc00));
trunk/src/mess/machine/isa_ide.c
r17961r17962
1111
1212static READ16_DEVICE_HANDLER( ide16_r )
1313{
14   return ide_controller16_r(device, 0x1f0/2 + offset, mem_mask);
14   return ide_controller16_r(device, space, 0x1f0/2 + offset, mem_mask);
1515}
1616
1717static WRITE16_DEVICE_HANDLER( ide16_w )
1818{
19   ide_controller16_w(device, 0x1f0/2 + offset, data, mem_mask);
19   ide_controller16_w(device, space, 0x1f0/2 + offset, data, mem_mask);
2020}
2121
2222
2323static READ16_DEVICE_HANDLER( ide16_alt_r )
2424{
25   return ide_controller16_r(device, 0x3f6/2 + offset, 0x00ff);
25   return ide_controller16_r(device, space, 0x3f6/2 + offset, 0x00ff);
2626}
2727
2828static WRITE16_DEVICE_HANDLER( ide16_alt_w )
2929{
30   ide_controller16_w(device, 0x3f6/2 + offset, data, 0x00ff);
30   ide_controller16_w(device, space, 0x3f6/2 + offset, data, 0x00ff);
3131}
3232
3333static void ide_interrupt(device_t *device, int state)
trunk/src/mess/machine/upd765.h
r17961r17962
113113***************************************************************************/
114114
115115/* read of data register */
116READ8_DEVICE_HANDLER(upd765_data_r);
116DECLARE_READ8_DEVICE_HANDLER(upd765_data_r);
117117/* write to data register */
118WRITE8_DEVICE_HANDLER(upd765_data_w);
118DECLARE_WRITE8_DEVICE_HANDLER(upd765_data_w);
119119/* read of main status register */
120READ8_DEVICE_HANDLER(upd765_status_r);
120DECLARE_READ8_DEVICE_HANDLER(upd765_status_r);
121121
122122/* dma acknowledge with write */
123WRITE8_DEVICE_HANDLER(upd765_dack_w);
123DECLARE_WRITE8_DEVICE_HANDLER(upd765_dack_w);
124124/* dma acknowledge with read */
125READ8_DEVICE_HANDLER(upd765_dack_r);
125DECLARE_READ8_DEVICE_HANDLER(upd765_dack_r);
126126
127127/* reset upd765 */
128128void upd765_reset(device_t *device, int);
trunk/src/mess/machine/mc80.c
r17961r17962
194194// SIO CH A in = keyboard; out = beeper; CH B = IFSS (??)
195195const z80sio_interface mc8030_asp_z80sio_intf =
196196{
197   0,   /* interrupt handler */
198   0,         /* DTR changed handler */
199   0,         /* RTS changed handler */
200   0,         /* BREAK changed handler */
201   0,         /* transmit handler */
202   0         /* receive handler */
197   DEVCB_NULL,   /* interrupt handler */
198   DEVCB_NULL,         /* DTR changed handler */
199   DEVCB_NULL,         /* RTS changed handler */
200   DEVCB_NULL,         /* BREAK changed handler */
201   DEVCB_NULL,         /* transmit handler */
202   DEVCB_NULL         /* receive handler */
203203};
204204
trunk/src/mess/machine/ti99/genboard.c
r17961r17962
338338         // clock
339339         // tests on the real machine showed that
340340         // upper nibble is 0xf (probably because of the location at 0xf130?)
341         value = mm58274c_r(m_clock, offset & 0x000f) | 0xf0;
341         value = mm58274c_r(m_clock, space, offset & 0x000f) | 0xf0;
342342         do_wait(1);
343343         if (VERBOSE>7) LOG("genboard: Read clock %04x -> %02x\n", offset, value);
344344         return value;
r17961r17962
372372         // Obscure, needs more investigation. We might as well ignore this,
373373         // as the high nibble is obviously undefined and takes some past
374374         // value floating around.
375         value = mm58274c_r(m_clock, offset & 0x000f);
375         value = mm58274c_r(m_clock, space, offset & 0x000f);
376376         value |= ((offset & 0x000f)==0x000f)? 0x20 : 0x10;
377377
378378         do_wait(1);
r17961r17962
609609      {
610610         // clock
611611         // ++++ ++++ ++++ ----
612         mm58274c_w(m_clock, offset & 0x00f, data);
612         mm58274c_w(m_clock, space, offset & 0x00f, data);
613613         do_wait(1);
614614         if (VERBOSE>7) LOG("genboard: Write clock %04x <- %02x\n", offset, data);
615615         return;
r17961r17962
630630      if ((offset & 0xfff0)==0x8010)
631631      {
632632         // clock
633         mm58274c_w(m_clock, offset & 0x00f, data);
633         mm58274c_w(m_clock, space, offset & 0x00f, data);
634634         do_wait(1);
635635         if (VERBOSE>7) LOG("genboard: Write clock %04x <- %02x\n", offset, data);
636636         return;
trunk/src/mess/machine/ti99/ti_fdc.c
r17961r17962
6464
6565         if ((offset & 0x1ff9)==0x1ff0)
6666         {
67            reply = wd17xx_r(m_controller, (offset >> 1)&0x03);
67            reply = wd17xx_r(m_controller, space, (offset >> 1)&0x03);
6868         }
6969         else
7070         {
r17961r17962
8888         // 0101 1111 1111 1xx0
8989         if ((offset & 0x1ff9)==0x1ff8)
9090         {
91            wd17xx_w(m_controller, (offset >> 1)&0x03, data);
91            wd17xx_w(m_controller, space, (offset >> 1)&0x03, data);
9292         }
9393      }
9494   }
trunk/src/mess/machine/ti99/hfdc.c
r17961r17962
8686
8787            if ((offset & 0x1fe1)==CLK_ADDR)
8888            {
89               *value = mm58274c_r(m_clock, (offset & 0x001e) >> 1);
89               *value = mm58274c_r(m_clock, space, (offset & 0x001e) >> 1);
9090               if (VERBOSE>7) LOG("hfdc: read from clock address %04x: %02x\n", offset & 0xffff, *value);
9191               return;
9292            }
r17961r17962
140140      if ((offset & 0x1fe1)==CLK_ADDR)
141141      {
142142         if (VERBOSE>7) LOG("hfdc: write to clock address %04x: %02x\n", offset & 0xffff, data);
143         mm58274c_w(m_clock, (offset & 0x001e) >> 1, data);
143         mm58274c_w(m_clock, space, (offset & 0x001e) >> 1, data);
144144         return;
145145      }
146146
trunk/src/mess/machine/ti99/bwg.c
r17961r17962
132132               if ((offset & 0x03e1)==0x03e0)
133133               {
134134                  // .... ..11 111x xxx0
135                  *value = mm58274c_r(m_clock, (offset & 0x001e) >> 1);
135                  *value = mm58274c_r(m_clock, space, (offset & 0x001e) >> 1);
136136               }
137137               else
138138               {
r17961r17962
146146                  // .... ..11 1111 0xx0
147147                  // Note that the value is inverted again on the board,
148148                  // so we can drop the inversion
149                  *value = wd17xx_r(m_controller, (offset >> 1)&0x03);
149                  *value = wd17xx_r(m_controller, space, (offset >> 1)&0x03);
150150               }
151151               else
152152               {
r17961r17962
211211               if ((offset & 0x03e1)==0x03e0)
212212               {
213213                  // .... ..11 111x xxx0
214                  mm58274c_w(m_clock, (offset & 0x001e) >> 1, data);
214                  mm58274c_w(m_clock, space, (offset & 0x001e) >> 1, data);
215215               }
216216               else
217217               {
r17961r17962
225225                  // .... ..11 1111 1xx0
226226                  // Note that the value is inverted again on the board,
227227                  // so we can drop the inversion
228                  wd17xx_w(m_controller, (offset >> 1)&0x03, data);
228                  wd17xx_w(m_controller, space, (offset >> 1)&0x03, data);
229229               }
230230               else
231231               {
trunk/src/mess/machine/c64_currah_speech.c
r17961r17962
264264
265265      set_osc1(voice, intonation);
266266
267      sp0256_ALD_w(m_nsp, 0, data & 0x3f);
267      sp0256_ALD_w(m_nsp, space, 0, data & 0x3f);
268268   }
269269}
trunk/src/mess/machine/gb.c
r17961r17962
238238         break;
239239   }
240240
241   gb_sound_w(space->machine().device("custom"), 0x16, 0x00 );       /* Initialize sound hardware */
241   gb_sound_w(space->machine().device("custom"), *space, 0x16, 0x00 );       /* Initialize sound hardware */
242242
243243   state->m_divcount = 0;
244244   state->m_triggering_irq = 0;
r17961r17962
340340   gb_init_regs(machine());
341341
342342   /* Initialize the Sound registers */
343   gb_sound_w(machine().device("custom"), 0x16,0x80);
344   gb_sound_w(machine().device("custom"), 0x15,0xF3);
345   gb_sound_w(machine().device("custom"), 0x14,0x77);
343   gb_sound_w(machine().device("custom"), generic_space(), 0x16,0x80);
344   gb_sound_w(machine().device("custom"), generic_space(), 0x15,0xF3);
345   gb_sound_w(machine().device("custom"), generic_space(), 0x14,0x77);
346346
347347   /* Enable BIOS rom if we have one */
348348   gb_rom16_0000( machine(), m_ROMMap[m_ROMBank00] ? m_ROMMap[m_ROMBank00] : m_gb_dummy_rom_bank );
r17961r17962
21002100
21012101WRITE8_MEMBER(gb_state::megaduck_sound_w1)
21022102{
2103   gb_sound_w(machine().device("custom"), megaduck_sound_offsets[offset], data );
2103   gb_sound_w(machine().device("custom"), space, megaduck_sound_offsets[offset], data );
21042104}
21052105
21062106READ8_MEMBER(gb_state::megaduck_sound_r1)
21072107{
2108   return gb_sound_r( machine().device("custom"), megaduck_sound_offsets[offset] );
2108   return gb_sound_r( machine().device("custom"), space, megaduck_sound_offsets[offset] );
21092109}
21102110
21112111WRITE8_MEMBER(gb_state::megaduck_sound_w2)
21122112{
21132113   switch(offset)
21142114   {
2115      case 0x00:   gb_sound_w(machine().device("custom"), 0x10, data );   break;
2116      case 0x01:   gb_sound_w(machine().device("custom"), 0x12, data );   break;
2117      case 0x02:   gb_sound_w(machine().device("custom"), 0x11, data );   break;
2118      case 0x03:   gb_sound_w(machine().device("custom"), 0x13, data );   break;
2119      case 0x04:   gb_sound_w(machine().device("custom"), 0x14, data );   break;
2120      case 0x05:   gb_sound_w(machine().device("custom"), 0x16, data );   break;
2121      case 0x06:   gb_sound_w(machine().device("custom"), 0x15, data );   break;
2115      case 0x00:   gb_sound_w(machine().device("custom"), space, 0x10, data );   break;
2116      case 0x01:   gb_sound_w(machine().device("custom"), space, 0x12, data );   break;
2117      case 0x02:   gb_sound_w(machine().device("custom"), space, 0x11, data );   break;
2118      case 0x03:   gb_sound_w(machine().device("custom"), space, 0x13, data );   break;
2119      case 0x04:   gb_sound_w(machine().device("custom"), space, 0x14, data );   break;
2120      case 0x05:   gb_sound_w(machine().device("custom"), space, 0x16, data );   break;
2121      case 0x06:   gb_sound_w(machine().device("custom"), space, 0x15, data );   break;
21222122      case 0x07:
21232123      case 0x08:
21242124      case 0x09:
r17961r17962
21342134
21352135READ8_MEMBER(gb_state::megaduck_sound_r2)
21362136{
2137   return gb_sound_r(machine().device("custom"), 0x10 + megaduck_sound_offsets[offset]);
2137   return gb_sound_r(machine().device("custom"), space, 0x10 + megaduck_sound_offsets[offset]);
21382138}
21392139
21402140WRITE8_MEMBER(gb_state::megaduck_rom_bank_select_type1)
trunk/src/mess/machine/s100_dj2db.c
r17961r17962
304304//  s100_smemr_r - memory read
305305//-------------------------------------------------
306306
307UINT8 s100_dj2db_device::s100_smemr_r(offs_t offset)
307UINT8 s100_dj2db_device::s100_smemr_r(address_space &space, offs_t offset)
308308{
309309   UINT8 data = 0;
310310
r17961r17962
365365   {
366366      m_s100->rdy_w(ASSERT_LINE);
367367
368      data = wd17xx_r(m_fdc, offset & 0x03);
368      data = wd17xx_r(m_fdc, space, offset & 0x03);
369369   }
370370   else if ((offset >= 0xfc00) && (offset < 0x10000))
371371   {
r17961r17962
385385//  s100_mwrt_w - memory write
386386//-------------------------------------------------
387387
388void s100_dj2db_device::s100_mwrt_w(offs_t offset, UINT8 data)
388void s100_dj2db_device::s100_mwrt_w(address_space &space, offs_t offset, UINT8 data)
389389{
390390//  if (!(m_board_enbl & m_phantom)) return;
391391
r17961r17962
459459   }
460460   else if ((offset >= 0xfbfc) && (offset < 0xfc00))
461461   {
462      wd17xx_w(m_fdc, offset & 0x03, data);
462      wd17xx_w(m_fdc, space, offset & 0x03, data);
463463   }
464464   else if ((offset >= 0xfc00) && (offset < 0x10000))
465465   {
r17961r17962
472472//  s100_sinp_r - I/O read
473473//-------------------------------------------------
474474
475UINT8 s100_dj2db_device::s100_sinp_r(offs_t offset)
475UINT8 s100_dj2db_device::s100_sinp_r(address_space &space, offs_t offset)
476476{
477477   return 0;
478478}
r17961r17962
482482//  s100_sout_w - I/O write
483483//-------------------------------------------------
484484
485void s100_dj2db_device::s100_sout_w(offs_t offset, UINT8 data)
485void s100_dj2db_device::s100_sout_w(address_space &space, offs_t offset, UINT8 data)
486486{
487487   if (offset == 0x41)
488488   {
trunk/src/mess/machine/s100_dj2db.h
r17961r17962
5151    virtual void device_config_complete() { m_shortname = "dj2db"; }
5252
5353   // device_s100_card_interface overrides
54   virtual UINT8 s100_smemr_r(offs_t offset);
55   virtual void s100_mwrt_w(offs_t offset, UINT8 data);
56   virtual UINT8 s100_sinp_r(offs_t offset);
57   virtual void s100_sout_w(offs_t offset, UINT8 data);
54   virtual UINT8 s100_smemr_r(address_space &space, offs_t offset);
55   virtual void s100_mwrt_w(address_space &space, offs_t offset, UINT8 data);
56   virtual UINT8 s100_sinp_r(address_space &space, offs_t offset);
57   virtual void s100_sout_w(address_space &space, offs_t offset, UINT8 data);
5858   virtual void s100_phantom_w(int state);
5959   virtual bool s100_has_terminal() { return true; }
6060   virtual void s100_terminal_w(UINT8 data);
trunk/src/mess/machine/aim65.c
r17961r17962
4747   dl1416_ce_w(device, state->m_pia_a & (0x04 << index));
4848   dl1416_wr_w(device, BIT(state->m_pia_a, 7));
4949   dl1416_cu_w(device, BIT(state->m_pia_b, 7));
50   dl1416_data_w(device, state->m_pia_a & 0x03, state->m_pia_b & 0x7f);
50   dl1416_data_w(device, state->generic_space(), state->m_pia_a & 0x03, state->m_pia_b & 0x7f);
5151}
5252
5353static void aim65_pia(running_machine &machine)
trunk/src/mess/machine/thomson.c
r17961r17962
319319   thom_set_irq  ( machine, 0, state );
320320}
321321
322static void thom_dev_irq_0  ( device_t *device, int state )
322static WRITE_LINE_DEVICE_HANDLER( thom_dev_irq_0 )
323323{
324324   thom_irq_0( device->machine(), state );
325325}
r17961r17962
543543
544544const mc6846_interface to7_timer =
545545{
546   to7_timer_port_out, NULL, to7_timer_cp2_out,
547   to7_timer_port_in, to7_timer_tco_out,
548   thom_dev_irq_0
546   DEVCB_HANDLER(to7_timer_port_out), DEVCB_NULL, DEVCB_HANDLER(to7_timer_cp2_out),
547   DEVCB_HANDLER(to7_timer_port_in), DEVCB_HANDLER(to7_timer_tco_out),
548   DEVCB_LINE(thom_dev_irq_0)
549549};
550550
551551
r17961r17962
934934/* ------------  dispatch MODEM / speech extension ------------ */
935935
936936
937const mea8000_interface to7_speech = { "speech", NULL };
937const mea8000_interface to7_speech = { "speech", DEVCB_NULL };
938938
939939
940940READ8_HANDLER ( to7_modem_mea8000_r )
r17961r17962
947947   if ( space->machine().root_device().ioport("mconfig")->read() & 1 )
948948   {
949949      device_t* device = space->machine().device("mea8000" );
950      return mea8000_r( device, offset );
950      return mea8000_r( device, *space, offset );
951951   }
952952   else
953953   {
r17961r17962
967967   if ( space->machine().root_device().ioport("mconfig")->read() & 1 )
968968   {
969969      device_t* device = space->machine().device("mea8000" );
970      mea8000_w( device, offset, data );
970      mea8000_w( device, *space, offset, data );
971971   }
972972   else
973973   {
r17961r17962
16621662
16631663const mc6846_interface to770_timer =
16641664{
1665   to770_timer_port_out, NULL, to7_timer_cp2_out,
1666   to7_timer_port_in, to7_timer_tco_out,
1667   thom_dev_irq_0
1665   DEVCB_HANDLER(to770_timer_port_out), DEVCB_NULL, DEVCB_HANDLER(to7_timer_cp2_out),
1666   DEVCB_HANDLER(to7_timer_port_in), DEVCB_HANDLER(to7_timer_tco_out),
1667   DEVCB_LINE(thom_dev_irq_0)
16681668};
16691669
16701670
r17961r17962
31043104
31053105const mc6846_interface to9_timer =
31063106{
3107   to9_timer_port_out, NULL, to7_timer_cp2_out,
3108   to7_timer_port_in, to7_timer_tco_out,
3109   thom_dev_irq_0
3107   DEVCB_HANDLER(to9_timer_port_out), DEVCB_NULL, DEVCB_HANDLER(to7_timer_cp2_out),
3108   DEVCB_HANDLER(to7_timer_port_in), DEVCB_HANDLER(to7_timer_tco_out),
3109   DEVCB_LINE(thom_dev_irq_0)
31103110};
31113111
31123112
r17961r17962
41564156
41574157const mc6846_interface to8_timer =
41584158{
4159   to8_timer_port_out, NULL, to8_timer_cp2_out,
4160   to8_timer_port_in, to7_timer_tco_out,
4161   thom_dev_irq_0
4159   DEVCB_HANDLER(to8_timer_port_out), DEVCB_NULL, DEVCB_HANDLER(to8_timer_cp2_out),
4160   DEVCB_HANDLER(to8_timer_port_in), DEVCB_HANDLER(to7_timer_tco_out),
4161   DEVCB_LINE(thom_dev_irq_0)
41624162};
41634163
41644164
r17961r17962
43454345
43464346const mc6846_interface to9p_timer =
43474347{
4348   to9p_timer_port_out, NULL, to8_timer_cp2_out,
4349   to9p_timer_port_in, to7_timer_tco_out,
4350   thom_dev_irq_0
4348   DEVCB_HANDLER(to9p_timer_port_out), DEVCB_NULL, DEVCB_HANDLER(to8_timer_cp2_out),
4349   DEVCB_HANDLER(to9p_timer_port_in), DEVCB_HANDLER(to7_timer_tco_out),
4350   DEVCB_LINE(thom_dev_irq_0)
43514351};
43524352
43534353
trunk/src/mess/machine/coco_fdc.c
r17961r17962
346346   switch(offset & 0xEF)
347347   {
348348      case 8:
349         result = wd17xx_status_r(m_wd17xx, 0);
349         result = wd17xx_status_r(m_wd17xx, space, 0);
350350         break;
351351      case 9:
352         result = wd17xx_track_r(m_wd17xx, 0);
352         result = wd17xx_track_r(m_wd17xx, space, 0);
353353         break;
354354      case 10:
355         result = wd17xx_sector_r(m_wd17xx, 0);
355         result = wd17xx_sector_r(m_wd17xx, space, 0);
356356         break;
357357      case 11:
358         result = wd17xx_data_r(m_wd17xx, 0);
358         result = wd17xx_data_r(m_wd17xx, space, 0);
359359         break;
360360   }
361361
r17961r17962
369369
370370      case 0x38:   /* FF78 */
371371         if (real_time_clock() == RTC_CLOUD9)
372            ds1315_r_0(m_ds1315, offset);
372            ds1315_r_0(m_ds1315, space, offset);
373373         break;
374374
375375      case 0x39:   /* FF79 */
376376         if (real_time_clock() == RTC_CLOUD9)
377            ds1315_r_1(m_ds1315, offset);
377            ds1315_r_1(m_ds1315, space, offset);
378378         break;
379379
380380      case 0x3C:   /* FF7C */
381381         if (real_time_clock() == RTC_CLOUD9)
382            result = ds1315_r_data(m_ds1315, offset);
382            result = ds1315_r_data(m_ds1315, space, offset);
383383         break;
384384   }
385385   return result;
r17961r17962
400400         dskreg_w(data);
401401         break;
402402      case 8:
403         wd17xx_command_w(m_wd17xx, 0, data);
403         wd17xx_command_w(m_wd17xx, space, 0, data);
404404         break;
405405      case 9:
406         wd17xx_track_w(m_wd17xx, 0, data);
406         wd17xx_track_w(m_wd17xx, space, 0, data);
407407         break;
408408      case 10:
409         wd17xx_sector_w(m_wd17xx, 0, data);
409         wd17xx_sector_w(m_wd17xx, space, 0, data);
410410         break;
411411      case 11:
412         wd17xx_data_w(m_wd17xx, 0, data);
412         wd17xx_data_w(m_wd17xx, space, 0, data);
413413         break;
414414   };
415415
r17961r17962
560560   switch(offset & 0xEF)
561561   {
562562      case 0:
563         result = wd17xx_status_r(m_wd17xx, 0);
563         result = wd17xx_status_r(m_wd17xx, space, 0);
564564         break;
565565      case 1:
566         result = wd17xx_track_r(m_wd17xx, 0);
566         result = wd17xx_track_r(m_wd17xx, space, 0);
567567         break;
568568      case 2:
569         result = wd17xx_sector_r(m_wd17xx, 0);
569         result = wd17xx_sector_r(m_wd17xx, space, 0);
570570         break;
571571      case 3:
572         result = wd17xx_data_r(m_wd17xx, 0);
572         result = wd17xx_data_r(m_wd17xx, space, 0);
573573         break;
574574   }
575575   return result;
r17961r17962
586586   switch(offset & 0xEF)
587587   {
588588      case 0:
589         wd17xx_command_w(m_wd17xx, 0, data);
589         wd17xx_command_w(m_wd17xx, space, 0, data);
590590
591591         /* disk head is encoded in the command byte */
592592         /* Only for type 3 & 4 commands */
r17961r17962
594594            wd17xx_set_side(m_wd17xx, (data & 0x02) ? 1 : 0);
595595         break;
596596      case 1:
597         wd17xx_track_w(m_wd17xx, 0, data);
597         wd17xx_track_w(m_wd17xx, space, 0, data);
598598         break;
599599      case 2:
600         wd17xx_sector_w(m_wd17xx, 0, data);
600         wd17xx_sector_w(m_wd17xx, space, 0, data);
601601         break;
602602      case 3:
603         wd17xx_data_w(m_wd17xx, 0, data);
603         wd17xx_data_w(m_wd17xx, space, 0, data);
604604         break;
605605      case 8: case 9: case 10: case 11:
606606      case 12: case 13: case 14: case 15:
trunk/src/mess/machine/c128.c
r17961r17962
126126
127127READ8_MEMBER( c128_state::cia1_pa_r )
128128{
129   UINT8 cia0portb = mos6526_pb_r(m_cia1, 0);
129   UINT8 cia0portb = mos6526_pb_r(m_cia1, space, 0);
130130
131131   return cbm_common_cia0_port_a_r(m_cia1, cia0portb);
132132}
r17961r17962
134134READ8_MEMBER( c128_state::cia1_pb_r )
135135{
136136   UINT8 value = 0xff;
137   UINT8 cia0porta = mos6526_pa_r(m_cia1, 0);
137   UINT8 cia0porta = mos6526_pa_r(m_cia1, space, 0);
138138   //vic2e_device_interface *intf = dynamic_cast<vic2e_device_interface*>(&m_vic);
139139
140140   value &= cbm_common_cia0_port_b_r(m_cia1, cia0porta);
r17961r17962
370370            m_colorram[(offset & 0x3ff)|((c64_port6510&3)<<10)] = data | 0xf0; // maybe all 8 bit connected!
371371          break;
372372      case 0xc:
373         mos6526_w(m_cia1, offset, data);
373         mos6526_w(m_cia1, space, offset, data);
374374         break;
375375      case 0xd:
376         mos6526_w(m_cia2, offset, data);
376         mos6526_w(m_cia2, space, offset, data);
377377         break;
378378      case 0xf:
379379         dma8726_port_w(space, offset&0xff,data);
r17961r17962
405405   else if (offset == 0xc00)
406406      {
407407         cia_set_port_mask_value(m_cia1, 0, ioport("CTRLSEL")->read() & 0x80 ? c64_keyline[8] : c64_keyline[9] );
408         return mos6526_r(m_cia1, offset);
408         return mos6526_r(m_cia1, space, offset);
409409      }
410410   else if (offset == 0xc01)
411411      {
412412         cia_set_port_mask_value(m_cia1, 1, ioport("CTRLSEL")->read() & 0x80 ? c64_keyline[9] : c64_keyline[8] );
413         return mos6526_r(m_cia1, offset);
413         return mos6526_r(m_cia1, space, offset);
414414      }
415415   else if (offset < 0xd00)
416      return mos6526_r(m_cia1, offset);
416      return mos6526_r(m_cia1, space, offset);
417417   else if (offset < 0xe00)
418      return mos6526_r(m_cia2, offset);
418      return mos6526_r(m_cia2, space, offset);
419419   else if ((offset >= 0xf00) & (offset <= 0xfff))
420420      return dma8726_port_r(space, offset&0xff);
421421   DBG_LOG(machine(), 1, "io read", ("%.3x\n", offset));
trunk/src/mess/machine/thomflop.c
r17961r17962
276276   device_t *fdc = space->machine().device("wd2793");
277277
278278   if ( offset < 4 )
279      return wd17xx_r( fdc, offset );
279      return wd17xx_r( fdc, *space, offset );
280280   else if ( offset == 8 )
281281      return to7_5p14_select;
282282   else
r17961r17962
290290{
291291   device_t *fdc = space->machine().device("wd2793");
292292   if ( offset < 4 )
293      wd17xx_w( fdc, offset, data );
293      wd17xx_w( fdc, *space, offset, data );
294294   else if ( offset == 8 )
295295   {
296296      /* drive select */
r17961r17962
362362static READ8_HANDLER ( to7_5p14sd_r )
363363{
364364   if ( offset < 8 )
365      return mc6843_r( space->machine().device("mc6843"), offset );
365      return mc6843_r( space->machine().device("mc6843"), *space, offset );
366366   else if ( offset >= 8 && offset <= 9 )
367367      return to7_5p14sd_select;
368368   else
r17961r17962
375375static WRITE8_HANDLER( to7_5p14sd_w )
376376{
377377   if ( offset < 8 )
378      mc6843_w( space->machine().device("mc6843"), offset, data );
378      mc6843_w( space->machine().device("mc6843"), *space, offset, data );
379379   else if ( offset >= 8 && offset <= 9 )
380380   {
381381      /* drive select */
r17961r17962
17151715static READ8_HANDLER ( to7_network_r )
17161716{
17171717   if ( offset < 4 )
1718      return mc6854_r( space->machine().device("mc6854"), offset );
1718      return mc6854_r( space->machine().device("mc6854"), *space, offset );
17191719
17201720   if ( offset == 8 )
17211721   {
r17961r17962
17341734static WRITE8_HANDLER ( to7_network_w )
17351735{
17361736   if ( offset < 4 )
1737      mc6854_w( space->machine().device("mc6854"), offset, data );
1737      mc6854_w( space->machine().device("mc6854"), *space, offset, data );
17381738   else
17391739   {
17401740      logerror( "%f $%04x to7_network_w: invalid write offset %i (data=$%02X)\n",
trunk/src/mess/machine/oric.c
r17961r17962
137137static READ8_DEVICE_HANDLER ( oric_via_in_a_func )
138138{
139139   oric_state *state = device->machine().driver_data<oric_state>();
140   address_space *space = device->machine().device( "maincpu")->memory().space( AS_PROGRAM );
141140
142141   /*logerror("port a read\r\n"); */
143142
r17961r17962
146145   {
147146      /* if psg is in read register state return reg data */
148147      if (state->m_psg_control==0x01)
149         return ay8910_r(space->machine().device("ay8912"), 0);
148         return ay8910_r(space.machine().device("ay8912"), space, 0);
150149
151150      /* return high-impedance */
152151      return 0x0ff;
r17961r17962
171170
172171
173172/* read/write data depending on state of bdir, bc1 pins and data output to psg */
174static void oric_psg_connection_refresh(running_machine &machine)
173static void oric_psg_connection_refresh(address_space &space)
175174{
176   oric_state *state = machine.driver_data<oric_state>();
175   oric_state *state = space.machine().driver_data<oric_state>();
177176   if (state->m_psg_control!=0)
178177   {
179178      switch (state->m_psg_control)
r17961r17962
190189         /* write register data */
191190         case 2:
192191         {
193            device_t *ay8912 = machine.device("ay8912");
194            ay8910_data_w(ay8912, 0, state->m_via_port_a_data);
192            device_t *ay8912 = space.machine().device("ay8912");
193            ay8910_data_w(ay8912, space, 0, state->m_via_port_a_data);
195194         }
196195         break;
197196         /* write register index */
198197         case 3:
199198         {
200            device_t *ay8912 = machine.device("ay8912");
201            ay8910_address_w(ay8912, 0, state->m_via_port_a_data);
199            device_t *ay8912 = space.machine().device("ay8912");
200            ay8910_address_w(ay8912, space, 0, state->m_via_port_a_data);
202201         }
203202         break;
204203
r17961r17962
215214   oric_state *state = device->machine().driver_data<oric_state>();
216215   state->m_via_port_a_data = data;
217216
218   oric_psg_connection_refresh(device->machine());
217   oric_psg_connection_refresh(space);
219218
220219
221220   if (state->m_psg_control==0)
r17961r17962
302301   /* centronics STROBE is connected to PB4 */
303302   centronics->strobe_w(BIT(data, 4));
304303
305   oric_psg_connection_refresh(device->machine());
304   oric_psg_connection_refresh(space);
306305   state->m_previous_portb_data = data;
307306}
308307
r17961r17962
327326   if (data)
328327      state->m_psg_control |=1;
329328
330   oric_psg_connection_refresh(device->machine());
329   oric_psg_connection_refresh(space);
331330}
332331
333332static WRITE8_DEVICE_HANDLER ( oric_via_out_cb2_func )
r17961r17962
338337   if (data)
339338      state->m_psg_control |=2;
340339
341   oric_psg_connection_refresh(device->machine());
340   oric_psg_connection_refresh(space);
342341}
343342
344343
r17961r17962
680679   {
681680      /* jasmin floppy disc interface */
682681      case 0x04:
683         data = wd17xx_status_r(fdc, 0);
682         data = wd17xx_status_r(fdc, space, 0);
684683         break;
685684      case 0x05:
686         data =wd17xx_track_r(fdc, 0);
685         data =wd17xx_track_r(fdc, space, 0);
687686         break;
688687      case 0x06:
689         data = wd17xx_sector_r(fdc, 0);
688         data = wd17xx_sector_r(fdc, space, 0);
690689         break;
691690      case 0x07:
692         data = wd17xx_data_r(fdc, 0);
691         data = wd17xx_data_r(fdc, space, 0);
693692         break;
694693      default:
695694         data = via_0->read(space,offset & 0x0f);
r17961r17962
709708   {
710709      /* microdisc floppy disc interface */
711710      case 0x04:
712         wd17xx_command_w(fdc, 0, data);
711         wd17xx_command_w(fdc, space, 0, data);
713712         break;
714713      case 0x05:
715         wd17xx_track_w(fdc, 0, data);
714         wd17xx_track_w(fdc, space, 0, data);
716715         break;
717716      case 0x06:
718         wd17xx_sector_w(fdc, 0, data);
717         wd17xx_sector_w(fdc, space, 0, data);
719718         break;
720719      case 0x07:
721         wd17xx_data_w(fdc, 0, data);
720         wd17xx_data_w(fdc, space, 0, data);
722721         break;
723722      /* bit 0 = side */
724723      case 0x08:
r17961r17962
898897   {
899898      /* microdisc floppy disc interface */
900899      case 0x00:
901         data = wd17xx_status_r(fdc, 0);
900         data = wd17xx_status_r(fdc, space, 0);
902901         break;
903902      case 0x01:
904         data =wd17xx_track_r(fdc, 0);
903         data =wd17xx_track_r(fdc, space, 0);
905904         break;
906905      case 0x02:
907         data = wd17xx_sector_r(fdc, 0);
906         data = wd17xx_sector_r(fdc, space, 0);
908907         break;
909908      case 0x03:
910         data = wd17xx_data_r(fdc, 0);
909         data = wd17xx_data_r(fdc, space, 0);
911910         break;
912911      case 0x04:
913912         data = m_port_314_r | 0x07f;
r17961r17962
937936   {
938937      /* microdisc floppy disc interface */
939938      case 0x00:
940         wd17xx_command_w(fdc, 0, data);
939         wd17xx_command_w(fdc, space, 0, data);
941940         break;
942941      case 0x01:
943         wd17xx_track_w(fdc, 0, data);
942         wd17xx_track_w(fdc, space, 0, data);
944943         break;
945944      case 0x02:
946         wd17xx_sector_w(fdc, 0, data);
945         wd17xx_sector_w(fdc, space, 0, data);
947946         break;
948947      case 0x03:
949         wd17xx_data_w(fdc, 0, data);
948         wd17xx_data_w(fdc, space, 0, data);
950949         break;
951950      case 0x04:
952951      {
trunk/src/mess/machine/osborne1.c
r17961r17962
4747      switch( offset & 0x0F00 )
4848      {
4949      case 0x100:   /* Floppy */
50         data = wd17xx_r( m_fdc, offset );
50         data = wd17xx_r( m_fdc, space, offset );
5151         break;
5252      case 0x200:   /* Keyboard */
5353         /* Row 0 */
r17961r17962
9696      switch( offset & 0x0F00 )
9797      {
9898      case 0x100:   /* Floppy */
99         wd17xx_w( m_fdc, offset, data );
99         wd17xx_w( m_fdc, space, offset, data );
100100         break;
101101      case 0x900:   /* IEEE488 PIA */
102102         m_pia0->write(space, offset & 0x03, data );
trunk/src/mess/machine/amstrad.c
r17961r17962
518518   case 0x0000:  // Load PSG register
519519      {
520520         device_t *ay8910 = state->m_ay;
521         ay8910_address_w(ay8910, 0, (command & 0x0f00) >> 8);
522         ay8910_data_w(ay8910, 0, command & 0x00ff);
523         ay8910_address_w(ay8910, 0, state->m_prev_reg);
521         ay8910_address_w(ay8910, state->generic_space(), 0, (command & 0x0f00) >> 8);
522         ay8910_data_w(ay8910, state->generic_space(), 0, command & 0x00ff);
523         ay8910_address_w(ay8910, state->generic_space(), 0, state->m_prev_reg);
524524      }
525525      logerror("DMA %i: LOAD %i, %i\n",channel,(command & 0x0f00) >> 8, command & 0x00ff);
526526      break;
r17961r17962
19601960            switch (b8b0)
19611961            {
19621962            case 0x02:
1963               data = upd765_status_r(fdc, 0);
1963               data = upd765_status_r(fdc, space, 0);
19641964               break;
19651965            case 0x03:
1966               data = upd765_data_r(fdc, 0);
1966               data = upd765_data_r(fdc, space, 0);
19671967               break;
19681968            default:
19691969               break;
r17961r17962
21382138              break;
21392139
21402140            case 0x03: /* Write Data register of FDC */
2141               upd765_data_w(fdc, 0,data);
2141               upd765_data_w(fdc, space, 0,data);
21422142               break;
21432143
21442144            default:
r17961r17962
21752175static void amstrad_handle_snapshot(running_machine &machine, unsigned char *pSnapshot)
21762176{
21772177   amstrad_state *state = machine.driver_data<amstrad_state>();
2178   address_space* space = state->m_maincpu->space(AS_PROGRAM);
2178   address_space &space = *state->m_maincpu->space(AS_PROGRAM);
21792179   mc6845_device *mc6845 = state->m_crtc;
21802180   device_t *ay8910 = state->m_ay;
21812181   int RegData;
r17961r17962
22652265   /* init CRTC */
22662266   for (i=0; i<18; i++)
22672267   {
2268      mc6845->address_w( *space, 0, i );
2269      mc6845->register_w( *space, 0, pSnapshot[0x043+i] & 0xff );
2268      mc6845->address_w( space, 0, i );
2269      mc6845->register_w( space, 0, pSnapshot[0x043+i] & 0xff );
22702270   }
22712271
2272   mc6845->address_w( *space, 0, i );
2272   mc6845->address_w( space, 0, i );
22732273
22742274   /* upper rom selection */
22752275   state->m_gate_array.upper_bank = pSnapshot[0x055];
22762276
22772277   /* PPI */
2278   state->m_ppi->write(*space, 3, pSnapshot[0x059] & 0x0ff);
2278   state->m_ppi->write(space, 3, pSnapshot[0x059] & 0x0ff);
22792279
2280   state->m_ppi->write(*space, 0, pSnapshot[0x056] & 0x0ff);
2281   state->m_ppi->write(*space, 1, pSnapshot[0x057] & 0x0ff);
2282   state->m_ppi->write(*space, 2, pSnapshot[0x058] & 0x0ff);
2280   state->m_ppi->write(space, 0, pSnapshot[0x056] & 0x0ff);
2281   state->m_ppi->write(space, 1, pSnapshot[0x057] & 0x0ff);
2282   state->m_ppi->write(space, 2, pSnapshot[0x058] & 0x0ff);
22832283
22842284   /* PSG */
22852285   for (i=0; i<16; i++)
22862286   {
2287      ay8910_address_w(ay8910, 0, i);
2288      ay8910_data_w(ay8910, 0, pSnapshot[0x05b + i] & 0x0ff);
2287      ay8910_address_w(ay8910, space, 0, i);
2288      ay8910_data_w(ay8910, space, 0, pSnapshot[0x05b + i] & 0x0ff);
22892289   }
22902290
2291   ay8910_address_w(ay8910, 0, pSnapshot[0x05a]);
2291   ay8910_address_w(ay8910, space, 0, pSnapshot[0x05a]);
22922292
22932293   {
22942294      int MemSize;
r17961r17962
24582458static void update_psg(running_machine &machine)
24592459{
24602460   amstrad_state *state = machine.driver_data<amstrad_state>();
2461   address_space *space = state->m_maincpu->space(AS_PROGRAM);
2461   address_space &space = *state->m_maincpu->space(AS_PROGRAM);
24622462   device_t *ay8910 = state->m_ay;
24632463   mc146818_device *rtc = state->m_rtc;
24642464
r17961r17962
24672467      switch(state->m_aleste_rtc_function)
24682468      {
24692469      case 0x02:  // AS
2470         rtc->write(*space, 0,state->m_ppi_port_outputs[amstrad_ppi_PortA]);
2470         rtc->write(space, 0,state->m_ppi_port_outputs[amstrad_ppi_PortA]);
24712471         break;
24722472      case 0x04:  // DS write
2473         rtc->write(*space, 1,state->m_ppi_port_outputs[amstrad_ppi_PortA]);
2473         rtc->write(space, 1,state->m_ppi_port_outputs[amstrad_ppi_PortA]);
24742474         break;
24752475      case 0x05:  // DS read
2476         state->m_ppi_port_inputs[amstrad_ppi_PortA] = rtc->read(*space, 1);
2476         state->m_ppi_port_inputs[amstrad_ppi_PortA] = rtc->read(space, 1);
24772477         break;
24782478      }
24792479      return;
r17961r17962
24852485      } break;
24862486   case 1:
24872487      {/* b6 = 1 ? : Read from selected PSG register and make the register data available to PPI Port A */
2488         state->m_ppi_port_inputs[amstrad_ppi_PortA] = ay8910_r(ay8910, 0);
2488         state->m_ppi_port_inputs[amstrad_ppi_PortA] = ay8910_r(ay8910, space, 0);
24892489      }
24902490      break;
24912491   case 2:
24922492      {/* b7 = 1 ? : Write to selected PSG register and write data to PPI Port A */
2493         ay8910_data_w(ay8910, 0, state->m_ppi_port_outputs[amstrad_ppi_PortA]);
2493         ay8910_data_w(ay8910, space, 0, state->m_ppi_port_outputs[amstrad_ppi_PortA]);
24942494      }
24952495      break;
24962496   case 3:
24972497      {/* 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.*/
2498         ay8910_address_w(ay8910, 0, state->m_ppi_port_outputs[amstrad_ppi_PortA]);
2498         ay8910_address_w(ay8910, space, 0, state->m_ppi_port_outputs[amstrad_ppi_PortA]);
24992499         state->m_prev_reg = state->m_ppi_port_outputs[amstrad_ppi_PortA];
25002500      }
25012501      break;
r17961r17962
28322832static void amstrad_common_init(running_machine &machine)
28332833{
28342834   amstrad_state *state = machine.driver_data<amstrad_state>();
2835   address_space *space = state->m_maincpu->space(AS_PROGRAM);
2835   address_space &space = *state->m_maincpu->space(AS_PROGRAM);
28362836   device_t* romexp;
28372837   rom_image_device* romimage;
28382838   char str[20];
r17961r17962
28462846   state->m_GateArray_RamConfiguration = 0;
28472847   state->m_gate_array.hsync_counter = 2;
28482848
2849   space->install_read_bank(0x0000, 0x1fff, "bank1");
2850   space->install_read_bank(0x2000, 0x3fff, "bank2");
2849   space.install_read_bank(0x0000, 0x1fff, "bank1");
2850   space.install_read_bank(0x2000, 0x3fff, "bank2");
28512851
2852   space->install_read_bank(0x4000, 0x5fff, "bank3");
2853   space->install_read_bank(0x6000, 0x7fff, "bank4");
2852   space.install_read_bank(0x4000, 0x5fff, "bank3");
2853   space.install_read_bank(0x6000, 0x7fff, "bank4");
28542854
2855   space->install_read_bank(0x8000, 0x9fff, "bank5");
2856   space->install_read_bank(0xa000, 0xbfff, "bank6");
2855   space.install_read_bank(0x8000, 0x9fff, "bank5");
2856   space.install_read_bank(0xa000, 0xbfff, "bank6");
28572857
2858   space->install_read_bank(0xc000, 0xdfff, "bank7");
2859   space->install_read_bank(0xe000, 0xffff, "bank8");
2858   space.install_read_bank(0xc000, 0xdfff, "bank7");
2859   space.install_read_bank(0xe000, 0xffff, "bank8");
28602860
2861   space->install_write_bank(0x0000, 0x1fff, "bank9");
2862   space->install_write_bank(0x2000, 0x3fff, "bank10");
2861   space.install_write_bank(0x0000, 0x1fff, "bank9");
2862   space.install_write_bank(0x2000, 0x3fff, "bank10");
28632863
2864   space->install_write_bank(0x4000, 0x5fff, "bank11");
2865   space->install_write_bank(0x6000, 0x7fff, "bank12");
2864   space.install_write_bank(0x4000, 0x5fff, "bank11");
2865   space.install_write_bank(0x6000, 0x7fff, "bank12");
28662866
2867   space->install_write_bank(0x8000, 0x9fff, "bank13");
2868   space->install_write_bank(0xa000, 0xbfff, "bank14");
2867   space.install_write_bank(0x8000, 0x9fff, "bank13");
2868   space.install_write_bank(0xa000, 0xbfff, "bank14");
28692869
2870   space->install_write_bank(0xc000, 0xdfff, "bank15");
2871   space->install_write_bank(0xe000, 0xffff, "bank16");
2870   space.install_write_bank(0xc000, 0xdfff, "bank15");
2871   space.install_write_bank(0xe000, 0xffff, "bank16");
28722872
28732873   /* Set up ROMs, if we have an expansion device connected */
28742874   romexp = get_expansion_device(machine,"rom");
r17961r17962
29772977
29782978MACHINE_RESET_MEMBER(amstrad_state,plus)
29792979{
2980   address_space *space = m_maincpu->space(AS_PROGRAM);
2980   address_space &space = *m_maincpu->space(AS_PROGRAM);
29812981   int i;
29822982   UINT8 *rom = memregion("maincpu")->base();
29832983
r17961r17962
30103010   AmstradCPC_GA_SetRamConfiguration(machine());
30113011   amstrad_GateArray_write(machine(), 0x081); // Epyx World of Sports requires upper ROM to be enabled by default
30123012
3013   space->install_read_handler(0x4000, 0x5fff, read8_delegate(FUNC(amstrad_state::amstrad_plus_asic_4000_r),this));
3014   space->install_read_handler(0x6000, 0x7fff, read8_delegate(FUNC(amstrad_state::amstrad_plus_asic_6000_r),this));
3015   space->install_write_handler(0x4000, 0x5fff, write8_delegate(FUNC(amstrad_state::amstrad_plus_asic_4000_w),this));
3016   space->install_write_handler(0x6000, 0x7fff, write8_delegate(FUNC(amstrad_state::amstrad_plus_asic_6000_w),this));
3013   space.install_read_handler(0x4000, 0x5fff, read8_delegate(FUNC(amstrad_state::amstrad_plus_asic_4000_r),this));
3014   space.install_read_handler(0x6000, 0x7fff, read8_delegate(FUNC(amstrad_state::amstrad_plus_asic_6000_r),this));
3015   space.install_write_handler(0x4000, 0x5fff, write8_delegate(FUNC(amstrad_state::amstrad_plus_asic_4000_w),this));
3016   space.install_write_handler(0x6000, 0x7fff, write8_delegate(FUNC(amstrad_state::amstrad_plus_asic_6000_w),this));
30173017
30183018   //  multiface_init();
30193019   machine().scheduler().timer_set( attotime::zero, FUNC(cb_set_resolution));
r17961r17962
30273027
30283028MACHINE_RESET_MEMBER(amstrad_state,gx4000)
30293029{
3030   address_space *space = m_maincpu->space(AS_PROGRAM);
3030   address_space &space = *m_maincpu->space(AS_PROGRAM);
30313031   int i;
30323032   UINT8 *rom = memregion("maincpu")->base();
30333033
r17961r17962
30603060   AmstradCPC_GA_SetRamConfiguration(machine());
30613061   amstrad_GateArray_write(machine(), 0x081); // Epyx World of Sports requires upper ROM to be enabled by default
30623062   //  multiface_init();
3063   space->install_read_handler(0x4000, 0x5fff, read8_delegate(FUNC(amstrad_state::amstrad_plus_asic_4000_r),this));
3064   space->install_read_handler(0x6000, 0x7fff, read8_delegate(FUNC(amstrad_state::amstrad_plus_asic_6000_r),this));
3065   space->install_write_handler(0x4000, 0x5fff, write8_delegate(FUNC(amstrad_state::amstrad_plus_asic_4000_w),this));
3066   space->install_write_handler(0x6000, 0x7fff, write8_delegate(FUNC(amstrad_state::amstrad_plus_asic_6000_w),this));
3063   space.install_read_handler(0x4000, 0x5fff, read8_delegate(FUNC(amstrad_state::amstrad_plus_asic_4000_r),this));
3064   space.install_read_handler(0x6000, 0x7fff, read8_delegate(FUNC(amstrad_state::amstrad_plus_asic_6000_r),this));
3065   space.install_write_handler(0x4000, 0x5fff, write8_delegate(FUNC(amstrad_state::amstrad_plus_asic_4000_w),this));
3066   space.install_write_handler(0x6000, 0x7fff, write8_delegate(FUNC(amstrad_state::amstrad_plus_asic_6000_w),this));
30673067
30683068   machine().scheduler().timer_set( attotime::zero, FUNC(cb_set_resolution));
30693069}
trunk/src/mess/machine/sms.c
r17961r17962
859859{
860860
861861   if (m_has_fm)
862      ym2413_w(m_ym, 0, (data & 0x3f));
862      ym2413_w(m_ym, space, 0, (data & 0x3f));
863863}
864864
865865
r17961r17962
869869   if (m_has_fm)
870870   {
871871      logerror("data_port_0_w %x %x\n", offset, data);
872      ym2413_w(m_ym, 1, data);
872      ym2413_w(m_ym, space, 1, data);
873873   }
874874}
875875
trunk/src/mess/machine/nes_pcb.c
r17961r17962
19011901   /* Send $5000-$5015 to the sound chip */
19021902   if ((offset >= 0xf00) && (offset <= 0xf15))
19031903   {
1904      nes_psg_w(state->m_sound, offset & 0x1f, data);
1904      nes_psg_w(state->m_sound, *space, offset & 0x1f, data);
19051905      return;
19061906   }
19071907
trunk/src/mess/machine/odyssey2.c
r17961r17962
100100      if ( offset & 0x80 ) {
101101         if ( data & 0x20 ) {
102102            logerror("voice write %02X, data = %02X (p1 = %02X)\n", offset, data, m_p1 );
103            sp0256_ALD_w( machine().device("sp0256_speech"), 0, offset & 0x7F );
103            sp0256_ALD_w( machine().device("sp0256_speech"), space, 0, offset & 0x7F );
104104         } else {
105105            /* TODO: Reset sp0256 in this case */
106106         }
trunk/src/mess/machine/s100_mm65k16s.c
r17961r17962
234234//  s100_smemr_r - memory read
235235//-------------------------------------------------
236236
237UINT8 s100_mm65k16s_device::s100_smemr_r(offs_t offset)
237UINT8 s100_mm65k16s_device::s100_smemr_r(address_space &space, offs_t offset)
238238{
239239   UINT8 data = 0;
240240
r17961r17962
251251//  s100_mwrt_w - memory write
252252//-------------------------------------------------
253253
254void s100_mm65k16s_device::s100_mwrt_w(offs_t offset, UINT8 data)
254void s100_mm65k16s_device::s100_mwrt_w(address_space &space, offs_t offset, UINT8 data)
255255{
256256   if (offset < 0xf800)
257257   {
trunk/src/mess/machine/s100_mm65k16s.h
r17961r17962
4141    virtual void device_config_complete() { m_shortname = "mm65k16s"; }
4242
4343   // device_s100_card_interface overrides
44   virtual UINT8 s100_smemr_r(offs_t offset);
45   virtual void s100_mwrt_w(offs_t offset, UINT8 data);
44   virtual UINT8 s100_smemr_r(address_space &space, offs_t offset);
45   virtual void s100_mwrt_w(address_space &space, offs_t offset, UINT8 data);
4646   virtual void s100_phantom_w(int state);
4747
4848private:
trunk/src/mess/machine/v1050kb.c
r17961r17962
417417   output_set_led_value(0, BIT(data, 5));
418418
419419   // speaker output
420   discrete_sound_w(m_discrete, NODE_01, BIT(data, 6));
420   discrete_sound_w(m_discrete, space, NODE_01, BIT(data, 6));
421421
422422   // serial output
423423   m_so = BIT(data, 7);
trunk/src/mess/machine/compis.c
r17961r17962
214214   /* DMA acknowledge if iSBX-218A has DMA enabled */
215215   if (ioport("DSW1")->read())
216216   {
217      data = upd765_dack_r(m_fdc, 0);
217      data = upd765_dack_r(m_fdc, space, 0);
218218   }
219219
220220   return data;
r17961r17962
225225   switch(offset)
226226   {
227227      case 2:
228         upd765_data_w(m_fdc, 0, data);
228         upd765_data_w(m_fdc, space, 0, data);
229229         break;
230230      default:
231231         printf("FDC Unknown Port Write %04X = %04X\n", offset, data);
r17961r17962
240240   switch(offset)
241241   {
242242      case 0:
243         data = upd765_status_r(m_fdc, 0);
243         data = upd765_status_r(m_fdc, space, 0);
244244         break;
245245      case 2:
246         data = upd765_data_r(m_fdc, 0);
246         data = upd765_data_r(m_fdc, space, 0);
247247         break;
248248      default:
249249         printf("FDC Unknown Port Read %04X\n", offset);
r17961r17962
347347
348348READ16_MEMBER( compis_state::compis_osp_pit_r )
349349{
350   return pit8253_r(m_8254, offset);
350   return pit8253_r(m_8254, space, offset);
351351}
352352
353353WRITE16_MEMBER( compis_state::compis_osp_pit_w )
354354{
355   pit8253_w(m_8254, offset, data);
355   pit8253_w(m_8254, space, offset, data);
356356}
357357
358358
trunk/src/mess/machine/c1551.c
r17961r17962
579579
580580   if (tpi1_selected(offset))
581581   {
582      data = tpi6525_r(m_tpi1, offset & 0x07);
582      data = tpi6525_r(m_tpi1, space, offset & 0x07);
583583   }
584584
585585   return data;
r17961r17962
594594{
595595   if (tpi1_selected(offset))
596596   {
597      tpi6525_w(m_tpi1, offset & 0x07, data);
597      tpi6525_w(m_tpi1, space, offset & 0x07, data);
598598   }
599599
600600   m_exp->cd_w(space, offset, data, ba, cs0, c1l, c2l, cs1, c1h, c2h);
trunk/src/mess/machine/mac.c
r17961r17962
132132static int scan_keyboard(running_machine &machine);
133133static TIMER_CALLBACK(inquiry_timeout_func);
134134static void keyboard_receive(running_machine &machine, int val);
135static READ8_DEVICE_HANDLER(mac_via_in_a);
136static READ8_DEVICE_HANDLER(mac_via_in_b);
137static READ8_DEVICE_HANDLER(mac_adb_via_in_cb2);
138static WRITE8_DEVICE_HANDLER(mac_via_out_a);
139static WRITE8_DEVICE_HANDLER(mac_via_out_b);
140static WRITE8_DEVICE_HANDLER(mac_adb_via_out_cb2);
141static WRITE8_DEVICE_HANDLER(mac_via_out_cb2);
142static READ8_DEVICE_HANDLER(mac_via2_in_a);
143static READ8_DEVICE_HANDLER(mac_via2_in_b);
144static WRITE8_DEVICE_HANDLER(mac_via2_out_a);
145static WRITE8_DEVICE_HANDLER(mac_via2_out_b);
135static DECLARE_READ8_DEVICE_HANDLER(mac_via_in_a);
136static DECLARE_READ8_DEVICE_HANDLER(mac_via_in_b);
137static DECLARE_READ8_DEVICE_HANDLER(mac_adb_via_in_cb2);
138static DECLARE_WRITE8_DEVICE_HANDLER(mac_via_out_a);
139static DECLARE_WRITE8_DEVICE_HANDLER(mac_via_out_b);
140static DECLARE_WRITE8_DEVICE_HANDLER(mac_adb_via_out_cb2);
141static DECLARE_WRITE8_DEVICE_HANDLER(mac_via_out_cb2);
142static DECLARE_READ8_DEVICE_HANDLER(mac_via2_in_a);
143static DECLARE_READ8_DEVICE_HANDLER(mac_via2_in_b);
144static DECLARE_WRITE8_DEVICE_HANDLER(mac_via2_out_a);
145static DECLARE_WRITE8_DEVICE_HANDLER(mac_via2_out_b);
146146static void mac_via_irq(device_t *device, int state);
147147static void mac_via2_irq(device_t *device, int state);
148148static offs_t mac_dasm_override(device_t &device, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, int options);
r17961r17962
11551155   UINT16 result = 0;
11561156   device_t *fdc = space.machine().device("fdc");
11571157
1158   result = applefdc_r(fdc, (offset >> 8));
1158   result = applefdc_r(fdc, space, (offset >> 8));
11591159
11601160   if (LOG_MAC_IWM)
11611161      printf("mac_iwm_r: offset=0x%08x mem_mask %04x = %02x (PC %x)\n", offset, mem_mask, result, m_maincpu->pc());
r17961r17962
11711171      printf("mac_iwm_w: offset=0x%08x data=0x%04x mask %04x (PC=%x)\n", offset, data, mem_mask, m_maincpu->pc());
11721172
11731173   if (ACCESSING_BITS_0_7)
1174      applefdc_w(fdc, (offset >> 8), data & 0xff);
1174      applefdc_w(fdc, space, (offset >> 8), data & 0xff);
11751175   else
1176      applefdc_w(fdc, (offset >> 8), data>>8);
1176      applefdc_w(fdc, space, (offset >> 8), data>>8);
11771177}
11781178
11791179static READ8_DEVICE_HANDLER(mac_adb_via_in_cb2)
trunk/src/mess/machine/i8271.c
r17961r17962
14961496/* to be completed! */
14971497READ8_DEVICE_HANDLER(i8271_dack_r)
14981498{
1499   return i8271_data_r(device, offset);
1499   return i8271_data_r(device, space, offset);
15001500}
15011501
15021502/* to be completed! */
15031503WRITE8_DEVICE_HANDLER(i8271_dack_w)
15041504{
1505   i8271_data_w(device, offset, data);
1505   i8271_data_w(device, space, offset, data);
15061506}
15071507
15081508 READ8_DEVICE_HANDLER(i8271_data_r)
trunk/src/mess/machine/i8271.h
r17961r17962
4646/***************************************************************************
4747    FUNCTION PROTOTYPES
4848***************************************************************************/
49READ8_DEVICE_HANDLER (i8271_r);
50WRITE8_DEVICE_HANDLER(i8271_w);
49DECLARE_READ8_DEVICE_HANDLER (i8271_r);
50DECLARE_WRITE8_DEVICE_HANDLER(i8271_w);
5151
52READ8_DEVICE_HANDLER (i8271_dack_r);
53WRITE8_DEVICE_HANDLER(i8271_dack_w);
52DECLARE_READ8_DEVICE_HANDLER (i8271_dack_r);
53DECLARE_WRITE8_DEVICE_HANDLER(i8271_dack_w);
5454
55READ8_DEVICE_HANDLER (i8271_data_r);
56WRITE8_DEVICE_HANDLER(i8271_data_w);
55DECLARE_READ8_DEVICE_HANDLER (i8271_data_r);
56DECLARE_WRITE8_DEVICE_HANDLER(i8271_data_w);
5757
5858
5959/***************************************************************************
trunk/src/mess/machine/amigacd.c
r17961r17962
216216      {
217217         device_t *tpi = space->machine().device("tpi6525");
218218         LOG(( "DMAC: PC=%08x - TPI6525 Read(%d)\n", space->device().safe_pc(), (offset - 0x58) ));
219         return tpi6525_r(tpi, offset - 0x58);
219         return tpi6525_r(tpi, *space, offset - 0x58);
220220      }
221221      break;
222222
r17961r17962
343343      {
344344         device_t *tpi = space->machine().device("tpi6525");
345345         LOG(( "DMAC: PC=%08x - TPI6525 Write(%d) - data = %04x\n", space->device().safe_pc(), (offset - 0x58), data ));
346         tpi6525_w(tpi, offset - 0x58, data);
346         tpi6525_w(tpi, *space, offset - 0x58, data);
347347      }
348348      break;
349349
trunk/src/mess/machine/amigacd.h
r17961r17962
66MACHINE_RESET( amigacd );
77
88/* 6525tpi */
9READ8_DEVICE_HANDLER( amigacd_tpi6525_portc_r );
10WRITE8_DEVICE_HANDLER( amigacd_tpi6525_portb_w );
9DECLARE_READ8_DEVICE_HANDLER( amigacd_tpi6525_portc_r );
10DECLARE_WRITE8_DEVICE_HANDLER( amigacd_tpi6525_portb_w );
1111WRITE_LINE_DEVICE_HANDLER( amigacd_tpi6525_irq );
1212
1313
trunk/src/mess/machine/concept.c
r17961r17962
3939/*static int ready;*/         /* ready line from monochip, role unknown */
4040
4141/* Via */
42static READ8_DEVICE_HANDLER(via_in_a);
43static WRITE8_DEVICE_HANDLER(via_out_a);
44static READ8_DEVICE_HANDLER(via_in_b);
45static WRITE8_DEVICE_HANDLER(via_out_b);
46static WRITE8_DEVICE_HANDLER(via_out_cb2);
42static DECLARE_READ8_DEVICE_HANDLER(via_in_a);
43static DECLARE_WRITE8_DEVICE_HANDLER(via_out_a);
44static DECLARE_READ8_DEVICE_HANDLER(via_in_b);
45static DECLARE_WRITE8_DEVICE_HANDLER(via_out_b);
46static DECLARE_WRITE8_DEVICE_HANDLER(via_out_cb2);
4747static void via_irq_func(device_t *device, int state);
4848
4949
r17961r17962
312312      /* calendar R/W */
313313      VLOG(("concept_io_r: Calendar read at address 0x03%4.4x\n", offset << 1));
314314      if (!m_clock_enable)
315         return mm58274c_r(machine().device("mm58274c"), m_clock_address);
315         return mm58274c_r(machine().device("mm58274c"), space, m_clock_address);
316316      break;
317317
318318   case 7:
r17961r17962
454454      /* calendar R/W */
455455      LOG(("concept_io_w: Calendar written to at address 0x03%4.4x, data: 0x%4.4x\n", offset << 1, data));
456456      if (!m_clock_enable)
457         mm58274c_w(machine().device("mm58274c"), m_clock_address, data & 0xf);
457         mm58274c_w(machine().device("mm58274c"), space, m_clock_address, data & 0xf);
458458      break;
459459
460460   case 7:
r17961r17962
599599
600600   case 8:
601601      /* FDC STATUS REG */
602      return wd17xx_status_r(fdc, offset);
602      return wd17xx_status_r(fdc, *space, offset);
603603
604604   case 9:
605605      /* FDC TRACK REG */
606      return wd17xx_track_r(fdc, offset);
606      return wd17xx_track_r(fdc, *space, offset);
607607
608608   case 10:
609609      /* FDC SECTOR REG */
610      return wd17xx_sector_r(fdc, offset);
610      return wd17xx_sector_r(fdc, *space, offset);
611611
612612   case 11:
613613      /* FDC DATA REG */
614      return wd17xx_data_r(fdc, offset);
614      return wd17xx_data_r(fdc, *space, offset);
615615   }
616616
617617   return 0;
r17961r17962
640640
641641   case 8:
642642      /* FDC COMMAMD REG */
643      wd17xx_command_w(fdc, offset, data);
643      wd17xx_command_w(fdc, *space, offset, data);
644644      break;
645645
646646   case 9:
647647      /* FDC TRACK REG */
648      wd17xx_track_w(fdc, offset, data);
648      wd17xx_track_w(fdc, *space, offset, data);
649649      break;
650650
651651   case 10:
652652      /* FDC SECTOR REG */
653      wd17xx_sector_w(fdc, offset, data);
653      wd17xx_sector_w(fdc, *space, offset, data);
654654      break;
655655
656656   case 11:
657657      /* FDC DATA REG */
658      wd17xx_data_w(fdc, offset, data);
658      wd17xx_data_w(fdc, *space, offset, data);
659659      break;
660660   }
661661}
trunk/src/mess/machine/upd7002.h
r17961r17962
5959
6060/* Standard handlers */
6161
62READ8_DEVICE_HANDLER ( uPD7002_EOC_r );
63READ8_DEVICE_HANDLER ( uPD7002_r );
64WRITE8_DEVICE_HANDLER ( uPD7002_w );
62DECLARE_READ8_DEVICE_HANDLER ( uPD7002_EOC_r );
63DECLARE_READ8_DEVICE_HANDLER ( uPD7002_r );
64DECLARE_WRITE8_DEVICE_HANDLER ( uPD7002_w );
6565
6666
6767/***************************************************************************
trunk/src/mess/machine/msx.c
r17961r17962
655655   if (m_opll_active)
656656   {
657657      if (offset == 1)
658         ym2413_w (m_ym, 1, data);
658         ym2413_w (m_ym, space, 1, data);
659659      else
660         ym2413_w (m_ym, 0, data);
660         ym2413_w (m_ym, space, 0, data);
661661   }
662662}
663663
trunk/src/mess/machine/mz700.c
r17961r17962
3636   } while (0)
3737
3838
39static READ8_DEVICE_HANDLER ( pio_port_b_r );
40static READ8_DEVICE_HANDLER ( pio_port_c_r );
41static WRITE8_DEVICE_HANDLER ( pio_port_a_w );
42static WRITE8_DEVICE_HANDLER ( pio_port_c_w );
39static DECLARE_READ8_DEVICE_HANDLER ( pio_port_b_r );
40static DECLARE_READ8_DEVICE_HANDLER ( pio_port_c_r );
41static DECLARE_WRITE8_DEVICE_HANDLER ( pio_port_a_w );
42static DECLARE_WRITE8_DEVICE_HANDLER ( pio_port_c_w );
4343
4444I8255_INTERFACE( mz700_ppi8255_interface )
4545{
trunk/src/mess/machine/lisa.c
r17961r17962
9191    a hard disk
9292*/
9393
94static READ8_DEVICE_HANDLER(COPS_via_in_b);
95static WRITE8_DEVICE_HANDLER(COPS_via_out_a);
96static WRITE8_DEVICE_HANDLER(COPS_via_out_b);
97static WRITE8_DEVICE_HANDLER(COPS_via_out_ca2);
98static WRITE8_DEVICE_HANDLER(COPS_via_out_cb2);
94static DECLARE_READ8_DEVICE_HANDLER(COPS_via_in_b);
95static DECLARE_WRITE8_DEVICE_HANDLER(COPS_via_out_a);
96static DECLARE_WRITE8_DEVICE_HANDLER(COPS_via_out_b);
97static DECLARE_WRITE8_DEVICE_HANDLER(COPS_via_out_ca2);
98static DECLARE_WRITE8_DEVICE_HANDLER(COPS_via_out_cb2);
9999static void COPS_via_irq_func(device_t *device, int val);
100static READ8_DEVICE_HANDLER(parallel_via_in_b);
100static DECLARE_READ8_DEVICE_HANDLER(parallel_via_in_b);
101101
102102
103103const via6522_interface lisa_via6522_0_intf =
r17961r17962
729729{
730730   lisa_state *state = device->machine().driver_data<lisa_state>();
731731   via6522_device *via_0 = device->machine().device<via6522_device>("via6522_0");
732   address_space *space = device->machine().device("maincpu")->memory().space(AS_PROGRAM);
733732
734733   /* pull-up */
735   data |= (~ via_0->read(*space,VIA_DDRA)) & 0x01;
734   data |= (~ via_0->read(space,VIA_DDRA)) & 0x01;
736735
737736   if (data & 0x01)
738737   {
r17961r17962
10731072
10741073   {
10751074      via6522_device *via_0 = machine().device<via6522_device>("via6522_0");
1076      COPS_via_out_ca2(via_0, 0, 0);   /* VIA core forgets to do so */
1075      COPS_via_out_ca2(via_0, generic_space(), 0, 0);   /* VIA core forgets to do so */
10771076   }
10781077
10791078   /* initialize floppy */
r17961r17962
12561255   switch ((offset & 0x0030) >> 4)
12571256   {
12581257   case 0:   /* IWM */
1259      answer = applefdc_r(fdc, offset);
1258      answer = applefdc_r(fdc, space, offset);
12601259      break;
12611260
12621261   case 1:   /* TTL glue */
r17961r17962
12831282   switch ((offset & 0x0030) >> 4)
12841283   {
12851284   case 0:   /* IWM */
1286      applefdc_w(fdc, offset, data);
1285      applefdc_w(fdc, space, offset, data);
12871286      break;
12881287
12891288   case 1:   /* TTL glue */
trunk/src/mess/machine/cgenie.c
r17961r17962
1919#include "machine/ram.h"
2020
2121#define AYWriteReg(chip,port,value) \
22   ay8910_address_w(ay8910, 0,port);  \
23   ay8910_data_w(ay8910, 0,value)
22   ay8910_address_w(ay8910, *space, 0,port);  \
23   ay8910_data_w(ay8910, *space, 0,value)
2424
2525#define TAPE_HEADER "Colour Genie - Virtual Tape File"
2626
r17961r17962
336336   /* If the floppy isn't emulated, return 0 */
337337   if( (space->machine().root_device().ioport("DSW0")->read() & 0x80) == 0 )
338338      return 0;
339   return wd17xx_status_r(fdc, offset);
339   return wd17xx_status_r(fdc, *space, offset);
340340}
341341
342342 READ8_HANDLER( cgenie_track_r )
r17961r17962
345345   /* If the floppy isn't emulated, return 0xff */
346346   if( (space->machine().root_device().ioport("DSW0")->read() & 0x80) == 0 )
347347      return 0xff;
348   return wd17xx_track_r(fdc, offset);
348   return wd17xx_track_r(fdc, *space, offset);
349349}
350350
351351 READ8_HANDLER( cgenie_sector_r )
r17961r17962
354354   /* If the floppy isn't emulated, return 0xff */
355355   if( (space->machine().root_device().ioport("DSW0")->read() & 0x80) == 0 )
356356      return 0xff;
357   return wd17xx_sector_r(fdc, offset);
357   return wd17xx_sector_r(fdc, *space, offset);
358358}
359359
360360 READ8_HANDLER(cgenie_data_r )
r17961r17962
363363   /* If the floppy isn't emulated, return 0xff */
364364   if( (space->machine().root_device().ioport("DSW0")->read() & 0x80) == 0 )
365365      return 0xff;
366   return wd17xx_data_r(fdc, offset);
366   return wd17xx_data_r(fdc, *space, offset);
367367}
368368
369369WRITE8_HANDLER( cgenie_command_w )
r17961r17962
372372   /* If the floppy isn't emulated, return immediately */
373373   if( (space->machine().root_device().ioport("DSW0")->read() & 0x80) == 0 )
374374      return;
375   wd17xx_command_w(fdc, offset, data);
375   wd17xx_command_w(fdc, *space, offset, data);
376376}
377377
378378WRITE8_HANDLER( cgenie_track_w )
r17961r17962
381381   /* If the floppy isn't emulated, ignore the write */
382382   if( (space->machine().root_device().ioport("DSW0")->read() & 0x80) == 0 )
383383      return;
384   wd17xx_track_w(fdc, offset, data);
384   wd17xx_track_w(fdc, *space, offset, data);
385385}
386386
387387WRITE8_HANDLER( cgenie_sector_w )
r17961r17962
390390   /* If the floppy isn't emulated, ignore the write */
391391   if( (space->machine().root_device().ioport("DSW0")->read() & 0x80) == 0 )
392392      return;
393   wd17xx_sector_w(fdc, offset, data);
393   wd17xx_sector_w(fdc, *space, offset, data);
394394}
395395
396396WRITE8_HANDLER( cgenie_data_w )
r17961r17962
399399   /* If the floppy isn't emulated, ignore the write */
400400   if( (space->machine().root_device().ioport("DSW0")->read() & 0x80) == 0 )
401401      return;
402   wd17xx_data_w(fdc, offset, data);
402   wd17xx_data_w(fdc, *space, offset, data);
403403}
404404
405405 READ8_HANDLER( cgenie_irq_status_r )
r17961r17962
614614{
615615   cgenie_state *state = device->machine().driver_data<cgenie_state>();
616616   state->m_control_port = data;
617   ay8910_address_w(device, offset, data);
617   ay8910_address_w(device, space, offset, data);
618618}
trunk/src/mess/machine/super80.c
r17961r17962
9494      state->m_cass_data[1] = 0;
9595   }
9696
97   state->m_pio->port_b_write(pio_port_b_r(state->m_pio,0));
97   state->m_pio->port_b_write(pio_port_b_r(state->m_pio,state->generic_space(),0,0xff));
9898}
9999
100100/* after the first 4 bytes have been read from ROM, switch the ram back in */
trunk/src/mess/machine/beta.c
r17961r17962
9999   beta_disk_state *beta = get_safe_token(device);
100100
101101   if (beta->betadisk_active==1) {
102      return wd17xx_status_r(beta->wd179x, offset);
102      return wd17xx_status_r(beta->wd179x, space, offset);
103103   } else {
104104      return 0xff;
105105   }
r17961r17962
110110   beta_disk_state *beta = get_safe_token(device);
111111
112112   if (beta->betadisk_active==1) {
113      return wd17xx_track_r(beta->wd179x, offset);
113      return wd17xx_track_r(beta->wd179x, space, offset);
114114   } else {
115115      return 0xff;
116116   }
r17961r17962
121121   beta_disk_state *beta = get_safe_token(device);
122122
123123   if (beta->betadisk_active==1) {
124      return wd17xx_sector_r(beta->wd179x, offset);
124      return wd17xx_sector_r(beta->wd179x, space, offset);
125125   } else {
126126      return 0xff;
127127   }
r17961r17962
133133   beta_disk_state *beta = get_safe_token(device);
134134
135135   if (beta->betadisk_active==1) {
136      return wd17xx_data_r(beta->wd179x, offset);
136      return wd17xx_data_r(beta->wd179x, space, offset);
137137   } else {
138138      return 0xff;
139139   }
r17961r17962
171171   beta_disk_state *beta = get_safe_token(device);
172172
173173   if (beta->betadisk_active==1) {
174      wd17xx_command_w(beta->wd179x, offset, data);
174      wd17xx_command_w(beta->wd179x, space, offset, data);
175175   }
176176}
177177
r17961r17962
180180   beta_disk_state *beta = get_safe_token(device);
181181
182182   if (beta->betadisk_active==1) {
183      wd17xx_track_w(beta->wd179x, offset, data);
183      wd17xx_track_w(beta->wd179x, space, offset, data);
184184   }
185185}
186186
r17961r17962
189189   beta_disk_state *beta = get_safe_token(device);
190190
191191   if (beta->betadisk_active==1) {
192      wd17xx_sector_w(beta->wd179x, offset, data);
192      wd17xx_sector_w(beta->wd179x, space, offset, data);
193193   }
194194}
195195
r17961r17962
198198   beta_disk_state *beta = get_safe_token(device);
199199
200200   if (beta->betadisk_active==1) {
201      wd17xx_data_w(beta->wd179x, offset, data);
201      wd17xx_data_w(beta->wd179x, space, offset, data);
202202   }
203203}
204204
trunk/src/mess/machine/beta.h
r17961r17962
4747#define MCFG_BETA_DISK_REMOVE(_tag)      \
4848    MCFG_DEVICE_REMOVE(_tag)
4949
50READ8_DEVICE_HANDLER(betadisk_status_r);
51READ8_DEVICE_HANDLER(betadisk_track_r);
52READ8_DEVICE_HANDLER(betadisk_sector_r);
53READ8_DEVICE_HANDLER(betadisk_data_r);
54READ8_DEVICE_HANDLER(betadisk_state_r);
50DECLARE_READ8_DEVICE_HANDLER(betadisk_status_r);
51DECLARE_READ8_DEVICE_HANDLER(betadisk_track_r);
52DECLARE_READ8_DEVICE_HANDLER(betadisk_sector_r);
53DECLARE_READ8_DEVICE_HANDLER(betadisk_data_r);
54DECLARE_READ8_DEVICE_HANDLER(betadisk_state_r);
5555
56WRITE8_DEVICE_HANDLER(betadisk_param_w);
57WRITE8_DEVICE_HANDLER(betadisk_command_w);
58WRITE8_DEVICE_HANDLER(betadisk_track_w);
59WRITE8_DEVICE_HANDLER(betadisk_sector_w);
60WRITE8_DEVICE_HANDLER(betadisk_data_w);
56DECLARE_WRITE8_DEVICE_HANDLER(betadisk_param_w);
57DECLARE_WRITE8_DEVICE_HANDLER(betadisk_command_w);
58DECLARE_WRITE8_DEVICE_HANDLER(betadisk_track_w);
59DECLARE_WRITE8_DEVICE_HANDLER(betadisk_sector_w);
60DECLARE_WRITE8_DEVICE_HANDLER(betadisk_data_w);
6161#endif /* __BETA_H__ */
trunk/src/mess/machine/mbc55x.c
r17961r17962
118118
119119READ8_MEMBER(mbc55x_state::mbcpic8259_r)
120120{
121   return pic8259_r(m_pic, offset>>1);
121   return pic8259_r(m_pic, space, offset>>1);
122122}
123123
124124WRITE8_MEMBER(mbc55x_state::mbcpic8259_w)
125125{
126   pic8259_w(m_pic, offset>>1, data);
126   pic8259_w(m_pic, space, offset>>1, data);
127127}
128128
129129static IRQ_CALLBACK(mbc55x_irq_callback)
r17961r17962
157157
158158READ8_MEMBER(mbc55x_state::mbcpit8253_r)
159159{
160   return pit8253_r(m_pit, offset>>1);
160   return pit8253_r(m_pit, space, offset>>1);
161161}
162162
163163WRITE8_MEMBER(mbc55x_state::mbcpit8253_w)
164164{
165   pit8253_w(m_pit, offset>>1, data);
165   pit8253_w(m_pit, space, offset>>1, data);
166166}
167167
168168WRITE_LINE_MEMBER( mbc55x_state::pit8253_t2 )
r17961r17962
187187
188188READ8_MEMBER(mbc55x_state::mbc55x_disk_r)
189189{
190   return wd17xx_r(m_fdc, offset>>1);
190   return wd17xx_r(m_fdc, space, offset>>1);
191191}
192192
193193WRITE8_MEMBER(mbc55x_state::mbc55x_disk_w)
194194{
195   wd17xx_w(m_fdc, offset>>1, data);
195   wd17xx_w(m_fdc, space, offset>>1, data);
196196}
197197
198198WRITE_LINE_MEMBER( mbc55x_state::mbc55x_fdc_intrq_w )
trunk/src/mess/machine/ay31015.c
r17961r17962
112112   UINT16 tx_pulses;   // total pulses left
113113   double tx_clock;
114114   emu_timer *tx_timer;
115
116   devcb_resolved_read8   read_si;            /* SI - pin 20 - This will be called whenever the SI pin is sampled. Optional */
117   devcb_resolved_write8   write_so;            /* SO - pin 25 - This will be called whenever data is put on the SO pin. Optional */
118   devcb_resolved_write8   status_changed;         /* This will be called whenever one of the status pins may have changed. Optional */
115119};
116120
117121
r17961r17962
148152{
149153   ay31015_t   *ay31015 = get_safe_token( device );
150154
151   if ( ay31015->config->read_si )
152      ay31015->pins[AY31015_SI] = (ay31015->config->read_si)( device, 0 ) ? 1 : 0;
155   if ( !ay31015->read_si.isnull() )
156      ay31015->pins[AY31015_SI] = ay31015->read_si( 0 ) ? 1 : 0;
153157
154158   return ay31015->pins[AY31015_SI];
155159}
r17961r17962
161165
162166   ay31015->pins[AY31015_SO] = data ? 1 : 0;
163167
164   if ( ay31015->config->write_so )
165      (ay31015->config->write_so)( device, 0, ay31015->pins[AY31015_SO] );
168   if ( !ay31015->write_so.isnull() )
169      ay31015->write_so( 0, ay31015->pins[AY31015_SO] );
166170}
167171
168172
r17961r17962
197201   }
198202   status_pins_changed += ay31015_update_status_pin( ay31015, STATUS_EOC, AY31015_EOC );
199203
200   if ( status_pins_changed && ay31015->config->status_changed )
204   if ( status_pins_changed && !ay31015->status_changed.isnull() )
201205   {
202      (ay31015->config->status_changed)( device, 0, status_pins_changed );
206      ay31015->status_changed( 0, status_pins_changed );
203207   }
204208}
205209
r17961r17962
693697
694698   ay31015->config = (const ay31015_config*)device->static_config();
695699
700   ay31015->read_si.resolve(ay31015->config->read_si_cb, *device);
701   ay31015->write_so.resolve(ay31015->config->write_so_cb, *device);
702   ay31015->status_changed.resolve(ay31015->config->status_changed_cb, *device);
703
696704   ay31015->tx_clock = ay31015->config->transmitter_clock;
697705   ay31015->rx_clock = ay31015->config->receiver_clock;
698706
trunk/src/mess/machine/ay31015.h
r17961r17962
5454   ay31015_type_t      type;               /* Type of chip */
5555   double            transmitter_clock;      /* TCP - pin 40 */
5656   double            receiver_clock;         /* RCP - pin 17 */
57   read8_device_func   read_si;            /* SI - pin 20 - This will be called whenever the SI pin is sampled. Optional */
58   write8_device_func   write_so;            /* SO - pin 25 - This will be called whenever data is put on the SO pin. Optional */
59   write8_device_func   status_changed;         /* This will be called whenever one of the status pins may have changed. Optional */
57   devcb_read8         read_si_cb;            /* SI - pin 20 - This will be called whenever the SI pin is sampled. Optional */
58   devcb_write8      write_so_cb;            /* SO - pin 25 - This will be called whenever data is put on the SO pin. Optional */
59   devcb_write8      status_changed_cb;         /* This will be called whenever one of the status pins may have changed. Optional */
6060};
6161
6262
trunk/src/mess/machine/southbridge.c
r17961r17962
467467
468468READ8_MEMBER( southbridge_device::at_dma8237_2_r )
469469{
470   return i8237_r( m_dma8237_2, offset / 2);
470   return i8237_r( m_dma8237_2, space, offset / 2);
471471}
472472
473473WRITE8_MEMBER( southbridge_device::at_dma8237_2_w )
474474{
475   i8237_w( m_dma8237_2, offset / 2, data);
475   i8237_w( m_dma8237_2, space, offset / 2, data);
476476}
477477
478478READ8_MEMBER( southbridge_device::at_keybc_r )
trunk/src/mess/machine/apple1.c
r17961r17962
5454static TIMER_CALLBACK(apple1_kbd_poll);
5555static TIMER_CALLBACK(apple1_kbd_strobe_end);
5656
57static READ8_DEVICE_HANDLER( apple1_pia0_kbdin );
58static WRITE8_DEVICE_HANDLER( apple1_pia0_dspout );
59static WRITE8_DEVICE_HANDLER( apple1_pia0_dsp_write_signal );
57static DECLARE_READ8_DEVICE_HANDLER( apple1_pia0_kbdin );
58static DECLARE_WRITE8_DEVICE_HANDLER( apple1_pia0_dspout );
59static DECLARE_WRITE8_DEVICE_HANDLER( apple1_pia0_dsp_write_signal );
6060
6161static TIMER_CALLBACK(apple1_dsp_ready_start);
6262static TIMER_CALLBACK(apple1_dsp_ready_end);
trunk/src/mess/machine/iq151_disc2.c
r17961r17962
130130void iq151_disc2_device::io_read(offs_t offset, UINT8 &data)
131131{
132132   if (offset == 0xaa)
133      data = upd765_status_r(m_fdc, 0);
133      data = upd765_status_r(m_fdc, machine().driver_data()->generic_space(), 0);
134134   else if (offset == 0xab)
135      data = upd765_data_r(m_fdc, 0);
135      data = upd765_data_r(m_fdc, machine().driver_data()->generic_space(), 0);
136136}
137137
138138//-------------------------------------------------
r17961r17962
142142void iq151_disc2_device::io_write(offs_t offset, UINT8 data)
143143{
144144   if (offset == 0xab)
145      upd765_data_w(m_fdc, 0, data);
145      upd765_data_w(m_fdc, machine().driver_data()->generic_space(), 0, data);
146146   else if (offset == 0xac)
147147      m_rom_enabled = (data == 0x01);
148148}
trunk/src/mess/machine/mc6843.h
r17961r17962
4949
5050/* ---------- functions ------------ */
5151
52extern READ8_DEVICE_HANDLER  ( mc6843_r );
53extern WRITE8_DEVICE_HANDLER ( mc6843_w );
52extern DECLARE_READ8_DEVICE_HANDLER  ( mc6843_r );
53extern DECLARE_WRITE8_DEVICE_HANDLER ( mc6843_w );
5454
5555extern void mc6843_set_drive ( device_t *device, int drive );
5656extern void mc6843_set_side  ( device_t *device, int side );
trunk/src/mess/machine/mm58274c.h
r17961r17962
4242   int   day1;      /* first day of week */
4343};
4444
45READ8_DEVICE_HANDLER ( mm58274c_r );
46WRITE8_DEVICE_HANDLER( mm58274c_w );
45DECLARE_READ8_DEVICE_HANDLER ( mm58274c_r );
46DECLARE_WRITE8_DEVICE_HANDLER( mm58274c_w );
4747
4848/***************************************************************************
4949    DEVICE CONFIGURATION MACROS
trunk/src/mess/machine/mtx.c
r17961r17962
118118{
119119   mtx_state *state = device->machine().driver_data<mtx_state>();
120120
121   sn76496_w(device, 0, state->m_sound_latch);
121   sn76496_w(device, space, 0, state->m_sound_latch);
122122
123123   return 0xff;
124124}
trunk/src/mess/machine/lux10828.c
r17961r17962
687687
688688   switch (offset & 0x03)
689689   {
690   case 0: data = wd17xx_status_r(m_fdc, 0); break;
691   case 1: data = wd17xx_track_r(m_fdc, 0);  break;
692   case 2: data = wd17xx_sector_r(m_fdc, 0); break;
693   case 3: data = wd17xx_data_r(m_fdc, 0);   break;
690   case 0: data = wd17xx_status_r(m_fdc, space, 0); break;
691   case 1: data = wd17xx_track_r(m_fdc, space, 0);  break;
692   case 2: data = wd17xx_sector_r(m_fdc, space, 0); break;
693   case 3: data = wd17xx_data_r(m_fdc, space, 0);   break;
694694   }
695695
696696   return data;
r17961r17962
711711
712712   switch (offset & 0x03)
713713   {
714   case 0: wd17xx_command_w(m_fdc, 0, data); break;
715   case 1: wd17xx_track_w(m_fdc, 0, data);   break;
716   case 2: wd17xx_sector_w(m_fdc, 0, data);  break;
717   case 3: wd17xx_data_w(m_fdc, 0, data);    break;
714   case 0: wd17xx_command_w(m_fdc, space, 0, data); break;
715   case 1: wd17xx_track_w(m_fdc, space, 0, data);   break;
716   case 2: wd17xx_sector_w(m_fdc, space, 0, data);  break;
717   case 3: wd17xx_data_w(m_fdc, space, 0, data);    break;
718718   }
719719}
720720
trunk/src/mess/machine/rmnimbus.c
r17961r17962
6767
6868#include "includes/rmnimbus.h"
6969
70static void sio_interrupt(device_t *device, int state);
71//static WRITE8_DEVICE_HANDLER( sio_dtr_w );
72static WRITE8_DEVICE_HANDLER( sio_serial_transmit );
73static int sio_serial_receive( device_t *device, int channel );
70static WRITE_LINE_DEVICE_HANDLER( sio_interrupt );
71//static DECLARE_WRITE8_DEVICE_HANDLER( sio_dtr_w );
72static DECLARE_WRITE16_DEVICE_HANDLER( sio_serial_transmit );
73static DECLARE_READ16_DEVICE_HANDLER( sio_serial_receive );
7474
7575
7676/*-------------------------------------------------------------------------*/
r17961r17962
113113
114114const z80sio_interface nimbus_sio_intf =
115115{
116   sio_interrupt,         /* interrupt handler */
117   0, //sio_dtr_w,             /* DTR changed handler */
118   0,                  /* RTS changed handler */
119   0,                  /* BREAK changed handler */
120   sio_serial_transmit,   /* transmit handler */
121   sio_serial_receive      /* receive handler */
116   DEVCB_LINE(sio_interrupt),         /* interrupt handler */
117   DEVCB_NULL, //sio_dtr_w,             /* DTR changed handler */
118   DEVCB_NULL,                  /* RTS changed handler */
119   DEVCB_NULL,                  /* BREAK changed handler */
120   DEVCB_HANDLER(sio_serial_transmit),   /* transmit handler */
121   DEVCB_HANDLER(sio_serial_receive)      /* receive handler */
122122};
123123
124124/* Floppy drives WD2793 */
r17961r17962
21942194
21952195/* Z80 SIO/2 */
21962196
2197static void sio_interrupt(device_t *device, int state)
2197static WRITE_LINE_DEVICE_HANDLER( sio_interrupt )
21982198{
21992199   rmnimbus_state *drvstate = device->machine().driver_data<rmnimbus_state>();
22002200    if(LOG_SIO)
r17961r17962
22192219}
22202220#endif
22212221
2222static WRITE8_DEVICE_HANDLER( sio_serial_transmit )
2222static WRITE16_DEVICE_HANDLER( sio_serial_transmit )
22232223{
22242224}
22252225
2226static int sio_serial_receive( device_t *device, int channel )
2226static READ16_DEVICE_HANDLER( sio_serial_receive )
22272227{
2228    if(channel==0)
2228    if(offset==0)
22292229    {
22302230        return keyboard_queue_read(device->machine());
22312231    }
r17961r17962
23202320   switch(offset*2)
23212321   {
23222322      case 0x08 :
2323         result = wd17xx_status_r(fdc, 0);
2323         result = wd17xx_status_r(fdc, space, 0);
23242324         if (LOG_DISK_FDD) logerror("Disk status=%2.2X\n",result);
23252325         break;
23262326      case 0x0A :
2327         result = wd17xx_track_r(fdc, 0);
2327         result = wd17xx_track_r(fdc, space, 0);
23282328         break;
23292329      case 0x0C :
2330         result = wd17xx_sector_r(fdc, 0);
2330         result = wd17xx_sector_r(fdc, space, 0);
23312331         break;
23322332      case 0x0E :
2333         result = wd17xx_data_r(fdc, 0);
2333         result = wd17xx_data_r(fdc, space, 0);
23342334         break;
23352335      case 0x10 :
23362336         m_nimbus_drives.reg410_in &= ~FDC_BITS_410;
r17961r17962
24062406
24072407            break;
24082408      case 0x08 :
2409         wd17xx_command_w(fdc, 0, data);
2409         wd17xx_command_w(fdc, space, 0, data);
24102410         break;
24112411      case 0x0A :
2412         wd17xx_track_w(fdc, 0, data);
2412         wd17xx_track_w(fdc, space, 0, data);
24132413         break;
24142414      case 0x0C :
2415         wd17xx_sector_w(fdc, 0, data);
2415         wd17xx_sector_w(fdc, space, 0, data);
24162416         break;
24172417      case 0x0E :
2418         wd17xx_data_w(fdc, 0, data);
2418         wd17xx_data_w(fdc, space, 0, data);
24192419         break;
24202420        case 0x10 :
24212421            hdc_ctrl_write(machine(),data);
r17961r17962
27742774    UINT8   result=0;
27752775
27762776    if ((offset*2)==0)
2777        result=ay8910_r(ay8910,0);
2777        result=ay8910_r(ay8910,space, 0);
27782778
27792779    return result;
27802780}
r17961r17962
27892789
27902790    switch (offset*2)
27912791    {
2792        case 0x00   : ay8910_data_address_w(ay8910, 1, data); break;
2793        case 0x02   : ay8910_data_address_w(ay8910, 0, data); break;
2792        case 0x00   : ay8910_data_address_w(ay8910, space, 1, data); break;
2793        case 0x02   : ay8910_data_address_w(ay8910, space, 0, data); break;
27942794    }
27952795
27962796}
trunk/src/mess/machine/isa_adlib.c
r17961r17962
2828   UINT8 retVal = 0xff;
2929   switch(offset)
3030   {
31      case 0 : retVal = ym3812_status_port_r( device, offset ); break;
31      case 0 : retVal = ym3812_status_port_r( device, space, offset ); break;
3232   }
3333   return retVal;
3434}
r17961r17962
3737{
3838   switch(offset)
3939   {
40      case 0 : ym3812_control_port_w( device, offset, data ); break;
41      case 1 : ym3812_write_port_w( device, offset, data ); break;
40      case 0 : ym3812_control_port_w( device, space, offset, data ); break;
41      case 1 : ym3812_write_port_w( device, space, offset, data ); break;
4242   }
4343}
4444
trunk/src/mess/machine/isa_ibm_mfc.c
r17961r17962
415415      case 0x6:
416416      case 0x7:
417417      {
418         pit8253_w(m_d8253, offset & 3, data);
418         pit8253_w(m_d8253, space, offset & 3, data);
419419         break;
420420      }
421421
trunk/src/mess/machine/isa_gblaster.c
r17961r17962
3434{
3535   switch(offset)
3636   {
37      case 0 : saa1099_control_w( device, offset, data ); break;
38      case 1 : saa1099_data_w( device, offset, data ); break;
37      case 0 : saa1099_control_w( device, space, offset, data ); break;
38      case 1 : saa1099_data_w( device, space, offset, data ); break;
3939   }
4040}
4141
trunk/src/mess/machine/pk8020.c
r17961r17962
164164
165165   switch(offset & 0x38)
166166   {
167      case 0x00: return pit8253_r(pit,offset & 3);
167      case 0x00: return pit8253_r(pit,space, offset & 3);
168168      case 0x08: return ppi3->read(space,offset & 3);
169169      case 0x10: switch(offset & 1) {
170170                  case 0 : return rs232->data_r(space,0);
r17961r17962
172172               }
173173               break;
174174      case 0x18: switch(offset & 3) {
175                  case 0 : return wd17xx_status_r(fdc,0);
176                  case 1 : return wd17xx_track_r(fdc,0);
177                  case 2 : return wd17xx_sector_r(fdc,0);
178                  case 3 : return wd17xx_data_r(fdc,0);
175                  case 0 : return wd17xx_status_r(fdc,space, 0);
176                  case 1 : return wd17xx_track_r(fdc,space, 0);
177                  case 2 : return wd17xx_sector_r(fdc,space, 0);
178                  case 3 : return wd17xx_data_r(fdc,space, 0);
179179               }
180180               break;
181181      case 0x20: switch(offset & 1) {
r17961r17962
183183                  case 1 : return lan->status_r(space,0);
184184               }
185185               break;
186      case 0x28: return pic8259_r(pic,offset & 1);
186      case 0x28: return pic8259_r(pic,space, offset & 1);
187187      case 0x30: return ppi2->read(space,offset & 3);
188188      case 0x38: return ppi1->read(space,offset & 3);
189189   }
r17961r17962
203203
204204   switch(offset & 0x38)
205205   {
206      case 0x00: pit8253_w(pit,offset & 3,data); break;
206      case 0x00: pit8253_w(pit,space, offset & 3,data); break;
207207      case 0x08: ppi3->write(space,offset & 3,data); break;
208208      case 0x10: switch(offset & 1) {
209209                  case 0 : rs232->data_w(space,0,data); break;
r17961r17962
211211               }
212212               break;
213213      case 0x18: switch(offset & 3) {
214                  case 0 : wd17xx_command_w(fdc,0,data);break;
215                  case 1 : wd17xx_track_w(fdc,0,data);break;
216                  case 2 : wd17xx_sector_w(fdc,0,data);break;
217                  case 3 : wd17xx_data_w(fdc,0,data);break;
214                  case 0 : wd17xx_command_w(fdc,space, 0,data);break;
215                  case 1 : wd17xx_track_w(fdc,space, 0,data);break;
216                  case 2 : wd17xx_sector_w(fdc,space, 0,data);break;
217                  case 3 : wd17xx_data_w(fdc,space, 0,data);break;
218218               }
219219               break;
220220      case 0x20: switch(offset & 1) {
r17961r17962
222222                  case 1 : lan->control_w(space,0,data); break;
223223               }
224224               break;
225      case 0x28: pic8259_w(pic,offset & 1,data);break;
225      case 0x28: pic8259_w(pic,space, offset & 1,data);break;
226226      case 0x30: ppi2->write(space,offset & 3,data); break;
227227      case 0x38: ppi1->write(space,offset & 3,data); break;
228228   }
trunk/src/mess/machine/omti8621.c
r17961r17962
10371037
10381038   switch (mem_mask) {
10391039   case 0x00ff:
1040      omti8621_w8(device, offset*2+1, data);
1040      omti8621_w8(device, space, offset*2+1, data, mem_mask);
10411041      break;
10421042   case 0xff00:
1043      omti8621_w8(device, offset*2, data>>8);
1043      omti8621_w8(device, space, offset*2, data>>8, mem_mask>>8);
10441044      break;
10451045   default:
10461046      LOG3(("writing OMTI 8621 Data Word Register to %0x = %04x & %04x", offset, data, mem_mask));
r17961r17962
10541054   UINT16 data;
10551055   switch (mem_mask) {
10561056   case 0x00ff:
1057      data = omti8621_r8(device, offset*2+1);
1057      data = omti8621_r8(device, space, offset*2+1, mem_mask);
10581058      break;
10591059   case 0xff00:
1060      data = omti8621_r8(device, offset*2) << 8;
1060      data = omti8621_r8(device, space, offset*2, mem_mask >> 8) << 8;
10611061      break;
10621062   default:
10631063      data = get_data(state);
trunk/src/mess/includes/wswan.h
r17961r17962
200200extern const device_type WSWAN;
201201
202202
203WRITE8_DEVICE_HANDLER( wswan_sound_port_w );
203DECLARE_WRITE8_DEVICE_HANDLER( wswan_sound_port_w );
204204
205205#endif /* WSWAN_H_ */
trunk/src/mess/includes/z80ne.h
r17961r17962
109109
110110/*----------- defined in machine/z80ne.c -----------*/
111111
112READ8_DEVICE_HANDLER(lx388_mc6847_videoram_r);
113READ8_DEVICE_HANDLER(lx390_fdc_r);
114WRITE8_DEVICE_HANDLER(lx390_fdc_w);
115READ8_DEVICE_HANDLER(lx390_reset_bank);
116WRITE8_DEVICE_HANDLER(lx390_motor_w);
112DECLARE_READ8_DEVICE_HANDLER(lx388_mc6847_videoram_r);
113DECLARE_READ8_DEVICE_HANDLER(lx390_fdc_r);
114DECLARE_WRITE8_DEVICE_HANDLER(lx390_fdc_w);
115DECLARE_READ8_DEVICE_HANDLER(lx390_reset_bank);
116DECLARE_WRITE8_DEVICE_HANDLER(lx390_motor_w);
117117
118118
119119
trunk/src/mess/includes/cbmb.h
r17961r17962
7272extern const mos6526_interface cbmb_cia;
7373
7474
75READ8_DEVICE_HANDLER( cbmb_tpi0_port_a_r );
76WRITE8_DEVICE_HANDLER( cbmb_tpi0_port_a_w );
77READ8_DEVICE_HANDLER( cbmb_tpi0_port_b_r );
78WRITE8_DEVICE_HANDLER( cbmb_tpi0_port_b_w );
75DECLARE_READ8_DEVICE_HANDLER( cbmb_tpi0_port_a_r );
76DECLARE_WRITE8_DEVICE_HANDLER( cbmb_tpi0_port_a_w );
77DECLARE_READ8_DEVICE_HANDLER( cbmb_tpi0_port_b_r );
78DECLARE_WRITE8_DEVICE_HANDLER( cbmb_tpi0_port_b_w );
7979
80WRITE8_DEVICE_HANDLER( cbmb_keyboard_line_select_a );
81WRITE8_DEVICE_HANDLER( cbmb_keyboard_line_select_b );
82WRITE8_DEVICE_HANDLER( cbmb_keyboard_line_select_c );
83READ8_DEVICE_HANDLER( cbmb_keyboard_line_a );
84READ8_DEVICE_HANDLER( cbmb_keyboard_line_b );
85READ8_DEVICE_HANDLER( cbmb_keyboard_line_c );
80DECLARE_WRITE8_DEVICE_HANDLER( cbmb_keyboard_line_select_a );
81DECLARE_WRITE8_DEVICE_HANDLER( cbmb_keyboard_line_select_b );
82DECLARE_WRITE8_DEVICE_HANDLER( cbmb_keyboard_line_select_c );
83DECLARE_READ8_DEVICE_HANDLER( cbmb_keyboard_line_a );
84DECLARE_READ8_DEVICE_HANDLER( cbmb_keyboard_line_b );
85DECLARE_READ8_DEVICE_HANDLER( cbmb_keyboard_line_c );
8686WRITE_LINE_DEVICE_HANDLER( cbmb_irq );
8787
8888int cbmb_dma_read(running_machine &machine, int offset);
trunk/src/mess/includes/pokemini.h
r17961r17962
6969
7070/*----------- defined in machine/pokemini.c -----------*/
7171
72WRITE8_DEVICE_HANDLER( pokemini_hwreg_w );
73READ8_DEVICE_HANDLER( pokemini_hwreg_r );
72DECLARE_WRITE8_DEVICE_HANDLER( pokemini_hwreg_w );
73DECLARE_READ8_DEVICE_HANDLER( pokemini_hwreg_r );
7474
7575DEVICE_IMAGE_LOAD( pokemini_cart );
7676
trunk/src/mess/includes/msx.h
r17961r17962
145145void msx_vdp_interrupt(device_t *, v99x8_device &device, int i);
146146
147147/* I/O functions */
148READ8_DEVICE_HANDLER( msx_printer_status_r );
149WRITE8_DEVICE_HANDLER( msx_printer_strobe_w );
150WRITE8_DEVICE_HANDLER( msx_printer_data_w );
148DECLARE_READ8_DEVICE_HANDLER( msx_printer_status_r );
149DECLARE_WRITE8_DEVICE_HANDLER( msx_printer_strobe_w );
150DECLARE_WRITE8_DEVICE_HANDLER( msx_printer_data_w );
151151
152152
153153#endif /* __MSX_H__ */
trunk/src/mess/includes/apollo.h
r17961r17962
241241
242242/*----------- machine/apollo_pic.c -----------*/
243243
244WRITE8_DEVICE_HANDLER(apollo_pic8259_master_w ) ;
245READ8_DEVICE_HANDLER( apollo_pic8259_master_r );
244DECLARE_WRITE8_DEVICE_HANDLER(apollo_pic8259_master_w ) ;
245DECLARE_READ8_DEVICE_HANDLER( apollo_pic8259_master_r );
246246
247WRITE8_DEVICE_HANDLER(apollo_pic8259_slave_w );
248READ8_DEVICE_HANDLER( apollo_pic8259_slave_r );
247DECLARE_WRITE8_DEVICE_HANDLER(apollo_pic8259_slave_w );
248DECLARE_READ8_DEVICE_HANDLER( apollo_pic8259_slave_r );
249249
250250IRQ_CALLBACK(apollo_pic_acknowledge);
251251
252252/*----------- machine/apollo_ptm.c -----------*/
253253
254WRITE8_DEVICE_HANDLER( apollo_ptm_w );
255READ8_DEVICE_HANDLER( apollo_ptm_r );
254DECLARE_WRITE8_DEVICE_HANDLER( apollo_ptm_w );
255DECLARE_READ8_DEVICE_HANDLER( apollo_ptm_r );
256256
257257/*----------- machine/apollo_rtc.c -----------*/
258258
r17961r17962
261261
262262void apollo_sio_rx_data( device_t* device, int ch, UINT8 data );
263263
264READ8_DEVICE_HANDLER(apollo_sio_r);
265WRITE8_DEVICE_HANDLER(apollo_sio_w);
264DECLARE_READ8_DEVICE_HANDLER(apollo_sio_r);
265DECLARE_WRITE8_DEVICE_HANDLER(apollo_sio_w);
266266
267267/*----------- machine/apollo_sio2.c -----------*/
268268
269READ8_DEVICE_HANDLER(apollo_sio2_r);
270WRITE8_DEVICE_HANDLER(apollo_sio2_w);
269DECLARE_READ8_DEVICE_HANDLER(apollo_sio2_r);
270DECLARE_WRITE8_DEVICE_HANDLER(apollo_sio2_w);
271271
272272/*----------- machine/apollo_fdc.c -----------*/
273273
r17961r17962
360360
361361MACHINE_CONFIG_EXTERN( apollo_mono15i );
362362
363READ16_DEVICE_HANDLER( apollo_mcr_r ) ;
364WRITE16_DEVICE_HANDLER(apollo_mcr_w );
363DECLARE_READ16_DEVICE_HANDLER( apollo_mcr_r ) ;
364DECLARE_WRITE16_DEVICE_HANDLER(apollo_mcr_w );
365365
366READ16_DEVICE_HANDLER( apollo_mgm_r );
367WRITE16_DEVICE_HANDLER( apollo_mgm_w );
366DECLARE_READ16_DEVICE_HANDLER( apollo_mgm_r );
367DECLARE_WRITE16_DEVICE_HANDLER( apollo_mgm_w );
368368
369369#endif /* APOLLO_H_ */
trunk/src/mess/includes/cgenie.h
r17961r17962
7575
7676/*----------- defined in machine/cgenie.c -----------*/
7777
78READ8_DEVICE_HANDLER( cgenie_sh_control_port_r );
79WRITE8_DEVICE_HANDLER( cgenie_sh_control_port_w );
78DECLARE_READ8_DEVICE_HANDLER( cgenie_sh_control_port_r );
79DECLARE_WRITE8_DEVICE_HANDLER( cgenie_sh_control_port_w );
8080
8181extern const wd17xx_interface cgenie_wd17xx_interface;
8282
trunk/src/mess/includes/kaypro.h
r17961r17962
9696extern const z80sio_interface kaypro_sio_intf;
9797extern const wd17xx_interface kaypro_wd1793_interface;
9898
99READ8_DEVICE_HANDLER( kaypro_sio_r );
100WRITE8_DEVICE_HANDLER( kaypro_sio_w );
99DECLARE_READ8_DEVICE_HANDLER( kaypro_sio_r );
100DECLARE_WRITE8_DEVICE_HANDLER( kaypro_sio_w );
101101
102102
103103
trunk/src/mess/includes/c16.h
r17961r17962
5252
5353/*----------- defined in machine/c16.c -----------*/
5454
55extern READ8_DEVICE_HANDLER(c16_m7501_port_read);
56extern WRITE8_DEVICE_HANDLER(c16_m7501_port_write);
55extern DECLARE_READ8_DEVICE_HANDLER(c16_m7501_port_read);
56extern DECLARE_WRITE8_DEVICE_HANDLER(c16_m7501_port_write);
5757
5858extern WRITE8_HANDLER(c16_6551_port_w);
5959extern READ8_HANDLER(c16_6551_port_r);
trunk/src/mess/includes/mc68328.h
r17961r17962
9898{
9999    const char *m68k_cpu_tag;
100100
101    write8_device_func  out_port_a_func;    /* 8-bit output */
102    write8_device_func  out_port_b_func;    /* 8-bit output */
103    write8_device_func  out_port_c_func;    /* 8-bit output */
104    write8_device_func  out_port_d_func;    /* 8-bit output */
105    write8_device_func  out_port_e_func;    /* 8-bit output */
106    write8_device_func  out_port_f_func;    /* 8-bit output */
107    write8_device_func  out_port_g_func;    /* 8-bit output */
108    write8_device_func  out_port_j_func;    /* 8-bit output */
109    write8_device_func  out_port_k_func;    /* 8-bit output */
110    write8_device_func  out_port_m_func;    /* 8-bit output */
101    devcb_write8  out_port_a_func;    /* 8-bit output */
102    devcb_write8  out_port_b_func;    /* 8-bit output */
103    devcb_write8  out_port_c_func;    /* 8-bit output */
104    devcb_write8  out_port_d_func;    /* 8-bit output */
105    devcb_write8  out_port_e_func;    /* 8-bit output */
106    devcb_write8  out_port_f_func;    /* 8-bit output */
107    devcb_write8  out_port_g_func;    /* 8-bit output */
108    devcb_write8  out_port_j_func;    /* 8-bit output */
109    devcb_write8  out_port_k_func;    /* 8-bit output */
110    devcb_write8  out_port_m_func;    /* 8-bit output */
111111
112    read8_device_func   in_port_a_func;     /* 8-bit input */
113    read8_device_func   in_port_b_func;     /* 8-bit input */
114    read8_device_func   in_port_c_func;     /* 8-bit input */
115    read8_device_func   in_port_d_func;     /* 8-bit input */
116    read8_device_func   in_port_e_func;     /* 8-bit input */
117    read8_device_func   in_port_f_func;     /* 8-bit input */
118    read8_device_func   in_port_g_func;     /* 8-bit input */
119    read8_device_func   in_port_j_func;     /* 8-bit input */
120    read8_device_func   in_port_k_func;     /* 8-bit input */
121    read8_device_func   in_port_m_func;     /* 8-bit input */
112    devcb_read8   in_port_a_func;     /* 8-bit input */
113    devcb_read8   in_port_b_func;     /* 8-bit input */
114    devcb_read8   in_port_c_func;     /* 8-bit input */
115    devcb_read8   in_port_d_func;     /* 8-bit input */
116    devcb_read8   in_port_e_func;     /* 8-bit input */
117    devcb_read8   in_port_f_func;     /* 8-bit input */
118    devcb_read8   in_port_g_func;     /* 8-bit input */
119    devcb_read8   in_port_j_func;     /* 8-bit input */
120    devcb_read8   in_port_k_func;     /* 8-bit input */
121    devcb_read8   in_port_m_func;     /* 8-bit input */
122122
123    write8_device_func  out_pwm_func;       /* 1-bit output */
123    devcb_write8  out_pwm_func;       /* 1-bit output */
124124
125    write16_device_func out_spim_func;      /* 16-bit output */
126    read16_device_func  in_spim_func;       /* 16-bit input */
125    devcb_write16 out_spim_func;      /* 16-bit output */
126    devcb_read16  in_spim_func;       /* 16-bit input */
127127    void (*spim_xch_trigger)( device_t *device );    /* SPIM exchange trigger */
128128};
129129#define MC68328_INTERFACE(name) const mc68328_interface (name)=
r17961r17962
144144    READ/WRITE HANDLERS
145145***************************************************************************/
146146
147WRITE16_DEVICE_HANDLER( mc68328_w );
148READ16_DEVICE_HANDLER(  mc68328_r );
147DECLARE_WRITE16_DEVICE_HANDLER( mc68328_w );
148DECLARE_READ16_DEVICE_HANDLER(  mc68328_r );
149149
150150
151151/***************************************************************************
trunk/src/mess/includes/c64_legacy.h
r17961r17962
9797
9898/* private area */
9999
100extern READ8_DEVICE_HANDLER(c64_m6510_port_read);
101extern WRITE8_DEVICE_HANDLER(c64_m6510_port_write);
100extern DECLARE_READ8_DEVICE_HANDLER(c64_m6510_port_read);
101extern DECLARE_WRITE8_DEVICE_HANDLER(c64_m6510_port_write);
102102
103103READ8_HANDLER ( c64_colorram_read );
104104WRITE8_HANDLER ( c64_colorram_write );
r17961r17962
116116
117117WRITE8_HANDLER ( c64_write_io );
118118READ8_HANDLER ( c64_read_io );
119int c64_paddle_read (device_t *device, int which);
119int c64_paddle_read (device_t *device, address_space &space, int which);
120120
121121extern const mos6526_interface c64_ntsc_cia0, c64_pal_cia0;
122122extern const mos6526_interface c64_ntsc_cia1, c64_pal_cia1;
trunk/src/mess/includes/nascom1.h
r17961r17962
6161
6262
6363
64READ8_DEVICE_HANDLER( nascom1_hd6402_si );
65WRITE8_DEVICE_HANDLER( nascom1_hd6402_so );
64DECLARE_READ8_DEVICE_HANDLER( nascom1_hd6402_si );
65DECLARE_WRITE8_DEVICE_HANDLER( nascom1_hd6402_so );
6666
6767
6868
trunk/src/mess/includes/mtx.h
r17961r17962
6868
6969
7070/* Sound */
71READ8_DEVICE_HANDLER( mtx_sound_strobe_r );
71DECLARE_READ8_DEVICE_HANDLER( mtx_sound_strobe_r );
7272
7373/* Cassette */
74WRITE8_DEVICE_HANDLER( mtx_cst_w );
74DECLARE_WRITE8_DEVICE_HANDLER( mtx_cst_w );
7575
7676/* Printer */
77READ8_DEVICE_HANDLER( mtx_strobe_r );
78READ8_DEVICE_HANDLER( mtx_prt_r );
77DECLARE_READ8_DEVICE_HANDLER( mtx_strobe_r );
78DECLARE_READ8_DEVICE_HANDLER( mtx_prt_r );
7979
8080/* Keyboard */
8181
trunk/src/mess/includes/amstrad.h
r17961r17962
174174
175175
176176
177READ8_DEVICE_HANDLER( amstrad_ppi_porta_r );
178READ8_DEVICE_HANDLER( amstrad_ppi_portb_r );
179WRITE8_DEVICE_HANDLER( amstrad_ppi_porta_w );
180WRITE8_DEVICE_HANDLER( amstrad_ppi_portc_w );
177DECLARE_READ8_DEVICE_HANDLER( amstrad_ppi_porta_r );
178DECLARE_READ8_DEVICE_HANDLER( amstrad_ppi_portb_r );
179DECLARE_WRITE8_DEVICE_HANDLER( amstrad_ppi_porta_w );
180DECLARE_WRITE8_DEVICE_HANDLER( amstrad_ppi_portc_w );
181181
182182
183183WRITE_LINE_DEVICE_HANDLER( aleste_interrupt );
trunk/src/mess/includes/svision.h
r17961r17962
9191int *svision_dma_finished(device_t *device);
9292void svision_sound_decrement(device_t *device);
9393void svision_soundport_w(device_t *device, int which, int offset, int data);
94WRITE8_DEVICE_HANDLER( svision_sounddma_w );
95WRITE8_DEVICE_HANDLER( svision_noise_w );
94DECLARE_WRITE8_DEVICE_HANDLER( svision_sounddma_w );
95DECLARE_WRITE8_DEVICE_HANDLER( svision_noise_w );
9696
9797
9898#endif /* SVISION_H_ */
trunk/src/mess/includes/c64.h
r17961r17962
182182};
183183
184184
185int c64_paddle_read (device_t *device, int which);
185int c64_paddle_read (device_t *device, address_space &space, int which);
186186
187187
188188#endif
trunk/src/mess/includes/pc.h
r17961r17962
113113
114114
115115
116READ8_DEVICE_HANDLER( mc1502_wd17xx_drq_r );
117READ8_DEVICE_HANDLER( mc1502_wd17xx_aux_r );
118READ8_DEVICE_HANDLER( mc1502_wd17xx_motor_r );
119WRITE8_DEVICE_HANDLER( mc1502_wd17xx_aux_w );
116DECLARE_READ8_DEVICE_HANDLER( mc1502_wd17xx_drq_r );
117DECLARE_READ8_DEVICE_HANDLER( mc1502_wd17xx_aux_r );
118DECLARE_READ8_DEVICE_HANDLER( mc1502_wd17xx_motor_r );
119DECLARE_WRITE8_DEVICE_HANDLER( mc1502_wd17xx_aux_w );
120120
121121
122122
trunk/src/mess/includes/vic10.h
r17961r17962
5050   virtual void machine_reset();
5151
5252   void check_interrupts();
53   UINT8 paddle_read(int which);
53   UINT8 paddle_read(address_space &space, int which);
5454
5555   DECLARE_READ8_MEMBER( read );
5656   DECLARE_WRITE8_MEMBER( write );
trunk/src/mess/video/911_vdt.h
r17961r17962
6868   MCFG_DEVICE_CONFIG(_intf)
6969
7070
71 READ8_DEVICE_HANDLER(vdt911_cru_r);
72WRITE8_DEVICE_HANDLER(vdt911_cru_w);
71 DECLARE_READ8_DEVICE_HANDLER(vdt911_cru_r);
72DECLARE_WRITE8_DEVICE_HANDLER(vdt911_cru_w);
7373
7474void vdt911_refresh(device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect, int x, int y);
7575
trunk/src/mess/video/isa_mda.c
r17961r17962
452452         mode_control_w(space, offset, data);
453453         break;
454454      case 12: case 13:  case 14:
455         pc_lpt_w(lpt, offset - 12, data);
455         pc_lpt_w(lpt, space, offset - 12, data);
456456         break;
457457   }
458458}
r17961r17962
475475         break;
476476      /* 12, 13, 14  are the LPT ports */
477477      case 12: case 13:  case 14:
478         data = pc_lpt_r(lpt, offset - 12);
478         data = pc_lpt_r(lpt, space, offset - 12);
479479         break;
480480    }
481481   return data;
r17961r17962
686686      mode_control_w(space, offset, data);
687687      break;
688688   case 12: case 13:  case 14:
689      pc_lpt_w(lpt, offset - 12, data);
689      pc_lpt_w(lpt, space, offset - 12, data);
690690      break;
691691   case 15:
692692      m_configuration_switch = data;
r17961r17962
733733      break;
734734   /* 12, 13, 14  are the LPT ports */
735735   case 12: case 13:  case 14:
736      data = pc_lpt_r(lpt, offset - 12);
736      data = pc_lpt_r(lpt, space, offset - 12);
737737      break;
738738   }
739739   return data;
trunk/src/mess/video/x68k.c
r17961r17962
13061306//  popmessage("Keyboard buffer position = %i",state->m_keyboard.headpos);
13071307//  popmessage("IERA = 0x%02x, IERB = 0x%02x",state->m_mfp.iera,state->m_mfp.ierb);
13081308//  popmessage("IPRA = 0x%02x, IPRB = 0x%02x",state->m_mfp.ipra,state->m_mfp.iprb);
1309//  popmessage("uPD72065 status = %02x",upd765_status_r(machine, 0));
1309//  popmessage("uPD72065 status = %02x",upd765_status_r(machine, space, 0));
13101310//  popmessage("Layer enable - 0x%02x",state->m_video.reg[2] & 0xff);
13111311//  popmessage("Graphic layer scroll - %i, %i - %i, %i - %i, %i - %i, %i",
13121312//      state->m_crtc.reg[12],state->m_crtc.reg[13],state->m_crtc.reg[14],state->m_crtc.reg[15],state->m_crtc.reg[16],state->m_crtc.reg[17],state->m_crtc.reg[18],state->m_crtc.reg[19]);
trunk/src/mess/video/vic4567.h
r17961r17962
164164
165165/*----------- defined in video/vic4567.c -----------*/
166166
167WRITE8_DEVICE_HANDLER( vic3_port_w );
168WRITE8_DEVICE_HANDLER( vic3_palette_w );
169READ8_DEVICE_HANDLER( vic3_port_r );
167DECLARE_WRITE8_DEVICE_HANDLER( vic3_port_w );
168DECLARE_WRITE8_DEVICE_HANDLER( vic3_palette_w );
169DECLARE_READ8_DEVICE_HANDLER( vic3_port_r );
170170
171171void vic3_raster_interrupt_gen( device_t *device );
172172UINT32 vic3_video_update( device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect );
trunk/src/mess/video/vtvideo.h
r17961r17962
6262    PROTOTYPES
6363***************************************************************************/
6464/* register access */
65READ8_DEVICE_HANDLER  ( vt_video_lba7_r );
66WRITE8_DEVICE_HANDLER ( vt_video_dc012_w );
67WRITE8_DEVICE_HANDLER ( vt_video_dc011_w );
68WRITE8_DEVICE_HANDLER ( vt_video_brightness_w );
65DECLARE_READ8_DEVICE_HANDLER  ( vt_video_lba7_r );
66DECLARE_WRITE8_DEVICE_HANDLER ( vt_video_dc012_w );
67DECLARE_WRITE8_DEVICE_HANDLER ( vt_video_dc011_w );
68DECLARE_WRITE8_DEVICE_HANDLER ( vt_video_brightness_w );
6969
7070
7171/* screen update */
trunk/src/mess/video/vdc8563.h
r17961r17962
5959void vdc8563_set_rastering(device_t *device, int on);
6060UINT32 vdc8563_video_update(device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect);
6161
62WRITE8_DEVICE_HANDLER( vdc8563_port_w );
63READ8_DEVICE_HANDLER( vdc8563_port_r );
62DECLARE_WRITE8_DEVICE_HANDLER( vdc8563_port_w );
63DECLARE_READ8_DEVICE_HANDLER( vdc8563_port_r );
6464
6565
6666#endif /* __VDC8563_H__ */
trunk/src/mess/video/vic6567.h
r17961r17962
163163
164164/*----------- defined in video/vic6567.c -----------*/
165165
166WRITE8_DEVICE_HANDLER ( vic2_port_w );
167READ8_DEVICE_HANDLER ( vic2_port_r );
166DECLARE_WRITE8_DEVICE_HANDLER ( vic2_port_w );
167DECLARE_READ8_DEVICE_HANDLER ( vic2_port_r );
168168
169169int vic2e_k0_r(device_t *device);
170170int vic2e_k1_r(device_t *device);
trunk/src/mess/video/dl1416.h
r17961r17962
4949WRITE_LINE_DEVICE_HANDLER( dl1416_wr_w ); /* write enable */
5050WRITE_LINE_DEVICE_HANDLER( dl1416_ce_w ); /* chip enable */
5151WRITE_LINE_DEVICE_HANDLER( dl1416_cu_w ); /* cursor enable */
52WRITE8_DEVICE_HANDLER( dl1416_data_w );
52DECLARE_WRITE8_DEVICE_HANDLER( dl1416_data_w );
5353
5454/* device get info callback */
5555class dl1416_device : public device_t
trunk/src/mess/video/733_asr.h
r17961r17962
4444   MCFG_DEVICE_ADD(_tag, ASR733, 0) \
4545   MCFG_DEVICE_CONFIG(_intf)
4646
47READ8_DEVICE_HANDLER(asr733_cru_r);
48WRITE8_DEVICE_HANDLER(asr733_cru_w);
47DECLARE_READ8_DEVICE_HANDLER(asr733_cru_r);
48DECLARE_WRITE8_DEVICE_HANDLER(asr733_cru_w);
4949
5050void asr733_refresh(device_t *device, bitmap_ind16 &bitmap, int x, int y);
5151
trunk/src/mess/video/k1ge.h
r17961r17962
6464PALETTE_INIT( k1ge );
6565PALETTE_INIT( k2ge );
6666
67WRITE8_DEVICE_HANDLER( k1ge_w );
68READ8_DEVICE_HANDLER( k1ge_r );
67DECLARE_WRITE8_DEVICE_HANDLER( k1ge_w );
68DECLARE_READ8_DEVICE_HANDLER( k1ge_r );
6969
7070void k1ge_update( device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect );
7171
trunk/src/mess/formats/m65_snqk.c
r17961r17962
298298        /* first set of AY8910 registers */
299299        for (i = 0; i < 16; i++ )
300300        {
301            ay8910_address_w(ay8910, 0, i);
302            ay8910_data_w(ay8910, 0, snapshot_buff[base++]);
301            ay8910_address_w(ay8910, state->generic_space(), 0, i);
302            ay8910_data_w(ay8910, state->generic_space(), 0, snapshot_buff[base++]);
303303        }
304304
305305        /* second set of AY8910 registers */
306306        for (i = 0; i < 16; i++ )
307307        {
308            ay8910_address_w(ay8910, 0, i);
309            ay8910_data_w(ay8910, 0, snapshot_buff[base++]);
308            ay8910_address_w(ay8910, state->generic_space(), 0, i);
309            ay8910_data_w(ay8910, state->generic_space(), 0, snapshot_buff[base++]);
310310        }
311311
312312        for (i = 0; i < 32*16; i++)
trunk/src/mess/formats/spec_snqk.c
r17961r17962
23572357            /* Only set up sound registers for 128K machine or TS2068! */
23582358            for (i = 0; i < 16; i++)
23592359            {
2360                ay8910_address_w(ay8912, 0, i);
2361                ay8910_data_w(ay8912, 0, snapdata[39 + i]);
2360                ay8910_address_w(ay8912, state->generic_space(), 0, i);
2361                ay8910_data_w(ay8912, state->generic_space(), 0, snapdata[39 + i]);
23622362            }
2363            ay8910_address_w(ay8912, 0, snapdata[38]);
2363            ay8910_address_w(ay8912, state->generic_space(), 0, snapdata[38]);
23642364        }
23652365
23662366        pSource = snapdata + header_size;
trunk/src/mess/drivers/vip.c
r17961r17962
482482WRITE_LINE_MEMBER( vip_state::q_w )
483483{
484484   // sound output
485   discrete_sound_w(m_beeper, NODE_01, state);
485   discrete_sound_w(m_beeper, machine().driver_data()->generic_space(), NODE_01, state);
486486
487487   // Q led
488488   set_led_status(machine(), LED_Q, state);
r17961r17962
671671   set_led_status(machine(), LED_POWER, 1);
672672
673673   // reset sound
674   discrete_sound_w(m_beeper, NODE_01, 0);
674   discrete_sound_w(m_beeper, machine().driver_data()->generic_space(), NODE_01, 0);
675675
676676   // state saving
677677   save_item(NAME(m_8000));
trunk/src/mess/drivers/homelab.c
r17961r17962
642642   GFXDECODE_ENTRY( "chargen", 0x0000, homelab_charlayout, 0, 1 )
643643GFXDECODE_END
644644
645static const mea8000_interface brailab4_speech_intf = { "speech", NULL };
645static const mea8000_interface brailab4_speech_intf = { "speech", DEVCB_NULL };
646646
647647static QUICKLOAD_LOAD(homelab)
648648{
trunk/src/mess/drivers/pc9801.c
r17961r17962
611611      if(offset & 0x14)
612612         printf("Read to undefined port [%02x]\n",offset+0x00);
613613      else
614         return pic8259_r(machine().device((offset & 8) ? "pic8259_slave" : "pic8259_master"), (offset & 2) >> 1);
614         return pic8259_r(machine().device((offset & 8) ? "pic8259_slave" : "pic8259_master"), space, (offset & 2) >> 1);
615615   }
616616   else // odd
617617   {
618      return i8237_r(machine().device("dma8237"), (offset & 0x1e) >> 1);
618      return i8237_r(machine().device("dma8237"), space, (offset & 0x1e) >> 1);
619619   }
620620
621621   return 0xff;
r17961r17962
628628      if(offset & 0x14)
629629         printf("Write to undefined port [%02x] <- %02x\n",offset+0x00,data);
630630      else
631         pic8259_w(machine().device((offset & 8) ? "pic8259_slave" : "pic8259_master"), (offset & 2) >> 1, data);
631         pic8259_w(machine().device((offset & 8) ? "pic8259_slave" : "pic8259_master"), space, (offset & 2) >> 1, data);
632632   }
633633   else // odd
634634   {
635      i8237_w(machine().device("dma8237"), (offset & 0x1e) >> 1, data);
635      i8237_w(machine().device("dma8237"), space, (offset & 0x1e) >> 1, data);
636636   }
637637}
638638
r17961r17962
875875      if(offset & 0x08)
876876         printf("Read to undefined port [%02x]\n",offset+0x70);
877877      else
878         return pit8253_r(machine().device("pit8253"), (offset & 6) >> 1);
878         return pit8253_r(machine().device("pit8253"), space, (offset & 6) >> 1);
879879   }
880880
881881   return 0xff;
r17961r17962
892892   else // odd
893893   {
894894      if(offset < 0x08)
895         pit8253_w(machine().device("pit8253"), (offset & 6) >> 1, data);
895         pit8253_w(machine().device("pit8253"), space, (offset & 6) >> 1, data);
896896      else
897897         printf("Write to undefined port [%02x] <- %02x\n",offset+0x70,data);
898898   }
r17961r17962
10381038   {
10391039      switch(offset & 6)
10401040      {
1041         case 0:   return upd765_status_r(machine().device("upd765_2hd"),0);
1042         case 2: return upd765_data_r(machine().device("upd765_2hd"),0);
1041         case 0:   return upd765_status_r(machine().device("upd765_2hd"),space, 0);
1042         case 2: return upd765_data_r(machine().device("upd765_2hd"),space, 0);
10431043         case 4: return 0x5f; //unknown port meaning
10441044      }
10451045   }
r17961r17962
10651065      switch(offset & 6)
10661066      {
10671067         case 0: printf("Write to undefined port [%02x] <- %02x\n",offset+0x90,data); return;
1068         case 2: upd765_data_w(machine().device("upd765_2hd"),0,data); return;
1068         case 2: upd765_data_w(machine().device("upd765_2hd"),space, 0,data); return;
10691069         case 4:
10701070            printf("%02x ctrl\n",data);
10711071            if(((m_fdc_2hd_ctrl & 0x80) == 0) && (data & 0x80))
r17961r17962
10991099   {
11001100      switch(offset & 6)
11011101      {
1102         case 0:   return upd765_status_r(machine().device("upd765_2dd"),0);
1103         case 2: return upd765_data_r(machine().device("upd765_2dd"),0);
1102         case 0:   return upd765_status_r(machine().device("upd765_2dd"),space, 0);
1103         case 2: return upd765_data_r(machine().device("upd765_2dd"),space, 0);
11041104         case 4: return 0x40; //unknown port meaning, might be 0x70
11051105      }
11061106   }
r17961r17962
11211121      switch(offset & 6)
11221122      {
11231123         case 0: printf("Write to undefined port [%02x] <- %02x\n",offset+0xc8,data); return;
1124         case 2: upd765_data_w(machine().device("upd765_2dd"),0,data); return;
1124         case 2: upd765_data_w(machine().device("upd765_2dd"),space, 0,data); return;
11251125         case 4:
11261126            printf("%02x ctrl\n",data);
11271127            if(((m_fdc_2dd_ctrl & 0x80) == 0) && (data & 0x80))
r17961r17962
11821182READ8_MEMBER(pc9801_state::pc9801_opn_r)
11831183{
11841184   if((offset & 1) == 0)
1185      return ym2203_r(machine().device("opn"),offset >> 1);
1185      return ym2203_r(machine().device("opn"),space, offset >> 1);
11861186   else // odd
11871187   {
11881188      printf("Read to undefined port [%02x]\n",offset+0x188);
r17961r17962
11931193WRITE8_MEMBER(pc9801_state::pc9801_opn_w)
11941194{
11951195   if((offset & 1) == 0)
1196      ym2203_w(machine().device("opn"),offset >> 1,data);
1196      ym2203_w(machine().device("opn"),space, offset >> 1,data);
11971197   else // odd
11981198   {
11991199      printf("Write to undefined port [%02x] %02x\n",offset+0x188,data);
r17961r17962
14111411   {
14121412      switch(offset & 6)
14131413      {
1414         case 0:   return upd765_status_r(machine().device("upd765_2hd"),0);
1415         case 2: return upd765_data_r(machine().device("upd765_2hd"),0);
1414         case 0:   return upd765_status_r(machine().device("upd765_2hd"),space, 0);
1415         case 2: return upd765_data_r(machine().device("upd765_2hd"),space, 0);
14161416         case 4: return 0x40; //2hd flag
14171417      }
14181418   }
r17961r17962
14281428   {
14291429      switch(offset & 6)
14301430      {
1431         case 2: upd765_data_w(machine().device("upd765_2hd"),0,data); return;
1431         case 2: upd765_data_w(machine().device("upd765_2hd"),space, 0,data); return;
14321432         case 4: printf("%02x FDC ctrl\n",data); return;
14331433      }
14341434   }
r17961r17962
14461446   {
14471447      switch(offset & 6)
14481448      {
1449         case 0:   return upd765_status_r(machine().device("upd765_2hd"),0);
1450         case 2: return upd765_data_r(machine().device("upd765_2hd"),0);
1449         case 0:   return upd765_status_r(machine().device("upd765_2hd"),space, 0);
1450         case 2: return upd765_data_r(machine().device("upd765_2hd"),space, 0);
14511451         case 4: return 0x70; //2dd flag
14521452      }
14531453   }
r17961r17962
14671467   {
14681468      switch(offset & 6)
14691469      {
1470         case 2: upd765_data_w(machine().device("upd765_2hd"),0,data); return;
1470         case 2: upd765_data_w(machine().device("upd765_2hd"),space, 0,data); return;
14711471         case 4: printf("%02x FDC ctrl\n",data); return;
14721472      }
14731473   }
r17961r17962
23772377
23782378static READ8_DEVICE_HANDLER( ppi_fdd_portb_r )
23792379{
2380   return 0xff; //upd765_status_r(device->machine().device("upd765_2dd"),0);
2380   return 0xff; //upd765_status_r(device->machine().device("upd765_2dd"),space, 0);
23812381}
23822382
23832383static READ8_DEVICE_HANDLER( ppi_fdd_portc_r )
23842384{
2385   return 0xff; //upd765_data_r(device->machine().device("upd765_2dd"),0);
2385   return 0xff; //upd765_data_r(device->machine().device("upd765_2dd"),space, 0);
23862386}
23872387
23882388static WRITE8_DEVICE_HANDLER( ppi_fdd_portc_w )
23892389{
2390   //upd765_data_w(device->machine().device("upd765_2dd"),0,data);
2390   //upd765_data_w(device->machine().device("upd765_2dd"),space, 0,data);
23912391}
23922392
23932393static I8255A_INTERFACE( ppi_fdd_intf )
trunk/src/mess/drivers/mz2000.c
r17961r17962
293293   mz2000_state *state = device->machine().driver_data<mz2000_state>();
294294
295295   if(state->m_has_fdc)
296      return wd17xx_r(device, offset) ^ 0xff;
296      return wd17xx_r(device, space, offset) ^ 0xff;
297297
298298   return 0xff;
299299}
r17961r17962
303303   mz2000_state *state = device->machine().driver_data<mz2000_state>();
304304
305305   if(state->m_has_fdc)
306      wd17xx_w(device, offset, data ^ 0xff);
306      wd17xx_w(device, space, offset, data ^ 0xff);
307307}
308308
309309WRITE8_MEMBER(mz2000_state::mz2000_fdc_w)
trunk/src/mess/drivers/z100.c
r17961r17962
355355
356356   switch(offset)
357357   {
358      case 0: res = wd17xx_status_r(m_fdc,offset); break;
359      case 1: res = wd17xx_track_r(m_fdc,offset);  break;
360      case 2: res = wd17xx_sector_r(m_fdc,offset); break;
361      case 3: res = wd17xx_data_r(m_fdc,offset); break;
358      case 0: res = wd17xx_status_r(m_fdc,space, offset); break;
359      case 1: res = wd17xx_track_r(m_fdc,space, offset);  break;
360      case 2: res = wd17xx_sector_r(m_fdc,space, offset); break;
361      case 3: res = wd17xx_data_r(m_fdc,space, offset); break;
362362   }
363363
364364   return res;
r17961r17962
368368{
369369   switch(offset)
370370   {
371      case 0: wd17xx_command_w(m_fdc,offset,data); break;
372      case 1: wd17xx_track_w(m_fdc,offset,data); break;
373      case 2: wd17xx_sector_w(m_fdc,offset,data); break;
374      case 3: wd17xx_data_w(m_fdc,offset,data); break;
371      case 0: wd17xx_command_w(m_fdc,space, offset,data); break;
372      case 1: wd17xx_track_w(m_fdc,space, offset,data); break;
373      case 2: wd17xx_sector_w(m_fdc,space, offset,data); break;
374      case 3: wd17xx_data_w(m_fdc,space, offset,data); break;
375375      case 4: // disk control
376376         wd17xx_set_drive(m_fdc,data & 3);
377377         m_z207_cur_drive = data & 3;
trunk/src/mess/drivers/c65.c
r17961r17962
193193{
194194   device_t *sid = machine().device("sid_r");
195195
196   return c64_paddle_read(sid, 0);
196   return c64_paddle_read(sid, space, 0);
197197}
198198
199199READ8_MEMBER( c65_state::sid_poty_r )
200200{
201201   device_t *sid = machine().device("sid_r");
202202
203   return c64_paddle_read(sid, 1);
203   return c64_paddle_read(sid, space, 1);
204204}
205205
206206static MOS6581_INTERFACE( sidr_intf )
trunk/src/mess/drivers/pc88va.c
r17961r17962
970970      /* ---x ---- RDY: (0) Busy (1) Ready */
971971      case 0x06: // FDC control port 2
972972         return 0;
973      case 0x08: return upd765_status_r(machine().device("upd765"), 0);
974      case 0x0a: return upd765_data_r(machine().device("upd765"), 0);
973      case 0x08: return upd765_status_r(machine().device("upd765"), space, 0);
974      case 0x0a: return upd765_data_r(machine().device("upd765"), space, 0);
975975   }
976976
977977   return 0xff;
r17961r17962
10131013         printf("%02x\n",data);
10141014         break; // FDC control port 2
10151015      case 0x08: break; // UPD765 status
1016      case 0x0a: upd765_data_w(machine().device("upd765"), 0,data); break;
1016      case 0x0a: upd765_data_w(machine().device("upd765"), space, 0,data); break;
10171017   }
10181018}
10191019
trunk/src/mess/drivers/pc1512.c
r17961r17962
474474   switch (offset)
475475   {
476476   case 4:
477      data = upd765_status_r(m_fdc, 0);
477      data = upd765_status_r(m_fdc, space, 0);
478478      break;
479479
480480   case 5:
481      data = upd765_data_r(m_fdc, 0);
481      data = upd765_data_r(m_fdc, space, 0);
482482      break;
483483   }
484484
r17961r17962
529529      break;
530530
531531   case 5:
532      upd765_data_w(m_fdc, 0, data);
532      upd765_data_w(m_fdc, space, 0, data);
533533      break;
534534   }
535535}
r17961r17962
551551   bool decoded = false;
552552
553553   if      (                 addr <= 0x00f) { data = m_dmac->read(space, offset & 0x0f); decoded = true; }
554   else if (addr >= 0x020 && addr <= 0x021) { data = pic8259_r(m_pic, offset & 0x01); decoded = true; }
555   else if (addr >= 0x040 && addr <= 0x043) { data = pit8253_r(m_pit, offset & 0x03); decoded = true; }
554   else if (addr >= 0x020 && addr <= 0x021) { data = pic8259_r(m_pic, space, offset & 0x01); decoded = true; }
555   else if (addr >= 0x040 && addr <= 0x043) { data = pit8253_r(m_pit, space, offset & 0x03); decoded = true; }
556556   else if (addr >= 0x060 && addr <= 0x06f) { data = system_r(space, offset & 0x0f); decoded = true; }
557557   else if (addr >= 0x070 && addr <= 0x073) { data = m_rtc->read(space, offset & 0x01); decoded = true; }
558558   else if (addr >= 0x078 && addr <= 0x07f) { data = mouse_r(space, offset & 0x07); decoded = true; }
r17961r17962
910910READ8_MEMBER( pc1512_state::ior2_r )
911911{
912912   if (m_nden)
913      return upd765_dack_r(m_fdc, 0);
913      return upd765_dack_r(m_fdc, space, 0);
914914   else
915915      return m_bus->dack_r(2);
916916}
r17961r17962
934934WRITE8_MEMBER( pc1512_state::iow2_w )
935935{
936936   if (m_nden)
937      upd765_dack_w(m_fdc, 0, data);
937      upd765_dack_w(m_fdc, space, 0, data);
938938   else
939939      m_bus->dack_w(2, data);
940940}
trunk/src/mess/drivers/pes.c
r17961r17962
139139#ifdef DEBUG_PORTS
140140   logerror("port1 write: tms5220 data written: %02X\n", data);
141141#endif
142   tms5220_data_w(state->m_speech, 0, data);
142   tms5220_data_w(state->m_speech, space, 0, data);
143143
144144}
145145
r17961r17962
147147{
148148   UINT8 data = 0xFF;
149149   pes_state *state = machine().driver_data<pes_state>();
150   data = tms5220_status_r(state->m_speech, 0);
150   data = tms5220_status_r(state->m_speech, space, 0);
151151#ifdef DEBUG_PORTS
152152   logerror("port1 read: tms5220 data read: 0x%02X\n", data);
153153#endif
trunk/src/mess/drivers/x1.c
r17961r17962
999999   switch(offset+0xff8)
10001000   {
10011001      case 0x0ff8:
1002         return wd17xx_status_r(m_fdc,offset);
1002         return wd17xx_status_r(m_fdc,space, offset);
10031003      case 0x0ff9:
1004         return wd17xx_track_r(m_fdc,offset);
1004         return wd17xx_track_r(m_fdc,space, offset);
10051005      case 0x0ffa:
1006         return wd17xx_sector_r(m_fdc,offset);
1006         return wd17xx_sector_r(m_fdc,space, offset);
10071007      case 0x0ffb:
1008         return wd17xx_data_r(m_fdc,offset);
1008         return wd17xx_data_r(m_fdc,space, offset);
10091009      case 0x0ffc:
10101010         printf("FDC: read FM type\n");
10111011         return 0xff;
r17961r17962
10281028   switch(offset+0xff8)
10291029   {
10301030      case 0x0ff8:
1031         wd17xx_command_w(m_fdc,offset,data);
1031         wd17xx_command_w(m_fdc,space, offset,data);
10321032         break;
10331033      case 0x0ff9:
1034         wd17xx_track_w(m_fdc,offset,data);
1034         wd17xx_track_w(m_fdc,space, offset,data);
10351035         break;
10361036      case 0x0ffa:
1037         wd17xx_sector_w(m_fdc,offset,data);
1037         wd17xx_sector_w(m_fdc,space, offset,data);
10381038         break;
10391039      case 0x0ffb:
1040         wd17xx_data_w(m_fdc,offset,data);
1040         wd17xx_data_w(m_fdc,space, offset,data);
10411041         break;
10421042      case 0x0ffc:
10431043         wd17xx_set_drive(m_fdc,data & 3);
r17961r17962
16181618   else if(offset >= 0x1400 && offset <= 0x17ff)   { return x1_pcg_r(space, offset-0x1400); }
16191619   else if(offset >= 0x1900 && offset <= 0x19ff)   { return x1_sub_io_r(space, 0); }
16201620   else if(offset >= 0x1a00 && offset <= 0x1aff)   { return machine().device<i8255_device>("ppi8255_0")->read(space, (offset-0x1a00) & 3); }
1621   else if(offset >= 0x1b00 && offset <= 0x1bff)   { return ay8910_r(machine().device("ay"), 0); }
1621   else if(offset >= 0x1b00 && offset <= 0x1bff)   { return ay8910_r(machine().device("ay"), space, 0); }
16221622//  else if(offset >= 0x1f80 && offset <= 0x1f8f)   { return z80dma_r(machine().device("dma"), 0); }
16231623//  else if(offset >= 0x1f90 && offset <= 0x1f91)   { return z80sio_c_r(machine().device("sio"), (offset-0x1f90) & 1); }
16241624//  else if(offset >= 0x1f92 && offset <= 0x1f93)   { return z80sio_d_r(machine().device("sio"), (offset-0x1f92) & 1); }
r17961r17962
16541654   else if(offset == 0x1800 || offset == 0x1801)   { x1_6845_w(space, offset-0x1800, data); }
16551655   else if(offset >= 0x1900 && offset <= 0x19ff)   { x1_sub_io_w(space, 0,data); }
16561656   else if(offset >= 0x1a00 && offset <= 0x1aff)   { machine().device<i8255_device>("ppi8255_0")->write(space, (offset-0x1a00) & 3,data); }
1657   else if(offset >= 0x1b00 && offset <= 0x1bff)   { ay8910_data_w(machine().device("ay"), 0,data); }
1658   else if(offset >= 0x1c00 && offset <= 0x1cff)   { ay8910_address_w(machine().device("ay"), 0,data); }
1657   else if(offset >= 0x1b00 && offset <= 0x1bff)   { ay8910_data_w(machine().device("ay"), space, 0,data); }
1658   else if(offset >= 0x1c00 && offset <= 0x1cff)   { ay8910_address_w(machine().device("ay"), space, 0,data); }
16591659   else if(offset >= 0x1d00 && offset <= 0x1dff)   { x1_rom_bank_1_w(space,0,data); }
16601660   else if(offset >= 0x1e00 && offset <= 0x1eff)   { x1_rom_bank_0_w(space,0,data); }
16611661//  else if(offset >= 0x1f80 && offset <= 0x1f8f)   { z80dma_w(machine().device("dma"), 0,data); }
r17961r17962
16841684   m_io_bank_mode = 0; //any read disables the extended mode.
16851685
16861686   // a * at the end states devices used on plain X1 too
1687   if(offset == 0x0700)                     { return (ym2151_r(machine().device("ym"), offset-0x0700) & 0x7f) | (ioport("SOUND_SW")->read() & 0x80); }
1688   else if(offset == 0x0701)                      { return ym2151_r(machine().device("ym"), offset-0x0700); }
1687   if(offset == 0x0700)                     { return (ym2151_r(machine().device("ym"), space, offset-0x0700) & 0x7f) | (ioport("SOUND_SW")->read() & 0x80); }
1688   else if(offset == 0x0701)                      { return ym2151_r(machine().device("ym"), space, offset-0x0700); }
16891689   //0x704 is FM sound detection port on X1 turboZ
16901690   else if(offset >= 0x0704 && offset <= 0x0707)   { return m_ctc->read(space,offset-0x0704); }
16911691   else if(offset == 0x0801)                  { printf("Color image board read\n"); return 0xff; } // *
r17961r17962
17021702   else if(offset >= 0x1400 && offset <= 0x17ff)   { return x1_pcg_r(space, offset-0x1400); }
17031703   else if(offset >= 0x1900 && offset <= 0x19ff)   { return x1_sub_io_r(space, 0); }
17041704   else if(offset >= 0x1a00 && offset <= 0x1aff)   { return machine().device<i8255_device>("ppi8255_0")->read(space, (offset-0x1a00) & 3); }
1705   else if(offset >= 0x1b00 && offset <= 0x1bff)   { return ay8910_r(machine().device("ay"), 0); }
1706   else if(offset >= 0x1f80 && offset <= 0x1f8f)   { return z80dma_r(machine().device("dma"), 0); }
1707   else if(offset >= 0x1f90 && offset <= 0x1f93)   { return z80dart_ba_cd_r(machine().device("sio"), (offset-0x1f90) & 3); }
1705   else if(offset >= 0x1b00 && offset <= 0x1bff)   { return ay8910_r(machine().device("ay"), space, 0); }
1706   else if(offset >= 0x1f80 && offset <= 0x1f8f)   { return z80dma_r(machine().device("dma"), space, 0); }
1707   else if(offset >= 0x1f90 && offset <= 0x1f93)   { return z80dart_ba_cd_r(machine().device("sio"), space, (offset-0x1f90) & 3); }
17081708   else if(offset >= 0x1f98 && offset <= 0x1f9f)   { printf("Extended SIO/CTC read %04x\n",offset); return 0xff; }
17091709   else if(offset >= 0x1fa0 && offset <= 0x1fa3)   { return m_ctc->read(space,offset-0x1fa0); }
17101710   else if(offset >= 0x1fa8 && offset <= 0x1fab)   { return m_ctc->read(space,offset-0x1fa8); }
r17961r17962
17301730{
17311731   // a * at the end states devices used on plain X1 too
17321732   if(m_io_bank_mode == 1)                    { x1_ex_gfxram_w(space, offset, data); }
1733   else if(offset == 0x0700 || offset == 0x0701)   { ym2151_w(machine().device("ym"), offset-0x0700,data); }
1733   else if(offset == 0x0700 || offset == 0x0701)   { ym2151_w(machine().device("ym"), space, offset-0x0700,data); }
17341734   //0x704 is FM sound detection port on X1 turboZ
17351735   else if(offset >= 0x0704 && offset <= 0x0707)   { m_ctc->write(space,offset-0x0704,data); }
17361736   else if(offset == 0x0800)                  { printf("Color image board write %02x\n",data); } // *
r17961r17962
17521752   else if(offset == 0x1800 || offset == 0x1801)   { x1_6845_w(space, offset-0x1800, data); }
17531753   else if(offset >= 0x1900 && offset <= 0x19ff)   { x1_sub_io_w(space, 0,data); }
17541754   else if(offset >= 0x1a00 && offset <= 0x1aff)   { machine().device<i8255_device>("ppi8255_0")->write(space, (offset-0x1a00) & 3,data); }
1755   else if(offset >= 0x1b00 && offset <= 0x1bff)   { ay8910_data_w(machine().device("ay"), 0,data); }
1756   else if(offset >= 0x1c00 && offset <= 0x1cff)   { ay8910_address_w(machine().device("ay"), 0,data); }
1755   else if(offset >= 0x1b00 && offset <= 0x1bff)   { ay8910_data_w(machine().device("ay"), space, 0,data); }
1756   else if(offset >= 0x1c00 && offset <= 0x1cff)   { ay8910_address_w(machine().device("ay"), space, 0,data); }
17571757   else if(offset >= 0x1d00 && offset <= 0x1dff)   { x1_rom_bank_1_w(space,0,data); }
17581758   else if(offset >= 0x1e00 && offset <= 0x1eff)   { x1_rom_bank_0_w(space,0,data); }
1759   else if(offset >= 0x1f80 && offset <= 0x1f8f)   { z80dma_w(machine().device("dma"), 0,data); }
1760   else if(offset >= 0x1f90 && offset <= 0x1f93)   { z80dart_ba_cd_w(machine().device("sio"), (offset-0x1f90) & 3,data); }
1759   else if(offset >= 0x1f80 && offset <= 0x1f8f)   { z80dma_w(machine().device("dma"), space, 0,data); }
1760   else if(offset >= 0x1f90 && offset <= 0x1f93)   { z80dart_ba_cd_w(machine().device("sio"), space, (offset-0x1f90) & 3,data); }
17611761   else if(offset >= 0x1f98 && offset <= 0x1f9f)   { printf("Extended SIO/CTC write %04x %02x\n",offset,data); }
17621762   else if(offset >= 0x1fa0 && offset <= 0x1fa3)   { m_ctc->write(space,offset-0x1fa0,data); }
17631763   else if(offset >= 0x1fa8 && offset <= 0x1fab)   { m_ctc->write(space,offset-0x1fa8,data); }
r17961r17962
22952295#if 0
22962296static const z80sio_interface sio_intf =
22972297{
2298   0,               /* interrupt handler */
2299   0,               /* DTR changed handler */
2300   0,               /* RTS changed handler */
2301   0,               /* BREAK changed handler */
2302   0,               /* transmit handler */
2303   0               /* receive handler */
2298   DEVCB_NULL,               /* interrupt handler */
2299   DEVCB_NULL,               /* DTR changed handler */
2300   DEVCB_NULL,               /* RTS changed handler */
2301   DEVCB_NULL,               /* BREAK changed handler */
2302   DEVCB_NULL,               /* transmit handler */
2303   DEVCB_NULL               /* receive handler */
23042304};
23052305#endif
23062306
trunk/src/mess/drivers/palm.c
r17961r17962
171171{
172172   "maincpu",
173173
174   NULL,                   // Port A Output
175   NULL,                   // Port B Output
176   NULL,                   // Port C Output
177   NULL,                   // Port D Output
178   NULL,                   // Port E Output
179   palm_port_f_out,        // Port F Output
180   NULL,                   // Port G Output
181   NULL,                   // Port J Output
182   NULL,                   // Port K Output
183   NULL,                   // Port M Output
174   DEVCB_NULL,                   // Port A Output
175   DEVCB_NULL,                   // Port B Output
176   DEVCB_NULL,                   // Port C Output
177   DEVCB_NULL,                   // Port D Output
178   DEVCB_NULL,                   // Port E Output
179   DEVCB_HANDLER(palm_port_f_out),// Port F Output
180   DEVCB_NULL,                   // Port G Output
181   DEVCB_NULL,                   // Port J Output
182   DEVCB_NULL,                   // Port K Output
183   DEVCB_NULL,                   // Port M Output
184184
185   NULL,                   // Port A Input
186   NULL,                   // Port B Input
187   palm_port_c_in,         // Port C Input
188   NULL,                   // Port D Input
189   NULL,                   // Port E Input
190   palm_port_f_in,         // Port F Input
191   NULL,                   // Port G Input
192   NULL,                   // Port J Input
193   NULL,                   // Port K Input
194   NULL,                   // Port M Input
185   DEVCB_NULL,                   // Port A Input
186   DEVCB_NULL,                   // Port B Input
187   DEVCB_HANDLER(palm_port_c_in),// Port C Input
188   DEVCB_NULL,                   // Port D Input
189   DEVCB_NULL,                   // Port E Input
190   DEVCB_HANDLER(palm_port_f_in),// Port F Input
191   DEVCB_NULL,                   // Port G Input
192   DEVCB_NULL,                   // Port J Input
193   DEVCB_NULL,                   // Port K Input
194   DEVCB_NULL,                   // Port M Input
195195
196   palm_dac_transition,
196   DEVCB_HANDLER(palm_dac_transition),
197197
198   palm_spim_out,
199   palm_spim_in,
198   DEVCB_HANDLER(palm_spim_out),
199   DEVCB_HANDLER(palm_spim_in),
200200   palm_spim_exchange
201201};
202202
trunk/src/mess/drivers/smc777.c
r17961r17962
366366   switch(offset)
367367   {
368368      case 0x00:
369         return wd17xx_status_r(dev,offset) ^ 0xff;
369         return wd17xx_status_r(dev,space, offset) ^ 0xff;
370370      case 0x01:
371         return wd17xx_track_r(dev,offset) ^ 0xff;
371         return wd17xx_track_r(dev,space, offset) ^ 0xff;
372372      case 0x02:
373         return wd17xx_sector_r(dev,offset) ^ 0xff;
373         return wd17xx_sector_r(dev,space, offset) ^ 0xff;
374374      case 0x03:
375         return wd17xx_data_r(dev,offset) ^ 0xff;
375         return wd17xx_data_r(dev,space, offset) ^ 0xff;
376376      case 0x04: //irq / drq status
377377         //popmessage("%02x %02x\n",m_fdc_irq_flag,m_fdc_drq_flag);
378378
r17961r17962
391391   switch(offset)
392392   {
393393      case 0x00:
394         wd17xx_command_w(dev,offset,data ^ 0xff);
394         wd17xx_command_w(dev,space, offset,data ^ 0xff);
395395         break;
396396      case 0x01:
397         wd17xx_track_w(dev,offset,data ^ 0xff);
397         wd17xx_track_w(dev,space, offset,data ^ 0xff);
398398         break;
399399      case 0x02:
400         wd17xx_sector_w(dev,offset,data ^ 0xff);
400         wd17xx_sector_w(dev,space, offset,data ^ 0xff);
401401         break;
402402      case 0x03:
403         wd17xx_data_w(dev,offset,data ^ 0xff);
403         wd17xx_data_w(dev,space, offset,data ^ 0xff);
404404         break;
405405      case 0x04:
406406         // ---- xxxx select floppy drive (yes, 15 of them, A to P)
trunk/src/mess/drivers/ace.c
r17961r17962
507507
508508   if (!BIT(data, 6))
509509   {
510      sp0256_ALD_w(device, 0, data & 0x3f);
510      sp0256_ALD_w(device, space, 0, data & 0x3f);
511511   }
512512}
513513
trunk/src/mess/drivers/m20.c
r17961r17962
231231
232232READ16_MEMBER(m20_state::m20_i8259_r)
233233{
234    return pic8259_r(m_i8259, offset)<<1;
234    return pic8259_r(m_i8259, space, offset)<<1;
235235}
236236
237237WRITE16_MEMBER(m20_state::m20_i8259_w)
238238{
239    pic8259_w(m_i8259, offset, (data>>1));
239    pic8259_w(m_i8259, space, offset, (data>>1));
240240}
241241
242242WRITE_LINE_MEMBER( m20_state::pic_irq_line_w )
r17961r17962
380380   m_maincpu->set_irq_acknowledge_callback(m20_irq_callback);
381381
382382   wd17xx_mr_w(m_wd177x, 0);
383   //wd17xx_mr_w(m_wd177x, 1);
383   //wd17xx_mr_w(m_wd177x, space, 1);
384384
385385    memcpy(RAM, ROM, 8);  // we need only the reset vector
386386    m_maincpu->reset();     // reset the CPU to ensure it picks up the new vector
trunk/src/mess/drivers/plus4.c
r17961r17962
157157
158158   if (!scs && m_t6721)
159159   {
160      data = t6721_speech_r(m_t6721, offset & 0x03);
160      data = t6721_speech_r(m_t6721, space, offset & 0x03);
161161   }
162162   else if (!user)
163163   {
r17961r17962
286286
287287   if (!scs && m_t6721)
288288   {
289      t6721_speech_w(m_t6721, offset & 0x03, data);
289      t6721_speech_w(m_t6721, space, offset & 0x03, data);
290290   }
291291   else if (!user && m_spi_user)
292292   {
trunk/src/mess/drivers/ip22.c
r17961r17962
246246   switch( offset )
247247   {
248248   case 0x004/4:
249      ret8 = pc_lpt_control_r(lpt, 0) ^ 0x0d;
249      ret8 = pc_lpt_control_r(lpt, space, 0) ^ 0x0d;
250250      //verboselog(( machine, 0, "Parallel Control Read: %02x\n", ret8 );
251251      return ret8;
252252   case 0x008/4:
253      ret8 = pc_lpt_status_r(lpt, 0) ^ 0x80;
253      ret8 = pc_lpt_status_r(lpt, space, 0) ^ 0x80;
254254      //verboselog(( machine, 0, "Parallel Status Read: %02x\n", ret8 );
255255      return ret8;
256256   case 0x030/4:
r17961r17962
290290//      mame_printf_info("INT3: r @ %x mask %08x (PC=%x)\n", offset*4, mem_mask, activecpu_get_pc());
291291      return m_int3_regs[offset-0x80/4];
292292   case 0xb0/4:
293      ret8 = pit8253_r(machine().device("pit8254"), 0);
293      ret8 = pit8253_r(machine().device("pit8254"), space, 0);
294294      //verboselog(( machine, 0, "HPC PBUS6 IOC4 Timer Counter 0 Register Read: 0x%02x (%08x)\n", ret8, mem_mask );
295295      return ret8;
296296   case 0xb4/4:
297      ret8 = pit8253_r(machine().device("pit8254"), 1);
297      ret8 = pit8253_r(machine().device("pit8254"), space, 1);
298298      //verboselog(( machine, 0, "HPC PBUS6 IOC4 Timer Counter 1 Register Read: 0x%02x (%08x)\n", ret8, mem_mask );
299299      return ret8;
300300   case 0xb8/4:
301      ret8 = pit8253_r(machine().device("pit8254"), 2);
301      ret8 = pit8253_r(machine().device("pit8254"), space, 2);
302302      //verboselog(( machine, 0, "HPC PBUS6 IOC4 Timer Counter 2 Register Read: 0x%02x (%08x)\n", ret8, mem_mask );
303303      return ret8;
304304   case 0xbc/4:
305      ret8 = pit8253_r(machine().device("pit8254"), 3);
305      ret8 = pit8253_r(machine().device("pit8254"), space, 3);
306306      //verboselog(( machine, 0, "HPC PBUS6 IOC4 Timer Control Word Register Read: 0x%02x (%08x)\n", ret8, mem_mask );
307307      return ret8;
308308   default:
r17961r17962
321321   {
322322   case 0x004/4:
323323      //verboselog(( machine, 0, "Parallel Control Write: %08x\n", data );
324      pc_lpt_control_w(lpt, 0, data ^ 0x0d);
324      pc_lpt_control_w(lpt, space, 0, data ^ 0x0d);
325325      //m_nIOC_ParCntl = data;
326326      break;
327327   case 0x030/4:
r17961r17962
395395      break;
396396   case 0xb0/4:
397397      //verboselog(( machine, 0, "HPC PBUS6 IOC4 Timer Counter 0 Register Write: 0x%08x (%08x)\n", data, mem_mask );
398      pit8253_w(machine().device("pit8254"), 0, data & 0x000000ff);
398      pit8253_w(machine().device("pit8254"), space, 0, data & 0x000000ff);
399399      return;
400400   case 0xb4/4:
401401      //verboselog(( machine, 0, "HPC PBUS6 IOC4 Timer Counter 1 Register Write: 0x%08x (%08x)\n", data, mem_mask );
402      pit8253_w(machine().device("pit8254"), 1, data & 0x000000ff);
402      pit8253_w(machine().device("pit8254"), space, 1, data & 0x000000ff);
403403      return;
404404   case 0xb8/4:
405405      //verboselog(( machine, 0, "HPC PBUS6 IOC4 Timer Counter 2 Register Write: 0x%08x (%08x)\n", data, mem_mask );
406      pit8253_w(machine().device("pit8254"), 2, data & 0x000000ff);
406      pit8253_w(machine().device("pit8254"), space, 2, data & 0x000000ff);
407407      return;
408408   case 0xbc/4:
409409      //verboselog(( machine, 0, "HPC PBUS6 IOC4 Timer Control Word Register Write: 0x%08x (%08x)\n", data, mem_mask );
410      pit8253_w(machine().device("pit8254"), 3, data & 0x000000ff);
410      pit8253_w(machine().device("pit8254"), space, 3, data & 0x000000ff);
411411      return;
412412   default:
413413      //verboselog(( machine, 0, "Unknown HPC PBUS6 Write: 0x%08x: 0x%08x (%08x)\n", 0x1fbd9800 + ( offset << 2 ), data, mem_mask );
trunk/src/mess/drivers/c128.c
r17961r17962
968968
969969READ8_MEMBER( c128_state::sid_potx_r )
970970{
971   UINT8 cia1_pa = mos6526_pa_r(m_cia1, 0);
971   UINT8 cia1_pa = mos6526_pa_r(m_cia1, space, 0);
972972
973973   int sela = BIT(cia1_pa, 6);
974974   int selb = BIT(cia1_pa, 7);
r17961r17962
983983
984984READ8_MEMBER( c128_state::sid_poty_r )
985985{
986   UINT8 cia1_pa = mos6526_pa_r(m_cia1, 0);
986   UINT8 cia1_pa = mos6526_pa_r(m_cia1, space, 0);
987987
988988   int sela = BIT(cia1_pa, 6);
989989   int selb = BIT(cia1_pa, 7);
trunk/src/mess/drivers/mikromik.c
r17961r17962
9696         break;
9797
9898      case 2:
99         data = i8275_r(m_crtc, offset & 0x01);
99         data = i8275_r(m_crtc, space, offset & 0x01);
100100         break;
101101
102102      case 3:
103         data = pit8253_r(m_pit, offset & 0x03);
103         data = pit8253_r(m_pit, space, offset & 0x03);
104104         break;
105105
106106      case 4:
r17961r17962
110110      case 5:
111111         if (BIT(offset, 0))
112112         {
113            data = upd765_data_r(m_fdc, 0);
113            data = upd765_data_r(m_fdc, space, 0);
114114         }
115115         else
116116         {
117            data = upd765_status_r(m_fdc, 0);
117            data = upd765_status_r(m_fdc, space, 0);
118118         }
119119         break;
120120
r17961r17962
165165         break;
166166
167167      case 2:
168         i8275_w(m_crtc, offset & 0x01, data);
168         i8275_w(m_crtc, space, offset & 0x01, data);
169169         break;
170170
171171      case 3:
172         pit8253_w(m_pit, offset & 0x03, data);
172         pit8253_w(m_pit, space, offset & 0x03, data);
173173         break;
174174
175175      case 4:
r17961r17962
179179      case 5:
180180         if (BIT(offset, 0))
181181         {
182            upd765_data_w(m_fdc, 0, data);
182            upd765_data_w(m_fdc, space, 0, data);
183183         }
184184         break;
185185
trunk/src/mess/drivers/pcw.c
r17961r17962
641641   /* from Jacob Nevins docs. FDC I/O is not fully decoded */
642642   if (offset & 1)
643643   {
644      return upd765_data_r(fdc, 0);
644      return upd765_data_r(fdc, space, 0);
645645   }
646646
647   return upd765_status_r(fdc, 0);
647   return upd765_status_r(fdc, space, 0);
648648}
649649
650650WRITE8_MEMBER(pcw_state::pcw_fdc_w)
r17961r17962
653653   /* from Jacob Nevins docs. FDC I/O is not fully decoded */
654654   if (offset & 1)
655655   {
656      upd765_data_w(fdc, 0,data);
656      upd765_data_w(fdc, space, 0,data);
657657   }
658658}
659659
trunk/src/mess/drivers/osi.c
r17961r17962
270270   m_keylatch = data;
271271
272272   if (ioport("Sound")->read())
273      discrete_sound_w(m_discrete, NODE_01, (data >> 2) & 0x0f);
273      discrete_sound_w(m_discrete, space, NODE_01, (data >> 2) & 0x0f);
274274}
275275
276276WRITE8_MEMBER( uk101_state::keyboard_w )
r17961r17962
298298   m_32 = BIT(data, 0);
299299   m_coloren = BIT(data, 1);
300300
301   discrete_sound_w(m_discrete, NODE_10, BIT(data, 4));
301   discrete_sound_w(m_discrete, space, NODE_10, BIT(data, 4));
302302}
303303
304304WRITE8_MEMBER( c1p_state::osi630_ctrl_w )
trunk/src/mess/drivers/rt1715.c
r17961r17962
274274
275275static const z80sio_interface rt1715_sio_intf =
276276{
277   NULL,
278   NULL,
279   NULL,
280   NULL,
281   NULL,
282   NULL
277   DEVCB_NULL,
278   DEVCB_NULL,
279   DEVCB_NULL,
280   DEVCB_NULL,
281   DEVCB_NULL,
282   DEVCB_NULL
283283};
284284
285285static const z80pio_interface rt1715_pio_data_intf =
trunk/src/mess/drivers/at.c
r17961r17962
165165READ32_MEMBER( at_state::ct486_chipset_r )
166166{
167167   if (ACCESSING_BITS_0_7)
168      return pic8259_r(m_pic8259_master, 0);
168      return pic8259_r(m_pic8259_master, space, 0);
169169
170170   if (ACCESSING_BITS_8_15)
171      return pic8259_r(m_pic8259_master, 1) << 8;
171      return pic8259_r(m_pic8259_master, space, 1) << 8;
172172
173173   if (ACCESSING_BITS_24_31)
174174      return m_cs4031->data_r(space, 0, 0) << 24;
r17961r17962
179179WRITE32_MEMBER( at_state::ct486_chipset_w )
180180{
181181   if (ACCESSING_BITS_0_7)
182      pic8259_w(m_pic8259_master, 0, data);
182      pic8259_w(m_pic8259_master, space, 0, data);
183183
184184   if (ACCESSING_BITS_8_15)
185      pic8259_w(m_pic8259_master, 1, data >> 8);
185      pic8259_w(m_pic8259_master, space, 1, data >> 8);
186186
187187   if (ACCESSING_BITS_16_23)
188188      m_cs4031->address_w(space, 0, data >> 16, 0);
trunk/src/mess/drivers/ql.c
r17961r17962
268268
269269   switch (offset)
270270   {
271      case 0x0000   : result=wd17xx_r(m_fdc, offset); break;
272      case 0x0001   : result=wd17xx_r(m_fdc, offset); break;
273      case 0x0002   : result=wd17xx_r(m_fdc, offset); break;
274      case 0x0003   : result=wd17xx_r(m_fdc, offset); break;
271      case 0x0000   : result=wd17xx_r(m_fdc, space, offset); break;
272      case 0x0001   : result=wd17xx_r(m_fdc, space, offset); break;
273      case 0x0002   : result=wd17xx_r(m_fdc, space, offset); break;
274      case 0x0003   : result=wd17xx_r(m_fdc, space, offset); break;
275275      default      : logerror("%s DiskIO undefined read : from %08X\n",machine().describe_context(),m_disk_io_base+offset); break;
276276   }
277277
r17961r17962
285285
286286   switch (offset)
287287   {
288      case 0x0000   : wd17xx_w(m_fdc, offset, data); break;
289      case 0x0001   : wd17xx_w(m_fdc, offset, data); break;
290      case 0x0002   : wd17xx_w(m_fdc, offset, data); break;
291      case 0x0003   : wd17xx_w(m_fdc, offset, data); break;
288      case 0x0000   : wd17xx_w(m_fdc, space, offset, data); break;
289      case 0x0001   : wd17xx_w(m_fdc, space, offset, data); break;
290      case 0x0002   : wd17xx_w(m_fdc, space, offset, data); break;
291      case 0x0003   : wd17xx_w(m_fdc, space, offset, data); break;
292292      case 0x0004 : if(m_disk_type==DISK_TYPE_SANDY)
293293                  sandy_set_control(data);break;
294294      case 0x0008 : if(m_disk_type==DISK_TYPE_SANDY)
trunk/src/mess/drivers/amiga.c
r17961r17962
4848   DECLARE_MACHINE_RESET(cdtv);
4949};
5050
51static READ8_DEVICE_HANDLER( amiga_cia_0_portA_r );
52static READ8_DEVICE_HANDLER( amiga_cia_0_cdtv_portA_r );
53static WRITE8_DEVICE_HANDLER( amiga_cia_0_portA_w );
51static DECLARE_READ8_DEVICE_HANDLER( amiga_cia_0_portA_r );
52static DECLARE_READ8_DEVICE_HANDLER( amiga_cia_0_cdtv_portA_r );
53static DECLARE_WRITE8_DEVICE_HANDLER( amiga_cia_0_portA_w );
5454
5555/***************************************************************************
5656  Battery Backed-Up Clock (MSM6264)
trunk/src/mess/drivers/sorcerer.c
r17961r17962
390390   AY_3_1015,
391391   4800.0,
392392   4800.0,
393   NULL,
394   NULL,
395   NULL
393   DEVCB_NULL,
394   DEVCB_NULL,
395   DEVCB_NULL
396396};
397397
398398
trunk/src/mess/drivers/abc80x.c
r17961r17962
161161{
162162   m_pling = !m_pling;
163163
164   discrete_sound_w(m_discrete, NODE_01, m_pling);
164   discrete_sound_w(m_discrete, space, NODE_01, m_pling);
165165
166166   return 0xff;
167167}
r17961r17962
175175{
176176   m_pling = !m_pling;
177177
178   discrete_sound_w(m_discrete, NODE_01, m_pling);
178   discrete_sound_w(m_discrete, space, NODE_01, m_pling);
179179
180180   return 0xff;
181181}
trunk/src/mess/drivers/bigbord2.c
r17961r17962
385385
386386/* Z80 SIO */
387387
388static void bigbord2_interrupt(device_t *device, int state)
388static WRITE_LINE_DEVICE_HANDLER( bigbord2_interrupt )
389389{
390390   device->machine().device(Z80_TAG)->execute().set_input_line(0, state);
391391}
392392
393393const z80sio_interface sio_intf =
394394{
395   bigbord2_interrupt,   /* interrupt handler */
396   0,         /* DTR changed handler */
397   0,         /* RTS changed handler */
398   0,         /* BREAK changed handler */
399   0,         /* transmit handler - which channel is this for? */
400   0         /* receive handler - which channel is this for? */
395   DEVCB_LINE(bigbord2_interrupt),   /* interrupt handler */
396   DEVCB_NULL,         /* DTR changed handler */
397   DEVCB_NULL,         /* RTS changed handler */
398   DEVCB_NULL,         /* BREAK changed handler */
399   DEVCB_NULL,         /* transmit handler - which channel is this for? */
400   DEVCB_NULL         /* receive handler - which channel is this for? */
401401};
402402
403403
trunk/src/mess/drivers/fmtowns.c
r17961r17962
393393READ8_MEMBER(towns_state::towns_dma1_r)
394394{
395395//  logerror("DMA#1: read register %i\n",offset);
396   return upd71071_r(m_dma_1,offset);
396   return upd71071_r(m_dma_1,space, offset);
397397}
398398
399399WRITE8_MEMBER(towns_state::towns_dma1_w)
400400{
401401//  logerror("DMA#1: wrote 0x%02x to register %i\n",data,offset);
402   upd71071_w(m_dma_1,offset,data);
402   upd71071_w(m_dma_1,space, offset,data);
403403}
404404
405405READ8_MEMBER(towns_state::towns_dma2_r)
406406{
407407   logerror("DMA#2: read register %i\n",offset);
408   return upd71071_r(m_dma_2,offset);
408   return upd71071_r(m_dma_2,space, offset);
409409}
410410
411411WRITE8_MEMBER(towns_state::towns_dma2_w)
412412{
413413   logerror("DMA#2: wrote 0x%02x to register %i\n",data,offset);
414   upd71071_w(m_dma_2,offset,data);
414   upd71071_w(m_dma_2,space, offset,data);
415415}
416416
417417/*
r17961r17962
440440   switch(offset)
441441   {
442442      case 0x00:
443         return wd17xx_status_r(fdc,offset/2);
443         return wd17xx_status_r(fdc,space, offset/2);
444444      case 0x02:
445         return wd17xx_track_r(fdc,offset/2);
445         return wd17xx_track_r(fdc,space, offset/2);
446446      case 0x04:
447         return wd17xx_sector_r(fdc,offset/2);
447         return wd17xx_sector_r(fdc,space, offset/2);
448448      case 0x06:
449         return wd17xx_data_r(fdc,offset/2);
449         return wd17xx_data_r(fdc,space, offset/2);
450450      case 0x08:  // selected drive status?
451451         //logerror("FDC: read from offset 0x08\n");
452452         ret = 0x80;  // always set
r17961r17962
492492            return;
493493         if(data == 0xfe)
494494            return;
495         wd17xx_command_w(fdc,offset/2,data);
495         wd17xx_command_w(fdc,space, offset/2,data);
496496         break;
497497      case 0x02:
498         wd17xx_track_w(fdc,offset/2,data);
498         wd17xx_track_w(fdc,space, offset/2,data);
499499         break;
500500      case 0x04:
501         wd17xx_sector_w(fdc,offset/2,data);
501         wd17xx_sector_w(fdc,space, offset/2,data);
502502         break;
503503      case 0x06:
504         wd17xx_data_w(fdc,offset/2,data);
504         wd17xx_data_w(fdc,space, offset/2,data);
505505         break;
506506      case 0x08:
507507         // bit 5 - CLKSEL
r17961r17962
550550{
551551   towns_state* state = machine.driver_data<towns_state>();
552552   device_t* fdc = state->m_fdc;
553   return wd17xx_data_r(fdc,0);
553   return wd17xx_data_r(fdc,state->generic_space(), 0);
554554}
555555
556556static void towns_fdc_dma_w(running_machine &machine, UINT16 data)
557557{
558558   towns_state* state = machine.driver_data<towns_state>();
559559   device_t* fdc = state->m_fdc;
560   wd17xx_data_w(fdc,0,data);
560   wd17xx_data_w(fdc,state->generic_space(), 0,data);
561561}
562562
563563/*
trunk/src/mess/drivers/mz2500.c
r17961r17962
12531253static READ8_DEVICE_HANDLER( mz2500_wd17xx_r )
12541254{
12551255   mz2500_state *state = device->machine().driver_data<mz2500_state>();
1256   return wd17xx_r(device, offset) ^ state->m_fdc_reverse;
1256   return wd17xx_r(device, space, offset) ^ state->m_fdc_reverse;
12571257}
12581258
12591259static WRITE8_DEVICE_HANDLER( mz2500_wd17xx_w )
12601260{
12611261   mz2500_state *state = device->machine().driver_data<mz2500_state>();
1262   wd17xx_w(device, offset, data ^ state->m_fdc_reverse);
1262   wd17xx_w(device, space, offset, data ^ state->m_fdc_reverse);
12631263}
12641264
12651265READ8_MEMBER(mz2500_state::mz2500_bplane_latch_r)
r17961r17962
20842084
20852085static const z80sio_interface mz2500_sio_intf =
20862086{
2087   NULL,
2088   NULL,
2089   NULL,
2090   NULL,
2091   NULL,
2092   NULL
2087   DEVCB_NULL,
2088   DEVCB_NULL,
2089   DEVCB_NULL,
2090   DEVCB_NULL,
2091   DEVCB_NULL,
2092   DEVCB_NULL
20932093};
20942094
20952095static MACHINE_CONFIG_START( mz2500, mz2500_state )
trunk/src/mess/drivers/nascom1.c
r17961r17962
257257   AY_3_1015,
258258   ( XTAL_16MHz / 16 ) / 256,
259259   ( XTAL_16MHz / 16 ) / 256,
260   nascom1_hd6402_si,
261   nascom1_hd6402_so,
262   NULL
260   DEVCB_HANDLER(nascom1_hd6402_si),
261   DEVCB_HANDLER(nascom1_hd6402_so),
262   DEVCB_NULL
263263};
264264
265265
trunk/src/mess/drivers/wangpc.c
r17961r17962
715715   if (m_disable_dreq2)
716716      return m_bus->dack_r(space, 2);
717717   else
718      return upd765_dack_r(m_fdc, 0);
718      return upd765_dack_r(m_fdc, space, 0);
719719}
720720
721721WRITE8_MEMBER( wangpc_state::iow2_w )
r17961r17962
723723   if (m_disable_dreq2)
724724      m_bus->dack_w(space, 2, data);
725725   else
726      upd765_dack_w(m_fdc, 0, data);
726      upd765_dack_w(m_fdc, space, 0, data);
727727}
728728
729729WRITE_LINE_MEMBER( wangpc_state::dack0_w )
trunk/src/mess/drivers/multi8.c
r17961r17962
326326   }
327327}
328328
329READ8_MEMBER(multi8_state::ay8912_0_r){ return ay8910_r(machine().device("aysnd"),0); }
330READ8_MEMBER(multi8_state::ay8912_1_r){ return ay8910_r(machine().device("aysnd"),1); }
329READ8_MEMBER(multi8_state::ay8912_0_r){ return ay8910_r(machine().device("aysnd"),space, 0); }
330READ8_MEMBER(multi8_state::ay8912_1_r){ return ay8910_r(machine().device("aysnd"),space, 1); }
331331
332332READ8_MEMBER( multi8_state::multi8_kanji_r )
333333{
trunk/src/mess/drivers/ssystem3.c
r17961r17962
202202static WRITE8_DEVICE_HANDLER(ssystem3_via_write_b)
203203{
204204   via6522_device *via_0 = device->machine().device<via6522_device>("via6522_0");
205   address_space* space = device->machine().device("maincpu")->memory().space(AS_PROGRAM);
206205   UINT8 d;
207206
208207   ssystem3_playfield_write(device->machine(), data&1, data&8);
209208   ssystem3_lcd_write(device->machine(), data&4, data&2);
210209
211   d=ssystem3_via_read_b(via_0, 0)&~0x40;
210   d=ssystem3_via_read_b(via_0, space, 0, mem_mask)&~0x40;
212211   if (data&0x80) d|=0x40;
213212   //  d&=~0x8f;
214   via_0->write_portb(*space,0, d );
213   via_0->write_portb(space,0, d );
215214}
216215
217216static const via6522_interface ssystem3_via_config=
trunk/src/mess/drivers/ng_aes.c
r17961r17962
330330   case 0x00: select_controller(machine(), data & 0x00ff); break;
331331//  case 0x18: set_output_latch(machine(), data & 0x00ff); break;
332332//  case 0x20: set_output_data(machine(), data & 0x00ff); break;
333   case 0x28: upd4990a_control_16_w(m_upd4990a, 0, data, mem_mask); break;
333   case 0x28: upd4990a_control_16_w(m_upd4990a, space, 0, data, mem_mask); break;
334334//  case 0x30: break; // coin counters
335335//  case 0x31: break; // coin counters
336336//  case 0x32: break; // coin lockout
r17961r17962
379379static CUSTOM_INPUT( get_calendar_status )
380380{
381381   neogeo_state *state = field.machine().driver_data<neogeo_state>();
382   return (upd4990a_databit_r(state->m_upd4990a, 0) << 1) | upd4990a_testbit_r(state->m_upd4990a, 0);
382   return (upd4990a_databit_r(state->m_upd4990a, state->generic_space(), 0) << 1) | upd4990a_testbit_r(state->m_upd4990a, state->generic_space(), 0);
383383}
384384
385385
trunk/src/mess/drivers/bml3.c
r17961r17962
330330   bml3_state *state = device->machine().driver_data<bml3_state>();
331331   UINT8 dev_offs = ((state->m_psg_latch & 3) != 3);
332332
333   return ym2203_r(device,dev_offs);
333   return ym2203_r(device,space, dev_offs);
334334}
335335
336336static WRITE8_DEVICE_HANDLER( bml3_ym2203_w )
r17961r17962
338338   bml3_state *state = device->machine().driver_data<bml3_state>();
339339   UINT8 dev_offs = ((state->m_psg_latch & 3) != 3);
340340
341   ym2203_w(device,dev_offs,data);
341   ym2203_w(device,space, dev_offs,data);
342342}
343343
344344READ8_MEMBER( bml3_state::bml3_vram_attr_r)
trunk/src/mess/drivers/trs80.c
r17961r17962
557557   AY_3_1015,
558558   0.0,
559559   0.0,
560   NULL,
561   NULL,
562   NULL
560   DEVCB_NULL,
561   DEVCB_NULL,
562   DEVCB_NULL
563563};
564564
565565static const floppy_interface trs80_floppy_interface =
trunk/src/mess/drivers/abc1600.c
r17961r17962
182182   else if (offset < 0x180000)
183183   {
184184      // video RAM
185      address_space *program = m_maincpu->space(AS_PROGRAM);
186      data = video_ram_r(*program, offset);
185      address_space &program = *m_maincpu->space(AS_PROGRAM);
186      data = video_ram_r(program, offset);
187187   }
188188   else
189189   {
r17961r17962
209209   else if (offset < 0x180000)
210210   {
211211      // video RAM
212      address_space *program = m_maincpu->space(AS_PROGRAM);
213      video_ram_w(*program, offset, data);
212      address_space &program = *m_maincpu->space(AS_PROGRAM);
213      video_ram_w(program, offset, data);
214214   }
215215   else
216216   {
r17961r17962
242242
243243UINT8 abc1600_state::read_internal_io(offs_t offset)
244244{
245   address_space *program = m_maincpu->space(AS_PROGRAM);
245   address_space &program = *m_maincpu->space(AS_PROGRAM);
246246   UINT8 data = 0;
247247
248248   if (X11)
r17961r17962
250250      switch (A10_A9_A8)
251251      {
252252      case IORD0:
253         data = iord0_r(*program, offset);
253         data = iord0_r(program, offset);
254254         break;
255255
256256      default:
r17961r17962
262262      switch (A10_A9_A8)
263263      {
264264      case FLP:
265         data = wd17xx_r(m_fdc, A2_A1);
265         data = wd17xx_r(m_fdc, program, A2_A1);
266266         break;
267267
268268      case CRT:
269269         if (A0)
270            data = m_crtc->register_r(*program, offset);
270            data = m_crtc->register_r(program, offset);
271271         else
272            data = m_crtc->status_r(*program, offset);
272            data = m_crtc->status_r(program, offset);
273273         break;
274274
275275      case DRT:
276         data = z80dart_ba_cd_r(m_dart, A2_A1 ^ 0x03);
276         data = z80dart_ba_cd_r(m_dart, program, A2_A1 ^ 0x03);
277277         break;
278278
279279      case DMA0:
r17961r17962
289289         break;
290290
291291      case SCC:
292         data = m_scc->reg_r(*program, A1_A2);
292         data = m_scc->reg_r(program, A1_A2);
293293         break;
294294
295295      case CIO:
296         data = m_cio->read(*program, A2_A1);
296         data = m_cio->read(program, A2_A1);
297297         break;
298298      }
299299   }
r17961r17962
467467
468468void abc1600_state::write_internal_io(offs_t offset, UINT8 data)
469469{
470   address_space *program = m_maincpu->space(AS_PROGRAM);
470   address_space &program = *m_maincpu->space(AS_PROGRAM);
471471
472472   if (X11)
473473   {
474474      switch (A10_A9_A8)
475475      {
476476      case IOWR0:
477         iowr0_w(*program, offset, data);
477         iowr0_w(program, offset, data);
478478         break;
479479
480480      case IOWR1:
481         iowr1_w(*program, offset, data);
481         iowr1_w(program, offset, data);
482482         break;
483483
484484      case IOWR2:
485         iowr2_w(*program, offset, data);
485         iowr2_w(program, offset, data);
486486         break;
487487
488488      case FW:
489489         if (!A7)
490490         {
491491            if (A0)
492               fw1_w(*program, offset, data);
492               fw1_w(program, offset, data);
493493            else
494               fw0_w(*program, offset, data);
494               fw0_w(program, offset, data);
495495         }
496496         else
497497         {
r17961r17962
500500         break;
501501
502502      case DMAMAP:
503         dmamap_w(*program, offset, data);
503         dmamap_w(program, offset, data);
504504         break;
505505
506506      case SPEC_CONTR_REG:
507         spec_contr_reg_w(*program, offset, data);
507         spec_contr_reg_w(program, offset, data);
508508         break;
509509
510510      default:
r17961r17962
516516      switch (A10_A9_A8)
517517      {
518518      case FLP:
519         wd17xx_w(m_fdc, A2_A1, data);
519         wd17xx_w(m_fdc, program, A2_A1, data);
520520         break;
521521
522522      case CRT:
523523         if (A0)
524            m_crtc->register_w(*program, offset, data);
524            m_crtc->register_w(program, offset, data);
525525         else
526            m_crtc->address_w(*program, offset, data);
526            m_crtc->address_w(program, offset, data);
527527         break;
528528
529529      case DRT:
530         z80dart_ba_cd_w(m_dart, A2_A1 ^ 0x03, data);
530         z80dart_ba_cd_w(m_dart, program, A2_A1 ^ 0x03, data);
531531         break;
532532
533533      case DMA0:
r17961r17962
543543         break;
544544
545545      case SCC:
546         m_scc->reg_w(*program, A1_A2, data);
546         m_scc->reg_w(program, A1_A2, data);
547547         break;
548548
549549      case CIO:
550         m_cio->write(*program, A2_A1, data);
550         m_cio->write(program, A2_A1, data);
551551         break;
552552      }
553553   }
r17961r17962
770770
771771UINT8 abc1600_state::read_supervisor_memory(offs_t offset)
772772{
773   address_space *program = m_maincpu->space(AS_PROGRAM);
773   address_space &program = *m_maincpu->space(AS_PROGRAM);
774774   UINT8 data = 0;
775775
776776   if (!A2 && !A1)
777777   {
778778      // _EP
779      data = page_r(*program, offset);
779      data = page_r(program, offset);
780780   }
781781   else if (!A2 && A1 && A0)
782782   {
783783      // _ES
784      data = segment_r(*program, offset);
784      data = segment_r(program, offset);
785785   }
786786   else if (A2 && A1 && A0)
787787   {
788788      // _CAUSE
789      data = cause_r(*program, offset);
789      data = cause_r(program, offset);
790790   }
791791
792792   return data;
r17961r17962
799799
800800void abc1600_state::write_supervisor_memory(offs_t offset, UINT8 data)
801801{
802   address_space *program = m_maincpu->space(AS_PROGRAM);
802   address_space &program = *m_maincpu->space(AS_PROGRAM);
803803
804804   if (!A2 && !A1)
805805   {
806806      // _WEP
807      page_w(*program, offset, data);
807      page_w(program, offset, data);
808808   }
809809   else if (!A2 && A1 && A0)
810810   {
811811      // _WES
812      segment_w(*program, offset, data);
812      segment_w(program, offset, data);
813813   }
814814   else if (A2 && !A1 && A0)
815815   {
816816      // W(C)
817      task_w(*program, offset, data);
817      task_w(program, offset, data);
818818   }
819819}
820820
r17961r17962
18791879
18801880void abc1600_state::machine_reset()
18811881{
1882   address_space *program = m_maincpu->space(AS_PROGRAM);
1882   address_space &program = *m_maincpu->space(AS_PROGRAM);
18831883
18841884   // clear special control register
18851885   for (int i = 0; i < 8; i++)
18861886   {
1887      spec_contr_reg_w(*program, 0, i);
1887      spec_contr_reg_w(program, 0, i);
18881888   }
18891889
18901890   // clear floppy registers
1891   fw0_w(*program, 0, 0);
1892   fw1_w(*program, 0, 0);
1891   fw0_w(program, 0, 0);
1892   fw1_w(program, 0, 0);
18931893
18941894   // clear task register
18951895   m_task = 0;
trunk/src/mess/drivers/nanos.c
r17961r17962
120120
121121/* Z80-SIO Interface */
122122
123static void z80daisy_interrupt(device_t *device, int state)
123static WRITE_LINE_DEVICE_HANDLER( z80daisy_interrupt )
124124{
125125   device->machine().device("maincpu")->execute().set_input_line(INPUT_LINE_IRQ0, state);
126126}
127127
128128static const z80sio_interface sio_intf =
129129{
130   z80daisy_interrupt,   /* interrupt handler */
131   NULL,            /* DTR changed handler */
132   NULL,            /* RTS changed handler */
133   NULL,            /* BREAK changed handler */
134   NULL,            /* transmit handler */
135   NULL            /* receive handler */
130   DEVCB_LINE(z80daisy_interrupt),   /* interrupt handler */
131   DEVCB_NULL,            /* DTR changed handler */
132   DEVCB_NULL,            /* RTS changed handler */
133   DEVCB_NULL,            /* BREAK changed handler */
134   DEVCB_NULL,            /* transmit handler */
135   DEVCB_NULL            /* receive handler */
136136};
137137
138138/* Z80 Daisy Chain */
trunk/src/mess/drivers/pasopia7.c
r17961r17962
549549{
550550   switch(offset)
551551   {
552      case 4: return upd765_status_r(m_fdc, 0);
553      case 5: return upd765_data_r(m_fdc, 0);
552      case 4: return upd765_status_r(m_fdc, space, 0);
553      case 5: return upd765_data_r(m_fdc, space, 0);
554554      //case 6: bit 7 interrupt bit
555555   }
556556
r17961r17962
563563   {
564564      case 0: upd765_tc_w(m_fdc, 0); break;
565565      case 2: upd765_tc_w(m_fdc, 1); break;
566      case 5: upd765_data_w(m_fdc, 0, data); break;
566      case 5: upd765_data_w(m_fdc, space, 0, data); break;
567567      case 6:
568568         upd765_reset_w(m_fdc, data & 0x80);
569569         floppy_mon_w(floppy_get_device(machine(), 0), (data & 0x40) ? CLEAR_LINE : ASSERT_LINE);
trunk/src/mess/drivers/fm7.c
r17961r17962
416416   switch(offset)
417417   {
418418      case 0:
419         return wd17xx_status_r(dev,offset);
419         return wd17xx_status_r(dev,space, offset);
420420      case 1:
421         return wd17xx_track_r(dev,offset);
421         return wd17xx_track_r(dev,space, offset);
422422      case 2:
423         return wd17xx_sector_r(dev,offset);
423         return wd17xx_sector_r(dev,space, offset);
424424      case 3:
425         return wd17xx_data_r(dev,offset);
425         return wd17xx_data_r(dev,space, offset);
426426      case 4:
427427         return m_fdc_side | 0xfe;
428428      case 5:
r17961r17962
448448   switch(offset)
449449   {
450450      case 0:
451         wd17xx_command_w(dev,offset,data);
451         wd17xx_command_w(dev,space, offset,data);
452452         break;
453453      case 1:
454         wd17xx_track_w(dev,offset,data);
454         wd17xx_track_w(dev,space, offset,data);
455455         break;
456456      case 2:
457         wd17xx_sector_w(dev,offset,data);
457         wd17xx_sector_w(dev,space, offset,data);
458458         break;
459459      case 3:
460         wd17xx_data_w(dev,offset,data);
460         wd17xx_data_w(dev,space, offset,data);
461461         break;
462462      case 4:
463463         m_fdc_side = data & 0x01;
r17961r17962
824824static void fm7_update_psg(running_machine &machine)
825825{
826826   fm7_state *state = machine.driver_data<fm7_state>();
827   address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
827   address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
828828
829829   if(state->m_type == SYS_FM7)
830830   {
r17961r17962
835835            break;
836836         case 0x01:
837837            // Data read
838            state->m_psg_data = ay8910_r(space->machine().device("psg"),0);
838            state->m_psg_data = ay8910_r(space.machine().device("psg"),space, 0);
839839            break;
840840         case 0x02:
841841            // Data write
842            ay8910_data_w(space->machine().device("psg"),0,state->m_psg_data);
842            ay8910_data_w(space.machine().device("psg"),space, 0,state->m_psg_data);
843843            break;
844844         case 0x03:
845845            // Address latch
846            ay8910_address_w(space->machine().device("psg"),0,state->m_psg_data);
846            ay8910_address_w(space.machine().device("psg"),space, 0,state->m_psg_data);
847847            break;
848848      }
849849   }
r17961r17962
856856            break;
857857         case 0x01:
858858            // Data read
859            state->m_psg_data = ym2203_r(space->machine().device("ym"),1);
859            state->m_psg_data = ym2203_r(space.machine().device("ym"),space, 1);
860860            break;
861861         case 0x02:
862862            // Data write
863            ym2203_w(space->machine().device("ym"),1,state->m_psg_data);
863            ym2203_w(space.machine().device("ym"),space, 1,state->m_psg_data);
864864            logerror("YM: data write 0x%02x\n",state->m_psg_data);
865865            break;
866866         case 0x03:
867867            // Address latch
868            ym2203_w(space->machine().device("ym"),0,state->m_psg_data);
868            ym2203_w(space.machine().device("ym"),space, 0,state->m_psg_data);
869869            logerror("YM: address latch 0x%02x\n",state->m_psg_data);
870870            break;
871871         case 0x04:
872872            // Status register
873            state->m_psg_data = ym2203_r(space->machine().device("ym"),0);
873            state->m_psg_data = ym2203_r(space.machine().device("ym"),space, 0);
874874            break;
875875         case 0x09:
876876            // Joystick port read
877            state->m_psg_data = space->machine().root_device().ioport("joy1")->read();
877            state->m_psg_data = space.machine().root_device().ioport("joy1")->read();
878878            break;
879879      }
880880   }
trunk/src/mess/drivers/vidbrain.c
r17961r17962
141141
142142   if (!m_sound_clk && sound_clk)
143143   {
144      //discrete_sound_w(m_discrete, NODE_01, m_keylatch & 0x03);
144      //discrete_sound_w(m_discrete, space, NODE_01, m_keylatch & 0x03);
145145
146146      UINT8 dac_data = 0;
147147
trunk/src/mess/drivers/z80ne.c
r17961r17962
410410   AY_3_1015,
411411   4800.0,
412412   4800.0,
413   NULL,
414   NULL,
415   NULL
413   DEVCB_NULL,
414   DEVCB_NULL,
415   DEVCB_NULL
416416};
417417
418418static const cassette_interface z80ne_cassettea_config =
r17961r17962
436436static const kr2376_interface lx388_kr2376_interface =
437437{
438438   50000,
439   NULL
439   DEVCB_NULL
440440};
441441
442442static const floppy_interface z80netf_floppy_interface =
trunk/src/mess/drivers/ami1200.c
r17961r17962
9090   /* bit 2 = Power Led on Amiga */
9191   set_led_status(device->machine(), 0, !BIT(data, 1));
9292
93   handle_cd32_joystick_cia(state, data, mos6526_r(device, 2));
93   handle_cd32_joystick_cia(state, data, mos6526_r(device, space, 2));
9494}
9595
9696/*************************************
trunk/src/mess/drivers/trs80m2.c
r17961r17962
334334
335335READ8_MEMBER( trs80m2_state::fdc_r )
336336{
337   return wd17xx_r(m_fdc, offset) ^ 0xff;
337   return wd17xx_r(m_fdc, space, offset) ^ 0xff;
338338}
339339
340340WRITE8_MEMBER( trs80m2_state::fdc_w )
341341{
342   wd17xx_w(m_fdc, offset, data ^ 0xff);
342   wd17xx_w(m_fdc, space, offset, data ^ 0xff);
343343}
344344
345345WRITE8_MEMBER( trs80m16_state::tcl_w )
trunk/src/mess/drivers/mz6500.c
r17961r17962
6060
6161READ8_MEMBER( mz6500_state::fdc_r )
6262{
63   return (offset) ? upd765_data_r(m_fdc, 0) : upd765_status_r(m_fdc, 0);
63   return (offset) ? upd765_data_r(m_fdc, space, 0) : upd765_status_r(m_fdc, space, 0);
6464}
6565
6666WRITE8_MEMBER( mz6500_state::fdc_w )
6767{
6868   if(offset)
69      upd765_data_w(m_fdc, 0, data);
69      upd765_data_w(m_fdc, space, 0, data);
7070}
7171
7272READ8_MEMBER( mz6500_state::mz6500_vram_r )
trunk/src/mess/drivers/p8k.c
r17961r17962
201201
202202****************************************************************************/
203203
204static void p8k_daisy_interrupt(device_t *device, int state)
204static WRITE_LINE_DEVICE_HANDLER( p8k_daisy_interrupt )
205205{
206206   device->machine().device("maincpu")->execute().set_input_line(0, state);
207207}
r17961r17962
300300
301301/* Z80 SIO 0 */
302302
303static WRITE8_DEVICE_HANDLER( pk8_sio_0_serial_transmit )
303static WRITE16_DEVICE_HANDLER( pk8_sio_0_serial_transmit )
304304{
305305// send character to terminal
306306}
307307
308308static const z80sio_interface p8k_sio_0_intf =
309309{
310   p8k_daisy_interrupt,         /* interrupt handler */
311   NULL,               /* DTR changed handler */
312   NULL,               /* RTS changed handler */
313   NULL,               /* BREAK changed handler */
314   pk8_sio_0_serial_transmit,   /* transmit handler */
315   NULL               /* receive handler */
310   DEVCB_LINE(p8k_daisy_interrupt),         /* interrupt handler */
311   DEVCB_NULL,               /* DTR changed handler */
312   DEVCB_NULL,               /* RTS changed handler */
313   DEVCB_NULL,               /* BREAK changed handler */
314   DEVCB_HANDLER(pk8_sio_0_serial_transmit),   /* transmit handler */
315   DEVCB_NULL               /* receive handler */
316316};
317317
318318/* Z80 SIO 1 */
319319
320static WRITE8_DEVICE_HANDLER( pk8_sio_1_serial_transmit )
320static WRITE16_DEVICE_HANDLER( pk8_sio_1_serial_transmit )
321321{
322322// send character to terminal
323323}
324324
325325static const z80sio_interface p8k_sio_1_intf =
326326{
327   p8k_daisy_interrupt,         /* interrupt handler */
328   NULL,               /* DTR changed handler */
329   NULL,               /* RTS changed handler */
330   NULL,               /* BREAK changed handler */
331   pk8_sio_1_serial_transmit,   /* transmit handler */
332   NULL               /* receive handler */
327   DEVCB_LINE(p8k_daisy_interrupt),         /* interrupt handler */
328   DEVCB_NULL,               /* DTR changed handler */
329   DEVCB_NULL,               /* RTS changed handler */
330   DEVCB_NULL,               /* BREAK changed handler */
331   DEVCB_HANDLER(pk8_sio_1_serial_transmit),   /* transmit handler */
332   DEVCB_NULL               /* receive handler */
333333};
334334
335335/* Z80 Daisy Chain */
r17961r17962
568568
569569****************************************************************************/
570570
571static void p8k_16_daisy_interrupt(device_t *device, int state)
571static WRITE_LINE_DEVICE_HANDLER( p8k_16_daisy_interrupt )
572572{
573573   // this must be studied a little bit more :-)
574574}
r17961r17962
634634
635635/* Z80 SIO 0 */
636636
637static WRITE8_DEVICE_HANDLER( pk8_16_sio_0_serial_transmit )
637static WRITE16_DEVICE_HANDLER( pk8_16_sio_0_serial_transmit )
638638{
639639// send character to terminal
640640}
641641
642642static const z80sio_interface p8k_16_sio_0_intf =
643643{
644   p8k_16_daisy_interrupt,         /* interrupt handler */
645   NULL,               /* DTR changed handler */
646   NULL,               /* RTS changed handler */
647   NULL,               /* BREAK changed handler */
648   pk8_16_sio_0_serial_transmit,   /* transmit handler */
649   NULL               /* receive handler */
644   DEVCB_LINE(p8k_16_daisy_interrupt),         /* interrupt handler */
645   DEVCB_NULL,               /* DTR changed handler */
646   DEVCB_NULL,               /* RTS changed handler */
647   DEVCB_NULL,               /* BREAK changed handler */
648   DEVCB_HANDLER(pk8_16_sio_0_serial_transmit),   /* transmit handler */
649   DEVCB_NULL               /* receive handler */
650650};
651651
652652/* Z80 SIO 1 */
653653
654static WRITE8_DEVICE_HANDLER( pk8_16_sio_1_serial_transmit )
654static WRITE16_DEVICE_HANDLER( pk8_16_sio_1_serial_transmit )
655655{
656656// send character to terminal
657657}
658658
659659static const z80sio_interface p8k_16_sio_1_intf =
660660{
661   p8k_16_daisy_interrupt,         /* interrupt handler */
662   NULL,               /* DTR changed handler */
663   NULL,               /* RTS changed handler */
664   NULL,               /* BREAK changed handler */
665   pk8_16_sio_1_serial_transmit,   /* transmit handler */
666   NULL               /* receive handler */
661   DEVCB_LINE(p8k_16_daisy_interrupt),         /* interrupt handler */
662   DEVCB_NULL,               /* DTR changed handler */
663   DEVCB_NULL,               /* RTS changed handler */
664   DEVCB_NULL,               /* BREAK changed handler */
665   DEVCB_HANDLER(pk8_16_sio_1_serial_transmit),   /* transmit handler */
666   DEVCB_NULL               /* receive handler */
667667};
668668
669669/* Z80 Daisy Chain */
trunk/src/mess/drivers/ngp.c
r17961r17962
229229   case 0x21:      /* t6w28 "left" */
230230      if ( m_io_reg[0x38] == 0x55 && m_io_reg[0x39] == 0xAA )
231231      {
232         t6w28_w( m_t6w28, 0, data );
232         t6w28_w( m_t6w28, space, 0, data );
233233      }
234234      break;
235235
trunk/src/mess/drivers/nes.c
r17961r17962
2323
2424static READ8_DEVICE_HANDLER( psg_4015_r )
2525{
26   return nes_psg_r(device, 0x15);
26   return nes_psg_r(device, space, 0x15);
2727}
2828
2929static WRITE8_DEVICE_HANDLER( psg_4015_w )
3030{
31   nes_psg_w(device, 0x15, data);
31   nes_psg_w(device, space, 0x15, data);
3232}
3333
3434static WRITE8_DEVICE_HANDLER( psg_4017_w )
3535{
36   nes_psg_w(device, 0x17, data);
36   nes_psg_w(device, space, 0x17, data);
3737}
3838
3939WRITE8_MEMBER(nes_state::nes_vh_sprite_dma_w)
trunk/src/mess/drivers/msx.c
r17961r17962
344344static WRITE8_DEVICE_HANDLER( msx_ay8910_w )
345345{
346346   if ( offset & 1 )
347      ay8910_data_w( device, offset, data );
347      ay8910_data_w( device, space, offset, data );
348348   else
349      ay8910_address_w( device, offset, data );
349      ay8910_address_w( device, space, offset, data );
350350}
351351
352352
trunk/src/mess/drivers/vt100.c
r17961r17962
9595READ8_MEMBER( vt100_state::vt100_flags_r )
9696{
9797   UINT8 ret = 0;
98   ret |= vt_video_lba7_r(m_crtc, 0) << 6;
98   ret |= vt_video_lba7_r(m_crtc, space, 0) << 6;
9999   ret |= m_keyboard_int << 7;
100100   return ret;
101101}
trunk/src/mess/drivers/apollo.c
r17961r17962
11701170}
11711171
11721172static APOLLO_KBD_INTERFACE( apollo_kbd_config ) = {
1173   apollo_kbd_putchar,
1174   apollo_kbd_has_beeper,
1175   apollo_kbd_is_german
1173   DEVCB_HANDLER(apollo_kbd_putchar),
1174   DEVCB_HANDLER(apollo_kbd_has_beeper),
1175   DEVCB_HANDLER(apollo_kbd_is_german)
11761176};
11771177
11781178static WRITE8_DEVICE_HANDLER( terminal_kbd_putchar ) {
trunk/src/mess/drivers/x1twin.c
r17961r17962
429429#if 0
430430static const z80sio_interface sio_intf =
431431{
432   0,               /* interrupt handler */
433   0,               /* DTR changed handler */
434   0,               /* RTS changed handler */
435   0,               /* BREAK changed handler */
436   0,               /* transmit handler */
437   0               /* receive handler */
432   DEVCB_NULL,               /* interrupt handler */
433   DEVCB_NULL,               /* DTR changed handler */
434   DEVCB_NULL,               /* RTS changed handler */
435   DEVCB_NULL,               /* BREAK changed handler */
436   DEVCB_NULL,               /* transmit handler */
437   DEVCB_NULL               /* receive handler */
438438};
439439#endif
440440
trunk/src/mess/drivers/specpls3.c
r17961r17962
185185{
186186   spectrum_state *state = space->machine().driver_data<spectrum_state>();
187187   if (state->m_floppy==1)
188      upd765_data_w(space->machine().device("upd765"), 0,data);
188      upd765_data_w(space->machine().device("upd765"), *space, 0,data);
189189}
190190
191191static  READ8_HANDLER(spectrum_plus3_port_3ffd_r)
r17961r17962
194194   if (state->m_floppy==0)
195195      return 0xff;
196196   else
197      return upd765_data_r(space->machine().device("upd765"), 0);
197      return upd765_data_r(space->machine().device("upd765"), *space, 0);
198198}
199199
200200
r17961r17962
204204   if (state->m_floppy==0)
205205         return 0xff;
206206   else
207         return upd765_status_r(space->machine().device("upd765"), 0);
207         return upd765_status_r(space->machine().device("upd765"), *space, 0);
208208}
209209
210210
trunk/src/mess/drivers/x68k.c
r17961r17962
347347static WRITE16_HANDLER( x68k_dmac_w )
348348{
349349   device_t* device = space->machine().device("hd63450");
350   hd63450_w(device, offset, data, mem_mask);
350   hd63450_w(device, *space, offset, data, mem_mask);
351351}
352352
353353static READ16_HANDLER( x68k_dmac_r )
354354{
355355   device_t* device = space->machine().device("hd63450");
356   return hd63450_r(device, offset, mem_mask);
356   return hd63450_r(device, *space, offset, mem_mask);
357357}
358358
359359static void x68k_keyboard_ctrl_w(x68k_state *state, int data)
r17961r17962
974974   {
975975   case 0x00:
976976   case 0x01:
977      upd765_data_w(fdc, 0,data);
977      upd765_data_w(fdc, *space, 0,data);
978978      break;
979979   case 0x02:  // drive option signal control
980980      x = data & 0x0f;
r17961r17962
10541054   switch(offset)
10551055   {
10561056   case 0x00:
1057      return upd765_status_r(fdc, 0);
1057      return upd765_status_r(fdc, *space, 0);
10581058   case 0x01:
1059      return upd765_data_r(fdc, 0);
1059      return upd765_data_r(fdc, *space, 0);
10601060   case 0x02:
10611061      ret = 0x00;
10621062      for(x=0;x<4;x++)
r17961r17962
11031103   device_t *fdc = machine.device("upd72065");
11041104
11051105   if(state->m_fdc.drq_state != 0)
1106      data = upd765_dack_r(fdc, 0);
1106      data = upd765_dack_r(fdc, state->generic_space(), 0);
11071107//  logerror("FDC: DACK reading\n");
11081108   return data;
11091109}
r17961r17962
11111111static void x68k_fdc_write_byte(running_machine &machine,int addr, int data)
11121112{
11131113   device_t *fdc = machine.device("upd72065");
1114   upd765_dack_w(fdc, 0, data);
1114   upd765_dack_w(fdc, machine.driver_data()->generic_space(), 0, data);
11151115}
11161116
11171117static WRITE_LINE_DEVICE_HANDLER ( fdc_drq )
r17961r17962
11261126   {
11271127   case 0x00:
11281128   case 0x01:
1129      ym2151_w(space->machine().device("ym2151"), offset, data);
1129      ym2151_w(space->machine().device("ym2151"), *space, offset, data);
11301130      break;
11311131   }
11321132}
r17961r17962
11341134static READ16_HANDLER( x68k_fm_r )
11351135{
11361136   if(offset == 0x01)
1137      return ym2151_r(space->machine().device("ym2151"), 1);
1137      return ym2151_r(space->machine().device("ym2151"), *space, 1);
11381138
11391139   return 0xffff;
11401140}
r17961r17962
18731873   switch(offset)
18741874   {
18751875      case 0x00:
1876         okim6258_ctrl_w(device,0,data);
1876         okim6258_ctrl_w(device,space,0,data);
18771877         break;
18781878      case 0x01:
1879         okim6258_data_w(device,0,data);
1879         okim6258_data_w(device,space,0,data);
18801880         break;
18811881   }
18821882}
trunk/src/mess/drivers/pc8801.c
r17961r17962
16881688READ8_MEMBER(pc8801_state::pc8801_sound_board_r)
16891689{
16901690   if(m_has_opna)
1691      return ym2608_r(machine().device("opna"), offset);
1691      return ym2608_r(machine().device("opna"), space, offset);
16921692
1693   return (offset & 2) ? 0xff : ym2203_r(machine().device("opn"), offset);
1693   return (offset & 2) ? 0xff : ym2203_r(machine().device("opn"), space, offset);
16941694}
16951695
16961696WRITE8_MEMBER(pc8801_state::pc8801_sound_board_w)
16971697{
16981698   if(m_has_opna)
1699      ym2608_w(machine().device("opna"), offset,data);
1699      ym2608_w(machine().device("opna"), space, offset,data);
17001700   else if((offset & 2) == 0)
1701      ym2203_w(machine().device("opn"), offset,data);
1701      ym2203_w(machine().device("opn"), space, offset,data);
17021702}
17031703
17041704READ8_MEMBER(pc8801_state::pc8801_opna_r)
17051705{
17061706   if(m_has_opna && (offset & 2) == 0)
1707      return ym2608_r(machine().device("opna"), (offset & 1) | ((offset & 4) >> 1));
1707      return ym2608_r(machine().device("opna"), space, (offset & 1) | ((offset & 4) >> 1));
17081708
17091709   return 0xff;
17101710}
r17961r17962
17121712WRITE8_MEMBER(pc8801_state::pc8801_opna_w)
17131713{
17141714   if(m_has_opna && (offset & 2) == 0)
1715      ym2608_w(machine().device("opna"), (offset & 1) | ((offset & 4) >> 1),data);
1715      ym2608_w(machine().device("opna"), space, (offset & 1) | ((offset & 4) >> 1),data);
17161716   else if(m_has_opna && offset == 2)
17171717   {
17181718      m_sound_irq_mask = ((data & 0x80) == 0);
trunk/src/mess/drivers/apricot.c
r17961r17962
120120   }
121121};
122122
123static void apricot_sio_irq_w(device_t *device, int st)
123static WRITE_LINE_DEVICE_HANDLER( apricot_sio_irq_w )
124124{
125   apricot_state *state = device->machine().driver_data<apricot_state>();
126   pic8259_ir5_w(state->m_pic, st);
125   apricot_state *astate = device->machine().driver_data<apricot_state>();
126   pic8259_ir5_w(astate->m_pic, state);
127127}
128128
129129static const z80sio_interface apricot_z80sio_intf =
130130{
131   apricot_sio_irq_w,
132   NULL,
133   NULL,
134   NULL,
135   NULL,
136   NULL
131   DEVCB_LINE(apricot_sio_irq_w),
132   DEVCB_NULL,
133   DEVCB_NULL,
134   DEVCB_NULL,
135   DEVCB_NULL,
136   DEVCB_NULL
137137};
138138
139139
trunk/src/mess/drivers/apf.c
r17961r17962
388388
389389WRITE8_MEMBER( apf_state::apf_wd179x_command_w)
390390{
391   wd17xx_command_w(m_fdc, offset,~data);
391   wd17xx_command_w(m_fdc, space, offset,~data);
392392}
393393
394394WRITE8_MEMBER( apf_state::apf_wd179x_track_w)
395395{
396   wd17xx_track_w(m_fdc, offset,~data);
396   wd17xx_track_w(m_fdc, space, offset,~data);
397397}
398398
399399WRITE8_MEMBER( apf_state::apf_wd179x_sector_w)
400400{
401   wd17xx_sector_w(m_fdc, offset,~data);
401   wd17xx_sector_w(m_fdc, space, offset,~data);
402402}
403403
404404WRITE8_MEMBER( apf_state::apf_wd179x_data_w)
405405{
406   wd17xx_data_w(m_fdc, offset,~data);
406   wd17xx_data_w(m_fdc, space, offset,~data);
407407}
408408
409409READ8_MEMBER( apf_state::apf_wd179x_status_r)
410410{
411   return ~wd17xx_status_r(m_fdc, offset);
411   return ~wd17xx_status_r(m_fdc, space, offset);
412412}
413413
414414READ8_MEMBER( apf_state::apf_wd179x_track_r)
415415{
416   return ~wd17xx_track_r(m_fdc, offset);
416   return ~wd17xx_track_r(m_fdc, space, offset);
417417}
418418
419419READ8_MEMBER( apf_state::apf_wd179x_sector_r)
420420{
421   return ~wd17xx_sector_r(m_fdc, offset);
421   return ~wd17xx_sector_r(m_fdc, space, offset);
422422}
423423
424424READ8_MEMBER( apf_state::apf_wd179x_data_r)
425425{
426   return wd17xx_data_r(m_fdc, offset); // should this be inverted like the rest?
426   return wd17xx_data_r(m_fdc, space, offset); // should this be inverted like the rest?
427427}
428428
429429static ADDRESS_MAP_START( apf_imagination_map, AS_PROGRAM, 8, apf_state )
trunk/src/mess/drivers/snes.c
r17961r17962
4747
4848static READ8_DEVICE_HANDLER( spc_ram_100_r )
4949{
50   return spc_ram_r(device, offset + 0x100);
50   return spc_ram_r(device, space, offset + 0x100);
5151}
5252
5353static WRITE8_DEVICE_HANDLER( spc_ram_100_w )
5454{
55   spc_ram_w(device, offset + 0x100, data);
55   spc_ram_w(device, space, offset + 0x100, data);
5656}
5757
5858/*************************************
trunk/src/mess/drivers/bebox.c
r17961r17962
3737#include "formats/pc_dsk.h"
3838#include "machine/ram.h"
3939
40static READ8_HANDLER(at_dma8237_1_r)  { return i8237_r(space->machine().device("dma8237_2"), offset / 2); }
41static WRITE8_HANDLER(at_dma8237_1_w) { i8237_w(space->machine().device("dma8237_2"), offset / 2, data); }
40static READ8_HANDLER(at_dma8237_1_r)  { return i8237_r(space->machine().device("dma8237_2"), *space, offset / 2); }
41static WRITE8_HANDLER(at_dma8237_1_w) { i8237_w(space->machine().device("dma8237_2"), *space, offset / 2, data); }
4242
4343static ADDRESS_MAP_START( bebox_mem, AS_PROGRAM, 64, bebox_state )
4444   AM_RANGE(0x7FFFF0F0, 0x7FFFF0F7) AM_READWRITE_LEGACY(bebox_cpu0_imask_r, bebox_cpu0_imask_w )
trunk/src/mess/drivers/elwro800.c
r17961r17962
289289      device_t *fdc = machine().device("upd765");
290290      if (offset & 1)
291291      {
292         return upd765_data_r(fdc,0);
292         return upd765_data_r(fdc,space, 0);
293293      }
294294      else
295295      {
296         return upd765_status_r(fdc,0);
296         return upd765_status_r(fdc,space, 0);
297297      }
298298   }
299299   else if (!BIT(cs,4))
r17961r17962
347347      device_t *fdc = machine().device("upd765");
348348      if (offset & 1)
349349      {
350         upd765_data_w(fdc, 0, data);
350         upd765_data_w(fdc, space, 0, data);
351351      }
352352   }
353353   else if (!BIT(cs,4))
trunk/src/mess/drivers/exelv.c
r17961r17962
381381{
382382   logerror("tms7041_portd_w: data = 0x%02x\n", data);
383383
384   tms5220_data_w(m_tms5220c, 0, BITSWAP8(data,0,1,2,3,4,5,6,7));
384   tms5220_data_w(m_tms5220c, space, 0, BITSWAP8(data,0,1,2,3,4,5,6,7));
385385   m_tms7041_portd = data;
386386}
387387
trunk/src/mess/drivers/svision.c
r17961r17962
150150         svision_soundport_w(m_sound, 1, offset & 3, data);
151151         break;
152152      case 0x18: case 0x19: case 0x1a: case 0x1b: case 0x1c:
153         svision_sounddma_w(m_sound, offset - 0x18, data);
153         svision_sounddma_w(m_sound, space, offset - 0x18, data);
154154         break;
155155      case 0x28: case 0x29: case 0x2a:
156         svision_noise_w(m_sound, offset - 0x28, data);
156         svision_noise_w(m_sound, space, offset - 0x28, data);
157157         break;
158158      default:
159159         logerror("%.6f svision write %04x %02x\n", machine().time().as_double(), offset, data);
trunk/src/mess/drivers/c64.c
r17961r17962
427427
428428READ8_MEMBER( c64_state::sid_potx_r )
429429{
430   UINT8 cia1_pa = mos6526_pa_r(m_cia1, 0);
430   UINT8 cia1_pa = mos6526_pa_r(m_cia1, space, 0);
431431
432432   int sela = BIT(cia1_pa, 6);
433433   int selb = BIT(cia1_pa, 7);
r17961r17962
442442
443443READ8_MEMBER( c64_state::sid_poty_r )
444444{
445   UINT8 cia1_pa = mos6526_pa_r(m_cia1, 0);
445   UINT8 cia1_pa = mos6526_pa_r(m_cia1, space, 0);
446446
447447   int sela = BIT(cia1_pa, 6);
448448   int selb = BIT(cia1_pa, 7);
r17961r17962
490490
491491    */
492492
493   UINT8 cia0portb = mos6526_pb_r(m_cia1, 0);
493   UINT8 cia0portb = mos6526_pb_r(m_cia1, space, 0);
494494
495495   return cbm_common_cia0_port_a_r(m_cia1, cia0portb);
496496}
r17961r17962
512512
513513    */
514514
515   UINT8 cia0porta = mos6526_pa_r(m_cia1, 0);
515   UINT8 cia0porta = mos6526_pa_r(m_cia1, space, 0);
516516
517517   return cbm_common_cia0_port_b_r(m_cia1, cia0porta);
518518}
trunk/src/mess/drivers/ptcsol.c
r17961r17962
522522   AY_3_1015,
523523   4800.0,
524524   4800.0,
525   NULL,
526   NULL,
527   NULL
525   DEVCB_NULL,
526   DEVCB_NULL,
527   DEVCB_NULL
528528};
529529
530530
trunk/src/mess/drivers/pcm.c
r17961r17962
269269
270270static const z80sio_interface sio_intf =
271271{
272   0, //DEVCB_CPU_INPUT_LINE("maincpu", INPUT_LINE_IRQ0), // interrupt callback
273   0,         /* DTR changed handler */
274   0,         /* RTS changed handler */
275   0,         /* BREAK changed handler */
276   0,         /* transmit handler */
277   0         /* receive handler */
272   DEVCB_NULL, //DEVCB_CPU_INPUT_LINE("maincpu", INPUT_LINE_IRQ0), // interrupt callback
273   DEVCB_NULL,         /* DTR changed handler */
274   DEVCB_NULL,         /* RTS changed handler */
275   DEVCB_NULL,         /* BREAK changed handler */
276   DEVCB_NULL,         /* transmit handler */
277   DEVCB_NULL         /* receive handler */
278278};
279279
280280
trunk/src/mess/drivers/vic10.c
r17961r17962
6868   }
6969   else if (offset >= 0xdc00 && offset < 0xe000)
7070   {
71      data = mos6526_r(m_cia, offset & 0x0f);
71      data = mos6526_r(m_cia, space, offset & 0x0f);
7272   }
7373   else if (offset >= 0xe000)
7474   {
r17961r17962
111111   }
112112   else if (offset >= 0xdc00 && offset < 0xe000)
113113   {
114      mos6526_w(m_cia, offset & 0x0f, data);
114      mos6526_w(m_cia, space, offset & 0x0f, data);
115115   }
116116
117117   m_exp->cd_w(space, offset, data, lorom, uprom, exram);
r17961r17962
251251//  sid6581_interface sid_intf
252252//-------------------------------------------------
253253
254UINT8 vic10_state::paddle_read(int which)
254UINT8 vic10_state::paddle_read(address_space &space, int which)
255255{
256256   int pot1 = 0xff, pot2 = 0xff, pot3 = 0xff, pot4 = 0xff, temp;
257   UINT8 cia0porta = mos6526_pa_r(m_cia, 0);
257   UINT8 cia0porta = mos6526_pa_r(m_cia, space, 0);
258258   int controller1 = ioport("CTRLSEL")->read() & 0x07;
259259   int controller2 = ioport("CTRLSEL")->read() & 0x70;
260260   // Notice that only a single input is defined for Mouse & Lightpen in both ports
r17961r17962
366366
367367READ8_MEMBER( vic10_state::sid_potx_r )
368368{
369   return paddle_read(0);
369   return paddle_read(space, 0);
370370}
371371
372372READ8_MEMBER( vic10_state::sid_poty_r )
373373{
374   return paddle_read(1);
374   return paddle_read(space, 1);
375375}
376376
377377static MOS6581_INTERFACE( sid_intf )
r17961r17962
409409
410410    */
411411
412   UINT8 cia0portb = mos6526_pb_r(m_cia, 0);
412   UINT8 cia0portb = mos6526_pb_r(m_cia, space, 0);
413413
414414   return cbm_common_cia0_port_a_r(m_cia, cia0portb);
415415}
r17961r17962
431431
432432    */
433433
434   UINT8 cia0porta = mos6526_pa_r(m_cia, 0);
434   UINT8 cia0porta = mos6526_pa_r(m_cia, space, 0);
435435
436436   return cbm_common_cia0_port_b_r(m_cia, cia0porta);
437437}
trunk/src/mess/drivers/gba.c
r17961r17962
773773         }
774774         break;
775775      case 0x0060/4:
776         retval = gb_sound_r(gb_device, 0) | gb_sound_r(gb_device, 1)<<16 | gb_sound_r(gb_device, 2)<<24;
776         retval = gb_sound_r(gb_device, space, 0) | gb_sound_r(gb_device, space, 1)<<16 | gb_sound_r(gb_device, space, 2)<<24;
777777         break;
778778      case 0x0064/4:
779         retval = gb_sound_r(gb_device, 3) | gb_sound_r(gb_device, 4)<<8;
779         retval = gb_sound_r(gb_device, space, 3) | gb_sound_r(gb_device, space, 4)<<8;
780780         break;
781781      case 0x0068/4:
782         retval = gb_sound_r(gb_device, 6) | gb_sound_r(gb_device, 7)<<8;
782         retval = gb_sound_r(gb_device, space, 6) | gb_sound_r(gb_device, space, 7)<<8;
783783         break;
784784      case 0x006c/4:
785         retval = gb_sound_r(gb_device, 8) | gb_sound_r(gb_device, 9)<<8;
785         retval = gb_sound_r(gb_device, space, 8) | gb_sound_r(gb_device, space, 9)<<8;
786786         break;
787787      case 0x0070/4:
788         retval = gb_sound_r(gb_device, 0xa) | gb_sound_r(gb_device, 0xb)<<16 | gb_sound_r(gb_device, 0xc)<<24;
788         retval = gb_sound_r(gb_device, space, 0xa) | gb_sound_r(gb_device, space, 0xb)<<16 | gb_sound_r(gb_device, space, 0xc)<<24;
789789         break;
790790      case 0x0074/4:
791         retval = gb_sound_r(gb_device, 0xd) | gb_sound_r(gb_device, 0xe)<<8;
791         retval = gb_sound_r(gb_device, space, 0xd) | gb_sound_r(gb_device, space, 0xe)<<8;
792792         break;
793793      case 0x0078/4:
794         retval = gb_sound_r(gb_device, 0x10) | gb_sound_r(gb_device, 0x11)<<8;
794         retval = gb_sound_r(gb_device, space, 0x10) | gb_sound_r(gb_device, space, 0x11)<<8;
795795         break;
796796      case 0x007c/4:
797         retval = gb_sound_r(gb_device, 0x12) | gb_sound_r(gb_device, 0x13)<<8;
797         retval = gb_sound_r(gb_device, space, 0x12) | gb_sound_r(gb_device, space, 0x13)<<8;
798798         break;
799799      case 0x0080/4:
800         retval = gb_sound_r(gb_device, 0x14) | gb_sound_r(gb_device, 0x15)<<8;
800         retval = gb_sound_r(gb_device, space, 0x14) | gb_sound_r(gb_device, space, 0x15)<<8;
801801         if( (mem_mask) & 0xffff0000 )
802802         {
803803            verboselog(machine(), 2, "GBA IO Register Read: SOUNDCNT_H (%08x) = %04x\n", 0x04000000 + ( offset << 2 ) + 2, m_SOUNDCNT_H );
r17961r17962
805805         }
806806         break;
807807      case 0x0084/4:
808         retval = gb_sound_r(gb_device, 0x16);
808         retval = gb_sound_r(gb_device, space, 0x16);
809809         break;
810810      case 0x0088/4:
811811         if( (mem_mask) & 0x0000ffff )
r17961r17962
819819         }
820820         break;
821821      case 0x0090/4:
822         retval = gb_wave_r(gb_device, 0) | gb_wave_r(gb_device, 1)<<8 | gb_wave_r(gb_device, 2)<<16 | gb_wave_r(gb_device, 3)<<24;
822         retval = gb_wave_r(gb_device, space, 0) | gb_wave_r(gb_device, space, 1)<<8 | gb_wave_r(gb_device, space, 2)<<16 | gb_wave_r(gb_device, space, 3)<<24;
823823         break;
824824      case 0x0094/4:
825         retval = gb_wave_r(gb_device, 4) | gb_wave_r(gb_device, 5)<<8 | gb_wave_r(gb_device, 6)<<16 | gb_wave_r(gb_device, 7)<<24;
825         retval = gb_wave_r(gb_device, space, 4) | gb_wave_r(gb_device, space, 5)<<8 | gb_wave_r(gb_device, space, 6)<<16 | gb_wave_r(gb_device, space, 7)<<24;
826826         break;
827827      case 0x0098/4:
828         retval = gb_wave_r(gb_device, 8) | gb_wave_r(gb_device, 9)<<8 | gb_wave_r(gb_device, 10)<<16 | gb_wave_r(gb_device, 11)<<24;
828         retval = gb_wave_r(gb_device, space, 8) | gb_wave_r(gb_device, space, 9)<<8 | gb_wave_r(gb_device, space, 10)<<16 | gb_wave_r(gb_device, space, 11)<<24;
829829         break;
830830      case 0x009c/4:
831         retval = gb_wave_r(gb_device, 12) | gb_wave_r(gb_device, 13)<<8 | gb_wave_r(gb_device, 14)<<16 | gb_wave_r(gb_device, 15)<<24;
831         retval = gb_wave_r(gb_device, space, 12) | gb_wave_r(gb_device, space, 13)<<8 | gb_wave_r(gb_device, space, 14)<<16 | gb_wave_r(gb_device, space, 15)<<24;
832832         break;
833833      case 0x00a0/4:
834834      case 0x00a4/4:
r17961r17962
13501350      case 0x0060/4:
13511351         if( (mem_mask) & 0x000000ff )   // SOUNDCNTL
13521352         {
1353            gb_sound_w(gb_device, 0, data);
1353            gb_sound_w(gb_device, space, 0, data);
13541354         }
13551355         if( (mem_mask) & 0x00ff0000 )
13561356         {
1357            gb_sound_w(gb_device, 1, data>>16);   // SOUND1CNT_H
1357            gb_sound_w(gb_device, space, 1, data>>16);   // SOUND1CNT_H
13581358         }
13591359         if( (mem_mask) & 0xff000000 )
13601360         {
1361            gb_sound_w(gb_device, 2, data>>24);
1361            gb_sound_w(gb_device, space, 2, data>>24);
13621362         }
13631363         break;
13641364      case 0x0064/4:
13651365         if( (mem_mask) & 0x000000ff )   // SOUNDCNTL
13661366         {
1367            gb_sound_w(gb_device, 3, data);
1367            gb_sound_w(gb_device, space, 3, data);
13681368         }
13691369         if( (mem_mask) & 0x0000ff00 )
13701370         {
1371            gb_sound_w(gb_device, 4, data>>8);   // SOUND1CNT_H
1371            gb_sound_w(gb_device, space, 4, data>>8);   // SOUND1CNT_H
13721372         }
13731373         break;
13741374      case 0x0068/4:
13751375         if( (mem_mask) & 0x000000ff )
13761376         {
1377            gb_sound_w(gb_device, 6, data);
1377            gb_sound_w(gb_device, space, 6, data);
13781378         }
13791379         if( (mem_mask) & 0x0000ff00 )
13801380         {
1381            gb_sound_w(gb_device, 7, data>>8);
1381            gb_sound_w(gb_device, space, 7, data>>8);
13821382         }
13831383         break;
13841384      case 0x006c/4:
13851385         if( (mem_mask) & 0x000000ff )
13861386         {
1387            gb_sound_w(gb_device, 8, data);
1387            gb_sound_w(gb_device, space, 8, data);
13881388         }
13891389         if( (mem_mask) & 0x0000ff00 )
13901390         {
1391            gb_sound_w(gb_device, 9, data>>8);
1391            gb_sound_w(gb_device, space, 9, data>>8);
13921392         }
13931393         break;
13941394      case 0x0070/4:   //SND3CNTL and H
13951395         if( (mem_mask) & 0x000000ff )   // SOUNDCNTL
13961396         {
1397            gb_sound_w(gb_device, 0xa, data);
1397            gb_sound_w(gb_device, space, 0xa, data);
13981398         }
13991399         if( (mem_mask) & 0x00ff0000 )
14001400         {
1401            gb_sound_w(gb_device, 0xb, data>>16);   // SOUND1CNT_H
1401            gb_sound_w(gb_device, space, 0xb, data>>16);   // SOUND1CNT_H
14021402         }
14031403         if( (mem_mask) & 0xff000000 )
14041404         {
1405            gb_sound_w(gb_device, 0xc, data>>24);
1405            gb_sound_w(gb_device, space, 0xc, data>>24);
14061406         }
14071407         break;
14081408      case 0x0074/4:
14091409         if( (mem_mask) & 0x000000ff )
14101410         {
1411            gb_sound_w(gb_device, 0xd, data);
1411            gb_sound_w(gb_device, space, 0xd, data);
14121412         }
14131413         if( (mem_mask) & 0x0000ff00 )
14141414         {
1415            gb_sound_w(gb_device, 0xe, data>>8);
1415            gb_sound_w(gb_device, space, 0xe, data>>8);
14161416         }
14171417         break;
14181418      case 0x0078/4:
14191419         if( (mem_mask) & 0x000000ff )
14201420         {
1421            gb_sound_w(gb_device, 0x10, data);
1421            gb_sound_w(gb_device, space, 0x10, data);
14221422         }
14231423         if( (mem_mask) & 0x0000ff00 )
14241424         {
1425            gb_sound_w(gb_device, 0x11, data>>8);
1425            gb_sound_w(gb_device, space, 0x11, data>>8);
14261426         }
14271427         break;
14281428      case 0x007c/4:
14291429         if( (mem_mask) & 0x000000ff )
14301430         {
1431            gb_sound_w(gb_device, 0x12, data);
1431            gb_sound_w(gb_device, space, 0x12, data);
14321432         }
14331433         if( (mem_mask) & 0x0000ff00 )
14341434         {
1435            gb_sound_w(gb_device, 0x13, data>>8);
1435            gb_sound_w(gb_device, space, 0x13, data>>8);
14361436         }
14371437         break;
14381438      case 0x0080/4:
14391439         if( (mem_mask) & 0x000000ff )
14401440         {
1441            gb_sound_w(gb_device, 0x14, data);
1441            gb_sound_w(gb_device, space, 0x14, data);
14421442         }
14431443         if( (mem_mask) & 0x0000ff00 )
14441444         {
1445            gb_sound_w(gb_device, 0x15, data>>8);
1445            gb_sound_w(gb_device, space, 0x15, data>>8);
14461446         }
14471447
14481448         if ((mem_mask) & 0xffff0000)
r17961r17962
14831483            dac_device *gb_b_l = machine().device<dac_device>("direct_b_left");
14841484            dac_device *gb_b_r = machine().device<dac_device>("direct_b_right");
14851485
1486            gb_sound_w(gb_device, 0x16, data);
1486            gb_sound_w(gb_device, space, 0x16, data);
14871487            if ((data & 0x80) && !(m_SOUNDCNT_X & 0x80))
14881488            {
14891489               m_fifo_a_ptr = m_fifo_a_in = 17;
r17961r17962
15101510      case 0x0090/4:
15111511         if( (mem_mask) & 0x000000ff )
15121512         {
1513            gb_wave_w(gb_device, 0, data);
1513            gb_wave_w(gb_device, space, 0, data);
15141514         }
15151515         if( (mem_mask) & 0x0000ff00 )
15161516         {
1517            gb_wave_w(gb_device, 1, data>>8);
1517            gb_wave_w(gb_device, space, 1, data>>8);
15181518         }
15191519         if( (mem_mask) & 0x00ff0000 )
15201520         {
1521            gb_wave_w(gb_device, 2, data>>16);
1521            gb_wave_w(gb_device, space, 2, data>>16);
15221522         }
15231523         if( (mem_mask) & 0xff000000 )
15241524         {
1525            gb_wave_w(gb_device, 3, data>>24);
1525            gb_wave_w(gb_device, space, 3, data>>24);
15261526         }
15271527         break;
15281528      case 0x0094/4:
15291529         if( (mem_mask) & 0x000000ff )
15301530         {
1531            gb_wave_w(gb_device, 4, data);
1531            gb_wave_w(gb_device, space, 4, data);
15321532         }
15331533         if( (mem_mask) & 0x0000ff00 )
15341534         {
1535            gb_wave_w(gb_device, 5, data>>8);
1535            gb_wave_w(gb_device, space, 5, data>>8);
15361536         }
15371537         if( (mem_mask) & 0x00ff0000 )
15381538         {
1539            gb_wave_w(gb_device, 6, data>>16);
1539            gb_wave_w(gb_device, space, 6, data>>16);
15401540         }
15411541         if( (mem_mask) & 0xff000000 )
15421542         {
1543            gb_wave_w(gb_device, 7, data>>24);
1543            gb_wave_w(gb_device, space, 7, data>>24);
15441544         }
15451545         break;
15461546      case 0x0098/4:
15471547         if( (mem_mask) & 0x000000ff )
15481548         {
1549            gb_wave_w(gb_device, 8, data);
1549            gb_wave_w(gb_device, space, 8, data);
15501550         }
15511551         if( (mem_mask) & 0x0000ff00 )
15521552         {
1553            gb_wave_w(gb_device, 9, data>>8);
1553            gb_wave_w(gb_device, space, 9, data>>8);
15541554         }
15551555         if( (mem_mask) & 0x00ff0000 )
15561556         {
1557            gb_wave_w(gb_device, 0xa, data>>16);
1557            gb_wave_w(gb_device, space, 0xa, data>>16);
15581558         }
15591559         if( (mem_mask) & 0xff000000 )
15601560         {
1561            gb_wave_w(gb_device, 0xb, data>>24);
1561            gb_wave_w(gb_device, space, 0xb, data>>24);
15621562         }
15631563         break;
15641564      case 0x009c/4:
15651565         if( (mem_mask) & 0x000000ff )
15661566         {
1567            gb_wave_w(gb_device, 0xc, data);
1567            gb_wave_w(gb_device, space, 0xc, data);
15681568         }
15691569         if( (mem_mask) & 0x0000ff00 )
15701570         {
1571            gb_wave_w(gb_device, 0xd, data>>8);
1571            gb_wave_w(gb_device, space, 0xd, data>>8);
15721572         }
15731573         if( (mem_mask) & 0x00ff0000 )
15741574         {
1575            gb_wave_w(gb_device, 0xe, data>>16);
1575            gb_wave_w(gb_device, space, 0xe, data>>16);
15761576         }
15771577         if( (mem_mask) & 0xff000000 )
15781578         {
1579            gb_wave_w(gb_device, 0xf, data>>24);
1579            gb_wave_w(gb_device, space, 0xf, data>>24);
15801580         }
15811581         break;
15821582      case 0x00a0/4:
trunk/src/mess/drivers/vixen.c
r17961r17962
557557   m_256 = BIT(data, 4);
558558
559559   // beep enable
560   discrete_sound_w(m_discrete, NODE_01, BIT(data, 5));
560   discrete_sound_w(m_discrete, space, NODE_01, BIT(data, 5));
561561}
562562
563563static I8155_INTERFACE( i8155_intf )

Previous 199869 Revisions Next


© 1997-2024 The MAME Team