diff options
| author | 2020-03-17 23:26:48 +0100 | |
|---|---|---|
| committer | 2020-03-17 23:27:19 +0100 | |
| commit | fa500f400dbee09e4ab4a5a01d2b05055a9749b2 (patch) | |
| tree | 8e9808585f440aed6f5b283937ebfa3a4f0291f9 | |
| parent | 8d40bc060a13ce253cef99e18b3df72861f32864 (diff) | |
ti99: Added FORTi sound card.
| -rw-r--r-- | scripts/src/bus.lua | 2 | ||||
| -rw-r--r-- | src/devices/bus/ti99/peb/forti.cpp | 133 | ||||
| -rw-r--r-- | src/devices/bus/ti99/peb/forti.h | 52 | ||||
| -rw-r--r-- | src/devices/bus/ti99/peb/peribox.cpp | 5 |
4 files changed, 192 insertions, 0 deletions
diff --git a/scripts/src/bus.lua b/scripts/src/bus.lua index 031815ae01e..4d0b8b43527 100644 --- a/scripts/src/bus.lua +++ b/scripts/src/bus.lua @@ -3152,6 +3152,8 @@ if (BUSES["TI99"]~=null) then MAME_DIR .. "src/devices/bus/ti99/peb/myarcfdc.h", MAME_DIR .. "src/devices/bus/ti99/peb/evpc.cpp", MAME_DIR .. "src/devices/bus/ti99/peb/evpc.h", + MAME_DIR .. "src/devices/bus/ti99/peb/forti.cpp", + MAME_DIR .. "src/devices/bus/ti99/peb/forti.h", MAME_DIR .. "src/devices/bus/ti99/peb/hfdc.cpp", MAME_DIR .. "src/devices/bus/ti99/peb/hfdc.h", MAME_DIR .. "src/devices/bus/ti99/peb/horizon.cpp", diff --git a/src/devices/bus/ti99/peb/forti.cpp b/src/devices/bus/ti99/peb/forti.cpp new file mode 100644 index 00000000000..b4a3836bc0d --- /dev/null +++ b/src/devices/bus/ti99/peb/forti.cpp @@ -0,0 +1,133 @@ +// license:LGPL-2.1+ +// copyright-holders:Michael Zapf +/******************************************************************************* + FORTi Sound card + + 4 x TMS9919 sound generators + 4 sound outputs; may be coupled to two stereo outputs + + Mapping: + + 1000 01xx xxxD CBA0 + + 8402: Sound chip 1 (A) + 8404: Sound chip 2 (B) + 8408: Sound chip 3 (C) + 8410: Sound chip 4 (D) + + Sound chips may be addressed in parallel: + 8406: Sound chips 1+2 + 841a: Sound chips 1+3+4 + + All sound READY lines are combined by a wired-AND as the common + READY line to the CPU. + + Michael Zapf + March 2020 + +*******************************************************************************/ + +#include "emu.h" +#include "forti.h" + +#define LOG_READY (1U<<1) + +#define VERBOSE ( LOG_GENERAL ) + +#include "logmacro.h" + +#define FORTI_GEN1_TAG "soundchip1" +#define FORTI_GEN2_TAG "soundchip2" +#define FORTI_GEN3_TAG "soundchip3" +#define FORTI_GEN4_TAG "soundchip4" + +DEFINE_DEVICE_TYPE_NS(TI99_FORTI, bus::ti99::peb, forti_device, "ti99_forti", "FORTi Sound Card") + +namespace bus { namespace ti99 { namespace peb { + +forti_device::forti_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock): + device_t(mconfig, TI99_FORTI, tag, owner, clock), + device_ti99_peribox_card_interface(mconfig, *this), + m_generator1(*this, FORTI_GEN1_TAG), + m_generator2(*this, FORTI_GEN2_TAG), + m_generator3(*this, FORTI_GEN3_TAG), + m_generator4(*this, FORTI_GEN4_TAG) +{ +} + +/* + No read access. The FORTi card does not support any reading. +*/ +READ8Z_MEMBER(forti_device::readz) +{ + return; +} + +/* + READY callbacks from the sound chips. +*/ +WRITE_LINE_MEMBER( forti_device::ready_sound ) +{ + LOGMASKED(LOG_READY, "READY (%d, %d, %d, %d)\n", m_generator1->ready_r(), + m_generator2->ready_r(), m_generator3->ready_r(), m_generator4->ready_r()); + + line_state ready = (m_generator1->ready_r() && m_generator2->ready_r() + && m_generator3->ready_r() && m_generator4->ready_r())? ASSERT_LINE : CLEAR_LINE; + + m_slot->set_ready(ready); +} + +void forti_device::write(offs_t offset, uint8_t data) +{ + // Decode for 8400-87ff + if ((offset & 0xfc01) == 0x8400) + { + // The generators can be accessed in parallel + if ((offset & 0x2)!=0) + m_generator1->write(data); + + if ((offset & 0x4)!=0) + m_generator2->write(data); + + if ((offset & 0x8)!=0) + m_generator3->write(data); + + if ((offset & 0x10)!=0) + m_generator4->write(data); + } +} + +void forti_device::device_add_mconfig(machine_config& config) +{ + // 1 and 3 are mixed to left channel + // 2 and 4 are moxed to right channel + + SPEAKER(config, "forti_left").front_left(); + SPEAKER(config, "forti_right").front_right(); + + SN94624(config, m_generator1, XTAL(3'579'545)/8); + m_generator1->ready_cb().set(FUNC(forti_device::ready_sound)); + m_generator1->add_route(ALL_OUTPUTS, "forti_left", 0.75); + + SN94624(config, m_generator2, XTAL(3'579'545)/8); + m_generator2->ready_cb().set(FUNC(forti_device::ready_sound)); + m_generator2->add_route(ALL_OUTPUTS, "forti_right", 0.75); + + SN94624(config, m_generator3, XTAL(3'579'545)/8); + m_generator3->ready_cb().set(FUNC(forti_device::ready_sound)); + m_generator3->add_route(ALL_OUTPUTS, "forti_left", 0.75); + + SN94624(config, m_generator4, XTAL(3'579'545)/8); + m_generator4->ready_cb().set(FUNC(forti_device::ready_sound)); + m_generator4->add_route(ALL_OUTPUTS, "forti_right", 0.75); +} + +void forti_device::device_start() +{ +} + +void forti_device::device_reset() +{ +} + +} } } // end namespace bus::ti99::peb
\ No newline at end of file diff --git a/src/devices/bus/ti99/peb/forti.h b/src/devices/bus/ti99/peb/forti.h new file mode 100644 index 00000000000..f5ede4b0a71 --- /dev/null +++ b/src/devices/bus/ti99/peb/forti.h @@ -0,0 +1,52 @@ +// license:LGPL-2.1+ +// copyright-holders:Michael Zapf +/******************************************************************************* + FORTi Sound card + + 4 x TMS9919 sound generators + 4 sound outputs; may be coupled to two stereo outputs + + Michael Zapf + March 2020 + +*******************************************************************************/ + +#ifndef MAME_BUS_TI99_PEB_FORTI_H +#define MAME_BUS_TI99_PEB_FORTI_H + +#pragma once + +#include "peribox.h" +#include "sound/sn76496.h" +#include "speaker.h" + +namespace bus { namespace ti99 { namespace peb { + +class forti_device : public device_t, public device_ti99_peribox_card_interface +{ +public: + forti_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + void write(offs_t offset, uint8_t data) override; + DECLARE_READ8Z_MEMBER(readz) override; + DECLARE_READ8Z_MEMBER(crureadz) override { }; + void cruwrite(offs_t offset, uint8_t data) override { }; + + DECLARE_WRITE_LINE_MEMBER( ready_sound ); + +private: + void device_start() override; + void device_reset() override; + void device_add_mconfig(machine_config &config) override; + + // TODO: Replace by TMS9919 when available + required_device<sn94624_device> m_generator1; + required_device<sn94624_device> m_generator2; + required_device<sn94624_device> m_generator3; + required_device<sn94624_device> m_generator4; +}; + +} } } // end namespace bus::ti99::peb + +DECLARE_DEVICE_TYPE_NS(TI99_FORTI, bus::ti99::peb, forti_device) + +#endif // MAME_BUS_TI99_PEB_FORTI_H diff --git a/src/devices/bus/ti99/peb/peribox.cpp b/src/devices/bus/ti99/peb/peribox.cpp index f177ce84b82..6e9290eea98 100644 --- a/src/devices/bus/ti99/peb/peribox.cpp +++ b/src/devices/bus/ti99/peb/peribox.cpp @@ -195,6 +195,7 @@ CRUCLK* 51||52 DBIN #include "spchsyn.h" #include "memex.h" #include "horizon.h" +#include "forti.h" #define LOG_WARN (1U<<1) // Warnings #define LOG_CONFIG (1U<<2) // Configuration @@ -495,6 +496,7 @@ void ti99_peribox_slot_standard(device_slot_interface &device) device.option_add("ccdcc", TI99_CCDCC); device.option_add("ccfdc", TI99_CCFDC); device.option_add("ddcc1", TI99_DDCC1); + device.option_add("forti", TI99_FORTI); } void peribox_device::device_add_mconfig(machine_config &config) @@ -537,6 +539,7 @@ void ti99_peribox_slot_evpc(device_slot_interface &device) device.option_add("ccdcc", TI99_CCDCC); device.option_add("ccfdc", TI99_CCFDC); device.option_add("ddcc1", TI99_DDCC1); + device.option_add("forti", TI99_FORTI); } void peribox_ev_device::device_add_mconfig(machine_config &config) @@ -589,6 +592,7 @@ void ti99_peribox_slot_geneve(device_slot_interface &device) device.option_add("ccdcc", TI99_CCDCC); device.option_add("ccfdc", TI99_CCFDC); device.option_add("ddcc1", TI99_DDCC1); + device.option_add("forti", TI99_FORTI); } void peribox_gen_device::device_add_mconfig(machine_config &config) @@ -643,6 +647,7 @@ void ti99_peribox_slot_sgcpu(device_slot_interface &device) device.option_add("ccdcc", TI99_CCDCC); device.option_add("ccfdc", TI99_CCFDC); device.option_add("ddcc1", TI99_DDCC1); + device.option_add("forti", TI99_FORTI); } void peribox_sg_device::device_add_mconfig(machine_config &config) |
