(MESS) Apple II: Correct setup of built-in ACIAs for IIc/IIc Plus [R. Belmont]

This commit is contained in:
R. Belmont 2014-04-13 21:34:58 +00:00
parent 0c1901e902
commit 6acc7852c7
3 changed files with 81 additions and 7 deletions

View File

@ -1169,9 +1169,27 @@ static MACHINE_CONFIG_DERIVED( apple2c, apple2ee )
MCFG_A2BUS_SLOT_REMOVE("sl6")
MCFG_A2BUS_SLOT_REMOVE("sl7")
MCFG_DEVICE_ADD(IIC_ACIA1_TAG, MOS6551, 0)
MCFG_MOS6551_XTAL(XTAL_14_31818MHz / 8) // ~1.789 MHz
MCFG_MOS6551_TXD_HANDLER(DEVWRITELINE(PRINTER_PORT_TAG, rs232_port_device, write_txd))
MCFG_DEVICE_ADD(IIC_ACIA2_TAG, MOS6551, 0)
MCFG_MOS6551_XTAL(XTAL_1_8432MHz) // matches SSC so modem software is compatible
MCFG_MOS6551_TXD_HANDLER(DEVWRITELINE("modem", rs232_port_device, write_txd))
MCFG_RS232_PORT_ADD(PRINTER_PORT_TAG, default_rs232_devices, NULL)
MCFG_RS232_RXD_HANDLER(DEVWRITELINE(IIC_ACIA1_TAG, mos6551_device, write_rxd))
MCFG_RS232_DCD_HANDLER(DEVWRITELINE(IIC_ACIA1_TAG, mos6551_device, write_dcd))
MCFG_RS232_DSR_HANDLER(DEVWRITELINE(IIC_ACIA1_TAG, mos6551_device, write_dsr))
MCFG_RS232_CTS_HANDLER(DEVWRITELINE(IIC_ACIA1_TAG, mos6551_device, write_cts))
MCFG_RS232_PORT_ADD(MODEM_PORT_TAG, default_rs232_devices, NULL)
MCFG_RS232_RXD_HANDLER(DEVWRITELINE(IIC_ACIA2_TAG, mos6551_device, write_rxd))
MCFG_RS232_DCD_HANDLER(DEVWRITELINE(IIC_ACIA2_TAG, mos6551_device, write_dcd))
MCFG_RS232_DSR_HANDLER(DEVWRITELINE(IIC_ACIA2_TAG, mos6551_device, write_dsr))
MCFG_RS232_CTS_HANDLER(DEVWRITELINE(IIC_ACIA2_TAG, mos6551_device, write_cts))
// TODO: populate the IIc's other virtual slots with ONBOARD_ADD
MCFG_A2BUS_ONBOARD_ADD("a2bus", "sl1", A2BUS_SSC, NULL)
MCFG_A2BUS_ONBOARD_ADD("a2bus", "sl2", A2BUS_SSC, NULL)
MCFG_A2BUS_ONBOARD_ADD("a2bus", "sl6", A2BUS_DISKIING, NULL)
MCFG_A2EAUXSLOT_SLOT_REMOVE("aux")
@ -1195,8 +1213,6 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( laser128, apple2c )
MCFG_MACHINE_START_OVERRIDE(apple2_state,laser128)
MCFG_A2BUS_SLOT_REMOVE("sl1")
MCFG_A2BUS_SLOT_REMOVE("sl2")
MCFG_A2BUS_SLOT_REMOVE("sl6")
MCFG_A2BUS_ONBOARD_ADD("a2bus", "sl1", A2BUS_LASER128, NULL)

View File

@ -19,9 +19,17 @@
#include "machine/kb3600.h"
#include "sound/speaker.h"
#include "machine/ram.h"
#include "bus/rs232/rs232.h"
#include "machine/mos6551.h"
#define AUXSLOT_TAG "auxbus"
#define IIC_ACIA1_TAG "acia1"
#define IIC_ACIA2_TAG "acia2"
#define PRINTER_PORT_TAG "printer"
#define MODEM_PORT_TAG "modem"
/***************************************************************************
SOFTSWITCH VALUES
***************************************************************************/
@ -127,7 +135,9 @@ public:
m_kbspecial(*this, "keyb_special"),
m_kbrepeat(*this, "keyb_repeat"),
m_resetdip(*this, "reset_dip"),
m_cassette(*this, "cassette")
m_cassette(*this, "cassette"),
m_acia1(*this, IIC_ACIA1_TAG),
m_acia2(*this, IIC_ACIA2_TAG)
{ }
required_device<cpu_device> m_maincpu;
@ -143,6 +153,8 @@ public:
optional_ioport m_resetdip;
optional_device<cassette_image_device> m_cassette;
optional_device<mos6551_device> m_acia1, m_acia2;
UINT32 m_flags, m_flags_mask;
INT32 m_a2_cnxx_slot;
UINT32 m_a2_mask;

View File

@ -345,11 +345,33 @@ READ8_MEMBER(apple2_state::apple2_c080_r)
if(!space.debugger_access())
{
device_a2bus_card_interface *slotdevice;
int slot;
offset &= 0x7F;
slot = offset / 0x10;
if ((m_machinetype == APPLE_IIC) || (m_machinetype == APPLE_IICPLUS))
{
if (slot == 1)
{
offset &= 0xf;
if (offset >= 8 && offset <= 0xb)
{
return m_acia1->read(space, offset-8);
}
}
else if (slot == 2)
{
offset &= 0xf;
if (offset >= 8 && offset <= 0xb)
{
return m_acia2->read(space, offset-8);
}
}
}
/* now identify the device */
slotdevice = m_a2bus->get_a2bus_card(offset / 0x10);
slotdevice = m_a2bus->get_a2bus_card(slot);
/* and if we can, read from the slot */
if (slotdevice != NULL)
@ -365,11 +387,35 @@ READ8_MEMBER(apple2_state::apple2_c080_r)
WRITE8_MEMBER(apple2_state::apple2_c080_w)
{
device_a2bus_card_interface *slotdevice;
int slot;
offset &= 0x7F;
slot = offset / 0x10;
if ((m_machinetype == APPLE_IIC) || (m_machinetype == APPLE_IICPLUS))
{
if (slot == 1)
{
offset &= 0xf;
if (offset >= 8 && offset <= 0xb)
{
m_acia1->write(space, offset-8, data);
return;
}
}
else if (slot == 2)
{
offset &= 0xf;
if (offset >= 8 && offset <= 0xb)
{
m_acia2->write(space, offset-8, data);
return;
}
}
}
/* now identify the device */
slotdevice = m_a2bus->get_a2bus_card(offset / 0x10);
slotdevice = m_a2bus->get_a2bus_card(slot);
/* and if we can, write to the slot */
if (slotdevice != NULL)