From 3c24c33a8640e25c53e4945251f952b86398fbd9 Mon Sep 17 00:00:00 2001 From: Ivan Vangelista Date: Thu, 7 Nov 2013 17:38:50 +0000 Subject: [PATCH] Moved gorf and wow sound handlers into the driver state. Updated some commented code (nw) --- src/mame/audio/gorf.c | 70 ++++++++++++++++------------------- src/mame/audio/wow.c | 71 ++++++++++++++++-------------------- src/mame/drivers/astrocde.c | 55 +++++++++++++--------------- src/mame/drivers/galaxian.c | 2 +- src/mame/drivers/m72.c | 2 +- src/mame/drivers/pturn.c | 4 +- src/mame/includes/astrocde.h | 36 +++++++++++------- 7 files changed, 117 insertions(+), 123 deletions(-) diff --git a/src/mame/audio/gorf.c b/src/mame/audio/gorf.c index bfe529fdd9d..697ff2033ac 100644 --- a/src/mame/audio/gorf.c +++ b/src/mame/audio/gorf.c @@ -19,8 +19,6 @@ gorf_sh_ update- Null #include "emu.h" #include "cpu/z80/z80.h" -#include "sound/samples.h" -#include "sound/votrax.h" #include "includes/astrocde.h" @@ -110,16 +108,15 @@ const char *const gorf_sample_names[] = }; -READ8_HANDLER( gorf_speech_r ) +READ8_MEMBER( astrocde_state::gorf_speech_r ) { UINT8 data = offset >> 8; #if USE_FAKE_VOTRAX - astrocde_state *state = space.machine().driver_data(); - int Phoneme, Intonation; + int Phoneme, Intonation; int i = 0; offset &= 0xff; - state->m_totalword_ptr = state->m_totalword; + m_totalword_ptr = m_totalword; Phoneme = data & 0x3F; Intonation = data >> 6; @@ -127,53 +124,52 @@ READ8_HANDLER( gorf_speech_r ) logerror("Date : %d Speech : %s at intonation %d\n",Phoneme, PhonemeTable[Phoneme],Intonation); if(Phoneme==63) { - state->m_samples->stop(0); - if (strlen(state->m_totalword)>2) logerror("Clearing sample %s\n",state->m_totalword); - state->m_totalword[0] = 0; /* Clear the total word stack */ + m_samples->stop(0); + if (strlen(m_totalword)>2) logerror("Clearing sample %s\n",m_totalword); + m_totalword[0] = 0; /* Clear the total word stack */ return data; } /* Phoneme to word translation */ - if (*(state->m_totalword) == 0) { - strcpy(state->m_totalword,PhonemeTable[Phoneme]); /* Copy over the first phoneme */ - if (state->m_plural != 0) { - logerror("found a possible plural at %d\n",state->m_plural-1); - if (!strcmp("S",state->m_totalword)) { /* Plural check */ - state->m_samples->start(0, num_samples-2); /* play the sample at position of word */ - state->m_samples->set_frequency(0, 11025); /* play at correct rate */ - state->m_totalword[0] = 0; /* Clear the total word stack */ - state->m_oldword[0] = 0; /* Clear the total word stack */ + if (*(m_totalword) == 0) { + strcpy(m_totalword,PhonemeTable[Phoneme]); /* Copy over the first phoneme */ + if (m_plural != 0) { + logerror("found a possible plural at %d\n",m_plural-1); + if (!strcmp("S",m_totalword)) { /* Plural check */ + m_samples->start(0, num_samples-2); /* play the sample at position of word */ + m_samples->set_frequency(0, 11025); /* play at correct rate */ + m_totalword[0] = 0; /* Clear the total word stack */ + m_oldword[0] = 0; /* Clear the total word stack */ return data; } else { - state->m_plural=0; + m_plural=0; } } } else - strcat(state->m_totalword,PhonemeTable[Phoneme]); /* Copy over the first phoneme */ + strcat(m_totalword,PhonemeTable[Phoneme]); /* Copy over the first phoneme */ - logerror("Total word = %s\n",state->m_totalword); + logerror("Total word = %s\n",m_totalword); for (i=0; GorfWordTable[i]; i++) { - if (!strcmp(GorfWordTable[i],state->m_totalword)) { /* Scan the word (sample) table for the complete word */ - if ((!strcmp("GDTO1RFYA2N",state->m_totalword)) || (!strcmp("RO1U1BAH1T",state->m_totalword)) || (!strcmp("KO1UH3I3E1N",state->m_totalword)) || (!strcmp("WORAYY1EH3R",state->m_totalword)) || (!strcmp("IN",state->m_totalword)) ) { /* May be state->m_plural */ - state->m_plural=i+1; - strcpy(state->m_oldword,state->m_totalword); - logerror("Storing sample position %d and copying string %s\n",state->m_plural,state->m_oldword); + if (!strcmp(GorfWordTable[i],m_totalword)) { /* Scan the word (sample) table for the complete word */ + if ((!strcmp("GDTO1RFYA2N",m_totalword)) || (!strcmp("RO1U1BAH1T",m_totalword)) || (!strcmp("KO1UH3I3E1N",m_totalword)) || (!strcmp("WORAYY1EH3R",m_totalword)) || (!strcmp("IN",m_totalword)) ) { /* May be m_plural */ + m_plural=i+1; + strcpy(m_oldword,m_totalword); + logerror("Storing sample position %d and copying string %s\n",m_plural,m_oldword); } else { - state->m_plural=0; + m_plural=0; } - state->m_samples->start(0, i); /* play the sample at position of word */ - state->m_samples->set_frequency(0, 11025); /* play at correct rate */ + m_samples->start(0, i); /* play the sample at position of word */ + m_samples->set_frequency(0, 11025); /* play at correct rate */ logerror("Playing sample %d",i); - state->m_totalword[0] = 0; /* Clear the total word stack */ + m_totalword[0] = 0; /* Clear the total word stack */ return data; } } #else - votrax_sc01_device *votrax = space.machine().device("votrax"); - votrax->inflection_w(space, 0, data >> 6); - votrax->write(space, 0, data); + m_votrax->inflection_w(space, 0, data >> 6); + m_votrax->write(space, 0, data); #endif /* Note : We should really also use volume in this as well as frequency */ @@ -181,13 +177,11 @@ READ8_HANDLER( gorf_speech_r ) } -CUSTOM_INPUT( gorf_speech_status_r ) +CUSTOM_INPUT_MEMBER( astrocde_state::gorf_speech_status_r ) { #if USE_FAKE_VOTRAX - samples_device *samples = field.machine().device("samples"); - return !samples->playing(0); + return !m_samples->playing(0); #else - votrax_sc01_device *votrax = field.machine().device("votrax"); - return votrax->request(); + return m_votrax->request(); #endif } diff --git a/src/mame/audio/wow.c b/src/mame/audio/wow.c index 742ce2c9a15..ad75d728e3d 100644 --- a/src/mame/audio/wow.c +++ b/src/mame/audio/wow.c @@ -20,8 +20,6 @@ wow_sh_ update- Null #include "emu.h" #include "cpu/z80/z80.h" -#include "sound/samples.h" -#include "sound/votrax.h" #include "includes/astrocde.h" @@ -101,17 +99,15 @@ const char *const wow_sample_names[] = }; -READ8_HANDLER( wow_speech_r ) +READ8_MEMBER( astrocde_state::wow_speech_r ) { UINT8 data = offset >> 8; #if USE_FAKE_VOTRAX - astrocde_state *state = space.machine().driver_data(); - samples_device *samples = space.machine().device("samples"); int Phoneme/*, Intonation*/; int i = 0; offset &= 0xff; - state->m_totalword_ptr = state->m_totalword; + m_totalword_ptr = m_totalword; Phoneme = data & 0x3F; //Intonation = data >> 6; @@ -119,56 +115,55 @@ READ8_HANDLER( wow_speech_r ) //logerror("Data : %d Speech : %s at intonation %d\n",Phoneme, PhonemeTable[Phoneme],Intonation); if(Phoneme==63) { - samples->stop(0); - //logerror("Clearing sample %s\n",state->m_totalword); - state->m_totalword[0] = 0; /* Clear the total word stack */ + m_samples->stop(0); + //logerror("Clearing sample %s\n",m_totalword); + m_totalword[0] = 0; /* Clear the total word stack */ return data; } if (Phoneme==3) /* We know PA0 is never part of a word */ - state->m_totalword[0] = 0; /* Clear the total word stack */ + m_totalword[0] = 0; /* Clear the total word stack */ /* Phoneme to word translation */ - if (*(state->m_totalword) == 0) { - strcpy(state->m_totalword,PhonemeTable[Phoneme]); /* Copy over the first phoneme */ - if (state->m_plural != 0) { - //logerror("found a possible plural at %d\n",state->m_plural-1); - if (!strcmp("S",state->m_totalword)) { /* Plural check */ - samples->start(0, num_samples-2); /* play the sample at position of word */ - samples->set_frequency(0, 11025); /* play at correct rate */ - state->m_totalword[0] = 0; /* Clear the total word stack */ - state->m_oldword[0] = 0; /* Clear the total word stack */ + if (*(m_totalword) == 0) { + strcpy(m_totalword,PhonemeTable[Phoneme]); /* Copy over the first phoneme */ + if (m_plural != 0) { + //logerror("found a possible plural at %d\n",m_plural-1); + if (!strcmp("S",m_totalword)) { /* Plural check */ + m_samples->start(0, num_samples-2); /* play the sample at position of word */ + m_samples->set_frequency(0, 11025); /* play at correct rate */ + m_totalword[0] = 0; /* Clear the total word stack */ + m_oldword[0] = 0; /* Clear the total word stack */ return data; } else { - state->m_plural=0; + m_plural=0; } } } else - strcat(state->m_totalword,PhonemeTable[Phoneme]); /* Copy over the first phoneme */ + strcat(m_totalword,PhonemeTable[Phoneme]); /* Copy over the first phoneme */ - //logerror("Total word = %s\n",state->m_totalword); + //logerror("Total word = %s\n",m_totalword); for (i=0; wowWordTable[i]; i++) { - if (!strcmp(wowWordTable[i],state->m_totalword)) { /* Scan the word (sample) table for the complete word */ + if (!strcmp(wowWordTable[i],m_totalword)) { /* Scan the word (sample) table for the complete word */ /* WOW has Dungeon */ - if ((!strcmp("GDTO1RFYA2N",state->m_totalword)) || (!strcmp("RO1U1BAH1T",state->m_totalword)) || (!strcmp("KO1UH3I3E1N",state->m_totalword))) { /* May be plural */ - state->m_plural=i+1; - strcpy(state->m_oldword,state->m_totalword); - //logerror("Storing sample position %d and copying string %s\n",state->m_plural,state->m_oldword); + if ((!strcmp("GDTO1RFYA2N",m_totalword)) || (!strcmp("RO1U1BAH1T",m_totalword)) || (!strcmp("KO1UH3I3E1N",m_totalword))) { /* May be plural */ + m_plural=i+1; + strcpy(m_oldword,m_totalword); + //logerror("Storing sample position %d and copying string %s\n",m_plural,m_oldword); } else { - state->m_plural=0; + m_plural=0; } - samples->start(0, i); /* play the sample at position of word */ - samples->set_frequency(0, 11025); /* play at correct rate */ + m_samples->start(0, i); /* play the sample at position of word */ + m_samples->set_frequency(0, 11025); /* play at correct rate */ //logerror("Playing sample %d\n",i); - state->m_totalword[0] = 0; /* Clear the total word stack */ + m_totalword[0] = 0; /* Clear the total word stack */ return data; } } #else - votrax_sc01_device *votrax = space.machine().device("votrax"); - votrax->inflection_w(space, 0, data >> 6); - votrax->write(space, 0, data); + m_votrax->inflection_w(space, 0, data >> 6); + m_votrax->write(space, 0, data); #endif /* Note : We should really also use volume in this as well as frequency */ @@ -176,13 +171,11 @@ READ8_HANDLER( wow_speech_r ) } -CUSTOM_INPUT( wow_speech_status_r ) +CUSTOM_INPUT_MEMBER( astrocde_state::wow_speech_status_r ) { #if USE_FAKE_VOTRAX - samples_device *samples = field.machine().device("samples"); - return !samples->playing(0); + return !m_samples->playing(0); #else - votrax_sc01_device *votrax = field.machine().device("votrax"); - return votrax->request(); + return m_votrax->request(); #endif } 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("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")->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); diff --git a/src/mame/drivers/galaxian.c b/src/mame/drivers/galaxian.c index 0a2036a2cff..0d8815639a5 100644 --- a/src/mame/drivers/galaxian.c +++ b/src/mame/drivers/galaxian.c @@ -6071,7 +6071,7 @@ DRIVER_INIT_MEMBER(galaxian_state,tenspot) //common_init(&galaxian_state::galaxian_draw_bullet, &galaxian_state::galaxian_draw_background, &galaxian_state::batman2_extend_tile_info, &galaxian_state::upper_extend_sprite_info); /* coin lockout replaced by graphics bank */ - //space.install_legacy_write_handler(0x6002, 0x6002, 0, 0x7f8, FUNC(galaxian_gfxbank_w)); + //space.install_write_handler(0x6002, 0x6002, 0, 0x7f8, write8_delegate(FUNC(galaxian_state::galaxian_gfxbank_w),this)); DRIVER_INIT_CALL(galaxian); diff --git a/src/mame/drivers/m72.c b/src/mame/drivers/m72.c index f8834508d47..a78ec46c3b8 100644 --- a/src/mame/drivers/m72.c +++ b/src/mame/drivers/m72.c @@ -356,7 +356,7 @@ DRIVER_INIT_MEMBER(m72_state,m72_8751) program.install_write_handler(0xb0000, 0xb0fff, write16_delegate(FUNC(m72_state::m72_main_mcu_w),this)); membank("bank1")->set_base(m_protection_ram); - //io.install_legacy_write_handler(0xc0, 0xc1, FUNC(loht_sample_trigger_w)); + //io.install_write_handler(0xc0, 0xc1, write16_delegate(FUNC(m72_state::loht_sample_trigger_w),this)); io.install_write_handler(0xc0, 0xc1, write16_delegate(FUNC(m72_state::m72_main_mcu_sound_w),this)); /* sound cpu */ diff --git a/src/mame/drivers/pturn.c b/src/mame/drivers/pturn.c index 747fefa3217..7916fbfe79f 100644 --- a/src/mame/drivers/pturn.c +++ b/src/mame/drivers/pturn.c @@ -557,8 +557,8 @@ ROM_END DRIVER_INIT_MEMBER(pturn_state,pturn) { /* - m_maincpu->space(AS_PROGRAM).install_legacy_read_handler(0xc0dd, 0xc0dd, FUNC(pturn_protection_r)); - m_maincpu->space(AS_PROGRAM).install_legacy_read_handler(0xc0db, 0xc0db, FUNC(pturn_protection2_r)); + m_maincpu->space(AS_PROGRAM).install_read_handler(0xc0dd, 0xc0dd, read8_delegate(FUNC(pturn_state::pturn_protection_r), this)); + m_maincpu->space(AS_PROGRAM).install_read_handler(0xc0db, 0xc0db, read8_delegate(FUNC(pturn_state::pturn_protection2_r), this)); */ } diff --git a/src/mame/includes/astrocde.h b/src/mame/includes/astrocde.h index 4e65e64a28c..67ccaa4e4ac 100644 --- a/src/mame/includes/astrocde.h +++ b/src/mame/includes/astrocde.h @@ -3,7 +3,10 @@ Bally Astrocade-based hardware ***************************************************************************/ +#include "sound/astrocde.h" #include "sound/samples.h" +#include "sound/votrax.h" + #define ASTROCADE_CLOCK (XTAL_14_31818MHz/2) #define AC_SOUND_PRESENT (0x01) @@ -25,20 +28,28 @@ public: astrocde_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), - m_videoram(*this, "videoram"), - m_protected_ram(*this, "protected_ram"), m_maincpu(*this, "maincpu"), m_subcpu(*this, "sub"), - m_samples(*this, "samples") { } + m_samples(*this, "samples"), + m_votrax(*this, "votrax"), + m_astrocade_sound1(*this, "astrocade1"), + m_videoram(*this, "videoram"), + m_protected_ram(*this, "protected_ram") { } + required_device m_maincpu; + optional_device m_subcpu; + optional_device m_samples; + optional_device m_votrax; + optional_device m_astrocade_sound1; optional_shared_ptr m_videoram; + optional_shared_ptr m_protected_ram; + UINT8 m_video_config; UINT8 m_sparkle[4]; char m_totalword[256]; char *m_totalword_ptr; char m_oldword[256]; int m_plural; - optional_shared_ptr m_protected_ram; UINT8 m_port_1_last; UINT8 m_port_2_last; UINT8 m_ram_write_enable; @@ -141,9 +152,14 @@ public: void execute_blit(address_space &space); void init_sparklestar(); virtual void machine_start(); - required_device m_maincpu; - optional_device m_subcpu; - optional_device m_samples; + + /*----------- defined in audio/wow.c -----------*/ + DECLARE_READ8_MEMBER( wow_speech_r ); + CUSTOM_INPUT_MEMBER( wow_speech_status_r ); + + /*----------- defined in audio/gorf.c -----------*/ + DECLARE_READ8_MEMBER( gorf_speech_r ); + CUSTOM_INPUT_MEMBER( gorf_speech_status_r ); protected: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); @@ -153,12 +169,6 @@ protected: extern const char *const wow_sample_names[]; -DECLARE_READ8_HANDLER( wow_speech_r ); -CUSTOM_INPUT( wow_speech_status_r ); - /*----------- defined in audio/gorf.c -----------*/ extern const char *const gorf_sample_names[]; - -DECLARE_READ8_HANDLER( gorf_speech_r ); -CUSTOM_INPUT( gorf_speech_status_r );