@@ -15,25 +15,44 @@ class tvdear_state : public driver_device
15
15
tvdear_state (const machine_config &mconfig, device_type type, const char *tag)
16
16
: driver_device(mconfig, type, tag)
17
17
, m_maincpu(*this , " systemcpu" )
18
+ , m_keyboard(*this , " KEY%u" , 0U )
18
19
{
19
20
}
20
21
21
22
void tvdear (machine_config &config);
22
23
24
+ protected:
25
+ virtual void machine_start () override ATTR_COLD;
26
+
23
27
private:
24
- void output_500_w (u8 data);
28
+ void p0_w (u8 data);
29
+ u8 pt_r ();
25
30
26
31
void mem_map (address_map &map);
27
32
void io_map (address_map &map);
28
33
29
34
required_device<v25_device> m_maincpu;
35
+ required_ioport_array<10 > m_keyboard;
36
+
37
+ u8 m_p0 = 0 ;
30
38
};
31
39
40
+ void tvdear_state::machine_start ()
41
+ {
42
+ save_item (NAME (m_p0));
43
+ }
44
+
45
+ void tvdear_state::p0_w (u8 data)
46
+ {
47
+ m_p0 = data;
48
+ }
32
49
33
- void tvdear_state::output_500_w (u8 data )
50
+ u8 tvdear_state::pt_r ( )
34
51
{
35
- if (data != 0 )
36
- logerror (" %s: OUT 500h, %02Xh\n " , machine ().describe_context (), data);
52
+ if (m_p0 < 0xa0 )
53
+ return m_keyboard[m_p0 >> 4 ]->read ();
54
+ else
55
+ return 0xff ;
37
56
}
38
57
39
58
void tvdear_state::mem_map (address_map &map)
@@ -45,17 +64,118 @@ void tvdear_state::mem_map(address_map &map)
45
64
46
65
void tvdear_state::io_map (address_map &map)
47
66
{
48
- map (0x0500 , 0x0500 ).w ( FUNC (tvdear_state::output_500_w));
67
+ map (0x0500 , 0x0500 ).nopw (); // watchdog?
49
68
}
50
69
51
70
static INPUT_PORTS_START (tvdear)
71
+ PORT_START(" KEY0" )
72
+ PORT_BIT(0x01 , IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(' O' ) PORT_CHAR(0x3089 ) PORT_CODE(KEYCODE_O) // ら
73
+ PORT_BIT(0x02 , IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(' 9' ) PORT_CHAR(0x3088 ) PORT_CODE(KEYCODE_9) // よ
74
+ PORT_BIT(0x04 , IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(' .' ) PORT_CHAR(0x308b ) PORT_CODE(KEYCODE_STOP) // る
75
+ PORT_BIT(0x08 , IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(' L' ) PORT_CHAR(0x308a ) PORT_CODE(KEYCODE_L) // り
76
+ PORT_BIT(0x10 , IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(" Key 001D" )
77
+ PORT_BIT(0x20 , IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(" Key 001F" )
78
+ PORT_BIT(0x40 , IP_ACTIVE_LOW, IPT_UNUSED)
79
+ PORT_BIT(0x80 , IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(" Key 0016" )
80
+
81
+ PORT_START(" KEY1" )
82
+ PORT_BIT(0x01 , IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(' P' ) PORT_CHAR(0x305b ) PORT_CODE(KEYCODE_P) // せ
83
+ PORT_BIT(0x02 , IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(' 0' ) PORT_CHAR(0x308f ) PORT_CODE(KEYCODE_0) // わ
84
+ PORT_BIT(0x04 , IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(' %' ) PORT_CHAR(0x307b ) PORT_CODE(KEYCODE_MINUS) // ほ
85
+ PORT_BIT(0x08 , IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(' ;' ) PORT_CHAR(0x308c ) PORT_CODE(KEYCODE_COLON) // れ
86
+ PORT_BIT(0x10 , IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(' &' ) PORT_CHAR(0x308d ) PORT_CODE(KEYCODE_RSHIFT) // ろ
87
+ PORT_BIT(0x20 , IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(' (' ) PORT_CHAR(0x309b ) PORT_CODE(KEYCODE_OPENBRACE) // ■゛
88
+ PORT_BIT(0x40 , IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(' :' ) PORT_CHAR(0x3051 ) PORT_CODE(KEYCODE_QUOTE) // け
89
+ PORT_BIT(0x80 , IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(' /' ) PORT_CHAR(0x3081 ) PORT_CODE(KEYCODE_SLASH) // め
90
+
91
+ PORT_START(" KEY2" )
92
+ PORT_BIT(0x01 , IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(' U' ) PORT_CHAR(0x306a ) PORT_CODE(KEYCODE_U) // な
93
+ PORT_BIT(0x02 , IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(' 7' ) PORT_CHAR(0x3084 ) PORT_CODE(KEYCODE_7) // や
94
+ PORT_BIT(0x04 , IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(' M' ) PORT_CHAR(0x3082 ) PORT_CODE(KEYCODE_M) // も
95
+ PORT_BIT(0x08 , IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(' J' ) PORT_CHAR(0x307e ) PORT_CODE(KEYCODE_J) // ま
96
+ PORT_BIT(0x10 , IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(' 6' ) PORT_CHAR(0x304a ) PORT_CODE(KEYCODE_6) // お
97
+ PORT_BIT(0x20 , IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(' Y' ) PORT_CHAR(0x3093 ) PORT_CODE(KEYCODE_Y) // ん
98
+ PORT_BIT(0x40 , IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(' H' ) PORT_CHAR(0x304f ) PORT_CODE(KEYCODE_H) // く
99
+ PORT_BIT(0x80 , IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(' N' ) PORT_CHAR(0x307f ) PORT_CODE(KEYCODE_N) // み
100
+
101
+ PORT_START(" KEY3" )
102
+ PORT_BIT(0x01 , IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(' I' ) PORT_CHAR(0x306b ) PORT_CODE(KEYCODE_I) // に
103
+ PORT_BIT(0x02 , IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(' 8' ) PORT_CHAR(0x3086 ) PORT_CODE(KEYCODE_8) // ゆ
104
+ PORT_BIT(0x04 , IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(' ,' ) PORT_CHAR(0x306d ) PORT_CODE(KEYCODE_COMMA) // ね
105
+ PORT_BIT(0x08 , IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(' K' ) PORT_CHAR(0x306e ) PORT_CODE(KEYCODE_K) // の
106
+ PORT_BIT(0x10 , IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(0x00a5 ) PORT_CHAR(0x3078 ) PORT_CODE(KEYCODE_EQUALS) // ¥ へ
107
+ PORT_BIT(0x20 , IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(' )' ) PORT_CHAR(0x309c ) PORT_CODE(KEYCODE_CLOSEBRACE) // ■゜
108
+ PORT_BIT(0x40 , IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(" Key 0015" )
109
+ PORT_BIT(0x80 , IP_ACTIVE_LOW, IPT_UNUSED)
110
+
111
+ PORT_START(" KEY4" )
112
+ PORT_BIT(0x01 , IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(' W' ) PORT_CHAR(0x3066 ) PORT_CODE(KEYCODE_W) // て
113
+ PORT_BIT(0x02 , IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(' 2' ) PORT_CHAR(0x3075 ) PORT_CODE(KEYCODE_2) // ふ
114
+ PORT_BIT(0x04 , IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(' X' ) PORT_CHAR(0x3055 ) PORT_CODE(KEYCODE_X) // さ
115
+ PORT_BIT(0x08 , IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(' S' ) PORT_CHAR(0x3068 ) PORT_CODE(KEYCODE_S) // と
116
+ PORT_BIT(0x10 , IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(" Key 0011" )
117
+ PORT_BIT(0x20 , IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(" Special Key L" )
118
+ PORT_BIT(0x40 , IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(" Key 0006" )
119
+ PORT_BIT(0x80 , IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(" Key 0009" )
120
+
121
+ PORT_START(" KEY5" )
122
+ PORT_BIT(0x01 , IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(' R' ) PORT_CHAR(0x3059 ) PORT_CODE(KEYCODE_R) // す
123
+ PORT_BIT(0x02 , IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(' 4' ) PORT_CHAR(0x3046 ) PORT_CODE(KEYCODE_4) // う
124
+ PORT_BIT(0x04 , IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(' V' ) PORT_CHAR(0x3072 ) PORT_CODE(KEYCODE_V) // ひ
125
+ PORT_BIT(0x08 , IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(' F' ) PORT_CHAR(0x306f ) PORT_CODE(KEYCODE_F) // は
126
+ PORT_BIT(0x10 , IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(' 5' ) PORT_CHAR(0x3048 ) PORT_CODE(KEYCODE_5) // え
127
+ PORT_BIT(0x20 , IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(' T' ) PORT_CHAR(0x304b ) PORT_CODE(KEYCODE_T) // か
128
+ PORT_BIT(0x40 , IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(' G' ) PORT_CHAR(0x304d ) PORT_CODE(KEYCODE_G) // き
129
+ PORT_BIT(0x80 , IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(' B' ) PORT_CHAR(0x3053 ) PORT_CODE(KEYCODE_B) // こ
130
+
131
+ PORT_START(" KEY6" )
132
+ PORT_BIT(0x01 , IP_ACTIVE_LOW, IPT_UNUSED)
133
+ PORT_BIT(0x02 , IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(0x2014 ) PORT_CHAR(0x30fc ) PORT_CODE(KEYCODE_BACKSLASH) // — ー
134
+ PORT_BIT(0x04 , IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(' \' ' ) PORT_CHAR(0x3080 ) PORT_CODE(KEYCODE_ENTER) // む
135
+ PORT_BIT(0x08 , IP_ACTIVE_LOW, IPT_UNUSED)
136
+ PORT_BIT(0x10 , IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(" Key 001E" )
137
+ PORT_BIT(0x20 , IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(" Key 001C" )
138
+ PORT_BIT(0x40 , IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(" Key 0014" )
139
+ PORT_BIT(0x80 , IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(u8" \u30B9\u30DA\u30FC\u30B9 (Space)" ) PORT_CHAR(0x20 ) PORT_CODE(KEYCODE_SPACE) // スペース
140
+
141
+ PORT_START(" KEY7" )
142
+ PORT_BIT(0x01 , IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(' E' ) PORT_CHAR(0x3044 ) PORT_CODE(KEYCODE_E) // い
143
+ PORT_BIT(0x02 , IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(' 3' ) PORT_CHAR(0x3042 ) PORT_CODE(KEYCODE_3) // あ
144
+ PORT_BIT(0x04 , IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(' C' ) PORT_CHAR(0x305d ) PORT_CODE(KEYCODE_C) // そ
145
+ PORT_BIT(0x08 , IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(' D' ) PORT_CHAR(0x3057 ) PORT_CODE(KEYCODE_D) // し
146
+ PORT_BIT(0x10 , IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(" Special Key H" )
147
+ PORT_BIT(0x20 , IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(" Key 0012" )
148
+ PORT_BIT(0x40 , IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(" Key 0013" )
149
+ PORT_BIT(0x80 , IP_ACTIVE_LOW, IPT_UNUSED)
150
+
151
+ PORT_START(" KEY8" )
152
+ PORT_BIT(0x01 , IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(' Q' ) PORT_CHAR(0x305f ) PORT_CODE(KEYCODE_Q) // た
153
+ PORT_BIT(0x02 , IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(' 1' ) PORT_CHAR(0x306c ) PORT_CODE(KEYCODE_1) // ぬ
154
+ PORT_BIT(0x04 , IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(' Z' ) PORT_CHAR(0x3064 ) PORT_CODE(KEYCODE_Z) // つ
155
+ PORT_BIT(0x08 , IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(' A' ) PORT_CHAR(0x3061 ) PORT_CODE(KEYCODE_A) // ち
156
+ PORT_BIT(0x10 , IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(" Key 0003" )
157
+ PORT_BIT(0x20 , IP_ACTIVE_LOW, IPT_UNUSED)
158
+ PORT_BIT(0x40 , IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(" Key 000F" )
159
+ PORT_BIT(0x80 , IP_ACTIVE_LOW, IPT_UNUSED)
160
+
161
+ PORT_START(" KEY9" )
162
+ PORT_BIT(0x01 , IP_ACTIVE_LOW, IPT_UNUSED)
163
+ PORT_BIT(0x02 , IP_ACTIVE_LOW, IPT_UNUSED)
164
+ PORT_BIT(0x04 , IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(" Key 000B" )
165
+ PORT_BIT(0x08 , IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(" Key 007F" )
166
+ PORT_BIT(0x10 , IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(" Key 000D" )
167
+ PORT_BIT(0x20 , IP_ACTIVE_LOW, IPT_UNUSED)
168
+ PORT_BIT(0x40 , IP_ACTIVE_LOW, IPT_UNUSED)
169
+ PORT_BIT(0x80 , IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(" Key 0017" )
52
170
INPUT_PORTS_END
53
171
54
172
void tvdear_state::tvdear(machine_config &config)
55
173
{
56
174
V25 (config, m_maincpu, 16000000 ); // NEC D70320DGJ-8; XTAL marked 16AKSS5HT
57
175
m_maincpu->set_addrmap (AS_PROGRAM, &tvdear_state::mem_map);
58
176
m_maincpu->set_addrmap (AS_IO, &tvdear_state::io_map);
177
+ m_maincpu->p0_out_cb ().set (FUNC (tvdear_state::p0_w));
178
+ m_maincpu->pt_in_cb ().set (FUNC (tvdear_state::pt_r));
59
179
60
180
// MB90076(config, "tvvc", 14318181); // XTAL marked 14AKSS5JT
61
181
0 commit comments