diff options
author | 2019-07-25 17:05:31 +0100 | |
---|---|---|
committer | 2019-07-26 12:46:24 +0100 | |
commit | 7e988f9563d837a523c238917760e5d801046fe6 (patch) | |
tree | 60337e7aa0765b78e1457fbdc64ed94919484692 /src/devices/bus/tanbus/tugpgm.cpp | |
parent | e724f4d7e60c266138b1ab4ffd6cd2bb81858682 (diff) |
microtan.cpp: The Microtan driver overhaul!
- Renamed driver microtan->mt65
- Added alternative monitor ROMs: TANBUG V3.1, TANBUG V.3B, TUGBUG V1.1, TANBUG V1.
- Replaced XBug with original 0.75MHz version, fixes cassette loading.
- New machine Micron, consisting of MT65 and Tanex boards only.
- Implemented the Microtan motherboard backplane and moved Tanex to slot device.
- Additional boards implemented: Bulldog Sound Generator Board, Mousepacket Designs Colour VDU Card, Tangerine Tandos Board (not working), Tangerine High Resolution Graphics Card (monochrome), Tangerine High Resolution Graphics Card (colour), Tangerine Tanram Board, TUG 64K RAM Card, TUG Programmable Graphic Module Card, Microtanic Video 80/82 (not working), Ralph Allen 32K EPROM-RAM Card (incomplete), Ralph Allen Disc Controller Card (not working), Ralph Allen Colour VDU card
- Added Microtan 6809 System, not yet working.
- Added Space Invasion (ETI), the DIY project from Electronics Today based on the Microtan.
Diffstat (limited to 'src/devices/bus/tanbus/tugpgm.cpp')
-rw-r--r-- | src/devices/bus/tanbus/tugpgm.cpp | 113 |
1 files changed, 113 insertions, 0 deletions
diff --git a/src/devices/bus/tanbus/tugpgm.cpp b/src/devices/bus/tanbus/tugpgm.cpp new file mode 100644 index 00000000000..e97b0853f64 --- /dev/null +++ b/src/devices/bus/tanbus/tugpgm.cpp @@ -0,0 +1,113 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +/********************************************************************** + + TUG Programmable Graphic Module + + http://www.microtan.ukpc.net/pageProducts.html#VIDEO + +**********************************************************************/ + + +#include "emu.h" +#include "tugpgm.h" + + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +DEFINE_DEVICE_TYPE(TANBUS_TUGPGM, tanbus_tugpgm_device, "tanbus_tugpgm", "TUG Programmable Graphic Module") + + +//------------------------------------------------- +// INPUT_PORTS( tugpgm ) +//------------------------------------------------- + +INPUT_PORTS_START(tugpgm) + PORT_START("LINKS") + PORT_DIPNAME(0x07, 0x04, "Address Select") + PORT_DIPSETTING(0x00, "$0400 - $07FF (Not Recommended)") + PORT_DIPSETTING(0x01, "$2400 - $27FF") + PORT_DIPSETTING(0x02, "$4400 - $47FF") + PORT_DIPSETTING(0x03, "$6400 - $67FF") + PORT_DIPSETTING(0x04, "$8400 - $87FF") + PORT_DIPSETTING(0x05, "$A400 - $A7FF") + PORT_DIPSETTING(0x06, "$C400 - $C7FF") + PORT_DIPSETTING(0x07, "$E400 - $E7FF") +INPUT_PORTS_END + +//------------------------------------------------- +// input_ports - device-specific input ports +//------------------------------------------------- + +ioport_constructor tanbus_tugpgm_device::device_input_ports() const +{ + return INPUT_PORTS_NAME(tugpgm); +} + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// tanbus_tugpgm_device - constructor +//------------------------------------------------- + +tanbus_tugpgm_device::tanbus_tugpgm_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : device_t(mconfig, TANBUS_TUGPGM, tag, owner, clock) + , device_tanbus_interface(mconfig, *this) + , m_links(*this, "LINKS") +{ +} + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void tanbus_tugpgm_device::device_start() +{ + m_ram = std::make_unique<uint8_t[]>(0x0400); + + /* randomize video memory contents */ + for (uint16_t addr = 0; addr < 0x0400; addr++) + { + m_ram[addr] = machine().rand() & 0xff; + m_tanbus->pgm_w(addr, m_ram[addr]); + } + + save_pointer(NAME(m_ram), 0x0400); +} + +//------------------------------------------------- +// read - card read +//------------------------------------------------- + +uint8_t tanbus_tugpgm_device::read(offs_t offset, int inhrom, int inhram, int be) +{ + uint8_t data = 0xff; + + if ((offset & 0xfc00) == ((m_links->read() << 13) | 0x0400)) + { + data = m_ram[offset & 0x3ff]; + } + + return data; +} + +//------------------------------------------------- +// write - card write +//------------------------------------------------- + +void tanbus_tugpgm_device::write(offs_t offset, uint8_t data, int inhrom, int inhram, int be) +{ + if ((offset & 0xfc00) == ((m_links->read() << 13) | 0x0400)) + { + m_ram[offset & 0x3ff] = data; + + /* update the chargen on the CPU board */ + m_tanbus->pgm_w(offset & 0x3ff, data); + } +} |