summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
author Curt Coder <curtcoder@mail.com>2016-06-15 10:55:10 +0300
committer Curt Coder <curtcoder@mail.com>2016-06-15 10:55:18 +0300
commitf945016811743c6ebf694fd399d342e1f4144d22 (patch)
treec84f9c1f574c22703da9a971e118d98e123918ea /src
parent3316070a98f16e1f84ebf8559388c93dcd7d8a79 (diff)
pofo: Expansion port slot interface WIP. (nw)
Diffstat (limited to 'src')
-rw-r--r--src/devices/bus/pofo/exp.cpp98
-rw-r--r--src/devices/bus/pofo/exp.h165
-rw-r--r--src/devices/bus/pofo/hpc101.cpp101
-rw-r--r--src/devices/bus/pofo/hpc101.h54
-rw-r--r--src/devices/bus/pofo/hpc102.cpp93
-rw-r--r--src/devices/bus/pofo/hpc102.h58
-rw-r--r--src/mame/drivers/pofo.cpp (renamed from src/mame/drivers/portfoli.cpp)341
-rw-r--r--src/mame/includes/portfoli.h123
8 files changed, 693 insertions, 340 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
diff --git a/src/mame/drivers/portfoli.cpp b/src/mame/drivers/pofo.cpp
index ba6d02805d7..4b55589d01e 100644
--- a/src/mame/drivers/portfoli.cpp
+++ b/src/mame/drivers/pofo.cpp
@@ -9,62 +9,12 @@
http://www.best-electronics-ca.com/portfoli.htm
http://www.atari-portfolio.co.uk/pfnews/pf9.txt
-
- Undumped Atari cartridges:
-
- Utility-Card HPC-701
- Finance-Card HPC-702
- Science-Card HPC-703
- File Manager / Tutorial HPC-704
- PowerBASIC HPC-705
- Instant Spell HPC-709
- Hyperlist HPC-713
- Bridge Baron HPC-724
- Wine Companion HPC-725
- Diet / Cholesterol Counter HPC-726
- Astrologer HPC-728
- Stock Tracker HPC-729
- Chess HPC-750
-
-
- Undumped 3rd party cartridges:
-
- Adcalc AAC-1000
- Alpha Paging Interface SAMpage
- Business Contacts and Information Manager BCIM
- Checkwriter
- Colossal Cave Adventure
- Drug Interactions
- Dynapulse 200M-A
- Form Letters
- FORTH programming system UTIL
- FX-3 DUAT Flight Software
- FX-4 Flight Planner
- Graphics Screens
- Marine Device Interface CM380 UMPIRE
- Message Mover (Mac) MSG-PKG6
- Message Mover (PC) MSG-PKG5
- Micro Hedge
- Micro-Roentgen Radiation Monitor RM-60
- Patient Management
- PBase
- PDD2 Utilities
- Pharmaceuticals
- Physician's Reference I
- PIPELINE Fuel Management
- REACT
- Stocks Games
- Terminal+
- Timekeeper
- TIMEPAC-5
-
*/
/*
TODO:
- - expansion port slot interface
- clock is running too fast
- create chargen ROM from tech manual
- memory error interrupt vector
@@ -73,38 +23,128 @@
- system tick frequency selection (1 or 128 Hz)
- speaker
- credit card memory (A:/B:)
- - software list
*/
-#include "includes/portfoli.h"
-#include "bus/rs232/rs232.h"
+#include "emu.h"
#include "rendlay.h"
#include "softlist.h"
+#include "cpu/i86/i86.h"
+#include "bus/generic/slot.h"
+#include "bus/generic/carts.h"
+#include "bus/pofo/exp.h"
+#include "machine/nvram.h"
+#include "machine/ram.h"
+#include "sound/speaker.h"
+#include "video/hd61830.h"
+
+#define M80C88A_TAG "u1"
+#define HD61830_TAG "hd61830"
+#define TIMER_TICK_TAG "tick"
+#define SCREEN_TAG "screen"
+
+class portfolio_state : public driver_device
+{
+public:
+ portfolio_state(const machine_config &mconfig, device_type type, const char *tag) :
+ driver_device(mconfig, type, tag),
+ m_maincpu(*this, M80C88A_TAG),
+ m_lcdc(*this, HD61830_TAG),
+ m_speaker(*this, "speaker"),
+ m_exp(*this, PORTFOLIO_EXPANSION_SLOT_TAG),
+ m_timer_tick(*this, TIMER_TICK_TAG),
+ m_rom(*this, M80C88A_TAG),
+ m_char_rom(*this, HD61830_TAG),
+ m_y0(*this, "Y0"),
+ m_y1(*this, "Y1"),
+ m_y2(*this, "Y2"),
+ m_y3(*this, "Y3"),
+ m_y4(*this, "Y4"),
+ m_y5(*this, "Y5"),
+ m_y6(*this, "Y6"),
+ m_y7(*this, "Y7"),
+ m_battery(*this, "BATTERY"),
+ m_contrast(*this, "contrast"),
+ m_ram(*this, RAM_TAG)
+ { }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<hd61830_device> m_lcdc;
+ required_device<speaker_sound_device> m_speaker;
+ required_device<portfolio_expansion_slot_t> m_exp;
+ required_device<timer_device> m_timer_tick;
+ required_region_ptr<UINT8> m_rom;
+ required_region_ptr<UINT8> m_char_rom;
+ required_ioport m_y0;
+ required_ioport m_y1;
+ required_ioport m_y2;
+ required_ioport m_y3;
+ required_ioport m_y4;
+ required_ioport m_y5;
+ required_ioport m_y6;
+ required_ioport m_y7;
+ required_ioport m_battery;
+
+ virtual void machine_start() override;
+ virtual void machine_reset() override;
+
+ void check_interrupt();
+ void trigger_interrupt(int level);
+ void scan_keyboard();
+
+ enum
+ {
+ INT_TICK = 0,
+ INT_KEYBOARD,
+ INT_ERROR,
+ INT_EXTERNAL
+ };
+
+ DECLARE_READ8_MEMBER( irq_status_r );
+ DECLARE_READ8_MEMBER( keyboard_r );
+ DECLARE_READ8_MEMBER( battery_r );
+ DECLARE_READ8_MEMBER( counter_r );
+
+ DECLARE_WRITE8_MEMBER( irq_mask_w );
+ DECLARE_WRITE8_MEMBER( speaker_w );
+ DECLARE_WRITE8_MEMBER( power_w );
+ DECLARE_WRITE8_MEMBER( unknown_w );
+ DECLARE_WRITE8_MEMBER( counter_w );
+
+ DECLARE_WRITE_LINE_MEMBER( iint_w );
+ DECLARE_WRITE_LINE_MEMBER( eint_w );
+
+ /* interrupt state */
+ UINT8 m_ip; /* interrupt pending */
+ UINT8 m_ie; /* interrupt enable */
+ UINT8 m_sivr; /* serial interrupt vector register */
+
+ /* counter state */
+ UINT16 m_counter;
+
+ /* keyboard state */
+ UINT8 m_keylatch;
+
+ /* video state */
+ required_shared_ptr<UINT8> m_contrast;
+
+ /* peripheral state */
+ DECLARE_PALETTE_INIT(portfolio);
+ TIMER_DEVICE_CALLBACK_MEMBER(keyboard_tick);
+ TIMER_DEVICE_CALLBACK_MEMBER(system_tick);
+ TIMER_DEVICE_CALLBACK_MEMBER(counter_tick);
+ DECLARE_READ8_MEMBER(hd61830_rd_r);
+ IRQ_CALLBACK_MEMBER(portfolio_int_ack);
+ DECLARE_DEVICE_IMAGE_LOAD_MEMBER( portfolio_cart );
+ required_device<ram_device> m_ram;
+};
+
//**************************************************************************
// MACROS / CONSTANTS
//**************************************************************************
-enum
-{
- INT_TICK = 0,
- INT_KEYBOARD,
- INT_ERROR,
- INT_EXTERNAL
-};
-
-enum
-{
- PID_COMMCARD = 0x00,
- PID_SERIAL,
- PID_PARALLEL,
- PID_PRINTER,
- PID_MODEM,
- PID_NONE = 0xff
-};
-
static const UINT8 INTERRUPT_VECTOR[] = { 0x08, 0x09, 0x00 };
@@ -162,17 +202,6 @@ WRITE8_MEMBER( portfolio_state::irq_mask_w )
//-------------------------------------------------
-// sivr_w - serial interrupt vector register
-//-------------------------------------------------
-
-WRITE8_MEMBER( portfolio_state::sivr_w )
-{
- m_sivr = data;
- //logerror("SIVR %02x\n", data);
-}
-
-
-//-------------------------------------------------
// IRQ_CALLBACK_MEMBER( portfolio_int_ack )
//-------------------------------------------------
@@ -363,7 +392,7 @@ READ8_MEMBER( portfolio_state::battery_r )
UINT8 data = 0;
/* peripheral detect */
- data |= (m_pid != PID_NONE) << 5;
+ data |= m_exp->pdet_r() << 5;
/* battery status */
data |= BIT(m_battery->read(), 0) << 6;
@@ -451,60 +480,6 @@ WRITE8_MEMBER( portfolio_state::counter_w )
//**************************************************************************
-// EXPANSION
-//**************************************************************************
-
-//-------------------------------------------------
-// ncc1_w - credit card memory select
-//-------------------------------------------------
-
-WRITE8_MEMBER( portfolio_state::ncc1_w )
-{
- address_space &program = m_maincpu->space(AS_PROGRAM);
-
- if (BIT(data, 0))
- {
- // system ROM
- program.install_rom(0xc0000, 0xdffff, m_rom);
- }
- else
- {
- // credit card memory
- program.unmap_readwrite(0xc0000, 0xdffff);
- }
-
- //logerror("NCC %02x\n", data);
-}
-
-
-//-------------------------------------------------
-// pid_r - peripheral identification
-//-------------------------------------------------
-
-READ8_MEMBER( portfolio_state::pid_r )
-{
- /*
-
- PID peripheral
-
- 00 communication card
- 01 serial port
- 02 parallel port
- 03 printer peripheral
- 04 modem
- 05-3f reserved
- 40-7f user peripherals
- 80 file-transfer interface
- 81-ff reserved
-
- */
-
- return m_pid;
-}
-
-
-
-//**************************************************************************
// ADDRESS MAPS
//**************************************************************************
@@ -535,10 +510,6 @@ static ADDRESS_MAP_START( portfolio_io, AS_IO, 8, portfolio_state )
AM_RANGE(0x8050, 0x8050) AM_READWRITE(irq_status_r, irq_mask_w)
AM_RANGE(0x8051, 0x8051) AM_READWRITE(battery_r, unknown_w)
AM_RANGE(0x8060, 0x8060) AM_RAM AM_SHARE("contrast")
-// AM_RANGE(0x8070, 0x8077) AM_DEVREADWRITE(M82C50A_TAG, ins8250_device, ins8250_r, ins8250_w) // Serial Interface
-// AM_RANGE(0x8078, 0x807b) AM_DEVREADWRITE(M82C55A_TAG, i8255_device, read, write) // Parallel Interface
- AM_RANGE(0x807c, 0x807c) AM_WRITE(ncc1_w)
- AM_RANGE(0x807f, 0x807f) AM_READWRITE(pid_r, sivr_w)
ADDRESS_MAP_END
@@ -636,12 +607,6 @@ static INPUT_PORTS_START( portfolio )
PORT_CONFNAME( 0x01, 0x01, "Battery Status" )
PORT_CONFSETTING( 0x01, DEF_STR( Normal ) )
PORT_CONFSETTING( 0x00, "Low Battery" )
-
- PORT_START("PERIPHERAL")
- PORT_CONFNAME( 0xff, PID_NONE, "Peripheral" )
- PORT_CONFSETTING( PID_NONE, DEF_STR( None ) )
- PORT_CONFSETTING( PID_PARALLEL, "Intelligent Parallel Interface (HPC-101)" )
- PORT_CONFSETTING( PID_SERIAL, "Serial Interface (HPC-102)" )
INPUT_PORTS_END
@@ -700,11 +665,11 @@ GFXDECODE_END
// DEVICE CONFIGURATION
//**************************************************************************
-//-------------------------------------------------
-// ins8250_interface i8250_intf
-//-------------------------------------------------
+WRITE_LINE_MEMBER( portfolio_state::iint_w )
+{
+}
-WRITE_LINE_MEMBER( portfolio_state::i8250_intrpt_w )
+WRITE_LINE_MEMBER( portfolio_state::eint_w )
{
if (state)
trigger_interrupt(INT_EXTERNAL);
@@ -752,7 +717,6 @@ void portfolio_state::machine_start()
/* set initial values */
m_keylatch = 0xff;
m_sivr = 0x2a;
- m_pid = 0xff;
/* register for state saving */
save_item(NAME(m_ip));
@@ -761,7 +725,6 @@ void portfolio_state::machine_start()
save_item(NAME(m_counter));
save_item(NAME(m_keylatch));
save_pointer(NAME(m_contrast.target()), m_contrast.bytes());
- save_item(NAME(m_pid));
}
@@ -771,24 +734,6 @@ void portfolio_state::machine_start()
void portfolio_state::machine_reset()
{
- address_space &io = m_maincpu->space(AS_IO);
-
- // peripherals
- m_pid = ioport("PERIPHERAL")->read();
-
- io.unmap_readwrite(0x8070, 0x807b);
- io.unmap_readwrite(0x807d, 0x807e);
-
- switch (m_pid)
- {
- case PID_SERIAL:
- io.install_readwrite_handler(0x8070, 0x8077, READ8_DEVICE_DELEGATE(m_uart, ins8250_device, ins8250_r), WRITE8_DEVICE_DELEGATE(m_uart, ins8250_device, ins8250_w));
- break;
-
- case PID_PARALLEL:
- io.install_readwrite_handler(0x8078, 0x807b, READ8_DEVICE_DELEGATE(m_ppi, i8255_device, read), WRITE8_DEVICE_DELEGATE(m_ppi, i8255_device, write));
- break;
- }
}
@@ -832,43 +777,16 @@ static MACHINE_CONFIG_START( portfolio, portfolio_state )
MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
- /* devices */
- 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))
-
- 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))
+ // devices
+ MCFG_PORTFOLIO_EXPANSION_SLOT_ADD(PORTFOLIO_EXPANSION_SLOT_TAG, XTAL_4_9152MHz, portfolio_expansion_cards, nullptr)
+ MCFG_PORTFOLIO_EXPANSION_SLOT_IINT_CALLBACK(WRITELINE(portfolio_state, iint_w))
+ MCFG_PORTFOLIO_EXPANSION_SLOT_EINT_CALLBACK(WRITELINE(portfolio_state, eint_w))
+ MCFG_PORTFOLIO_EXPANSION_SLOT_NMIO_CALLBACK(INPUTLINE(M80C88A_TAG, INPUT_LINE_NMI))
+ //MCFG_PORTFOLIO_EXPANSION_SLOT_WAKE_CALLBACK()
+
MCFG_TIMER_DRIVER_ADD_PERIODIC("counter", portfolio_state, counter_tick, attotime::from_hz(XTAL_32_768kHz/16384))
MCFG_TIMER_DRIVER_ADD_PERIODIC(TIMER_TICK_TAG, portfolio_state, system_tick, attotime::from_hz(XTAL_32_768kHz/32768))
- 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))
-
/* fake keyboard */
MCFG_TIMER_DRIVER_ADD_PERIODIC("keyboard", portfolio_state, keyboard_tick, attotime::from_usec(2500))
@@ -876,19 +794,8 @@ static MACHINE_CONFIG_START( portfolio, portfolio_state )
MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_plain_slot, "portfolio_cart")
MCFG_GENERIC_LOAD(portfolio_state, portfolio_cart)
- /* memory card */
-/* MCFG_MEMCARD_ADD("memcard_a")
- MCFG_MEMCARD_EXTENSION_LIST("bin")
- MCFG_MEMCARD_LOAD(portfolio_memcard)
- MCFG_MEMCARD_SIZE_OPTIONS("32K,64K,128K")
-
- MCFG_MEMCARD_ADD("memcard_b")
- MCFG_MEMCARD_EXTENSION_LIST("bin")
- MCFG_MEMCARD_LOAD(portfolio_memcard)
- MCFG_MEMCARD_SIZE_OPTIONS("32K,64K,128K")*/
-
/* software lists */
-// MCFG_SOFTWARE_LIST_ADD("cart_list", "pofo")
+ MCFG_SOFTWARE_LIST_ADD("cart_list", "pofo")
/* internal ram */
MCFG_RAM_ADD(RAM_TAG)
diff --git a/src/mame/includes/portfoli.h b/src/mame/includes/portfoli.h
deleted file mode 100644
index 7070f734e42..00000000000
--- a/src/mame/includes/portfoli.h
+++ /dev/null
@@ -1,123 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Curt Coder
-#pragma once
-
-#ifndef __PORTFOLIO__
-#define __PORTFOLIO__
-
-#include "emu.h"
-#include "cpu/i86/i86.h"
-#include "bus/centronics/ctronics.h"
-#include "machine/i8255.h"
-#include "machine/ins8250.h"
-#include "machine/nvram.h"
-#include "machine/ram.h"
-#include "sound/speaker.h"
-#include "video/hd61830.h"
-
-#include "bus/generic/slot.h"
-#include "bus/generic/carts.h"
-
-#define M80C88A_TAG "u1"
-#define M82C55A_TAG "hpc101_u1"
-#define M82C50A_TAG "hpc102_u1"
-#define HD61830_TAG "hd61830"
-#define CENTRONICS_TAG "centronics"
-#define TIMER_TICK_TAG "tick"
-#define SCREEN_TAG "screen"
-#define RS232_TAG "rs232"
-
-class portfolio_state : public driver_device
-{
-public:
- portfolio_state(const machine_config &mconfig, device_type type, const char *tag)
- : driver_device(mconfig, type, tag),
- m_maincpu(*this, M80C88A_TAG),
- m_lcdc(*this, HD61830_TAG),
- m_ppi(*this, M82C55A_TAG),
- m_uart(*this, M82C50A_TAG),
- m_speaker(*this, "speaker"),
- m_timer_tick(*this, TIMER_TICK_TAG),
- m_rom(*this, M80C88A_TAG),
- m_char_rom(*this, HD61830_TAG),
- m_y0(*this, "Y0"),
- m_y1(*this, "Y1"),
- m_y2(*this, "Y2"),
- m_y3(*this, "Y3"),
- m_y4(*this, "Y4"),
- m_y5(*this, "Y5"),
- m_y6(*this, "Y6"),
- m_y7(*this, "Y7"),
- m_battery(*this, "BATTERY"),
- m_contrast(*this, "contrast"),
- m_ram(*this, RAM_TAG)
- { }
-
- required_device<cpu_device> m_maincpu;
- required_device<hd61830_device> m_lcdc;
- required_device<i8255_device> m_ppi;
- required_device<ins8250_device> m_uart;
- required_device<speaker_sound_device> m_speaker;
- required_device<timer_device> m_timer_tick;
- required_region_ptr<UINT8> m_rom;
- required_region_ptr<UINT8> m_char_rom;
- required_ioport m_y0;
- required_ioport m_y1;
- required_ioport m_y2;
- required_ioport m_y3;
- required_ioport m_y4;
- required_ioport m_y5;
- required_ioport m_y6;
- required_ioport m_y7;
- required_ioport m_battery;
-
- virtual void machine_start() override;
- virtual void machine_reset() override;
-
- void check_interrupt();
- void trigger_interrupt(int level);
- void scan_keyboard();
-
- DECLARE_READ8_MEMBER( irq_status_r );
- DECLARE_READ8_MEMBER( keyboard_r );
- DECLARE_READ8_MEMBER( battery_r );
- DECLARE_READ8_MEMBER( counter_r );
- DECLARE_READ8_MEMBER( pid_r );
-
- DECLARE_WRITE8_MEMBER( irq_mask_w );
- DECLARE_WRITE8_MEMBER( sivr_w );
- DECLARE_WRITE8_MEMBER( speaker_w );
- DECLARE_WRITE8_MEMBER( power_w );
- DECLARE_WRITE8_MEMBER( unknown_w );
- DECLARE_WRITE8_MEMBER( counter_w );
- DECLARE_WRITE8_MEMBER( ncc1_w );
-
- DECLARE_WRITE_LINE_MEMBER( i8250_intrpt_w );
-
- /* interrupt state */
- UINT8 m_ip; /* interrupt pending */
- UINT8 m_ie; /* interrupt enable */
- UINT8 m_sivr; /* serial interrupt vector register */
-
- /* counter state */
- UINT16 m_counter;
-
- /* keyboard state */
- UINT8 m_keylatch;
-
- /* video state */
- required_shared_ptr<UINT8> m_contrast;
-
- /* peripheral state */
- UINT8 m_pid; /* peripheral identification */
- DECLARE_PALETTE_INIT(portfolio);
- TIMER_DEVICE_CALLBACK_MEMBER(keyboard_tick);
- TIMER_DEVICE_CALLBACK_MEMBER(system_tick);
- TIMER_DEVICE_CALLBACK_MEMBER(counter_tick);
- DECLARE_READ8_MEMBER(hd61830_rd_r);
- IRQ_CALLBACK_MEMBER(portfolio_int_ack);
- DECLARE_DEVICE_IMAGE_LOAD_MEMBER( portfolio_cart );
- required_device<ram_device> m_ram;
-};
-
-#endif