mirror of
https://github.com/holub/mame
synced 2025-07-06 02:18:09 +03:00
tricep.cpp: Misc. update; serial board identified (nw)
This commit is contained in:
parent
5cafaea691
commit
5b339ef362
@ -6,10 +6,15 @@
|
||||
|
||||
12/05/2009 Skeleton driver.
|
||||
|
||||
Several of the boards apparently used in this S-100 system were
|
||||
made by CompuPro/Viasyn, including the CPU 68K and Interfacer 3
|
||||
(2651 USART multiplexer).
|
||||
|
||||
****************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "bus/rs232/rs232.h"
|
||||
//#include "bus/s100/s100.h"
|
||||
#include "cpu/m68000/m68000.h"
|
||||
#include "machine/mc2661.h"
|
||||
|
||||
@ -19,23 +24,23 @@ public:
|
||||
tricep_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag)
|
||||
, m_maincpu(*this, "maincpu")
|
||||
, m_pci(*this, "pci%u", 0)
|
||||
, m_usart(*this, "usart%u", 0)
|
||||
, m_p_ram(*this, "p_ram")
|
||||
{
|
||||
}
|
||||
|
||||
void tricep(machine_config &config);
|
||||
private:
|
||||
DECLARE_WRITE8_MEMBER(pci_mux_w);
|
||||
DECLARE_READ8_MEMBER(pci_r);
|
||||
DECLARE_WRITE8_MEMBER(pci_w);
|
||||
DECLARE_WRITE8_MEMBER(usart_select_w);
|
||||
DECLARE_READ8_MEMBER(usart_r);
|
||||
DECLARE_WRITE8_MEMBER(usart_w);
|
||||
|
||||
void tricep_mem(address_map &map);
|
||||
|
||||
virtual void machine_reset() override;
|
||||
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device_array<mc2661_device, 4> m_pci;
|
||||
required_device_array<mc2661_device, 4> m_usart;
|
||||
required_shared_ptr<uint16_t> m_p_ram;
|
||||
|
||||
uint8_t m_mux;
|
||||
@ -43,19 +48,19 @@ private:
|
||||
|
||||
|
||||
|
||||
WRITE8_MEMBER(tricep_state::pci_mux_w)
|
||||
WRITE8_MEMBER(tricep_state::usart_select_w)
|
||||
{
|
||||
m_mux = data & 3;
|
||||
}
|
||||
|
||||
READ8_MEMBER(tricep_state::pci_r)
|
||||
READ8_MEMBER(tricep_state::usart_r)
|
||||
{
|
||||
return m_pci[m_mux]->read(space, offset);
|
||||
return m_usart[m_mux]->read(space, offset);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(tricep_state::pci_w)
|
||||
WRITE8_MEMBER(tricep_state::usart_w)
|
||||
{
|
||||
m_pci[m_mux]->write(space, offset, data);
|
||||
m_usart[m_mux]->write(space, offset, data);
|
||||
}
|
||||
|
||||
void tricep_state::tricep_mem(address_map &map)
|
||||
@ -63,8 +68,9 @@ void tricep_state::tricep_mem(address_map &map)
|
||||
map.unmap_value_high();
|
||||
map(0x00000000, 0x0007ffff).ram().share("p_ram");
|
||||
map(0x00fd0000, 0x00fd1fff).rom().region("user1", 0);
|
||||
map(0x00ff0028, 0x00ff002b).rw(FUNC(tricep_state::pci_r), FUNC(tricep_state::pci_w)).umask16(0xffff);
|
||||
map(0x00ff002f, 0x00ff002f).w(FUNC(tricep_state::pci_mux_w));
|
||||
map(0x00ff0028, 0x00ff002b).rw(FUNC(tricep_state::usart_r), FUNC(tricep_state::usart_w));
|
||||
map(0x00ff002e, 0x00ff002f).nopr();
|
||||
map(0x00ff002f, 0x00ff002f).w(FUNC(tricep_state::usart_select_w));
|
||||
}
|
||||
|
||||
/* Input ports */
|
||||
@ -85,7 +91,7 @@ void tricep_state::machine_reset()
|
||||
|
||||
static const input_device_default terminal_defaults[] =
|
||||
{
|
||||
DEVICE_INPUT_DEFAULTS( "RS232_RXBAUD", 0xff, RS232_BAUD_9600 ) // FIXME: should be 19200 with SCN2661B
|
||||
DEVICE_INPUT_DEFAULTS( "RS232_RXBAUD", 0xff, RS232_BAUD_9600 )
|
||||
DEVICE_INPUT_DEFAULTS( "RS232_TXBAUD", 0xff, RS232_BAUD_9600 )
|
||||
DEVICE_INPUT_DEFAULTS( "RS232_STARTBITS", 0xff, RS232_STARTBITS_1 )
|
||||
DEVICE_INPUT_DEFAULTS( "RS232_DATABITS", 0xff, RS232_DATABITS_8 )
|
||||
@ -96,23 +102,24 @@ static const input_device_default terminal_defaults[] =
|
||||
|
||||
void tricep_state::tricep(machine_config &config)
|
||||
{
|
||||
M68000(config, m_maincpu, XTAL(8'000'000));
|
||||
M68000(config, m_maincpu, 20_MHz_XTAL / 2);
|
||||
m_maincpu->set_addrmap(AS_PROGRAM, &tricep_state::tricep_mem);
|
||||
// TODO: MC68451 MMU
|
||||
|
||||
MC2661(config, m_pci[0], 4915200);
|
||||
m_pci[0]->txd_handler().set("rs232", FUNC(rs232_port_device::write_txd));
|
||||
m_pci[0]->rts_handler().set("rs232", FUNC(rs232_port_device::write_rts));
|
||||
m_pci[0]->dtr_handler().set("rs232", FUNC(rs232_port_device::write_dtr));
|
||||
MC2661(config, m_usart[0], 5.0688_MHz_XTAL);
|
||||
m_usart[0]->txd_handler().set("rs232", FUNC(rs232_port_device::write_txd));
|
||||
m_usart[0]->rts_handler().set("rs232", FUNC(rs232_port_device::write_rts));
|
||||
m_usart[0]->dtr_handler().set("rs232", FUNC(rs232_port_device::write_dtr));
|
||||
|
||||
MC2661(config, m_pci[1], 4915200);
|
||||
MC2661(config, m_pci[2], 4915200);
|
||||
MC2661(config, m_pci[3], 4915200);
|
||||
MC2661(config, m_usart[1], 5.0688_MHz_XTAL);
|
||||
MC2661(config, m_usart[2], 5.0688_MHz_XTAL);
|
||||
MC2661(config, m_usart[3], 5.0688_MHz_XTAL);
|
||||
|
||||
rs232_port_device &rs232(RS232_PORT(config, "rs232", default_rs232_devices, "terminal"));
|
||||
rs232.rxd_handler().set(m_pci[0], FUNC(mc2661_device::rx_w));
|
||||
rs232.dsr_handler().set(m_pci[0], FUNC(mc2661_device::dsr_w));
|
||||
rs232.dcd_handler().set(m_pci[0], FUNC(mc2661_device::dcd_w));
|
||||
rs232.cts_handler().set(m_pci[0], FUNC(mc2661_device::cts_w));
|
||||
rs232.rxd_handler().set(m_usart[0], FUNC(mc2661_device::rx_w));
|
||||
rs232.dsr_handler().set(m_usart[0], FUNC(mc2661_device::dsr_w));
|
||||
rs232.dcd_handler().set(m_usart[0], FUNC(mc2661_device::dcd_w));
|
||||
rs232.cts_handler().set(m_usart[0], FUNC(mc2661_device::cts_w));
|
||||
rs232.set_option_device_input_defaults("terminal", terminal_defaults);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user