harddriv.cpp: Add 74LS259 to sound board (nw)

This commit is contained in:
AJR 2017-07-27 17:27:36 -04:00
parent 04295ba3e1
commit 14d282e0a4
2 changed files with 46 additions and 29 deletions

View File

@ -32,6 +32,7 @@ DEFINE_DEVICE_TYPE(HARDDRIV_SOUND_BOARD, harddriv_sound_board_device, "harddriv_
harddriv_sound_board_device::harddriv_sound_board_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : harddriv_sound_board_device::harddriv_sound_board_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, HARDDRIV_SOUND_BOARD, tag, owner, clock), device_t(mconfig, HARDDRIV_SOUND_BOARD, tag, owner, clock),
m_soundcpu(*this, "soundcpu"), m_soundcpu(*this, "soundcpu"),
m_latch(*this, "latch"),
m_dac(*this, "dac"), m_dac(*this, "dac"),
m_sounddsp(*this, "sounddsp"), m_sounddsp(*this, "sounddsp"),
m_sounddsp_ram(*this, "sounddsp_ram"), m_sounddsp_ram(*this, "sounddsp_ram"),
@ -192,41 +193,42 @@ READ16_MEMBER(harddriv_sound_board_device::hdsnd68k_status_r)
WRITE16_MEMBER(harddriv_sound_board_device::hdsnd68k_latches_w) WRITE16_MEMBER(harddriv_sound_board_device::hdsnd68k_latches_w)
{ {
/* bit 3 selects the value; data is ignored */ // bit 3 selects the value; data is ignored
data = (offset >> 3) & 1; // low 3 bits select the function
m_latch->write_bit(offset & 7, (offset >> 3) & 1);
}
/* low 3 bits select the function */
offset &= 7;
switch (offset)
{
case 0: /* SPWR - 5220 write strobe */
/* data == 0 means high, 1 means low */
logerror("%06X:SPWR=%d\n", space.device().safe_pcbase(), data);
break;
case 1: /* SPRES - 5220 hard reset */ WRITE_LINE_MEMBER(harddriv_sound_board_device::speech_write_w)
/* data == 0 means low, 1 means high */ {
logerror("%06X:SPRES=%d\n", space.device().safe_pcbase(), data); // data == 0 means high, 1 means low
break; logerror("%06X:SPWR=%d\n", m_soundcpu->pcbase(), state);
}
case 2: /* SPRATE */
/* data == 0 means 8kHz, 1 means 10kHz */
logerror("%06X:SPRATE=%d\n", space.device().safe_pcbase(), data);
break;
case 3: /* CRAMEN */ WRITE_LINE_MEMBER(harddriv_sound_board_device::speech_reset_w)
/* data == 0 means disable 68k access to COM320, 1 means enable */ {
m_cramen = data; // data == 0 means low, 1 means high
break; logerror("%06X:SPRES=%d\n", m_soundcpu->pcbase(), state);
}
case 4: /* RES320 */
logerror("%06X:RES320=%d\n", space.device().safe_pcbase(), data);
m_sounddsp->set_input_line(INPUT_LINE_HALT, data ? CLEAR_LINE : ASSERT_LINE);
break;
case 7: /* LED */ WRITE_LINE_MEMBER(harddriv_sound_board_device::speech_rate_w)
break; {
} // data == 0 means 8kHz, 1 means 10kHz
logerror("%06X:SPRATE=%d\n", m_soundcpu->pcbase(), state);
}
WRITE_LINE_MEMBER(harddriv_sound_board_device::cram_enable_w)
{
// data == 0 means disable 68k access to COM320, 1 means enable
m_cramen = state;
}
WRITE_LINE_MEMBER(harddriv_sound_board_device::led_w)
{
} }
@ -433,6 +435,14 @@ MACHINE_CONFIG_MEMBER( harddriv_sound_board_device::device_add_mconfig )
MCFG_CPU_ADD("soundcpu", M68000, XTAL_16MHz/2) MCFG_CPU_ADD("soundcpu", M68000, XTAL_16MHz/2)
MCFG_CPU_PROGRAM_MAP(driversnd_68k_map) MCFG_CPU_PROGRAM_MAP(driversnd_68k_map)
MCFG_DEVICE_ADD("latch", LS259, 0) // 80R
MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(harddriv_sound_board_device, speech_write_w)) // SPWR - 5220 write strobe
MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(harddriv_sound_board_device, speech_reset_w)) // SPRES - 5220 hard reset
MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(harddriv_sound_board_device, speech_rate_w)) // SPRATE
MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(harddriv_sound_board_device, cram_enable_w)) // CRAMEN
MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(INPUTLINE("sounddsp", INPUT_LINE_HALT)) MCFG_DEVCB_INVERT // RES320
MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(harddriv_sound_board_device, led_w))
MCFG_CPU_ADD("sounddsp", TMS32010, XTAL_20MHz) MCFG_CPU_ADD("sounddsp", TMS32010, XTAL_20MHz)
MCFG_CPU_PROGRAM_MAP(driversnd_dsp_program_map) MCFG_CPU_PROGRAM_MAP(driversnd_dsp_program_map)
/* Data Map is internal to the CPU */ /* Data Map is internal to the CPU */

View File

@ -20,6 +20,7 @@
#include "cpu/tms32010/tms32010.h" #include "cpu/tms32010/tms32010.h"
#include "cpu/tms34010/tms34010.h" #include "cpu/tms34010/tms34010.h"
#include "machine/74259.h"
#include "machine/asic65.h" #include "machine/asic65.h"
#include "machine/mc68681.h" #include "machine/mc68681.h"
#include "machine/timekpr.h" #include "machine/timekpr.h"
@ -485,6 +486,11 @@ public:
DECLARE_READ16_MEMBER(hdsnd68k_320port_r); DECLARE_READ16_MEMBER(hdsnd68k_320port_r);
DECLARE_READ16_MEMBER(hdsnd68k_status_r); DECLARE_READ16_MEMBER(hdsnd68k_status_r);
DECLARE_WRITE16_MEMBER(hdsnd68k_latches_w); DECLARE_WRITE16_MEMBER(hdsnd68k_latches_w);
DECLARE_WRITE_LINE_MEMBER(speech_write_w);
DECLARE_WRITE_LINE_MEMBER(speech_reset_w);
DECLARE_WRITE_LINE_MEMBER(speech_rate_w);
DECLARE_WRITE_LINE_MEMBER(cram_enable_w);
DECLARE_WRITE_LINE_MEMBER(led_w);
DECLARE_WRITE16_MEMBER(hdsnd68k_speech_w); DECLARE_WRITE16_MEMBER(hdsnd68k_speech_w);
DECLARE_WRITE16_MEMBER(hdsnd68k_irqclr_w); DECLARE_WRITE16_MEMBER(hdsnd68k_irqclr_w);
DECLARE_READ16_MEMBER(hdsnd68k_320ram_r); DECLARE_READ16_MEMBER(hdsnd68k_320ram_r);
@ -510,6 +516,7 @@ protected:
private: private:
required_device<cpu_device> m_soundcpu; required_device<cpu_device> m_soundcpu;
required_device<ls259_device> m_latch;
required_device<dac_word_interface> m_dac; required_device<dac_word_interface> m_dac;
required_device<cpu_device> m_sounddsp; required_device<cpu_device> m_sounddsp;
required_shared_ptr<uint16_t> m_sounddsp_ram; required_shared_ptr<uint16_t> m_sounddsp_ram;