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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
|
// license:BSD-3-Clause
// copyright-holders:Nathan Woods
/***************************************************************************
dragon.h
Dragon Family
***************************************************************************/
#ifndef MAME_INCLUDES_DRAGON_H
#define MAME_INCLUDES_DRAGON_H
#pragma once
#include "includes/coco12.h"
#include "imagedev/printer.h"
#include "machine/mos6551.h"
#include "video/mc6845.h"
#include "emupal.h"
//**************************************************************************
// MACROS / CONSTANTS
//**************************************************************************
#define PRINTER_TAG "printer"
#define ACIA_TAG "acia"
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
class dragon_state : public coco12_state
{
public:
dragon_state(const machine_config &mconfig, device_type type, const char *tag)
: coco12_state(mconfig, type, tag)
, m_printer(*this, PRINTER_TAG)
{
}
void dragon_base(machine_config &config);
void dragon32(machine_config &config);
void dragon_mem(address_map &map);
protected:
virtual void pia1_pa_changed(uint8_t data) override;
private:
required_device<printer_image_device> m_printer;
};
// dragon64 has an ACIA chip
class dragon64_state : public dragon_state
{
public:
dragon64_state(const machine_config &mconfig, device_type type, const char *tag)
: dragon_state(mconfig, type, tag)
, m_acia(*this, ACIA_TAG)
, m_rombank(*this, "rombank%u", 0U)
{
}
void tanodr64(machine_config &config);
void dragon64(machine_config &config);
void tanodr64h(machine_config &config);
void dragon64h(machine_config &config);
protected:
void d64_rom0(address_map &map);
void d64_rom1(address_map &map);
void d64_io0(address_map &map);
virtual void device_start() override;
virtual void device_reset() override;
virtual void pia1_pb_changed(uint8_t data) override;
void page_rom(bool romswitch);
private:
required_device<mos6551_device> m_acia;
required_memory_bank_array<2> m_rombank;
};
// dragon200e has a character generator
class dragon200e_state : public dragon64_state
{
public:
dragon200e_state(const machine_config &mconfig, device_type type, const char *tag)
: dragon64_state(mconfig, type, tag)
, m_char_rom(*this, "chargen")
, m_lk1(*this, "LK1")
{
}
uint8_t sam_read(offs_t offset);
MC6847_GET_CHARROM_MEMBER(char_rom_r);
void dragon200e(machine_config &config);
private:
required_memory_region m_char_rom;
required_ioport m_lk1;
};
// d64plus has a HD6845 and character generator
class d64plus_state : public dragon64_state
{
public:
d64plus_state(const machine_config &mconfig, device_type type, const char *tag)
: dragon64_state(mconfig, type, tag)
, m_crtc(*this, "crtc")
, m_palette(*this, "palette")
, m_plus_ram(*this, "plus_ram", 0x10000, ENDIANNESS_BIG)
, m_video_ram(*this, "video_ram", 0x800, ENDIANNESS_BIG)
, m_pram_bank(*this, "pram_bank")
, m_vram_bank(*this, "vram_bank")
, m_char_rom(*this, "chargen")
{
}
uint8_t d64plus_6845_disp_r();
void d64plus_bank_w(uint8_t data);
MC6845_UPDATE_ROW(crtc_update_row);
void d64plus(machine_config &config);
protected:
virtual void device_start() override;
virtual void device_reset() override;
private:
required_device<hd6845s_device> m_crtc;
required_device<palette_device> m_palette;
memory_share_creator<uint8_t> m_plus_ram;
memory_share_creator<uint8_t> m_video_ram;
memory_bank_creator m_pram_bank;
memory_bank_creator m_vram_bank;
required_memory_region m_char_rom;
};
#endif // MAME_INCLUDES_DRAGON_H
|