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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
|
// license:BSD-3-Clause
// copyright-holders:Angelo Salese,Carl
/******************************************
*
* NEC PC-9821
*
******************************************/
#ifndef MAME_INCLUDES_PC9821_H
#define MAME_INCLUDES_PC9821_H
#pragma once
#include "includes/pc9801.h"
class pc9821_state : public pc9801bx_state
{
public:
pc9821_state(const machine_config &mconfig, device_type type, const char *tag)
: pc9801bx_state(mconfig, type, tag)
, m_ext_gvram(*this, "ext_gvram")
{
}
void pc9821(machine_config &config);
protected:
void pc9821_io(address_map &map);
void pc9821_map(address_map &map);
DECLARE_MACHINE_START(pc9821);
DECLARE_MACHINE_RESET(pc9821);
private:
required_shared_ptr<uint32_t> m_ext_gvram;
uint16_t pc9821_grcg_gvram_r(offs_t offset, uint16_t mem_mask = ~0);
void pc9821_grcg_gvram_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
uint16_t pc9821_grcg_gvram0_r(offs_t offset, uint16_t mem_mask = ~0);
void pc9821_grcg_gvram0_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
void pc9821_video_ff_w(offs_t offset, uint8_t data);
uint8_t pc9821_a0_r(offs_t offset);
void pc9821_a0_w(offs_t offset, uint8_t data);
uint8_t window_bank_r(offs_t offset);
void window_bank_w(offs_t offset, uint8_t data);
uint8_t ext2_video_ff_r();
void ext2_video_ff_w(uint8_t data);
uint8_t m_pc9821_window_bank = 0;
uint8_t m_ext2_ff = 0;
struct {
uint8_t pal_entry = 0;
uint8_t r[0x100]{}, g[0x100]{}, b[0x100]{};
uint16_t bank[2]{};
}m_analog256;
void pc9821_egc_w(offs_t offset, u16 data, u16 mem_mask = ~0);
UPD7220_DISPLAY_PIXELS_MEMBER( pegc_display_pixels );
};
// MATE A
class pc9821_mate_a_state : public pc9821_state
{
public:
pc9821_mate_a_state(const machine_config &mconfig, device_type type, const char *tag)
: pc9821_state(mconfig, type, tag)
{
}
void pc9821as(machine_config &config);
void pc9821ap2(machine_config &config);
protected:
void pc9821as_io(address_map &map);
private:
DECLARE_MACHINE_START(pc9821ap2);
// Ap, As, Ae only
u8 ext_sdip_data_r(offs_t offset);
void ext_sdip_data_w(offs_t offset, u8 data);
void ext_sdip_address_w(offs_t offset, u8 data);
void ext_sdip_access_w(offs_t offset, u8 data);
uint8_t m_ext_sdip[0x100]{}, m_ext_sdip_addr = 0;
};
// CanBe
class pc9821_canbe_state : public pc9821_state
{
public:
pc9821_canbe_state(const machine_config &mconfig, device_type type, const char *tag)
: pc9821_state(mconfig, type, tag)
{
}
void pc9821ce2(machine_config &config);
void pc9821cx3(machine_config &config);
protected:
void pc9821cx3_map(address_map &map);
void pc9821cx3_io(address_map &map);
private:
void remote_addr_w(offs_t offset, u8 data);
u8 remote_data_r(offs_t offset);
void remote_data_w(offs_t offset, u8 data);
DECLARE_MACHINE_START(pc9821_canbe);
struct {
u8 index = 0;
}m_remote;
};
// class pc9821_cereb_state : public pc9821_canbe_state
// Mate B
// class pc9821_mate_b_state : public pc9821_state
// Mate X (NB: should be subclass of Mate B)
class pc9821_mate_x_state : public pc9821_state
{
public:
pc9821_mate_x_state(const machine_config &mconfig, device_type type, const char *tag)
: pc9821_state(mconfig, type, tag)
{
}
void pc9821xa16(machine_config &config);
void pc9821xs(machine_config &config);
};
// Mate R
class pc9821_mate_r_state : public pc9821_mate_x_state
{
public:
pc9821_mate_r_state(const machine_config &mconfig, device_type type, const char *tag)
: pc9821_mate_x_state(mconfig, type, tag)
{
}
void pc9821ra20(machine_config &config);
void pc9821ra266(machine_config &config);
void pc9821ra333(machine_config &config);
};
class pc9821_valuestar_state : public pc9821_mate_x_state
{
public:
pc9821_valuestar_state(const machine_config &mconfig, device_type type, const char *tag)
: pc9821_mate_x_state(mconfig, type, tag)
{
}
void pc9821v13(machine_config &config);
void pc9821v20(machine_config &config);
};
// 9821NOTE
class pc9821_note_state : public pc9821_state
{
public:
pc9821_note_state(const machine_config &mconfig, device_type type, const char *tag)
: pc9821_state(mconfig, type, tag)
{
}
void pc9821ne(machine_config &config);
};
class pc9821_note_lavie_state : public pc9821_note_state
{
public:
pc9821_note_lavie_state(const machine_config &mconfig, device_type type, const char *tag)
: pc9821_note_state(mconfig, type, tag)
{
}
void pc9821nr15(machine_config &config);
void pc9821nr166(machine_config &config);
void pc9821nw150(machine_config &config);
};
#endif // MAME_INCLUDES_PC9821_H
|