Previous 199869 Revisions Next

r29620 Sunday 13th April, 2014 at 21:34:58 UTC by R. Belmont
(MESS) Apple II: Correct setup of built-in ACIAs for IIc/IIc Plus [R. Belmont]
[src/mess/drivers]apple2.c
[src/mess/includes]apple2.h
[src/mess/machine]apple2.c

trunk/src/mess/includes/apple2.h
r29619r29620
1919#include "machine/kb3600.h"
2020#include "sound/speaker.h"
2121#include "machine/ram.h"
22#include "bus/rs232/rs232.h"
23#include "machine/mos6551.h"
2224
2325#define AUXSLOT_TAG "auxbus"
2426
27#define IIC_ACIA1_TAG "acia1"
28#define IIC_ACIA2_TAG "acia2"
29
30#define PRINTER_PORT_TAG "printer"
31#define MODEM_PORT_TAG "modem"
32
2533/***************************************************************************
2634    SOFTSWITCH VALUES
2735***************************************************************************/
r29619r29620
127135      m_kbspecial(*this, "keyb_special"),
128136      m_kbrepeat(*this, "keyb_repeat"),
129137      m_resetdip(*this, "reset_dip"),
130      m_cassette(*this, "cassette")
138      m_cassette(*this, "cassette"),
139      m_acia1(*this, IIC_ACIA1_TAG),
140      m_acia2(*this, IIC_ACIA2_TAG)
131141   { }
132142
133143   required_device<cpu_device> m_maincpu;
r29619r29620
143153   optional_ioport m_resetdip;
144154   optional_device<cassette_image_device> m_cassette;
145155
156   optional_device<mos6551_device> m_acia1, m_acia2;
157
146158   UINT32 m_flags, m_flags_mask;
147159   INT32 m_a2_cnxx_slot;
148160   UINT32 m_a2_mask;
trunk/src/mess/drivers/apple2.c
r29619r29620
11691169   MCFG_A2BUS_SLOT_REMOVE("sl6")
11701170   MCFG_A2BUS_SLOT_REMOVE("sl7")
11711171
1172   MCFG_DEVICE_ADD(IIC_ACIA1_TAG, MOS6551, 0)
1173   MCFG_MOS6551_XTAL(XTAL_14_31818MHz / 8)   // ~1.789 MHz
1174   MCFG_MOS6551_TXD_HANDLER(DEVWRITELINE(PRINTER_PORT_TAG, rs232_port_device, write_txd))
1175
1176   MCFG_DEVICE_ADD(IIC_ACIA2_TAG, MOS6551, 0)
1177   MCFG_MOS6551_XTAL(XTAL_1_8432MHz)   // matches SSC so modem software is compatible
1178   MCFG_MOS6551_TXD_HANDLER(DEVWRITELINE("modem", rs232_port_device, write_txd))
1179
1180   MCFG_RS232_PORT_ADD(PRINTER_PORT_TAG, default_rs232_devices, NULL)
1181   MCFG_RS232_RXD_HANDLER(DEVWRITELINE(IIC_ACIA1_TAG, mos6551_device, write_rxd))
1182   MCFG_RS232_DCD_HANDLER(DEVWRITELINE(IIC_ACIA1_TAG, mos6551_device, write_dcd))
1183   MCFG_RS232_DSR_HANDLER(DEVWRITELINE(IIC_ACIA1_TAG, mos6551_device, write_dsr))
1184   MCFG_RS232_CTS_HANDLER(DEVWRITELINE(IIC_ACIA1_TAG, mos6551_device, write_cts))
1185
1186   MCFG_RS232_PORT_ADD(MODEM_PORT_TAG, default_rs232_devices, NULL)
1187   MCFG_RS232_RXD_HANDLER(DEVWRITELINE(IIC_ACIA2_TAG, mos6551_device, write_rxd))
1188   MCFG_RS232_DCD_HANDLER(DEVWRITELINE(IIC_ACIA2_TAG, mos6551_device, write_dcd))
1189   MCFG_RS232_DSR_HANDLER(DEVWRITELINE(IIC_ACIA2_TAG, mos6551_device, write_dsr))
1190   MCFG_RS232_CTS_HANDLER(DEVWRITELINE(IIC_ACIA2_TAG, mos6551_device, write_cts))
1191
11721192   // TODO: populate the IIc's other virtual slots with ONBOARD_ADD
1173   MCFG_A2BUS_ONBOARD_ADD("a2bus", "sl1", A2BUS_SSC, NULL)
1174   MCFG_A2BUS_ONBOARD_ADD("a2bus", "sl2", A2BUS_SSC, NULL)
11751193   MCFG_A2BUS_ONBOARD_ADD("a2bus", "sl6", A2BUS_DISKIING, NULL)
11761194
11771195   MCFG_A2EAUXSLOT_SLOT_REMOVE("aux")
r29619r29620
11951213static MACHINE_CONFIG_DERIVED( laser128, apple2c )
11961214   MCFG_MACHINE_START_OVERRIDE(apple2_state,laser128)
11971215
1198   MCFG_A2BUS_SLOT_REMOVE("sl1")
1199   MCFG_A2BUS_SLOT_REMOVE("sl2")
12001216   MCFG_A2BUS_SLOT_REMOVE("sl6")
12011217
12021218   MCFG_A2BUS_ONBOARD_ADD("a2bus", "sl1", A2BUS_LASER128, NULL)
trunk/src/mess/machine/apple2.c
r29619r29620
345345   if(!space.debugger_access())
346346   {
347347      device_a2bus_card_interface *slotdevice;
348      int slot;
348349
349350      offset &= 0x7F;
351      slot = offset / 0x10;
350352
353      if ((m_machinetype == APPLE_IIC) || (m_machinetype == APPLE_IICPLUS))
354      {
355         if (slot == 1)
356         {
357            offset &= 0xf;
358            if (offset >= 8 && offset <= 0xb)
359            {
360               return m_acia1->read(space, offset-8);
361            }
362         }
363         else if (slot == 2)
364         {
365            offset &= 0xf;
366            if (offset >= 8 && offset <= 0xb)
367            {
368               return m_acia2->read(space, offset-8);
369            }
370         }
371      }
372
351373      /* now identify the device */
352      slotdevice = m_a2bus->get_a2bus_card(offset / 0x10);
374      slotdevice = m_a2bus->get_a2bus_card(slot);
353375
354376      /* and if we can, read from the slot */
355377      if (slotdevice != NULL)
r29619r29620
365387WRITE8_MEMBER(apple2_state::apple2_c080_w)
366388{
367389   device_a2bus_card_interface *slotdevice;
390   int slot;
368391
369392   offset &= 0x7F;
393   slot = offset / 0x10;
370394
395   if ((m_machinetype == APPLE_IIC) || (m_machinetype == APPLE_IICPLUS))
396   {
397      if (slot == 1)
398      {
399         offset &= 0xf;
400         if (offset >= 8 && offset <= 0xb)
401         {
402            m_acia1->write(space, offset-8, data);
403            return;
404         }
405      }
406      else if (slot == 2)
407      {
408         offset &= 0xf;
409         if (offset >= 8 && offset <= 0xb)
410         {
411            m_acia2->write(space, offset-8, data);
412            return;
413         }
414      }
415   }
416
371417   /* now identify the device */
372   slotdevice = m_a2bus->get_a2bus_card(offset / 0x10);
418   slotdevice = m_a2bus->get_a2bus_card(slot);
373419
374420   /* and if we can, write to the slot */
375421   if (slotdevice != NULL)

Previous 199869 Revisions Next


© 1997-2024 The MAME Team