dct11em: added devices and digital display

This commit is contained in:
Robbbert 2020-08-01 03:19:53 +10:00
parent 7c80f66cec
commit 4266388e8e
2 changed files with 203 additions and 42 deletions

View File

@ -1,17 +1,28 @@
// license:BSD-3-Clause
// copyright-holders:Miodrag Milanovic
// copyright-holders:Miodrag Milanovic,Robbbert
/***************************************************************************
DEC DCT11-EM
DEC DCT11-EM (Evaluation Module)
03/12/2010 Skeleton driver.
2010-12-03 Skeleton driver.
TODO:
- user LED
- keyboard (not in manual so have to guess)
- HALT and INT buttons (to HALT and PF input lines)
- DLART device to be emulated
- hookups between DLART, UART and remaining interrupts
- rs232 terminal
****************************************************************************/
#include "emu.h"
#include "cpu/t11/t11.h"
#include "emupal.h"
#include "screen.h"
#include "machine/i8251.h"
#include "machine/i8255.h"
#include "machine/clock.h"
#include "dct11em.lh"
class dct11em_state : public driver_device
@ -20,77 +31,167 @@ public:
dct11em_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag)
, m_maincpu(*this, "maincpu")
, m_ppi(*this, "ppi")
, m_uart(*this, "uart")
, m_digits(*this, "digit%d", 0U)
{ }
void dct11em(machine_config &config);
private:
virtual void machine_reset() override;
virtual void video_start() override;
void machine_reset() override;
void machine_start() override;
void dct11em_mem(address_map &map);
void porta_w(u8);
void portc_w(u8);
u8 portc_r();
void irq_encoder(u8, bool);
uint32_t screen_update_dct11em(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
u8 m_seg_lower;
u8 m_seg_upper;
u8 m_portc;
u16 m_irqs;
void mem_map(address_map &map);
required_device<t11_device> m_maincpu;
required_device<i8255_device> m_ppi;
required_device<i8251_device> m_uart;
output_finder<12> m_digits;
};
void dct11em_state::dct11em_mem(address_map &map)
void dct11em_state::mem_map(address_map &map)
{
map.unmap_value_high();
map(0x0000, 0x0fff).ram(); // RAM
map(0x2000, 0x2fff).ram(); // Optional RAM
map(0xa000, 0xdfff).rom(); // RAM
map(0x0000, 0x0fff).ram(); // 2x 6116
map(0x1000, 0x1fff).noprw(); // the ram test reads/writes here even though there's no ram
map(0x2000, 0x2fff).ram(); // expansion sockets, 2x 6116
map(0xa000, 0xdfff).rom();
map(0xff20, 0xff27).lw8(NAME([this] (offs_t offset, u8 data) { m_ppi->write(offset>>1, data); }));
map(0xff28, 0xff2b).lw8(NAME([this] (offs_t offset, u8 data) { m_uart->write(offset>>1, data); }));
map(0xff60, 0xff67).lr8(NAME([this] (offs_t offset) { return m_ppi->read(offset>>1); }));
map(0xff68, 0xff6b).lr8(NAME([this] (offs_t offset) { return m_uart->read(offset>>1); }));
//map(0xff70, 0xff7f). // DC309 DLART unemulated device - uart to terminal
}
void dct11em_state::porta_w(u8 data)
{
m_seg_lower = data;
if (BIT(m_portc, 3))
m_seg_upper = data;
}
void dct11em_state::portc_w(u8 data)
{
data &= 15;
m_portc = data;
if (BIT(data, 3))
{
m_seg_upper = m_seg_lower;
irq_encoder(10, 0);
}
if (data < 6)
{
m_digits[data] = m_seg_lower;
m_digits[data+6] = m_seg_upper;
}
if (data == 10)
output().set_value("led0", 0);
else
if (data == 11)
output().set_value("led0", 1);
}
u8 dct11em_state::portc_r()
{
return 0;
}
/*
* interrupts (p. 101)
*
* IRQ CPx Pri Vec Device
* --- --- --- --- ------
* 15 LLLL 7 140 DLART receiver break
* 11 LHLL 6 100 External interrupt
* 10 LHLH 6 104 Keypad/LED scanning
* 7 HLLL 5 120 8251 receiver
* 6 HLLH 5 124 8251 transmitter
* 3 HHLL 4 060 DLART receiver
* 2 HHLH 4 064 DLART transmitter */
void dct11em_state::irq_encoder(u8 irq, bool state)
{
if (state)
m_irqs |= (1 << irq);
else
m_irqs &= ~(1 << irq);
int i;
for (i = 15; i > 0; i--)
if (BIT(m_irqs, i))
break;
m_maincpu->set_input_line(t11_device::CP3_LINE, BIT(i, 3) ? ASSERT_LINE : CLEAR_LINE);
m_maincpu->set_input_line(t11_device::CP2_LINE, BIT(i, 2) ? ASSERT_LINE : CLEAR_LINE);
m_maincpu->set_input_line(t11_device::CP1_LINE, BIT(i, 1) ? ASSERT_LINE : CLEAR_LINE);
m_maincpu->set_input_line(t11_device::CP0_LINE, BIT(i, 0) ? ASSERT_LINE : CLEAR_LINE);
}
void dct11em_state::machine_reset()
{
m_irqs = 0;
}
void dct11em_state::machine_start()
{
m_digits.resolve();
save_item(NAME(m_seg_lower));
save_item(NAME(m_seg_upper));
save_item(NAME(m_portc));
save_item(NAME(m_irqs));
}
/* Input ports */
static INPUT_PORTS_START( dct11em )
INPUT_PORTS_END
void dct11em_state::machine_reset()
{
}
void dct11em_state::video_start()
{
}
uint32_t dct11em_state::screen_update_dct11em(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
return 0;
}
void dct11em_state::dct11em(machine_config &config)
{
/* basic machine hardware */
T11(config, m_maincpu, 7500000); // 7.5MHz XTAL
T11(config, m_maincpu, 7'500'000); // 7.5MHz XTAL
m_maincpu->set_initial_mode(0x1403); /* according to specs */
m_maincpu->set_addrmap(AS_PROGRAM, &dct11em_state::dct11em_mem);
m_maincpu->set_addrmap(AS_PROGRAM, &dct11em_state::mem_map);
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
screen.set_refresh_hz(50);
screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */
screen.set_size(640, 480);
screen.set_visarea(0, 640-1, 0, 480-1);
screen.set_screen_update(FUNC(dct11em_state::screen_update_dct11em));
screen.set_palette("palette");
config.set_default_layout(layout_dct11em);
PALETTE(config, "palette", palette_device::MONOCHROME);
I8255(config, m_ppi);
m_ppi->out_pa_callback().set(FUNC(dct11em_state::porta_w)); // segments
// port B - expansion interface
m_ppi->in_pc_callback().set(FUNC(dct11em_state::portc_r)); // keyboard
m_ppi->out_pc_callback().set(FUNC(dct11em_state::portc_w)); // various
I8251(config, m_uart, 2'457'600 / 8);
// txc and rxc come from DLART pin 34
clock_device &inta_clock(CLOCK(config, "inta_clock", 614'400 / 768)); // 800Hz, from DLART pin 25
inta_clock.signal_handler().set([this] (bool state) { if (state) irq_encoder(10, 1); });
//clock_device &dlart_clock(CLOCK(config, "dlart_clock", 7'500'000 / 4)); --> to DLART CLK pin 32
//clock_device &uart_clock(CLOCK(config, "uart_clock", 2'457'600 / 8)); --> to UART CLK
}
/* ROM definition */
ROM_START( dct11em )
ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF )
// Highest address line inverted
ROM_LOAD16_BYTE( "23-213e4.bin", 0x8000, 0x2000, CRC(bdd82f39) SHA1(347deeff77596b67eee27a39a9c40075fcf5c10d))
ROM_LOAD16_BYTE( "23-214e4.bin", 0x8001, 0x2000, CRC(b523dae8) SHA1(cd1a64a2bce9730f7a9177d391663919c7f56073))
ROM_LOAD16_BYTE( "23-213e4.e53", 0x8000, 0x2000, CRC(bdd82f39) SHA1(347deeff77596b67eee27a39a9c40075fcf5c10d))
ROM_LOAD16_BYTE( "23-214e4.e45", 0x8001, 0x2000, CRC(b523dae8) SHA1(cd1a64a2bce9730f7a9177d391663919c7f56073))
ROM_COPY("maincpu", 0x8000, 0xc000, 0x2000)
ROM_END
/* Driver */
/* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS */
COMP( 1983, dct11em, 0, 0, dct11em, dct11em, dct11em_state, empty_init, "Digital Equipment Corporation", "DCT11-EM", MACHINE_NOT_WORKING | MACHINE_NO_SOUND)
COMP( 1983, dct11em, 0, 0, dct11em, dct11em, dct11em_state, empty_init, "Digital Equipment Corporation", "DCT11-EM", MACHINE_NOT_WORKING | MACHINE_NO_SOUND_HW | MACHINE_SUPPORTS_SAVE )

View File

@ -0,0 +1,60 @@
<?xml version="1.0"?>
<!--
license:CC0
-->
<mamelayout version="2">
<element name="digit" defstate="0">
<led7seg>
<color red="0.75" green="0.0" blue="0.0" />
</led7seg>
</element>
<element name="background">
<rect>
<bounds left="0" top="0" right="1" bottom="1" />
<color red="0.0" green="0.0" blue="0.0" />
</rect>
</element>
<view name="Default Layout">
<!-- Black background -->
<bezel element="background">
<bounds left="97" top="0" right="405" bottom="195" />
</bezel>
<bezel name="digit11" element="digit">
<bounds left="107" top="10" right="155" bottom="90" />
</bezel>
<bezel name="digit10" element="digit">
<bounds left="155" top="10" right="203" bottom="90" />
</bezel>
<bezel name="digit9" element="digit">
<bounds left="203" top="10" right="251" bottom="90" />
</bezel>
<bezel name="digit8" element="digit">
<bounds left="251" top="10" right="299" bottom="90" />
</bezel>
<bezel name="digit7" element="digit">
<bounds left="299" top="10" right="347" bottom="90" />
</bezel>
<bezel name="digit6" element="digit">
<bounds left="347" top="10" right="395" bottom="90" />
</bezel>
<bezel name="digit5" element="digit">
<bounds left="107" top="105" right="155" bottom="185" />
</bezel>
<bezel name="digit4" element="digit">
<bounds left="155" top="105" right="203" bottom="185" />
</bezel>
<bezel name="digit3" element="digit">
<bounds left="203" top="105" right="251" bottom="185" />
</bezel>
<bezel name="digit2" element="digit">
<bounds left="251" top="105" right="299" bottom="185" />
</bezel>
<bezel name="digit1" element="digit">
<bounds left="299" top="105" right="347" bottom="185" />
</bezel>
<bezel name="digit0" element="digit">
<bounds left="347" top="105" right="395" bottom="185" />
</bezel>
</view>
</mamelayout>