(MESS) Apple II: Add support for the Applied Engineering TimeMaster II H.O. card [R. Belmont]

This commit is contained in:
R. Belmont 2014-08-17 04:09:41 +00:00
parent 51e2c71c75
commit a4461829b5
5 changed files with 350 additions and 0 deletions

2
.gitattributes vendored
View File

@ -474,6 +474,8 @@ src/emu/bus/a2bus/a2zipdrive.c svneol=native#text/plain
src/emu/bus/a2bus/a2zipdrive.h svneol=native#text/plain
src/emu/bus/a2bus/laser128.c svneol=native#text/plain
src/emu/bus/a2bus/laser128.h svneol=native#text/plain
src/emu/bus/a2bus/timemasterho.c svneol=native#text/plain
src/emu/bus/a2bus/timemasterho.h svneol=native#text/plain
src/emu/bus/abcbus/abc890.c svneol=native#text/plain
src/emu/bus/abcbus/abc890.h svneol=native#text/plain
src/emu/bus/abcbus/abcbus.c svneol=native#text/plain

View File

@ -0,0 +1,280 @@
/*********************************************************************
timemasterho.c
Implemention of the Applied Engineering TimeMaster H.O.
PCB Layout:
_____________________________________________________
| ___ _ _____________________ |
| | D | | |MSM5832 | |u3 |
| | I | u1| | | HD46821P | ___ |
| | P | |_| |_____________________|| B | |
| |_S_| _____ | A | |
| u2|_____| 74LS245| T | |
| |J1 74LS00 74LS08 ____________ | T | |
| | _ _ u4| | | E | |
| | u5| | u6| | | 2716 | | R | |
| | |_| |_| |____________| |_Y_| |
|____________________________ _|
| |
|______________________|
DIPS: 1:SET 2:MODE 3:NMI 4:IRQ
1 & 4 are on by default.
J1: 8 pins for X10 home control functions (top to bottom)
1: ADJ 2: 5V 3: MODE 4: GND
5: A 6: 5V 7: B 8: GND
X10 functions not supported.
*********************************************************************/
#include "timemasterho.h"
/***************************************************************************
PARAMETERS
***************************************************************************/
//**************************************************************************
// GLOBAL VARIABLES
//**************************************************************************
const device_type A2BUS_TIMEMASTERHO = &device_creator<a2bus_timemasterho_device>;
#define TIMEMASTER_ROM_REGION "timemst_rom"
#define TIMEMASTER_PIA_TAG "timemst_pia"
#define TIMEMASTER_M5832_TAG "timemst_msm"
MACHINE_CONFIG_FRAGMENT( timemaster )
MCFG_DEVICE_ADD(TIMEMASTER_PIA_TAG, PIA6821, 1021800)
MCFG_PIA_WRITEPA_HANDLER(WRITE8(a2bus_timemasterho_device, pia_out_a))
MCFG_PIA_WRITEPB_HANDLER(WRITE8(a2bus_timemasterho_device, pia_out_b))
MCFG_PIA_IRQA_HANDLER(WRITELINE(a2bus_timemasterho_device, pia_irqa_w))
MCFG_PIA_IRQB_HANDLER(WRITELINE(a2bus_timemasterho_device, pia_irqb_w))
MCFG_DEVICE_ADD(TIMEMASTER_M5832_TAG, MSM5832, 32768)
MACHINE_CONFIG_END
ROM_START( timemaster )
ROM_REGION(0x1000, TIMEMASTER_ROM_REGION, 0)
ROM_LOAD( "ae timemaster ii h.o. rom rev. 5.bin", 0x000000, 0x001000, CRC(ff5bd644) SHA1(ae0173da61581a06188c1bee89e95a0aa536c411) )
ROM_END
static INPUT_PORTS_START( tmho )
PORT_START("DSW1")
PORT_DIPNAME( 0x01, 0x01, "Set")
PORT_DIPSETTING( 0x00, "Apple can't set clock")
PORT_DIPSETTING( 0x01, "Apple can set clock")
PORT_DIPNAME( 0x02, 0x00, "Mode")
PORT_DIPSETTING( 0x00, "TimeMaster")
PORT_DIPSETTING( 0x02, "Mountain AppleClock")
PORT_DIPNAME( 0x04, 0x00, "NMI")
PORT_DIPSETTING( 0x00, DEF_STR(Off))
PORT_DIPSETTING( 0x04, DEF_STR(On))
PORT_DIPNAME( 0x08, 0x08, "IRQ")
PORT_DIPSETTING( 0x00, DEF_STR(Off))
PORT_DIPSETTING( 0x08, DEF_STR(On))
INPUT_PORTS_END
/***************************************************************************
FUNCTION PROTOTYPES
***************************************************************************/
//-------------------------------------------------
// input_ports - device-specific input ports
//-------------------------------------------------
ioport_constructor a2bus_timemasterho_device::device_input_ports() const
{
return INPUT_PORTS_NAME( tmho );
}
//-------------------------------------------------
// machine_config_additions - device-specific
// machine configurations
//-------------------------------------------------
machine_config_constructor a2bus_timemasterho_device::device_mconfig_additions() const
{
return MACHINE_CONFIG_NAME( timemaster );
}
//-------------------------------------------------
// rom_region - device-specific ROM region
//-------------------------------------------------
const rom_entry *a2bus_timemasterho_device::device_rom_region() const
{
return ROM_NAME( timemaster );
}
//**************************************************************************
// LIVE DEVICE
//**************************************************************************
a2bus_timemasterho_device::a2bus_timemasterho_device(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_a2bus_card_interface(mconfig, *this),
m_pia(*this, TIMEMASTER_PIA_TAG),
m_msm5832(*this, TIMEMASTER_M5832_TAG),
m_dsw1(*this, "DSW1")
{
m_started = false;
}
a2bus_timemasterho_device::a2bus_timemasterho_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
device_t(mconfig, A2BUS_TIMEMASTERHO, "Applied Engineering TimeMaster H.O.", tag, owner, clock, "a2tmstho", __FILE__),
device_a2bus_card_interface(mconfig, *this),
m_pia(*this, TIMEMASTER_PIA_TAG),
m_msm5832(*this, TIMEMASTER_M5832_TAG),
m_dsw1(*this, "DSW1")
{
m_started = false;
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void a2bus_timemasterho_device::device_start()
{
// set_a2bus_device makes m_slot valid
set_a2bus_device();
astring tempstring;
m_rom = device().machine().root_device().memregion(this->subtag(tempstring, TIMEMASTER_ROM_REGION))->base();
}
void a2bus_timemasterho_device::device_reset()
{
m_msm5832->cs_w(ASSERT_LINE); // CS is tied to Vcc
m_started = true;
}
/*-------------------------------------------------
read_c0nx - called for reads from this card's c0nx space
-------------------------------------------------*/
UINT8 a2bus_timemasterho_device::read_c0nx(address_space &space, UINT8 offset)
{
if (offset <= 3)
{
return m_pia->read(space, offset);
}
return 0xff;
}
/*-------------------------------------------------
write_c0nx - called for writes to this card's c0nx space
-------------------------------------------------*/
void a2bus_timemasterho_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data)
{
if (offset <= 3)
{
m_pia->write(space, offset, data);
}
}
/*-------------------------------------------------
read_cnxx - called for reads from this card's cnxx space
-------------------------------------------------*/
UINT8 a2bus_timemasterho_device::read_cnxx(address_space &space, UINT8 offset)
{
if (m_started)
{
if (m_dsw1->read() & 2) // TimeMaster native
{
return m_rom[offset+0xc00];
}
}
// Mountain Computer compatible
return m_rom[offset+0x800];
}
/*-------------------------------------------------
read_c800 - called for reads from this card's c800 space
-------------------------------------------------*/
UINT8 a2bus_timemasterho_device::read_c800(address_space &space, UINT16 offset)
{
return m_rom[offset+0xc00];
}
WRITE8_MEMBER(a2bus_timemasterho_device::pia_out_a)
{
// port A appears to be input only
}
WRITE8_MEMBER(a2bus_timemasterho_device::pia_out_b)
{
m_msm5832->address_w(data & 0xf);
m_msm5832->hold_w((data>>4) & 1 ? ASSERT_LINE : CLEAR_LINE);
m_msm5832->read_w((data>>5) & 1 ? ASSERT_LINE : CLEAR_LINE);
if (m_started)
{
if (!(m_dsw1->read() & 1))
{
m_msm5832->write_w((data >> 6) & 1 ? ASSERT_LINE : CLEAR_LINE);
}
}
// if it's a read, poke it into the PIA
if ((data>>5) & 1)
{
m_pia->porta_w(m_msm5832->data_r(space, 0));
}
}
void a2bus_timemasterho_device::update_irqs()
{
UINT8 dip = 0;
if (m_started)
{
dip = m_dsw1->read();
}
if ((m_irqa | m_irqb) == ASSERT_LINE)
{
if (dip & 4)
{
raise_slot_nmi();
}
if (dip & 8)
{
raise_slot_irq();
}
}
else
{
lower_slot_irq();
lower_slot_nmi();
}
}
WRITE_LINE_MEMBER(a2bus_timemasterho_device::pia_irqa_w)
{
m_irqa = state;
update_irqs();
}
WRITE_LINE_MEMBER(a2bus_timemasterho_device::pia_irqb_w)
{
m_irqb = state;
update_irqs();
}

View File

@ -0,0 +1,65 @@
/*********************************************************************
timemasterho.h
Implemention of the Applied Engineering TimeMaster H.O.
*********************************************************************/
#ifndef __A2BUS_TIMEMASTERHO__
#define __A2BUS_TIMEMASTERHO__
#include "emu.h"
#include "a2bus.h"
#include "machine/6821pia.h"
#include "machine/msm5832.h"
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
class a2bus_timemasterho_device:
public device_t,
public device_a2bus_card_interface
{
public:
// construction/destruction
a2bus_timemasterho_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
a2bus_timemasterho_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
// optional information overrides
virtual machine_config_constructor device_mconfig_additions() const;
virtual const rom_entry *device_rom_region() const;
virtual ioport_constructor device_input_ports() const;
DECLARE_WRITE8_MEMBER(pia_out_a);
DECLARE_WRITE8_MEMBER(pia_out_b);
DECLARE_WRITE_LINE_MEMBER(pia_irqa_w);
DECLARE_WRITE_LINE_MEMBER(pia_irqb_w);
protected:
virtual void device_start();
virtual void device_reset();
// overrides of standard a2bus slot functions
virtual UINT8 read_c0nx(address_space &space, UINT8 offset);
virtual void write_c0nx(address_space &space, UINT8 offset, UINT8 data);
virtual UINT8 read_cnxx(address_space &space, UINT8 offset);
virtual UINT8 read_c800(address_space &space, UINT16 offset);
required_device<pia6821_device> m_pia;
required_device<msm5832_device> m_msm5832;
required_ioport m_dsw1;
private:
void update_irqs();
UINT8 *m_rom;
bool m_irqa, m_irqb;
bool m_started;
};
// device type definition
extern const device_type A2BUS_TIMEMASTERHO;
#endif /* __A2BUS_TIMEMASTERHO__ */

View File

@ -717,6 +717,7 @@ BUSOBJS += $(BUSOBJ)/a2bus/a2corvus.o
BUSOBJS += $(BUSOBJ)/a2bus/a2diskiing.o
BUSOBJS += $(BUSOBJ)/a2bus/a2mcms.o
BUSOBJS += $(BUSOBJ)/a2bus/a2dx1.o
BUSOBJS += $(BUSOBJ)/a2bus/timemasterho.o
endif
#-------------------------------------------------

View File

@ -223,6 +223,7 @@ Address bus A0-A11 is Y0-Y11
#include "bus/a2bus/a2corvus.h"
#include "bus/a2bus/a2mcms.h"
#include "bus/a2bus/a2dx1.h"
#include "bus/a2bus/timemasterho.h"
#include "bus/a2bus/a2estd80col.h"
#include "bus/a2bus/a2eext80col.h"
#include "bus/a2bus/a2eramworks3.h"
@ -1024,6 +1025,7 @@ static SLOT_INTERFACE_START(apple2_cards)
SLOT_INTERFACE("mcms1", A2BUS_MCMS1) /* Mountain Computer Music System, card 1 of 2 */
SLOT_INTERFACE("mcms2", A2BUS_MCMS2) /* Mountain Computer Music System, card 2 of 2. must be in card 1's slot + 1! */
SLOT_INTERFACE("dx1", A2BUS_DX1) /* Decillonix DX-1 sampler card */
SLOT_INTERFACE("tm2ho", A2BUS_TIMEMASTERHO) /* Applied Engineering TimeMaster II H.O. */
SLOT_INTERFACE_END
static SLOT_INTERFACE_START(apple2eaux_cards)