mirror of
https://github.com/holub/mame
synced 2025-04-27 18:53:05 +03:00
Fleshed out Color Computer serial expansion cards to support actual input and output
This commit is contained in:
parent
f6ad5b79e1
commit
ab7f0042e1
@ -6,9 +6,6 @@
|
|||||||
|
|
||||||
Code for emulating the CoCo Direct Connect Modem PAK
|
Code for emulating the CoCo Direct Connect Modem PAK
|
||||||
|
|
||||||
This is just a "skeleton device"; the UART is emulated but pretty much
|
|
||||||
nothing else
|
|
||||||
|
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#include "emu.h"
|
#include "emu.h"
|
||||||
@ -16,6 +13,7 @@
|
|||||||
|
|
||||||
#include "cococart.h"
|
#include "cococart.h"
|
||||||
#include "machine/mos6551.h"
|
#include "machine/mos6551.h"
|
||||||
|
#include "bus/rs232/rs232.h"
|
||||||
|
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
@ -23,6 +21,7 @@
|
|||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#define UART_TAG "uart"
|
#define UART_TAG "uart"
|
||||||
|
#define PORT_TAG "port"
|
||||||
|
|
||||||
|
|
||||||
//**************************************************************************
|
//**************************************************************************
|
||||||
@ -87,6 +86,13 @@ MACHINE_CONFIG_START(coco_dc_modem_device::device_add_mconfig)
|
|||||||
MCFG_DEVICE_ADD(UART_TAG, MOS6551, 0)
|
MCFG_DEVICE_ADD(UART_TAG, MOS6551, 0)
|
||||||
MCFG_MOS6551_XTAL(XTAL(1'843'200))
|
MCFG_MOS6551_XTAL(XTAL(1'843'200))
|
||||||
MCFG_MOS6551_IRQ_HANDLER(WRITELINE(coco_dc_modem_device, uart_irq_w))
|
MCFG_MOS6551_IRQ_HANDLER(WRITELINE(coco_dc_modem_device, uart_irq_w))
|
||||||
|
MCFG_MOS6551_TXD_HANDLER(DEVWRITELINE(PORT_TAG, rs232_port_device, write_txd))
|
||||||
|
|
||||||
|
MCFG_RS232_PORT_ADD(PORT_TAG, default_rs232_devices, nullptr)
|
||||||
|
MCFG_RS232_RXD_HANDLER(DEVWRITELINE(UART_TAG, mos6551_device, write_rxd))
|
||||||
|
MCFG_RS232_DCD_HANDLER(DEVWRITELINE(UART_TAG, mos6551_device, write_dcd))
|
||||||
|
MCFG_RS232_DSR_HANDLER(DEVWRITELINE(UART_TAG, mos6551_device, write_dsr))
|
||||||
|
MCFG_RS232_CTS_HANDLER(DEVWRITELINE(UART_TAG, mos6551_device, write_cts))
|
||||||
MACHINE_CONFIG_END
|
MACHINE_CONFIG_END
|
||||||
|
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
coco_rs232.cpp
|
coco_rs232.cpp
|
||||||
|
|
||||||
Code for emulating the CoCo RS-232 PAK
|
Code for emulating the CoCo Deluxe RS-232 PAK
|
||||||
|
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
@ -13,6 +13,7 @@
|
|||||||
|
|
||||||
#include "cococart.h"
|
#include "cococart.h"
|
||||||
#include "machine/mos6551.h"
|
#include "machine/mos6551.h"
|
||||||
|
#include "bus/rs232/rs232.h"
|
||||||
|
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
@ -20,7 +21,7 @@
|
|||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#define UART_TAG "uart"
|
#define UART_TAG "uart"
|
||||||
|
#define PORT_TAG "port"
|
||||||
|
|
||||||
//**************************************************************************
|
//**************************************************************************
|
||||||
// TYPE DEFINITIONS
|
// TYPE DEFINITIONS
|
||||||
@ -46,6 +47,10 @@ namespace
|
|||||||
// optional information overrides
|
// optional information overrides
|
||||||
virtual void device_add_mconfig(machine_config &config) override;
|
virtual void device_add_mconfig(machine_config &config) override;
|
||||||
|
|
||||||
|
WRITE_LINE_MEMBER(uart_irq_w)
|
||||||
|
{
|
||||||
|
set_line_value(line::CART, state != 0);
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// device-level overrides
|
// device-level overrides
|
||||||
@ -56,6 +61,14 @@ namespace
|
|||||||
write8_delegate(FUNC(mos6551_device::write), (mos6551_device *)m_uart));
|
write8_delegate(FUNC(mos6551_device::write), (mos6551_device *)m_uart));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual const tiny_rom_entry *device_rom_region() const override;
|
||||||
|
|
||||||
|
// CoCo cartridge level overrides
|
||||||
|
virtual uint8_t *get_cart_base() override
|
||||||
|
{
|
||||||
|
return memregion("eprom")->base();
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// internal state
|
// internal state
|
||||||
required_device<mos6551_device> m_uart;
|
required_device<mos6551_device> m_uart;
|
||||||
@ -70,11 +83,33 @@ IMPLEMENTATION
|
|||||||
MACHINE_CONFIG_START(coco_rs232_device::device_add_mconfig)
|
MACHINE_CONFIG_START(coco_rs232_device::device_add_mconfig)
|
||||||
MCFG_DEVICE_ADD(UART_TAG, MOS6551, 0)
|
MCFG_DEVICE_ADD(UART_TAG, MOS6551, 0)
|
||||||
MCFG_MOS6551_XTAL(XTAL(1'843'200))
|
MCFG_MOS6551_XTAL(XTAL(1'843'200))
|
||||||
|
|
||||||
|
MCFG_MOS6551_IRQ_HANDLER(WRITELINE(coco_rs232_device, uart_irq_w))
|
||||||
|
MCFG_MOS6551_TXD_HANDLER(DEVWRITELINE(PORT_TAG, rs232_port_device, write_txd))
|
||||||
|
|
||||||
|
MCFG_RS232_PORT_ADD(PORT_TAG, default_rs232_devices, nullptr)
|
||||||
|
MCFG_RS232_RXD_HANDLER(DEVWRITELINE(UART_TAG, mos6551_device, write_rxd))
|
||||||
|
MCFG_RS232_DCD_HANDLER(DEVWRITELINE(UART_TAG, mos6551_device, write_dcd))
|
||||||
|
MCFG_RS232_DSR_HANDLER(DEVWRITELINE(UART_TAG, mos6551_device, write_dsr))
|
||||||
|
MCFG_RS232_CTS_HANDLER(DEVWRITELINE(UART_TAG, mos6551_device, write_cts))
|
||||||
MACHINE_CONFIG_END
|
MACHINE_CONFIG_END
|
||||||
|
|
||||||
|
ROM_START(coco_rs232_device)
|
||||||
|
ROM_REGION(0x1000, "eprom", ROMREGION_ERASE00)
|
||||||
|
ROM_LOAD("Deluxe_RS-232_Program_Pak_1983_26-2226_Tandy.rom", 0x0000, 0x1000, CRC(d990e1f9) SHA1(3fad25f3462a0b581b9c182ac11ad90c8fa08cb6))
|
||||||
|
ROM_END
|
||||||
|
|
||||||
|
//-------------------------------------------------
|
||||||
|
// device_rom_region
|
||||||
|
//-------------------------------------------------
|
||||||
|
|
||||||
|
const tiny_rom_entry *coco_rs232_device::device_rom_region() const
|
||||||
|
{
|
||||||
|
return ROM_NAME(coco_rs232_device);
|
||||||
|
}
|
||||||
|
|
||||||
//**************************************************************************
|
//**************************************************************************
|
||||||
// DEVICE DECLARATION
|
// DEVICE DECLARATION
|
||||||
//**************************************************************************
|
//**************************************************************************
|
||||||
|
|
||||||
DEFINE_DEVICE_TYPE(COCO_RS232, coco_rs232_device, "coco_rs232", "CoCo RS-232 PAK")
|
DEFINE_DEVICE_TYPE(COCO_RS232, coco_rs232_device, "coco_rs232", "CoCo Deluxe RS-232 PAK")
|
||||||
|
Loading…
Reference in New Issue
Block a user