mirror of
https://github.com/holub/mame
synced 2025-04-23 00:39:36 +03:00
Added rs232 port to apple 3. Currently cts is not mapped because that needs to be driven low whether something is plugged in or not or the apple 3 won't boot (I believe pull up resistors on the 12v side take care of that on real hardware). Not tested with Apple 3 software. (nw)
This commit is contained in:
parent
ba96964efc
commit
41466dcb47
@ -15,6 +15,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "bus/rs232/rs232.h"
|
||||
#include "includes/apple3.h"
|
||||
#include "includes/apple2.h"
|
||||
#include "imagedev/flopdrv.h"
|
||||
@ -109,6 +110,16 @@ static MACHINE_CONFIG_START( apple3, apple3_state )
|
||||
/* acia */
|
||||
MCFG_DEVICE_ADD("acia", MOS6551, 0)
|
||||
MCFG_MOS6551_XTAL(XTAL_1_8432MHz)
|
||||
MCFG_MOS6551_IRQ_HANDLER(WRITELINE(apple3_state, apple3_acia_irq_func))
|
||||
MCFG_MOS6551_TXD_HANDLER(DEVWRITELINE("rs232", rs232_port_device, write_txd))
|
||||
MCFG_MOS6551_RTS_HANDLER(DEVWRITELINE("rs232", rs232_port_device, write_rts))
|
||||
MCFG_MOS6551_DTR_HANDLER(DEVWRITELINE("rs232", rs232_port_device, write_dtr))
|
||||
|
||||
MCFG_RS232_PORT_ADD("rs232", default_rs232_devices, NULL)
|
||||
MCFG_RS232_RXD_HANDLER(DEVWRITELINE("acia", mos6551_device, write_rxd))
|
||||
MCFG_RS232_DCD_HANDLER(DEVWRITELINE("acia", mos6551_device, write_dcd))
|
||||
MCFG_RS232_DSR_HANDLER(DEVWRITELINE("acia", mos6551_device, write_dsr))
|
||||
// TODO: remove cts kludge from machine/apple3.c and come up with a good way of coping with pull up resistors.
|
||||
|
||||
/* rtc */
|
||||
MCFG_DEVICE_ADD("rtc", MM58167, XTAL_32_768kHz)
|
||||
|
@ -80,6 +80,7 @@ public:
|
||||
DECLARE_VIDEO_START(apple3);
|
||||
UINT32 screen_update_apple3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(apple3_interrupt);
|
||||
DECLARE_WRITE_LINE_MEMBER(apple3_acia_irq_func);
|
||||
DECLARE_WRITE8_MEMBER(apple3_via_0_out_a);
|
||||
DECLARE_WRITE8_MEMBER(apple3_via_0_out_b);
|
||||
DECLARE_WRITE8_MEMBER(apple3_via_1_out_a);
|
||||
@ -112,6 +113,7 @@ public:
|
||||
int m_enable_mask;
|
||||
|
||||
private:
|
||||
int m_acia_irq;
|
||||
UINT8 m_via_0_a;
|
||||
UINT8 m_via_0_b;
|
||||
UINT8 m_via_1_a;
|
||||
|
@ -524,7 +524,7 @@ WRITE8_MEMBER(apple3_state::apple3_via_1_out_b)
|
||||
|
||||
void apple3_state::apple3_irq_update()
|
||||
{
|
||||
if (m_via_1_irq || m_via_0_irq)
|
||||
if (m_acia_irq || m_via_1_irq || m_via_0_irq)
|
||||
{
|
||||
// HACK: SOS floppy driver enables ROM at Fxxx *before* trying to
|
||||
// suppress IRQs. IRQ hits at inopportune time -> bad vector -> system crash.
|
||||
@ -549,6 +549,13 @@ void apple3_state::apple3_irq_update()
|
||||
}
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER(apple3_state::apple3_acia_irq_func)
|
||||
{
|
||||
// printf("acia IRQ: %d\n", state);
|
||||
m_acia_irq = state;
|
||||
apple3_irq_update();
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER(apple3_state::apple3_via_1_irq_func)
|
||||
{
|
||||
// printf("via 1 IRQ: %d\n", state);
|
||||
@ -658,12 +665,13 @@ DRIVER_INIT_MEMBER(apple3_state,apple3)
|
||||
apple3_update_drives(machine().device("fdc"));
|
||||
|
||||
m_flags = 0;
|
||||
m_acia_irq = 0;
|
||||
m_via_0_a = ~0;
|
||||
m_via_1_a = ~0;
|
||||
m_via_0_irq = 0;
|
||||
m_via_1_irq = 0;
|
||||
|
||||
// kludge round +12v pull up resistors, which after conversion will bring this low when nothing is plugged in.
|
||||
// kludge round +12v pull up resistors, which after conversion will bring this low when nothing is plugged in. issue also affects dcd/dsr but those don't affect booting.
|
||||
m_acia->write_cts(0);
|
||||
|
||||
/* these are here to appease the Apple /// confidence tests */
|
||||
@ -687,6 +695,7 @@ DRIVER_INIT_MEMBER(apple3_state,apple3)
|
||||
|
||||
apple3_update_memory();
|
||||
|
||||
save_item(NAME(m_acia_irq));
|
||||
save_item(NAME(m_via_0_a));
|
||||
save_item(NAME(m_via_0_b));
|
||||
save_item(NAME(m_via_1_a));
|
||||
|
Loading…
Reference in New Issue
Block a user