1 // license:GPL-2.0+
2 // copyright-holders:Peter Trauner
3 /******************************************************************************
4     Sharp pocket computers
5     PC1401/PC1403
6     PeT mess@utanet.at May 2000
7 
8     pc1403 and pc1403h can be convinced to work if you hit Enter once or twice
9     as soon as it is started.
10 
11 ******************************************************************************/
12 
13 #include "emu.h"
14 #include "includes/pocketc.h"
15 #include "includes/pc1401.h"
16 #include "includes/pc1251.h"
17 #include "includes/pc1350.h"
18 #include "includes/pc1403.h"
19 
20 #include "machine/ram.h"
21 
22 /* PC1430 lacks peek/poke operations */
23 
24 /* PC1280?? */
25 
26 /* PC126x
27    port
28    1 ?
29    2 +6v
30    3 gnd
31    4 f0
32    5 f1
33    6 load
34    7 save
35    8 ib7
36    9 ib6
37   10 ib5
38   11 ib4 */
39 
40 /* PC1350 other keyboard,
41    f2 instead f0 at port
42    port
43    1 ?
44    2 +6v
45    3 gnd
46    4 f2
47    5 f1
48    6 load
49    7 save
50    8 ib7
51    9 ib6
52   10 ib5
53   11 ib4
54 */
55 
56 /* Similar Computers:
57    - PC1260/1261
58    - PC1402/1403
59    - PC1421 */
60 /* PC140x
61    a,b0..b5 keyboard matrix
62    b0 off key
63    c0 display on
64    c1 counter reset
65    c2 cpu halt
66    c3 computer off
67    c4 beeper frequency (1 4kHz, 0 2kHz), or (c5=0) membrane pos1/pos2
68    c5 beeper on
69    c6 beeper control
70 
71    port
72    1 ?
73    2 +6v
74    3 gnd
75    4 f0
76    5 f1
77    6 load
78    7 save
79    8 ib7
80    9 ib6
81   10 ?
82   11 ?
83 */
84 
85 /* Special Leys Red C-CE and Reset; warm boot, program NOT lost */
86 
pc1401_mem(address_map & map)87 void pc1401_state::pc1401_mem(address_map &map)
88 {
89 	map(0x0000, 0x1fff).rom();
90 	map(0x3800, 0x47ff).ram();
91 	map(0x6000, 0x67ff).rw(FUNC(pc1401_state::lcd_read), FUNC(pc1401_state::lcd_write)).mirror(0x1000);
92 	map(0x8000, 0xffff).rom();
93 }
94 
pc1402_mem(address_map & map)95 void pc1401_state::pc1402_mem(address_map &map)
96 {
97 	map(0x0000, 0x1fff).rom();
98 	map(0x2000, 0x47ff).ram();
99 	map(0x6000, 0x67ff).rw(FUNC(pc1401_state::lcd_read), FUNC(pc1401_state::lcd_write)).mirror(0x1000);
100 	map(0x8000, 0xffff).rom();
101 }
102 
pc1250_mem(address_map & map)103 void pc1251_state::pc1250_mem(address_map &map)
104 {
105 	map(0x0000, 0x1fff).rom();
106 	map(0x4000, 0x7fff).rom();
107 	map(0xc000, 0xc7ff).ram(); // 2KB RAM
108 	map(0xf800, 0xf8ff).rw(FUNC(pc1251_state::lcd_read), FUNC(pc1251_state::lcd_write));
109 }
110 
pc1251_mem(address_map & map)111 void pc1251_state::pc1251_mem(address_map &map)
112 {
113 	map(0x0000, 0x1fff).rom();
114 	map(0x4000, 0x7fff).rom();
115 	map(0xb800, 0xc7ff).ram(); // 4KB RAM
116 	map(0xf800, 0xf8ff).rw(FUNC(pc1251_state::lcd_read), FUNC(pc1251_state::lcd_write));
117 }
118 
pc1255_mem(address_map & map)119 void pc1251_state::pc1255_mem(address_map &map)
120 {
121 	map(0x0000, 0x1fff).rom();
122 	map(0x4000, 0x7fff).rom();
123 	map(0xa000, 0xc7ff).ram(); // 10KB RAM
124 	map(0xf800, 0xf8ff).rw(FUNC(pc1251_state::lcd_read), FUNC(pc1251_state::lcd_write));
125 }
126 
pc1260_mem(address_map & map)127 void pc1251_state::pc1260_mem(address_map &map)
128 {
129 	map(0x0000, 0x1fff).rom();
130 	map(0x2000, 0x20ff).rw(FUNC(pc1251_state::lcd_read), FUNC(pc1251_state::lcd_write));
131 	map(0x5800, 0x67ff).ram(); // 4KB RAM
132 	map(0x8000, 0xffff).rom();
133 }
134 
pc1261_mem(address_map & map)135 void pc1251_state::pc1261_mem(address_map &map)
136 {
137 	map(0x0000, 0x1fff).rom();
138 	map(0x2000, 0x20ff).rw(FUNC(pc1251_state::lcd_read), FUNC(pc1251_state::lcd_write));
139 	map(0x4000, 0x67ff).ram(); // 10KB RAM
140 	map(0x8000, 0xffff).rom();
141 }
142 
pc1350_mem(address_map & map)143 void pc1350_state::pc1350_mem(address_map &map)
144 {
145 	map(0x0000, 0x1fff).rom();
146 	map(0x7000, 0x7eff).rw(FUNC(pc1350_state::lcd_read), FUNC(pc1350_state::lcd_write));
147 	map(0x8000, 0xffff).rom();
148 }
149 
pc1403_mem(address_map & map)150 void pc1403_state::pc1403_mem(address_map &map)
151 {
152 	map(0x0000, 0x1fff).rom();
153 	map(0x3000, 0x30bf).rw(FUNC(pc1403_state::lcd_read), FUNC(pc1403_state::lcd_write));
154 	map(0x3800, 0x3fff).rw(FUNC(pc1403_state::asic_read), FUNC(pc1403_state::asic_write));
155 	map(0x4000, 0x7fff).bankr("bank1");
156 	map(0xe000, 0xffff).ram();
157 }
158 
pc1403h_mem(address_map & map)159 void pc1403_state::pc1403h_mem(address_map &map)
160 {
161 	map(0x0000, 0x1fff).rom();
162 	map(0x3000, 0x30bf).rw(FUNC(pc1403_state::lcd_read), FUNC(pc1403_state::lcd_write));
163 	map(0x3800, 0x3fff).rw(FUNC(pc1403_state::asic_read), FUNC(pc1403_state::asic_write));
164 	map(0x4000, 0x7fff).bankr("bank1");
165 	map(0x8000, 0xffff).ram();
166 }
167 
168 #if 0
169 void pc1403_state::pc1421_readmem(address_map &map)
170 {
171 	map(0x0000, 0x1fff).rom();
172 	map(0x3800, 0x47ff).ram();
173 	map(0x8000, 0xffff).rom();
174 }
175 
176 void pc1403_state::pc1421_writemem(address_map &map)
177 {
178 	map(0x0000, 0x1fff).rom();
179 	map(0x2000, 0x37ff).ram();
180 	map(0x3800, 0x47ff).ram();
181 	map(0x8000, 0xffff).rom();
182 }
183 #endif
184 
185 
186 /* 2008-05 FP: the following input ports are based on the way ports are read, but I would like
187    to have confirmation from technical docs before considering these correct.
188    If they need to be changed, you must also update the clickable artwork.
189 */
190 
191 static INPUT_PORTS_START( pc1401 )
192 	PORT_START("KEY0")
193 	PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("+/-   y'") PORT_CODE(KEYCODE_NUMLOCK)
194 	PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("8     Sy") PORT_CODE(KEYCODE_8_PAD)
195 	PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("2     a") PORT_CODE(KEYCODE_2_PAD)
196 	PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("5     Sx") PORT_CODE(KEYCODE_5_PAD)
197 	PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("CAL") PORT_CODE(KEYCODE_F1)
198 	PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Q     !") PORT_CODE(KEYCODE_Q)
199 	PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("A     INPUT") PORT_CODE(KEYCODE_A)
200 	PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Z     PRINT") PORT_CODE(KEYCODE_Z)
201 
202 	PORT_START("KEY1")
203 	PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(".     DRG") PORT_CODE(KEYCODE_DEL_PAD)
204 	PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("9     sigmay") PORT_CODE(KEYCODE_9_PAD)
205 	PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("3     b") PORT_CODE(KEYCODE_3_PAD)
206 	PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("6     sigmax") PORT_CODE(KEYCODE_6_PAD)
207 	PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("BASIC") PORT_CODE(KEYCODE_F2)
208 	PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("W     \"") PORT_CODE(KEYCODE_W)
209 	PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("S     IF") PORT_CODE(KEYCODE_S)
210 	PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("X     USING") PORT_CODE(KEYCODE_X)
211 
212 	PORT_START("KEY2")
213 	PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("+     ^") PORT_CODE(KEYCODE_PLUS_PAD)
214 	PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("/") PORT_CODE(KEYCODE_SLASH_PAD)
215 	PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("-     >") PORT_CODE(KEYCODE_MINUS_PAD)
216 	PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("*     <") PORT_CODE(KEYCODE_ASTERISK)
217 	PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("DEF") PORT_CODE(KEYCODE_LALT) PORT_CODE(KEYCODE_RALT)
218 	PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("E     #") PORT_CODE(KEYCODE_E)
219 	PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("D     THEN") PORT_CODE(KEYCODE_D)
220 	PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("C     GOSUB") PORT_CODE(KEYCODE_C)
221 
222 	PORT_START("KEY3")
223 	PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(")     n!") PORT_CODE(KEYCODE_9)
224 	PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("(     ->xy") PORT_CODE(KEYCODE_8)
225 	PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("sqr   tri%   D")
226 	PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("sqrt  3root  C")
227 	PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("y^x   xROOTy B")
228 	PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("EXP   Pi     A")
229 	PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("X->M  Sum y  Sum y^2")
230 	PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("=") PORT_CODE(KEYCODE_ENTER_PAD)
231 
232 	PORT_START("KEY4")
233 	PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("chnge STAT")
234 	PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("1/x   ->r theta")
235 	PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("LOG   10^x   F")
236 	PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("LN    e^x    E")
237 	PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("->DEG ->D.MS")
238 	PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("->HEX ->DEC")
239 	PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
240 	PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("M+    DATA   CD")
241 
242 	PORT_START("KEY5")
243 	PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("C-CE  CA") PORT_CODE(KEYCODE_ESC)
244 	PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F<>E  TAB")
245 	PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("TAN   TAN^-1")
246 	PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("COS   COS^-1")
247 	PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("SIN   SIN^-1")
248 	PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("HYP   ARCHYP")
249 	PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("SHIFT") PORT_CODE(KEYCODE_LSHIFT) PORT_CODE(KEYCODE_RSHIFT)
250 	PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("RM    (x,y)")
251 
252 	PORT_START("KEY6")
253 	PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_UNUSED)
254 	PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("7     y mean") PORT_CODE(KEYCODE_7_PAD)
255 	PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("1     r") PORT_CODE(KEYCODE_1_PAD)
256 	PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("4     x mean") PORT_CODE(KEYCODE_4_PAD)
257 	PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("down") PORT_CODE(KEYCODE_DOWN)
258 	PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("R     $") PORT_CODE(KEYCODE_R)
259 	PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F     GOTO") PORT_CODE(KEYCODE_F)
260 	PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("V     RETURN") PORT_CODE(KEYCODE_V)
261 
262 	PORT_START("KEY7")
263 	PORT_BIT(0x03, IP_ACTIVE_HIGH, IPT_UNUSED)
264 	PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(",     RUN") PORT_CODE(KEYCODE_COMMA)
265 	PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("P     ;") PORT_CODE(KEYCODE_P)
266 	PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("up") PORT_CODE(KEYCODE_UP)
267 	PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("T     %") PORT_CODE(KEYCODE_T)
268 	PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("G     FOR") PORT_CODE(KEYCODE_G)
269 	PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("B     DIM") PORT_CODE(KEYCODE_B)
270 
271 	PORT_START("KEY8")
272 	PORT_BIT(0x07, IP_ACTIVE_HIGH, IPT_UNUSED)
273 	PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("O     :") PORT_CODE(KEYCODE_O)
274 	PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("left  DEL") PORT_CODE(KEYCODE_LEFT)
275 	PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Y     &") PORT_CODE(KEYCODE_Y)
276 	PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("H     TO") PORT_CODE(KEYCODE_H)
277 	PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("N     END") PORT_CODE(KEYCODE_N)
278 
279 	PORT_START("KEY9")
280 	PORT_BIT(0x0f, IP_ACTIVE_HIGH, IPT_UNUSED)
281 	PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("right INS") PORT_CODE(KEYCODE_RIGHT)
282 	PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("U     ?") PORT_CODE(KEYCODE_U)
283 	PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("J     STEP") PORT_CODE(KEYCODE_J)
284 	PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("M     CSAVE") PORT_CODE(KEYCODE_M)
285 
286 	PORT_START("KEY10")
287 	PORT_BIT(0x1f, IP_ACTIVE_HIGH, IPT_UNUSED)
288 	PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("I     @") PORT_CODE(KEYCODE_I)
289 	PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("K     NEXT") PORT_CODE(KEYCODE_K)
290 	PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("SPC   CLOAD") PORT_CODE(KEYCODE_SPACE)
291 
292 	PORT_START("KEY11")
293 	PORT_BIT(0x3f, IP_ACTIVE_HIGH, IPT_UNUSED)
294 	PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("L     LIST") PORT_CODE(KEYCODE_L)
295 	PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("ENTER N<>NP") PORT_CODE(KEYCODE_ENTER)
296 
297 	PORT_START("KEY12")
298 	PORT_BIT(0x7f, IP_ACTIVE_HIGH, IPT_UNUSED)
299 	PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("0     x'") PORT_CODE(KEYCODE_0_PAD)
300 
301 	PORT_START("EXTRA")
302 	PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("BRK   ON") PORT_CODE(KEYCODE_F4)
303 	PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Reset") PORT_CODE(KEYCODE_F3)
304 	PORT_DIPNAME( 0x04, 0x00,  "Power")
305 	PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
306 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
307 
308 	PORT_START("DSW0")
309 	PORT_DIPNAME( 0x07, 0x01, "Contrast")
310 	PORT_DIPSETTING(    0x00, "0/Low" )
311 	PORT_DIPSETTING(    0x01, "1" )
312 	PORT_DIPSETTING(    0x02, "2" )
313 	PORT_DIPSETTING(    0x03, "3" )
314 	PORT_DIPSETTING(    0x04, "4" )
315 	PORT_DIPSETTING(    0x05, "5" )
316 	PORT_DIPSETTING(    0x06, "6" )
317 	PORT_DIPSETTING(    0x07, "7/High" )
318 INPUT_PORTS_END
319 
320 static INPUT_PORTS_START( pc1403 )
321 	PORT_START("KEY0")
322 	PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("7     y mean") PORT_CODE(KEYCODE_7_PAD)
323 	PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("8     Sy") PORT_CODE(KEYCODE_8_PAD)
324 	PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("9     sigmay") PORT_CODE(KEYCODE_9_PAD)
325 	PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("/") PORT_CODE(KEYCODE_SLASH_PAD)
326 	PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("X->M  Sum y  Sum y^2")
327 	PORT_BIT(0xe0, IP_ACTIVE_HIGH, IPT_UNUSED)
328 
329 	PORT_START("KEY1")
330 	PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("4     x mean") PORT_CODE(KEYCODE_4_PAD)
331 	PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("5     Sx") PORT_CODE(KEYCODE_5_PAD)
332 	PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("6     sigmax") PORT_CODE(KEYCODE_6_PAD)
333 	PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("*     <") PORT_CODE(KEYCODE_ASTERISK)
334 	PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("RM    (x,y)")
335 	PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("SHIFT") PORT_CODE(KEYCODE_LSHIFT) PORT_CODE(KEYCODE_RSHIFT)
336 	PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("DEF") PORT_CODE(KEYCODE_LALT) PORT_CODE(KEYCODE_RALT)
337 	PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("SML") PORT_CODE(KEYCODE_CAPSLOCK)
338 
339 	PORT_START("KEY2")
340 	PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("1     r") PORT_CODE(KEYCODE_1_PAD)
341 	PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("2     a") PORT_CODE(KEYCODE_2_PAD)
342 	PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("3     b") PORT_CODE(KEYCODE_3_PAD)
343 	PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("-     >") PORT_CODE(KEYCODE_MINUS_PAD)
344 	PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("M+    DATA   CD")
345 	PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Q     !") PORT_CODE(KEYCODE_Q)
346 	PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("A     INPUT") PORT_CODE(KEYCODE_A)
347 	PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Z     PRINT") PORT_CODE(KEYCODE_Z)
348 
349 	PORT_START("KEY3")
350 	PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("0     x'") PORT_CODE(KEYCODE_0_PAD)
351 	PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("+/-   y'") PORT_CODE(KEYCODE_NUMLOCK)
352 	PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(".     DRG") PORT_CODE(KEYCODE_DEL_PAD)
353 	PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("+     ^") PORT_CODE(KEYCODE_PLUS_PAD)
354 	PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("=") PORT_CODE(KEYCODE_ENTER_PAD)
355 	PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("W     \"") PORT_CODE(KEYCODE_W)
356 	PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("S     IF") PORT_CODE(KEYCODE_S)
357 	PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("X     USING") PORT_CODE(KEYCODE_X)
358 
359 	PORT_START("KEY4")
360 	PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("HYP   ARCHYP")
361 	PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("SIN   SIN^-1")
362 	PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("COS   COS^-1")
363 	PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("TAN   TAN^-1")
364 	PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED)      /* toggles indicator 3c bit 0 japan? */
365 	PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("E     #") PORT_CODE(KEYCODE_E)
366 	PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("D     THEN") PORT_CODE(KEYCODE_D)
367 	PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("C     GOSUB") PORT_CODE(KEYCODE_C)
368 
369 	PORT_START("KEY5")
370 	PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("->HEX ->DEC")
371 	PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("->DEG ->D.MS")
372 	PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("LN    e^x    E")
373 	PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("LOG   10^x   F")
374 	PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED)      /* tilde? */
375 	PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("R     $") PORT_CODE(KEYCODE_R)
376 	PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F     GOTO") PORT_CODE(KEYCODE_F)
377 	PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("V     RETURN") PORT_CODE(KEYCODE_V)
378 
379 	PORT_START("KEY6")
380 	PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("EXP   Pi     A")
381 	PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("y^x   xROOTy B")
382 	PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("sqrt  3root  C")
383 	PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("sqr   tri%   D")
384 	PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED)      /* yen? */
385 	PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("T     %") PORT_CODE(KEYCODE_T)
386 	PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("G     FOR") PORT_CODE(KEYCODE_G)
387 	PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("B     DIM") PORT_CODE(KEYCODE_B)
388 
389 	PORT_START("KEY7")
390 	PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_UNUSED)
391 	PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("C-CE  CA") PORT_CODE(KEYCODE_ESC)
392 	PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("chnge STAT")
393 	PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F<>E  TAB")
394 	PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Down") PORT_CODE(KEYCODE_DOWN)
395 	PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Y     &") PORT_CODE(KEYCODE_Y)
396 	PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("H     TO") PORT_CODE(KEYCODE_H)
397 	PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("N     END") PORT_CODE(KEYCODE_N)
398 
399 	PORT_START("KEY8")
400 	PORT_BIT(0x03, IP_ACTIVE_HIGH, IPT_UNUSED)
401 	PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(")     n!") PORT_CODE(KEYCODE_9)
402 	PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("1/x   ->r theta")
403 	PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Up") PORT_CODE(KEYCODE_UP)
404 	PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("U     ?") PORT_CODE(KEYCODE_U)
405 	PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("J     STEP") PORT_CODE(KEYCODE_J)
406 	PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("M     CSAVE") PORT_CODE(KEYCODE_M)
407 
408 	PORT_START("KEY9")
409 	PORT_BIT(0x07, IP_ACTIVE_HIGH, IPT_UNUSED)
410 	PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("(     ->x y") PORT_CODE(KEYCODE_8)
411 	PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Left  DEL") PORT_CODE(KEYCODE_LEFT)
412 	PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("I     @") PORT_CODE(KEYCODE_I)
413 	PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("K     NEXT") PORT_CODE(KEYCODE_K)
414 	PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("SPC   CLOAD") PORT_CODE(KEYCODE_SPACE)
415 
416 	PORT_START("KEY10")
417 	PORT_BIT(0x0f, IP_ACTIVE_HIGH, IPT_UNUSED)
418 	PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Right INS") PORT_CODE(KEYCODE_RIGHT)
419 	PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("O     :") PORT_CODE(KEYCODE_O)
420 	PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("L     LIST") PORT_CODE(KEYCODE_L)
421 	PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("ENTER N<>NP") PORT_CODE(KEYCODE_ENTER)
422 
423 	PORT_START("KEY11")
424 	PORT_BIT(0x1f, IP_ACTIVE_HIGH, IPT_UNUSED)
425 	PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("P     ;") PORT_CODE(KEYCODE_P)
426 	PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(",     RUN") PORT_CODE(KEYCODE_COMMA)
427 	PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("BASIC") PORT_CODE(KEYCODE_F2)
428 
429 	PORT_START("KEY12")
430 	PORT_BIT(0x3f, IP_ACTIVE_HIGH, IPT_UNUSED)
431 	PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_UNUSED)      /* shift lock */
432 	PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("CAL") PORT_CODE(KEYCODE_F1)
433 
434 	PORT_START("KEY13")
435 	PORT_BIT(0x7f, IP_ACTIVE_HIGH, IPT_UNUSED)
436 	PORT_DIPNAME( 0x80, 0x00,  "Power")
437 	PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
438 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
439 
440 	PORT_START("EXTRA")
441 	PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("BRK   ON") PORT_CODE(KEYCODE_F4)
442 	PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Reset") PORT_CODE(KEYCODE_F3)
443 
444 	PORT_START("DSW0")
445 	// normally no contrast control!
446 	PORT_DIPNAME( 0x07, 0x01, "Contrast")
447 	PORT_DIPSETTING(    0x00, "0/Low" )
448 	PORT_DIPSETTING(    0x01, "1" )
449 	PORT_DIPSETTING(    0x02, "2" )
450 	PORT_DIPSETTING(    0x03, "3" )
451 	PORT_DIPSETTING(    0x04, "4" )
452 	PORT_DIPSETTING(    0x05, "5" )
453 	PORT_DIPSETTING(    0x06, "6" )
454 	PORT_DIPSETTING(    0x07, "7/High" )
455 INPUT_PORTS_END
456 
457 static INPUT_PORTS_START( pc1251 )
458 	PORT_START("KEY0")
459 	PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("-     >") PORT_CODE(KEYCODE_MINUS) PORT_CODE(KEYCODE_MINUS_PAD)
460 	PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("CL    CA") PORT_CODE(KEYCODE_ESC)
461 	PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("*     <") PORT_CODE(KEYCODE_ASTERISK)
462 	PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("/     ^") PORT_CODE(KEYCODE_SLASH) PORT_CODE(KEYCODE_SLASH_PAD)
463 	PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("DOWN  (") PORT_CODE(KEYCODE_DOWN)
464 	PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("E     #") PORT_CODE(KEYCODE_E)
465 	PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("D") PORT_CODE(KEYCODE_D)
466 	PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("C") PORT_CODE(KEYCODE_C)
467 
468 	PORT_START("KEY1")
469 	PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("+     Exp") PORT_CODE(KEYCODE_PLUS_PAD)
470 	PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("9") PORT_CODE(KEYCODE_9) PORT_CODE(KEYCODE_9_PAD)
471 	PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("3     @") PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD)
472 	PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("6") PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD)
473 	PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("SHIFT") PORT_CODE(KEYCODE_LSHIFT) PORT_CODE(KEYCODE_RSHIFT)
474 	PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("W     \"") PORT_CODE(KEYCODE_W)
475 	PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("S") PORT_CODE(KEYCODE_S)
476 	PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("X") PORT_CODE(KEYCODE_X)
477 
478 	PORT_START("KEY2")
479 	PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(".     SquareRoot") PORT_CODE(KEYCODE_STOP) PORT_CODE(KEYCODE_DEL_PAD)
480 	PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("8") PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_8_PAD)
481 	PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("2") PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD)
482 	PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("5") PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD)
483 	PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("DEF") PORT_CODE(KEYCODE_LALT) PORT_CODE(KEYCODE_RALT)
484 	PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Q     !") PORT_CODE(KEYCODE_Q)
485 	PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("A") PORT_CODE(KEYCODE_A)
486 	PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Z") PORT_CODE(KEYCODE_Z)
487 
488 	PORT_START("KEY3")
489 	PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_UNUSED)
490 	PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("7") PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_7_PAD)
491 	PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("1") PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD)
492 	PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("4") PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD)
493 	PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("UP    )") PORT_CODE(KEYCODE_UP)
494 	PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("R     $") PORT_CODE(KEYCODE_R)
495 	PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F") PORT_CODE(KEYCODE_F)
496 	PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("V") PORT_CODE(KEYCODE_V)
497 
498 	PORT_START("KEY4")
499 	PORT_BIT(0x03, IP_ACTIVE_HIGH, IPT_UNUSED)
500 	PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("=") PORT_CODE(KEYCODE_QUOTE)
501 	PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("P     ;") PORT_CODE(KEYCODE_P)
502 	PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("LEFT  DEL") PORT_CODE(KEYCODE_LEFT)
503 	PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("T     %") PORT_CODE(KEYCODE_T)
504 	PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("G") PORT_CODE(KEYCODE_G)
505 	PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("B") PORT_CODE(KEYCODE_B)
506 
507 	PORT_START("KEY5")
508 	PORT_BIT(0x07, IP_ACTIVE_HIGH, IPT_UNUSED)
509 	PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("O     ,") PORT_CODE(KEYCODE_O)
510 	PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("RIGHT INS") PORT_CODE(KEYCODE_RIGHT)
511 	PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Y     &") PORT_CODE(KEYCODE_Y)
512 	PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("H") PORT_CODE(KEYCODE_H)
513 	PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("N") PORT_CODE(KEYCODE_N)
514 
515 	PORT_START("KEY6")
516 	PORT_BIT(0x0f, IP_ACTIVE_HIGH, IPT_UNUSED)
517 	PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED)  /* down? */
518 	PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("U     ?") PORT_CODE(KEYCODE_U)
519 	PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("J") PORT_CODE(KEYCODE_J)
520 	PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("M") PORT_CODE(KEYCODE_M)
521 
522 	PORT_START("KEY7")
523 	PORT_BIT(0x1f, IP_ACTIVE_HIGH, IPT_UNUSED)
524 	PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("I     :") PORT_CODE(KEYCODE_I)
525 	PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("K") PORT_CODE(KEYCODE_K)
526 	PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("      SPC") PORT_CODE(KEYCODE_SPACE)
527 
528 	PORT_START("KEY8")
529 	PORT_BIT(0x3f, IP_ACTIVE_HIGH, IPT_UNUSED)
530 	PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("L") PORT_CODE(KEYCODE_L)
531 	PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("ENTER N<>NP") PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD)
532 
533 	PORT_START("KEY9")
534 	PORT_BIT(0x7f, IP_ACTIVE_HIGH, IPT_UNUSED)
535 	PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("0     Pi") PORT_CODE(KEYCODE_0) PORT_CODE(KEYCODE_0_PAD)
536 
537 	PORT_START("EXTRA")
538 	PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("BRK   ON") PORT_CODE(KEYCODE_F4)
539 	PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Reset") PORT_CODE(KEYCODE_F3)
540 
541 	PORT_START("MODE")
542 	PORT_DIPNAME( 0x07, 0x00, "Mode")
543 	PORT_DIPSETTING(    0x04, DEF_STR(Off) )
544 	PORT_DIPSETTING(    0x00, "On/RUN" )
545 	PORT_DIPSETTING(    0x02, "On/PRO" )
546 	PORT_DIPSETTING(    0x01, "On/RSV" )
547 
548 	PORT_START("DSW0")
549 	PORT_DIPNAME( 0x07, 0x01, "Contrast")
550 	PORT_DIPSETTING(    0x00, "0/Low" )
551 	PORT_DIPSETTING(    0x01, "1" )
552 	PORT_DIPSETTING(    0x02, "2" )
553 	PORT_DIPSETTING(    0x03, "3" )
554 	PORT_DIPSETTING(    0x04, "4" )
555 	PORT_DIPSETTING(    0x05, "5" )
556 	PORT_DIPSETTING(    0x06, "6" )
557 	PORT_DIPSETTING(    0x07, "7/High" )
558 INPUT_PORTS_END
559 
560 static INPUT_PORTS_START( pc1350 )
561 	PORT_START("KEY0")
562 	PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(")     >") PORT_CODE(KEYCODE_CLOSEBRACE)
563 	PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(":") PORT_CODE(KEYCODE_COLON)
564 	PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(";") PORT_CODE(KEYCODE_QUOTE)
565 	PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(",") PORT_CODE(KEYCODE_COMMA)
566 	PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("SML") PORT_CODE(KEYCODE_LCONTROL) PORT_CODE(KEYCODE_RCONTROL)
567 	PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("DEF") PORT_CODE(KEYCODE_LALT) PORT_CODE(KEYCODE_RALT)
568 	PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("SHIFT") PORT_CODE(KEYCODE_RSHIFT)   /* are both Shifts connected here? or is Left Shift missing */
569 
570 	PORT_START("KEY1")
571 	PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("(     <") PORT_CODE(KEYCODE_OPENBRACE)
572 	PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("/") PORT_CODE(KEYCODE_SLASH) PORT_CODE(KEYCODE_SLASH_PAD)
573 	PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("*") PORT_CODE(KEYCODE_ASTERISK)
574 	PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("-     ^") PORT_CODE(KEYCODE_MINUS) PORT_CODE(KEYCODE_MINUS_PAD)
575 	PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Z") PORT_CODE(KEYCODE_Z)
576 	PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("A") PORT_CODE(KEYCODE_A)
577 	PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Q     !") PORT_CODE(KEYCODE_Q)
578 
579 	PORT_START("KEY2")
580 	PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("9") PORT_CODE(KEYCODE_9) PORT_CODE(KEYCODE_9_PAD)
581 	PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("6") PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD)
582 	PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("3") PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD)
583 	PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("+") PORT_CODE(KEYCODE_PLUS_PAD)
584 	PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("X") PORT_CODE(KEYCODE_X)
585 	PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("S") PORT_CODE(KEYCODE_S)
586 	PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("W     \"") PORT_CODE(KEYCODE_W)
587 
588 	PORT_START("KEY3")
589 	PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("8") PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_8_PAD)
590 	PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("5") PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD)
591 	PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("2") PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD)
592 	PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(".") PORT_CODE(KEYCODE_STOP)
593 	PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("C") PORT_CODE(KEYCODE_C)
594 	PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("D") PORT_CODE(KEYCODE_D)
595 	PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("E     #") PORT_CODE(KEYCODE_E)
596 
597 	PORT_START("KEY4")
598 	PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("7") PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_7_PAD)
599 	PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("4") PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD)
600 	PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("1") PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD)
601 	PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("0") PORT_CODE(KEYCODE_0) PORT_CODE(KEYCODE_0_PAD)
602 	PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("V") PORT_CODE(KEYCODE_V)
603 	PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F") PORT_CODE(KEYCODE_F)
604 	PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("R     $") PORT_CODE(KEYCODE_R)
605 
606 	PORT_START("KEY5")
607 	PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("UP") PORT_CODE(KEYCODE_UP)
608 	PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("DOWN") PORT_CODE(KEYCODE_DOWN)
609 	PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("LEFT") PORT_CODE(KEYCODE_LEFT)
610 	PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("RIGHT") PORT_CODE(KEYCODE_RIGHT)
611 	PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("B") PORT_CODE(KEYCODE_B)
612 	PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("G") PORT_CODE(KEYCODE_G)
613 	PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("T     %") PORT_CODE(KEYCODE_T)
614 
615 	PORT_START("KEY6")
616 	PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_UNUSED)
617 	PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_UNUSED)      /* 1 ?*/
618 	PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("INS") PORT_CODE(KEYCODE_INSERT)
619 	PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("DEL") PORT_CODE(KEYCODE_DEL)
620 	PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("N") PORT_CODE(KEYCODE_N)
621 	PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("H") PORT_CODE(KEYCODE_H)
622 	PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Y     &") PORT_CODE(KEYCODE_Y)
623 
624 	PORT_START("KEY7")
625 	PORT_BIT(0x03, IP_ACTIVE_HIGH, IPT_UNUSED)
626 	PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED)      /* 2 ?*/
627 	PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("MODE") PORT_CODE(KEYCODE_F1)
628 	PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("M") PORT_CODE(KEYCODE_M)
629 	PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("J") PORT_CODE(KEYCODE_J)
630 	PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("U     ?") PORT_CODE(KEYCODE_U)
631 
632 	PORT_START("KEY8")
633 	PORT_BIT(0x07, IP_ACTIVE_HIGH, IPT_UNUSED)
634 	PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("CLS   CA") PORT_CODE(KEYCODE_ESC)
635 	PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("SPC") PORT_CODE(KEYCODE_SPACE)
636 	PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("K") PORT_CODE(KEYCODE_K)
637 	PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("I     Pi") PORT_CODE(KEYCODE_I)
638 
639 	PORT_START("KEY9")
640 	PORT_BIT(0x0f, IP_ACTIVE_HIGH, IPT_UNUSED)
641 	PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("ENTER P<->NP") PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD)
642 	PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("L") PORT_CODE(KEYCODE_L)
643 	PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("O     Squareroot") PORT_CODE(KEYCODE_O)
644 
645 	PORT_START("KEY10")
646 	PORT_BIT(0x1f, IP_ACTIVE_HIGH, IPT_UNUSED)
647 	PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("=") PORT_CODE(KEYCODE_EQUALS)
648 	PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("P     Alpha") PORT_CODE(KEYCODE_P)
649 
650 	PORT_START("KEY11")
651 	PORT_DIPNAME( 0xc0, 0x00, "Power")
652 	PORT_DIPSETTING(    0xc0, DEF_STR( Off ) )
653 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
654 
655 	PORT_START("EXTRA")
656 	PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("BRK   ON") PORT_CODE(KEYCODE_F4)
657 	PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("SHIFT") PORT_CODE(KEYCODE_LSHIFT) // temporarily here, but not read...
658 
659 	PORT_START("DSW0")
660 	PORT_DIPNAME( 0x07, 0x07, "Contrast")
661 	PORT_DIPSETTING(    0x00, "0/Low" )
662 	PORT_DIPSETTING(    0x01, "1" )
663 	PORT_DIPSETTING(    0x02, "2" )
664 	PORT_DIPSETTING(    0x03, "3" )
665 	PORT_DIPSETTING(    0x04, "4" )
666 	PORT_DIPSETTING(    0x05, "5" )
667 	PORT_DIPSETTING(    0x06, "6" )
668 	PORT_DIPSETTING(    0x07, "7/High" )
669 INPUT_PORTS_END
670 
671 
672 static const gfx_layout pc1401_charlayout =
673 {
674 	2,21,
675 	128,                                    /* 256 characters */
676 	1,                      /* 1 bits per pixel */
677 	{ 0,0 },                  /* no bitplanes; 1 bit per pixel */
678 	/* x offsets */
679 	{ 0,0 },
680 	/* y offsets */
681 	{
682 		7, 7, 7,
683 		6, 6, 6,
684 		5, 5, 5,
685 		4, 4, 4,
686 		3, 3, 3,
687 		2, 2, 2,
688 		1, 1, 1
689 	},
690 	1*8
691 };
692 
693 static const gfx_layout pc1251_charlayout =
694 {
695 	3,21,
696 	128,                                    /* 256 characters */
697 	1,                      /* 1 bits per pixel */
698 	{ 0, },                  /* no bitplanes; 1 bit per pixel */
699 	/* x offsets */
700 	{ 0,0,0 },
701 	/* y offsets */
702 	{
703 		7, 7, 7,
704 		6, 6, 6,
705 		5, 5, 5,
706 		4, 4, 4,
707 		3, 3, 3,
708 		2, 2, 2,
709 		1, 1, 1
710 	},
711 	1*8
712 };
713 
714 static GFXDECODE_START( gfx_pc1401 )
715 	GFXDECODE_ENTRY( "gfx1", 0x0000, pc1401_charlayout, 0, 8 )
716 GFXDECODE_END
717 
GFXDECODE_START(gfx_pc1251)718 static GFXDECODE_START( gfx_pc1251 )
719 	GFXDECODE_ENTRY( "gfx1", 0x0000, pc1251_charlayout, 0, 8 )
720 GFXDECODE_END
721 
722 void pocketc_state::pocketc_base(machine_config &config)
723 {
724 	config.set_maximum_quantum(attotime::from_hz(60));
725 
726 	NVRAM(config, "cpu_nvram", nvram_device::DEFAULT_ALL_0);
727 	NVRAM(config, "ram_nvram", nvram_device::DEFAULT_ALL_0);
728 
729 	// TODO: Convert to an SVG
730 	SCREEN(config, m_screen, SCREEN_TYPE_LCD);
731 	m_screen->set_refresh_hz(20);
732 	m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */
733 	m_screen->set_size(594, 273);
734 	m_screen->set_visarea(0, 594-1, 0, 273-1);
735 	m_screen->set_palette(m_palette);
736 
737 	GFXDECODE(config, m_gfxdecode, m_palette, gfx_pc1401);
738 	PALETTE(config, m_palette, FUNC(pocketc_state::pocketc_palette), 8*2, 6);
739 }
740 
pc1401(machine_config & config)741 void pc1401_state::pc1401(machine_config &config)
742 {
743 	pocketc_base(config);
744 	SC61860(config, m_maincpu, 192000);        /* 7.8336 MHz */
745 	m_maincpu->set_addrmap(AS_PROGRAM, &pc1401_state::pc1401_mem);
746 	m_maincpu->reset_cb().set(FUNC(pc1401_state::reset_r));
747 	m_maincpu->brk_cb().set(FUNC(pc1401_state::brk_r));
748 	m_maincpu->x_cb().set_constant(0);
749 	m_maincpu->in_a_cb().set(FUNC(pc1401_state::in_a_r));
750 	m_maincpu->out_a_cb().set(FUNC(pc1401_state::out_a_w));
751 	m_maincpu->in_b_cb().set(FUNC(pc1401_state::in_b_r));
752 	m_maincpu->out_b_cb().set(FUNC(pc1401_state::out_b_w));
753 	m_maincpu->out_c_cb().set(FUNC(pc1401_state::out_c_w));
754 
755 	m_screen->set_screen_update(FUNC(pc1401_state::screen_update));
756 }
757 
pc1402(machine_config & config)758 void pc1401_state::pc1402(machine_config &config)
759 {
760 	pc1401(config);
761 	m_maincpu->set_addrmap(AS_PROGRAM, &pc1401_state::pc1402_mem);
762 }
763 
pc1250(machine_config & config)764 void pc1251_state::pc1250(machine_config &config)
765 {
766 	pocketc_base(config);
767 	SC61860(config, m_maincpu, 192000);        /* 7.8336 MHz */
768 	m_maincpu->set_addrmap(AS_PROGRAM, &pc1251_state::pc1250_mem);
769 	m_maincpu->reset_cb().set_constant(0);
770 	m_maincpu->brk_cb().set(FUNC(pc1251_state::brk_r));
771 	m_maincpu->x_cb().set_constant(0);
772 	m_maincpu->in_a_cb().set(FUNC(pc1251_state::in_a_r));
773 	m_maincpu->out_a_cb().set(FUNC(pc1251_state::out_a_w));
774 	m_maincpu->in_b_cb().set(FUNC(pc1251_state::in_b_r));
775 	m_maincpu->out_b_cb().set(FUNC(pc1251_state::out_b_w));
776 	m_maincpu->out_c_cb().set(FUNC(pc1251_state::out_c_w));
777 
778 	/* video hardware */
779 	m_screen->set_size(608, 300);
780 	m_screen->set_visarea(0, 608-1, 0, 300-1);
781 	m_screen->set_screen_update(FUNC(pc1251_state::screen_update));
782 	m_gfxdecode->set_info(gfx_pc1251);
783 }
784 
pc1251(machine_config & config)785 void pc1251_state::pc1251(machine_config &config)
786 {
787 	pc1250(config);
788 	m_maincpu->set_addrmap(AS_PROGRAM, &pc1251_state::pc1251_mem);
789 }
790 
pc1255(machine_config & config)791 void pc1251_state::pc1255(machine_config &config)
792 {
793 	pc1250(config);
794 	m_maincpu->set_addrmap(AS_PROGRAM, &pc1251_state::pc1255_mem);
795 }
796 
pc1260(machine_config & config)797 void pc1260_state::pc1260(machine_config &config)
798 {
799 	pc1250(config);
800 	m_maincpu->set_addrmap(AS_PROGRAM, &pc1260_state::pc1260_mem);
801 }
802 
pc1261(machine_config & config)803 void pc1260_state::pc1261(machine_config &config)
804 {
805 	pc1260(config);
806 	m_maincpu->set_addrmap(AS_PROGRAM, &pc1260_state::pc1261_mem);
807 }
808 
pc1350(machine_config & config)809 void pc1350_state::pc1350(machine_config &config)
810 {
811 	pocketc_base(config);
812 	SC61860(config, m_maincpu, 192000);        /* 7.8336 MHz */
813 	m_maincpu->set_addrmap(AS_PROGRAM, &pc1350_state::pc1350_mem);
814 	m_maincpu->reset_cb().set_constant(0);
815 	m_maincpu->brk_cb().set(FUNC(pc1350_state::brk_r));
816 	m_maincpu->x_cb().set_constant(0);
817 	m_maincpu->in_a_cb().set(FUNC(pc1350_state::in_a_r));
818 	m_maincpu->out_a_cb().set(FUNC(pc1350_state::out_a_w));
819 	m_maincpu->in_b_cb().set(FUNC(pc1350_state::in_b_r));
820 	m_maincpu->out_b_cb().set(FUNC(pc1350_state::out_b_w));
821 	m_maincpu->out_c_cb().set(FUNC(pc1350_state::out_c_w));
822 
823 	/* video hardware */
824 	m_screen->set_size(640, 252);
825 	m_screen->set_visarea(0, 640-1, 0, 252-1);
826 	m_screen->set_screen_update(FUNC(pc1350_state::screen_update));
827 
828 	/* internal ram */
829 	RAM(config, m_ram).set_default_size("4K").set_extra_options("12K,20K");
830 }
831 
pc1403(machine_config & config)832 void pc1403_state::pc1403(machine_config &config)
833 {
834 	pocketc_base(config);
835 	SC61860(config, m_maincpu, 256000);
836 	m_maincpu->set_addrmap(AS_PROGRAM, &pc1403_state::pc1403_mem);
837 	m_maincpu->reset_cb().set_constant(0);
838 	m_maincpu->brk_cb().set(FUNC(pc1403_state::brk_r));
839 	m_maincpu->x_cb().set_constant(0);
840 	m_maincpu->in_a_cb().set(FUNC(pc1403_state::in_a_r));
841 	m_maincpu->out_a_cb().set(FUNC(pc1403_state::out_a_w));
842 	m_maincpu->in_b_cb().set_constant(0);
843 	m_maincpu->out_b_cb().set_nop();
844 	m_maincpu->out_c_cb().set(FUNC(pc1403_state::out_c_w));
845 
846 	/* video hardware */
847 	m_screen->set_size(848, 320);
848 	m_screen->set_visarea(0, 848-1, 0, 320-1);
849 	m_screen->set_screen_update(FUNC(pc1403_state::screen_update));
850 }
851 
pc1403h(machine_config & config)852 void pc1403_state::pc1403h(machine_config &config)
853 {
854 	pc1403(config);
855 	m_maincpu->set_addrmap(AS_PROGRAM, &pc1403_state::pc1403h_mem);
856 }
857 
858 
859 ROM_START(pc1401)
860 	ROM_REGION(0x10000,"maincpu",0)
861 	/* SC61860A08 5H 13LD cpu with integrated rom*/
862 	ROM_LOAD("sc61860.a08", 0x0000, 0x2000, CRC(44bee438) SHA1(c5106bc8d848be1b49494ace30a26eeb1cc5e504))
863 /* 5S1 SC613256 D30
864    or SC43536LD 5G 13 (LCD chip?) */
865 	ROM_LOAD("sc613256.d30", 0x8000, 0x8000, CRC(69b9d587) SHA1(fa0602e7dfee548546f801fb4cca7d73da2d8f18))
866 	ROM_REGION(0x80,"gfx1",ROMREGION_ERASEFF)
867 ROM_END
868 
869 #define rom_pc1402 rom_pc1401
870 
871 ROM_START(pc1245)
872 	ROM_REGION(0x10000,"maincpu",0)
873 	ROM_LOAD( "cpu1245.rom", 0x0000, 0x2000, CRC(e0964069) SHA1(293c57b233d55944b308191fd72ecff81979cda7))
874 	ROM_LOAD( "bas1245.rom", 0x4000, 0x4000, CRC(f6253a0d) SHA1(bcac9b4f5a88eb952e81b3ee28f922c06bace18e))
875 	ROM_REGION(0x80,"gfx1",ROMREGION_ERASEFF)
876 ROM_END
877 
878 ROM_START(pc1250)
879 	ROM_REGION(0x10000,"maincpu",0)
880 	/* sc61860a13 6c 13 ld */
881 	ROM_LOAD("cpu1250.rom", 0x0000, 0x2000, CRC(f7287aca) SHA1(19bfa778e3e05ea06bdca15cd9dfbba9b971340e))
882 	ROM_LOAD("bas1250.rom", 0x4000, 0x4000, CRC(93ecb629) SHA1(0fe0ad419053ee7814600b0be320dd2e8eb2ec92))
883 	ROM_REGION(0x80,"gfx1",ROMREGION_ERASEFF)
884 ROM_END
885 
886 #define rom_pc1251 rom_pc1250
887 #define rom_pc1255 rom_pc1250
888 #define rom_trs80pc3 rom_pc1250
889 
890 
891 ROM_START(pc1260)
892 	ROM_REGION(0x10000,"maincpu",0)
893 	ROM_LOAD( "cpu1260.rom", 0x0000, 0x2000, CRC(f46d23d3) SHA1(e00c9194570048185ec8358732adeba151c56b33))
894 	ROM_LOAD( "bas1260.rom", 0x8000, 0x8000, CRC(6c7e017d) SHA1(e2ae717438cea59416b0670e2a53989c147fb362))
895 	ROM_REGION(0x80,"gfx1",ROMREGION_ERASEFF)
896 ROM_END
897 
898 #define rom_pc1261 rom_pc1260
899 
900 ROM_START(pc1350)
901 	ROM_REGION(0x10000,"maincpu",0)
902 	/* sc61860a13 6c 13 ld */
903 	ROM_LOAD("cpu.rom", 0x0000, 0x2000, CRC(79a924bc) SHA1(2eaef0d53d85863ca70a41c8e1eddc5915136b99))
904 	ROM_LOAD("basic.rom", 0x8000, 0x8000, CRC(158b28e2) SHA1(b63b37dd510b3c4d9f16d224f87ae2efb3bcc51f))
905 	ROM_REGION(0x100,"gfx1",ROMREGION_ERASEFF)
906 ROM_END
907 
908 ROM_START( pc1360 )
909 	ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF )
910 	ROM_LOAD( "cpu-1360.rom", 0x0000, 0x2000, CRC(8fc9bf75) SHA1(f803cfecb8179f47031901c4d5bd546ac93118b1))
911 	ROM_REGION(0x20000,"user1",0)
912 	ROM_LOAD( "b0-1360.rom", 0x00000, 0x4000, CRC(afe1d3d6) SHA1(7178fd30dcc7f2777f0539897ef7245832f26152))
913 	ROM_LOAD( "b1-1360.rom", 0x04000, 0x4000, CRC(83f7e4dd) SHA1(ae6d133fdb586df8660dd9315c1fdf80b7b8dd57))
914 	ROM_LOAD( "b2-1360.rom", 0x08000, 0x4000, CRC(007cf5a6) SHA1(311d3ceaaed61479bdb00d8ade358fd6a99da170))
915 	ROM_LOAD( "b3-1360.rom", 0x0c000, 0x4000, CRC(4170849f) SHA1(70eeaa29c008131137bd28e4e957694cdf312413))
916 	ROM_LOAD( "b4-1360.rom", 0x10000, 0x4000, CRC(0d311e21) SHA1(55987b7b00ddc666db30f35cbf23500b49e7ff09))
917 	ROM_LOAD( "b5-1360.rom", 0x14000, 0x4000, CRC(f945f3f7) SHA1(26116d8277212e14bddb64c531f134fbb5c86f9e))
918 	ROM_LOAD( "b6-1360.rom", 0x18000, 0x4000, CRC(ae823112) SHA1(9ab458e70752cacfd5d3ed36a8e89f96c63a6f50))
919 	ROM_LOAD( "b7-1360.rom", 0x1c000, 0x4000, CRC(ba7384b6) SHA1(95396d506f1d71e66c3ae2d47ffb4b6d10b31401))
920 	ROM_REGION(0x100,"gfx1",ROMREGION_ERASEFF)
921 ROM_END
922 
923 ROM_START(pc1403)
924 	ROM_REGION(0x10000,"maincpu",0)
925 	ROM_LOAD("introm.bin", 0x0000, 0x2000, CRC(588c500b) SHA1(2fed9ebede27e20a8ee4b4b03b9f8cd7808ada5c))
926 	ROM_REGION(0x10000,"user1",0)
927 	ROM_LOAD("extrom08.bin", 0x0000, 0x4000, CRC(1fa65140) SHA1(f22a9f114486f69733fc43dfec26fb210643aeff))
928 	ROM_LOAD("extrom09.bin", 0x4000, 0x4000, CRC(4a7da6ab) SHA1(b50fe8a4ca821244c119147b3ff04cee0fd6ad5c))
929 	ROM_LOAD("extrom0a.bin", 0x8000, 0x4000, CRC(9925174f) SHA1(793a79142cd170ed7ac3f7ecb1b6e6f92c8fa4e0))
930 	ROM_LOAD("extrom0b.bin", 0xc000, 0x4000, CRC(fa5df9ec) SHA1(6ff62c215f510a3a652d61823f54cd4018d6a771))
931 	ROM_REGION(0x100,"gfx1",ROMREGION_ERASEFF)
932 ROM_END
933 
934 #define rom_pc1403h rom_pc1403
935 
936 // disk drive support
937 #define io_pc1403 io_pc1401
938 #define io_pc1403h io_pc1403
939 
940 /* ROM definition */
941 ROM_START( pc1450 )
942 	ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF )
943 	ROM_LOAD( "cpu-1450.rom", 0x0000, 0x2000, CRC(dead7be5) SHA1(f55ba8cb823eb16b514032e96d2068d028964c1f))
944 	ROM_LOAD( "bas-1450.rom", 0x8000, 0x8000, CRC(d207cae9) SHA1(a88ef79bc38ea264165f800e4e386050d4d461b2))
945 	ROM_REGION(0x100,"gfx1",ROMREGION_ERASEFF)
946 ROM_END
947 
948 /*    YEAR  NAME      PARENT    MACHINE   INPUT     INIT      MONITOR   COMPANY   FULLNAME */
949 
950 /* cpu sc43177, sc43178 (4bit!)
951    pc 1211
952    clone tandy trs80 pocket computer
953    pc1246/pc1247
954 */
955 
956 /* cpu lh5801
957    pc1500
958    clone tandy pc2 look into drivers/pc1500.c
959    pc1600
960 */
961 
962 //    YEAR  NAME      PARENT  COMPAT  MACHINE  INPUT   CLASS         INIT         COMPANY  FULLNAME                     FLAGS
963 // cpu sc61860
964 COMP( 1982, pc1245,   0,      0,      pc1250,  pc1251, pc1251_state, empty_init, "Sharp", "Pocket Computer 1245",      MACHINE_NOT_WORKING  | MACHINE_NO_SOUND )
965 COMP( 1982, pc1250,   0,      0,      pc1250,  pc1251, pc1251_state, empty_init, "Sharp", "Pocket Computer 1250",      MACHINE_NO_SOUND)
966 COMP( 1982, pc1251,   pc1250, 0,      pc1251,  pc1251, pc1251_state, empty_init, "Sharp", "Pocket Computer 1251",      MACHINE_NO_SOUND)
967 COMP( 1982, pc1255,   pc1250, 0,      pc1255,  pc1251, pc1251_state, empty_init, "Sharp", "Pocket Computer 1255",      MACHINE_NO_SOUND)
968 COMP( 1983, trs80pc3, pc1250, 0,      pc1251,  pc1251, pc1251_state, empty_init, "Tandy Radio Shack", "TRS-80 Pocket Computer PC-3", MACHINE_NO_SOUND)
969 
970 COMP( 1982, pc1260,   0,      0,      pc1260,  pc1251, pc1260_state, empty_init, "Sharp", "Pocket Computer 1260",      MACHINE_NOT_WORKING  | MACHINE_NO_SOUND )
971 COMP( 1982, pc1261,   pc1260, 0,      pc1261,  pc1251, pc1260_state, empty_init, "Sharp", "Pocket Computer 1261/1262", MACHINE_NOT_WORKING  | MACHINE_NO_SOUND)
972 
973 // pc1261/pc1262
974 COMP( 1984, pc1350,   0,      0,      pc1350,  pc1350, pc1350_state, empty_init, "Sharp", "Pocket Computer 1350",      MACHINE_NO_SOUND )
975 COMP( 198?, pc1450,   0,      0,      pc1350,  pc1350, pc1350_state, empty_init, "Sharp", "Pocket Computer 1450",      MACHINE_NOT_WORKING | MACHINE_NO_SOUND )
976 
977 COMP( 1983, pc1401,   0,      0,      pc1401,  pc1401, pc1401_state, empty_init, "Sharp", "Pocket Computer 1401",      MACHINE_NO_SOUND)
978 COMP( 1984, pc1402,   pc1401, 0,      pc1402,  pc1401, pc1401_state, empty_init, "Sharp", "Pocket Computer 1402",      MACHINE_NO_SOUND)
979 COMP( 198?, pc1360,   pc1401, 0,      pc1401,  pc1401, pc1401_state, empty_init, "Sharp", "Pocket Computer 1360",      MACHINE_NOT_WORKING | MACHINE_NO_SOUND )
980 
981 // 72kb rom, 32kb ram, cpu? pc1360
982 COMP( 1986, pc1403,   0,      0,      pc1403,  pc1403, pc1403_state, empty_init, "Sharp", "Pocket Computer 1403",      MACHINE_NOT_WORKING  | MACHINE_NO_SOUND)
983 COMP( 198?, pc1403h,  pc1403, 0,      pc1403h, pc1403, pc1403_state, empty_init, "Sharp", "Pocket Computer 1403H",     MACHINE_NOT_WORKING  | MACHINE_NO_SOUND)
984