diff options
author | 2016-08-08 14:44:04 +0300 | |
---|---|---|
committer | 2016-08-08 14:54:27 +0300 | |
commit | 463212cf1bdbe411b9f137747c85a79795ff3f79 (patch) | |
tree | dfd5860ea924302ecc4df416ce570a8ad7cb42a3 /src | |
parent | 6673af1285376eee38a7fa0f924ddf5b61c3c654 (diff) |
pofo: Expansion WIP. (nw)
Diffstat (limited to 'src')
-rw-r--r-- | src/devices/bus/pofo/ccm.h | 36 | ||||
-rw-r--r-- | src/devices/bus/pofo/exp.cpp | 3 | ||||
-rw-r--r-- | src/devices/bus/pofo/hpc104.cpp | 219 | ||||
-rw-r--r-- | src/devices/bus/pofo/hpc104.h | 86 | ||||
-rw-r--r-- | src/mame/drivers/pofo.cpp | 3 |
5 files changed, 347 insertions, 0 deletions
diff --git a/src/devices/bus/pofo/ccm.h b/src/devices/bus/pofo/ccm.h index f8387326207..4f8f87c873f 100644 --- a/src/devices/bus/pofo/ccm.h +++ b/src/devices/bus/pofo/ccm.h @@ -6,6 +6,41 @@ ********************************************************************** + Pin COMMON RAM OPTROM Mask ROM + 32k 64k 128k + 1 A16 + 2 A15 + 3 VBB VPP NC VPP NC + 4 A12 + 5 A7 + 6 A6 + 7 A5 + 8 A4 + 9 A3 + 10 A2 + 11 A1 + 12 A0 + 13 D0 + 14 D1 + 15 D2 + 16 GND + 17 D3 + 18 D4 + 19 D5 + 20 D6 + 21 D7 + 22 CE + 23 A10 + 24 OE OE OE/VPP OE OE + 25 A11 + 26 A9 + 27 A8 + 28 A13 + 29 A14 + 30 WE NC NC PGM NC + 31 VCC + 32 CDET + **********************************************************************/ #pragma once @@ -14,6 +49,7 @@ #define __PORTFOLIO_MEMORY_CARD_SLOT__ #include "emu.h" +#include "softlist_dev.h" diff --git a/src/devices/bus/pofo/exp.cpp b/src/devices/bus/pofo/exp.cpp index 98b411990bf..ce7adb0d1fb 100644 --- a/src/devices/bus/pofo/exp.cpp +++ b/src/devices/bus/pofo/exp.cpp @@ -96,8 +96,11 @@ void portfolio_expansion_slot_t::device_reset() // slot devices #include "hpc101.h" #include "hpc102.h" +#include "hpc104.h" SLOT_INTERFACE_START( portfolio_expansion_cards ) SLOT_INTERFACE("lpt", HPC101) SLOT_INTERFACE("uart", HPC102) + SLOT_INTERFACE("ram", HPC104) + SLOT_INTERFACE("ram2", HPC104_2) SLOT_INTERFACE_END diff --git a/src/devices/bus/pofo/hpc104.cpp b/src/devices/bus/pofo/hpc104.cpp new file mode 100644 index 00000000000..7552055b2a7 --- /dev/null +++ b/src/devices/bus/pofo/hpc104.cpp @@ -0,0 +1,219 @@ +// license:BSD-3-Clause +// copyright-holders:Curt Coder +/********************************************************************** + + Atari Portfolio HPC-104 Memory Expander Plus emulation + +**********************************************************************/ + +#include "hpc104.h" + + + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +const device_type HPC104 = &device_creator<hpc104_t>; +const device_type HPC104_2 = &device_creator<hpc104_2_t>; + + +//------------------------------------------------- +// MACHINE_CONFIG_FRAGMENT( hpc104 ) +//------------------------------------------------- + +static MACHINE_CONFIG_FRAGMENT( hpc104 ) + MCFG_PORTFOLIO_MEMORY_CARD_SLOT_ADD(PORTFOLIO_MEMORY_CARD_SLOT_B_TAG, portfolio_memory_cards, nullptr) + + MCFG_PORTFOLIO_EXPANSION_SLOT_ADD(PORTFOLIO_EXPANSION_SLOT_TAG, XTAL_4_9152MHz, portfolio_expansion_cards, nullptr) + MCFG_PORTFOLIO_EXPANSION_SLOT_IINT_CALLBACK(DEVWRITELINE(DEVICE_SELF_OWNER, portfolio_expansion_slot_t, iint_w)) + MCFG_PORTFOLIO_EXPANSION_SLOT_EINT_CALLBACK(DEVWRITELINE(DEVICE_SELF_OWNER, portfolio_expansion_slot_t, eint_w)) + MCFG_PORTFOLIO_EXPANSION_SLOT_NMIO_CALLBACK(DEVWRITELINE(DEVICE_SELF_OWNER, portfolio_expansion_slot_t, nmio_w)) + MCFG_PORTFOLIO_EXPANSION_SLOT_WAKE_CALLBACK(DEVWRITELINE(DEVICE_SELF_OWNER, portfolio_expansion_slot_t, wake_w)) +MACHINE_CONFIG_END + + +//------------------------------------------------- +// machine_config_additions - device-specific +// machine configurations +//------------------------------------------------- + +machine_config_constructor hpc104_t::device_mconfig_additions() const +{ + return MACHINE_CONFIG_NAME( hpc104 ); +} + + +//------------------------------------------------- +// INPUT_PORTS( hpc104 ) +//------------------------------------------------- + +static INPUT_PORTS_START( hpc104 ) + PORT_START("SW1") + PORT_DIPNAME( 0x01, 0x00, "Unit Number" ) + PORT_DIPSETTING( 0x00, "1 (0x1F000)" ) + PORT_DIPSETTING( 0x01, "2 (0x5F000)" ) +INPUT_PORTS_END + + +//------------------------------------------------- +// input_ports - device-specific input ports +//------------------------------------------------- + +ioport_constructor hpc104_t::device_input_ports() const +{ + return INPUT_PORTS_NAME( hpc104 ); +} + + +//------------------------------------------------- +// INPUT_PORTS( hpc104_2 ) +//------------------------------------------------- + +static INPUT_PORTS_START( hpc104_2 ) + PORT_START("SW1") + PORT_DIPNAME( 0x01, 0x01, "Unit Number" ) + PORT_DIPSETTING( 0x00, "1 (0x1F000)" ) + PORT_DIPSETTING( 0x01, "2 (0x5F000)" ) +INPUT_PORTS_END + + +//------------------------------------------------- +// input_ports - device-specific input ports +//------------------------------------------------- + +ioport_constructor hpc104_2_t::device_input_ports() const +{ + return INPUT_PORTS_NAME( hpc104_2 ); +} + + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// hpc104_t - constructor +//------------------------------------------------- + +hpc104_t::hpc104_t(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : + device_t(mconfig, type, name, tag, owner, clock, shortname, source), + device_portfolio_expansion_slot_interface(mconfig, *this), + device_nvram_interface(mconfig, *this), + m_ccm(*this, PORTFOLIO_MEMORY_CARD_SLOT_B_TAG), + m_exp(*this, PORTFOLIO_EXPANSION_SLOT_TAG), + m_nvram(*this, "nvram"), + m_io_sw1(*this, "SW1") +{ +} + +hpc104_t::hpc104_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : + device_t(mconfig, HPC104, "Atari Portfolio HPC-104", tag, owner, clock, "hpc104", __FILE__), + device_portfolio_expansion_slot_interface(mconfig, *this), + device_nvram_interface(mconfig, *this), + m_ccm(*this, PORTFOLIO_MEMORY_CARD_SLOT_B_TAG), + m_exp(*this, PORTFOLIO_EXPANSION_SLOT_TAG), + m_nvram(*this, "nvram"), + m_io_sw1(*this, "SW1") +{ +} + + +//------------------------------------------------- +// hpc104_2_t - constructor +//------------------------------------------------- + +hpc104_2_t::hpc104_2_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : + hpc104_t(mconfig, HPC104_2, "Atari Portfolio HPC-104 (Unit 2)", tag, owner, clock, "hpc104_2", __FILE__) { } + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void hpc104_t::device_start() +{ + // allocate memory + m_nvram.allocate(0x40000); +} + + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void hpc104_t::device_reset() +{ + m_sw1 = BIT(m_io_sw1->read(), 0); +} + + +//------------------------------------------------- +// nrdi_r - read +//------------------------------------------------- + +UINT8 hpc104_t::nrdi_r(address_space &space, offs_t offset, UINT8 data, bool iom, bool bcom, bool ncc1) +{ + data = m_exp->nrdi_r(space, offset, data, iom, bcom, m_ncc1_out || ncc1); + + if (!(!m_ncc1_out || ncc1)) + { + data = m_ccm->nrdi_r(space, offset & 0x1ffff); + } + + if (m_sw1) + { + if (offset >= 0x5f000 && offset < 0x9f000) + { + data = m_nvram[offset - 0x5f000]; + } + } + else + { + if (offset >= 0x1f000 && offset < 0x5f000) + { + data = m_nvram[offset - 0x1f000] = data; + } + } + + return data; +} + + +//------------------------------------------------- +// nwri_w - write +//------------------------------------------------- + +void hpc104_t::nwri_w(address_space &space, offs_t offset, UINT8 data, bool iom, bool bcom, bool ncc1) +{ + m_exp->nwri_w(space, offset, data, iom, bcom, m_ncc1_out || ncc1); + + if (!bcom) + { + if ((offset & 0x0f) == 0x0c) + { + m_ncc1_out = BIT(data, 0); + } + } + + if (!(!m_ncc1_out || ncc1)) + { + m_ccm->nwri_w(space, offset & 0x1ffff, data); + } + + if (m_sw1) + { + if (offset >= 0x5f000 && offset < 0x9f000) + { + m_nvram[offset - 0x5f000] = data; + } + } + else + { + if (offset >= 0x1f000 && offset < 0x5f000) + { + m_nvram[offset - 0x1f000] = data; + } + } +} diff --git a/src/devices/bus/pofo/hpc104.h b/src/devices/bus/pofo/hpc104.h new file mode 100644 index 00000000000..9d930c21347 --- /dev/null +++ b/src/devices/bus/pofo/hpc104.h @@ -0,0 +1,86 @@ +// license:BSD-3-Clause +// copyright-holders:Curt Coder +/********************************************************************** + + Atari Portfolio HPC-104 Memory Expander Plus emulation + +**********************************************************************/ + +#pragma once + +#ifndef __HPC104__ +#define __HPC104__ + +#include "emu.h" +#include "exp.h" +#include "bus/pofo/ccm.h" +#include "machine/nvram.h" + + + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +// ======================> hpc104_t + +class hpc104_t : public device_t, + public device_portfolio_expansion_slot_interface, + public device_nvram_interface +{ +public: + // construction/destruction + hpc104_t(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); + hpc104_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; + virtual ioport_constructor device_input_ports() const override; + +protected: + // device-level overrides + virtual void device_start() override; + virtual void device_reset() override; + + // device_nvram_interface overrides + virtual void nvram_default() override { } + virtual void nvram_read(emu_file &file) override { if (m_nvram != nullptr) { file.read(m_nvram, m_nvram.bytes()); } } + virtual void nvram_write(emu_file &file) override { if (m_nvram != nullptr) { file.write(m_nvram, m_nvram.bytes()); } } + + // device_portfolio_expansion_slot_interface overrides + virtual bool nmd1() override { return m_ccm->cdet_r(); } + + virtual UINT8 nrdi_r(address_space &space, offs_t offset, UINT8 data, bool iom, bool bcom, bool ncc1) override; + virtual void nwri_w(address_space &space, offs_t offset, UINT8 data, bool iom, bool bcom, bool ncc1) override; + +private: + required_device<portfolio_memory_card_slot_t> m_ccm; + required_device<portfolio_expansion_slot_t> m_exp; + optional_shared_ptr<UINT8> m_nvram; + required_ioport m_io_sw1; + + bool m_sw1; + bool m_ncc1_out; +}; + + +// ======================> hpc104_2_t + +class hpc104_2_t : public hpc104_t +{ +public: + // construction/destruction + hpc104_2_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + + // optional information overrides + virtual ioport_constructor device_input_ports() const override; +}; + + +// device type definition +extern const device_type HPC104; +extern const device_type HPC104_2; + + + +#endif diff --git a/src/mame/drivers/pofo.cpp b/src/mame/drivers/pofo.cpp index 7b7405244d4..9e92c6939e6 100644 --- a/src/mame/drivers/pofo.cpp +++ b/src/mame/drivers/pofo.cpp @@ -9,6 +9,9 @@ http://www.best-electronics-ca.com/portfoli.htm http://www.atari-portfolio.co.uk/pfnews/pf9.txt + Command line for dual RAM expansion with A: File Manager ROM card and B: RAM card + ./mess64 pofo -exp ram -exp:ram:exp ram2 -cart1 fileman -exp:ram:ccmb ram + */ /* |