diff options
Diffstat (limited to 'src/devices/bus/pofo')
-rw-r--r-- | src/devices/bus/pofo/exp.cpp | 98 | ||||
-rw-r--r-- | src/devices/bus/pofo/exp.h | 165 | ||||
-rw-r--r-- | src/devices/bus/pofo/hpc101.cpp | 101 | ||||
-rw-r--r-- | src/devices/bus/pofo/hpc101.h | 54 | ||||
-rw-r--r-- | src/devices/bus/pofo/hpc102.cpp | 93 | ||||
-rw-r--r-- | src/devices/bus/pofo/hpc102.h | 58 |
6 files changed, 569 insertions, 0 deletions
diff --git a/src/devices/bus/pofo/exp.cpp b/src/devices/bus/pofo/exp.cpp new file mode 100644 index 00000000000..663f1860193 --- /dev/null +++ b/src/devices/bus/pofo/exp.cpp @@ -0,0 +1,98 @@ +// license:BSD-3-Clause +// copyright-holders:Curt Coder +/********************************************************************** + + Atari Portfolio Expansion Port emulation + +**********************************************************************/ + +#include "exp.h" + + + +//************************************************************************** +// GLOBAL VARIABLES +//************************************************************************** + +const device_type PORTFOLIO_EXPANSION_SLOT = &device_creator<portfolio_expansion_slot_t>; + + + +//************************************************************************** +// CARD INTERFACE +//************************************************************************** + +//------------------------------------------------- +// device_portfolio_expansion_slot_interface - constructor +//------------------------------------------------- + +device_portfolio_expansion_slot_interface::device_portfolio_expansion_slot_interface(const machine_config &mconfig, device_t &device) : + device_slot_card_interface(mconfig,device) +{ + m_slot = dynamic_cast<portfolio_expansion_slot_t *>(device.owner()); +} + + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// portfolio_expansion_slot_t - constructor +//------------------------------------------------- + +portfolio_expansion_slot_t::portfolio_expansion_slot_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : + device_t(mconfig, PORTFOLIO_EXPANSION_SLOT, "Atari Portfolio expansion port", tag, owner, clock, "portfolio_expansion_slot", __FILE__), + device_slot_interface(mconfig, *this), + m_write_iint(*this), + m_write_eint(*this), + m_write_nmio(*this), + m_write_wake(*this), + m_card(nullptr) +{ +} + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void portfolio_expansion_slot_t::device_start() +{ + m_card = dynamic_cast<device_portfolio_expansion_slot_interface *>(get_card_device()); + + // resolve callbacks + m_write_iint.resolve_safe(); + m_write_eint.resolve_safe(); + m_write_nmio.resolve_safe(); + m_write_wake.resolve_safe(); +} + + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void portfolio_expansion_slot_t::device_reset() +{ + if (m_card != nullptr) + { + m_card->device().reset(); + } +} + + + +//------------------------------------------------- +// SLOT_INTERFACE( portfolio_expansion_cards ) +//------------------------------------------------- + +// slot devices +#include "hpc101.h" +#include "hpc102.h" + +SLOT_INTERFACE_START( portfolio_expansion_cards ) + SLOT_INTERFACE("lpt", HPC101) + SLOT_INTERFACE("uart", HPC102) +SLOT_INTERFACE_END diff --git a/src/devices/bus/pofo/exp.h b/src/devices/bus/pofo/exp.h new file mode 100644 index 00000000000..129269ed1cb --- /dev/null +++ b/src/devices/bus/pofo/exp.h @@ -0,0 +1,165 @@ +// license:BSD-3-Clause +// copyright-holders:Curt Coder +/********************************************************************** + + Atari Portfolio Expansion Port emulation + +********************************************************************** + + ABUF 1 2 5VS + REDY 3 4 VCC + BCOM 5 6 NCC1 + NMD1 7 8 WAKE + DTR 9 10 DEN + PDET 11 12 IINT + CCLK 13 14 MRST + HLDA 15 16 HLDO + IACK 17 18 CDET + IOM 19 20 A19 + A18 21 22 A17 + A16 23 24 A15 + A14 25 26 A13 + A12 27 28 A11 + A10 29 30 A9 + A8 31 32 VRAM + HLDI 33 34 ALE + GND 35 36 NMIO + OA7 37 38 OA6 + OA5 39 40 OA4 + OA3 41 42 OA2 + OA1 43 44 OA0 + AD0 45 46 AD1 + AD2 47 48 AD3 + AD4 49 50 AD5 + AD6 51 52 AD7 + EINT 53 54 NRDI + VEXT 55 56 EACK + BATD 57 58 NWRI + 5VS 59 60 BBUF + +**********************************************************************/ + +#pragma once + +#ifndef __PORTFOLIO_EXPANSION_SLOT__ +#define __PORTFOLIO_EXPANSION_SLOT__ + +#include "emu.h" + + + +//************************************************************************** +// CONSTANTS +//************************************************************************** + +#define PORTFOLIO_EXPANSION_SLOT_TAG "exp" + + + +//************************************************************************** +// INTERFACE CONFIGURATION MACROS +//************************************************************************** + +#define MCFG_PORTFOLIO_EXPANSION_SLOT_ADD(_tag, _clock, _slot_intf, _def_slot) \ + MCFG_DEVICE_ADD(_tag, PORTFOLIO_EXPANSION_SLOT, _clock) \ + MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) + +#define MCFG_PORTFOLIO_EXPANSION_SLOT_IINT_CALLBACK(_write) \ + devcb = &portfolio_expansion_slot_t::set_iint_wr_callback(*device, DEVCB_##_write); + +#define MCFG_PORTFOLIO_EXPANSION_SLOT_EINT_CALLBACK(_write) \ + devcb = &portfolio_expansion_slot_t::set_eint_wr_callback(*device, DEVCB_##_write); + +#define MCFG_PORTFOLIO_EXPANSION_SLOT_NMIO_CALLBACK(_write) \ + devcb = &portfolio_expansion_slot_t::set_nmio_wr_callback(*device, DEVCB_##_write); + +#define MCFG_PORTFOLIO_EXPANSION_SLOT_WAKE_CALLBACK(_write) \ + devcb = &portfolio_expansion_slot_t::set_wake_wr_callback(*device, DEVCB_##_write); + + + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +// ======================> device_portfolio_expansion_slot_interface + +class portfolio_expansion_slot_t; + +class device_portfolio_expansion_slot_interface : public device_slot_card_interface +{ +public: + // construction/destruction + device_portfolio_expansion_slot_interface(const machine_config &mconfig, device_t &device); + virtual ~device_portfolio_expansion_slot_interface() { } + + bool nmd1() { return 1; } + bool pdet() { return 0; } + bool cdet() { return 1; } + + UINT8 iack_r() { return 0xff; } + UINT8 eack_r() { return 0xff; } + + UINT8 nrdi_r(address_space &space, offs_t offset, UINT8 data, bool iom, bool bcom, bool ncc1) { return data; }; + void nwri_w(address_space &space, offs_t offset, UINT8 data, bool iom, bool bcom, bool ncc1) { }; + +protected: + portfolio_expansion_slot_t *m_slot; +}; + + +// ======================> portfolio_expansion_slot_t + +class portfolio_expansion_slot_t : public device_t, + public device_slot_interface +{ +public: + // construction/destruction + portfolio_expansion_slot_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + virtual ~portfolio_expansion_slot_t() { } + + template<class _Object> static devcb_base &set_iint_wr_callback(device_t &device, _Object object) { return downcast<portfolio_expansion_slot_t &>(device).m_write_iint.set_callback(object); } + template<class _Object> static devcb_base &set_eint_wr_callback(device_t &device, _Object object) { return downcast<portfolio_expansion_slot_t &>(device).m_write_eint.set_callback(object); } + template<class _Object> static devcb_base &set_nmio_wr_callback(device_t &device, _Object object) { return downcast<portfolio_expansion_slot_t &>(device).m_write_nmio.set_callback(object); } + template<class _Object> static devcb_base &set_wake_wr_callback(device_t &device, _Object object) { return downcast<portfolio_expansion_slot_t &>(device).m_write_wake.set_callback(object); } + + // computer interface + bool nmd1_r() { return (m_card != nullptr) ? m_card->nmd1() : 1; } + bool pdet_r() { return (m_card != nullptr) ? m_card->pdet() : 0; } + bool cdet_r() { return (m_card != nullptr) ? m_card->cdet() : 1; } + + UINT8 iack_r() { return (m_card != nullptr) ? m_card->iack_r() : 0xff; }; + UINT8 eack_r() { return (m_card != nullptr) ? m_card->eack_r() : 0xff; }; + + UINT8 nrdi_r(address_space &space, offs_t offset, UINT8 data, bool iom, bool bcom, bool ncc1) { return (m_card != nullptr) ? m_card->nrdi_r(space, offset, data, iom, bcom, ncc1) : data; } + void nwri_w(address_space &space, offs_t offset, UINT8 data, bool iom, bool bcom, bool ncc1) { if (m_card != nullptr) m_card->nwri_w(space, offset, data, iom, bcom, ncc1); } + + // peripheral interface + WRITE_LINE_MEMBER( iint_w ) { m_write_iint(state); } + WRITE_LINE_MEMBER( eint_w ) { m_write_eint(state); } + WRITE_LINE_MEMBER( nmio_w ) { m_write_nmio(state); } + WRITE_LINE_MEMBER( wake_w ) { m_write_wake(state); } + +protected: + // device-level overrides + virtual void device_start() override; + virtual void device_reset() override; + + devcb_write_line m_write_iint; + devcb_write_line m_write_eint; + devcb_write_line m_write_nmio; + devcb_write_line m_write_wake; + + device_portfolio_expansion_slot_interface *m_card; +}; + + +// device type definition +extern const device_type PORTFOLIO_EXPANSION_SLOT; + + +SLOT_INTERFACE_EXTERN( portfolio_expansion_cards ); + + + +#endif diff --git a/src/devices/bus/pofo/hpc101.cpp b/src/devices/bus/pofo/hpc101.cpp new file mode 100644 index 00000000000..8ea93ac4989 --- /dev/null +++ b/src/devices/bus/pofo/hpc101.cpp @@ -0,0 +1,101 @@ +// license:BSD-3-Clause +// copyright-holders:Curt Coder +/********************************************************************** + + Atari Portfolio HPC-101 parallel interface emulation + +**********************************************************************/ + +#include "hpc101.h" + + + +//************************************************************************** +// MACROS / CONSTANTS +//************************************************************************** + +#define LOG 0 + +#define M82C55A_TAG "u1" +#define CENTRONICS_TAG "centronics" + + + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +const device_type HPC101 = &device_creator<hpc101_t>; + + +//------------------------------------------------- +// MACHINE_CONFIG_FRAGMENT( hpc101 ) +//------------------------------------------------- + +static MACHINE_CONFIG_FRAGMENT( hpc101 ) + MCFG_DEVICE_ADD(M82C55A_TAG, I8255A, 0) + MCFG_I8255_OUT_PORTA_CB(DEVWRITE8("cent_data_out", output_latch_device, write)) + MCFG_I8255_OUT_PORTB_CB(DEVWRITE8("cent_ctrl_out", output_latch_device, write)) + MCFG_I8255_IN_PORTC_CB(DEVREAD8("cent_status_in", input_buffer_device, read)) + + MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_devices, "printer") + MCFG_CENTRONICS_ACK_HANDLER(DEVWRITELINE("cent_status_in", input_buffer_device, write_bit5)) + MCFG_CENTRONICS_BUSY_HANDLER(DEVWRITELINE("cent_status_in", input_buffer_device, write_bit4)) + MCFG_CENTRONICS_FAULT_HANDLER(DEVWRITELINE("cent_status_in", input_buffer_device, write_bit3)) + MCFG_CENTRONICS_SELECT_HANDLER(DEVWRITELINE("cent_status_in", input_buffer_device, write_bit1)) + MCFG_CENTRONICS_PERROR_HANDLER(DEVWRITELINE("cent_status_in", input_buffer_device, write_bit0)) + + MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", CENTRONICS_TAG) + MCFG_DEVICE_ADD("cent_status_in", INPUT_BUFFER, 0) + + MCFG_DEVICE_ADD("cent_ctrl_out", OUTPUT_LATCH, 0) + MCFG_OUTPUT_LATCH_BIT0_HANDLER(DEVWRITELINE(CENTRONICS_TAG, centronics_device, write_strobe)) + MCFG_OUTPUT_LATCH_BIT1_HANDLER(DEVWRITELINE(CENTRONICS_TAG, centronics_device, write_autofd)) + MCFG_OUTPUT_LATCH_BIT2_HANDLER(DEVWRITELINE(CENTRONICS_TAG, centronics_device, write_init)) + MCFG_OUTPUT_LATCH_BIT3_HANDLER(DEVWRITELINE(CENTRONICS_TAG, centronics_device, write_select_in)) +MACHINE_CONFIG_END + + +//------------------------------------------------- +// machine_config_additions - device-specific +// machine configurations +//------------------------------------------------- + +machine_config_constructor hpc101_t::device_mconfig_additions() const +{ + return MACHINE_CONFIG_NAME( hpc101 ); +} + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// hpc101_t - constructor +//------------------------------------------------- + +hpc101_t::hpc101_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : + device_t(mconfig, HPC101, "Atari Portfolio HPC-101", tag, owner, clock, "hpc101", __FILE__), + device_portfolio_expansion_slot_interface(mconfig, *this), + m_ppi(*this, M82C55A_TAG) +{ +} + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void hpc101_t::device_start() +{ +} + + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void hpc101_t::device_reset() +{ +} diff --git a/src/devices/bus/pofo/hpc101.h b/src/devices/bus/pofo/hpc101.h new file mode 100644 index 00000000000..dc578e3769b --- /dev/null +++ b/src/devices/bus/pofo/hpc101.h @@ -0,0 +1,54 @@ +// license:BSD-3-Clause +// copyright-holders:Curt Coder +/********************************************************************** + + Atari Portfolio HPC-101 parallel interface emulation + +**********************************************************************/ + +#pragma once + +#ifndef __HPC101__ +#define __HPC101__ + +#include "emu.h" +#include "exp.h" +#include "bus/centronics/ctronics.h" +#include "machine/i8255.h" + + + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +// ======================> hpc101_t + +class hpc101_t : public device_t, + public device_portfolio_expansion_slot_interface +{ +public: + // construction/destruction + hpc101_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + + // optional information overrides + virtual machine_config_constructor device_mconfig_additions() const override; + +protected: + // device-level overrides + virtual void device_start() override; + virtual void device_reset() override; + + // device_portfolio_expansion_slot_interface overrides + +private: + required_device<i8255_device> m_ppi; +}; + + +// device type definition +extern const device_type HPC101; + + + +#endif diff --git a/src/devices/bus/pofo/hpc102.cpp b/src/devices/bus/pofo/hpc102.cpp new file mode 100644 index 00000000000..8d40470a2eb --- /dev/null +++ b/src/devices/bus/pofo/hpc102.cpp @@ -0,0 +1,93 @@ +// license:BSD-3-Clause +// copyright-holders:Curt Coder +/********************************************************************** + + Atari Portfolio HPC-102 serial interface emulation + +**********************************************************************/ + +#include "hpc102.h" + + + +//************************************************************************** +// MACROS / CONSTANTS +//************************************************************************** + +#define LOG 0 + +#define M82C50A_TAG "u1" +#define RS232_TAG "rs232" + + + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +const device_type HPC102 = &device_creator<hpc102_t>; + + +//------------------------------------------------- +// MACHINE_CONFIG_FRAGMENT( hpc102 ) +//------------------------------------------------- + +static MACHINE_CONFIG_FRAGMENT( hpc102 ) + MCFG_DEVICE_ADD(M82C50A_TAG, INS8250, XTAL_1_8432MHz) // should be INS8250A + MCFG_INS8250_OUT_TX_CB(DEVWRITELINE(RS232_TAG, rs232_port_device, write_txd)) + MCFG_INS8250_OUT_DTR_CB(DEVWRITELINE(RS232_TAG, rs232_port_device, write_dtr)) + MCFG_INS8250_OUT_RTS_CB(DEVWRITELINE(RS232_TAG, rs232_port_device, write_rts)) + //MCFG_INS8250_OUT_INT_CB(WRITELINE(portfolio_state, i8250_intrpt_w)) + + MCFG_RS232_PORT_ADD(RS232_TAG, default_rs232_devices, nullptr) + MCFG_RS232_RXD_HANDLER(DEVWRITELINE(M82C50A_TAG, ins8250_uart_device, rx_w)) + MCFG_RS232_DCD_HANDLER(DEVWRITELINE(M82C50A_TAG, ins8250_uart_device, dcd_w)) + MCFG_RS232_DSR_HANDLER(DEVWRITELINE(M82C50A_TAG, ins8250_uart_device, dsr_w)) + MCFG_RS232_RI_HANDLER(DEVWRITELINE(M82C50A_TAG, ins8250_uart_device, ri_w)) + MCFG_RS232_CTS_HANDLER(DEVWRITELINE(M82C50A_TAG, ins8250_uart_device, cts_w)) +MACHINE_CONFIG_END + + +//------------------------------------------------- +// machine_config_additions - device-specific +// machine configurations +//------------------------------------------------- + +machine_config_constructor hpc102_t::device_mconfig_additions() const +{ + return MACHINE_CONFIG_NAME( hpc102 ); +} + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// hpc102_t - constructor +//------------------------------------------------- + +hpc102_t::hpc102_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : + device_t(mconfig, HPC102, "Atari Portfolio HPC-102", tag, owner, clock, "hpc102", __FILE__), + device_portfolio_expansion_slot_interface(mconfig, *this), + m_uart(*this, M82C50A_TAG) +{ +} + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void hpc102_t::device_start() +{ +} + + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void hpc102_t::device_reset() +{ +} diff --git a/src/devices/bus/pofo/hpc102.h b/src/devices/bus/pofo/hpc102.h new file mode 100644 index 00000000000..0ef1d978e90 --- /dev/null +++ b/src/devices/bus/pofo/hpc102.h @@ -0,0 +1,58 @@ +// license:BSD-3-Clause +// copyright-holders:Curt Coder +/********************************************************************** + + Atari Portfolio HPC-102 serial interface emulation + +**********************************************************************/ + +#pragma once + +#ifndef __HPC102__ +#define __HPC102__ + +#include "emu.h" +#include "exp.h" +#include "bus/rs232/rs232.h" +#include "machine/ins8250.h" + + + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +// ======================> hpc102_t + +class hpc102_t : public device_t, + public device_portfolio_expansion_slot_interface +{ +public: + // construction/destruction + hpc102_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + + // optional information overrides + virtual machine_config_constructor device_mconfig_additions() const override; + +protected: + // device-level overrides + virtual void device_start() override; + virtual void device_reset() override; + + // device_portfolio_expansion_slot_interface overrides + +private: + required_device<ins8250_device> m_uart; +}; + + +// device type definition +extern const device_type HPC102; + + + +#endif +/* + + +*/
\ No newline at end of file |