diff options
author | Ivan Vangelista <mesgnet@yahoo.it> | 2013-11-07 17:38:50 +0000 |
---|---|---|
committer | Ivan Vangelista <mesgnet@yahoo.it> | 2013-11-07 17:38:50 +0000 |
commit | 3c24c33a8640e25c53e4945251f952b86398fbd9 (patch) | |
tree | 9a39068dd5255931862327ad9dbfd2deb47757fc /src/mame/drivers/astrocde.c | |
parent | 2031bd8f5a78368f4b3b212ba4a5eeadcf584853 (diff) |
Moved gorf and wow sound handlers into the driver state. Updated some commented code (nw)
Diffstat (limited to 'src/mame/drivers/astrocde.c')
-rw-r--r-- | src/mame/drivers/astrocde.c | 55 |
1 files changed, 26 insertions, 29 deletions
diff --git a/src/mame/drivers/astrocde.c b/src/mame/drivers/astrocde.c index af71f3deeb2..67a8876e78a 100644 --- a/src/mame/drivers/astrocde.c +++ b/src/mame/drivers/astrocde.c @@ -117,9 +117,6 @@ #include "includes/astrocde.h" #include "machine/z80ctc.h" #include "machine/nvram.h" -#include "sound/samples.h" -#include "sound/votrax.h" -#include "sound/astrocde.h" #include "sound/ay8910.h" #include "gorf.lh" @@ -311,11 +308,11 @@ READ8_MEMBER(astrocde_state::gorf_io_1_r) case 4: m_sparkle[2] = data; break; case 5: m_sparkle[3] = data; break; case 6: - machine().device<astrocade_device>("astrocade1")->set_output_gain(0, data ? 0.0 : 1.0); + m_astrocade_sound1->set_output_gain(0, data ? 0.0 : 1.0); #if USE_FAKE_VOTRAX m_samples->set_output_gain(0, data ? 1.0 : 0.0); #else - machine().device<votrax_sc01_device>("votrax")->set_output_gain(0, data ? 1.0 : 0.0); + m_votrax->set_output_gain(0, data ? 1.0 : 0.0); #endif break; case 7: mame_printf_debug("io_1:%d\n", data); break; @@ -411,7 +408,7 @@ WRITE8_MEMBER(astrocde_state::profpac_banksw_w) /* bank 0 reads video RAM in the 4000-7FFF range */ if (bank == 0) - prog_space.install_read_handler(0x4000, 0x7fff, read8_delegate(FUNC(astrocde_state::profpac_videoram_r),this)); + prog_space.install_read_handler(0x4000, 0x7fff, read8_delegate(FUNC(astrocde_state::profpac_videoram_r), this)); /* if we have a 640k EPROM board, map that on top of the 4000-7FFF range if specified */ if ((data & 0x80) && memregion("user2")->base() != NULL) @@ -793,7 +790,7 @@ static INPUT_PORTS_START( ebases ) PORT_DIPUNUSED_DIPLOC( 0x80, 0x00, "S1:8" ) PORT_START("P4HANDLE") - PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, astrocde_state,ebases_trackball_r, NULL) + PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, astrocde_state, ebases_trackball_r, NULL) PORT_START("TRACKX1") PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_SENSITIVITY(50) PORT_KEYDELTA(10) PORT_RESET @@ -908,7 +905,7 @@ static INPUT_PORTS_START( wow ) PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(wow_speech_status_r, NULL) + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, astrocde_state, wow_speech_status_r, NULL) PORT_START("P4HANDLE") /* "If S1:1,2,3 are all ON or all OFF, only coin meter number 1 will count." */ @@ -978,7 +975,7 @@ static INPUT_PORTS_START( gorf ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_BIT( 0x60, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(gorf_speech_status_r, NULL) + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, astrocde_state, gorf_speech_status_r, NULL) PORT_START("P4HANDLE") PORT_DIPNAME( 0x01, 0x01, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("S1:1") @@ -1717,48 +1714,48 @@ ROM_END DRIVER_INIT_MEMBER(astrocde_state,seawolf2) { m_video_config = 0x00; - m_maincpu->space(AS_IO).install_write_handler(0x40, 0x40, 0, 0xff18, write8_delegate(FUNC(astrocde_state::seawolf2_sound_1_w),this)); - m_maincpu->space(AS_IO).install_write_handler(0x41, 0x41, 0, 0xff18, write8_delegate(FUNC(astrocde_state::seawolf2_sound_2_w),this)); - m_maincpu->space(AS_IO).install_write_handler(0x42, 0x43, 0, 0xff18, write8_delegate(FUNC(astrocde_state::seawolf2_lamps_w),this)); + m_maincpu->space(AS_IO).install_write_handler(0x40, 0x40, 0, 0xff18, write8_delegate(FUNC(astrocde_state::seawolf2_sound_1_w), this)); + m_maincpu->space(AS_IO).install_write_handler(0x41, 0x41, 0, 0xff18, write8_delegate(FUNC(astrocde_state::seawolf2_sound_2_w), this)); + m_maincpu->space(AS_IO).install_write_handler(0x42, 0x43, 0, 0xff18, write8_delegate(FUNC(astrocde_state::seawolf2_lamps_w), this)); } DRIVER_INIT_MEMBER(astrocde_state,ebases) { m_video_config = AC_SOUND_PRESENT | AC_MONITOR_BW; - m_maincpu->space(AS_IO).install_write_handler(0x20, 0x20, 0, 0xff07, write8_delegate(FUNC(astrocde_state::ebases_coin_w),this)); - m_maincpu->space(AS_IO).install_write_handler(0x28, 0x28, 0, 0xff07, write8_delegate(FUNC(astrocde_state::ebases_trackball_select_w),this)); + m_maincpu->space(AS_IO).install_write_handler(0x20, 0x20, 0, 0xff07, write8_delegate(FUNC(astrocde_state::ebases_coin_w), this)); + m_maincpu->space(AS_IO).install_write_handler(0x28, 0x28, 0, 0xff07, write8_delegate(FUNC(astrocde_state::ebases_trackball_select_w), this)); } DRIVER_INIT_MEMBER(astrocde_state,spacezap) { m_video_config = AC_SOUND_PRESENT | AC_MONITOR_BW; - m_maincpu->space(AS_IO).install_read_handler(0x13, 0x13, 0x03ff, 0xff00, read8_delegate(FUNC(astrocde_state::spacezap_io_r),this)); + m_maincpu->space(AS_IO).install_read_handler(0x13, 0x13, 0x03ff, 0xff00, read8_delegate(FUNC(astrocde_state::spacezap_io_r), this)); } DRIVER_INIT_MEMBER(astrocde_state,wow) { m_video_config = AC_SOUND_PRESENT | AC_LIGHTPEN_INTS | AC_STARS; - m_maincpu->space(AS_IO).install_read_handler(0x15, 0x15, 0x0fff, 0xff00, read8_delegate(FUNC(astrocde_state::wow_io_r),this)); - m_maincpu->space(AS_IO).install_legacy_read_handler(0x17, 0x17, 0xffff, 0xff00, FUNC(wow_speech_r)); + m_maincpu->space(AS_IO).install_read_handler(0x15, 0x15, 0x0fff, 0xff00, read8_delegate(FUNC(astrocde_state::wow_io_r), this)); + m_maincpu->space(AS_IO).install_read_handler(0x17, 0x17, 0xffff, 0xff00, read8_delegate(FUNC(astrocde_state::wow_speech_r), this)); } DRIVER_INIT_MEMBER(astrocde_state,gorf) { m_video_config = AC_SOUND_PRESENT | AC_LIGHTPEN_INTS | AC_STARS; - m_maincpu->space(AS_IO).install_read_handler(0x15, 0x15, 0x0fff, 0xff00, read8_delegate(FUNC(astrocde_state::gorf_io_1_r),this)); - m_maincpu->space(AS_IO).install_read_handler(0x16, 0x16, 0x0fff, 0xff00, read8_delegate(FUNC(astrocde_state::gorf_io_2_r),this)); - m_maincpu->space(AS_IO).install_legacy_read_handler(0x17, 0x17, 0xffff, 0xff00, FUNC(gorf_speech_r)); + m_maincpu->space(AS_IO).install_read_handler(0x15, 0x15, 0x0fff, 0xff00, read8_delegate(FUNC(astrocde_state::gorf_io_1_r), this)); + m_maincpu->space(AS_IO).install_read_handler(0x16, 0x16, 0x0fff, 0xff00, read8_delegate(FUNC(astrocde_state::gorf_io_2_r), this)); + m_maincpu->space(AS_IO).install_read_handler(0x17, 0x17, 0xffff, 0xff00, read8_delegate(FUNC(astrocde_state::gorf_speech_r), this)); } DRIVER_INIT_MEMBER(astrocde_state,robby) { m_video_config = AC_SOUND_PRESENT; - m_maincpu->space(AS_IO).install_read_handler(0x15, 0x15, 0x0fff, 0xff00, read8_delegate(FUNC(astrocde_state::robby_io_r),this)); + m_maincpu->space(AS_IO).install_read_handler(0x15, 0x15, 0x0fff, 0xff00, read8_delegate(FUNC(astrocde_state::robby_io_r), this)); } @@ -1767,8 +1764,8 @@ DRIVER_INIT_MEMBER(astrocde_state,profpac) address_space &iospace = m_maincpu->space(AS_IO); m_video_config = AC_SOUND_PRESENT; - iospace.install_read_handler(0x14, 0x14, 0x0fff, 0xff00, read8_delegate(FUNC(astrocde_state::profpac_io_1_r),this)); - iospace.install_read_handler(0x15, 0x15, 0x77ff, 0xff00, read8_delegate(FUNC(astrocde_state::profpac_io_2_r),this)); + iospace.install_read_handler(0x14, 0x14, 0x0fff, 0xff00, read8_delegate(FUNC(astrocde_state::profpac_io_1_r), this)); + iospace.install_read_handler(0x15, 0x15, 0x77ff, 0xff00, read8_delegate(FUNC(astrocde_state::profpac_io_2_r), this)); /* reset banking */ profpac_banksw_w(iospace, 0, 0); @@ -1781,10 +1778,10 @@ DRIVER_INIT_MEMBER(astrocde_state,demndrgn) address_space &iospace = m_maincpu->space(AS_IO); m_video_config = 0x00; - iospace.install_read_handler(0x14, 0x14, 0x1fff, 0xff00, read8_delegate(FUNC(astrocde_state::demndrgn_io_r),this)); + iospace.install_read_handler(0x14, 0x14, 0x1fff, 0xff00, read8_delegate(FUNC(astrocde_state::demndrgn_io_r), this)); iospace.install_read_port(0x1c, 0x1c, 0x0000, 0xff00, "FIREX"); iospace.install_read_port(0x1d, 0x1d, 0x0000, 0xff00, "FIREY"); - iospace.install_write_handler(0x97, 0x97, 0x0000, 0xff00, write8_delegate(FUNC(astrocde_state::demndrgn_sound_w),this)); + iospace.install_write_handler(0x97, 0x97, 0x0000, 0xff00, write8_delegate(FUNC(astrocde_state::demndrgn_sound_w), this)); /* reset banking */ profpac_banksw_w(iospace, 0, 0); @@ -1802,10 +1799,10 @@ DRIVER_INIT_MEMBER(astrocde_state,tenpindx) iospace.install_read_port(0x62, 0x62, 0x0000, 0xff00, "P62"); iospace.install_read_port(0x63, 0x63, 0x0000, 0xff00, "P63"); iospace.install_read_port(0x64, 0x64, 0x0000, 0xff00, "P64"); - iospace.install_write_handler(0x65, 0x66, 0x0000, 0xff00, write8_delegate(FUNC(astrocde_state::tenpindx_lamp_w),this)); - iospace.install_write_handler(0x67, 0x67, 0x0000, 0xff00, write8_delegate(FUNC(astrocde_state::tenpindx_counter_w),this)); - iospace.install_write_handler(0x68, 0x68, 0x0000, 0xff00, write8_delegate(FUNC(astrocde_state::tenpindx_lights_w),this)); - iospace.install_write_handler(0x97, 0x97, 0x0000, 0xff00, write8_delegate(FUNC(astrocde_state::tenpindx_sound_w),this)); + iospace.install_write_handler(0x65, 0x66, 0x0000, 0xff00, write8_delegate(FUNC(astrocde_state::tenpindx_lamp_w), this)); + iospace.install_write_handler(0x67, 0x67, 0x0000, 0xff00, write8_delegate(FUNC(astrocde_state::tenpindx_counter_w), this)); + iospace.install_write_handler(0x68, 0x68, 0x0000, 0xff00, write8_delegate(FUNC(astrocde_state::tenpindx_lights_w), this)); + iospace.install_write_handler(0x97, 0x97, 0x0000, 0xff00, write8_delegate(FUNC(astrocde_state::tenpindx_sound_w), this)); /* reset banking */ profpac_banksw_w(iospace, 0, 0); |