From 66cf70ac29f954ae0c47367e86b3d93aadabafb8 Mon Sep 17 00:00:00 2001 From: Ivan Vangelista Date: Fri, 27 May 2016 18:49:47 +0200 Subject: some more gen_latch.cpp (nw) --- src/mame/drivers/aeroboto.cpp | 16 ++++++++++------ src/mame/drivers/aquarium.cpp | 7 ++++--- src/mame/drivers/argus.cpp | 17 ++++++++++++----- src/mame/drivers/blueprnt.cpp | 6 ++++-- src/mame/drivers/capbowl.cpp | 6 ++++-- src/mame/drivers/cischeat.cpp | 15 +++++++++------ src/mame/drivers/citycon.cpp | 12 ++++++++---- src/mame/drivers/crospang.cpp | 6 ++++-- src/mame/drivers/ddayjlc.cpp | 20 +++++++++++++------- src/mame/drivers/ddenlovr.cpp | 13 +++++++++---- src/mame/drivers/diverboy.cpp | 26 ++++++++++++++++---------- src/mame/drivers/dooyong.cpp | 35 ++++++++++++++++++++++------------- src/mame/drivers/exerion.cpp | 9 ++++++--- src/mame/drivers/fantland.cpp | 19 +++++++++++++------ src/mame/drivers/fcombat.cpp | 7 +++++-- src/mame/drivers/fuukifg2.cpp | 7 ++++--- src/mame/drivers/gaelco.cpp | 6 ++++-- src/mame/drivers/gameplan.cpp | 8 ++++---- src/mame/drivers/ghosteo.cpp | 21 ++++++++++++--------- src/mame/drivers/ginganin.cpp | 4 +++- src/mame/drivers/lordgun.cpp | 20 ++++++++++++-------- src/mame/drivers/m107.cpp | 8 +++++--- src/mame/drivers/m63.cpp | 34 +++++++++++++++++++++------------- src/mame/drivers/m72.cpp | 10 ++++++---- src/mame/drivers/m90.cpp | 10 ++++++---- src/mame/drivers/m92.cpp | 8 +++++--- src/mame/drivers/momoko.cpp | 7 +++++-- src/mame/drivers/ms32.cpp | 12 +++++++----- src/mame/drivers/mugsmash.cpp | 6 ++++-- src/mame/drivers/olibochu.cpp | 19 +++++++++++++------ src/mame/drivers/pgm.cpp | 25 +++++++++++++++---------- src/mame/drivers/pokechmp.cpp | 8 +++++--- src/mame/drivers/ppmast93.cpp | 7 +++++-- src/mame/drivers/psychic5.cpp | 13 +++++++++---- src/mame/drivers/pturn.cpp | 11 ++++++++--- src/mame/drivers/redalert.cpp | 2 +- src/mame/drivers/royalmah.cpp | 12 +++++++++--- src/mame/drivers/shisen.cpp | 4 +++- src/mame/drivers/silvmil.cpp | 9 +++++++-- src/mame/drivers/skyfox.cpp | 6 ++++-- src/mame/drivers/spartanxtec.cpp | 18 ++++++++++-------- src/mame/drivers/splash.cpp | 18 ++++++++++++------ src/mame/drivers/spyhuntertec.cpp | 11 ++++++++--- src/mame/drivers/tetrisp2.cpp | 8 +++++--- src/mame/drivers/vegaeo.cpp | 12 +++++++++--- src/mame/drivers/vigilant.cpp | 10 ++++++++-- 46 files changed, 368 insertions(+), 200 deletions(-) (limited to 'src/mame/drivers') diff --git a/src/mame/drivers/aeroboto.cpp b/src/mame/drivers/aeroboto.cpp index 39f96ae7375..6dd3b35dbdc 100644 --- a/src/mame/drivers/aeroboto.cpp +++ b/src/mame/drivers/aeroboto.cpp @@ -26,6 +26,7 @@ Revisions: #include "emu.h" #include "cpu/m6809/m6809.h" +#include "machine/gen_latch.h" #include "sound/ay8910.h" #include "includes/aeroboto.h" @@ -81,8 +82,8 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, aeroboto_state ) AM_RANGE(0x2900, 0x2fff) AM_WRITENOP // cleared along with sprite RAM AM_RANGE(0x2973, 0x2973) AM_READ(aeroboto_2973_r) // protection read AM_RANGE(0x3000, 0x3000) AM_READWRITE(aeroboto_in0_r, aeroboto_3000_w) - AM_RANGE(0x3001, 0x3001) AM_READ_PORT("DSW1") AM_WRITE(soundlatch_byte_w) - AM_RANGE(0x3002, 0x3002) AM_READ_PORT("DSW2") AM_WRITE(soundlatch2_byte_w) + AM_RANGE(0x3001, 0x3001) AM_READ_PORT("DSW1") AM_DEVWRITE("soundlatch", generic_latch_8_device, write) + AM_RANGE(0x3002, 0x3002) AM_READ_PORT("DSW2") AM_DEVWRITE("soundlatch2", generic_latch_8_device, write) AM_RANGE(0x3003, 0x3003) AM_WRITEONLY AM_SHARE("vscroll") AM_RANGE(0x3004, 0x3004) AM_READ(aeroboto_201_r) AM_WRITEONLY AM_SHARE("starx") AM_RANGE(0x3005, 0x3005) AM_WRITEONLY AM_SHARE("stary") // usable but probably wrong @@ -259,9 +260,12 @@ static MACHINE_CONFIG_START( formatz, aeroboto_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_GENERIC_LATCH_8_ADD("soundlatch") + MCFG_GENERIC_LATCH_8_ADD("soundlatch2") + MCFG_SOUND_ADD("ay1", AY8910, XTAL_10MHz/8) /* verified on pcb */ - MCFG_AY8910_PORT_A_READ_CB(READ8(driver_device, soundlatch_byte_r)) - MCFG_AY8910_PORT_B_READ_CB(READ8(driver_device, soundlatch2_byte_r)) + MCFG_AY8910_PORT_A_READ_CB(DEVREAD8("soundlatch", generic_latch_8_device, read)) + MCFG_AY8910_PORT_B_READ_CB(DEVREAD8("soundlatch2", generic_latch_8_device, read)) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) MCFG_SOUND_ADD("ay2", AY8910, XTAL_10MHz/16) /* verified on pcb */ @@ -330,5 +334,5 @@ ROM_END -GAME( 1984, formatz, 0, formatz, formatz, driver_device, 0, ROT0, "Jaleco", "Formation Z", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_GRAPHICS ) -GAME( 1984, aeroboto, formatz, formatz, formatz, driver_device, 0, ROT0, "Jaleco (Williams license)", "Aeroboto", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_GRAPHICS ) +GAME( 1984, formatz, 0, formatz, formatz, driver_device, 0, ROT0, "Jaleco", "Formation Z", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) +GAME( 1984, aeroboto, formatz, formatz, formatz, driver_device, 0, ROT0, "Jaleco (Williams license)", "Aeroboto", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/aquarium.cpp b/src/mame/drivers/aquarium.cpp index c8f0d7fb4b1..07d4dc17321 100644 --- a/src/mame/drivers/aquarium.cpp +++ b/src/mame/drivers/aquarium.cpp @@ -37,7 +37,6 @@ Notes: #include "cpu/z80/z80.h" #include "cpu/m68000/m68000.h" #include "sound/2151intf.h" -#include "sound/okim6295.h" #include "includes/aquarium.h" @@ -60,7 +59,7 @@ WRITE16_MEMBER(aquarium_state::aquarium_sound_w) { // popmessage("sound write %04x",data); - soundlatch_byte_w(space, 1, data & 0xff); + m_soundlatch->write(space, 1, data & 0xff); m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE ); } @@ -137,7 +136,7 @@ static ADDRESS_MAP_START( snd_portmap, AS_IO, 8, aquarium_state ) ADDRESS_MAP_GLOBAL_MASK(0xff) AM_RANGE(0x00, 0x01) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write) AM_RANGE(0x02, 0x02) AM_READWRITE(aquarium_oki_r, aquarium_oki_w) - AM_RANGE(0x04, 0x04) AM_READ(soundlatch_byte_r) + AM_RANGE(0x04, 0x04) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_RANGE(0x06, 0x06) AM_WRITE(aquarium_snd_ack_w) AM_RANGE(0x08, 0x08) AM_WRITE(aquarium_z80_bank_w) ADDRESS_MAP_END @@ -334,6 +333,8 @@ static MACHINE_CONFIG_START( aquarium, aquarium_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") + MCFG_GENERIC_LATCH_8_ADD("soundlatch") + MCFG_YM2151_ADD("ymsnd", XTAL_14_31818MHz/4) // clock not verified on pcb MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0)) MCFG_SOUND_ROUTE(0, "lspeaker", 0.45) diff --git a/src/mame/drivers/argus.cpp b/src/mame/drivers/argus.cpp index b6c6cf16e95..36e9d6606ce 100644 --- a/src/mame/drivers/argus.cpp +++ b/src/mame/drivers/argus.cpp @@ -121,6 +121,7 @@ Known issues : #include "emu.h" #include "cpu/z80/z80.h" +#include "machine/gen_latch.h" #include "sound/2203intf.h" #include "includes/argus.h" @@ -185,7 +186,7 @@ static ADDRESS_MAP_START( argus_map, AS_PROGRAM, 8, argus_state ) AM_RANGE(0xc002, 0xc002) AM_READ_PORT("P2") AM_RANGE(0xc003, 0xc003) AM_READ_PORT("DSW1") AM_RANGE(0xc004, 0xc004) AM_READ_PORT("DSW2") - AM_RANGE(0xc200, 0xc200) AM_WRITE(soundlatch_byte_w) + AM_RANGE(0xc200, 0xc200) AM_DEVWRITE("soundlatch", generic_latch_8_device, write) AM_RANGE(0xc201, 0xc201) AM_WRITE(flipscreen_w) AM_RANGE(0xc202, 0xc202) AM_WRITE(bankselect_w) AM_RANGE(0xc300, 0xc301) AM_RAM AM_SHARE("bg0_scrollx") @@ -209,7 +210,7 @@ static ADDRESS_MAP_START( valtric_map, AS_PROGRAM, 8, argus_state ) AM_RANGE(0xc002, 0xc002) AM_READ_PORT("P2") AM_RANGE(0xc003, 0xc003) AM_READ_PORT("DSW1") AM_RANGE(0xc004, 0xc004) AM_READ_PORT("DSW2") - AM_RANGE(0xc200, 0xc200) AM_WRITE(soundlatch_byte_w) + AM_RANGE(0xc200, 0xc200) AM_DEVWRITE("soundlatch", generic_latch_8_device, write) AM_RANGE(0xc201, 0xc201) AM_WRITE(flipscreen_w) AM_RANGE(0xc202, 0xc202) AM_WRITE(bankselect_w) AM_RANGE(0xc300, 0xc300) AM_WRITE(valtric_unknown_w) @@ -234,7 +235,7 @@ static ADDRESS_MAP_START( butasan_map, AS_PROGRAM, 8, argus_state ) AM_RANGE(0xc003, 0xc003) AM_READ_PORT("DSW1") AM_RANGE(0xc004, 0xc004) AM_READ_PORT("DSW2") AM_RANGE(0xc100, 0xc100) AM_WRITE(butasan_unknown_w) - AM_RANGE(0xc200, 0xc200) AM_WRITE(soundlatch_byte_w) + AM_RANGE(0xc200, 0xc200) AM_DEVWRITE("soundlatch", generic_latch_8_device, write) AM_RANGE(0xc201, 0xc201) AM_WRITE(flipscreen_w) AM_RANGE(0xc202, 0xc202) AM_WRITE(bankselect_w) AM_RANGE(0xc203, 0xc203) AM_WRITE(butasan_pageselect_w) @@ -255,13 +256,13 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( sound_map_a, AS_PROGRAM, 8, argus_state ) AM_RANGE(0x0000, 0x7fff) AM_ROM AM_RANGE(0x8000, 0x87ff) AM_RAM - AM_RANGE(0xc000, 0xc000) AM_READ(soundlatch_byte_r) + AM_RANGE(0xc000, 0xc000) AM_DEVREAD("soundlatch", generic_latch_8_device, read) ADDRESS_MAP_END static ADDRESS_MAP_START( sound_map_b, AS_PROGRAM, 8, argus_state ) AM_RANGE(0x0000, 0xbfff) AM_ROM AM_RANGE(0xc000, 0xc7ff) AM_RAM - AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_byte_r) + AM_RANGE(0xe000, 0xe000) AM_DEVREAD("soundlatch", generic_latch_8_device, read) ADDRESS_MAP_END #if 0 @@ -559,6 +560,8 @@ static MACHINE_CONFIG_START( argus, argus_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_GENERIC_LATCH_8_ADD("soundlatch") + MCFG_SOUND_ADD("ym1", YM2203, 6000000 / 4) MCFG_YM2203_IRQ_HANDLER(INPUTLINE("audiocpu", 0)) MCFG_SOUND_ROUTE(0, "mono", 0.15) @@ -605,6 +608,8 @@ static MACHINE_CONFIG_START( valtric, argus_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_GENERIC_LATCH_8_ADD("soundlatch") + MCFG_SOUND_ADD("ym1", YM2203, 6000000 / 4) MCFG_YM2203_IRQ_HANDLER(INPUTLINE("audiocpu", 0)) MCFG_SOUND_ROUTE(0, "mono", 0.15) @@ -651,6 +656,8 @@ static MACHINE_CONFIG_START( butasan, argus_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_GENERIC_LATCH_8_ADD("soundlatch") + MCFG_SOUND_ADD("ym1", YM2203, 6000000 / 4) MCFG_YM2203_IRQ_HANDLER(INPUTLINE("audiocpu", 0)) MCFG_SOUND_ROUTE(0, "mono", 0.30) diff --git a/src/mame/drivers/blueprnt.cpp b/src/mame/drivers/blueprnt.cpp index f318bcf649a..6de7c1437a4 100644 --- a/src/mame/drivers/blueprnt.cpp +++ b/src/mame/drivers/blueprnt.cpp @@ -80,7 +80,7 @@ READ8_MEMBER(blueprnt_state::grasspin_sh_dipsw_r) WRITE8_MEMBER(blueprnt_state::blueprnt_sound_command_w) { - soundlatch_byte_w(space, offset, data); + m_soundlatch->write(space, offset, data); m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); } @@ -371,8 +371,10 @@ static MACHINE_CONFIG_START( blueprnt, blueprnt_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_GENERIC_LATCH_8_ADD("soundlatch") + MCFG_SOUND_ADD("ay1", AY8910, 10000000/2/2/2) - MCFG_AY8910_PORT_B_READ_CB(READ8(driver_device, soundlatch_byte_r)) + MCFG_AY8910_PORT_B_READ_CB(DEVREAD8("soundlatch", generic_latch_8_device, read)) MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(blueprnt_state, dipsw_w)) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) diff --git a/src/mame/drivers/capbowl.cpp b/src/mame/drivers/capbowl.cpp index 1512534c7c4..52f37d5266e 100644 --- a/src/mame/drivers/capbowl.cpp +++ b/src/mame/drivers/capbowl.cpp @@ -195,7 +195,7 @@ WRITE8_MEMBER(capbowl_state::track_reset_w) WRITE8_MEMBER(capbowl_state::sndcmd_w) { m_audiocpu->set_input_line(M6809_IRQ_LINE, HOLD_LINE); - soundlatch_byte_w(space, offset, data); + m_soundlatch->write(space, offset, data); } @@ -244,7 +244,7 @@ static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, capbowl_state ) AM_RANGE(0x1000, 0x1001) AM_DEVREADWRITE("ymsnd", ym2203_device, read, write) AM_RANGE(0x2000, 0x2000) AM_WRITENOP /* watchdog */ AM_RANGE(0x6000, 0x6000) AM_DEVWRITE("dac", dac_device, write_unsigned8) - AM_RANGE(0x7000, 0x7000) AM_READ(soundlatch_byte_r) + AM_RANGE(0x7000, 0x7000) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_RANGE(0x8000, 0xffff) AM_ROM ADDRESS_MAP_END @@ -343,6 +343,8 @@ static MACHINE_CONFIG_START( capbowl, capbowl_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_GENERIC_LATCH_8_ADD("soundlatch") + MCFG_SOUND_ADD("ymsnd", YM2203, MASTER_CLOCK/2) MCFG_YM2203_IRQ_HANDLER(INPUTLINE("audiocpu", M6809_FIRQ_LINE)) MCFG_AY8910_PORT_A_READ_CB(DEVREAD8("ticket", ticket_dispenser_device, read)) diff --git a/src/mame/drivers/cischeat.cpp b/src/mame/drivers/cischeat.cpp index e0489d75491..e36cde2e1b8 100644 --- a/src/mame/drivers/cischeat.cpp +++ b/src/mame/drivers/cischeat.cpp @@ -765,8 +765,8 @@ WRITE16_MEMBER(cischeat_state::bigrun_soundbank_w) static ADDRESS_MAP_START( bigrun_sound_map, AS_PROGRAM, 16, cischeat_state ) AM_RANGE(0x000000, 0x03ffff) AM_ROM // ROM - AM_RANGE(0x040000, 0x040001) AM_READ(soundlatch_word_r) AM_WRITE(bigrun_soundbank_w) // From Main CPU - AM_RANGE(0x060000, 0x060001) AM_WRITE(soundlatch2_word_w) // To Main CPU + AM_RANGE(0x040000, 0x040001) AM_DEVREAD("soundlatch", generic_latch_16_device, read) AM_WRITE(bigrun_soundbank_w) // From Main CPU + AM_RANGE(0x060000, 0x060001) AM_DEVREAD("soundlatch2", generic_latch_16_device, read) // To Main CPU AM_RANGE(0x080000, 0x080003) AM_DEVREADWRITE8("ymsnd", ym2151_device, read, write, 0x00ff) AM_RANGE(0x0a0000, 0x0a0003) AM_DEVREADWRITE8("oki1", okim6295_device, read, write, 0x00ff) AM_RANGE(0x0c0000, 0x0c0003) AM_DEVREADWRITE8("oki2", okim6295_device, read, write, 0x00ff) @@ -791,8 +791,8 @@ static ADDRESS_MAP_START( cischeat_sound_map, AS_PROGRAM, 16, cischeat_state ) AM_RANGE(0x000000, 0x03ffff) AM_ROM // ROM AM_RANGE(0x040002, 0x040003) AM_WRITE(cischeat_soundbank_1_w) // Sample Banking AM_RANGE(0x040004, 0x040005) AM_WRITE(cischeat_soundbank_2_w) // Sample Banking - AM_RANGE(0x060002, 0x060003) AM_WRITE(soundlatch2_word_w) // To Main CPU - AM_RANGE(0x060004, 0x060005) AM_READ(soundlatch_word_r) // From Main CPU + AM_RANGE(0x060002, 0x060003) AM_DEVREAD("soundlatch2", generic_latch_16_device, read) // To Main CPU + AM_RANGE(0x060004, 0x060005) AM_DEVREAD("soundlatch", generic_latch_16_device, read) // From Main CPU AM_RANGE(0x080000, 0x080003) AM_DEVREADWRITE8("ymsnd", ym2151_device, read, write, 0x00ff) AM_RANGE(0x0a0000, 0x0a0003) AM_DEVREADWRITE8("oki1", okim6295_device, read, write, 0x00ff) AM_RANGE(0x0c0000, 0x0c0003) AM_DEVREADWRITE8("oki2", okim6295_device, read, write, 0x00ff) @@ -808,7 +808,7 @@ static ADDRESS_MAP_START( f1gpstar_sound_map, AS_PROGRAM, 16, cischeat_state ) AM_RANGE(0x000000, 0x03ffff) AM_ROM // ROM AM_RANGE(0x040004, 0x040005) AM_WRITE(cischeat_soundbank_1_w) // Sample Banking (cischeat: 40002) AM_RANGE(0x040008, 0x040009) AM_WRITE(cischeat_soundbank_2_w) // Sample Banking (cischeat: 40004) - AM_RANGE(0x060000, 0x060001) AM_READWRITE(soundlatch_word_r, soundlatch2_word_w) // From Main CPU (cischeat: 60004) + AM_RANGE(0x060000, 0x060001) AM_DEVREAD("soundlatch", generic_latch_16_device, read) AM_DEVWRITE("soundlatch2", generic_latch_16_device, write) // From Main CPU (cischeat: 60004) AM_RANGE(0x080000, 0x080003) AM_DEVREADWRITE8("ymsnd", ym2151_device, read, write, 0x00ff) AM_RANGE(0x0a0000, 0x0a0003) AM_DEVREADWRITE8("oki1", okim6295_device, read, write, 0x00ff) AM_RANGE(0x0c0000, 0x0c0003) AM_DEVREADWRITE8("oki2", okim6295_device, read, write, 0x00ff) @@ -825,7 +825,7 @@ static ADDRESS_MAP_START( f1gpstr2_sound_map, AS_PROGRAM, 16, cischeat_state ) AM_RANGE(0x040004, 0x040005) AM_WRITE(cischeat_soundbank_1_w) // Sample Banking AM_RANGE(0x040008, 0x040009) AM_WRITE(cischeat_soundbank_2_w) // Sample Banking AM_RANGE(0x04000e, 0x04000f) AM_WRITENOP // ? 0 (f1gpstar: no) - AM_RANGE(0x060004, 0x060005) AM_READWRITE(soundlatch_word_r, soundlatch2_word_w) // From Main CPU (f1gpstar: 60000) + AM_RANGE(0x060004, 0x060005) AM_DEVREAD("soundlatch", generic_latch_16_device, read) AM_DEVWRITE("soundlatch2", generic_latch_16_device, write) // From Main CPU (f1gpstar: 60000) AM_RANGE(0x080000, 0x080003) AM_DEVREADWRITE8("ymsnd", ym2151_device, read, write, 0x00ff) AM_RANGE(0x0a0000, 0x0a0003) AM_DEVREADWRITE8("oki1", okim6295_device, read, write, 0x00ff) AM_RANGE(0x0c0000, 0x0c0003) AM_DEVREADWRITE8("oki2", okim6295_device, read, write, 0x00ff) @@ -1761,6 +1761,9 @@ static MACHINE_CONFIG_START( bigrun, cischeat_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") + MCFG_GENERIC_LATCH_16_ADD("soundlatch") + MCFG_GENERIC_LATCH_16_ADD("soundlatch2") + MCFG_YM2151_ADD("ymsnd", STD_FM_CLOCK) MCFG_SOUND_ROUTE(0, "lspeaker", 0.50) MCFG_SOUND_ROUTE(1, "rspeaker", 0.50) diff --git a/src/mame/drivers/citycon.cpp b/src/mame/drivers/citycon.cpp index cd908b3acb5..8deef5b4e23 100644 --- a/src/mame/drivers/citycon.cpp +++ b/src/mame/drivers/citycon.cpp @@ -11,6 +11,7 @@ Dip locations added from dip listing at crazykong.com #include "emu.h" #include "cpu/m6809/m6809.h" +#include "machine/gen_latch.h" #include "sound/ay8910.h" #include "sound/2203intf.h" #include "includes/citycon.h" @@ -35,8 +36,8 @@ static ADDRESS_MAP_START( citycon_map, AS_PROGRAM, 8, citycon_state ) AM_RANGE(0x2800, 0x28ff) AM_RAM AM_SHARE("spriteram") AM_RANGE(0x2800, 0x2fff) AM_NOP //0x2900-0x2fff cleared at post but unused AM_RANGE(0x3000, 0x3000) AM_READ(citycon_in_r) AM_WRITE(citycon_background_w) /* player 1 & 2 inputs multiplexed */ - AM_RANGE(0x3001, 0x3001) AM_READ_PORT("DSW1") AM_WRITE(soundlatch_byte_w) - AM_RANGE(0x3002, 0x3002) AM_READ_PORT("DSW2") AM_WRITE(soundlatch2_byte_w) + AM_RANGE(0x3001, 0x3001) AM_READ_PORT("DSW1") AM_DEVWRITE("soundlatch", generic_latch_8_device, write) + AM_RANGE(0x3002, 0x3002) AM_READ_PORT("DSW2") AM_DEVWRITE("soundlatch2", generic_latch_8_device, write) AM_RANGE(0x3004, 0x3005) AM_READNOP AM_WRITEONLY AM_SHARE("scroll") AM_RANGE(0x3007, 0x3007) AM_READ(citycon_irq_ack_r) AM_RANGE(0x3800, 0x3cff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") @@ -210,12 +211,15 @@ static MACHINE_CONFIG_START( citycon, citycon_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_GENERIC_LATCH_8_ADD("soundlatch") + MCFG_GENERIC_LATCH_8_ADD("soundlatch2") + MCFG_SOUND_ADD("aysnd", AY8910, 1250000) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40) MCFG_SOUND_ADD("ymsnd", YM2203, 1250000) - MCFG_AY8910_PORT_A_READ_CB(READ8(driver_device, soundlatch_byte_r)) - MCFG_AY8910_PORT_B_READ_CB(READ8(driver_device, soundlatch2_byte_r)) + MCFG_AY8910_PORT_A_READ_CB(DEVREAD8("soundlatch", generic_latch_8_device, read)) + MCFG_AY8910_PORT_B_READ_CB(DEVREAD8("soundlatch2", generic_latch_8_device, read)) MCFG_SOUND_ROUTE(0, "mono", 0.40) MCFG_SOUND_ROUTE(1, "mono", 0.40) MCFG_SOUND_ROUTE(2, "mono", 0.40) diff --git a/src/mame/drivers/crospang.cpp b/src/mame/drivers/crospang.cpp index 472abdbd0e2..e75a6ff015b 100644 --- a/src/mame/drivers/crospang.cpp +++ b/src/mame/drivers/crospang.cpp @@ -44,7 +44,7 @@ WRITE16_MEMBER(crospang_state::crospang_soundlatch_w) { if(ACCESSING_BITS_0_7) { - soundlatch_byte_w(space, 0, data & 0xff); + m_soundlatch->write(space, 0, data & 0xff); } } @@ -114,7 +114,7 @@ static ADDRESS_MAP_START( crospang_sound_io_map, AS_IO, 8, crospang_state ) ADDRESS_MAP_GLOBAL_MASK(0xff) AM_RANGE(0x00, 0x01) AM_DEVREADWRITE("ymsnd", ym3812_device, read, write) AM_RANGE(0x02, 0x02) AM_DEVREADWRITE("oki", okim6295_device, read, write) - AM_RANGE(0x06, 0x06) AM_READ(soundlatch_byte_r) + AM_RANGE(0x06, 0x06) AM_DEVREAD("soundlatch", generic_latch_8_device, read) ADDRESS_MAP_END @@ -377,6 +377,8 @@ static MACHINE_CONFIG_START( crospang, crospang_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_GENERIC_LATCH_8_ADD("soundlatch") + MCFG_SOUND_ADD("ymsnd", YM3812, 14318180/4) MCFG_YM3812_IRQ_HANDLER(INPUTLINE("audiocpu", 0)) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) diff --git a/src/mame/drivers/ddayjlc.cpp b/src/mame/drivers/ddayjlc.cpp index bb1c5b88c83..d2530b8d090 100644 --- a/src/mame/drivers/ddayjlc.cpp +++ b/src/mame/drivers/ddayjlc.cpp @@ -55,6 +55,7 @@ $842f = lives #include "emu.h" #include "cpu/z80/z80.h" +#include "machine/gen_latch.h" #include "sound/ay8910.h" @@ -67,10 +68,11 @@ public: m_spriteram(*this, "spriteram"), m_videoram(*this, "videoram"), m_bgram(*this, "bgram"), - m_audiocpu(*this, "audiocpu"), m_maincpu(*this, "maincpu"), + m_audiocpu(*this, "audiocpu"), m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette") { } + m_palette(*this, "palette"), + m_soundlatch(*this, "soundlatch") { } /* memory pointers */ required_shared_ptr m_mainram; @@ -91,7 +93,12 @@ public: UINT8 m_prot_addr; /* devices */ + required_device m_maincpu; required_device m_audiocpu; + required_device m_gfxdecode; + required_device m_palette; + required_device m_soundlatch; + DECLARE_WRITE8_MEMBER(prot_w); DECLARE_WRITE8_MEMBER(char_bank_w); DECLARE_WRITE8_MEMBER(ddayjlc_bgram_w); @@ -114,9 +121,6 @@ public: UINT32 screen_update_ddayjlc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(ddayjlc_interrupt); INTERRUPT_GEN_MEMBER(ddayjlc_snd_interrupt); - required_device m_maincpu; - required_device m_gfxdecode; - required_device m_palette; }; @@ -224,7 +228,7 @@ WRITE8_MEMBER(ddayjlc_state::bg2_w) WRITE8_MEMBER(ddayjlc_state::sound_w) { - soundlatch_byte_w(space, offset, data); + m_soundlatch->write(space, offset, data); m_audiocpu->set_input_line_and_vector(0, HOLD_LINE, 0xff); } @@ -533,8 +537,10 @@ static MACHINE_CONFIG_START( ddayjlc, ddayjlc_state ) MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_GENERIC_LATCH_8_ADD("soundlatch") + MCFG_SOUND_ADD("ay1", AY8910, 12000000/6) - MCFG_AY8910_PORT_A_READ_CB(READ8(driver_device, soundlatch_byte_r)) + MCFG_AY8910_PORT_A_READ_CB(DEVREAD8("soundlatch", generic_latch_8_device, read)) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) MCFG_SOUND_ADD("ay2", AY8910, 12000000/6) diff --git a/src/mame/drivers/ddenlovr.cpp b/src/mame/drivers/ddenlovr.cpp index 08cf58cde18..725411052d8 100644 --- a/src/mame/drivers/ddenlovr.cpp +++ b/src/mame/drivers/ddenlovr.cpp @@ -116,6 +116,7 @@ Notes: #include "cpu/m68000/m68000.h" #include "cpu/z80/z80.h" #include "sound/ay8910.h" +#include "machine/gen_latch.h" #include "machine/msm6242.h" #include "machine/nvram.h" #include "includes/dynax.h" @@ -160,13 +161,15 @@ public: : dynax_state(mconfig, type, tag), m_dsw_sel16(*this, "dsw_sel16"), m_protection1(*this, "protection1"), - m_protection2(*this, "protection2") { } + m_protection2(*this, "protection2"), + m_soundlatch(*this, "soundlatch") { } optional_shared_ptr m_dsw_sel16; optional_shared_ptr m_protection1; optional_shared_ptr m_protection2; + optional_device m_soundlatch; std::unique_ptr m_ddenlovr_pixmap[8]; @@ -2415,7 +2418,7 @@ WRITE8_MEMBER(ddenlovr_state::mmpanic_rombank_w) WRITE8_MEMBER(ddenlovr_state::mmpanic_soundlatch_w) { - soundlatch_byte_w(space, 0, data); + m_soundlatch->write(space, 0, data); m_soundcpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); } @@ -2524,7 +2527,7 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( mmpanic_sound_portmap, AS_IO, 8, ddenlovr_state ) ADDRESS_MAP_GLOBAL_MASK(0xff) - AM_RANGE(0x00, 0x00) AM_READ(soundlatch_byte_r) + AM_RANGE(0x00, 0x00) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_RANGE(0x02, 0x02) AM_READNOP // read just before port 00 AM_RANGE(0x04, 0x04) AM_NOP // read only once at the start AM_RANGE(0x06, 0x06) AM_WRITENOP // almost always 1, sometimes 0 @@ -2657,7 +2660,7 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( funkyfig_sound_portmap, AS_IO, 8, ddenlovr_state ) ADDRESS_MAP_GLOBAL_MASK(0xff) - AM_RANGE(0x02, 0x02) AM_READ(soundlatch_byte_r) + AM_RANGE(0x02, 0x02) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_RANGE(0x04, 0x04) AM_READNOP // read only once at the start ADDRESS_MAP_END @@ -9953,6 +9956,8 @@ static MACHINE_CONFIG_START( mmpanic, ddenlovr_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_GENERIC_LATCH_8_ADD("soundlatch") + MCFG_SOUND_ADD("ym2413", YM2413, 3579545) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) diff --git a/src/mame/drivers/diverboy.cpp b/src/mame/drivers/diverboy.cpp index b4146901107..61af792522a 100644 --- a/src/mame/drivers/diverboy.cpp +++ b/src/mame/drivers/diverboy.cpp @@ -19,7 +19,7 @@ About the game: - The worst game i have :) Enjoy it so much as me :D + The worst game I have :) Enjoy it so much as me :D ---- @@ -51,6 +51,7 @@ #include "emu.h" #include "cpu/z80/z80.h" #include "cpu/m68000/m68000.h" +#include "machine/gen_latch.h" #include "sound/okim6295.h" @@ -61,29 +62,32 @@ public: diverboy_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), m_spriteram(*this, "spriteram"), - m_audiocpu(*this, "audiocpu"), m_maincpu(*this, "maincpu"), + m_audiocpu(*this, "audiocpu"), m_oki(*this, "oki"), m_gfxdecode(*this, "gfxdecode"), m_screen(*this, "screen"), - m_palette(*this, "palette") { } + m_palette(*this, "palette"), + m_soundlatch(*this, "soundlatch") { } /* memory pointers */ required_shared_ptr m_spriteram; /* devices */ + required_device m_maincpu; required_device m_audiocpu; + required_device m_oki; + required_device m_gfxdecode; + required_device m_screen; + required_device m_palette; + required_device m_soundlatch; + DECLARE_WRITE16_MEMBER(soundcmd_w); DECLARE_WRITE8_MEMBER(okibank_w); virtual void machine_start() override; virtual void video_start() override; UINT32 screen_update_diverboy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); - required_device m_maincpu; - required_device m_oki; - required_device m_gfxdecode; - required_device m_screen; - required_device m_palette; }; @@ -138,7 +142,7 @@ WRITE16_MEMBER(diverboy_state::soundcmd_w) { if (ACCESSING_BITS_0_7) { - soundlatch_byte_w(space, 0, data & 0xff); + m_soundlatch->write(space, 0, data & 0xff); m_audiocpu->set_input_line(0, HOLD_LINE); } } @@ -174,7 +178,7 @@ static ADDRESS_MAP_START( snd_map, AS_PROGRAM, 8, diverboy_state ) AM_RANGE(0x8000, 0x87ff) AM_RAM AM_RANGE(0x9000, 0x9000) AM_WRITE(okibank_w) AM_RANGE(0x9800, 0x9800) AM_DEVREADWRITE("oki", okim6295_device, read, write) - AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r) + AM_RANGE(0xa000, 0xa000) AM_DEVREAD("soundlatch", generic_latch_8_device, read) ADDRESS_MAP_END @@ -285,6 +289,8 @@ static MACHINE_CONFIG_START( diverboy, diverboy_state ) MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_GENERIC_LATCH_8_ADD("soundlatch") + MCFG_OKIM6295_ADD("oki", 1320000, OKIM6295_PIN7_HIGH) // clock frequency & pin 7 not verified MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) MACHINE_CONFIG_END diff --git a/src/mame/drivers/dooyong.cpp b/src/mame/drivers/dooyong.cpp index 9e439ded0a1..50ab7f5e64f 100644 --- a/src/mame/drivers/dooyong.cpp +++ b/src/mame/drivers/dooyong.cpp @@ -55,7 +55,7 @@ Interrupts are generated by both YM chips. Sound CPU checks interrupt source Due to bad timing/incorrect int line handling - interrupt is skipped if fires when another one is being processed and int line is still asserted (and not cleared). This situation results in missing or incomplete audio, -becasue one of interrupt sources is _dead_ (timer never restarts). +because one of interrupt sources is _dead_ (timer never restarts). Music tempo and audio pitch depends on (unknown) YM clocks. Sound cpu runs currently at 8 MHz to avoid jerky music when there's (too) @@ -76,6 +76,7 @@ are almost identical, except for much darker BG layer colors). #include "emu.h" #include "cpu/z80/z80.h" #include "cpu/m68000/m68000.h" +#include "machine/gen_latch.h" #include "sound/2203intf.h" #include "sound/2151intf.h" #include "sound/okim6295.h" @@ -120,7 +121,7 @@ static ADDRESS_MAP_START( lastday_map, AS_PROGRAM, 8, dooyong_z80_ym2203_state ) AM_RANGE(0xc011, 0xc011) AM_READ_PORT("P1") AM_RANGE(0xc011, 0xc011) AM_WRITE(bankswitch_w) AM_RANGE(0xc012, 0xc012) AM_READ_PORT("P2") - AM_RANGE(0xc012, 0xc012) AM_WRITE(soundlatch_byte_w) + AM_RANGE(0xc012, 0xc012) AM_DEVWRITE("soundlatch", generic_latch_8_device, write) AM_RANGE(0xc013, 0xc013) AM_READ_PORT("DSWA") AM_RANGE(0xc014, 0xc014) AM_READ_PORT("DSWB") AM_RANGE(0xc800, 0xcfff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") @@ -141,7 +142,7 @@ static ADDRESS_MAP_START( pollux_map, AS_PROGRAM, 8, dooyong_z80_ym2203_state ) AM_RANGE(0xf003, 0xf003) AM_READ_PORT("P2") AM_RANGE(0xf004, 0xf004) AM_READ_PORT("SYSTEM") AM_RANGE(0xf008, 0xf008) AM_WRITE(pollux_ctrl_w) /* coin counter, flip screen */ - AM_RANGE(0xf010, 0xf010) AM_WRITE(soundlatch_byte_w) + AM_RANGE(0xf010, 0xf010) AM_DEVWRITE("soundlatch", generic_latch_8_device, write) AM_RANGE(0xf018, 0xf01f) AM_WRITE(bgscroll_w) AM_RANGE(0xf020, 0xf027) AM_WRITE(fgscroll_w) AM_RANGE(0xf800, 0xffff) AM_READWRITE(paletteram_flytiger_r, paletteram_flytiger_w) @@ -160,7 +161,7 @@ static ADDRESS_MAP_START( gulfstrm_map, AS_PROGRAM, 8, dooyong_z80_ym2203_state AM_RANGE(0xf003, 0xf003) AM_READ_PORT("P1") AM_RANGE(0xf004, 0xf004) AM_READ_PORT("SYSTEM") AM_RANGE(0xf008, 0xf008) AM_WRITE(pollux_ctrl_w) /* coin counter, flip screen */ - AM_RANGE(0xf010, 0xf010) AM_WRITE(soundlatch_byte_w) + AM_RANGE(0xf010, 0xf010) AM_DEVWRITE("soundlatch", generic_latch_8_device, write) AM_RANGE(0xf018, 0xf01f) AM_WRITE(bgscroll_w) AM_RANGE(0xf020, 0xf027) AM_WRITE(fgscroll_w) AM_RANGE(0xf800, 0xffff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") @@ -176,7 +177,7 @@ static ADDRESS_MAP_START( bluehawk_map, AS_PROGRAM, 8, dooyong_z80_state ) AM_RANGE(0xc003, 0xc003) AM_READ_PORT("P2") AM_RANGE(0xc004, 0xc004) AM_READ_PORT("SYSTEM") AM_RANGE(0xc008, 0xc008) AM_WRITE(bankswitch_w) - AM_RANGE(0xc010, 0xc010) AM_WRITE(soundlatch_byte_w) + AM_RANGE(0xc010, 0xc010) AM_DEVWRITE("soundlatch", generic_latch_8_device, write) AM_RANGE(0xc018, 0xc01f) AM_WRITE(fg2scroll_w) AM_RANGE(0xc040, 0xc047) AM_WRITE(bgscroll_w) AM_RANGE(0xc048, 0xc04f) AM_WRITE(fgscroll_w) @@ -198,7 +199,7 @@ static ADDRESS_MAP_START( flytiger_map, AS_PROGRAM, 8, dooyong_z80_state ) AM_RANGE(0xe006, 0xe006) AM_READ_PORT("DSWA") AM_RANGE(0xe008, 0xe008) AM_READ_PORT("DSWB") AM_RANGE(0xe010, 0xe010) AM_WRITE(flytiger_ctrl_w) /* coin counter, flip screen */ - AM_RANGE(0xe020, 0xe020) AM_WRITE(soundlatch_byte_w) + AM_RANGE(0xe020, 0xe020) AM_DEVWRITE("soundlatch", generic_latch_8_device, write) AM_RANGE(0xe030, 0xe037) AM_WRITE(bgscroll_w) AM_RANGE(0xe040, 0xe047) AM_WRITE(fgscroll_w) AM_RANGE(0xe800, 0xefff) AM_READWRITE(paletteram_flytiger_r, paletteram_flytiger_w) @@ -215,7 +216,7 @@ static ADDRESS_MAP_START( primella_map, AS_PROGRAM, 8, dooyong_z80_state ) AM_RANGE(0xf800, 0xf800) AM_READ_PORT("DSWA") AM_RANGE(0xf800, 0xf800) AM_WRITE(primella_ctrl_w) /* bank switch, flip screen etc */ AM_RANGE(0xf810, 0xf810) AM_READ_PORT("DSWB") - AM_RANGE(0xf810, 0xf810) AM_WRITE(soundlatch_byte_w) + AM_RANGE(0xf810, 0xf810) AM_DEVWRITE("soundlatch", generic_latch_8_device, write) AM_RANGE(0xf820, 0xf820) AM_READ_PORT("P1") AM_RANGE(0xf830, 0xf830) AM_READ_PORT("P2") AM_RANGE(0xf840, 0xf840) AM_READ_PORT("SYSTEM") @@ -235,7 +236,7 @@ static ADDRESS_MAP_START( rshark_map, AS_PROGRAM, 16, dooyong_68k_state ) AM_RANGE(0x0c4000, 0x0c400f) AM_WRITE8(bgscroll_w, 0x00ff) AM_RANGE(0x0c4010, 0x0c401f) AM_WRITE8(bg2scroll_w, 0x00ff) AM_RANGE(0x0c8000, 0x0c8fff) AM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") - AM_RANGE(0x0c0012, 0x0c0013) AM_WRITE(soundlatch_word_w) + AM_RANGE(0x0c0012, 0x0c0013) AM_DEVWRITE8("soundlatch", generic_latch_8_device, write, 0x00ff) AM_RANGE(0x0c0014, 0x0c0015) AM_WRITE(ctrl_w) /* flip screen + unknown stuff */ AM_RANGE(0x0cc000, 0x0cc00f) AM_WRITE8(fgscroll_w, 0x00ff) AM_RANGE(0x0cc010, 0x0cc01f) AM_WRITE8(fg2scroll_w, 0x00ff) @@ -253,7 +254,7 @@ static ADDRESS_MAP_START( superx_map, AS_PROGRAM, 16, dooyong_68k_state ) AM_RANGE(0x084000, 0x08400f) AM_WRITE8(bgscroll_w, 0x00ff) AM_RANGE(0x084010, 0x08401f) AM_WRITE8(bg2scroll_w, 0x00ff) AM_RANGE(0x088000, 0x088fff) AM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") - AM_RANGE(0x080012, 0x080013) AM_WRITE(soundlatch_word_w) + AM_RANGE(0x080012, 0x080013) AM_DEVWRITE8("soundlatch", generic_latch_8_device, write, 0x00ff) AM_RANGE(0x080014, 0x080015) AM_WRITE(ctrl_w) /* flip screen + unknown stuff */ AM_RANGE(0x08c000, 0x08c00f) AM_WRITE8(fgscroll_w, 0x00ff) AM_RANGE(0x08c010, 0x08c01f) AM_WRITE8(fg2scroll_w, 0x00ff) @@ -268,7 +269,7 @@ static ADDRESS_MAP_START( popbingo_map, AS_PROGRAM, 16, dooyong_68k_state ) AM_RANGE(0x0c0002, 0x0c0003) AM_READ_PORT("DSW") AM_RANGE(0x0c0004, 0x0c0005) AM_READ_PORT("P1_P2") AM_RANGE(0x0c0006, 0x0c0007) AM_READ_PORT("SYSTEM") - AM_RANGE(0x0c0012, 0x0c0013) AM_WRITE(soundlatch_word_w) + AM_RANGE(0x0c0012, 0x0c0013) AM_DEVWRITE8("soundlatch", generic_latch_8_device, write, 0x00ff) AM_RANGE(0x0c0014, 0x0c0015) AM_WRITE(ctrl_w) AM_RANGE(0x0c0018, 0x0c001b) AM_WRITENOP // ? AM_RANGE(0x0c4000, 0x0c400f) AM_WRITE8(bgscroll_w, 0x00ff) @@ -282,7 +283,7 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( lastday_sound_map, AS_PROGRAM, 8, dooyong_z80_ym2203_state ) AM_RANGE(0x0000, 0x7fff) AM_ROM AM_RANGE(0xc000, 0xc7ff) AM_RAM - AM_RANGE(0xc800, 0xc800) AM_READ(soundlatch_byte_r) + AM_RANGE(0xc800, 0xc800) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_RANGE(0xf000, 0xf001) AM_DEVREADWRITE("ym1", ym2203_device, read, write) AM_RANGE(0xf002, 0xf003) AM_DEVREADWRITE("ym2", ym2203_device, read, write) ADDRESS_MAP_END @@ -290,7 +291,7 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( pollux_sound_map, AS_PROGRAM, 8, dooyong_z80_ym2203_state ) AM_RANGE(0x0000, 0xefff) AM_ROM AM_RANGE(0xf000, 0xf7ff) AM_RAM - AM_RANGE(0xf800, 0xf800) AM_READ(soundlatch_byte_r) + AM_RANGE(0xf800, 0xf800) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_RANGE(0xf802, 0xf803) AM_DEVREADWRITE("ym1", ym2203_device, read, write) AM_RANGE(0xf804, 0xf805) AM_DEVREADWRITE("ym2", ym2203_device, read, write) ADDRESS_MAP_END @@ -298,7 +299,7 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( bluehawk_sound_map, AS_PROGRAM, 8, dooyong_state ) AM_RANGE(0x0000, 0xefff) AM_ROM AM_RANGE(0xf000, 0xf7ff) AM_RAM - AM_RANGE(0xf800, 0xf800) AM_READ(soundlatch_byte_r) + AM_RANGE(0xf800, 0xf800) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_RANGE(0xf808, 0xf809) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write) AM_RANGE(0xf80a, 0xf80a) AM_DEVREADWRITE("oki", okim6295_device, read, write) ADDRESS_MAP_END @@ -799,6 +800,8 @@ WRITE_LINE_MEMBER(dooyong_z80_ym2203_state::irqhandler_2203_2) static MACHINE_CONFIG_FRAGMENT( sound_2203 ) MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_GENERIC_LATCH_8_ADD("soundlatch") + MCFG_SOUND_ADD("ym1", YM2203, 1500000) MCFG_YM2203_IRQ_HANDLER(WRITELINE(dooyong_z80_ym2203_state, irqhandler_2203_1)) MCFG_AY8910_PORT_A_READ_CB(READ8(dooyong_z80_ym2203_state, unk_r)) @@ -813,6 +816,8 @@ MACHINE_CONFIG_END static MACHINE_CONFIG_FRAGMENT( sound_2151 ) MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_GENERIC_LATCH_8_ADD("soundlatch") + MCFG_YM2151_ADD("ymsnd", XTAL_3_579545MHz ) MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0)) MCFG_SOUND_ROUTE(0, "mono", 0.50) @@ -825,6 +830,8 @@ MACHINE_CONFIG_END static MACHINE_CONFIG_FRAGMENT( sound_2151_4mhz ) MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_GENERIC_LATCH_8_ADD("soundlatch") + MCFG_YM2151_ADD("ymsnd", XTAL_16MHz/4) /* 4MHz (16MHz/4 for most, 8Mhz/2 for Super-X) */ MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0)) MCFG_SOUND_ROUTE(0, "mono", 0.50) @@ -869,6 +876,8 @@ static MACHINE_CONFIG_START( lastday, dooyong_z80_ym2203_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_GENERIC_LATCH_8_ADD("soundlatch") + MCFG_SOUND_ADD("ym1", YM2203, XTAL_16MHz/4) /* 4MHz verified for Last Day / D-day */ MCFG_YM2203_IRQ_HANDLER(WRITELINE(dooyong_z80_ym2203_state, irqhandler_2203_1)) MCFG_AY8910_PORT_A_READ_CB(READ8(dooyong_z80_ym2203_state, unk_r)) diff --git a/src/mame/drivers/exerion.cpp b/src/mame/drivers/exerion.cpp index 925a3558d40..fb8bf40a063 100644 --- a/src/mame/drivers/exerion.cpp +++ b/src/mame/drivers/exerion.cpp @@ -6,7 +6,7 @@ **************************************************************************** - Exerion is a unique driver in that it has idiosyncracies that are straight + Exerion is a unique driver in that it has idiosyncrasies that are straight out of Bizarro World. I submit for your approval: * The mystery reads from $d802 - timer-based protection? @@ -122,6 +122,7 @@ Stephh's notes (based on the games Z80 code and some tests) : #include "emu.h" #include "cpu/z80/z80.h" #include "includes/exerion.h" +#include "machine/gen_latch.h" #include "sound/ay8910.h" @@ -199,7 +200,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, exerion_state ) AM_RANGE(0xa800, 0xa800) AM_READ_PORT("DSW0") AM_RANGE(0xb000, 0xb000) AM_READ_PORT("DSW1") AM_RANGE(0xc000, 0xc000) AM_WRITE(exerion_videoreg_w) - AM_RANGE(0xc800, 0xc800) AM_WRITE(soundlatch_byte_w) + AM_RANGE(0xc800, 0xc800) AM_DEVWRITE("soundlatch", generic_latch_8_device, write) AM_RANGE(0xd000, 0xd001) AM_DEVWRITE("ay1", ay8910_device, address_data_w) AM_RANGE(0xd800, 0xd801) AM_DEVWRITE("ay2", ay8910_device, address_data_w) AM_RANGE(0xd802, 0xd802) AM_DEVREAD("ay2", ay8910_device, data_r) @@ -216,7 +217,7 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( sub_map, AS_PROGRAM, 8, exerion_state ) AM_RANGE(0x0000, 0x1fff) AM_ROM AM_RANGE(0x4000, 0x47ff) AM_RAM - AM_RANGE(0x6000, 0x6000) AM_READ(soundlatch_byte_r) + AM_RANGE(0x6000, 0x6000) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_RANGE(0x8000, 0x800c) AM_WRITE(exerion_video_latch_w) AM_RANGE(0xa000, 0xa000) AM_READ(exerion_video_timing_r) ADDRESS_MAP_END @@ -390,6 +391,8 @@ static MACHINE_CONFIG_START( exerion, exerion_state ) /* audio hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_GENERIC_LATCH_8_ADD("soundlatch") + MCFG_SOUND_ADD("ay1", AY8910, EXERION_AY8910_CLOCK) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30) diff --git a/src/mame/drivers/fantland.cpp b/src/mame/drivers/fantland.cpp index af10ddd4bd1..dd1ebe141d7 100644 --- a/src/mame/drivers/fantland.cpp +++ b/src/mame/drivers/fantland.cpp @@ -52,7 +52,6 @@ Year + Game Main CPU Sound CPU Sound Video #include "sound/2151intf.h" #include "sound/3526intf.h" #include "sound/dac.h" -#include "sound/msm5205.h" #include "includes/fantland.h" /*************************************************************************** @@ -77,7 +76,7 @@ WRITE16_MEMBER(fantland_state::fantland_nmi_enable_16_w) WRITE8_MEMBER(fantland_state::fantland_soundlatch_w) { - soundlatch_byte_w(space, 0, data); + m_soundlatch->write(space, 0, data); m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); } @@ -294,13 +293,13 @@ static ADDRESS_MAP_START( fantland_sound_map, AS_PROGRAM, 8, fantland_state ) ADDRESS_MAP_END static ADDRESS_MAP_START( fantland_sound_iomap, AS_IO, 8, fantland_state ) - AM_RANGE( 0x0080, 0x0080 ) AM_READ(soundlatch_byte_r ) + AM_RANGE( 0x0080, 0x0080 ) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_RANGE( 0x0100, 0x0101 ) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write) AM_RANGE( 0x0180, 0x0180 ) AM_DEVWRITE("dac", dac_device, write_unsigned8 ) ADDRESS_MAP_END static ADDRESS_MAP_START( galaxygn_sound_iomap, AS_IO, 8, fantland_state ) - AM_RANGE( 0x0080, 0x0080 ) AM_READ(soundlatch_byte_r ) + AM_RANGE( 0x0080, 0x0080 ) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_RANGE( 0x0100, 0x0101 ) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write) ADDRESS_MAP_END @@ -399,7 +398,7 @@ WRITE_LINE_MEMBER(fantland_state::borntofi_adpcm_int_3) { borntofi_adpcm_int(m_m static ADDRESS_MAP_START( borntofi_sound_map, AS_PROGRAM, 8, fantland_state ) AM_RANGE( 0x00000, 0x003ff ) AM_RAM - AM_RANGE( 0x04000, 0x04000 ) AM_READ(soundlatch_byte_r) + AM_RANGE( 0x04000, 0x04000 ) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_RANGE( 0x04000, 0x0401f ) AM_WRITE(borntofi_msm5205_w) AM_RANGE( 0x08000, 0x0ffff ) AM_ROM AM_RANGE( 0xf8000, 0xfffff ) AM_ROM @@ -418,7 +417,7 @@ static ADDRESS_MAP_START( wheelrun_sound_map, AS_PROGRAM, 8, fantland_state ) AM_RANGE(0xb000, 0xb000) AM_WRITENOP // on a car crash / hit AM_RANGE(0xc000, 0xc000) AM_WRITENOP // "" - AM_RANGE(0xd000, 0xd000) AM_READ(soundlatch_byte_r ) // during NMI + AM_RANGE(0xd000, 0xd000) AM_DEVREAD("soundlatch", generic_latch_8_device, read) // during NMI ADDRESS_MAP_END @@ -870,6 +869,8 @@ static MACHINE_CONFIG_START( fantland, fantland_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_GENERIC_LATCH_8_ADD("soundlatch") + MCFG_YM2151_ADD("ymsnd", 3000000) MCFG_SOUND_ROUTE(0, "mono", 0.35) MCFG_SOUND_ROUTE(1, "mono", 0.35) @@ -915,6 +916,8 @@ static MACHINE_CONFIG_START( galaxygn, fantland_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_GENERIC_LATCH_8_ADD("soundlatch") + MCFG_YM2151_ADD("ymsnd", 3000000) MCFG_YM2151_IRQ_HANDLER(WRITELINE(fantland_state, galaxygn_sound_irq)) MCFG_SOUND_ROUTE(0, "mono", 1.0) @@ -993,6 +996,8 @@ static MACHINE_CONFIG_START( borntofi, fantland_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_GENERIC_LATCH_8_ADD("soundlatch") + // OKI M5205 running at 384kHz [18.432/48]. Sample rate = 384000 / 48 MCFG_SOUND_ADD("msm1", MSM5205, 384000) MCFG_MSM5205_VCLK_CB(WRITELINE(fantland_state, borntofi_adpcm_int_0)) /* IRQ handler */ @@ -1046,6 +1051,8 @@ static MACHINE_CONFIG_START( wheelrun, fantland_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_GENERIC_LATCH_8_ADD("soundlatch") + MCFG_SOUND_ADD("ymsnd", YM3526, XTAL_14MHz/4) MCFG_YM3526_IRQ_HANDLER(INPUTLINE("audiocpu", INPUT_LINE_IRQ0)) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) diff --git a/src/mame/drivers/fcombat.cpp b/src/mame/drivers/fcombat.cpp index cd1f0c1a03c..304f33b1e7c 100644 --- a/src/mame/drivers/fcombat.cpp +++ b/src/mame/drivers/fcombat.cpp @@ -33,6 +33,7 @@ inputs + notes by stephh #include "emu.h" #include "cpu/z80/z80.h" +#include "machine/gen_latch.h" #include "sound/ay8910.h" #include "includes/fcombat.h" @@ -126,14 +127,14 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, fcombat_state ) AM_RANGE(0xec00, 0xec00) AM_WRITE(ec00_w) AM_RANGE(0xed00, 0xed00) AM_WRITE(ed00_w) AM_RANGE(0xee00, 0xee00) AM_WRITE(ee00_w) // related to protection ? - doesn't seem to have any effect - AM_RANGE(0xef00, 0xef00) AM_WRITE(soundlatch_byte_w) + AM_RANGE(0xef00, 0xef00) AM_DEVWRITE("soundlatch", generic_latch_8_device, write) ADDRESS_MAP_END static ADDRESS_MAP_START( audio_map, AS_PROGRAM, 8, fcombat_state ) AM_RANGE(0x0000, 0x3fff) AM_ROM AM_RANGE(0x4000, 0x47ff) AM_RAM - AM_RANGE(0x6000, 0x6000) AM_READ(soundlatch_byte_r) + AM_RANGE(0x6000, 0x6000) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_RANGE(0x8001, 0x8001) AM_DEVREAD("ay1", ay8910_device, data_r) AM_RANGE(0x8002, 0x8003) AM_DEVWRITE("ay1", ay8910_device, data_address_w) AM_RANGE(0xa001, 0xa001) AM_DEVREAD("ay2", ay8910_device, data_r) @@ -306,6 +307,8 @@ static MACHINE_CONFIG_START( fcombat, fcombat_state ) /* audio hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_GENERIC_LATCH_8_ADD("soundlatch") + MCFG_SOUND_ADD("ay1", AY8910, 1500000) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.12) diff --git a/src/mame/drivers/fuukifg2.cpp b/src/mame/drivers/fuukifg2.cpp index e4796dc5f0c..35f90b55867 100644 --- a/src/mame/drivers/fuukifg2.cpp +++ b/src/mame/drivers/fuukifg2.cpp @@ -50,7 +50,6 @@ To Do: #include "cpu/m68000/m68000.h" #include "sound/2203intf.h" #include "sound/3812intf.h" -#include "sound/okim6295.h" #include "includes/fuukifg2.h" @@ -78,7 +77,7 @@ WRITE16_MEMBER(fuuki16_state::sound_command_w) { if (ACCESSING_BITS_0_7) { - soundlatch_byte_w(space,0,data & 0xff); + m_soundlatch->write(space,0,data & 0xff); m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); // space.device().execute().spin_until_time(attotime::from_usec(50)); // Allow the other CPU to reply machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(50)); // Fixes glitching in rasters @@ -139,7 +138,7 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( fuuki16_sound_io_map, AS_IO, 8, fuuki16_state ) ADDRESS_MAP_GLOBAL_MASK(0xff) AM_RANGE(0x00, 0x00) AM_WRITE(sound_rombank_w) // ROM Bank - AM_RANGE(0x11, 0x11) AM_READ(soundlatch_byte_r) AM_WRITENOP // From Main CPU / ? To Main CPU ? + AM_RANGE(0x11, 0x11) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_WRITENOP // From Main CPU / ? To Main CPU ? AM_RANGE(0x20, 0x20) AM_WRITE(oki_banking_w) // Oki Banking AM_RANGE(0x30, 0x30) AM_WRITENOP // ? In the NMI routine AM_RANGE(0x40, 0x41) AM_DEVWRITE("ym1", ym2203_device, write) @@ -469,6 +468,8 @@ static MACHINE_CONFIG_START( fuuki16, fuuki16_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") + MCFG_GENERIC_LATCH_8_ADD("soundlatch") + MCFG_SOUND_ADD("ym1", YM2203, XTAL_28_64MHz / 8) /* 3.58 MHz */ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.15) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.15) diff --git a/src/mame/drivers/gaelco.cpp b/src/mame/drivers/gaelco.cpp index 5b301f59ddc..f054f669d4d 100644 --- a/src/mame/drivers/gaelco.cpp +++ b/src/mame/drivers/gaelco.cpp @@ -37,7 +37,7 @@ WRITE16_MEMBER(gaelco_state::bigkarnk_sound_command_w) { if (ACCESSING_BITS_0_7) { - soundlatch_byte_w(space, 0, data & 0xff); + m_soundlatch->write(space, 0, data & 0xff); m_audiocpu->set_input_line(M6809_FIRQ_LINE, HOLD_LINE); } } @@ -134,7 +134,7 @@ static ADDRESS_MAP_START( bigkarnk_snd_map, AS_PROGRAM, 8, gaelco_state ) AM_RANGE(0x0800, 0x0801) AM_DEVREADWRITE("oki", okim6295_device, read, write) /* OKI6295 */ // AM_RANGE(0x0900, 0x0900) AM_WRITENOP /* enable sound output? */ AM_RANGE(0x0a00, 0x0a01) AM_DEVREADWRITE("ymsnd", ym3812_device, read, write) /* YM3812 */ - AM_RANGE(0x0b00, 0x0b00) AM_READ(soundlatch_byte_r) /* Sound latch */ + AM_RANGE(0x0b00, 0x0b00) AM_DEVREAD("soundlatch", generic_latch_8_device, read) /* Sound latch */ AM_RANGE(0x0c00, 0xffff) AM_ROM /* ROM */ ADDRESS_MAP_END @@ -533,6 +533,8 @@ static MACHINE_CONFIG_START( bigkarnk, gaelco_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_GENERIC_LATCH_8_ADD("soundlatch") + MCFG_SOUND_ADD("ymsnd", YM3812, 3580000) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) diff --git a/src/mame/drivers/gameplan.cpp b/src/mame/drivers/gameplan.cpp index 497d8b3e74a..a59919edc7c 100644 --- a/src/mame/drivers/gameplan.cpp +++ b/src/mame/drivers/gameplan.cpp @@ -78,8 +78,6 @@ TODO: #include "emu.h" #include "cpu/m6502/m6502.h" -#include "machine/6532riot.h" -#include "machine/6522via.h" #include "sound/ay8910.h" #include "includes/gameplan.h" @@ -168,7 +166,7 @@ WRITE_LINE_MEMBER(gameplan_state::r6532_irq) WRITE8_MEMBER(gameplan_state::r6532_soundlatch_w) { address_space &progspace = m_maincpu->space(AS_PROGRAM); - soundlatch_byte_w(progspace, 0, data); + m_soundlatch->write(progspace, 0, data); } @@ -978,6 +976,8 @@ static MACHINE_CONFIG_START( gameplan, gameplan_state ) /* audio hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_GENERIC_LATCH_8_ADD("soundlatch") + MCFG_SOUND_ADD("aysnd", AY8910, GAMEPLAN_AY8910_CLOCK) MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSW2")) MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSW3")) @@ -996,7 +996,7 @@ static MACHINE_CONFIG_START( gameplan, gameplan_state ) MCFG_VIA6522_CB2_HANDLER(WRITELINE(gameplan_state, coin_w)) MCFG_DEVICE_ADD("via6522_2", VIA6522, 0) - MCFG_VIA6522_READPB_HANDLER(READ8(driver_device, soundlatch_byte_r)) + MCFG_VIA6522_READPB_HANDLER(DEVREAD8("soundlatch", generic_latch_8_device, read)) MCFG_VIA6522_WRITEPA_HANDLER(WRITE8(gameplan_state, audio_cmd_w)) MCFG_VIA6522_CA2_HANDLER(WRITELINE(gameplan_state, audio_trigger_w)) MCFG_VIA6522_CB2_HANDLER(WRITELINE(gameplan_state, audio_reset_w)) diff --git a/src/mame/drivers/ghosteo.cpp b/src/mame/drivers/ghosteo.cpp index 2a6a1fa071b..67ad8f62cd9 100644 --- a/src/mame/drivers/ghosteo.cpp +++ b/src/mame/drivers/ghosteo.cpp @@ -59,6 +59,7 @@ ToDo: verify QS1000 hook-up #include "emu.h" #include "cpu/arm7/arm7.h" #include "cpu/arm7/arm7core.h" +#include "machine/gen_latch.h" #include "machine/s3c2410.h" //#include "machine/smartmed.h" #include "machine/i2cmem.h" @@ -86,14 +87,18 @@ class ghosteo_state : public driver_device public: ghosteo_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu") , + m_maincpu(*this, "maincpu"), + m_qs1000(*this, "qs1000"), m_i2cmem(*this, "i2cmem"), m_s3c2410(*this, "s3c2410"), + m_soundlatch(*this, "soundlatch"), m_system_memory(*this, "systememory") { } required_device m_maincpu; + required_device m_qs1000; required_device m_i2cmem; required_device m_s3c2410; + required_device m_soundlatch; required_shared_ptr m_system_memory; int m_security_count; @@ -154,7 +159,7 @@ NAND Flash Controller (4KB internal buffer) READ8_MEMBER( ghosteo_state::qs1000_p1_r ) { - return soundlatch_byte_r(space, 0); + return m_soundlatch->read(space, 0); } WRITE8_MEMBER( ghosteo_state::qs1000_p1_w ) @@ -171,12 +176,10 @@ WRITE8_MEMBER( ghosteo_state::qs1000_p3_w ) // ...x .... - ? // ..x. .... - /IRQ clear - qs1000_device *qs1000 = machine().device("qs1000"); - membank("qs1000:bank")->set_entry(data & 0x07); if (!BIT(data, 5)) - qs1000->set_irq(CLEAR_LINE); + m_qs1000->set_irq(CLEAR_LINE); } @@ -586,10 +589,8 @@ READ32_MEMBER(ghosteo_state::bballoon_speedup_r) WRITE32_MEMBER(ghosteo_state::soundlatch_w) { - qs1000_device *qs1000 = space.machine().device("qs1000"); - - soundlatch_byte_w(space, 0, data); - qs1000->set_irq(ASSERT_LINE); + m_soundlatch->write(space, 0, data); + m_qs1000->set_irq(ASSERT_LINE); machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(100)); } @@ -645,6 +646,8 @@ static MACHINE_CONFIG_START( ghosteo, ghosteo_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") + MCFG_GENERIC_LATCH_8_ADD("soundlatch") + MCFG_SOUND_ADD("qs1000", QS1000, XTAL_24MHz) MCFG_QS1000_EXTERNAL_ROM(true) MCFG_QS1000_IN_P1_CB(READ8(ghosteo_state, qs1000_p1_r)) diff --git a/src/mame/drivers/ginganin.cpp b/src/mame/drivers/ginganin.cpp index cd8dffb1f8e..620870e93ac 100644 --- a/src/mame/drivers/ginganin.cpp +++ b/src/mame/drivers/ginganin.cpp @@ -95,7 +95,7 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, ginganin_state ) AM_RANGE(0x0000, 0x07ff) AM_RAM AM_RANGE(0x0800, 0x0807) AM_DEVREADWRITE("6840ptm", ptm6840_device, read, write) - AM_RANGE(0x1800, 0x1800) AM_READ(soundlatch_byte_r) + AM_RANGE(0x1800, 0x1800) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_RANGE(0x2000, 0x2001) AM_DEVWRITE("ymsnd", y8950_device, write) AM_RANGE(0x2800, 0x2801) AM_DEVWRITE("aysnd", ay8910_device, address_data_w) AM_RANGE(0x4000, 0xffff) AM_ROM @@ -271,6 +271,8 @@ static MACHINE_CONFIG_START( ginganin, ginganin_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_GENERIC_LATCH_8_ADD("soundlatch") + MCFG_SOUND_ADD("aysnd", AY8910, SOUND_CLOCK / 2) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10) diff --git a/src/mame/drivers/lordgun.cpp b/src/mame/drivers/lordgun.cpp index 15b66477bf1..6a61bdfa80d 100644 --- a/src/mame/drivers/lordgun.cpp +++ b/src/mame/drivers/lordgun.cpp @@ -43,9 +43,7 @@ Notes: #include "cpu/m68000/m68000.h" #include "cpu/z80/z80.h" #include "machine/i8255.h" -#include "machine/eepromser.h" #include "sound/3812intf.h" -#include "sound/okim6295.h" #include "sound/ymf278b.h" #include "includes/lordgun.h" @@ -272,8 +270,8 @@ READ16_MEMBER(lordgun_state::lordgun_gun_1_y_r) WRITE16_MEMBER(lordgun_state::lordgun_soundlatch_w) { - if (ACCESSING_BITS_0_7) soundlatch_byte_w (space, 0, (data >> 0) & 0xff); - if (ACCESSING_BITS_8_15) soundlatch2_byte_w(space, 0, (data >> 8) & 0xff); + if (ACCESSING_BITS_0_7) m_soundlatch->write(space, 0, (data >> 0) & 0xff); + if (ACCESSING_BITS_8_15) m_soundlatch2->write(space, 0, (data >> 8) & 0xff); m_soundcpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); } @@ -362,16 +360,16 @@ WRITE8_MEMBER(lordgun_state::lordgun_okibank_w) static ADDRESS_MAP_START( lordgun_soundio_map, AS_IO, 8, lordgun_state ) AM_RANGE(0x1000, 0x1001) AM_DEVWRITE("ymsnd", ym3812_device, write) AM_RANGE(0x2000, 0x2000) AM_DEVREADWRITE("oki", okim6295_device, read, write) - AM_RANGE(0x3000, 0x3000) AM_READ(soundlatch2_byte_r ) - AM_RANGE(0x4000, 0x4000) AM_READ(soundlatch_byte_r ) + AM_RANGE(0x3000, 0x3000) AM_DEVREAD("soundlatch2", generic_latch_8_device, read) + AM_RANGE(0x4000, 0x4000) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_RANGE(0x5000, 0x5000) AM_READNOP AM_RANGE(0x6000, 0x6000) AM_WRITE(lordgun_okibank_w ) ADDRESS_MAP_END static ADDRESS_MAP_START( aliencha_soundio_map, AS_IO, 8, lordgun_state ) - AM_RANGE(0x3000, 0x3000) AM_READ(soundlatch2_byte_r ) - AM_RANGE(0x4000, 0x4000) AM_READ(soundlatch_byte_r ) + AM_RANGE(0x3000, 0x3000) AM_DEVREAD("soundlatch2", generic_latch_8_device, read) + AM_RANGE(0x4000, 0x4000) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_RANGE(0x5000, 0x5000) AM_WRITENOP // writes 03 then 07 at end of NMI AM_RANGE(0x7000, 0x7000) AM_DEVREAD("ymf", ymf278b_device, read) AM_RANGE(0x7000, 0x7005) AM_DEVWRITE("ymf", ymf278b_device, write) @@ -672,6 +670,9 @@ static MACHINE_CONFIG_START( lordgun, lordgun_state ) // sound hardware MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_GENERIC_LATCH_8_ADD("soundlatch") + MCFG_GENERIC_LATCH_8_ADD("soundlatch2") + MCFG_SOUND_ADD("ymsnd", YM3812, XTAL_3_579545MHz) MCFG_YM3812_IRQ_HANDLER(INPUTLINE("soundcpu", 0)) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) @@ -721,6 +722,9 @@ static MACHINE_CONFIG_START( aliencha, lordgun_state ) // sound hardware MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_GENERIC_LATCH_8_ADD("soundlatch") + MCFG_GENERIC_LATCH_8_ADD("soundlatch2") + MCFG_SOUND_ADD("ymf", YMF278B, 26000000) // ? 26MHz matches video (decrease for faster music tempo) MCFG_DEVICE_ADDRESS_MAP(AS_0, ymf278_map) MCFG_YMF278B_IRQ_HANDLER(INPUTLINE("soundcpu", 0)) diff --git a/src/mame/drivers/m107.cpp b/src/mame/drivers/m107.cpp index 9a92d8ad326..e2a057b39b7 100644 --- a/src/mame/drivers/m107.cpp +++ b/src/mame/drivers/m107.cpp @@ -126,8 +126,8 @@ WRITE16_MEMBER(m107_state::bankswitch_w) WRITE16_MEMBER(m107_state::soundlatch_w) { m_soundcpu->set_input_line(NEC_INPUT_LINE_INTP1, ASSERT_LINE); - soundlatch_byte_w(space, 0, data & 0xff); -// logerror("soundlatch_byte_w %02x\n",data); + m_soundlatch->write(space, 0, data & 0xff); +// logerror("m_soundlatch->write %02x\n",data); } READ16_MEMBER(m107_state::sound_status_r) @@ -138,7 +138,7 @@ READ16_MEMBER(m107_state::sound_status_r) READ16_MEMBER(m107_state::soundlatch_r) { m_soundcpu->set_input_line(NEC_INPUT_LINE_INTP1, CLEAR_LINE); - return soundlatch_byte_r(space, offset) | 0xff00; + return m_soundlatch->read(space, offset) | 0xff00; } WRITE16_MEMBER(m107_state::sound_irq_ack_w) @@ -824,6 +824,8 @@ static MACHINE_CONFIG_START( firebarr, m107_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") + MCFG_GENERIC_LATCH_8_ADD("soundlatch") + MCFG_YM2151_ADD("ymsnd", 14318180/4) MCFG_YM2151_IRQ_HANDLER(INPUTLINE("soundcpu", NEC_INPUT_LINE_INTP0)) MCFG_SOUND_ROUTE(0, "lspeaker", 0.40) diff --git a/src/mame/drivers/m63.cpp b/src/mame/drivers/m63.cpp index 1a0f04752eb..2e70f38c2a7 100644 --- a/src/mame/drivers/m63.cpp +++ b/src/mame/drivers/m63.cpp @@ -96,7 +96,7 @@ Notes: The NMI handler just handles the "Stop Mode" dip switch. TS 2008.06.14: -- Addedd sound emulation - atomboy and fghtbskt req different interrupt (T1) +- Added sound emulation - atomboy and fghtbskt req different interrupt (T1) timing than wilytowr, otherwise music/fx tempo is too fast. Music tempo and pitch verified on real pcb. - Extra space in atomboy 2764 eproms is filled with garbage z80 code @@ -120,6 +120,7 @@ Dip locations verified for: #include "emu.h" #include "cpu/z80/z80.h" #include "cpu/mcs48/mcs48.h" +#include "machine/gen_latch.h" #include "sound/ay8910.h" #include "sound/samples.h" @@ -133,13 +134,14 @@ public: m_videoram2(*this, "videoram2"), m_videoram(*this, "videoram"), m_colorram(*this, "colorram"), - m_soundcpu(*this, "soundcpu"), - m_samples(*this, "samples"), m_maincpu(*this, "maincpu"), m_ay1(*this, "ay1"), m_ay2(*this, "ay2"), m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette") + m_palette(*this, "palette"), + m_soundcpu(*this, "soundcpu"), + m_samples(*this, "samples"), + m_soundlatch(*this, "soundlatch") { } @@ -165,9 +167,16 @@ public: int m_p2; std::unique_ptr m_samplebuf; - /* sound devices */ + /* devices */ + required_device m_maincpu; + required_device m_ay1; + optional_device m_ay2; + required_device m_gfxdecode; + required_device m_palette; required_device m_soundcpu; optional_device m_samples; + required_device m_soundlatch; + DECLARE_WRITE8_MEMBER(m63_videoram_w); DECLARE_WRITE8_MEMBER(m63_colorram_w); DECLARE_WRITE8_MEMBER(m63_videoram2_w); @@ -197,11 +206,6 @@ public: INTERRUPT_GEN_MEMBER(snd_irq); INTERRUPT_GEN_MEMBER(vblank_irq); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); - required_device m_maincpu; - required_device m_ay1; - optional_device m_ay2; - required_device m_gfxdecode; - required_device m_palette; }; @@ -440,7 +444,7 @@ READ8_MEMBER(m63_state::snddata_r) { switch (m_p2 & 0xf0) { - case 0x60: return soundlatch_byte_r(space, 0); ; + case 0x60: return m_soundlatch->read(space, 0); ; case 0x70: return memregion("user1")->base()[((m_p1 & 0x1f) << 8) | offset]; } return 0xff; @@ -471,7 +475,7 @@ static ADDRESS_MAP_START( m63_map, AS_PROGRAM, 8, m63_state ) AM_RANGE(0xf002, 0xf002) AM_WRITE(m63_flipscreen_w) AM_RANGE(0xf003, 0xf003) AM_WRITE(m63_palbank_w) AM_RANGE(0xf006, 0xf007) AM_WRITE(coin_w) - AM_RANGE(0xf800, 0xf800) AM_READ_PORT("P1") AM_WRITE(soundlatch_byte_w) + AM_RANGE(0xf800, 0xf800) AM_READ_PORT("P1") AM_DEVWRITE("soundlatch", generic_latch_8_device, write) AM_RANGE(0xf801, 0xf801) AM_READ_PORT("P2") AM_WRITENOP /* continues game when in stop mode (cleared by NMI handler) */ AM_RANGE(0xf802, 0xf802) AM_READ_PORT("DSW1") AM_RANGE(0xf803, 0xf803) AM_WRITE(snd_irq_w) @@ -494,7 +498,7 @@ static ADDRESS_MAP_START( fghtbskt_map, AS_PROGRAM, 8, m63_state ) AM_RANGE(0xf003, 0xf003) AM_READ_PORT("DSW") AM_RANGE(0xf000, 0xf000) AM_WRITE(snd_irq_w) AM_RANGE(0xf001, 0xf001) AM_WRITENOP - AM_RANGE(0xf002, 0xf002) AM_WRITE(soundlatch_byte_w) + AM_RANGE(0xf002, 0xf002) AM_DEVWRITE("soundlatch", generic_latch_8_device, write) AM_RANGE(0xf800, 0xf800) AM_WRITENOP AM_RANGE(0xf801, 0xf801) AM_WRITE(nmi_mask_w) AM_RANGE(0xf802, 0xf802) AM_WRITE(fghtbskt_flipscreen_w) @@ -779,6 +783,8 @@ static MACHINE_CONFIG_START( m63, m63_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") /* ????? */ + MCFG_GENERIC_LATCH_8_ADD("soundlatch") + MCFG_SOUND_ADD("ay1", AY8910, XTAL_12MHz/8) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) @@ -822,6 +828,8 @@ static MACHINE_CONFIG_START( fghtbskt, m63_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_GENERIC_LATCH_8_ADD("soundlatch") + MCFG_SOUND_ADD("ay1", AY8910, XTAL_12MHz/8) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) diff --git a/src/mame/drivers/m72.cpp b/src/mame/drivers/m72.cpp index 37fe8921b2a..acab1dcb3e6 100644 --- a/src/mame/drivers/m72.cpp +++ b/src/mame/drivers/m72.cpp @@ -1106,7 +1106,7 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( rtype_sound_portmap, AS_IO, 8, m72_state ) ADDRESS_MAP_GLOBAL_MASK(0xff) AM_RANGE(0x00, 0x01) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write) - AM_RANGE(0x02, 0x02) AM_READ(soundlatch_byte_r) + AM_RANGE(0x02, 0x02) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_RANGE(0x06, 0x06) AM_DEVWRITE("m72", m72_audio_device, sound_irq_ack_w) AM_RANGE(0x84, 0x84) AM_DEVREAD("m72", m72_audio_device, sample_r) ADDRESS_MAP_END @@ -1114,7 +1114,7 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( sound_portmap, AS_IO, 8, m72_state ) ADDRESS_MAP_GLOBAL_MASK(0xff) AM_RANGE(0x00, 0x01) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write) - AM_RANGE(0x02, 0x02) AM_READ(soundlatch_byte_r) + AM_RANGE(0x02, 0x02) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_RANGE(0x06, 0x06) AM_DEVWRITE("m72", m72_audio_device, sound_irq_ack_w) AM_RANGE(0x82, 0x82) AM_DEVWRITE("m72", m72_audio_device, sample_w) AM_RANGE(0x84, 0x84) AM_DEVREAD("m72", m72_audio_device, sample_r) @@ -1123,7 +1123,7 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( rtype2_sound_portmap, AS_IO, 8, m72_state ) ADDRESS_MAP_GLOBAL_MASK(0xff) AM_RANGE(0x00, 0x01) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write) - AM_RANGE(0x80, 0x80) AM_READ(soundlatch_byte_r) + AM_RANGE(0x80, 0x80) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_RANGE(0x80, 0x81) AM_DEVWRITE("m72", m72_audio_device, rtype2_sample_addr_w) AM_RANGE(0x82, 0x82) AM_DEVWRITE("m72", m72_audio_device, sample_w) AM_RANGE(0x83, 0x83) AM_DEVWRITE("m72", m72_audio_device, sound_irq_ack_w) @@ -1135,7 +1135,7 @@ static ADDRESS_MAP_START( poundfor_sound_portmap, AS_IO, 8, m72_state ) ADDRESS_MAP_GLOBAL_MASK(0xff) AM_RANGE(0x10, 0x13) AM_DEVWRITE("m72", m72_audio_device, poundfor_sample_addr_w) AM_RANGE(0x40, 0x41) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write) - AM_RANGE(0x42, 0x42) AM_READ(soundlatch_byte_r) + AM_RANGE(0x42, 0x42) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_RANGE(0x42, 0x42) AM_DEVWRITE("m72", m72_audio_device, sound_irq_ack_w) ADDRESS_MAP_END @@ -1871,6 +1871,8 @@ static MACHINE_CONFIG_FRAGMENT( m72_audio_chips ) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_GENERIC_LATCH_8_ADD("soundlatch") + MCFG_SOUND_ADD("m72", M72, 0); MCFG_YM2151_ADD("ymsnd", SOUND_CLOCK) diff --git a/src/mame/drivers/m90.cpp b/src/mame/drivers/m90.cpp index 66097bbacf6..9bc262da880 100644 --- a/src/mame/drivers/m90.cpp +++ b/src/mame/drivers/m90.cpp @@ -58,7 +58,7 @@ WRITE16_MEMBER(m90_state::dynablsb_sound_command_w) { if (ACCESSING_BITS_0_7) { - soundlatch_byte_w(space, offset, data); + m_soundlatch->write(space, offset, data); m_soundcpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); } } @@ -131,7 +131,7 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( m90_sound_cpu_io_map, AS_IO, 8, m90_state ) ADDRESS_MAP_GLOBAL_MASK(0xff) AM_RANGE(0x00, 0x01) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write) - AM_RANGE(0x80, 0x80) AM_READ(soundlatch_byte_r) + AM_RANGE(0x80, 0x80) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_RANGE(0x80, 0x81) AM_DEVWRITE("m72", m72_audio_device, rtype2_sample_addr_w) AM_RANGE(0x82, 0x82) AM_DEVWRITE("m72", m72_audio_device, sample_w) AM_RANGE(0x83, 0x83) AM_DEVWRITE("m72", m72_audio_device, sound_irq_ack_w) @@ -141,7 +141,7 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( dynablsb_sound_cpu_io_map, AS_IO, 8, m90_state ) ADDRESS_MAP_GLOBAL_MASK(0xff) AM_RANGE(0x00, 0x01) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write) - AM_RANGE(0x80, 0x80) AM_READ(soundlatch_byte_r) + AM_RANGE(0x80, 0x80) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_RANGE(0x82, 0x82) AM_DEVWRITE("dac", dac_device, write_signed8) ADDRESS_MAP_END @@ -149,7 +149,7 @@ static ADDRESS_MAP_START( m99_sound_cpu_io_map, AS_IO, 8, m90_state ) ADDRESS_MAP_GLOBAL_MASK(0xff) AM_RANGE(0x00, 0x01) AM_DEVWRITE("m72", m72_audio_device, poundfor_sample_addr_w) AM_RANGE(0x40, 0x41) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write) - AM_RANGE(0x42, 0x42) AM_READ(soundlatch_byte_r) + AM_RANGE(0x42, 0x42) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_RANGE(0x42, 0x42) AM_DEVWRITE("m72", m72_audio_device, sound_irq_ack_w) ADDRESS_MAP_END @@ -744,6 +744,8 @@ static MACHINE_CONFIG_START( m90, m90_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_GENERIC_LATCH_8_ADD("soundlatch") + MCFG_SOUND_ADD("m72", M72, 0) MCFG_YM2151_ADD("ymsnd", XTAL_3_579545MHz) /* verified on pcb */ diff --git a/src/mame/drivers/m92.cpp b/src/mame/drivers/m92.cpp index c7b8dd95e97..2b17ab8bce0 100644 --- a/src/mame/drivers/m92.cpp +++ b/src/mame/drivers/m92.cpp @@ -208,7 +208,6 @@ psoldier dip locations still need verification. #include "machine/irem_cpu.h" #include "sound/2151intf.h" #include "sound/iremga20.h" -#include "sound/okim6295.h" // I haven't managed to find a way to keep nbbatman happy when using the proper upd71059c device @@ -338,7 +337,7 @@ WRITE16_MEMBER(m92_state::m92_soundlatch_w) if (m_soundcpu) m_soundcpu->set_input_line(NEC_INPUT_LINE_INTP1, ASSERT_LINE); - soundlatch_byte_w(space, 0, data & 0xff); + m_soundlatch->write(space, 0, data & 0xff); } READ16_MEMBER(m92_state::m92_sound_status_r) @@ -352,7 +351,7 @@ READ16_MEMBER(m92_state::m92_soundlatch_r) if (m_soundcpu) m_soundcpu->set_input_line(NEC_INPUT_LINE_INTP1, CLEAR_LINE); - return soundlatch_byte_r(space, offset) | 0xff00; + return m_soundlatch->read(space, offset) | 0xff00; } WRITE16_MEMBER(m92_state::m92_sound_irq_ack_w) @@ -1004,6 +1003,8 @@ static MACHINE_CONFIG_START( m92, m92_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_GENERIC_LATCH_8_ADD("soundlatch") + MCFG_YM2151_ADD("ymsnd", XTAL_14_31818MHz/4) MCFG_YM2151_IRQ_HANDLER(INPUTLINE("soundcpu", NEC_INPUT_LINE_INTP0)) MCFG_SOUND_ROUTE(0, "mono", 0.40) @@ -1056,6 +1057,7 @@ static MACHINE_CONFIG_DERIVED( ppan, m92 ) MCFG_CPU_IO_MAP(ppan_portmap) MCFG_DEVICE_REMOVE("soundcpu") + MCFG_DEVICE_REMOVE("soundlatch") MCFG_DEVICE_REMOVE("ymsnd") MCFG_DEVICE_REMOVE("irem") diff --git a/src/mame/drivers/momoko.cpp b/src/mame/drivers/momoko.cpp index b4b23ec7aa9..3702f925599 100644 --- a/src/mame/drivers/momoko.cpp +++ b/src/mame/drivers/momoko.cpp @@ -47,6 +47,7 @@ Stephh's notes (based on the game Z80 code and some tests) : #include "emu.h" #include "cpu/z80/z80.h" +#include "machine/gen_latch.h" #include "machine/watchdog.h" #include "sound/2203intf.h" #include "includes/momoko.h" @@ -66,7 +67,7 @@ static ADDRESS_MAP_START( momoko_map, AS_PROGRAM, 8, momoko_state ) AM_RANGE(0xd400, 0xd400) AM_READ_PORT("IN0") AM_WRITENOP /* interrupt ack? */ AM_RANGE(0xd402, 0xd402) AM_READ_PORT("IN1") AM_WRITE(momoko_flipscreen_w) AM_RANGE(0xd404, 0xd404) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w) - AM_RANGE(0xd406, 0xd406) AM_READ_PORT("DSW0") AM_WRITE(soundlatch_byte_w) + AM_RANGE(0xd406, 0xd406) AM_READ_PORT("DSW0") AM_DEVWRITE("soundlatch", generic_latch_8_device, write) AM_RANGE(0xd407, 0xd407) AM_READ_PORT("DSW1") AM_RANGE(0xd800, 0xdbff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") AM_RANGE(0xdc00, 0xdc00) AM_WRITE(momoko_fg_scrolly_w) @@ -278,6 +279,8 @@ static MACHINE_CONFIG_START( momoko, momoko_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_GENERIC_LATCH_8_ADD("soundlatch") + MCFG_SOUND_ADD("ym1", YM2203, 1250000) MCFG_SOUND_ROUTE(0, "mono", 0.15) MCFG_SOUND_ROUTE(1, "mono", 0.15) @@ -285,7 +288,7 @@ static MACHINE_CONFIG_START( momoko, momoko_state ) MCFG_SOUND_ROUTE(3, "mono", 0.40) MCFG_SOUND_ADD("ym2", YM2203, 1250000) - MCFG_AY8910_PORT_A_READ_CB(READ8(driver_device, soundlatch_byte_r)) + MCFG_AY8910_PORT_A_READ_CB(DEVREAD8("soundlatch", generic_latch_8_device, read)) MCFG_SOUND_ROUTE(0, "mono", 0.15) MCFG_SOUND_ROUTE(1, "mono", 0.15) MCFG_SOUND_ROUTE(2, "mono", 0.15) diff --git a/src/mame/drivers/ms32.cpp b/src/mame/drivers/ms32.cpp index 32293c02c73..8fd5e12aa70 100644 --- a/src/mame/drivers/ms32.cpp +++ b/src/mame/drivers/ms32.cpp @@ -82,7 +82,7 @@ Priorities (code in tetrisp2.c doesn't use all of the priority ram.. and doesn't - some games require completely reversed list processing! Dip switches/inputs in t2m32 and f1superb -some games (hayaosi2) don't seeem to have service mode even if it's listed among the dips +some games (hayaosi2) don't seem to have service mode even if it's listed among the dips service mode is still accessible through F1 though Fix Anything Else (Palette etc.) @@ -105,7 +105,7 @@ horizontal position of tx and bg tilemaps is off by 1 pixel in some games bbbxing: some sprite/roz/bg alignment issues gratia: at the beginning of a level it shows the level name in the bottom right corner, scrolling it up - and making the score display scroll out of the screen. Is this correct ar should there be a raster + and making the score display scroll out of the screen. Is this correct or should there be a raster effect keeping the score on screen? And why didn't they just use sprites to do that? gratia: the 3d sky shown at the beginning of the game has a black gap near the end. It would not be visible @@ -117,7 +117,7 @@ gratia: the 3d sky seems to be the only place needed the "wrap" parameter to dra gratia: at the beginning of the game, before the sky appears, the city background appears for an instant. Missing layer enable register? -background color: pen 0 is correct for gametngk, but wrong for f1superb. Maybe it dpeends on the layer +background color: pen 0 is correct for gametngk, but wrong for f1superb. Maybe it depends on the layer priority order? roz layer wrapping: currently it's always ON, breaking places where it gets very small so it gets @@ -221,7 +221,7 @@ READ32_MEMBER(ms32_state::ms32_read_inputs3) WRITE32_MEMBER(ms32_state::ms32_sound_w) { - soundlatch_byte_w(space, 0, data & 0xff); + m_soundlatch->write(space, 0, data & 0xff); m_audiocpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE); // give the Z80 time to respond @@ -1343,7 +1343,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(ms32_state::ms32_interrupt) READ8_MEMBER(ms32_state::latch_r) { m_audiocpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE); - return soundlatch_byte_r(space,0)^0xff; + return m_soundlatch->read(space,0)^0xff; } WRITE8_MEMBER(ms32_state::ms32_snd_bank_w) @@ -1414,6 +1414,8 @@ static MACHINE_CONFIG_START( ms32, ms32_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_GENERIC_LATCH_8_ADD("soundlatch") + MCFG_SOUND_ADD("ymf", YMF271, 16934400) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) diff --git a/src/mame/drivers/mugsmash.cpp b/src/mame/drivers/mugsmash.cpp index 77e5c55efe5..0cee7ed9153 100644 --- a/src/mame/drivers/mugsmash.cpp +++ b/src/mame/drivers/mugsmash.cpp @@ -56,7 +56,7 @@ WRITE16_MEMBER(mugsmash_state::mugsmash_reg2_w) switch (offset) { case 1: - soundlatch_byte_w(space, 1, data & 0xff); + m_soundlatch->write(space, 1, data & 0xff); m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE ); break; @@ -197,7 +197,7 @@ static ADDRESS_MAP_START( mugsmash_sound_map, AS_PROGRAM, 8, mugsmash_state ) AM_RANGE(0x8000, 0x87ff) AM_RAM AM_RANGE(0x8800, 0x8801) AM_DEVREADWRITE("ymsnd", ym2151_device,read,write) AM_RANGE(0x9800, 0x9800) AM_DEVREADWRITE("oki", okim6295_device, read, write) - AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r) + AM_RANGE(0xa000, 0xa000) AM_DEVREAD("soundlatch", generic_latch_8_device, read) ADDRESS_MAP_END @@ -419,6 +419,8 @@ static MACHINE_CONFIG_START( mugsmash, mugsmash_state ) MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") + MCFG_GENERIC_LATCH_8_ADD("soundlatch") + MCFG_YM2151_ADD("ymsnd", 3579545) MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0)) MCFG_SOUND_ROUTE(0, "lspeaker", 1.00) /* music */ diff --git a/src/mame/drivers/olibochu.cpp b/src/mame/drivers/olibochu.cpp index 8e997d897fb..5f76ddabc3d 100644 --- a/src/mame/drivers/olibochu.cpp +++ b/src/mame/drivers/olibochu.cpp @@ -55,6 +55,7 @@ $7004 writes, related to $7000 reads #include "emu.h" #include "cpu/z80/z80.h" +#include "machine/gen_latch.h" #include "sound/ay8910.h" class olibochu_state : public driver_device @@ -68,7 +69,8 @@ public: m_spriteram2(*this, "spriteram2"), m_maincpu(*this, "maincpu"), m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette") { } + m_palette(*this, "palette"), + m_soundlatch(*this, "soundlatch") { } /* memory pointers */ required_shared_ptr m_videoram; @@ -76,6 +78,12 @@ public: required_shared_ptr m_spriteram; required_shared_ptr m_spriteram2; + /* devices */ + required_device m_maincpu; + required_device m_gfxdecode; + required_device m_palette; + required_device m_soundlatch; + /* video-related */ tilemap_t *m_bg_tilemap; @@ -93,9 +101,6 @@ public: UINT32 screen_update_olibochu(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(olibochu_scanline); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); - required_device m_maincpu; - required_device m_gfxdecode; - required_device m_palette; }; @@ -255,7 +260,7 @@ WRITE8_MEMBER(olibochu_state::sound_command_w) for (c = 15; c >= 0; c--) if (m_cmd & (1 << c)) break; - if (c >= 0) soundlatch_byte_w(space, 0, 15 - c); + if (c >= 0) m_soundlatch->write(space, 0, 15 - c); } @@ -281,7 +286,7 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( olibochu_sound_map, AS_PROGRAM, 8, olibochu_state ) AM_RANGE(0x0000, 0x1fff) AM_ROM AM_RANGE(0x6000, 0x63ff) AM_RAM - AM_RANGE(0x7000, 0x7000) AM_READ(soundlatch_byte_r) /* likely ay8910 input port, not direct */ + AM_RANGE(0x7000, 0x7000) AM_DEVREAD("soundlatch", generic_latch_8_device, read) /* likely ay8910 input port, not direct */ AM_RANGE(0x7000, 0x7001) AM_DEVWRITE("aysnd", ay8910_device, address_data_w) AM_RANGE(0x7004, 0x7004) AM_WRITENOP //sound filter? AM_RANGE(0x7006, 0x7006) AM_WRITENOP //irq ack? @@ -479,6 +484,8 @@ static MACHINE_CONFIG_START( olibochu, olibochu_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_GENERIC_LATCH_8_ADD("soundlatch") + MCFG_SOUND_ADD("aysnd", AY8910, 2000000) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) MACHINE_CONFIG_END diff --git a/src/mame/drivers/pgm.cpp b/src/mame/drivers/pgm.cpp index d26b8392863..41868a2de66 100644 --- a/src/mame/drivers/pgm.cpp +++ b/src/mame/drivers/pgm.cpp @@ -52,7 +52,7 @@ Known Games on this Platform ToDo: - IRQ4 generation - Puzzli 2 doens't like this, many other games require it for coins / inputs to work. + IRQ4 generation - Puzzli 2 doesn't like this, many other games require it for coins / inputs to work. Protection Devices / Co-processors @@ -173,7 +173,7 @@ Notes: ----- 3.6V_BATT - 3.6V NICad battery, connected to the V3021 RTC IDC34 - IDC34 way flat cable plug, PGM can support 4 players max in two cabs, - this is jamma connecter for another cab and the P3&P4 + this is jamma connector for another cab and the P3&P4 PAL - Atmel ATF16V8B PAL (DIP20) SW1 - Push button switch to enter Test Mode SW2 - 8 position DIP Switch (for configuration of PCB/game options) @@ -277,7 +277,7 @@ WRITE16_MEMBER(pgm_state::m68k_l1_w) { if (PGMLOGERROR) logerror("SL 1 m68.w %02x (%06x) IRQ\n", data & 0xff, space.device().safe_pc()); - soundlatch_byte_w(space, 0, data); + m_soundlatch->write(space, 0, data); m_soundcpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE ); } } @@ -286,7 +286,7 @@ WRITE8_MEMBER(pgm_state::z80_l3_w) { if (PGMLOGERROR) logerror("SL 3 z80.w %02x (%04x)\n", data, space.device().safe_pc()); - soundlatch3_byte_w(space, 0, data); + m_soundlatch3->write(space, 0, data); } WRITE_LINE_MEMBER(pgm_state::pgm_sound_irq) @@ -304,9 +304,9 @@ ADDRESS_MAP_END ADDRESS_MAP_START( pgm_z80_io, AS_IO, 8, pgm_state ) AM_RANGE(0x8000, 0x8003) AM_DEVREADWRITE("ics", ics2115_device, read, write) - AM_RANGE(0x8100, 0x81ff) AM_READ(soundlatch3_byte_r) AM_WRITE(z80_l3_w) - AM_RANGE(0x8200, 0x82ff) AM_READWRITE(soundlatch_byte_r, soundlatch_byte_w) - AM_RANGE(0x8400, 0x84ff) AM_READWRITE(soundlatch2_byte_r, soundlatch2_byte_w) + AM_RANGE(0x8100, 0x81ff) AM_DEVREAD("soundlatch3", generic_latch_8_device, read) AM_WRITE(z80_l3_w) + AM_RANGE(0x8200, 0x82ff) AM_DEVREADWRITE("soundlatch", generic_latch_8_device, read, write) + AM_RANGE(0x8400, 0x84ff) AM_DEVREADWRITE("soundlatch2", generic_latch_8_device, read, write) ADDRESS_MAP_END /*** 68000 (main CPU) + variants for protection devices **********************/ @@ -320,12 +320,12 @@ ADDRESS_MAP_START( pgm_base_mem, AS_PROGRAM, 16, pgm_state ) AM_RANGE(0xa00000, 0xa011ff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") AM_RANGE(0xb00000, 0xb0ffff) AM_RAM AM_SHARE("videoregs") /* Video Regs inc. Zoom Table */ - AM_RANGE(0xc00002, 0xc00003) AM_READ(soundlatch_word_r) AM_WRITE(m68k_l1_w) - AM_RANGE(0xc00004, 0xc00005) AM_READWRITE(soundlatch2_word_r, soundlatch2_word_w) + AM_RANGE(0xc00002, 0xc00003) AM_DEVREAD8("soundlatch", generic_latch_8_device, read, 0x00ff) AM_WRITE(m68k_l1_w) + AM_RANGE(0xc00004, 0xc00005) AM_DEVREADWRITE8("soundlatch2", generic_latch_8_device, read, write, 0x00ff) AM_RANGE(0xc00006, 0xc00007) AM_DEVREADWRITE8("rtc", v3021_device, read, write, 0x00ff) AM_RANGE(0xc00008, 0xc00009) AM_WRITE(z80_reset_w) AM_RANGE(0xc0000a, 0xc0000b) AM_WRITE(z80_ctrl_w) - AM_RANGE(0xc0000c, 0xc0000d) AM_READWRITE(soundlatch3_word_r, soundlatch3_word_w) + AM_RANGE(0xc0000c, 0xc0000d) AM_DEVREADWRITE8("soundlatch3", generic_latch_8_device, read, write, 0x00ff) AM_RANGE(0xc08000, 0xc08001) AM_READ_PORT("P1P2") AM_RANGE(0xc08002, 0xc08003) AM_READ_PORT("P3P4") @@ -538,6 +538,11 @@ MACHINE_CONFIG_FRAGMENT( pgmbase ) /*sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") + + MCFG_GENERIC_LATCH_8_ADD("soundlatch") + MCFG_GENERIC_LATCH_8_ADD("soundlatch2") + MCFG_GENERIC_LATCH_8_ADD("soundlatch3") + MCFG_ICS2115_ADD("ics", 0) MCFG_ICS2115_IRQ_CB(WRITELINE(pgm_state, pgm_sound_irq)) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 5.0) diff --git a/src/mame/drivers/pokechmp.cpp b/src/mame/drivers/pokechmp.cpp index 6394aea67fe..a02d4ba615e 100644 --- a/src/mame/drivers/pokechmp.cpp +++ b/src/mame/drivers/pokechmp.cpp @@ -33,7 +33,7 @@ ROM 11 = Main CPU code? -Sound = Yamaha YM2203C + Y3014B -Also, there are some GALs on the board (not dumped) a - 8-dips bank and two oscilators (4 MHz and 24 MHz, both near + 8-dips bank and two oscillators (4 MHz and 24 MHz, both near the sound parts). ClawGrip, Jul 2006 @@ -69,7 +69,7 @@ WRITE8_MEMBER(pokechmp_state::pokechmp_sound_bank_w) WRITE8_MEMBER(pokechmp_state::pokechmp_sound_w) { - soundlatch_byte_w(space, 0, data); + m_soundlatch->write(space, 0, data); m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); } @@ -107,7 +107,7 @@ static ADDRESS_MAP_START( pokechmp_sound_map, AS_PROGRAM, 8, pokechmp_state ) AM_RANGE(0x1800, 0x1800) AM_WRITENOP /* MSM5205 chip on Pocket Gal, not connected here? */ AM_RANGE(0x2000, 0x2000) AM_WRITE(pokechmp_sound_bank_w) /* sound rom bank seems to be replaced with OKI bank */ AM_RANGE(0x2800, 0x2800) AM_DEVREADWRITE("oki", okim6295_device, read, write) // extra - AM_RANGE(0x3000, 0x3000) AM_READ(soundlatch_byte_r) + AM_RANGE(0x3000, 0x3000) AM_DEVREAD("soundlatch", generic_latch_8_device, read) // AM_RANGE(0x3400, 0x3400) AM_READ(pokechmp_adpcm_reset_r) /* not on here */ AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank3") AM_RANGE(0x8000, 0xffff) AM_ROM @@ -238,6 +238,8 @@ static MACHINE_CONFIG_START( pokechmp, pokechmp_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_GENERIC_LATCH_8_ADD("soundlatch") + MCFG_SOUND_ADD("ym1", YM2203, XTAL_4MHz/4) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.60) diff --git a/src/mame/drivers/ppmast93.cpp b/src/mame/drivers/ppmast93.cpp index b3d2bc556fb..e2e8cb8539c 100644 --- a/src/mame/drivers/ppmast93.cpp +++ b/src/mame/drivers/ppmast93.cpp @@ -133,6 +133,7 @@ Dip locations added based on the notes above. #include "emu.h" #include "cpu/z80/z80.h" +#include "machine/gen_latch.h" #include "sound/2413intf.h" #include "sound/dac.h" @@ -211,7 +212,7 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( ppmast93_cpu1_io, AS_IO, 8, ppmast93_state ) ADDRESS_MAP_GLOBAL_MASK(0xff) - AM_RANGE(0x00, 0x00) AM_READ_PORT("P1") AM_WRITE(soundlatch_byte_w) + AM_RANGE(0x00, 0x00) AM_READ_PORT("P1") AM_DEVWRITE("soundlatch", generic_latch_8_device, write) AM_RANGE(0x02, 0x02) AM_READ_PORT("P2") AM_RANGE(0x04, 0x04) AM_READ_PORT("SYSTEM") AM_WRITE(port4_w) AM_RANGE(0x06, 0x06) AM_READ_PORT("DSW1") @@ -220,7 +221,7 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( ppmast93_cpu2_map, AS_PROGRAM, 8, ppmast93_state ) AM_RANGE(0x0000, 0xfbff) AM_ROM AM_REGION("sub", 0x10000) - AM_RANGE(0xfc00, 0xfc00) AM_READ(soundlatch_byte_r) + AM_RANGE(0xfc00, 0xfc00) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_RANGE(0xfd00, 0xffff) AM_RAM ADDRESS_MAP_END @@ -399,6 +400,8 @@ static MACHINE_CONFIG_START( ppmast93, ppmast93_state ) MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_GENERIC_LATCH_8_ADD("soundlatch") + MCFG_SOUND_ADD("ymsnd", YM2413, 5000000/2) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) diff --git a/src/mame/drivers/psychic5.cpp b/src/mame/drivers/psychic5.cpp index 3f079ba10b9..0333e04e0a3 100644 --- a/src/mame/drivers/psychic5.cpp +++ b/src/mame/drivers/psychic5.cpp @@ -331,6 +331,7 @@ Notes (23-Jan-2016 AS): #include "emu.h" #include "cpu/z80/z80.h" +#include "machine/gen_latch.h" #include "sound/2203intf.h" #include "includes/psychic5.h" @@ -436,7 +437,7 @@ static ADDRESS_MAP_START( psychic5_main_map, AS_PROGRAM, 8, psychic5_state ) AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("mainbank") AM_RANGE(0xc000, 0xdfff) AM_DEVICE("vrambank", address_map_bank_device, amap8) AM_RANGE(0xe000, 0xefff) AM_RAM - AM_RANGE(0xf000, 0xf000) AM_WRITE(soundlatch_byte_w) + AM_RANGE(0xf000, 0xf000) AM_DEVWRITE("soundlatch", generic_latch_8_device, write) AM_RANGE(0xf001, 0xf001) AM_READNOP AM_WRITE(psychic5_coin_counter_w) AM_RANGE(0xf002, 0xf002) AM_READWRITE(bankselect_r, psychic5_bankselect_w) AM_RANGE(0xf003, 0xf003) AM_READWRITE(vram_page_select_r, vram_page_select_w) @@ -472,7 +473,7 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( psychic5_sound_map, AS_PROGRAM, 8, psychic5_state ) AM_RANGE(0x0000, 0x7fff) AM_ROM AM_RANGE(0xc000, 0xc7ff) AM_RAM - AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_byte_r) + AM_RANGE(0xe000, 0xe000) AM_DEVREAD("soundlatch", generic_latch_8_device, read) ADDRESS_MAP_END static ADDRESS_MAP_START( psychic5_soundport_map, AS_IO, 8, psychic5_state ) @@ -488,7 +489,7 @@ static ADDRESS_MAP_START( bombsa_main_map, AS_PROGRAM, 8, psychic5_state ) AM_RANGE(0xc000, 0xcfff) AM_RAM /* ports look like the other games */ - AM_RANGE(0xd000, 0xd000) AM_WRITE(soundlatch_byte_w) // confirmed + AM_RANGE(0xd000, 0xd000) AM_DEVWRITE("soundlatch", generic_latch_8_device, write) // confirmed AM_RANGE(0xd001, 0xd001) AM_WRITE(bombsa_flipscreen_w) AM_RANGE(0xd002, 0xd002) AM_READWRITE(bankselect_r, bombsa_bankselect_w) AM_RANGE(0xd003, 0xd003) AM_READWRITE(vram_page_select_r, vram_page_select_w) @@ -504,7 +505,7 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( bombsa_sound_map, AS_PROGRAM, 8, psychic5_state ) AM_RANGE(0x0000, 0xbfff) AM_ROM AM_RANGE(0xc000, 0xc7ff) AM_RAM - AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_byte_r) + AM_RANGE(0xe000, 0xe000) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_RANGE(0xf000, 0xf000) AM_WRITEONLY // Is this a confirm of some sort? ADDRESS_MAP_END @@ -746,6 +747,8 @@ static MACHINE_CONFIG_START( psychic5, psychic5_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_GENERIC_LATCH_8_ADD("soundlatch") + MCFG_SOUND_ADD("ym1", YM2203, XTAL_12MHz/8) MCFG_YM2203_IRQ_HANDLER(INPUTLINE("audiocpu", 0)) MCFG_SOUND_ROUTE(0, "mono", 0.15) @@ -796,6 +799,8 @@ static MACHINE_CONFIG_START( bombsa, psychic5_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_GENERIC_LATCH_8_ADD("soundlatch") + MCFG_SOUND_ADD("ym1", YM2203, XTAL_12MHz/8) MCFG_YM2203_IRQ_HANDLER(INPUTLINE("audiocpu", 0)) MCFG_SOUND_ROUTE(0, "mono", 0.30) diff --git a/src/mame/drivers/pturn.cpp b/src/mame/drivers/pturn.cpp index 82d6fd2d033..0655195bcce 100644 --- a/src/mame/drivers/pturn.cpp +++ b/src/mame/drivers/pturn.cpp @@ -78,6 +78,7 @@ ROMS: All ROM labels say only "PROM" and a number. */ #include "emu.h" #include "cpu/z80/z80.h" +#include "machine/gen_latch.h" #include "sound/ay8910.h" @@ -89,12 +90,14 @@ public: m_maincpu(*this, "maincpu"), m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette"), + m_soundlatch(*this, "soundlatch"), m_videoram(*this, "videoram"), m_spriteram(*this, "spriteram") { } required_device m_maincpu; required_device m_gfxdecode; required_device m_palette; + required_device m_soundlatch; required_shared_ptr m_videoram; required_shared_ptr m_spriteram; @@ -325,7 +328,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, pturn_state ) AM_RANGE(0xe000, 0xe3ff) AM_RAM_WRITE(videoram_w) AM_SHARE("videoram") AM_RANGE(0xe400, 0xe400) AM_WRITE(fgpalette_w) - AM_RANGE(0xe800, 0xe800) AM_WRITE(soundlatch_byte_w) + AM_RANGE(0xe800, 0xe800) AM_DEVWRITE("soundlatch", generic_latch_8_device, write) AM_RANGE(0xf000, 0xf0ff) AM_RAM AM_SHARE("spriteram") @@ -353,7 +356,7 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( sub_map, AS_PROGRAM, 8, pturn_state ) AM_RANGE(0x0000, 0x0fff) AM_ROM AM_RANGE(0x2000, 0x23ff) AM_RAM - AM_RANGE(0x3000, 0x3000) AM_READ(soundlatch_byte_r) AM_WRITE(nmi_sub_enable_w) + AM_RANGE(0x3000, 0x3000) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_WRITE(nmi_sub_enable_w) AM_RANGE(0x4000, 0x4000) AM_RAM AM_RANGE(0x5000, 0x5001) AM_DEVWRITE("ay1", ay8910_device, address_data_w) AM_RANGE(0x6000, 0x6001) AM_DEVWRITE("ay2", ay8910_device, address_data_w) @@ -490,7 +493,7 @@ void pturn_state::machine_start() void pturn_state::machine_reset() { address_space &space = m_maincpu->space(AS_PROGRAM); - soundlatch_clear_byte_w(space,0,0); + m_soundlatch->clear_w(space,0,0); } static MACHINE_CONFIG_START( pturn, pturn_state ) @@ -518,6 +521,8 @@ static MACHINE_CONFIG_START( pturn, pturn_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_GENERIC_LATCH_8_ADD("soundlatch") + MCFG_SOUND_ADD("ay1", AY8910, 2000000) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) diff --git a/src/mame/drivers/redalert.cpp b/src/mame/drivers/redalert.cpp index 469e3253fc0..cff4ab900da 100644 --- a/src/mame/drivers/redalert.cpp +++ b/src/mame/drivers/redalert.cpp @@ -81,7 +81,7 @@ the MAME soundrom (red alert) it is marked exactly the same "w3s1"(IC5). The Bprom matched the Red Alert set also... marked "W3" i think? it's hard to see because the sticker has been damaged. - The other eproms exept one did not match anything in MAME, + The other eproms except one did not match anything in MAME, and only one of those had the eprom type markings on it... I read all like that type. diff --git a/src/mame/drivers/royalmah.cpp b/src/mame/drivers/royalmah.cpp index 5a37bae7207..a5706997c33 100644 --- a/src/mame/drivers/royalmah.cpp +++ b/src/mame/drivers/royalmah.cpp @@ -95,6 +95,7 @@ Stephh's notes (based on the games Z80 code and some tests) : #include "emu.h" #include "cpu/z80/z80.h" #include "cpu/tlcs90/tlcs90.h" +#include "machine/gen_latch.h" #include "machine/msm6242.h" #include "sound/ay8910.h" #include "sound/dac.h" @@ -109,12 +110,15 @@ public: m_maincpu(*this,"maincpu"), m_videoram(*this, "videoram"), m_audiocpu(*this, "audiocpu"), - m_rtc(*this, "rtc") { } + m_rtc(*this, "rtc"), + m_soundlatch(*this, "soundlatch") { } required_device m_maincpu; required_shared_ptr m_videoram; optional_device m_audiocpu; optional_device m_rtc; + optional_device m_soundlatch; + UINT8 m_input_port_select; UINT8 m_dsw_select; UINT8 m_rombank; @@ -808,7 +812,7 @@ READ8_MEMBER(royalmah_state::jansou_6405_r) WRITE8_MEMBER(royalmah_state::jansou_sound_w) { - soundlatch_byte_w(space, 0, data); + m_soundlatch->write(space, 0, data); m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); } @@ -837,7 +841,7 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( jansou_sub_iomap, AS_IO, 8, royalmah_state ) ADDRESS_MAP_GLOBAL_MASK(0xff) - AM_RANGE(0x00, 0x00) AM_READ(soundlatch_byte_r) AM_DEVWRITE("dac", dac_device, write_unsigned8 ) + AM_RANGE(0x00, 0x00) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_DEVWRITE("dac", dac_device, write_unsigned8 ) ADDRESS_MAP_END @@ -3353,6 +3357,8 @@ static MACHINE_CONFIG_DERIVED( jansou, royalmah ) MCFG_CPU_IO_MAP(jansou_sub_iomap) MCFG_CPU_PERIODIC_INT_DRIVER(royalmah_state, irq0_line_hold, 4000000/512) + MCFG_GENERIC_LATCH_8_ADD("soundlatch") + MCFG_DAC_ADD("dac") MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) MACHINE_CONFIG_END diff --git a/src/mame/drivers/shisen.cpp b/src/mame/drivers/shisen.cpp index 8b1c1347c66..1ad20d759f1 100644 --- a/src/mame/drivers/shisen.cpp +++ b/src/mame/drivers/shisen.cpp @@ -68,7 +68,7 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( shisen_sound_io_map, AS_IO, 8, shisen_state ) ADDRESS_MAP_GLOBAL_MASK(0xff) AM_RANGE(0x00, 0x01) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write) - AM_RANGE(0x80, 0x80) AM_READ(soundlatch_byte_r) + AM_RANGE(0x80, 0x80) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_RANGE(0x80, 0x81) AM_DEVWRITE("m72", m72_audio_device, shisen_sample_addr_w) AM_RANGE(0x82, 0x82) AM_DEVWRITE("m72", m72_audio_device, sample_w) AM_RANGE(0x83, 0x83) AM_DEVWRITE("m72", m72_audio_device, sound_irq_ack_w) @@ -232,6 +232,8 @@ static MACHINE_CONFIG_START( shisen, shisen_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") + MCFG_GENERIC_LATCH_8_ADD("soundlatch") + MCFG_SOUND_ADD("m72", M72, 0) MCFG_YM2151_ADD("ymsnd", 3579545) diff --git a/src/mame/drivers/silvmil.cpp b/src/mame/drivers/silvmil.cpp index fed4f7976be..72948726546 100644 --- a/src/mame/drivers/silvmil.cpp +++ b/src/mame/drivers/silvmil.cpp @@ -26,6 +26,7 @@ Very likely to be 'whatever crystals we had on hand which were close enough for #include "emu.h" #include "cpu/z80/z80.h" #include "cpu/m68000/m68000.h" +#include "machine/gen_latch.h" #include "sound/okim6295.h" #include "video/decospr.h" #include "sound/2151intf.h" @@ -39,6 +40,7 @@ public: m_maincpu(*this, "maincpu"), m_gfxdecode(*this, "gfxdecode"), m_sprgen(*this, "spritegen"), + m_soundlatch(*this, "soundlatch"), m_bg_videoram(*this, "bg_videoram"), m_fg_videoram(*this, "fg_videoram"), m_spriteram(*this, "spriteram") { } @@ -48,6 +50,7 @@ public: required_device m_maincpu; required_device m_gfxdecode; required_device m_sprgen; + required_device m_soundlatch; /* memory pointers */ required_shared_ptr m_bg_videoram; @@ -111,7 +114,7 @@ public: { if (ACCESSING_BITS_0_7) { - soundlatch_byte_w(space, 0, data & 0xff); + m_soundlatch->write(space, 0, data & 0xff); machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(20)); } @@ -385,7 +388,7 @@ static ADDRESS_MAP_START( silvmil_sound_map, AS_PROGRAM, 8, silvmil_state ) AM_RANGE(0xd000, 0xd7ff) AM_RAM AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write) AM_RANGE(0xc002, 0xc002) AM_DEVREADWRITE("oki", okim6295_device, read, write) AM_MIRROR(1) - AM_RANGE(0xc006, 0xc006) AM_READ(soundlatch_byte_r) + AM_RANGE(0xc006, 0xc006) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_RANGE(0xc00f, 0xc00f) AM_WRITENOP // ?? ADDRESS_MAP_END @@ -423,6 +426,8 @@ static MACHINE_CONFIG_START( silvmil, silvmil_state ) MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_GENERIC_LATCH_8_ADD("soundlatch") + MCFG_YM2151_ADD("ymsnd", XTAL_14_31818MHz/4) /* Verified */ MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0)) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) diff --git a/src/mame/drivers/skyfox.cpp b/src/mame/drivers/skyfox.cpp index e0040ed1457..199025b4768 100644 --- a/src/mame/drivers/skyfox.cpp +++ b/src/mame/drivers/skyfox.cpp @@ -40,7 +40,7 @@ WRITE8_MEMBER(skyfox_state::skyfox_vregs_w) break; case 1: - soundlatch_byte_w(space, 0, data); + m_soundlatch->write(space, 0, data); break; default: @@ -74,7 +74,7 @@ static ADDRESS_MAP_START( skyfox_sound_map, AS_PROGRAM, 8, skyfox_state ) AM_RANGE(0xa000, 0xa001) AM_DEVREADWRITE("ym1", ym2203_device, read, write) // AM_RANGE(0xb000, 0xb001) AM_WRITENOP // ?? AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE("ym2", ym2203_device, read, write) - AM_RANGE(0xb000, 0xb000) AM_READ(soundlatch_byte_r) + AM_RANGE(0xb000, 0xb000) AM_DEVREAD("soundlatch", generic_latch_8_device, read) ADDRESS_MAP_END @@ -244,6 +244,8 @@ static MACHINE_CONFIG_START( skyfox, skyfox_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_GENERIC_LATCH_8_ADD("soundlatch") + MCFG_SOUND_ADD("ym1", YM2203, XTAL_14_31818MHz/8) /* Verified at 1.789772MHz */ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) diff --git a/src/mame/drivers/spartanxtec.cpp b/src/mame/drivers/spartanxtec.cpp index 3d267d47276..7cd0a9f9b8a 100644 --- a/src/mame/drivers/spartanxtec.cpp +++ b/src/mame/drivers/spartanxtec.cpp @@ -22,6 +22,7 @@ probably an original bug? #include "emu.h" #include "cpu/z80/z80.h" #include "includes/iremipt.h" +#include "machine/gen_latch.h" #include "sound/ay8910.h" class spartanxtec_state : public driver_device @@ -36,7 +37,8 @@ public: m_maincpu(*this, "maincpu"), m_audiocpu(*this, "audiocpu"), m_palette(*this, "palette"), - m_gfxdecode(*this, "gfxdecode") + m_gfxdecode(*this, "gfxdecode"), + m_soundlatch(*this, "soundlatch") { } required_shared_ptr m_m62_tileram; @@ -45,6 +47,9 @@ public: required_shared_ptr m_scroll_hi; required_device m_maincpu; required_device m_audiocpu; + required_device m_palette; + required_device m_gfxdecode; + required_device m_soundlatch; virtual void machine_start() override; virtual void machine_reset() override; @@ -60,11 +65,6 @@ public: DECLARE_WRITE8_MEMBER(a801_w); DECLARE_WRITE8_MEMBER(sound_irq_ack); DECLARE_WRITE8_MEMBER(irq_ack); - - required_device m_palette; - required_device m_gfxdecode; - - }; @@ -161,7 +161,7 @@ UINT32 spartanxtec_state::screen_update_spartanxtec(screen_device &screen, bitma WRITE8_MEMBER(spartanxtec_state::spartanxtec_soundlatch_w) { - soundlatch_byte_w(space, 0, data); + m_soundlatch->write(space, 0, data); m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); } @@ -213,7 +213,7 @@ static ADDRESS_MAP_START( spartanxtec_sound_map, AS_PROGRAM, 8, spartanxtec_stat AM_RANGE(0x0000, 0x0fff) AM_ROM AM_RANGE(0x8000, 0x83ff) AM_RAM - AM_RANGE(0xc000, 0xc000) AM_READ(soundlatch_byte_r) + AM_RANGE(0xc000, 0xc000) AM_DEVREAD("soundlatch", generic_latch_8_device, read) ADDRESS_MAP_END static ADDRESS_MAP_START( spartanxtec_sound_io, AS_IO, 8, spartanxtec_state ) @@ -383,6 +383,8 @@ static MACHINE_CONFIG_START( spartanxtec, spartanxtec_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_GENERIC_LATCH_8_ADD("soundlatch") + MCFG_SOUND_ADD("ay1", AY8910, 1000000) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) MCFG_SOUND_ADD("ay2", AY8910, 1000000) diff --git a/src/mame/drivers/splash.cpp b/src/mame/drivers/splash.cpp index 5b32c10d8c0..a31da94b4b3 100644 --- a/src/mame/drivers/splash.cpp +++ b/src/mame/drivers/splash.cpp @@ -54,7 +54,7 @@ WRITE16_MEMBER(splash_state::splash_sh_irqtrigger_w) { if (ACCESSING_BITS_0_7) { - soundlatch_byte_w(space, 0, data & 0xff); + m_soundlatch->write(space, 0, data & 0xff); m_audiocpu->set_input_line(0, HOLD_LINE); } } @@ -63,7 +63,7 @@ WRITE16_MEMBER(splash_state::roldf_sh_irqtrigger_w) { if (ACCESSING_BITS_0_7) { - soundlatch_byte_w(space, 0, data & 0xff); + m_soundlatch->write(space, 0, data & 0xff); m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); } @@ -121,7 +121,7 @@ static ADDRESS_MAP_START( splash_sound_map, AS_PROGRAM, 8, splash_state ) AM_RANGE(0x0000, 0xd7ff) AM_ROM /* ROM */ AM_RANGE(0xd800, 0xd800) AM_WRITE(splash_adpcm_data_w) /* ADPCM data for the MSM5205 chip */ // AM_RANGE(0xe000, 0xe000) AM_WRITENOP /* ??? */ - AM_RANGE(0xe800, 0xe800) AM_READ(soundlatch_byte_r) /* Sound latch */ + AM_RANGE(0xe800, 0xe800) AM_DEVREAD("soundlatch", generic_latch_8_device, read) /* Sound latch */ AM_RANGE(0xf000, 0xf001) AM_DEVREADWRITE("ymsnd", ym3812_device, read, write) /* YM3812 */ AM_RANGE(0xf800, 0xffff) AM_RAM /* RAM */ ADDRESS_MAP_END @@ -199,7 +199,7 @@ static ADDRESS_MAP_START( roldfrog_sound_io_map, AS_IO, 8, splash_state ) AM_RANGE(0x40, 0x40) AM_NOP AM_RANGE(0x31, 0x31) AM_WRITE(sound_bank_w) AM_RANGE(0x37, 0x37) AM_WRITE(roldfrog_vblank_ack_w ) - AM_RANGE(0x70, 0x70) AM_READ(soundlatch_byte_r) + AM_RANGE(0x70, 0x70) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_RANGE(0x0, 0xff) AM_READ(roldfrog_unk_r) ADDRESS_MAP_END @@ -217,7 +217,7 @@ WRITE16_MEMBER(splash_state::spr_write) WRITE16_MEMBER(splash_state::funystrp_sh_irqtrigger_w) { - soundlatch_byte_w(space, 0, data>>8); + m_soundlatch->write(space, 0, data>>8); m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); } @@ -280,7 +280,7 @@ static ADDRESS_MAP_START( funystrp_sound_io_map, AS_IO, 8, splash_state ) AM_RANGE(0x00, 0x00) AM_WRITE(msm1_data_w) AM_RANGE(0x01, 0x01) AM_WRITE(msm2_data_w) AM_RANGE(0x02, 0x02) AM_WRITE(sound_bank_w) - AM_RANGE(0x03, 0x03) AM_READ(soundlatch_byte_r) + AM_RANGE(0x03, 0x03) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_RANGE(0x04, 0x04) AM_READ(int_source_r) AM_RANGE(0x06, 0x06) AM_WRITE(msm1_interrupt_w) AM_RANGE(0x07, 0x07) AM_WRITE(msm2_interrupt_w) @@ -514,6 +514,8 @@ static MACHINE_CONFIG_START( splash, splash_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_GENERIC_LATCH_8_ADD("soundlatch") + MCFG_SOUND_ADD("ymsnd", YM3812, XTAL_30MHz/8) /* 3.75MHz (30/8) */ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) @@ -568,6 +570,8 @@ static MACHINE_CONFIG_START( roldfrog, splash_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_GENERIC_LATCH_8_ADD("soundlatch") + MCFG_SOUND_ADD("ymsnd", YM2203, XTAL_24MHz / 8) MCFG_YM2203_IRQ_HANDLER(WRITELINE(splash_state, ym_irq)) MCFG_SOUND_ROUTE(0, "mono", 0.20) @@ -651,6 +655,8 @@ static MACHINE_CONFIG_START( funystrp, splash_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_GENERIC_LATCH_8_ADD("soundlatch") + MCFG_SOUND_ADD("msm1", MSM5205, XTAL_400kHz) MCFG_MSM5205_VCLK_CB(WRITELINE(splash_state, adpcm_int1)) /* interrupt function */ MCFG_MSM5205_PRESCALER_SELECTOR(MSM5205_S48_4B) /* 1 / 48 */ /* Sample rate = 400kHz/64 */ diff --git a/src/mame/drivers/spyhuntertec.cpp b/src/mame/drivers/spyhuntertec.cpp index 464ae6e3b0d..d8c51804c36 100644 --- a/src/mame/drivers/spyhuntertec.cpp +++ b/src/mame/drivers/spyhuntertec.cpp @@ -19,6 +19,7 @@ sound system appears to be the same as 'spartanxtec.cpp' #include "emu.h" #include "cpu/z80/z80.h" +#include "machine/gen_latch.h" #include "sound/ay8910.h" #include "spyhunttec.lh" @@ -38,7 +39,8 @@ public: m_spyhunt_alpharam(*this, "spyhunt_alpha"), m_palette(*this, "palette"), m_gfxdecode(*this, "gfxdecode"), - m_screen(*this, "screen") + m_screen(*this, "screen"), + m_soundlatch(*this, "soundlatch") { } @@ -54,6 +56,7 @@ public: required_device m_palette; required_device m_gfxdecode; required_device m_screen; + required_device m_soundlatch; virtual void machine_start() override; virtual void machine_reset() override; @@ -334,7 +337,7 @@ UINT32 spyhuntertec_state::screen_update_spyhuntertec(screen_device &screen, bit WRITE8_MEMBER(spyhuntertec_state::spyhuntertec_fd00_w) { // printf("%04x spyhuntertec_fd00_w %02x\n", space.device().safe_pc(), data); - soundlatch_byte_w(space, 0, data); + m_soundlatch->write(space, 0, data); m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); } @@ -468,7 +471,7 @@ static ADDRESS_MAP_START( spyhuntertec_sound_map, AS_PROGRAM, 8, spyhuntertec_st AM_RANGE(0x0000, 0x1fff) AM_ROM AM_RANGE(0x8000, 0x83ff) AM_RAM - AM_RANGE(0xc000, 0xc000) AM_READ(soundlatch_byte_r) + AM_RANGE(0xc000, 0xc000) AM_DEVREAD("soundlatch", generic_latch_8_device, read) ADDRESS_MAP_END @@ -694,6 +697,8 @@ static MACHINE_CONFIG_START( spyhuntertec, spyhuntertec_state ) MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_GENERIC_LATCH_8_ADD("soundlatch") + MCFG_SOUND_ADD("ay1", AY8912, 3000000/2) // AY-3-8912 MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) MCFG_AY8910_PORT_A_READ_CB(READ8(spyhuntertec_state, ay1_porta_r)) diff --git a/src/mame/drivers/tetrisp2.cpp b/src/mame/drivers/tetrisp2.cpp index b7e7f1beb70..5e8726e5e5e 100644 --- a/src/mame/drivers/tetrisp2.cpp +++ b/src/mame/drivers/tetrisp2.cpp @@ -563,7 +563,7 @@ READ16_MEMBER(stepstag_state::unk_a42000_r) WRITE16_MEMBER(stepstag_state::stepstag_soundlatch_word_w) { - soundlatch_word_w(space, offset, data, mem_mask); + m_soundlatch->write(space, offset, data, mem_mask); m_subcpu->set_input_line(M68K_IRQ_6, HOLD_LINE); @@ -617,7 +617,7 @@ static ADDRESS_MAP_START( stepstag_map, AS_PROGRAM, 16, stepstag_state ) AM_RANGE(0xa44000, 0xa44001) AM_READNOP // watchdog // AM_RANGE(0xa48000, 0xa48001) AM_WRITENOP // PC? // AM_RANGE(0xa4c000, 0xa4c001) AM_WRITENOP // PC? - AM_RANGE(0xa50000, 0xa50001) AM_READWRITE( soundlatch_word_r, stepstag_soundlatch_word_w ) + AM_RANGE(0xa50000, 0xa50001) AM_DEVREAD("soundlatch", generic_latch_16_device, read) AM_WRITE(stepstag_soundlatch_word_w) AM_RANGE(0xa60000, 0xa60003) AM_DEVWRITE8("ymz", ymz280b_device, write, 0x00ff) // Sound AM_RANGE(0xb00000, 0xb00001) AM_WRITENOP // Coin Counter plus other things @@ -673,7 +673,7 @@ static ADDRESS_MAP_START( stepstag_sub_map, AS_PROGRAM, 16, stepstag_state ) AM_RANGE(0xa80000, 0xa80001) AM_WRITENOP // cleared after writing this sprite list // AM_RANGE(0xac0000, 0xac0001) AM_WRITENOP // cleared at boot - AM_RANGE(0xb00000, 0xb00001) AM_READWRITE( soundlatch_word_r, soundlatch_word_w ) + AM_RANGE(0xb00000, 0xb00001) AM_DEVREADWRITE("soundlatch", generic_latch_16_device, read, write) AM_RANGE(0xc00000, 0xc00001) AM_READ(unknown_read_0xc00000) AM_WRITENOP //?? AM_RANGE(0xd00000, 0xd00001) AM_READNOP // watchdog @@ -1552,6 +1552,8 @@ static MACHINE_CONFIG_START( stepstag, stepstag_state ) // sound hardware MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") + MCFG_GENERIC_LATCH_16_ADD("soundlatch") + MCFG_SOUND_ADD("ymz", YMZ280B, 16934400) MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) diff --git a/src/mame/drivers/vegaeo.cpp b/src/mame/drivers/vegaeo.cpp index 9ea3f95100f..20f671825ce 100644 --- a/src/mame/drivers/vegaeo.cpp +++ b/src/mame/drivers/vegaeo.cpp @@ -16,6 +16,7 @@ #include "emu.h" #include "cpu/e132xs/e132xs.h" #include "machine/at28c16.h" +#include "machine/gen_latch.h" #include "sound/qs1000.h" #include "includes/eolith.h" @@ -24,7 +25,10 @@ class vegaeo_state : public eolith_state { public: vegaeo_state(const machine_config &mconfig, device_type type, const char *tag) - : eolith_state(mconfig, type, tag) { } + : eolith_state(mconfig, type, tag), + m_soundlatch(*this, "soundlatch") { } + + required_device m_soundlatch; std::unique_ptr m_vega_vram; UINT8 m_vega_vbuffer; @@ -47,7 +51,7 @@ public: READ8_MEMBER( vegaeo_state::qs1000_p1_r ) { - return soundlatch_byte_r(space, 0); + return m_soundlatch->read(space, 0); } WRITE8_MEMBER( vegaeo_state::qs1000_p1_w ) @@ -121,7 +125,7 @@ READ32_MEMBER(vegaeo_state::vegaeo_custom_read) WRITE32_MEMBER(vegaeo_state::soundlatch_w) { - soundlatch_byte_w(space, 0, data); + m_soundlatch->write(space, 0, data); m_qs1000->set_irq(ASSERT_LINE); machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(100)); @@ -236,6 +240,8 @@ static MACHINE_CONFIG_START( vega, vegaeo_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") + MCFG_GENERIC_LATCH_8_ADD("soundlatch") + MCFG_SOUND_ADD("qs1000", QS1000, XTAL_24MHz) MCFG_QS1000_EXTERNAL_ROM(true) MCFG_QS1000_IN_P1_CB(READ8(vegaeo_state, qs1000_p1_r)) diff --git a/src/mame/drivers/vigilant.cpp b/src/mame/drivers/vigilant.cpp index 35053e8f5e2..4b615dd94e6 100644 --- a/src/mame/drivers/vigilant.cpp +++ b/src/mame/drivers/vigilant.cpp @@ -117,7 +117,7 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( sound_io_map, AS_IO, 8, vigilant_state ) ADDRESS_MAP_GLOBAL_MASK(0xff) AM_RANGE(0x00, 0x01) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write) - AM_RANGE(0x80, 0x81) AM_READ(soundlatch_byte_r) AM_DEVWRITE("m72", m72_audio_device, vigilant_sample_addr_w) /* STL / STH */ + AM_RANGE(0x80, 0x81) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_DEVWRITE("m72", m72_audio_device, vigilant_sample_addr_w) /* STL / STH */ AM_RANGE(0x82, 0x82) AM_DEVWRITE("m72", m72_audio_device, sample_w) /* COUNT UP */ AM_RANGE(0x83, 0x83) AM_DEVWRITE("m72", m72_audio_device, sound_irq_ack_w) /* IRQ clear */ AM_RANGE(0x84, 0x84) AM_DEVREAD("m72", m72_audio_device, sample_r) /* S ROM C */ @@ -127,7 +127,7 @@ static ADDRESS_MAP_START( buccanrs_sound_io_map, AS_IO, 8, vigilant_state ) ADDRESS_MAP_GLOBAL_MASK(0xff) AM_RANGE(0x00, 0x01) AM_DEVREADWRITE("ym1", ym2203_device, read, write) AM_RANGE(0x02, 0x03) AM_DEVREADWRITE("ym2", ym2203_device, read, write) - AM_RANGE(0x80, 0x80) AM_READ(soundlatch_byte_r) /* SDRE */ + AM_RANGE(0x80, 0x80) AM_DEVREAD("soundlatch", generic_latch_8_device, read) /* SDRE */ AM_RANGE(0x80, 0x81) AM_DEVWRITE("m72", m72_audio_device, vigilant_sample_addr_w) /* STL / STH */ AM_RANGE(0x82, 0x82) AM_DEVWRITE("m72", m72_audio_device, sample_w) /* COUNT UP */ AM_RANGE(0x83, 0x83) AM_DEVWRITE("m72", m72_audio_device, sound_irq_ack_w) /* IRQ clear */ @@ -496,6 +496,8 @@ static MACHINE_CONFIG_START( vigilant, vigilant_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") + MCFG_GENERIC_LATCH_8_ADD("soundlatch") + MCFG_SOUND_ADD("m72", M72, 0) MCFG_YM2151_ADD("ymsnd", 3579645) @@ -537,6 +539,8 @@ static MACHINE_CONFIG_START( buccanrs, vigilant_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") + MCFG_GENERIC_LATCH_8_ADD("soundlatch") + MCFG_SOUND_ADD("m72", M72, 0) MCFG_SOUND_ADD("ym1", YM2203, 18432000/6) @@ -594,6 +598,8 @@ static MACHINE_CONFIG_START( kikcubic, vigilant_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") + MCFG_GENERIC_LATCH_8_ADD("soundlatch") + MCFG_SOUND_ADD("m72", M72, 0) MCFG_YM2151_ADD("ymsnd", 3579645) -- cgit v1.2.3