blob: 904f790751876f430274c667b20e78b9761a1f36 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
|
// license:BSD-3-Clause
// copyright-holders:Miodrag Milanovic
/***************************************************************************
Pecom driver by Miodrag Milanovic
08/11/2008 Preliminary driver.
****************************************************************************/
#include "emu.h"
#include "includes/pecom.h"
void pecom_state::cdp1869_w(offs_t offset, uint8_t data)
{
uint16_t ma = m_maincpu->get_memory_address();
switch (offset + 3)
{
case 3:
m_cdp1869->out3_w(data);
break;
case 4:
m_cdp1869->out4_w(ma);
break;
case 5:
m_cdp1869->out5_w(ma);
break;
case 6:
m_cdp1869->out6_w(ma);
break;
case 7:
m_cdp1869->out7_w(ma);
break;
}
}
CDP1869_CHAR_RAM_READ_MEMBER(pecom_state::char_ram_r )
{
uint8_t column = pmd & 0x7f;
uint16_t charaddr = (column << 4) | cma;
return m_charram[charaddr];
}
CDP1869_CHAR_RAM_WRITE_MEMBER(pecom_state::char_ram_w )
{
uint8_t column = pmd & 0x7f;
uint16_t charaddr = (column << 4) | cma;
m_charram[charaddr] = data;
}
CDP1869_PCB_READ_MEMBER(pecom_state::pcb_r )
{
return BIT(pmd, 7);
}
WRITE_LINE_MEMBER(pecom_state::prd_w)
{
// every other PRD triggers a DMAOUT request
if (m_dma)
m_maincpu->set_input_line(COSMAC_INPUT_LINE_DMAOUT, HOLD_LINE);
m_dma = !m_dma;
}
void pecom_state::machine_start()
{
m_bank1->configure_entry(0, m_ram);
m_bank1->configure_entry(1, m_rom);
/* allocate memory */
m_charram = std::make_unique<uint8_t[]>(0x0800);
/* register for state saving */
save_item(NAME(m_reset));
save_item(NAME(m_dma));
save_pointer(NAME(m_charram), 0x0800);
m_reset_timer = timer_alloc(FUNC(pecom_state::reset_tick), this);
}
|