svi318: add support for the rs232 interface (sv805)

This commit is contained in:
Dirk Best 2016-03-17 23:50:27 +01:00
parent 9737f41ad0
commit de0d79e5e9
7 changed files with 164 additions and 0 deletions

View File

@ -2619,6 +2619,8 @@ if (BUSES["SVI_SLOT"]~=null) then
MAME_DIR .. "src/devices/bus/svi3x8/slot/sv801.h",
MAME_DIR .. "src/devices/bus/svi3x8/slot/sv803.cpp",
MAME_DIR .. "src/devices/bus/svi3x8/slot/sv803.h",
MAME_DIR .. "src/devices/bus/svi3x8/slot/sv805.cpp",
MAME_DIR .. "src/devices/bus/svi3x8/slot/sv805.h",
MAME_DIR .. "src/devices/bus/svi3x8/slot/sv806.cpp",
MAME_DIR .. "src/devices/bus/svi3x8/slot/sv806.h",
MAME_DIR .. "src/devices/bus/svi3x8/slot/sv807.cpp",

View File

@ -11,6 +11,7 @@
SLOT_INTERFACE_START( svi_slot_cards )
SLOT_INTERFACE("sv801", SV801)
SLOT_INTERFACE("sv803", SV803)
SLOT_INTERFACE("sv805", SV805)
SLOT_INTERFACE("sv806", SV806)
SLOT_INTERFACE("sv807", SV807)
SLOT_INTERFACE_END

View File

@ -14,6 +14,7 @@
#include "emu.h"
#include "sv801.h"
#include "sv803.h"
#include "sv805.h"
#include "sv806.h"
#include "sv807.h"

View File

@ -96,6 +96,7 @@ public:
void add_card(device_svi_slot_interface *card);
// from slot
DECLARE_WRITE_LINE_MEMBER( int_w ) { m_int_handler(state); };
DECLARE_WRITE_LINE_MEMBER( romdis_w ) { m_romdis_handler(state); };
DECLARE_WRITE_LINE_MEMBER( ramdis_w ) { m_ramdis_handler(state); };

View File

@ -0,0 +1,109 @@
// license:GPL-2.0+
// copyright-holders:Dirk Best
/***************************************************************************
SV-805 RS-232 Interface for SVI 318/328
***************************************************************************/
#include "sv805.h"
//**************************************************************************
// DEVICE DEFINITIONS
//**************************************************************************
const device_type SV805 = &device_creator<sv805_device>;
//-------------------------------------------------
// machine_config_additions - device-specific
// machine configurations
//-------------------------------------------------
static MACHINE_CONFIG_FRAGMENT( sv805 )
MCFG_DEVICE_ADD("uart", INS8250, XTAL_3_072MHz)
MCFG_INS8250_OUT_INT_CB(WRITELINE(sv805_device, uart_intr_w))
MCFG_INS8250_OUT_TX_CB(DEVWRITELINE("rs232", rs232_port_device, write_txd))
MCFG_INS8250_OUT_DTR_CB(DEVWRITELINE("rs232", rs232_port_device, write_dtr))
MCFG_INS8250_OUT_RTS_CB(DEVWRITELINE("rs232", rs232_port_device, write_rts))
MCFG_RS232_PORT_ADD("rs232", default_rs232_devices, nullptr)
MCFG_RS232_RXD_HANDLER(DEVWRITELINE("uart", ins8250_uart_device, rx_w))
MCFG_RS232_DCD_HANDLER(DEVWRITELINE("uart", ins8250_uart_device, dcd_w))
MCFG_RS232_DSR_HANDLER(DEVWRITELINE("uart", ins8250_uart_device, dsr_w))
MCFG_RS232_CTS_HANDLER(DEVWRITELINE("uart", ins8250_uart_device, cts_w))
MACHINE_CONFIG_END
machine_config_constructor sv805_device::device_mconfig_additions() const
{
return MACHINE_CONFIG_NAME( sv805 );
}
//**************************************************************************
// LIVE DEVICE
//**************************************************************************
//-------------------------------------------------
// sv806_device - constructor
//-------------------------------------------------
sv805_device::sv805_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
device_t(mconfig, SV805, "SV-805 RS-232 Interface", tag, owner, clock, "sv805", __FILE__),
device_svi_slot_interface(mconfig, *this),
m_uart(*this, "uart"),
m_rs232(*this, "rs232")
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void sv805_device::device_start()
{
}
//**************************************************************************
// IMPLEMENTATION
//**************************************************************************
READ8_MEMBER( sv805_device::iorq_r )
{
switch (offset)
{
case 0x28:
case 0x29:
case 0x2a:
case 0x2b:
case 0x2c:
case 0x2d:
case 0x2e:
case 0x2f:
return m_uart->ins8250_r(space, offset & 0x07);
}
return 0xff;
}
WRITE8_MEMBER( sv805_device::iorq_w )
{
switch (offset)
{
case 0x28:
case 0x29:
case 0x2a:
case 0x2b:
case 0x2c:
case 0x2d:
case 0x2e:
case 0x2f:
m_uart->ins8250_w(space, offset & 0x07, data);
}
}
WRITE_LINE_MEMBER( sv805_device::uart_intr_w )
{
m_bus->int_w(state);
}

View File

@ -0,0 +1,49 @@
// license:GPL-2.0+
// copyright-holders:Dirk Best
/***************************************************************************
SV-805 RS-232 Interface for SVI 318/328
***************************************************************************/
#pragma once
#ifndef __SVI3X8_SLOT_SV805_H__
#define __SVI3X8_SLOT_SV805_H__
#include "emu.h"
#include "slot.h"
#include "machine/ins8250.h"
#include "bus/rs232/rs232.h"
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
// ======================> sv805_device
class sv805_device : public device_t, public device_svi_slot_interface
{
public:
// construction/destruction
sv805_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
virtual DECLARE_READ8_MEMBER( iorq_r ) override;
virtual DECLARE_WRITE8_MEMBER( iorq_w ) override;
DECLARE_WRITE_LINE_MEMBER( uart_intr_w );
protected:
virtual machine_config_constructor device_mconfig_additions() const override;
virtual void device_start() override;
private:
required_device<ins8250_device> m_uart;
required_device<rs232_port_device> m_rs232;
};
// device type definition
extern const device_type SV805;
#endif // __SVI3X8_SLOT_SV805_H__

View File

@ -56,6 +56,7 @@ enum
XTAL_2_4576MHz = 2457600, /* Atari ST MFP, NEC PC-98xx */
XTAL_2_5MHz = 2500000, /* Janken Man units */
XTAL_3MHz = 3000000, /* Probably only used to drive 68705 or similar MCUs on 80's Taito PCBs */
XTAL_3_072MHz = 3072000, /* INS 8520 input clock rate */
XTAL_3_12MHz = 3120000, /* SP0250 clock on Gottlieb games */
XTAL_3_5MHz = 3500000, /* Reported by Commodore 65 document, true xtal unchecked on PCB */
XTAL_3_52128MHz = 3521280, /* RCA COSMAC VIP */