From d25e17ef6aeceb2cea444f4fd76e998795cdebd7 Mon Sep 17 00:00:00 2001 From: mooglyguy Date: Thu, 31 May 2018 15:38:19 +0200 Subject: [PATCH] dkong, gridlee, hyprolyb, jedi, mario, phoenix, pleids, polepos, redalert, tx1: machine().device removals. Also refactored tx1 to have separate sound-board devices. nw --- src/mame/audio/dkong.cpp | 11 +- src/mame/audio/gridlee.cpp | 88 +++--- src/mame/audio/hyprolyb.cpp | 8 +- src/mame/audio/hyprolyb.h | 5 +- src/mame/audio/jedi.cpp | 7 +- src/mame/audio/mario.cpp | 11 +- src/mame/audio/phoenix.cpp | 5 +- src/mame/audio/phoenix.h | 4 +- src/mame/audio/pleiads.cpp | 2 +- src/mame/audio/pleiads.h | 2 +- src/mame/audio/polepos.cpp | 2 +- src/mame/audio/redalert.cpp | 24 +- src/mame/audio/tx1.cpp | 583 +++++++++++++++++++++++++++++++++-- src/mame/audio/tx1.h | 84 ++++- src/mame/drivers/polepos.cpp | 2 +- src/mame/drivers/tx1.cpp | 568 ++-------------------------------- src/mame/includes/dkong.h | 18 +- src/mame/includes/gridlee.h | 2 +- src/mame/includes/jedi.h | 3 + src/mame/includes/redalert.h | 13 + src/mame/includes/tx1.h | 36 +-- 21 files changed, 784 insertions(+), 694 deletions(-) diff --git a/src/mame/audio/dkong.cpp b/src/mame/audio/dkong.cpp index 6c468c05db7..0b0dbfdbf15 100644 --- a/src/mame/audio/dkong.cpp +++ b/src/mame/audio/dkong.cpp @@ -5,7 +5,6 @@ #include "cpu/mcs48/mcs48.h" #include "sound/discrete.h" -#include "sound/tms5110.h" #include "speaker.h" @@ -1199,11 +1198,10 @@ Addresses found at @0x510, cpu2 */ -WRITE8_MEMBER(dkong_state::M58817_command_w) +WRITE8_MEMBER(dkong_state::m58817_command_w) { - m58817_device *m58817 = machine().device("tms"); - m58817->ctl_w(space, 0, data & 0x0f); - m58817->pdc_w((data>>4) & 0x01); + m_m58817->ctl_w(space, 0, data & 0x0f); + m_m58817->pdc_w((data>>4) & 0x01); /* FIXME 0x20 is CS */ } @@ -1232,7 +1230,6 @@ READ8_MEMBER(dkong_state::dkong_voice_status_r) READ8_MEMBER(dkong_state::dkong_tune_r) { - latch8_device *m_ls175_3d = machine().device("ls175.3d"); uint8_t page = m_dev_vp2->read(space, 0) & 0x47; if ( page & 0x40 ) @@ -1371,7 +1368,7 @@ MACHINE_CONFIG_START(dkong_state::radarscp1_audio) MCFG_DEVICE_MODIFY("soundcpu") MCFG_DEVICE_IO_MAP(radarscp1_sound_io_map) MCFG_MCS48_PORT_P1_IN_CB(READ8("virtual_p1", latch8_device, read)) - MCFG_MCS48_PORT_P1_OUT_CB(WRITE8(*this, dkong_state, M58817_command_w)) + MCFG_MCS48_PORT_P1_OUT_CB(WRITE8(*this, dkong_state, m58817_command_w)) MCFG_MCS48_PORT_P2_IN_CB(NOOP) /* virtual_p2 is not read -see memory map-, all bits are output bits */ diff --git a/src/mame/audio/gridlee.cpp b/src/mame/audio/gridlee.cpp index 1e98d311e3f..5f73a22fc45 100644 --- a/src/mame/audio/gridlee.cpp +++ b/src/mame/audio/gridlee.cpp @@ -29,7 +29,7 @@ gridlee_sound_device::gridlee_sound_device(const machine_config &mconfig, const m_tone_fraction(0), m_tone_volume(0), m_stream(nullptr), - m_samples(nullptr), + m_samples(*this, ":samples"), m_freq_to_step(0.0) { memset(m_sound_data, 0, sizeof(uint8_t)*24); @@ -45,8 +45,6 @@ void gridlee_sound_device::device_start() /* allocate the stream */ m_stream = stream_alloc(0, 1, machine().sample_rate()); - m_samples = machine().device("samples"); - m_freq_to_step = (double)(1 << 24) / (double)machine().sample_rate(); } @@ -73,7 +71,6 @@ void gridlee_sound_device::sound_stream_update(sound_stream &stream, stream_samp WRITE8_MEMBER( gridlee_sound_device::gridlee_sound_w ) { uint8_t *sound_data = m_sound_data; - samples_device *samples = m_samples; m_stream->update(); @@ -81,13 +78,13 @@ WRITE8_MEMBER( gridlee_sound_device::gridlee_sound_w ) { case 0x04: if (data == 0xef && sound_data[offset] != 0xef) - samples->start(4, 1); + m_samples->start(4, 1); else if (data != 0xef && sound_data[offset] == 0xef) - samples->stop(4); + m_samples->stop(4); // if (!(data & 0x01) && (sound_data[offset] & 0x01)) -// samples->start(5, 1); +// m_samples->start(5, 1); // else if ((data & 0x01) && !(sound_data[offset] & 0x01)) -// samples->stop(5); +// m_samples->stop(5); break; case 0x0c: @@ -95,9 +92,9 @@ WRITE8_MEMBER( gridlee_sound_device::gridlee_sound_w ) case 0x0e: case 0x0f: if ((data & 1) && !(sound_data[offset] & 1)) - samples->start(offset - 0x0c, 1 - sound_data[offset - 4]); + m_samples->start(offset - 0x0c, 1 - sound_data[offset - 4]); else if (!(data & 1) && (sound_data[offset] & 1)) - samples->stop(offset - 0x0c); + m_samples->stop(offset - 0x0c); break; case 0x08+0x08: @@ -112,18 +109,18 @@ WRITE8_MEMBER( gridlee_sound_device::gridlee_sound_w ) break; case 0x0b+0x08: -// tone_volume = (data | sound_data[0x0c+0x08]) ? 0xff : 0x00; +// m_tone_volume = (data | sound_data[0x0c+0x08]) ? 0xff : 0x00; break; case 0x0c+0x08: -// tone_volume = (data | sound_data[0x0b+0x08]) ? 0xff : 0x00; +// m_tone_volume = (data | sound_data[0x0b+0x08]) ? 0xff : 0x00; break; case 0x0d+0x08: // if (data) -// tone_step = freq_to_step * (double)(data * 11); +// m_tone_step = freq_to_step * (double)(data * 11); // else -// tone_step = 0; +// m_tone_step = 0; break; } sound_data[offset] = data; @@ -131,38 +128,35 @@ WRITE8_MEMBER( gridlee_sound_device::gridlee_sound_w ) #if 0 -{ -static int first = 1; -FILE *f; -f = fopen("sound.log", first ? "w" : "a"); -first = 0; -fprintf(f, "[%02x=%02x] %02x %02x %02x %02x %02x %02x %02x %02x - %02x %02x %02x %02x %02x %02x %02x %02x - %02x %02x %02x %02x %02x %02x %02x %02x\n", - offset,data, - sound_data[0], - sound_data[1], - sound_data[2], - sound_data[3], - sound_data[4], - sound_data[5], - sound_data[6], - sound_data[7], - sound_data[8], - sound_data[9], - sound_data[10], - sound_data[11], - sound_data[12], - sound_data[13], - sound_data[14], - sound_data[15], - sound_data[16], - sound_data[17], - sound_data[18], - sound_data[19], - sound_data[20], - sound_data[21], - sound_data[22], - sound_data[23]); -fclose(f); -} + static int first = 1; + FILE *f = fopen("sound.log", first ? "w" : "a"); + first = 0; + fprintf(f, "[%02x=%02x] %02x %02x %02x %02x %02x %02x %02x %02x - %02x %02x %02x %02x %02x %02x %02x %02x - %02x %02x %02x %02x %02x %02x %02x %02x\n", + offset,data, + sound_data[0], + sound_data[1], + sound_data[2], + sound_data[3], + sound_data[4], + sound_data[5], + sound_data[6], + sound_data[7], + sound_data[8], + sound_data[9], + sound_data[10], + sound_data[11], + sound_data[12], + sound_data[13], + sound_data[14], + sound_data[15], + sound_data[16], + sound_data[17], + sound_data[18], + sound_data[19], + sound_data[20], + sound_data[21], + sound_data[22], + sound_data[23]); + fclose(f); #endif } diff --git a/src/mame/audio/hyprolyb.cpp b/src/mame/audio/hyprolyb.cpp index c99d1ec05eb..4d4dc9f2365 100644 --- a/src/mame/audio/hyprolyb.cpp +++ b/src/mame/audio/hyprolyb.cpp @@ -9,7 +9,9 @@ DEFINE_DEVICE_TYPE(HYPROLYB_ADPCM, hyprolyb_adpcm_device, "hyprolyb_adpcm", "Hyp hyprolyb_adpcm_device::hyprolyb_adpcm_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, HYPROLYB_ADPCM, tag, owner, clock) , device_sound_interface(mconfig, *this) + , m_audiocpu(*this, ":audiocpu") , m_soundlatch2(*this, ":soundlatch2") + , m_msm(*this, ":msm") , m_adpcm_ready(0) , m_adpcm_busy(0) , m_vck_ready(0) @@ -23,8 +25,6 @@ hyprolyb_adpcm_device::hyprolyb_adpcm_device(const machine_config &mconfig, cons void hyprolyb_adpcm_device::device_start() { - m_space = &machine().device("audiocpu")->space(AS_PROGRAM); - m_msm = machine().device("msm"); save_item(NAME(m_adpcm_ready)); // only bootlegs save_item(NAME(m_adpcm_busy)); save_item(NAME(m_vck_ready)); @@ -43,7 +43,7 @@ void hyprolyb_adpcm_device::device_reset() WRITE8_MEMBER( hyprolyb_adpcm_device::write ) { - m_soundlatch2->write(*m_space, offset, data); + m_soundlatch2->write(m_audiocpu->space(AS_PROGRAM), offset, data); m_adpcm_ready = 0x80; } @@ -73,7 +73,7 @@ READ8_MEMBER( hyprolyb_adpcm_device::ready_r ) READ8_MEMBER( hyprolyb_adpcm_device::data_r ) { m_adpcm_ready = 0x00; - return m_soundlatch2->read(*m_space, offset); + return m_soundlatch2->read(m_audiocpu->space(AS_PROGRAM), offset); } void hyprolyb_adpcm_device::vck_callback( int st ) diff --git a/src/mame/audio/hyprolyb.h b/src/mame/audio/hyprolyb.h index 5be7d39a10c..05b0770239c 100644 --- a/src/mame/audio/hyprolyb.h +++ b/src/mame/audio/hyprolyb.h @@ -22,7 +22,6 @@ public: READ8_MEMBER( data_r ); void vck_callback( int st ); - void hyprolyb_adpcm(machine_config &config); protected: // device-level overrides virtual void device_start() override; @@ -33,9 +32,9 @@ protected: private: // internal state + required_device m_audiocpu; required_device m_soundlatch2; - msm5205_device *m_msm; - address_space *m_space; + required_device m_msm; uint8_t m_adpcm_ready; // only bootlegs uint8_t m_adpcm_busy; uint8_t m_vck_ready; diff --git a/src/mame/audio/jedi.cpp b/src/mame/audio/jedi.cpp index 7a14d89232f..a53e386819b 100644 --- a/src/mame/audio/jedi.cpp +++ b/src/mame/audio/jedi.cpp @@ -11,7 +11,6 @@ #include "emu.h" #include "includes/jedi.h" #include "cpu/m6502/m6502.h" -#include "sound/tms5220.h" #include "sound/pokey.h" #include "speaker.h" @@ -136,8 +135,7 @@ WRITE8_MEMBER(jedi_state::speech_strobe_w) if ((new_speech_strobe_state != m_speech_strobe_state) && new_speech_strobe_state) { - tms5220_device *tms5220 = machine().device("tms"); - tms5220->data_w(space, 0, *m_speech_data); + m_tms->data_w(space, 0, *m_speech_data); } m_speech_strobe_state = new_speech_strobe_state; } @@ -145,8 +143,7 @@ WRITE8_MEMBER(jedi_state::speech_strobe_w) READ8_MEMBER(jedi_state::speech_ready_r) { - tms5220_device *tms5220 = machine().device("tms"); - return (tms5220->readyq_r()) << 7; + return m_tms->readyq_r() << 7; } diff --git a/src/mame/audio/mario.cpp b/src/mame/audio/mario.cpp index b95ea00f001..f1e080824d4 100644 --- a/src/mame/audio/mario.cpp +++ b/src/mame/audio/mario.cpp @@ -8,7 +8,9 @@ #include "sound/ay8910.h" #include "speaker.h" +#if !OLD_SOUND #include "audio/nl_mario.h" +#endif /**************************************************************** * @@ -40,10 +42,7 @@ #define I8035_P2_W_AH(M,B,D) I8035_P2_W(M,ACTIVEHIGH_PORT_BIT(I8035_P2_R(M),B,(D))) -#if !OLD_SOUND - - -#else +#if OLD_SOUND /**************************************************************** * * Discrete Sound defines @@ -596,7 +595,7 @@ WRITE8_MEMBER(mario_state::mario_sh3_w) break; case 7: /* skid */ #if OLD_SOUND - machine().device("discrete")->write(space, DS_SOUND7_INP, data & 1); + m_discrete->write(space, DS_SOUND7_INP, data & 1); #else m_audio_snd7->write((data & 1) ^ 1); #endif @@ -661,7 +660,7 @@ MACHINE_CONFIG_START(mario_state::mario_audio) #if OLD_SOUND MCFG_DEVICE_ADD("discrete", DISCRETE) - MCFG_DISCRETE_INTF(mario) + MCFG_DISCRETE_INTF(mario_discrete) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1) #else MCFG_DEVICE_ADD("snd_nl", NETLIST_SOUND, 48000) diff --git a/src/mame/audio/phoenix.cpp b/src/mame/audio/phoenix.cpp index 7b7fd0d4915..f77a26717f7 100644 --- a/src/mame/audio/phoenix.cpp +++ b/src/mame/audio/phoenix.cpp @@ -53,6 +53,8 @@ DEFINE_DEVICE_TYPE(PHOENIX_SOUND, phoenix_sound_device, "phoenix_sound", "Phoeni phoenix_sound_device::phoenix_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PHOENIX_SOUND, tag, owner, clock) , device_sound_interface(mconfig, *this) + , m_discrete(*this, ":discrete") + , m_tms(*this, ":tms") { } @@ -70,9 +72,6 @@ void phoenix_sound_device::device_start() memset(&m_c25_state, 0, sizeof(m_c25_state)); memset(&m_noise_state, 0, sizeof(m_noise_state)); - m_discrete = machine().device("discrete"); - m_tms = machine().device("tms"); - m_poly18 = std::make_unique(1ul << (18-5)); shiftreg = 0; diff --git a/src/mame/audio/phoenix.h b/src/mame/audio/phoenix.h index c59d8fb1640..217b6134116 100644 --- a/src/mame/audio/phoenix.h +++ b/src/mame/audio/phoenix.h @@ -47,8 +47,8 @@ private: uint8_t m_sound_latch_a; sound_stream * m_channel; std::unique_ptr m_poly18; - discrete_device *m_discrete; - tms36xx_device *m_tms; + required_device m_discrete; + required_device m_tms; int update_c24(int samplerate); int update_c25(int samplerate); diff --git a/src/mame/audio/pleiads.cpp b/src/mame/audio/pleiads.cpp index d97df0f2da9..50b9a0f57ee 100644 --- a/src/mame/audio/pleiads.cpp +++ b/src/mame/audio/pleiads.cpp @@ -28,6 +28,7 @@ pleiads_sound_device::pleiads_sound_device(const machine_config &mconfig, const pleiads_sound_device::pleiads_sound_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, type, tag, owner, clock), device_sound_interface(mconfig, *this), + m_tms(*this, ":tms"), m_channel(nullptr), m_sound_latch_a(0), m_sound_latch_b(0), @@ -620,7 +621,6 @@ void pleiads_sound_device::common_start() int i, j; uint32_t shiftreg; - m_tms = machine().device("tms"); m_pc4.level = PC4_MIN; m_poly18 = make_unique_clear(1ul << (18-5)); diff --git a/src/mame/audio/pleiads.h b/src/mame/audio/pleiads.h index 4a6f34dfdb1..aab507076e2 100644 --- a/src/mame/audio/pleiads.h +++ b/src/mame/audio/pleiads.h @@ -65,7 +65,7 @@ protected: inline int noise(int samplerate); // internal state - tms36xx_device *m_tms; + required_device m_tms; sound_stream *m_channel; int m_sound_latch_a; diff --git a/src/mame/audio/polepos.cpp b/src/mame/audio/polepos.cpp index f911dd2ae2e..c1250ad35c6 100644 --- a/src/mame/audio/polepos.cpp +++ b/src/mame/audio/polepos.cpp @@ -270,7 +270,7 @@ void polepos_sound_device::sound_stream_update(sound_stream &stream, stream_samp } /* determine the effective clock rate */ - clock = (machine().device("maincpu")->unscaled_clock() / 16) * ((m_sample_msb + 1) * 64 + m_sample_lsb + 1) / (64*64); + clock = (unscaled_clock() / 16) * ((m_sample_msb + 1) * 64 + m_sample_lsb + 1) / (64*64); step = (clock << 12) / OUTPUT_RATE; /* determine the volume */ diff --git a/src/mame/audio/redalert.cpp b/src/mame/audio/redalert.cpp index fa569553689..f0194492b61 100644 --- a/src/mame/audio/redalert.cpp +++ b/src/mame/audio/redalert.cpp @@ -12,12 +12,10 @@ #include "emu.h" #include "includes/redalert.h" -#include "cpu/i8085/i8085.h" #include "cpu/m6800/m6800.h" #include "cpu/m6502/m6502.h" #include "machine/rescap.h" #include "machine/6821pia.h" -#include "sound/ay8910.h" #include "speaker.h" @@ -79,7 +77,6 @@ WRITE8_MEMBER(redalert_state::redalert_audio_command_w) WRITE8_MEMBER(redalert_state::redalert_AY8910_w) { - ay8910_device *ay8910 = machine().device("aysnd"); /* BC2 is connected to a pull-up resistor, so BC2=1 always */ switch (data & 0x03) { @@ -89,7 +86,7 @@ WRITE8_MEMBER(redalert_state::redalert_AY8910_w) /* BC1=1, BDIR=0 : read from PSG */ case 0x01: - m_ay8910_latch_1 = ay8910->data_r(space, 0); + m_ay8910_latch_1 = m_ay8910->data_r(space, 0); break; /* BC1=0, BDIR=1 : write to PSG */ @@ -97,7 +94,7 @@ WRITE8_MEMBER(redalert_state::redalert_AY8910_w) case 0x02: case 0x03: default: - ay8910->data_address_w(space, data, m_ay8910_latch_2); + m_ay8910->data_address_w(space, data, m_ay8910_latch_2); break; } } @@ -146,7 +143,7 @@ void redalert_state::sound_start() WRITE8_MEMBER(redalert_state::redalert_voice_command_w) { m_soundlatch2->write(space, 0, (data & 0x78) >> 3); - machine().device("voice")->execute().set_input_line(I8085_RST75_LINE, (~data & 0x80) ? ASSERT_LINE : CLEAR_LINE); + m_voicecpu->set_input_line(I8085_RST75_LINE, (~data & 0x80) ? ASSERT_LINE : CLEAR_LINE); } @@ -272,35 +269,32 @@ READ8_MEMBER(redalert_state::demoneye_ay8910_latch_2_r) WRITE8_MEMBER(redalert_state::demoneye_ay8910_data_w) { - ay8910_device *ay1 = machine().device("ay1"); - ay8910_device *ay2 = machine().device("ay2"); - switch (m_ay8910_latch_1 & 0x03) { case 0x00: if (m_ay8910_latch_1 & 0x10) - ay1->data_w(space, 0, data); + m_ay[0]->data_w(space, 0, data); if (m_ay8910_latch_1 & 0x20) - ay2->data_w(space, 0, data); + m_ay[1]->data_w(space, 0, data); break; case 0x01: if (m_ay8910_latch_1 & 0x10) - m_ay8910_latch_2 = ay1->data_r(space, 0); + m_ay8910_latch_2 = m_ay[0]->data_r(space, 0); if (m_ay8910_latch_1 & 0x20) - m_ay8910_latch_2 = ay2->data_r(space, 0); + m_ay8910_latch_2 = m_ay[1]->data_r(space, 0); break; case 0x03: if (m_ay8910_latch_1 & 0x10) - ay1->address_w(space, 0, data); + m_ay[0]->address_w(space, 0, data); if (m_ay8910_latch_1 & 0x20) - ay2->address_w(space, 0, data); + m_ay[1]->address_w(space, 0, data); break; diff --git a/src/mame/audio/tx1.cpp b/src/mame/audio/tx1.cpp index b67bfcf42b5..53ff934f121 100644 --- a/src/mame/audio/tx1.cpp +++ b/src/mame/audio/tx1.cpp @@ -7,10 +7,13 @@ ***************************************************************************/ #include "emu.h" -#include "tx1.h" -#include "sound/ay8910.h" +#include "audio/tx1.h" +#include "cpu/z80/z80.h" +#include "includes/tx1.h" +#include "machine/i8255.h" #include "video/resnet.h" +#include "speaker.h" /************************************* @@ -53,6 +56,7 @@ static const double tx1_engine_gains[16] = DEFINE_DEVICE_TYPE(TX1_SOUND, tx1_sound_device, "tx1_sound", "TX-1 Custom Sound") +DEFINE_DEVICE_TYPE(TX1J_SOUND, tx1j_sound_device, "tx1j_sound", "TX-1 Custom Sound (Japan)") tx1_sound_device::tx1_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tx1_sound_device(mconfig, TX1_SOUND, tag, owner, clock) @@ -62,6 +66,8 @@ tx1_sound_device::tx1_sound_device(const machine_config &mconfig, const char *ta tx1_sound_device::tx1_sound_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, type, tag, owner, clock), device_sound_interface(mconfig, *this), + m_audiocpu(*this, "audio_cpu"), + m_z80_ram(*this, "z80_ram"), m_stream(nullptr), m_freq_to_step(0), m_step0(0), @@ -114,6 +120,104 @@ void tx1_sound_device::device_reset() m_step0 = m_step1 = m_step2 = 0; } +/* Main CPU and Z80 synchronisation */ +WRITE16_MEMBER( tx1_sound_device::z80_busreq_w ) +{ + m_audiocpu->set_input_line(INPUT_LINE_HALT, (data & 1) ? CLEAR_LINE : ASSERT_LINE); +} + +/* Z80 can trigger its own interrupts */ +WRITE8_MEMBER( tx1_sound_device::z80_intreq_w ) +{ + m_audiocpu->set_input_line(0, HOLD_LINE); +} + +READ16_MEMBER( tx1_sound_device::z80_shared_r ) +{ + return m_audiocpu->space(AS_PROGRAM).read_byte(offset); +} + +WRITE16_MEMBER( tx1_sound_device::z80_shared_w ) +{ + m_audiocpu->space(AS_PROGRAM).write_byte(offset, data & 0xff); +} + +/* + (TODO) TS: Connected in place of dipswitch A bit 0 + Accessed on startup as some sort of acknowledgement +*/ +WRITE8_MEMBER( tx1_sound_device::ts_w ) +{ +// TS = 1; + m_z80_ram[offset] = data; +} + +READ8_MEMBER( tx1_sound_device::ts_r ) +{ +// TS = 1; + return m_z80_ram[offset]; +} + +static uint8_t bit_reverse8(uint8_t val) +{ + val = ((val & 0xF0) >> 4) | ((val & 0x0F) << 4); + val = ((val & 0xCC) >> 2) | ((val & 0x33) << 2); + val = ((val & 0xAA) >> 1) | ((val & 0x55) << 1); + + return val; +} + +READ16_MEMBER( tx1_sound_device::dipswitches_r ) +{ + return (ioport("DSW")->read() & 0xfffe) | m_ts; +} + +// Tazmi TZ2103 custom 4-channel A/D converter @ 7.5 MHz +READ8_MEMBER( buggyboy_sound_device::bb_analog_r ) +{ + if (offset == 0) + return bit_reverse8(((ioport("AN_ACCELERATOR")->read() & 0xf) << 4) | ioport("AN_STEERING")->read()); + else + return bit_reverse8((ioport("AN_BRAKE")->read() & 0xf) << 4); +} + +READ8_MEMBER( buggyboyjr_sound_device::bbjr_analog_r ) +{ + if (offset == 0) + return ((ioport("AN_ACCELERATOR")->read() & 0xf) << 4) | ioport("AN_STEERING")->read(); + else + return (ioport("AN_BRAKE")->read() & 0xf) << 4; +} + +WRITE8_MEMBER( tx1_sound_device::tx1_coin_cnt_w ) +{ + machine().bookkeeping().coin_counter_w(0, data & 0x80); + machine().bookkeeping().coin_counter_w(1, data & 0x40); +// machine().bookkeeping().coin_counter_w(2, data & 0x40); +} + +WRITE8_MEMBER( buggyboy_sound_device::bb_coin_cnt_w ) +{ + machine().bookkeeping().coin_counter_w(0, data & 0x01); + machine().bookkeeping().coin_counter_w(1, data & 0x02); +// machine().bookkeeping().coin_counter_w(2, data & 0x04); +} + +WRITE8_MEMBER( tx1_sound_device::tx1_ppi_latch_w ) +{ + m_ppi_latch_a = ((ioport("AN_BRAKE")->read() & 0xf) << 4) | (ioport("AN_ACCELERATOR")->read() & 0xf); + m_ppi_latch_b = ioport("AN_STEERING")->read(); +} + +READ8_MEMBER( tx1_sound_device::tx1_ppi_porta_r ) +{ + return m_ppi_latch_a; +} + +READ8_MEMBER( tx1_sound_device::tx1_ppi_portb_r ) +{ + return ioport("PPI_PORTD")->read() | m_ppi_latch_b; +} WRITE8_MEMBER( tx1_sound_device::pit8253_w ) { @@ -153,6 +257,12 @@ READ8_MEMBER( tx1_sound_device::pit8253_r ) return 0; } +/* Periodic Z80 interrupt */ +INTERRUPT_GEN_MEMBER(tx1_sound_device::z80_irq) +{ + m_audiocpu->set_input_line(0, HOLD_LINE); +} + /*************************************************************************** AY-8910 port mappings: @@ -294,6 +404,171 @@ void tx1_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t } } +void tx1_sound_device::tx1_sound_prg(address_map &map) +{ + map(0x0000, 0x1fff).rom(); + map(0x3000, 0x37ff).ram().mirror(0x800).share("z80_ram"); + map(0x4000, 0x4000).w(this, FUNC(tx1_sound_device::z80_intreq_w)); + map(0x5000, 0x5003).rw("ppi8255", FUNC(i8255_device::read), FUNC(i8255_device::write)); + map(0x6000, 0x6003).rw(this, FUNC(tx1_sound_device::pit8253_r), FUNC(tx1_sound_device::pit8253_w)); + map(0x7000, 0x7fff).w(this, FUNC(tx1_sound_device::tx1_ppi_latch_w)); + map(0xb000, 0xbfff).rw(this, FUNC(tx1_sound_device::ts_r), FUNC(tx1_sound_device::ts_w)); +} + +void tx1_sound_device::tx1_sound_io(address_map &map) +{ + map.global_mask(0xff); + map(0x40, 0x41).w("aysnd", FUNC(ay8910_device::data_address_w)); +} + +INPUT_PORTS_START( tx1_inputs ) + PORT_START("DSW") + /* Dipswitch DS.2 is 6 switches but "maps" to switches 2 to 8 (at 6P according to the manual) */ + PORT_DIPNAME( 0x000c, 0x0000, "Game Cost" ) PORT_DIPLOCATION("DS.2:1,2") + PORT_DIPSETTING( 0x0000, "1 Coin Unit for 1 Credit" ) + PORT_DIPSETTING( 0x0004, "2 Coin Units for 1 Credit" ) + PORT_DIPSETTING( 0x0008, "3 Coin Units for 1 Credit" ) + PORT_DIPSETTING( 0x000c, "4 Coin Units for 1 Credit" ) + + PORT_DIPNAME( 0x0010, 0x0000, "Left Coin Mechanism" ) PORT_DIPLOCATION("DS.2:3") + PORT_DIPSETTING( 0x0000, "1 Coin for 1 Coin Unit" ) + PORT_DIPSETTING( 0x0010, "1 Coin for 2 Coin Units" ) + + PORT_DIPNAME( 0x0060, 0x0000, "Right Coin Mechanism" ) PORT_DIPLOCATION("DS.2:4,5") + PORT_DIPSETTING( 0x0000, "1 Coin for 1 Coin Unit" ) + PORT_DIPSETTING( 0x0020, "1 Coin for 4 Coin Units" ) + PORT_DIPSETTING( 0x0040, "1 Coin for 5 Coin Units" ) + PORT_DIPSETTING( 0x0060, "1 Coin for 6 Coin Units" ) + + PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DS.2:6") /* Manual states switches 6 to 8 unused (physically it's only 6 switches) */ + PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + + /* Dipswitch DS.1 is 8 switches (at 8P according to the manual) */ + PORT_DIPNAME( 0x0700, 0x0300, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("DS.1:1,2,3") + PORT_DIPSETTING( 0x0000, "A (Easiest)" ) + PORT_DIPSETTING( 0x0100, "B" ) + PORT_DIPSETTING( 0x0200, "C" ) + PORT_DIPSETTING( 0x0300, "D" ) + PORT_DIPSETTING( 0x0400, "E" ) + PORT_DIPSETTING( 0x0500, "F" ) + PORT_DIPSETTING( 0x0600, "G" ) + PORT_DIPSETTING( 0x0700, "H (Hardest)" ) + + PORT_DIPNAME( 0x1800, 0x1000, DEF_STR( Game_Time ) ) PORT_DIPLOCATION("DS.1:4,5") + PORT_DIPSETTING( 0x0000, "A (Longest)" ) + PORT_DIPSETTING( 0x0800, "B" ) + PORT_DIPSETTING( 0x1000, "C" ) + PORT_DIPSETTING( 0x1800, "D (Shortest)" ) + + PORT_DIPNAME( 0xe000, 0xe000, "Bonus Adder" ) PORT_DIPLOCATION("DS.1:6,7,8") + PORT_DIPSETTING( 0x0000, "No Bonus" ) + PORT_DIPSETTING( 0x2000, "2 Coin Units for 1 Credit" ) + PORT_DIPSETTING( 0x4000, "3 Coin Units for 1 Credit" ) + PORT_DIPSETTING( 0x6000, "4 Coin Units for 1 Credit" ) + PORT_DIPSETTING( 0x8000, "5 Coin Units for 1 Credit" ) + PORT_DIPSETTING( 0xa000, "4 Coin Units for 2 Credit" ) + PORT_DIPSETTING( 0xc000, DEF_STR( Free_Play ) ) + PORT_DIPSETTING( 0xe000, "No Bonus" ) + + PORT_START("AN_STEERING") + PORT_BIT( 0x0f, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) + + PORT_START("AN_ACCELERATOR") + PORT_BIT( 0x1f, 0x00, IPT_PEDAL ) PORT_MINMAX(0x00,0x1f) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) + + PORT_START("AN_BRAKE") + PORT_BIT( 0x1f, 0x00, IPT_PEDAL2 ) PORT_MINMAX(0x00,0x1f) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) + + PORT_START("PPI_PORTC") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) + PORT_SERVICE( 0x04, IP_ACTIVE_HIGH ) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Gear Change") PORT_CODE(KEYCODE_SPACE) PORT_TOGGLE + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN3 ) + + PORT_START("PPI_PORTD") + /* Wire jumper setting on sound PCB - actually unpopulated 4 switch DS.3 */ + PORT_DIPNAME( 0xf0, 0x80, "Sound PCB Jumper (DS.3)" ) + PORT_DIPSETTING( 0x10, "1" ) + PORT_DIPSETTING( 0x20, "2" ) + PORT_DIPSETTING( 0x40, "3" ) + PORT_DIPSETTING( 0x80, "4" ) +INPUT_PORTS_END + +ioport_constructor tx1_sound_device::device_input_ports() const +{ + return INPUT_PORTS_NAME(tx1_inputs); +} + +INPUT_PORTS_START( tx1j_inputs ) + PORT_INCLUDE(tx1_inputs) + + PORT_MODIFY("DSW") + /* Dipswitch DS.2 is 6 switches but "maps" to switches 2 to 8 (at 6P according to the manual) */ + PORT_DIPNAME( 0x001c, 0x0000, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("DS.2:1,2,3") /* As silkscreened on the PCB */ + PORT_DIPSETTING( 0x0008, DEF_STR( 3C_1C ) ) + PORT_DIPSETTING( 0x0004, DEF_STR( 2C_1C ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x001c, DEF_STR( 2C_3C ) ) + PORT_DIPSETTING( 0x000c, DEF_STR( 1C_2C ) ) + PORT_DIPSETTING( 0x0010, DEF_STR( 1C_3C ) ) + PORT_DIPSETTING( 0x0014, DEF_STR( 1C_5C ) ) + PORT_DIPSETTING( 0x0018, DEF_STR( 1C_6C ) ) + + PORT_DIPNAME( 0x00e0, 0x0000, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("DS.2:4,5,6") /* As silkscreened on the PCB */ + PORT_DIPSETTING( 0x0040, DEF_STR( 3C_1C ) ) + PORT_DIPSETTING( 0x0020, DEF_STR( 2C_1C ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x00e0, DEF_STR( 2C_3C ) ) + PORT_DIPSETTING( 0x0060, DEF_STR( 1C_2C ) ) + PORT_DIPSETTING( 0x0080, DEF_STR( 1C_3C ) ) + PORT_DIPSETTING( 0x00a0, DEF_STR( 1C_5C ) ) + PORT_DIPSETTING( 0x00c0, DEF_STR( 1C_6C ) ) + + /* Dipswitch DS.1 is 8 switches (at 8P according to the manual) */ + PORT_DIPNAME( 0xe000, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DS.1:6,7,8") + PORT_DIPSETTING( 0x0000, "0" ) + PORT_DIPSETTING( 0x2000, "1" ) + PORT_DIPSETTING( 0x4000, "2" ) + PORT_DIPSETTING( 0x6000, "3" ) + PORT_DIPSETTING( 0x8000, "4" ) + PORT_DIPSETTING( 0xa000, "5" ) + PORT_DIPSETTING( 0xc000, "6" ) + PORT_DIPSETTING( 0xe000, "7" ) +INPUT_PORTS_END + +ioport_constructor tx1j_sound_device::device_input_ports() const +{ + return INPUT_PORTS_NAME(tx1j_inputs); +} + +MACHINE_CONFIG_START(tx1_sound_device::device_add_mconfig) + MCFG_DEVICE_ADD("audio_cpu", Z80, TX1_PIXEL_CLOCK / 2) + MCFG_DEVICE_PROGRAM_MAP(tx1_sound_prg) + MCFG_DEVICE_IO_MAP(tx1_sound_io) + MCFG_DEVICE_PERIODIC_INT_DEVICE(DEVICE_SELF, tx1_sound_device, z80_irq, TX1_PIXEL_CLOCK / 4 / 2048 / 2) + + MCFG_DEVICE_ADD("ppi8255", I8255A, 0) + MCFG_I8255_IN_PORTA_CB(READ8(*this, tx1_sound_device, tx1_ppi_porta_r)) + MCFG_I8255_IN_PORTB_CB(READ8(*this, tx1_sound_device, tx1_ppi_portb_r)) + MCFG_I8255_IN_PORTC_CB(IOPORT("PPI_PORTC")) + MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, tx1_sound_device, tx1_coin_cnt_w)) + + SPEAKER(config, "frontleft", -0.2, 0.0, 1.0); + SPEAKER(config, "frontright", 0.2, 0.0, 1.0); +// SPEAKER(config, "rearleft", -0.2, 0.0, -0.5); /* Atari TX-1 TM262 manual shows 4 speakers (TX-1 Audio PCB Assembly A042016-01 A) */ +// SPEAKER(config, "rearright", 0.2, 0.0, -0.5); + + MCFG_DEVICE_ADD("aysnd", AY8910, TX1_PIXEL_CLOCK / 8) + MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(*this, tx1_sound_device, ay8910_a_w)) + MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(*this, tx1_sound_device, ay8910_b_w)) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "frontleft", 0.1) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "frontright", 0.1) + + MCFG_SOUND_ROUTE(0, "frontleft", 0.2) + MCFG_SOUND_ROUTE(1, "frontright", 0.2) +MACHINE_CONFIG_END /************************************* * @@ -336,9 +611,21 @@ static const double bb_engine_gains[16] = }; DEFINE_DEVICE_TYPE(BUGGYBOY_SOUND, buggyboy_sound_device, "buggyboy_sound", "Buggy Boy Custom Sound") +DEFINE_DEVICE_TYPE(BUGGYBOYJR_SOUND, buggyboyjr_sound_device, "buggyboyjr_sound", "Buggy Boy Jr. Custom Sound") buggyboy_sound_device::buggyboy_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : tx1_sound_device(mconfig, BUGGYBOY_SOUND, tag, owner, clock) + : buggyboy_sound_device(mconfig, BUGGYBOY_SOUND, tag, owner, clock) +{ +} + +buggyboy_sound_device::buggyboy_sound_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) + : tx1_sound_device(mconfig, type, tag, owner, clock) + , m_ym(*this, "ym%u", 1U) +{ +} + +buggyboyjr_sound_device::buggyboyjr_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : buggyboy_sound_device(mconfig, BUGGYBOYJR_SOUND, tag, owner, clock) { } @@ -435,15 +722,11 @@ WRITE8_MEMBER( buggyboy_sound_device::ym2_a_w ) WRITE8_MEMBER( buggyboy_sound_device::ym2_b_w ) { - device_t *ym1 = machine().device("ym1"); - device_t *ym2 = machine().device("ym2"); - double gain; - m_stream->update(); m_ym2_outputb = data ^ 0xff; - if (!strcmp(machine().system().name, "buggyboyjr")) + if (has_coin_counters()) { machine().bookkeeping().coin_counter_w(0, data & 0x01); machine().bookkeeping().coin_counter_w(1, data & 0x02); @@ -456,19 +739,16 @@ WRITE8_MEMBER( buggyboy_sound_device::ym2_b_w ) */ /* Rear left speaker */ - device_sound_interface *sound; - ym1->interface(sound); - gain = data & 0x80 ? 1.0 : 2.0; - sound->set_output_gain(0, gain); - sound->set_output_gain(1, gain); - sound->set_output_gain(2, gain); + double gain = data & 0x80 ? 1.0 : 2.0; + m_ym[0]->set_output_gain(0, gain); + m_ym[0]->set_output_gain(1, gain); + m_ym[0]->set_output_gain(2, gain); /* Rear right speaker */ - ym2->interface(sound); gain = data & 0x40 ? 1.0 : 2.0; - sound->set_output_gain(0, gain); - sound->set_output_gain(1, gain); - sound->set_output_gain(2, gain); + m_ym[1]->set_output_gain(0, gain); + m_ym[1]->set_output_gain(1, gain); + m_ym[1]->set_output_gain(2, gain); } @@ -556,3 +836,270 @@ void buggyboy_sound_device::sound_stream_update(sound_stream &stream, stream_sam m_step1 += step_1; } } + +/* Buggy Boy Sound PCB TC033A */ +void buggyboy_sound_device::buggyboy_sound_prg(address_map &map) +{ + map(0x0000, 0x3fff).rom(); + map(0x4000, 0x47ff).ram().share("z80_ram"); + map(0x6000, 0x6001).r(this, FUNC(buggyboy_sound_device::bb_analog_r)); + map(0x6800, 0x6803).rw("ppi8255", FUNC(i8255_device::read), FUNC(i8255_device::write)); + map(0x7000, 0x7003).rw(this, FUNC(buggyboy_sound_device::pit8253_r), FUNC(buggyboy_sound_device::pit8253_w)); + map(0x7800, 0x7800).w(this, FUNC(tx1_sound_device::z80_intreq_w)); + map(0xc000, 0xc7ff).rw(this, FUNC(tx1_sound_device::ts_r), FUNC(tx1_sound_device::ts_w)); +} + +/* Buggy Boy Jr Sound PCB TC043 */ +void buggyboyjr_sound_device::buggybjr_sound_prg(address_map &map) +{ + map(0x0000, 0x3fff).rom(); + map(0x4000, 0x47ff).ram().share("z80_ram"); + map(0x5000, 0x5003).rw(this, FUNC(buggyboy_sound_device::pit8253_r), FUNC(buggyboy_sound_device::pit8253_w)); + map(0x6000, 0x6001).r(this, FUNC(buggyboyjr_sound_device::bbjr_analog_r)); + map(0x7000, 0x7000).w(this, FUNC(tx1_sound_device::z80_intreq_w)); + map(0xc000, 0xc7ff).rw(this, FUNC(tx1_sound_device::ts_r), FUNC(tx1_sound_device::ts_w)); +} + +/* Common */ +void buggyboy_sound_device::buggyboy_sound_io(address_map &map) +{ + map.global_mask(0xff); + map(0x40, 0x40).r("ym1", FUNC(ay8910_device::data_r)); + map(0x40, 0x41).w("ym1", FUNC(ay8910_device::data_address_w)); + map(0x80, 0x80).r("ym2", FUNC(ay8910_device::data_r)); + map(0x80, 0x81).w("ym2", FUNC(ay8910_device::data_address_w)); +} + +INPUT_PORTS_START( buggyboy_inputs ) + PORT_START("DSW") + /* Dipswitch 0 is unconnected */ + PORT_DIPNAME( 0x0003, 0x0003, "Do not change DSW2 1&2" ) PORT_DIPLOCATION("SW2:1,2") /* Listed in manual as "Do Not Change" */ + PORT_DIPSETTING( 0x0000, "0" ) + PORT_DIPSETTING( 0x0001, "1" ) + PORT_DIPSETTING( 0x0002, "2" ) + PORT_DIPSETTING( 0x0003, "3" ) + + PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Language ) ) PORT_DIPLOCATION("SW2:3") /* Language of game instructions */ + PORT_DIPSETTING( 0x0004, DEF_STR( English ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( Japanese ) ) + + PORT_DIPNAME( 0x0008, 0x0008, "Do not Change DSW2 4" ) PORT_DIPLOCATION("SW2:4") /* Listed in manual as "Do Not Change" */ + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0008, DEF_STR( On ) ) + + PORT_DIPNAME( 0x0030, 0x0010, "Time Rank" ) PORT_DIPLOCATION("SW2:5,6") + PORT_DIPSETTING( 0x0000, "A (Longest)" ) + PORT_DIPSETTING( 0x0010, "B" ) + PORT_DIPSETTING( 0x0020, "C" ) + PORT_DIPSETTING( 0x0030, "D (Shortest)" ) + + PORT_DIPNAME( 0x00c0, 0x0040, "Game Rank" ) PORT_DIPLOCATION("SW2:7,8") + PORT_DIPSETTING( 0x0000, "A (Easy)") + PORT_DIPSETTING( 0x0040, "B" ) + PORT_DIPSETTING( 0x0080, "C" ) + PORT_DIPSETTING( 0x00c0, "D (Difficult)" ) + + PORT_DIPNAME( 0xe000, 0x0000, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:8,7,6") + PORT_DIPSETTING( 0x4000, DEF_STR( 3C_1C ) ) + PORT_DIPSETTING( 0x2000, DEF_STR( 2C_1C ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0xc000, DEF_STR( 2C_3C ) ) + PORT_DIPSETTING( 0x6000, DEF_STR( 1C_2C ) ) + PORT_DIPSETTING( 0x8000, DEF_STR( 1C_5C ) ) + PORT_DIPSETTING( 0xa000, DEF_STR( 1C_6C ) ) + PORT_DIPSETTING( 0xe000, "Free-Play" ) + + PORT_DIPNAME( 0x1800, 0x0800, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:5,4") + PORT_DIPSETTING( 0x0800, DEF_STR( 2C_1C ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x1000, DEF_STR( 1C_2C ) ) + PORT_DIPSETTING( 0x1800, DEF_STR( 1C_5C ) ) + + PORT_DIPNAME( 0x0700, 0x0700, "Do not change DSW1 1-3" ) PORT_DIPLOCATION("SW1:3,2,1") /* Listed in manual as "Do Not Change" */ + PORT_DIPSETTING( 0x0000, "0" ) + PORT_DIPSETTING( 0x0100, "1" ) + PORT_DIPSETTING( 0x0200, "2" ) + PORT_DIPSETTING( 0x0300, "3" ) + PORT_DIPSETTING( 0x0400, "4" ) + PORT_DIPSETTING( 0x0500, "5" ) + PORT_DIPSETTING( 0x0600, "6" ) + PORT_DIPSETTING( 0x0700, "7" ) + + PORT_START("PPI_PORTA") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN3 ) + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Gear Change") PORT_CODE(KEYCODE_SPACE) PORT_TOGGLE + PORT_SERVICE( 0x80, IP_ACTIVE_HIGH ) + + PORT_START("PPI_PORTC") + PORT_DIPNAME( 0xff, 0x80, "Sound PCB Jumper" ) + PORT_DIPSETTING( 0x00, "0" ) + PORT_DIPSETTING( 0x01, "1" ) + PORT_DIPSETTING( 0x02, "2" ) + PORT_DIPSETTING( 0x04, "3" ) + PORT_DIPSETTING( 0x08, "4" ) + PORT_DIPSETTING( 0x10, "5" ) + PORT_DIPSETTING( 0x20, "Speed Buggy/Data East" ) + PORT_DIPSETTING( 0x40, "Buggy Boy/Taito" ) + PORT_DIPSETTING( 0x80, "Buggy Boy/Tatsumi" ) + + PORT_START("AN_STEERING") + PORT_BIT( 0x0f, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(25) + + PORT_START("AN_ACCELERATOR") + PORT_BIT( 0x1f, 0x00, IPT_PEDAL ) PORT_MINMAX(0x00,0x1f) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) + + PORT_START("AN_BRAKE") + PORT_BIT( 0x1f, 0x00, IPT_PEDAL2 ) PORT_MINMAX(0x00,0x1f) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) +INPUT_PORTS_END + +ioport_constructor buggyboy_sound_device::device_input_ports() const +{ + return INPUT_PORTS_NAME(buggyboy_inputs); +} + +INPUT_PORTS_START( buggyboyjr_inputs ) + PORT_START("DSW") + /* Dipswitch 0 is unconnected */ + PORT_DIPNAME( 0x0003, 0x0003, "Do not change DSW2 1&2" ) PORT_DIPLOCATION("SW2:1,2") /* Listed in manual as "Do Not Change" */ + PORT_DIPSETTING( 0x0000, "0" ) + PORT_DIPSETTING( 0x0001, "1" ) + PORT_DIPSETTING( 0x0002, "2" ) + PORT_DIPSETTING( 0x0003, "3" ) + + PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Language ) ) PORT_DIPLOCATION("SW2:3") /* Language of game instructions */ + PORT_DIPSETTING( 0x0004, DEF_STR( English ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( Japanese ) ) + + PORT_DIPNAME( 0x0008, 0x0008, "Do not Change DSW2 4" ) PORT_DIPLOCATION("SW2:4") /* Listed in manual as "Do Not Change" */ + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0008, DEF_STR( On ) ) + + PORT_DIPNAME( 0x0030, 0x0010, "Time Rank" ) PORT_DIPLOCATION("SW2:5,6") + PORT_DIPSETTING( 0x0000, "A (Longest)" ) + PORT_DIPSETTING( 0x0010, "B" ) + PORT_DIPSETTING( 0x0020, "C" ) + PORT_DIPSETTING( 0x0030, "D (Shortest)" ) + + PORT_DIPNAME( 0x00c0, 0x0040, "Game Rank" ) PORT_DIPLOCATION("SW2:7,8") + PORT_DIPSETTING( 0x0000, "A (Easy)") + PORT_DIPSETTING( 0x0040, "B" ) + PORT_DIPSETTING( 0x0080, "C" ) + PORT_DIPSETTING( 0x00c0, "D (Difficult)" ) + + PORT_DIPNAME( 0xe000, 0x0000, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:8,7,6") + PORT_DIPSETTING( 0x4000, DEF_STR( 3C_1C ) ) + PORT_DIPSETTING( 0x2000, DEF_STR( 2C_1C ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0xc000, DEF_STR( 2C_3C ) ) + PORT_DIPSETTING( 0x6000, DEF_STR( 1C_2C ) ) + PORT_DIPSETTING( 0x8000, DEF_STR( 1C_5C ) ) + PORT_DIPSETTING( 0xa000, DEF_STR( 1C_6C ) ) + PORT_DIPSETTING( 0xe000, "Free-Play" ) + + PORT_DIPNAME( 0x1800, 0x0800, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:5,4") + PORT_DIPSETTING( 0x0000, DEF_STR( 2C_1C ) ) + PORT_DIPSETTING( 0x1000, DEF_STR( 1C_4C ) ) + PORT_DIPSETTING( 0x0800, DEF_STR( 1C_5C ) ) + PORT_DIPSETTING( 0x1800, DEF_STR( 1C_6C ) ) + + PORT_DIPNAME( 0x0700, 0x0700, "Do not change DSW1 1-3" ) PORT_DIPLOCATION("SW1:3,2,1") /* Listed in manual as "Do Not Change" */ + PORT_DIPSETTING( 0x0000, "0" ) + PORT_DIPSETTING( 0x0100, "1" ) + PORT_DIPSETTING( 0x0200, "2" ) + PORT_DIPSETTING( 0x0300, "3" ) + PORT_DIPSETTING( 0x0400, "4" ) + PORT_DIPSETTING( 0x0500, "5" ) + PORT_DIPSETTING( 0x0600, "6" ) + PORT_DIPSETTING( 0x0700, "7" ) + + PORT_START("YM2149_IC19_A") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN3 ) + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Gear Change") PORT_CODE(KEYCODE_SPACE) PORT_TOGGLE + PORT_SERVICE( 0x80, IP_ACTIVE_HIGH ) + + /* Wire jumper setting on sound PCB */ + PORT_START("YM2149_IC19_B") + PORT_DIPNAME( 0xff, 0x80, "Sound PCB Jumper" ) + PORT_DIPSETTING( 0x00, "0" ) + PORT_DIPSETTING( 0x01, "1" ) + PORT_DIPSETTING( 0x02, "2" ) + PORT_DIPSETTING( 0x04, "3" ) + PORT_DIPSETTING( 0x08, "4" ) + PORT_DIPSETTING( 0x10, "5" ) + PORT_DIPSETTING( 0x20, "Speed Buggy/Data East" ) + PORT_DIPSETTING( 0x40, "Buggy Boy/Taito" ) + PORT_DIPSETTING( 0x80, "Buggy Boy/Tatsumi" ) + + PORT_START("AN_STEERING") + PORT_BIT( 0x0f, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(25) + + PORT_START("AN_ACCELERATOR") + PORT_BIT( 0x1f, 0x00, IPT_PEDAL ) PORT_MINMAX(0x00, 0x1f) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) + + PORT_START("AN_BRAKE") + PORT_BIT( 0x1f, 0x00, IPT_PEDAL2 ) PORT_MINMAX(0x00, 0x1f) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) +INPUT_PORTS_END + +ioport_constructor buggyboyjr_sound_device::device_input_ports() const +{ + return INPUT_PORTS_NAME(buggyboyjr_inputs); +} + +MACHINE_CONFIG_START(buggyboy_sound_device::device_add_mconfig) + MCFG_DEVICE_ADD("audio_cpu", Z80, BUGGYBOY_ZCLK / 2) + MCFG_DEVICE_PROGRAM_MAP(buggyboy_sound_prg) + MCFG_DEVICE_PERIODIC_INT_DEVICE(DEVICE_SELF, buggyboy_sound_device, z80_irq, BUGGYBOY_ZCLK / 2 / 4 / 2048) + MCFG_DEVICE_IO_MAP(buggyboy_sound_io) + + MCFG_DEVICE_ADD("ppi8255", I8255A, 0) + /* Buggy Boy uses an 8255 PPI instead of YM2149 ports for inputs! */ + MCFG_I8255_IN_PORTA_CB(IOPORT("PPI_PORTA")) + MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, buggyboy_sound_device, bb_coin_cnt_w)) + MCFG_I8255_IN_PORTC_CB(IOPORT("PPI_PORTC")) + + SPEAKER(config, "frontleft", -0.2, 0.0, 1.0); + SPEAKER(config, "frontright", 0.2, 0.0, 1.0); +// SPEAKER(config, "rearleft", -0.2, 0.0, -0.5); /* Atari TX-1 TM262 manual shows 4 speakers (TX-1 Audio PCB Assembly A042016-01 A) */ +// SPEAKER(config, "rearright", 0.2, 0.0, -0.5); + + MCFG_DEVICE_ADD("ym1", YM2149, BUGGYBOY_ZCLK / 4) + MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(*this, buggyboy_sound_device, ym1_a_w)) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "frontleft", 0.15) + + MCFG_DEVICE_ADD("ym2", YM2149, BUGGYBOY_ZCLK / 4) + MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(*this, buggyboy_sound_device, ym2_a_w)) + MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(*this, buggyboy_sound_device, ym2_b_w)) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "frontright", 0.15) + + MCFG_SOUND_ROUTE(0, "frontleft", 0.2) + MCFG_SOUND_ROUTE(1, "frontright", 0.2) +MACHINE_CONFIG_END + +MACHINE_CONFIG_START(buggyboyjr_sound_device::device_add_mconfig) + MCFG_DEVICE_ADD("audio_cpu", Z80, BUGGYBOY_ZCLK / 2) + MCFG_DEVICE_PROGRAM_MAP(buggybjr_sound_prg) + MCFG_DEVICE_IO_MAP(buggyboy_sound_io) + MCFG_DEVICE_PERIODIC_INT_DEVICE(DEVICE_SELF, buggyboy_sound_device, z80_irq, BUGGYBOY_ZCLK / 2 / 4 / 2048) + + SPEAKER(config, "frontleft", -0.2, 0.0, 1.0); + SPEAKER(config, "frontright", 0.2, 0.0, 1.0); +// SPEAKER(config, "rearleft", -0.2, 0.0, -0.5); +// SPEAKER(config, "rearright", 0.2, 0.0, -0.5); + + MCFG_DEVICE_ADD("ym1", YM2149, BUGGYBOY_ZCLK / 4) /* YM2149 IC19 */ + MCFG_AY8910_PORT_A_READ_CB(IOPORT("YM2149_IC19_A")) + MCFG_AY8910_PORT_B_READ_CB(IOPORT("YM2149_IC19_B")) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "frontleft", 0.15) + + MCFG_DEVICE_ADD("ym2", YM2149, BUGGYBOY_ZCLK / 4) /* YM2149 IC24 */ + MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(*this, buggyboy_sound_device, ym2_a_w)) + MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(*this, buggyboy_sound_device, ym2_b_w)) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "frontright", 0.15) + + MCFG_SOUND_ROUTE(0, "frontleft", 0.2) + MCFG_SOUND_ROUTE(1, "frontright", 0.2) +MACHINE_CONFIG_END diff --git a/src/mame/audio/tx1.h b/src/mame/audio/tx1.h index a4d8d3d8735..50a91ce0488 100644 --- a/src/mame/audio/tx1.h +++ b/src/mame/audio/tx1.h @@ -1,20 +1,46 @@ +// license:BSD-3-Clause +// copyright-holders:Philip Bennett +/*************************************************************************** + + Tatsumi TX-1/Buggy Boy sound hardware + +***************************************************************************/ + #ifndef MAME_AUDIO_TX1_H #define MAME_AUDIO_TX1_H #pragma once +#include "sound/ay8910.h" + class tx1_sound_device : public device_t, public device_sound_interface { public: tx1_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - ~tx1_sound_device() {} + + DECLARE_WRITE16_MEMBER( z80_busreq_w ); + DECLARE_WRITE8_MEMBER( z80_intreq_w ); + DECLARE_READ16_MEMBER( z80_shared_r ); + DECLARE_WRITE16_MEMBER( z80_shared_w ); + + READ16_MEMBER( dipswitches_r ); + DECLARE_WRITE8_MEMBER( ts_w ); + DECLARE_READ8_MEMBER( ts_r ); + + DECLARE_WRITE8_MEMBER( tx1_ppi_latch_w ); + DECLARE_WRITE8_MEMBER( tx1_coin_cnt_w ); + DECLARE_READ8_MEMBER( tx1_ppi_porta_r ); + DECLARE_READ8_MEMBER( tx1_ppi_portb_r ); DECLARE_READ8_MEMBER( pit8253_r ); DECLARE_WRITE8_MEMBER( pit8253_w ); DECLARE_WRITE8_MEMBER( ay8910_a_w ); DECLARE_WRITE8_MEMBER( ay8910_b_w ); + INTERRUPT_GEN_MEMBER( z80_irq ); + protected: + /************************************* * * 8253 Programmable Interval Timer @@ -38,13 +64,21 @@ protected: tx1_sound_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); // device-level overrides + virtual ioport_constructor device_input_ports() const override; + virtual void device_add_mconfig(machine_config &config) override; virtual void device_start() override; virtual void device_reset() override; // sound stream update overrides virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) override; + void tx1_sound_io(address_map &map); + void tx1_sound_prg(address_map &map); + // internal state + required_device m_audiocpu; + required_shared_ptr m_z80_ram; + sound_stream *m_stream; uint32_t m_freq_to_step; uint32_t m_step0; @@ -56,6 +90,10 @@ protected: uint8_t m_ay_outputa; uint8_t m_ay_outputb; + uint8_t m_ppi_latch_a; + uint8_t m_ppi_latch_b; + uint32_t m_ts; + stream_sample_t m_pit0; stream_sample_t m_pit1; stream_sample_t m_pit2; @@ -78,6 +116,18 @@ protected: uint16_t m_eng_voltages[16]; }; +class tx1j_sound_device : public tx1_sound_device +{ +public: + tx1j_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + tx1_sound_device(mconfig, tag, owner, clock) + { } + +protected: + + // device-level overrides + virtual ioport_constructor device_input_ports() const override; +}; class buggyboy_sound_device : public tx1_sound_device { @@ -88,17 +138,49 @@ public: DECLARE_WRITE8_MEMBER( ym2_a_w ); DECLARE_WRITE8_MEMBER( ym2_b_w ); + DECLARE_READ8_MEMBER( bb_analog_r ); + DECLARE_WRITE8_MEMBER( bb_coin_cnt_w ); + protected: + buggyboy_sound_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); + // device-level overrides + virtual ioport_constructor device_input_ports() const override; + virtual void device_add_mconfig(machine_config &config) override; virtual void device_start() override; virtual void device_reset() override; // sound stream update overrides virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) override; + + virtual bool has_coin_counters() { return false; } + + void buggyboy_sound_io(address_map &map); + void buggyboy_sound_prg(address_map &map); + + required_device_array m_ym; }; +class buggyboyjr_sound_device : public buggyboy_sound_device +{ +public: + buggyboyjr_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + + DECLARE_READ8_MEMBER( bbjr_analog_r ); + +protected: + // device-level overrides + virtual ioport_constructor device_input_ports() const override; + virtual void device_add_mconfig(machine_config &config) override; + + virtual bool has_coin_counters() override { return true; } + + void buggybjr_sound_prg(address_map &map); +}; DECLARE_DEVICE_TYPE(TX1_SOUND, tx1_sound_device) +DECLARE_DEVICE_TYPE(TX1J_SOUND, tx1j_sound_device) DECLARE_DEVICE_TYPE(BUGGYBOY_SOUND, buggyboy_sound_device) +DECLARE_DEVICE_TYPE(BUGGYBOYJR_SOUND, buggyboyjr_sound_device) #endif // MAME_AUDIO_TX1_H diff --git a/src/mame/drivers/polepos.cpp b/src/mame/drivers/polepos.cpp index 7dbaa289564..ae8bf4bd9fe 100644 --- a/src/mame/drivers/polepos.cpp +++ b/src/mame/drivers/polepos.cpp @@ -938,7 +938,7 @@ MACHINE_CONFIG_START(polepos_state::polepos) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.90) /* engine sound */ - MCFG_DEVICE_ADD("polepos", POLEPOS_SOUND, 0) + MCFG_DEVICE_ADD("polepos", POLEPOS_SOUND, MASTER_CLOCK/8) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.90 * 0.77) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.90 * 0.77) MACHINE_CONFIG_END diff --git a/src/mame/drivers/tx1.cpp b/src/mame/drivers/tx1.cpp index e535c37c073..be17514e840 100644 --- a/src/mame/drivers/tx1.cpp +++ b/src/mame/drivers/tx1.cpp @@ -42,16 +42,13 @@ #include "emu.h" #include "includes/tx1.h" -#include "audio/tx1.h" #include "cpu/i86/i86.h" #include "cpu/z80/z80.h" -#include "machine/i8255.h" #include "machine/nvram.h" #include "machine/watchdog.h" #include "sound/ay8910.h" #include "rendlay.h" -#include "speaker.h" #include "tx1.lh" #include "buggyboy.lh" @@ -64,12 +61,6 @@ * *************************************/ -/* Main CPU and Z80 synchronisation */ -WRITE16_MEMBER(tx1_state::z80_busreq_w) -{ - m_audiocpu->set_input_line(INPUT_LINE_HALT, (data & 1) ? CLEAR_LINE : ASSERT_LINE); -} - WRITE16_MEMBER(tx1_state::resume_math_w) { m_mathcpu->set_input_line(INPUT_LINE_TEST, ASSERT_LINE); @@ -80,398 +71,6 @@ WRITE16_MEMBER(tx1_state::halt_math_w) m_mathcpu->set_input_line(INPUT_LINE_TEST, CLEAR_LINE); } -/* Z80 can trigger its own interrupts */ -WRITE8_MEMBER(tx1_state::z80_intreq_w) -{ - m_audiocpu->set_input_line(0, HOLD_LINE); -} - -/* Periodic Z80 interrupt */ -INTERRUPT_GEN_MEMBER(tx1_state::z80_irq) -{ - device.execute().set_input_line(0, HOLD_LINE); -} - -READ16_MEMBER(tx1_state::z80_shared_r) -{ - address_space &cpu2space = m_audiocpu->space(AS_PROGRAM); - return cpu2space.read_byte(offset); -} - -WRITE16_MEMBER(tx1_state::z80_shared_w) -{ - address_space &cpu2space = m_audiocpu->space(AS_PROGRAM); - cpu2space.write_byte(offset, data & 0xff); -} - - -/************************************* - * - * Port definitions - * - *************************************/ - -static INPUT_PORTS_START( tx1 ) - PORT_START("DSW") - /* Dipswitch DS.2 is 6 switches but "maps" to switches 2 to 8 (at 6P according to the manual) */ - PORT_DIPNAME( 0x000c, 0x0000, "Game Cost" ) PORT_DIPLOCATION("DS.2:1,2") - PORT_DIPSETTING( 0x0000, "1 Coin Unit for 1 Credit" ) - PORT_DIPSETTING( 0x0004, "2 Coin Units for 1 Credit" ) - PORT_DIPSETTING( 0x0008, "3 Coin Units for 1 Credit" ) - PORT_DIPSETTING( 0x000c, "4 Coin Units for 1 Credit" ) - - PORT_DIPNAME( 0x0010, 0x0000, "Left Coin Mechanism" ) PORT_DIPLOCATION("DS.2:3") - PORT_DIPSETTING( 0x0000, "1 Coin for 1 Coin Unit" ) - PORT_DIPSETTING( 0x0010, "1 Coin for 2 Coin Units" ) - - PORT_DIPNAME( 0x0060, 0x0000, "Right Coin Mechanism" ) PORT_DIPLOCATION("DS.2:4,5") - PORT_DIPSETTING( 0x0000, "1 Coin for 1 Coin Unit" ) - PORT_DIPSETTING( 0x0020, "1 Coin for 4 Coin Units" ) - PORT_DIPSETTING( 0x0040, "1 Coin for 5 Coin Units" ) - PORT_DIPSETTING( 0x0060, "1 Coin for 6 Coin Units" ) - - PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DS.2:6") /* Manual states switches 6 to 8 unused (physically it's only 6 switches) */ - PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - - /* Dipswitch DS.1 is 8 switches (at 8P according to the manual) */ - PORT_DIPNAME( 0x0700, 0x0300, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("DS.1:1,2,3") - PORT_DIPSETTING( 0x0000, "A (Easiest)" ) - PORT_DIPSETTING( 0x0100, "B" ) - PORT_DIPSETTING( 0x0200, "C" ) - PORT_DIPSETTING( 0x0300, "D" ) - PORT_DIPSETTING( 0x0400, "E" ) - PORT_DIPSETTING( 0x0500, "F" ) - PORT_DIPSETTING( 0x0600, "G" ) - PORT_DIPSETTING( 0x0700, "H (Hardest)" ) - - PORT_DIPNAME( 0x1800, 0x1000, DEF_STR( Game_Time ) ) PORT_DIPLOCATION("DS.1:4,5") - PORT_DIPSETTING( 0x0000, "A (Longest)" ) - PORT_DIPSETTING( 0x0800, "B" ) - PORT_DIPSETTING( 0x1000, "C" ) - PORT_DIPSETTING( 0x1800, "D (Shortest)" ) - - PORT_DIPNAME( 0xe000, 0xe000, "Bonus Adder" ) PORT_DIPLOCATION("DS.1:6,7,8") - PORT_DIPSETTING( 0x0000, "No Bonus" ) - PORT_DIPSETTING( 0x2000, "2 Coin Units for 1 Credit" ) - PORT_DIPSETTING( 0x4000, "3 Coin Units for 1 Credit" ) - PORT_DIPSETTING( 0x6000, "4 Coin Units for 1 Credit" ) - PORT_DIPSETTING( 0x8000, "5 Coin Units for 1 Credit" ) - PORT_DIPSETTING( 0xa000, "4 Coin Units for 2 Credit" ) - PORT_DIPSETTING( 0xc000, DEF_STR( Free_Play ) ) - PORT_DIPSETTING( 0xe000, "No Bonus" ) - - PORT_START("AN_STEERING") - PORT_BIT( 0x0f, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) - - PORT_START("AN_ACCELERATOR") - PORT_BIT( 0x1f, 0x00, IPT_PEDAL ) PORT_MINMAX(0x00,0x1f) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) - - PORT_START("AN_BRAKE") - PORT_BIT( 0x1f, 0x00, IPT_PEDAL2 ) PORT_MINMAX(0x00,0x1f) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) - - PORT_START("PPI_PORTC") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) - PORT_SERVICE( 0x04, IP_ACTIVE_HIGH ) - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Gear Change") PORT_CODE(KEYCODE_SPACE) PORT_TOGGLE - PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN3 ) - - PORT_START("PPI_PORTD") - /* Wire jumper setting on sound PCB - actually unpopulated 4 switch DS.3 */ - PORT_DIPNAME( 0xf0, 0x80, "Sound PCB Jumper (DS.3)" ) - PORT_DIPSETTING( 0x10, "1" ) - PORT_DIPSETTING( 0x20, "2" ) - PORT_DIPSETTING( 0x40, "3" ) - PORT_DIPSETTING( 0x80, "4" ) -INPUT_PORTS_END - -static INPUT_PORTS_START( tx1j ) - PORT_INCLUDE(tx1) - - PORT_MODIFY("DSW") - /* Dipswitch DS.2 is 6 switches but "maps" to switches 2 to 8 (at 6P according to the manual) */ - PORT_DIPNAME( 0x001c, 0x0000, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("DS.2:1,2,3") /* As silkscreened on the PCB */ - PORT_DIPSETTING( 0x0008, DEF_STR( 3C_1C ) ) - PORT_DIPSETTING( 0x0004, DEF_STR( 2C_1C ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( 1C_1C ) ) - PORT_DIPSETTING( 0x001c, DEF_STR( 2C_3C ) ) - PORT_DIPSETTING( 0x000c, DEF_STR( 1C_2C ) ) - PORT_DIPSETTING( 0x0010, DEF_STR( 1C_3C ) ) - PORT_DIPSETTING( 0x0014, DEF_STR( 1C_5C ) ) - PORT_DIPSETTING( 0x0018, DEF_STR( 1C_6C ) ) - - PORT_DIPNAME( 0x00e0, 0x0000, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("DS.2:4,5,6") /* As silkscreened on the PCB */ - PORT_DIPSETTING( 0x0040, DEF_STR( 3C_1C ) ) - PORT_DIPSETTING( 0x0020, DEF_STR( 2C_1C ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( 1C_1C ) ) - PORT_DIPSETTING( 0x00e0, DEF_STR( 2C_3C ) ) - PORT_DIPSETTING( 0x0060, DEF_STR( 1C_2C ) ) - PORT_DIPSETTING( 0x0080, DEF_STR( 1C_3C ) ) - PORT_DIPSETTING( 0x00a0, DEF_STR( 1C_5C ) ) - PORT_DIPSETTING( 0x00c0, DEF_STR( 1C_6C ) ) - - /* Dipswitch DS.1 is 8 switches (at 8P according to the manual) */ - PORT_DIPNAME( 0xe000, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DS.1:6,7,8") - PORT_DIPSETTING( 0x0000, "0" ) - PORT_DIPSETTING( 0x2000, "1" ) - PORT_DIPSETTING( 0x4000, "2" ) - PORT_DIPSETTING( 0x6000, "3" ) - PORT_DIPSETTING( 0x8000, "4" ) - PORT_DIPSETTING( 0xa000, "5" ) - PORT_DIPSETTING( 0xc000, "6" ) - PORT_DIPSETTING( 0xe000, "7" ) -INPUT_PORTS_END - - -static INPUT_PORTS_START( buggyboy ) - PORT_START("DSW") - /* Dipswitch 0 is unconnected */ - PORT_DIPNAME( 0x0003, 0x0003, "Do not change DSW2 1&2" ) PORT_DIPLOCATION("SW2:1,2") /* Listed in manual as "Do Not Change" */ - PORT_DIPSETTING( 0x0000, "0" ) - PORT_DIPSETTING( 0x0001, "1" ) - PORT_DIPSETTING( 0x0002, "2" ) - PORT_DIPSETTING( 0x0003, "3" ) - - PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Language ) ) PORT_DIPLOCATION("SW2:3") /* Language of game instructions */ - PORT_DIPSETTING( 0x0004, DEF_STR( English ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( Japanese ) ) - - PORT_DIPNAME( 0x0008, 0x0008, "Do not Change DSW2 4" ) PORT_DIPLOCATION("SW2:4") /* Listed in manual as "Do Not Change" */ - PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0008, DEF_STR( On ) ) - - PORT_DIPNAME( 0x0030, 0x0010, "Time Rank" ) PORT_DIPLOCATION("SW2:5,6") - PORT_DIPSETTING( 0x0000, "A (Longest)" ) - PORT_DIPSETTING( 0x0010, "B" ) - PORT_DIPSETTING( 0x0020, "C" ) - PORT_DIPSETTING( 0x0030, "D (Shortest)" ) - - PORT_DIPNAME( 0x00c0, 0x0040, "Game Rank" ) PORT_DIPLOCATION("SW2:7,8") - PORT_DIPSETTING( 0x0000, "A (Easy)") - PORT_DIPSETTING( 0x0040, "B" ) - PORT_DIPSETTING( 0x0080, "C" ) - PORT_DIPSETTING( 0x00c0, "D (Difficult)" ) - - PORT_DIPNAME( 0xe000, 0x0000, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:8,7,6") - PORT_DIPSETTING( 0x4000, DEF_STR( 3C_1C ) ) - PORT_DIPSETTING( 0x2000, DEF_STR( 2C_1C ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( 1C_1C ) ) - PORT_DIPSETTING( 0xc000, DEF_STR( 2C_3C ) ) - PORT_DIPSETTING( 0x6000, DEF_STR( 1C_2C ) ) - PORT_DIPSETTING( 0x8000, DEF_STR( 1C_5C ) ) - PORT_DIPSETTING( 0xa000, DEF_STR( 1C_6C ) ) - PORT_DIPSETTING( 0xe000, "Free-Play" ) - - PORT_DIPNAME( 0x1800, 0x0800, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:5,4") - PORT_DIPSETTING( 0x0800, DEF_STR( 2C_1C ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( 1C_1C ) ) - PORT_DIPSETTING( 0x1000, DEF_STR( 1C_2C ) ) - PORT_DIPSETTING( 0x1800, DEF_STR( 1C_5C ) ) - - PORT_DIPNAME( 0x0700, 0x0700, "Do not change DSW1 1-3" ) PORT_DIPLOCATION("SW1:3,2,1") /* Listed in manual as "Do Not Change" */ - PORT_DIPSETTING( 0x0000, "0" ) - PORT_DIPSETTING( 0x0100, "1" ) - PORT_DIPSETTING( 0x0200, "2" ) - PORT_DIPSETTING( 0x0300, "3" ) - PORT_DIPSETTING( 0x0400, "4" ) - PORT_DIPSETTING( 0x0500, "5" ) - PORT_DIPSETTING( 0x0600, "6" ) - PORT_DIPSETTING( 0x0700, "7" ) - - PORT_START("PPI_PORTA") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN3 ) - PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Gear Change") PORT_CODE(KEYCODE_SPACE) PORT_TOGGLE - PORT_SERVICE( 0x80, IP_ACTIVE_HIGH ) - - PORT_START("PPI_PORTC") - PORT_DIPNAME( 0xff, 0x80, "Sound PCB Jumper" ) - PORT_DIPSETTING( 0x00, "0" ) - PORT_DIPSETTING( 0x01, "1" ) - PORT_DIPSETTING( 0x02, "2" ) - PORT_DIPSETTING( 0x04, "3" ) - PORT_DIPSETTING( 0x08, "4" ) - PORT_DIPSETTING( 0x10, "5" ) - PORT_DIPSETTING( 0x20, "Speed Buggy/Data East" ) - PORT_DIPSETTING( 0x40, "Buggy Boy/Taito" ) - PORT_DIPSETTING( 0x80, "Buggy Boy/Tatsumi" ) - - PORT_START("AN_STEERING") - PORT_BIT( 0x0f, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(25) - - PORT_START("AN_ACCELERATOR") - PORT_BIT( 0x1f, 0x00, IPT_PEDAL ) PORT_MINMAX(0x00,0x1f) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) - - PORT_START("AN_BRAKE") - PORT_BIT( 0x1f, 0x00, IPT_PEDAL2 ) PORT_MINMAX(0x00,0x1f) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) -INPUT_PORTS_END - -static INPUT_PORTS_START( buggybjr ) - PORT_START("DSW") - /* Dipswitch 0 is unconnected */ - PORT_DIPNAME( 0x0003, 0x0003, "Do not change DSW2 1&2" ) PORT_DIPLOCATION("SW2:1,2") /* Listed in manual as "Do Not Change" */ - PORT_DIPSETTING( 0x0000, "0" ) - PORT_DIPSETTING( 0x0001, "1" ) - PORT_DIPSETTING( 0x0002, "2" ) - PORT_DIPSETTING( 0x0003, "3" ) - - PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Language ) ) PORT_DIPLOCATION("SW2:3") /* Language of game instructions */ - PORT_DIPSETTING( 0x0004, DEF_STR( English ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( Japanese ) ) - - PORT_DIPNAME( 0x0008, 0x0008, "Do not Change DSW2 4" ) PORT_DIPLOCATION("SW2:4") /* Listed in manual as "Do Not Change" */ - PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0008, DEF_STR( On ) ) - - PORT_DIPNAME( 0x0030, 0x0010, "Time Rank" ) PORT_DIPLOCATION("SW2:5,6") - PORT_DIPSETTING( 0x0000, "A (Longest)" ) - PORT_DIPSETTING( 0x0010, "B" ) - PORT_DIPSETTING( 0x0020, "C" ) - PORT_DIPSETTING( 0x0030, "D (Shortest)" ) - - PORT_DIPNAME( 0x00c0, 0x0040, "Game Rank" ) PORT_DIPLOCATION("SW2:7,8") - PORT_DIPSETTING( 0x0000, "A (Easy)") - PORT_DIPSETTING( 0x0040, "B" ) - PORT_DIPSETTING( 0x0080, "C" ) - PORT_DIPSETTING( 0x00c0, "D (Difficult)" ) - - PORT_DIPNAME( 0xe000, 0x0000, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:8,7,6") - PORT_DIPSETTING( 0x4000, DEF_STR( 3C_1C ) ) - PORT_DIPSETTING( 0x2000, DEF_STR( 2C_1C ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( 1C_1C ) ) - PORT_DIPSETTING( 0xc000, DEF_STR( 2C_3C ) ) - PORT_DIPSETTING( 0x6000, DEF_STR( 1C_2C ) ) - PORT_DIPSETTING( 0x8000, DEF_STR( 1C_5C ) ) - PORT_DIPSETTING( 0xa000, DEF_STR( 1C_6C ) ) - PORT_DIPSETTING( 0xe000, "Free-Play" ) - - PORT_DIPNAME( 0x1800, 0x0800, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:5,4") - PORT_DIPSETTING( 0x0000, DEF_STR( 2C_1C ) ) - PORT_DIPSETTING( 0x1000, DEF_STR( 1C_4C ) ) - PORT_DIPSETTING( 0x0800, DEF_STR( 1C_5C ) ) - PORT_DIPSETTING( 0x1800, DEF_STR( 1C_6C ) ) - - PORT_DIPNAME( 0x0700, 0x0700, "Do not change DSW1 1-3" ) PORT_DIPLOCATION("SW1:3,2,1") /* Listed in manual as "Do Not Change" */ - PORT_DIPSETTING( 0x0000, "0" ) - PORT_DIPSETTING( 0x0100, "1" ) - PORT_DIPSETTING( 0x0200, "2" ) - PORT_DIPSETTING( 0x0300, "3" ) - PORT_DIPSETTING( 0x0400, "4" ) - PORT_DIPSETTING( 0x0500, "5" ) - PORT_DIPSETTING( 0x0600, "6" ) - PORT_DIPSETTING( 0x0700, "7" ) - - PORT_START("YM2149_IC19_A") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN3 ) - PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Gear Change") PORT_CODE(KEYCODE_SPACE) PORT_TOGGLE - PORT_SERVICE( 0x80, IP_ACTIVE_HIGH ) - - /* Wire jumper setting on sound PCB */ - PORT_START("YM2149_IC19_B") - PORT_DIPNAME( 0xff, 0x80, "Sound PCB Jumper" ) - PORT_DIPSETTING( 0x00, "0" ) - PORT_DIPSETTING( 0x01, "1" ) - PORT_DIPSETTING( 0x02, "2" ) - PORT_DIPSETTING( 0x04, "3" ) - PORT_DIPSETTING( 0x08, "4" ) - PORT_DIPSETTING( 0x10, "5" ) - PORT_DIPSETTING( 0x20, "Speed Buggy/Data East" ) - PORT_DIPSETTING( 0x40, "Buggy Boy/Taito" ) - PORT_DIPSETTING( 0x80, "Buggy Boy/Tatsumi" ) - - PORT_START("AN_STEERING") - PORT_BIT( 0x0f, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(25) - - PORT_START("AN_ACCELERATOR") - PORT_BIT( 0x1f, 0x00, IPT_PEDAL ) PORT_MINMAX(0x00, 0x1f) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) - - PORT_START("AN_BRAKE") - PORT_BIT( 0x1f, 0x00, IPT_PEDAL2 ) PORT_MINMAX(0x00, 0x1f) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) -INPUT_PORTS_END - -READ16_MEMBER(tx1_state::dipswitches_r) -{ - return (ioport("DSW")->read() & 0xfffe) | m_ts; -} - -/* - (TODO) TS: Connected in place of dipswitch A bit 0 - Accessed on startup as some sort of acknowledgement -*/ -WRITE8_MEMBER(tx1_state::ts_w) -{ -// TS = 1; - m_z80_ram[offset] = data; -} - -READ8_MEMBER(tx1_state::ts_r) -{ -// TS = 1; - return m_z80_ram[offset]; -} - - -WRITE8_MEMBER(tx1_state::tx1_coin_cnt_w) -{ - machine().bookkeeping().coin_counter_w(0, data & 0x80); - machine().bookkeeping().coin_counter_w(1, data & 0x40); -// machine().bookkeeping().coin_counter_w(2, data & 0x40); -} - -WRITE8_MEMBER(tx1_state::bb_coin_cnt_w) -{ - machine().bookkeeping().coin_counter_w(0, data & 0x01); - machine().bookkeeping().coin_counter_w(1, data & 0x02); -// machine().bookkeeping().coin_counter_w(2, data & 0x04); -} - -WRITE8_MEMBER(tx1_state::tx1_ppi_latch_w) -{ - m_ppi_latch_a = ((ioport("AN_BRAKE")->read() & 0xf) << 4) | (ioport("AN_ACCELERATOR")->read() & 0xf); - m_ppi_latch_b = ioport("AN_STEERING")->read(); -} - -READ8_MEMBER(tx1_state::tx1_ppi_porta_r) -{ - return m_ppi_latch_a; -} - -READ8_MEMBER(tx1_state::tx1_ppi_portb_r) -{ - return ioport("PPI_PORTD")->read() | m_ppi_latch_b; -} - - -static uint8_t bit_reverse8(uint8_t val) -{ - val = ((val & 0xF0) >> 4) | ((val & 0x0F) << 4); - val = ((val & 0xCC) >> 2) | ((val & 0x33) << 2); - val = ((val & 0xAA) >> 1) | ((val & 0x55) << 1); - - return val; -} - -// Tazmi TZ2103 custom 4-channel A/D converter @ 7.5 MHz -READ8_MEMBER(tx1_state::bb_analog_r) -{ - if (offset == 0) - return bit_reverse8(((ioport("AN_ACCELERATOR")->read() & 0xf) << 4) | ioport("AN_STEERING")->read()); - else - return bit_reverse8((ioport("AN_BRAKE")->read() & 0xf) << 4); -} - -READ8_MEMBER(tx1_state::bbjr_analog_r) -{ - if (offset == 0) - return ((ioport("AN_ACCELERATOR")->read() & 0xf) << 4) | ioport("AN_STEERING")->read(); - else - return (ioport("AN_BRAKE")->read() & 0xf) << 4; -} - /************************************* * @@ -487,12 +86,12 @@ void tx1_state::tx1_main(address_map &map) map(0x06000, 0x06fff).rw(this, FUNC(tx1_state::tx1_crtc_r), FUNC(tx1_state::tx1_crtc_w)); map(0x08000, 0x09fff).ram().share("vram"); map(0x0a000, 0x0afff).ram().share("rcram"); - map(0x0b000, 0x0b001).rw(this, FUNC(tx1_state::dipswitches_r), FUNC(tx1_state::z80_busreq_w)); + map(0x0b000, 0x0b001).rw(m_sound, FUNC(tx1_sound_device::dipswitches_r), FUNC(tx1_sound_device::z80_busreq_w)); map(0x0c000, 0x0c001).w(this, FUNC(tx1_state::tx1_scolst_w)); map(0x0d000, 0x0d003).w(this, FUNC(tx1_state::tx1_slincs_w)); map(0x0e000, 0x0e001).w(this, FUNC(tx1_state::tx1_slock_w)); map(0x0f000, 0x0f001).r("watchdog", FUNC(watchdog_timer_device::reset16_r)).w(this, FUNC(tx1_state::resume_math_w)); - map(0x10000, 0x1ffff).rw(this, FUNC(tx1_state::z80_shared_r), FUNC(tx1_state::z80_shared_w)); + map(0x10000, 0x1ffff).rw(m_sound, FUNC(tx1_sound_device::z80_shared_r), FUNC(tx1_sound_device::z80_shared_w)); map(0x20000, 0x2ffff).mirror(0xd0000).rom(); } @@ -510,22 +109,6 @@ void tx1_state::tx1_math(address_map &map) map(0x05000, 0x07fff).r(this, FUNC(tx1_state::tx1_spcs_rom_r)); } -void tx1_state::tx1_sound_prg(address_map &map) -{ - map(0x0000, 0x1fff).rom(); - map(0x3000, 0x37ff).ram().mirror(0x800).share("z80_ram"); - map(0x4000, 0x4000).w(this, FUNC(tx1_state::z80_intreq_w)); - map(0x5000, 0x5003).rw("ppi8255", FUNC(i8255_device::read), FUNC(i8255_device::write)); - map(0x6000, 0x6003).rw("tx1", FUNC(tx1_sound_device::pit8253_r), FUNC(tx1_sound_device::pit8253_w)); - map(0x7000, 0x7fff).w(this, FUNC(tx1_state::tx1_ppi_latch_w)); - map(0xb000, 0xbfff).rw(this, FUNC(tx1_state::ts_r), FUNC(tx1_state::ts_w)); -} - -void tx1_state::tx1_sound_io(address_map &map) -{ - map.global_mask(0xff); - map(0x40, 0x41).w("aysnd", FUNC(ay8910_device::data_address_w)); -} /************************************* @@ -540,12 +123,12 @@ void tx1_state::buggyboy_main(address_map &map) map(0x04000, 0x04fff).rw(this, FUNC(tx1_state::tx1_crtc_r), FUNC(tx1_state::tx1_crtc_w)); map(0x08000, 0x09fff).ram().share("vram"); map(0x0a000, 0x0afff).ram().share("rcram"); - map(0x0b000, 0x0b001).rw(this, FUNC(tx1_state::dipswitches_r), FUNC(tx1_state::z80_busreq_w)); + map(0x0b000, 0x0b001).rw(m_sound, FUNC(tx1_sound_device::dipswitches_r), FUNC(tx1_sound_device::z80_busreq_w)); map(0x0c000, 0x0c001).w(this, FUNC(tx1_state::buggyboy_scolst_w)); map(0x0d000, 0x0d003).w(this, FUNC(tx1_state::tx1_slincs_w)); map(0x0e000, 0x0e001).w(this, FUNC(tx1_state::buggyboy_sky_w)); map(0x0f000, 0x0f003).r("watchdog", FUNC(watchdog_timer_device::reset16_r)).w(this, FUNC(tx1_state::resume_math_w)); - map(0x10000, 0x1ffff).rw(this, FUNC(tx1_state::z80_shared_r), FUNC(tx1_state::z80_shared_w)); + map(0x10000, 0x1ffff).rw(m_sound, FUNC(tx1_sound_device::z80_shared_r), FUNC(tx1_sound_device::z80_shared_w)); map(0x20000, 0x2ffff).rom(); map(0xf0000, 0xfffff).rom(); } @@ -556,12 +139,12 @@ void tx1_state::buggybjr_main(address_map &map) map(0x04000, 0x04fff).rw(this, FUNC(tx1_state::tx1_crtc_r), FUNC(tx1_state::tx1_crtc_w)); map(0x08000, 0x08fff).ram().share("vram"); map(0x0a000, 0x0afff).ram().share("rcram"); - map(0x0b000, 0x0b001).rw(this, FUNC(tx1_state::dipswitches_r), FUNC(tx1_state::z80_busreq_w)); + map(0x0b000, 0x0b001).rw(m_sound, FUNC(tx1_sound_device::dipswitches_r), FUNC(tx1_sound_device::z80_busreq_w)); map(0x0c000, 0x0c001).w(this, FUNC(tx1_state::buggyboy_scolst_w)); map(0x0d000, 0x0d003).w(this, FUNC(tx1_state::tx1_slincs_w)); map(0x0e000, 0x0e001).w(this, FUNC(tx1_state::buggyboy_sky_w)); map(0x0f000, 0x0f003).r("watchdog", FUNC(watchdog_timer_device::reset16_r)).w(this, FUNC(tx1_state::resume_math_w)); - map(0x10000, 0x1ffff).rw(this, FUNC(tx1_state::z80_shared_r), FUNC(tx1_state::z80_shared_w)); + map(0x10000, 0x1ffff).rw(m_sound, FUNC(tx1_sound_device::z80_shared_r), FUNC(tx1_sound_device::z80_shared_w)); map(0x20000, 0x2ffff).rom(); map(0xf0000, 0xfffff).rom(); } @@ -578,39 +161,6 @@ void tx1_state::buggyboy_math(address_map &map) map(0x05000, 0x07fff).r(this, FUNC(tx1_state::buggyboy_spcs_rom_r)); } -/* Buggy Boy Sound PCB TC033A */ -void tx1_state::buggyboy_sound_prg(address_map &map) -{ - map(0x0000, 0x3fff).rom(); - map(0x4000, 0x47ff).ram().share("z80_ram"); - map(0x6000, 0x6001).r(this, FUNC(tx1_state::bb_analog_r)); - map(0x6800, 0x6803).rw("ppi8255", FUNC(i8255_device::read), FUNC(i8255_device::write)); - map(0x7000, 0x7003).rw("buggyboy", FUNC(buggyboy_sound_device::pit8253_r), FUNC(buggyboy_sound_device::pit8253_w)); - map(0x7800, 0x7800).w(this, FUNC(tx1_state::z80_intreq_w)); - map(0xc000, 0xc7ff).rw(this, FUNC(tx1_state::ts_r), FUNC(tx1_state::ts_w)); -} - -/* Buggy Boy Jr Sound PCB TC043 */ -void tx1_state::buggybjr_sound_prg(address_map &map) -{ - map(0x0000, 0x3fff).rom(); - map(0x4000, 0x47ff).ram().share("z80_ram"); - map(0x5000, 0x5003).rw("buggyboy", FUNC(buggyboy_sound_device::pit8253_r), FUNC(buggyboy_sound_device::pit8253_w)); - map(0x6000, 0x6001).r(this, FUNC(tx1_state::bbjr_analog_r)); - map(0x7000, 0x7000).w(this, FUNC(tx1_state::z80_intreq_w)); - map(0xc000, 0xc7ff).rw(this, FUNC(tx1_state::ts_r), FUNC(tx1_state::ts_w)); -} - -/* Common */ -void tx1_state::buggyboy_sound_io(address_map &map) -{ - map.global_mask(0xff); - map(0x40, 0x40).r("ym1", FUNC(ay8910_device::data_r)); - map(0x40, 0x41).w("ym1", FUNC(ay8910_device::data_address_w)); - map(0x80, 0x80).r("ym2", FUNC(ay8910_device::data_r)); - map(0x80, 0x81).w("ym2", FUNC(ay8910_device::data_address_w)); -} - /************************************* * * Machine driver @@ -627,20 +177,9 @@ MACHINE_CONFIG_START(tx1_state::tx1) MCFG_DEVICE_ADD("math_cpu", I8086, CPU_MASTER_CLOCK / 3) MCFG_DEVICE_PROGRAM_MAP(tx1_math) - MCFG_DEVICE_ADD("audio_cpu", Z80, TX1_PIXEL_CLOCK / 2) - MCFG_DEVICE_PROGRAM_MAP(tx1_sound_prg) - MCFG_DEVICE_IO_MAP(tx1_sound_io) - MCFG_DEVICE_PERIODIC_INT_DRIVER(tx1_state, irq0_line_hold, TX1_PIXEL_CLOCK / 4 / 2048 / 2) - MCFG_MACHINE_RESET_OVERRIDE(tx1_state,tx1) MCFG_NVRAM_ADD_0FILL("nvram") - MCFG_DEVICE_ADD("ppi8255", I8255A, 0) - MCFG_I8255_IN_PORTA_CB(READ8(*this, tx1_state, tx1_ppi_porta_r)) - MCFG_I8255_IN_PORTB_CB(READ8(*this, tx1_state, tx1_ppi_portb_r)) - MCFG_I8255_IN_PORTC_CB(IOPORT("PPI_PORTC")) - MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, tx1_state, tx1_coin_cnt_w)) - MCFG_PALETTE_ADD("palette", 256) MCFG_PALETTE_INIT_OWNER(tx1_state,tx1) @@ -664,22 +203,16 @@ MACHINE_CONFIG_START(tx1_state::tx1) MCFG_VIDEO_START_OVERRIDE(tx1_state,tx1) - SPEAKER(config, "frontleft", -0.2, 0.0, 1.0); - SPEAKER(config, "frontright", 0.2, 0.0, 1.0); -// SPEAKER(config, "rearleft", -0.2, 0.0, -0.5); /* Atari TX-1 TM262 manual shows 4 speakers (TX-1 Audio PCB Assembly A042016-01 A) */ -// SPEAKER(config, "rearright", 0.2, 0.0, -0.5); - - MCFG_DEVICE_ADD("aysnd", AY8910, TX1_PIXEL_CLOCK / 8) - MCFG_AY8910_PORT_A_WRITE_CB(WRITE8("tx1", tx1_sound_device, ay8910_a_w)) - MCFG_AY8910_PORT_B_WRITE_CB(WRITE8("tx1", tx1_sound_device, ay8910_b_w)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "frontleft", 0.1) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "frontright", 0.1) - - MCFG_DEVICE_ADD("tx1", TX1_SOUND, TX1_PIXEL_CLOCK) - MCFG_SOUND_ROUTE(0, "frontleft", 0.2) - MCFG_SOUND_ROUTE(1, "frontright", 0.2) + MCFG_DEVICE_ADD("soundbrd", TX1_SOUND, TX1_PIXEL_CLOCK) MACHINE_CONFIG_END +MACHINE_CONFIG_START(tx1_state::tx1j) + tx1(config); + + MCFG_DEVICE_REMOVE("soundbrd") + + MCFG_DEVICE_ADD("soundbrd", TX1J_SOUND, TX1_PIXEL_CLOCK) +MACHINE_CONFIG_END MACHINE_CONFIG_START(tx1_state::buggyboy) MCFG_DEVICE_ADD("main_cpu", I8086, CPU_MASTER_CLOCK / 3) @@ -691,20 +224,9 @@ MACHINE_CONFIG_START(tx1_state::buggyboy) MCFG_DEVICE_ADD("math_cpu", I8086, CPU_MASTER_CLOCK / 3) MCFG_DEVICE_PROGRAM_MAP(buggyboy_math) - MCFG_DEVICE_ADD("audio_cpu", Z80, BUGGYBOY_ZCLK / 2) - MCFG_DEVICE_PROGRAM_MAP(buggyboy_sound_prg) - MCFG_DEVICE_PERIODIC_INT_DRIVER(tx1_state, z80_irq, BUGGYBOY_ZCLK / 2 / 4 / 2048) - MCFG_DEVICE_IO_MAP(buggyboy_sound_io) - MCFG_MACHINE_RESET_OVERRIDE(tx1_state,buggyboy) MCFG_NVRAM_ADD_0FILL("nvram") - MCFG_DEVICE_ADD("ppi8255", I8255A, 0) - /* Buggy Boy uses an 8255 PPI instead of YM2149 ports for inputs! */ - MCFG_I8255_IN_PORTA_CB(IOPORT("PPI_PORTA")) - MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, tx1_state, bb_coin_cnt_w)) - MCFG_I8255_IN_PORTC_CB(IOPORT("PPI_PORTC")) - MCFG_DEFAULT_LAYOUT(layout_triphsxs) MCFG_SCREEN_ADD("lscreen", RASTER) @@ -727,23 +249,7 @@ MACHINE_CONFIG_START(tx1_state::buggyboy) MCFG_PALETTE_INIT_OWNER(tx1_state,buggyboy) MCFG_VIDEO_START_OVERRIDE(tx1_state,buggyboy) - SPEAKER(config, "frontleft", -0.2, 0.0, 1.0); - SPEAKER(config, "frontright", 0.2, 0.0, 1.0); -// SPEAKER(config, "rearleft", -0.2, 0.0, -0.5); /* Atari TX-1 TM262 manual shows 4 speakers (TX-1 Audio PCB Assembly A042016-01 A) */ -// SPEAKER(config, "rearright", 0.2, 0.0, -0.5); - - MCFG_DEVICE_ADD("ym1", YM2149, BUGGYBOY_ZCLK / 4) - MCFG_AY8910_PORT_A_WRITE_CB(WRITE8("buggyboy", buggyboy_sound_device, ym1_a_w)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "frontleft", 0.15) - - MCFG_DEVICE_ADD("ym2", YM2149, BUGGYBOY_ZCLK / 4) - MCFG_AY8910_PORT_A_WRITE_CB(WRITE8("buggyboy", buggyboy_sound_device, ym2_a_w)) - MCFG_AY8910_PORT_B_WRITE_CB(WRITE8("buggyboy", buggyboy_sound_device, ym2_b_w)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "frontright", 0.15) - - MCFG_DEVICE_ADD("buggyboy", BUGGYBOY_SOUND, BUGGYBOY_ZCLK) - MCFG_SOUND_ROUTE(0, "frontleft", 0.2) - MCFG_SOUND_ROUTE(1, "frontright", 0.2) + MCFG_DEVICE_ADD("soundbrd", BUGGYBOY_SOUND, BUGGYBOY_ZCLK) MACHINE_CONFIG_END @@ -757,11 +263,6 @@ MACHINE_CONFIG_START(tx1_state::buggybjr) MCFG_DEVICE_ADD("math_cpu", I8086, CPU_MASTER_CLOCK / 3) MCFG_DEVICE_PROGRAM_MAP(buggyboy_math) - MCFG_DEVICE_ADD("audio_cpu", Z80, BUGGYBOY_ZCLK / 2) - MCFG_DEVICE_PROGRAM_MAP(buggybjr_sound_prg) - MCFG_DEVICE_IO_MAP(buggyboy_sound_io) - MCFG_DEVICE_PERIODIC_INT_DRIVER(tx1_state, z80_irq, BUGGYBOY_ZCLK / 2 / 4 / 2048) - MCFG_MACHINE_RESET_OVERRIDE(tx1_state,buggyboy) MCFG_NVRAM_ADD_0FILL("nvram") @@ -775,24 +276,7 @@ MACHINE_CONFIG_START(tx1_state::buggybjr) MCFG_PALETTE_INIT_OWNER(tx1_state,buggyboy) MCFG_VIDEO_START_OVERRIDE(tx1_state,buggybjr) - SPEAKER(config, "frontleft", -0.2, 0.0, 1.0); - SPEAKER(config, "frontright", 0.2, 0.0, 1.0); -// SPEAKER(config, "rearleft", -0.2, 0.0, -0.5); -// SPEAKER(config, "rearright", 0.2, 0.0, -0.5); - - MCFG_DEVICE_ADD("ym1", YM2149, BUGGYBOY_ZCLK / 4) /* YM2149 IC19 */ - MCFG_AY8910_PORT_A_READ_CB(IOPORT("YM2149_IC19_A")) - MCFG_AY8910_PORT_B_READ_CB(IOPORT("YM2149_IC19_B")) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "frontleft", 0.15) - - MCFG_DEVICE_ADD("ym2", YM2149, BUGGYBOY_ZCLK / 4) /* YM2149 IC24 */ - MCFG_AY8910_PORT_A_WRITE_CB(WRITE8("buggyboy", buggyboy_sound_device, ym2_a_w)) - MCFG_AY8910_PORT_B_WRITE_CB(WRITE8("buggyboy", buggyboy_sound_device, ym2_b_w)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "frontright", 0.15) - - MCFG_DEVICE_ADD("buggyboy", BUGGYBOY_SOUND, BUGGYBOY_ZCLK) - MCFG_SOUND_ROUTE(0, "frontleft", 0.2) - MCFG_SOUND_ROUTE(1, "frontright", 0.2) + MCFG_DEVICE_ADD("soundbrd", BUGGYBOYJR_SOUND, BUGGYBOY_ZCLK) MACHINE_CONFIG_END @@ -820,7 +304,7 @@ ROM_START( tx1 ) ROM_LOAD16_BYTE( "8411-136027-152.146", 0x04000, 0x2000, CRC(b65eeea2) SHA1(b5f26e17520c598132b93c5cd7af7ebd03b10012) ) ROM_LOAD16_BYTE( "8411-136027-151.132", 0x04001, 0x2000, CRC(0d63dadc) SHA1(0954174b25c08967d3efb31f5721fd05502d66dd) ) - ROM_REGION( 0x10000, "audio_cpu", 0 ) + ROM_REGION( 0x10000, "soundbrd:audio_cpu", 0 ) ROM_LOAD( "8411-136027-157.11", 0x00000, 0x2000, CRC(10ae3075) SHA1(69c5f62f2473aba848383eed3cecf15e273d86ca) ) ROM_REGION( 0x8000, "char_tiles", 0 ) @@ -907,7 +391,7 @@ ROM_START( tx1jb ) ROM_LOAD16_BYTE( "tx1_9b.ic146", 0x04000, 0x2000, CRC(af677ff4) SHA1(3968d7f3811ed7552efe1e1c5c416ec740503ee4) ) ROM_LOAD16_BYTE( "tx1_8b.ic132", 0x04001, 0x2000, CRC(dd4356f8) SHA1(b666d2aa93e61f6bcdb8326b8b06635be743b64e) ) - ROM_REGION( 0x10000, "audio_cpu", 0 ) + ROM_REGION( 0x10000, "soundbrd:audio_cpu", 0 ) ROM_LOAD( "tx1_22h.ic9", 0x00000, 0x2000, CRC(66376232) SHA1(b8a026dae47173e7760eea4f52e67e525ad1b70b) ) ROM_REGION( 0x8000, "char_tiles", 0 ) @@ -988,7 +472,7 @@ ROM_START( tx1jc ) ROM_LOAD16_BYTE( "tx1_9c.ic146", 0x04000, 0x2000, CRC(b65eeea2) SHA1(b5f26e17520c598132b93c5cd7af7ebd03b10012) ) ROM_LOAD16_BYTE( "tx1_8c.ic132", 0x04001, 0x2000, CRC(0d63dadc) SHA1(0954174b25c08967d3efb31f5721fd05502d66dd) ) - ROM_REGION( 0x10000, "audio_cpu", 0 ) /* Label was missing */ + ROM_REGION( 0x10000, "soundbrd:audio_cpu", 0 ) /* Label was missing */ ROM_LOAD( "8411-136027-157.11", 0x00000, 0x2000, CRC(10ae3075) SHA1(69c5f62f2473aba848383eed3cecf15e273d86ca) ) /* Unconfirmed TC013A or the later TC013B */ ROM_REGION( 0x8000, "char_tiles", 0 ) @@ -1073,7 +557,7 @@ ROM_START( buggyboy ) ROM_LOAD16_BYTE( "bug8a.061", 0x04000, 0x2000, CRC(512291cd) SHA1(60f87133c86b88b982ba4680f96d0ac55970cb8d) ) ROM_LOAD16_BYTE( "bug7a.060", 0x04001, 0x2000, CRC(d24dfdef) SHA1(37d05a8bf9567380523df01265afb9780e39ea2a) ) - ROM_REGION( 0x10000, "audio_cpu", 0 ) + ROM_REGION( 0x10000, "soundbrd:audio_cpu", 0 ) ROM_LOAD( "bug35.11", 0x00000, 0x4000, CRC(7aa16e9e) SHA1(ea54e56270f70351a62a78fa32027bb41ef9861e) ) ROM_REGION( 0x8000, "char_tiles", 0 ) @@ -1174,7 +658,7 @@ ROM_START( buggyboyjr ) ROM_LOAD16_BYTE( "bug8s.26", 0x04000, 0x2000, CRC(efd66282) SHA1(8355422c0732c92951659930eb399129fe8d6230) ) ROM_LOAD16_BYTE( "bug7s.25", 0x04001, 0x2000, CRC(bd75b5eb) SHA1(f2b55f84f4c968df177a56103924ac64705285cd) ) - ROM_REGION( 0x10000, "audio_cpu", 0 ) + ROM_REGION( 0x10000, "soundbrd:audio_cpu", 0 ) ROM_LOAD( "bug35s.21", 0x00000, 0x4000, CRC(65d9af57) SHA1(17b09404942d17e7254550c43b56ae96a8c55680) ) ROM_REGION( 0x8000, "char_tiles", 0 ) @@ -1259,8 +743,8 @@ ROM_END * *************************************/ -GAMEL( 1983, tx1, 0, tx1, tx1, tx1_state, empty_init, ROT0, "Tatsumi (Atari/Namco/Taito license)", "TX-1 (World)", MACHINE_IMPERFECT_SOUND, layout_tx1 ) -GAMEL( 1983, tx1jb, tx1, tx1, tx1j, tx1_state, empty_init, ROT0, "Tatsumi", "TX-1 (Japan rev. B)", MACHINE_IMPERFECT_SOUND, layout_tx1 ) -GAMEL( 1983, tx1jc, tx1, tx1, tx1j, tx1_state, empty_init, ROT0, "Tatsumi", "TX-1 (Japan rev. C)", MACHINE_IMPERFECT_SOUND, layout_tx1 ) -GAMEL( 1985, buggyboy, 0, buggyboy, buggyboy, tx1_state, empty_init, ROT0, "Tatsumi", "Buggy Boy/Speed Buggy (cockpit)", 0, layout_buggyboy ) -GAMEL( 1986, buggyboyjr, buggyboy, buggybjr, buggybjr, tx1_state, empty_init, ROT0, "Tatsumi", "Buggy Boy Junior/Speed Buggy (upright)", 0, layout_buggybjr ) +GAMEL( 1983, tx1, 0, tx1, 0, tx1_state, empty_init, ROT0, "Tatsumi (Atari/Namco/Taito license)", "TX-1 (World)", MACHINE_IMPERFECT_SOUND, layout_tx1 ) +GAMEL( 1983, tx1jb, tx1, tx1, 0, tx1_state, empty_init, ROT0, "Tatsumi", "TX-1 (Japan rev. B)", MACHINE_IMPERFECT_SOUND, layout_tx1 ) +GAMEL( 1983, tx1jc, tx1, tx1, 0, tx1_state, empty_init, ROT0, "Tatsumi", "TX-1 (Japan rev. C)", MACHINE_IMPERFECT_SOUND, layout_tx1 ) +GAMEL( 1985, buggyboy, 0, buggyboy, 0, tx1_state, empty_init, ROT0, "Tatsumi", "Buggy Boy/Speed Buggy (cockpit)", 0, layout_buggyboy ) +GAMEL( 1986, buggyboyjr, buggyboy, buggybjr, 0, tx1_state, empty_init, ROT0, "Tatsumi", "Buggy Boy Junior/Speed Buggy (upright)", 0, layout_buggybjr ) diff --git a/src/mame/includes/dkong.h b/src/mame/includes/dkong.h index 6cde8a1ebea..f29208040c1 100644 --- a/src/mame/includes/dkong.h +++ b/src/mame/includes/dkong.h @@ -6,14 +6,15 @@ ***************************************************************************/ -#include "sound/discrete.h" -#include "machine/eepromser.h" -#include "machine/tms6100.h" #include "cpu/m6502/n2a03.h" -#include "machine/latch8.h" -#include "machine/z80dma.h" +#include "machine/eepromser.h" #include "machine/i8257.h" +#include "machine/latch8.h" +#include "machine/tms6100.h" #include "machine/watchdog.h" +#include "machine/z80dma.h" +#include "sound/discrete.h" +#include "sound/tms5110.h" #include "screen.h" @@ -104,7 +105,9 @@ public: , m_dev_n2a03b(*this, "n2a03b") , m_dev_vp2(*this, "virtual_p2") , m_dev_6h(*this, "ls259.6h") + , m_ls175_3d(*this, "ls175.3d") , m_discrete(*this, "discrete") + , m_m58817(*this, "tms") , m_watchdog(*this, "watchdog") , m_video_ram(*this,"video_ram") , m_sprite_ram(*this,"sprite_ram") @@ -135,7 +138,9 @@ public: optional_device m_dev_n2a03b; /* dkong3 */ optional_device m_dev_vp2; /* dkong2, virtual port 2 */ optional_device m_dev_6h; /* dkong2 */ + optional_device m_ls175_3d; /* dkong2b_audio */ optional_device m_discrete; + optional_device m_m58817; /* radarscp1 */ optional_device m_watchdog; /* memory pointers */ @@ -271,7 +276,7 @@ public: DECLARE_MACHINE_START(s2650); DECLARE_MACHINE_RESET(strtheat); DECLARE_MACHINE_RESET(drakton); - DECLARE_WRITE8_MEMBER(M58817_command_w); + DECLARE_WRITE8_MEMBER(m58817_command_w); DECLARE_READ8_MEMBER(dkong_voice_status_r); DECLARE_READ8_MEMBER(dkong_tune_r); DECLARE_WRITE8_MEMBER(dkong_p1_w); @@ -329,6 +334,7 @@ public: void s2650_data_map(address_map &map); void s2650_io_map(address_map &map); void s2650_map(address_map &map); + private: // video/dkong.c void radarscp_step(int line_cnt); diff --git a/src/mame/includes/gridlee.h b/src/mame/includes/gridlee.h index f4492114c5b..5d647002bcb 100644 --- a/src/mame/includes/gridlee.h +++ b/src/mame/includes/gridlee.h @@ -113,7 +113,7 @@ private: /* sound streaming variables */ sound_stream *m_stream; - samples_device *m_samples; + required_device m_samples; double m_freq_to_step; uint8_t m_sound_data[24]; }; diff --git a/src/mame/includes/jedi.h b/src/mame/includes/jedi.h index e6b0ce9b6ba..33ff8f86b3e 100644 --- a/src/mame/includes/jedi.h +++ b/src/mame/includes/jedi.h @@ -10,6 +10,7 @@ #pragma once +#include "sound/tms5220.h" #include "screen.h" @@ -37,6 +38,7 @@ public: m_speech_data(*this, "speech_data"), m_maincpu(*this, "maincpu"), m_audiocpu(*this, "audiocpu"), + m_tms(*this, "tms"), m_screen(*this, "screen") { } @@ -110,6 +112,7 @@ private: required_device m_maincpu; required_device m_audiocpu; + required_device m_tms; required_device m_screen; }; diff --git a/src/mame/includes/redalert.h b/src/mame/includes/redalert.h index b3aa9eb9d25..f5f1964b0cf 100644 --- a/src/mame/includes/redalert.h +++ b/src/mame/includes/redalert.h @@ -7,13 +7,20 @@ If you have any questions about how this driver works, don't hesitate to ask. - Mike Balfour (mab22@po.cwru.edu) + To Do: + - Device-ify video and audio hardware to turn optional_devices into + required_devices. + ****************************************************************************/ + #ifndef MAME_INCLUDES_REDALERT_H #define MAME_INCLUDES_REDALERT_H #pragma once +#include "cpu/i8085/i8085.h" #include "machine/gen_latch.h" +#include "sound/ay8910.h" #include "sound/hc55516.h" #include "screen.h" @@ -28,6 +35,9 @@ public: m_bitmap_color(*this, "bitmap_color"), m_maincpu(*this, "maincpu"), m_audiocpu(*this, "audiocpu"), + m_voicecpu(*this, "voice"), + m_ay8910(*this, "aysnd"), + m_ay(*this, "ay%u", 1U), m_cvsd(*this, "cvsd"), m_screen(*this, "screen"), m_soundlatch(*this, "soundlatch"), @@ -42,6 +52,9 @@ public: required_device m_maincpu; required_device m_audiocpu; + optional_device m_voicecpu; + optional_device m_ay8910; + optional_device_array m_ay; optional_device m_cvsd; required_device m_screen; required_device m_soundlatch; diff --git a/src/mame/includes/tx1.h b/src/mame/includes/tx1.h index 58e8a081144..0ab077046d8 100644 --- a/src/mame/includes/tx1.h +++ b/src/mame/includes/tx1.h @@ -11,7 +11,7 @@ #pragma once #include "screen.h" - +#include "audio/tx1.h" #define TX1_PIXEL_CLOCK (XTAL(18'000'000) / 3) #define TX1_HBSTART 256 @@ -109,28 +109,26 @@ public: : driver_device(mconfig, type, tag), m_maincpu(*this, "main_cpu"), m_mathcpu(*this, "math_cpu"), - m_audiocpu(*this, "audio_cpu"), m_math_ram(*this, "math_ram"), m_vram(*this, "vram"), m_objram(*this, "objram"), m_rcram(*this, "rcram"), - m_z80_ram(*this, "z80_ram"), m_char_tiles(*this, "char_tiles"), m_obj_tiles(*this, "obj_tiles"), m_road_rom(*this, "road"), m_obj_map(*this, "obj_map"), m_obj_luts(*this, "obj_luts"), m_proms(*this, "proms"), - m_screen(*this, "screen") { } + m_screen(*this, "screen"), + m_sound(*this, "soundbrd") + { } required_device m_maincpu; required_device m_mathcpu; - required_device m_audiocpu; required_shared_ptr m_math_ram; required_shared_ptr m_vram; required_shared_ptr m_objram; required_shared_ptr m_rcram; - required_shared_ptr m_z80_ram; required_region_ptr m_char_tiles; required_region_ptr m_obj_tiles; @@ -140,14 +138,10 @@ public: required_region_ptr m_proms; required_device m_screen; + required_device m_sound; emu_timer *m_interrupt_timer; - uint8_t m_ppi_latch_a; - uint8_t m_ppi_latch_b; - uint32_t m_ts; - - math_t m_math; sn74s516_t m_sn74s516; @@ -179,22 +173,9 @@ public: DECLARE_WRITE16_MEMBER(buggyboy_gas_w); DECLARE_WRITE16_MEMBER(buggyboy_sky_w); DECLARE_WRITE16_MEMBER(buggyboy_scolst_w); - DECLARE_WRITE16_MEMBER(z80_busreq_w); DECLARE_WRITE16_MEMBER(resume_math_w); DECLARE_WRITE16_MEMBER(halt_math_w); - DECLARE_WRITE8_MEMBER(z80_intreq_w); - DECLARE_READ16_MEMBER(z80_shared_r); - DECLARE_WRITE16_MEMBER(z80_shared_w); DECLARE_READ16_MEMBER(dipswitches_r); - DECLARE_WRITE8_MEMBER(ts_w); - DECLARE_READ8_MEMBER(ts_r); - DECLARE_WRITE8_MEMBER(tx1_ppi_latch_w); - DECLARE_READ8_MEMBER(bb_analog_r); - DECLARE_READ8_MEMBER(bbjr_analog_r); - DECLARE_WRITE8_MEMBER(tx1_coin_cnt_w); - DECLARE_WRITE8_MEMBER(bb_coin_cnt_w); - DECLARE_READ8_MEMBER(tx1_ppi_porta_r); - DECLARE_READ8_MEMBER(tx1_ppi_portb_r); DECLARE_MACHINE_RESET(tx1); DECLARE_VIDEO_START(tx1); DECLARE_PALETTE_INIT(tx1); @@ -231,21 +212,16 @@ public: uint32_t screen_update_buggybjr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_WRITE_LINE_MEMBER(screen_vblank_tx1); DECLARE_WRITE_LINE_MEMBER(screen_vblank_buggyboy); - INTERRUPT_GEN_MEMBER(z80_irq); TIMER_CALLBACK_MEMBER(interrupt_callback); void tx1(machine_config &config); + void tx1j(machine_config &config); void buggyboy(machine_config &config); void buggybjr(machine_config &config); void buggybjr_main(address_map &map); - void buggybjr_sound_prg(address_map &map); void buggyboy_main(address_map &map); void buggyboy_math(address_map &map); - void buggyboy_sound_io(address_map &map); - void buggyboy_sound_prg(address_map &map); void tx1_main(address_map &map); void tx1_math(address_map &map); - void tx1_sound_io(address_map &map); - void tx1_sound_prg(address_map &map); }; #endif // MAME_INCLUDES_TX1_H