From 93179fb4630d903db8916ba3fdbb37c9d3236408 Mon Sep 17 00:00:00 2001 From: Robbbert Date: Sun, 13 Mar 2022 21:51:17 +1100 Subject: gts80a,b: sound for another 16 machines. --- src/mame/audio/gottlieb.cpp | 103 +++++++++++++++++++++++++++++++++++++++++++- src/mame/audio/gottlieb.h | 37 ++++++++++++++++ src/mame/drivers/gts3a.cpp | 10 ++++- src/mame/drivers/gts80a.cpp | 30 ++++++------- src/mame/drivers/gts80b.cpp | 15 +++---- 5 files changed, 167 insertions(+), 28 deletions(-) diff --git a/src/mame/audio/gottlieb.cpp b/src/mame/audio/gottlieb.cpp index 93e56116d9c..f7553ae8009 100644 --- a/src/mame/audio/gottlieb.cpp +++ b/src/mame/audio/gottlieb.cpp @@ -30,6 +30,7 @@ constexpr XTAL SOUND2_SPEECH_CLOCK(3'120'000); //************************************************************************** DEFINE_DEVICE_TYPE(GOTTLIEB_SOUND_PIN2, gottlieb_sound_p2_device, "gotsndp2", "Gottlieb Multi-mode Sound Board") +DEFINE_DEVICE_TYPE(GOTTLIEB_SOUND_PIN3, gottlieb_sound_p3_device, "gotsndp3", "Gottlieb Sound pin. 3") DEFINE_DEVICE_TYPE(GOTTLIEB_SOUND_PIN4, gottlieb_sound_p4_device, "gotsndp4", "Gottlieb Sound pin. 4") DEFINE_DEVICE_TYPE(GOTTLIEB_SOUND_PIN5, gottlieb_sound_p5_device, "gotsndp5", "Gottlieb Sound pin. 5") DEFINE_DEVICE_TYPE(GOTTLIEB_SOUND_PIN6, gottlieb_sound_p6_device, "gotsndp6", "Gottlieb Sound pin. 6") @@ -39,7 +40,7 @@ DEFINE_DEVICE_TYPE(GOTTLIEB_SOUND_REV2, gottlieb_sound_r2_device, //************************************************************************** -// REV 0 SOUND BOARD: 6502 + 6530 + DAC +// PIN 2 SOUND BOARD: 6502 + 6530 + DAC //************************************************************************** //------------------------------------------------- @@ -159,6 +160,106 @@ void gottlieb_sound_p2_device::device_start() } +//************************************************************************** +// PIN 3 SOUND BOARD: 6502 + 6530 + DAC +// No schematic found, so it's reversed engineered guesswork +//************************************************************************** + +//------------------------------------------------- +// gottlieb_sound_p3_device - constructors +//------------------------------------------------- + +gottlieb_sound_p3_device::gottlieb_sound_p3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : device_t(mconfig, GOTTLIEB_SOUND_PIN3, tag, owner, clock) + , device_mixer_interface(mconfig, *this) + , m_cpu(*this, "audiocpu") + , m_r6530(*this, "r6530") + , m_sndcmd(0) +{ +} + + +//------------------------------------------------- +// read port - +//------------------------------------------------- + +uint8_t gottlieb_sound_p3_device::r6530b_r() +{ + return m_sndcmd; +} + +//------------------------------------------------- +// write port - +//------------------------------------------------- + +void gottlieb_sound_p3_device::r6530b_w(u8 data) +{ +// if (BIT(data, 6)) +// m_cpu->set_input_line(M6502_IRQ_LINE, CLEAR_LINE); +} + + +//------------------------------------------------- +// write - handle an external command write +//------------------------------------------------- + +void gottlieb_sound_p3_device::write(uint8_t data) +{ + data = (data ^ 15) & 15; + //if (data) printf("%X ",data); + u8 pb7 = (data) ? 0 : 0x80; + m_sndcmd = data | pb7; + //m_r6530->write(2, m_sndcmd); // has no effect + if (!pb7) + m_cpu->set_input_line(M6502_IRQ_LINE, HOLD_LINE); +} + + +//------------------------------------------------- +// audio CPU map +//------------------------------------------------- + +void gottlieb_sound_p3_device::p3_map(address_map &map) +{ + map.global_mask(0x0fff); + map.unmap_value_high(); + map(0x0000, 0x017f).ram(); + map(0x0200, 0x03ff).rw(m_r6530, FUNC(mos6530_device::read), FUNC(mos6530_device::write)); + map(0x0400, 0x0fff).rom(); +} + + +//------------------------------------------------- +// device_add_mconfig - add device configuration +//------------------------------------------------- + +void gottlieb_sound_p3_device::device_add_mconfig(machine_config &config) +{ + // audio CPU + M6502(config, m_cpu, 800'000); // M6503 - clock is a gate, a resistor and a capacitor. Freq 675-1000kHz. + m_cpu->set_addrmap(AS_PROGRAM, &gottlieb_sound_p3_device::p3_map); + + // I/O configuration + MOS6530(config, m_r6530, 800'000); // same as cpu + m_r6530->out_pa_callback().set("dac", FUNC(dac_byte_interface::data_w)); + m_r6530->in_pb_callback().set(FUNC(gottlieb_sound_p3_device::r6530b_r)); + m_r6530->out_pb_callback().set(FUNC(gottlieb_sound_p3_device::r6530b_w)); + + // sound devices + MC1408(config, "dac", 0).add_route(ALL_OUTPUTS, *this, 0.50); // SSS1408-6P +} + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void gottlieb_sound_p3_device::device_start() +{ + save_item(NAME(m_sndcmd)); +} + + //************************************************************************** // REV 1 SOUND BOARD: 6502 + DAC //************************************************************************** diff --git a/src/mame/audio/gottlieb.h b/src/mame/audio/gottlieb.h index a9dfced8803..79c78b1b395 100644 --- a/src/mame/audio/gottlieb.h +++ b/src/mame/audio/gottlieb.h @@ -21,6 +21,7 @@ //************************************************************************** DECLARE_DEVICE_TYPE(GOTTLIEB_SOUND_PIN2, gottlieb_sound_p2_device) +DECLARE_DEVICE_TYPE(GOTTLIEB_SOUND_PIN3, gottlieb_sound_p3_device) DECLARE_DEVICE_TYPE(GOTTLIEB_SOUND_PIN4, gottlieb_sound_p4_device) DECLARE_DEVICE_TYPE(GOTTLIEB_SOUND_PIN5, gottlieb_sound_p5_device) DECLARE_DEVICE_TYPE(GOTTLIEB_SOUND_PIN6, gottlieb_sound_p6_device) @@ -65,6 +66,37 @@ private: uint8_t r6530b_r(); }; + +// ======================> gottlieb_sound_p3_device + +class gottlieb_sound_p3_device : public device_t, public device_mixer_interface +{ +public: + // construction/destruction + gottlieb_sound_p3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); + + // read/write + void write(uint8_t data); + +protected: + // device-level overrides + virtual void device_add_mconfig(machine_config &config) override; + virtual void device_start() override; + + void p3_map(address_map &map); + +private: + // devices + required_device m_cpu; + required_device m_r6530; + + uint8_t m_sndcmd; + + uint8_t r6530b_r(); + void r6530b_w(u8); +}; + + // ======================> gottlieb_sound_r1_device // rev 1 sound board, with unpopulated VOTRAX @@ -101,6 +133,9 @@ private: u8 m_dummy = 0; // needed for save-state support }; + +// ======================> gottlieb_sound_r1_with_votrax_device + // fully populated rev 1 sound board class gottlieb_sound_r1_with_votrax_device : public gottlieb_sound_r1_device { @@ -236,6 +271,7 @@ private: uint8_t m_sp0250_latch; }; + // ======================> gottlieb_sound_p5_device // same as p5 plus a YM2151 in the expansion socket @@ -262,6 +298,7 @@ private: optional_device m_ym2151; }; + // ======================> gottlieb_sound_p6_device // same as p5 plus an extra dac, same as existing audiocpu. For bonebusters. diff --git a/src/mame/drivers/gts3a.cpp b/src/mame/drivers/gts3a.cpp index a86c1fe8c4a..fc839c7950f 100644 --- a/src/mame/drivers/gts3a.cpp +++ b/src/mame/drivers/gts3a.cpp @@ -13,7 +13,6 @@ Status: ToDo: - Sound - Make it work -- Mechanical sounds - Make display show something sensible - There's an undumped GAL 16V8-25L on the DMD board (position U8) @@ -267,7 +266,14 @@ void gts3a_state::solenoid_w(offs_t offset, u8 data) { for (u8 i = 0; i < 8; i++) m_io_outputs[offset*8+i] = BIT(data, i); - // Add knocker + // Mechanical sounds + if (offset == 3) + { + if (data & 0x18) + m_samples->start(0, 9); // outhole + if (data & 0x20) + m_samples->start(1, 6); // knocker + } } void gts3a_state::segbank_w(u8 data) diff --git a/src/mame/drivers/gts80a.cpp b/src/mame/drivers/gts80a.cpp index c6152df5e22..65d4c35b9b4 100644 --- a/src/mame/drivers/gts80a.cpp +++ b/src/mame/drivers/gts80a.cpp @@ -7,16 +7,10 @@ Gottlieb System 80A Same as system 80, except that the displays have 7 digits. -Most games start up and will accept credits, and the test mode works. See key codes below. - Caveman is missing its joystick. Need the manual. The video-pinball interface has not been written. If you turn on DIPS6,7,8, you can enter test mode, insert coins and start a game. But once in-game, no inputs work. -Rocky has a habit of locking up. Have to reboot the machine with F3. - -Sound is wrong in all games. - Note: If DIP28 is set to Novelty, then Match doesn't work. Here are the key codes to enable play: (may need to hit X to start a ball) @@ -80,6 +74,7 @@ public: , m_io_dips(*this, "DSW%d", 0U) , m_io_keyboard(*this, "X%d", 0U) , m_p2_sound(*this, "p2sound") + , m_p3_sound(*this, "p3sound") , m_r1_sound(*this, "r1sound") , m_digits(*this, "digit%d", 0U) , m_io_outputs(*this, "out%d", 0U) @@ -116,6 +111,7 @@ private: required_ioport_array<4> m_io_dips; required_ioport_array<9> m_io_keyboard; optional_device m_p2_sound; + optional_device m_p3_sound; optional_device m_r1_sound; output_finder<80> m_digits; output_finder<57> m_io_outputs; // 8 solenoids, 1 outhole, 48 lamps @@ -400,6 +396,9 @@ void gts80a_state::port3a_w(u8 data) else if (m_r1_sound) m_r1_sound->write(sndcmd | m_soundex); + else + if (m_p3_sound) + m_p3_sound->write(sndcmd); // Solenoids group 1 if (!BIT(data, 5)) @@ -557,8 +556,7 @@ void gts80a_state::p2(machine_config &config) void gts80a_state::p3(machine_config &config) { p0(config); - // To be developed - no schematic has been found - //GOTTLIEB_SOUND_PIN3(config, m_p3_sound, 0).add_route(ALL_OUTPUTS, "mono", 0.75); + GOTTLIEB_SOUND_PIN3(config, m_p3_sound, 0).add_route(ALL_OUTPUTS, "mono", 0.75); } void gts80a_state::r1(machine_config &config) @@ -673,7 +671,7 @@ ROM_START(alienstr) GTS80A_BIOS ROM_LOAD("689.cpu", 0x1000, 0x0800, CRC(4262006b) SHA1(66520b66c31efd0dc654630b2d3567da799b4d89)) - ROM_REGION(0x1000, "p2sound:audiocpu", 0) + ROM_REGION(0x1000, "p3sound:audiocpu", 0) ROM_LOAD("689-s.snd", 0x0800, 0x0800, CRC(e1e7a610) SHA1(d4eddfc970127cf3a7d086ad46cbc7b95fdc269d)) ROM_END @@ -770,7 +768,7 @@ ROM_START(eldorado) GTS80A_BIOS ROM_LOAD("692-2.cpu", 0x1000, 0x0800, CRC(4ee6d09b) SHA1(5da0556204e76029380366f9fbb5662715cc3257)) - ROM_REGION(0x1000, "p2sound:audiocpu", 0) + ROM_REGION(0x1000, "p3sound:audiocpu", 0) ROM_LOAD("692-s.snd", 0x0800, 0x0800, CRC(9bfbf400) SHA1(58aed9c0b1f52bcd0b53edcdf7af576bb175e3d6)) ROM_END @@ -793,7 +791,7 @@ ROM_START(icefever) GTS80A_BIOS ROM_LOAD("695.cpu", 0x1000, 0x0800, CRC(2f6e9caf) SHA1(4f9eeafcbaf758ee6bbad74611b4912ff75b8576)) - ROM_REGION(0x1000, "p2sound:audiocpu", 0) + ROM_REGION(0x1000, "p3sound:audiocpu", 0) ROM_LOAD("695-s.snd", 0x0800, 0x0800, CRC(daededc2) SHA1(b43303c1e39b21f3fcbc339d440ea051ced1ea26)) ROM_END @@ -804,7 +802,7 @@ ROM_START(jack2opn) GTS80A_BIOS ROM_LOAD("687.cpu", 0x1000, 0x0800, CRC(0080565e) SHA1(c08412ba24d2ffccf11431e80bd2fc95fc4ce02b)) - ROM_REGION(0x1000, "p2sound:audiocpu", 0) + ROM_REGION(0x1000, "p3sound:audiocpu", 0) ROM_LOAD("687-s.snd", 0x0800, 0x0800, CRC(f9d10b7a) SHA1(db255711ed6cb46d183c0ae3894df447f3d8a8e3)) ROM_END @@ -851,7 +849,7 @@ ROM_START(rackempp) GTS80A_BIOS ROM_LOAD("685.cpu", 0x1000, 0x0800, CRC(4754d68d) SHA1(2af743287c1a021f3e130d3d6e191ec9724d640c)) - ROM_REGION(0x1000, "p2sound:audiocpu", 0) + ROM_REGION(0x1000, "p3sound:audiocpu", 0) ROM_LOAD("685-s.snd", 0x0800, 0x0800, CRC(d4219987) SHA1(7385d8723bdc937e7c9d6bf7f26ca06f64a9a212)) ROM_END @@ -862,7 +860,7 @@ ROM_START(raimfire) GTS80A_BIOS ROM_LOAD("686.cpu", 0x1000, 0x0800, CRC(d1e7a0de) SHA1(b9af2fcaadc55d37c7d9d22621c3817eb751de6b)) - ROM_REGION(0x1000, "p2sound:audiocpu", 0) + ROM_REGION(0x1000, "p3sound:audiocpu", 0) ROM_LOAD("686-s.snd", 0x0800, 0x0800, CRC(09740682) SHA1(4f36d78207bd5b8e7abb7118f03acbb3885173c2)) ROM_END @@ -943,7 +941,7 @@ ROM_START(thegames) GTS80A_BIOS ROM_LOAD("691.cpu", 0x1000, 0x0800, CRC(50f620ea) SHA1(2f997a637eba4eb362586d3aa8caac44acccc795)) - ROM_REGION(0x1000, "p2sound:audiocpu", 0) + ROM_REGION(0x1000, "p3sound:audiocpu", 0) ROM_LOAD("691-s.snd", 0x0800, 0x0800, CRC(d7011a31) SHA1(edf5de6cf5ddc1eb577dd1d8dcc9201522df8315)) ROM_END @@ -954,7 +952,7 @@ ROM_START(touchdn) GTS80A_BIOS ROM_LOAD("688.cpu", 0x1000, 0x0800, CRC(e531ab3f) SHA1(695aef0dd911fee27ac2d1493a9646b5430a07d5)) - ROM_REGION(0x1000, "p2sound:audiocpu", 0) + ROM_REGION(0x1000, "p3sound:audiocpu", 0) ROM_LOAD("688-s.snd", 0x0800, 0x0800, CRC(5e9988a6) SHA1(5f531491722d3c30cf4a7c17982813a7c548387a)) ROM_END diff --git a/src/mame/drivers/gts80b.cpp b/src/mame/drivers/gts80b.cpp index 527ac0f62d0..852d36d5224 100644 --- a/src/mame/drivers/gts80b.cpp +++ b/src/mame/drivers/gts80b.cpp @@ -57,8 +57,6 @@ Status: - Various sounds are missing in some games, usually because the cpu concerned runs into the weeds. ToDo: -- Some sound boards to be emulated (p3,p5) -- p3 sound card to be written, haven't found a schematic as manuals are hard to obtain - Missing sounds because of program crashes - bighouse: after game ends, the display freezes. Game keeps running though. @@ -86,7 +84,7 @@ public: , m_riot3(*this, "riot3") , m_io_dips(*this, "DSW%d", 0U) , m_io_keyboard(*this, "X%d", 0U) - //, m_p3_sound(*this, "p3sound") + , m_p3_sound(*this, "p3sound") , m_p4_sound(*this, "p4sound") , m_p5_sound(*this, "p5sound") , m_p6_sound(*this, "p6sound") @@ -134,7 +132,7 @@ private: required_device m_riot3; required_ioport_array<4> m_io_dips; required_ioport_array<9> m_io_keyboard; - //optional_device m_p3_sound; + optional_device m_p3_sound; optional_device m_p4_sound; optional_device m_p5_sound; optional_device m_p6_sound; @@ -468,6 +466,9 @@ void gts80b_state::port3a_w(u8 data) if (m_r2_sound) m_r2_sound->write(sndcmd | m_soundex); else + if (m_p3_sound) + m_p3_sound->write(sndcmd); + else if (m_p4_sound) m_p4_sound->write(sndcmd | m_soundex); else @@ -634,28 +635,24 @@ void gts80b_state::p0(machine_config &config) void gts80b_state::p3(machine_config &config) { p0(config); - - //GOTTLIEB_SOUND_PIN3(config, m_p3_sound, 0).add_route(ALL_OUTPUTS, "mono", 1.00); + GOTTLIEB_SOUND_PIN3(config, m_p3_sound, 0).add_route(ALL_OUTPUTS, "mono", 1.00); } void gts80b_state::p4(machine_config &config) { p0(config); - GOTTLIEB_SOUND_PIN4(config, m_p4_sound, 0).add_route(ALL_OUTPUTS, "mono", 1.00); } void gts80b_state::p5(machine_config &config) { p0(config); - GOTTLIEB_SOUND_PIN5(config, m_p5_sound, 0).add_route(ALL_OUTPUTS, "mono", 1.00); } void gts80b_state::p6(machine_config &config) { p0(config); - GOTTLIEB_SOUND_PIN6(config, m_p6_sound, 0).add_route(ALL_OUTPUTS, "mono", 1.00); } -- cgit v1.2.3