Previous 15994 Revisions Next

r1221 Saturday 3rd November, 2007 at 21:58:56 UTC by Nathan Woods
[ADAM] Input ports cleanup, natural keyboard support. [Stefano Priore]
[docs]messnew.txt
[src/mess/drivers]adam.c
[src/mess/machine]adam.c

src/mess/machine/adam.c
r1220r1221
2020int adam_pcb;
2121
2222static int joy_mode = 0;
23
24/* TODO: Are these digits correct? */
2325static int KeyboardBuffer[20]; /* Buffer to store keys pressed */
2426static int KbBufferCapacity = 15; /* Capacity of the Keyboard Buffer */
2527static int KbRepeatDelay = 20;
28
2629static UINT8 KbRepeatTable[256];
2730
2831int adam_cart_verify(const UINT8 *cartdata, size_t size)
r1220r1221
113116//logerror("Exploring Keyboard.............\n");
114117    for(i=0;i<=255;i++) {if (KbRepeatTable[i]>0) KbRepeatTable[i]++;} /* Update repeat table */
115118
116    keyboard[0] = input_port_9_r(0);
117    keyboard[1] = input_port_10_r(0);
118    keyboard[2] = input_port_11_r(0);
119    keyboard[3] = input_port_12_r(0);
120    keyboard[4] = input_port_13_r(0);
121    keyboard[5] = input_port_14_r(0);
122    keyboard[6] = input_port_15_r(0);
123    keyboard[7] = input_port_16_r(0);
124    keyboard[8] = input_port_17_r(0);
125    keyboard[9] = input_port_18_r(0);
126   
127    controlKey = (!(keyboard[9]&0x01) || !(keyboard[9]&0x02)); /* Left Control or Right Control */
128    shiftKey = (!(keyboard[8]&0x40) || !(keyboard[8]&0x80) || !(keyboard[9]&0x04)); /* Left shiftKey or Right shiftKey or Caps Lock*/
119    keyboard[0] = readinputportbytag("keyboard_1");
120    keyboard[1] = readinputportbytag("keyboard_2");
121    keyboard[2] = readinputportbytag("keyboard_3");
122    keyboard[3] = readinputportbytag("keyboard_4");
123    keyboard[4] = readinputportbytag("keyboard_5");
124    keyboard[5] = readinputportbytag("keyboard_6");
125    keyboard[6] = readinputportbytag("keyboard_7");
126    keyboard[7] = readinputportbytag("keyboard_8");
127    keyboard[8] = readinputportbytag("keyboard_9");
128    keyboard[9] = readinputportbytag("keyboard_10");
129129
130    if (shiftKey && !controlKey && !(keyboard[7] & 0x80)) addToKeyboardBuffer(0xB8); /* shiftKey + BACKSPACE */
131    else {KbRepeatTable[0xB8]=0;}
130/* Reference: Appendix of COLECO ADAM TECHNICAL MANUAL at http://drushel.cwru.edu/atm/atm.html */
131
132    controlKey = !(keyboard[9]&0x01);                                                /* Control */
133    shiftKey = (!(keyboard[8]&0x40) || !(keyboard[8]&0x80) || !(keyboard[9]&0x04));  /* Left shiftKey or Right shiftKey or Lock */
134
135    if (controlKey && !shiftKey && !(keyboard[4] & 0x04)) addToKeyboardBuffer(0x00); /* controlKey + 2 */
136    else {KbRepeatTable[0x00]=0;}
137    if (controlKey && !shiftKey && !(keyboard[0] & 0x02)) addToKeyboardBuffer(0x01); /* controlKey + A */
138    else {KbRepeatTable[0x01]=0;}
139    if (controlKey && !shiftKey && !(keyboard[0] & 0x04)) addToKeyboardBuffer(0x02); /* controlKey + B */
140    else {KbRepeatTable[0x02]=0;}
141    if (controlKey && !shiftKey && !(keyboard[0] & 0x08)) addToKeyboardBuffer(0x03); /* controlKey + C */
142    else {KbRepeatTable[0x03]=0;}
143    if (controlKey && !shiftKey && !(keyboard[0] & 0x10)) addToKeyboardBuffer(0x04); /* controlKey + D */
144    else {KbRepeatTable[0x04]=0;}
145    if (controlKey && !shiftKey && !(keyboard[0] & 0x20)) addToKeyboardBuffer(0x05); /* controlKey + E */
146    else {KbRepeatTable[0x05]=0;}
147    if (controlKey && !shiftKey && !(keyboard[0] & 0x40)) addToKeyboardBuffer(0x06); /* controlKey + F */
148    else {KbRepeatTable[0x06]=0;}
149    if (controlKey && !shiftKey && !(keyboard[0] & 0x80)) addToKeyboardBuffer(0x07); /* controlKey + G */
150    else {KbRepeatTable[0x07]=0;}
151
152    if ((controlKey && !shiftKey && !(keyboard[1] & 0x01)) || !(keyboard[9] & 0x02)) addToKeyboardBuffer(0x08); /* controlKey + H or BACKSPACE */
153    else {KbRepeatTable[0x08]=0;}
154    if ((controlKey && !shiftKey && !(keyboard[1] & 0x02)) || !(keyboard[8] & 0x20)) addToKeyboardBuffer(0x09); /* controlKey + I or TAB */
155    else {KbRepeatTable[0x09]=0;}
156    if (controlKey && !shiftKey && !(keyboard[1] & 0x04)) addToKeyboardBuffer(0x0A); /* controlKey + J */
157    else {KbRepeatTable[0x0A]=0;}
158    if (controlKey && !shiftKey && !(keyboard[1] & 0x08)) addToKeyboardBuffer(0x0B); /* controlKey + K */
159    else {KbRepeatTable[0x0B]=0;}
160    if (controlKey && !shiftKey && !(keyboard[1] & 0x10)) addToKeyboardBuffer(0x0C); /* controlKey + L */
161    else {KbRepeatTable[0x0C]=0;}
162    if ((controlKey && !shiftKey && !(keyboard[1] & 0x20)) || !(keyboard[6] & 0x80)) addToKeyboardBuffer(0x0D); /* controlKey + M or RETURN */
163    else {KbRepeatTable[0x0D]=0;}
164    if (controlKey && !shiftKey && !(keyboard[1] & 0x40)) addToKeyboardBuffer(0x0E); /* controlKey + N */
165    else {KbRepeatTable[0x0E]=0;}
166    if (controlKey && !shiftKey && !(keyboard[1] & 0x80)) addToKeyboardBuffer(0x0F); /* controlKey + O */
167    else {KbRepeatTable[0x0F]=0;}
132168   
133    if (shiftKey && !controlKey && !(keyboard[8] & 0x20)) addToKeyboardBuffer(0xB9); /* shiftKey + TAB */
134    else {KbRepeatTable[0xB9]=0;}
135   
136    if (shiftKey && !controlKey && !(keyboard[4] & 0x01)) addToKeyboardBuffer(0x29); /* shiftKey + 0 */
137    else {KbRepeatTable[0x29]=0;}
169    if (controlKey && !shiftKey && !(keyboard[2] & 0x01)) addToKeyboardBuffer(0x10); /* controlKey + P */
170    else {KbRepeatTable[0x10]=0;}
171    if (controlKey && !shiftKey && !(keyboard[2] & 0x02)) addToKeyboardBuffer(0x11); /* controlKey + Q */
172    else {KbRepeatTable[0x11]=0;}
173    if (controlKey && !shiftKey && !(keyboard[2] & 0x04)) addToKeyboardBuffer(0x12); /* controlKey + R */
174    else {KbRepeatTable[0x12]=0;}
175    if (controlKey && !shiftKey && !(keyboard[2] & 0x08)) addToKeyboardBuffer(0x13); /* controlKey + S */
176    else {KbRepeatTable[0x13]=0;}
177    if (controlKey && !shiftKey && !(keyboard[2] & 0x10)) addToKeyboardBuffer(0x14); /* controlKey + T */
178    else {KbRepeatTable[0x14]=0;}
179    if (controlKey && !shiftKey && !(keyboard[2] & 0x20)) addToKeyboardBuffer(0x15); /* controlKey + U */
180    else {KbRepeatTable[0x15]=0;}
181    if (controlKey && !shiftKey && !(keyboard[2] & 0x40)) addToKeyboardBuffer(0x16); /* controlKey + V */
182    else {KbRepeatTable[0x16]=0;}
183    if (controlKey && !shiftKey && !(keyboard[2] & 0x80)) addToKeyboardBuffer(0x17); /* controlKey + W */
184    else {KbRepeatTable[0x17]=0;}
185
186    if (controlKey && !shiftKey && !(keyboard[3] & 0x01)) addToKeyboardBuffer(0x18); /* controlKey + X */
187    else {KbRepeatTable[0x18]=0;}
188    if (controlKey && !shiftKey && !(keyboard[3] & 0x02)) addToKeyboardBuffer(0x19); /* controlKey + Y */
189    else {KbRepeatTable[0x19]=0;}
190    if (controlKey && !shiftKey && !(keyboard[3] & 0x04)) addToKeyboardBuffer(0x1A); /* controlKey + Z */
191    else {KbRepeatTable[0x1A]=0;}
192    if ((controlKey && !shiftKey && !(keyboard[5] & 0x80)) || !(keyboard[0] & 0x01)) addToKeyboardBuffer(0x1B); /* controlKey + [ or ESCAPE/WP */
193    else {KbRepeatTable[0x1B]=0;}
194    if (controlKey && !shiftKey && !(keyboard[3] & 0x10)) addToKeyboardBuffer(0x1C); /* controlKey + \ */
195    else {KbRepeatTable[0x1C]=0;}
196    if (controlKey && !shiftKey && !(keyboard[3] & 0x08)) addToKeyboardBuffer(0x1D); /* controlKey + ] */
197    else {KbRepeatTable[0x1D]=0;}
198    if (controlKey && !shiftKey && !(keyboard[3] & 0x20)) addToKeyboardBuffer(0x1E); /* controlKey + ^ */
199    else {KbRepeatTable[0x1E]=0;}
200    if (controlKey && !shiftKey && !(keyboard[4] & 0x40)) addToKeyboardBuffer(0x1F); /* controlKey + 6 */
201    else {KbRepeatTable[0x1F]=0;}
202
203    if (!controlKey && !shiftKey && !(keyboard[6] & 0x40)) addToKeyboardBuffer(0x20); /* SPACEBAR */
204    else {KbRepeatTable[0x20]=0;}
138205    if (shiftKey && !controlKey && !(keyboard[4] & 0x02)) addToKeyboardBuffer(0x21); /* shiftKey + 1 */
139206    else {KbRepeatTable[0x21]=0;}
140    if (shiftKey && !controlKey && !(keyboard[4] & 0x04)) addToKeyboardBuffer(0x40); /* shiftKey + 2 */
141    else {KbRepeatTable[0x40]=0;}
207    if (shiftKey && !controlKey && !(keyboard[5] & 0x04)) addToKeyboardBuffer(0x22); /* shiftKey + ' */
208    else {KbRepeatTable[0x22]=0;}
142209    if (shiftKey && !controlKey && !(keyboard[4] & 0x08)) addToKeyboardBuffer(0x23); /* shiftKey + 3 */
143210    else {KbRepeatTable[0x23]=0;}
144211    if (shiftKey && !controlKey && !(keyboard[4] & 0x10)) addToKeyboardBuffer(0x24); /* shiftKey + 4 */
145212    else {KbRepeatTable[0x24]=0;}
146213    if (shiftKey && !controlKey && !(keyboard[4] & 0x20)) addToKeyboardBuffer(0x25); /* shiftKey + 5 */
147214    else {KbRepeatTable[0x25]=0;}
148    if (shiftKey && !controlKey && !(keyboard[4] & 0x40)) addToKeyboardBuffer(0x5F); /* shiftKey + 6 */
149    else {KbRepeatTable[0x5F]=0;}
150215    if (shiftKey && !controlKey && !(keyboard[4] & 0x80)) addToKeyboardBuffer(0x26); /* shiftKey + 7 */
151216    else {KbRepeatTable[0x26]=0;}
217    if (!shiftKey && !controlKey && !(keyboard[5] & 0x04)) addToKeyboardBuffer(0x27); /* ' */
218    else {KbRepeatTable[0x27]=0;}
152219
153    if (shiftKey && !controlKey && !(keyboard[5] & 0x01)) addToKeyboardBuffer(0x2A); /* shiftKey + 8 */
154    else {KbRepeatTable[0x2A]=0;}
155220    if (shiftKey && !controlKey && !(keyboard[5] & 0x02)) addToKeyboardBuffer(0x28); /* shiftKey + 9 */
156221    else {KbRepeatTable[0x28]=0;}
222    if (shiftKey && !controlKey && !(keyboard[4] & 0x01)) addToKeyboardBuffer(0x29); /* shiftKey + 0 */
223    else {KbRepeatTable[0x29]=0;}
224    if (shiftKey && !controlKey && !(keyboard[5] & 0x01)) addToKeyboardBuffer(0x2A); /* shiftKey + 8 */
225    else {KbRepeatTable[0x2A]=0;}
226    if (!controlKey && !shiftKey && !(keyboard[5] & 0x08)) addToKeyboardBuffer(0x2B); /* + */
227    else {KbRepeatTable[0x2B]=0;}
228    if (!controlKey && !shiftKey && !(keyboard[5] & 0x10)) addToKeyboardBuffer(0x2C); /* , */
229    else {KbRepeatTable[0x2C]=0;}
230    if (!controlKey && !shiftKey && !(keyboard[3] & 0x40)) addToKeyboardBuffer(0x2D); /* - */
231    else {KbRepeatTable[0x2D]=0;}
232    if (!controlKey && !shiftKey && !(keyboard[5] & 0x20)) addToKeyboardBuffer(0x2E); /* . */
233    else {KbRepeatTable[0x2E]=0;}
234    if (!controlKey && !shiftKey && !(keyboard[5] & 0x40)) addToKeyboardBuffer(0x2F); /* / */
235    else {KbRepeatTable[0x2F]=0;}
157236
158237    if (!shiftKey && !controlKey && !(keyboard[4] & 0x01)) addToKeyboardBuffer(0x30); /* 0 */
159238    else {KbRepeatTable[0x30]=0;}
r1220r1221
176255    else {KbRepeatTable[0x38]=0;}
177256    if (!shiftKey && !controlKey && !(keyboard[5] & 0x02)) addToKeyboardBuffer(0x39); /* 9 */
178257    else {KbRepeatTable[0x39]=0;}
258    if (shiftKey && !controlKey && !(keyboard[3] & 0x80)) addToKeyboardBuffer(0x3A); /* shiftKey + ; */
259    else {KbRepeatTable[0x3A]=0;}
260    if (!controlKey && !shiftKey && !(keyboard[3] & 0x80)) addToKeyboardBuffer(0x3B); /* ; */
261    else {KbRepeatTable[0x3B]=0;}
262    if (shiftKey && !controlKey && !(keyboard[5] & 0x10)) addToKeyboardBuffer(0x3C); /* shiftKey + , */
263    else {KbRepeatTable[0x3C]=0;}
264    if (shiftKey && !controlKey && !(keyboard[5] & 0x08)) addToKeyboardBuffer(0x3D); /* shiftKey + + */
265    else {KbRepeatTable[0x3D]=0;}
266    if (shiftKey && !controlKey && !(keyboard[5] & 0x20)) addToKeyboardBuffer(0x3E); /* shiftKey + . */
267    else {KbRepeatTable[0x3E]=0;}
268    if (shiftKey && !controlKey && !(keyboard[5] & 0x40)) addToKeyboardBuffer(0x3F); /* shiftKey + / */
269    else {KbRepeatTable[0x3F]=0;}
179270
180    if (controlKey && !shiftKey && !(keyboard[4] & 0x04)) addToKeyboardBuffer(0x00); /* controlKey + 2 */
181    else {KbRepeatTable[0x00]=0;}
182    if (controlKey && !shiftKey && !(keyboard[4] & 0x40)) addToKeyboardBuffer(0x1F); /* controlKey + 6 */
183    else {KbRepeatTable[0x1F]=0;}
184
185
271    if (shiftKey && !controlKey && !(keyboard[4] & 0x04)) addToKeyboardBuffer(0x40); /* shiftKey + 2 */
272    else {KbRepeatTable[0x40]=0;}
186273    if (shiftKey && !controlKey && !(keyboard[0] & 0x02)) addToKeyboardBuffer(0x41); /* shiftKey + A */
187274    else {KbRepeatTable[0x41]=0;}
188275    if (shiftKey && !controlKey && !(keyboard[0] & 0x04)) addToKeyboardBuffer(0x42); /* shiftKey + B */
r1220r1221
238325    else {KbRepeatTable[0x59]=0;}
239326    if (shiftKey && !controlKey && !(keyboard[3] & 0x04)) addToKeyboardBuffer(0x5A); /* shiftKey + Z */
240327    else {KbRepeatTable[0x5A]=0;}
328    if (!controlKey && !shiftKey && !(keyboard[5] & 0x80)) addToKeyboardBuffer(0x5B); /* [ */
329    else {KbRepeatTable[0x5B]=0;}
330    if (!controlKey && !shiftKey && !(keyboard[3] & 0x10)) addToKeyboardBuffer(0x5C); /* \ */
331    else {KbRepeatTable[0x5C]=0;}
332    if (!controlKey && !shiftKey && !(keyboard[3] & 0x08)) addToKeyboardBuffer(0x5D); /* ] */
333    else {KbRepeatTable[0x5D]=0;}
334    if (!controlKey && !shiftKey && !(keyboard[3] & 0x20)) addToKeyboardBuffer(0x5E); /* ^ */
335    else {KbRepeatTable[0x5E]=0;}
336    if (shiftKey && !controlKey && !(keyboard[4] & 0x40)) addToKeyboardBuffer(0x5F); /* shiftKey + 6 */
337    else {KbRepeatTable[0x5F]=0;}
241338
242    if (controlKey && !shiftKey && !(keyboard[0] & 0x02)) addToKeyboardBuffer(0x01); /* controlKey + A */
243    else {KbRepeatTable[0x01]=0;}
244    if (controlKey && !shiftKey && !(keyboard[0] & 0x04)) addToKeyboardBuffer(0x02); /* controlKey + B */
245    else {KbRepeatTable[0x02]=0;}
246    if (controlKey && !shiftKey && !(keyboard[0] & 0x08)) addToKeyboardBuffer(0x03); /* controlKey + C */
247    else {KbRepeatTable[0x03]=0;}
248    if (controlKey && !shiftKey && !(keyboard[0] & 0x10)) addToKeyboardBuffer(0x04); /* controlKey + D */
249    else {KbRepeatTable[0x04]=0;}
250    if (controlKey && !shiftKey && !(keyboard[0] & 0x20)) addToKeyboardBuffer(0x05); /* controlKey + E */
251    else {KbRepeatTable[0x05]=0;}
252    if (controlKey && !shiftKey && !(keyboard[0] & 0x40)) addToKeyboardBuffer(0x06); /* controlKey + F */
253    else {KbRepeatTable[0x06]=0;}
254    if (controlKey && !shiftKey && !(keyboard[0] & 0x80)) addToKeyboardBuffer(0x07); /* controlKey + G */
255    else {KbRepeatTable[0x07]=0;}
256
257    if ((controlKey && !shiftKey && !(keyboard[1] & 0x01)) || !(keyboard[7] & 0x80)) addToKeyboardBuffer(0x08); /* controlKey + H or BACKSPACE */
258    else {KbRepeatTable[0x08]=0;}
259    if ((controlKey && !shiftKey && !(keyboard[1] & 0x02)) || !(keyboard[8] & 0x20)) addToKeyboardBuffer(0x09); /* controlKey + I or TAB */
260    else {KbRepeatTable[0x09]=0;}
261    if (controlKey && !shiftKey && !(keyboard[1] & 0x04)) addToKeyboardBuffer(0x0A); /* controlKey + J */
262    else {KbRepeatTable[0x0A]=0;}
263    if (controlKey && !shiftKey && !(keyboard[1] & 0x08)) addToKeyboardBuffer(0x0B); /* controlKey + K */
264    else {KbRepeatTable[0x0B]=0;}
265    if (controlKey && !shiftKey && !(keyboard[1] & 0x10)) addToKeyboardBuffer(0x0C); /* controlKey + L */
266    else {KbRepeatTable[0x0C]=0;}
267    if ((controlKey && !shiftKey && !(keyboard[1] & 0x20)) || !(keyboard[6] & 0x80)) addToKeyboardBuffer(0x0D); /* controlKey + M or RETURN */
268    else {KbRepeatTable[0x0D]=0;}
269    if (controlKey && !shiftKey && !(keyboard[1] & 0x40)) addToKeyboardBuffer(0x0E); /* controlKey + N */
270    else {KbRepeatTable[0x0E]=0;}
271    if (controlKey && !shiftKey && !(keyboard[1] & 0x80)) addToKeyboardBuffer(0x0F); /* controlKey + O */
272    else {KbRepeatTable[0x0F]=0;}
273   
274    if (controlKey && !shiftKey && !(keyboard[2] & 0x01)) addToKeyboardBuffer(0x10); /* controlKey + P */
275    else {KbRepeatTable[0x10]=0;}
276    if (controlKey && !shiftKey && !(keyboard[2] & 0x02)) addToKeyboardBuffer(0x11); /* controlKey + Q */
277    else {KbRepeatTable[0x11]=0;}
278    if (controlKey && !shiftKey && !(keyboard[2] & 0x04)) addToKeyboardBuffer(0x12); /* controlKey + R */
279    else {KbRepeatTable[0x12]=0;}
280    if (controlKey && !shiftKey && !(keyboard[2] & 0x08)) addToKeyboardBuffer(0x13); /* controlKey + S */
281    else {KbRepeatTable[0x13]=0;}
282    if (controlKey && !shiftKey && !(keyboard[2] & 0x10)) addToKeyboardBuffer(0x14); /* controlKey + T */
283    else {KbRepeatTable[0x14]=0;}
284    if (controlKey && !shiftKey && !(keyboard[2] & 0x20)) addToKeyboardBuffer(0x15); /* controlKey + U */
285    else {KbRepeatTable[0x15]=0;}
286    if (controlKey && !shiftKey && !(keyboard[2] & 0x40)) addToKeyboardBuffer(0x16); /* controlKey + V */
287    else {KbRepeatTable[0x16]=0;}
288    if (controlKey && !shiftKey && !(keyboard[2] & 0x80)) addToKeyboardBuffer(0x17); /* controlKey + W */
289    else {KbRepeatTable[0x17]=0;}
290
291    if (controlKey && !shiftKey && !(keyboard[3] & 0x01)) addToKeyboardBuffer(0x18); /* controlKey + X */
292    else {KbRepeatTable[0x18]=0;}
293    if (controlKey && !shiftKey && !(keyboard[3] & 0x02)) addToKeyboardBuffer(0x19); /* controlKey + Y */
294    else {KbRepeatTable[0x19]=0;}
295    if (controlKey && !shiftKey && !(keyboard[3] & 0x04)) addToKeyboardBuffer(0x1A); /* controlKey + Z */
296    else {KbRepeatTable[0x1A]=0;}
297
339    if (shiftKey && !controlKey && !(keyboard[3] & 0x40)) addToKeyboardBuffer(0x60); /* shiftKey + - */
340    else {KbRepeatTable[0x60]=0;}
298341    if (!controlKey && !shiftKey && !(keyboard[0] & 0x02)) addToKeyboardBuffer(0x61); /* A */
299342    else {KbRepeatTable[0x61]=0;}
300
301343    if (!controlKey && !shiftKey && !(keyboard[0] & 0x04)) addToKeyboardBuffer(0x62); /* B */
302344    else {KbRepeatTable[0x62]=0;}
303345    if (!controlKey && !shiftKey && !(keyboard[0] & 0x08)) addToKeyboardBuffer(0x63); /* C */
r1220r1221
351393    else {KbRepeatTable[0x79]=0;}
352394    if (!controlKey && !shiftKey && !(keyboard[3] & 0x04)) addToKeyboardBuffer(0x7A); /* Z */
353395    else {KbRepeatTable[0x7A]=0;}
354
355
356
357    if (shiftKey && !controlKey && !(keyboard[5] & 0x04)) addToKeyboardBuffer(0x22); /* shiftKey + ' *//****** Not sure ******/
358    else {KbRepeatTable[0x22]=0;}
359    if (shiftKey && !controlKey && !(keyboard[3] & 0x80)) addToKeyboardBuffer(0x3A); /* shiftKey + ; */   
360    else {KbRepeatTable[0x3A]=0;}
361    if (shiftKey && !controlKey && !(keyboard[5] & 0x10)) addToKeyboardBuffer(0x3C); /* shiftKey + , */
362    else {KbRepeatTable[0x3C]=0;}
363    if (shiftKey && !controlKey && !(keyboard[5] & 0x08)) addToKeyboardBuffer(0x3D); /* shiftKey + + */
364    else {KbRepeatTable[0x3D]=0;}
365    if (shiftKey && !controlKey && !(keyboard[5] & 0x20)) addToKeyboardBuffer(0x3E); /* shiftKey + . */
366    else {KbRepeatTable[0x3E]=0;}
367    if (shiftKey && !controlKey && !(keyboard[5] & 0x40)) addToKeyboardBuffer(0x3F); /* shiftKey + / */
368    else {KbRepeatTable[0x3F]=0;}
369
370    if (shiftKey && !controlKey && !(keyboard[3] & 0x40)) addToKeyboardBuffer(0x60); /* shiftKey + - */
371    else {KbRepeatTable[0x60]=0;}
372396    if (shiftKey && !controlKey && !(keyboard[5] & 0x80)) addToKeyboardBuffer(0x7B); /* shiftKey + [ */
373397    else {KbRepeatTable[0x7B]=0;}
374    if (shiftKey && !controlKey && !(keyboard[5] & 0x04)) addToKeyboardBuffer(0x7C); /* shiftKey + \ *//****** Not sure  ******/
398    if (shiftKey && !controlKey && !(keyboard[3] & 0x10)) addToKeyboardBuffer(0x7C); /* shiftKey + \ */
375399    else {KbRepeatTable[0x7C]=0;}
376400    if (shiftKey && !controlKey && !(keyboard[3] & 0x08)) addToKeyboardBuffer(0x7D); /* shiftKey + ] */
377401    else {KbRepeatTable[0x7D]=0;}
378402    if (shiftKey && !controlKey && !(keyboard[3] & 0x20)) addToKeyboardBuffer(0x7E); /* shiftKey + ^ */
379403    else {KbRepeatTable[0x7E]=0;}
380    if (shiftKey && !controlKey && !(keyboard[6] & 0x01)) addToKeyboardBuffer(0x89); /* shiftKey + I */
381    else {KbRepeatTable[0x89]=0;}
382    if (shiftKey && !controlKey && !(keyboard[6] & 0x02)) addToKeyboardBuffer(0x8A); /* shiftKey + II */
383    else {KbRepeatTable[0x8A]=0;}
384    if (shiftKey && !controlKey && !(keyboard[6] & 0x04)) addToKeyboardBuffer(0x8B); /* shiftKey + III */
385    else {KbRepeatTable[0x8B]=0;}
386    if (shiftKey && !controlKey && !(keyboard[6] & 0x08)) addToKeyboardBuffer(0x8C); /* shiftKey + IV */
387    else {KbRepeatTable[0x8C]=0;}
388    if (shiftKey && !controlKey && !(keyboard[6] & 0x10)) addToKeyboardBuffer(0x8D); /* shiftKey + V */
389    else {KbRepeatTable[0x8D]=0;}
390    if (shiftKey && !controlKey && !(keyboard[6] & 0x20)) addToKeyboardBuffer(0x8E); /* shiftKey + VI */
391    else {KbRepeatTable[0x8E]=0;}
392
393    if (shiftKey && !controlKey && !(keyboard[7] & 0x01)) addToKeyboardBuffer(0x98); /* shiftKey + WILD CARD */
394    else {KbRepeatTable[0x98]=0;}
395    if (shiftKey && !controlKey && !(keyboard[7] & 0x02)) addToKeyboardBuffer(0x99); /* shiftKey + UNDO */
396    else {KbRepeatTable[0x99]=0;}
397    if (shiftKey && !controlKey && !(keyboard[7] & 0x04)) addToKeyboardBuffer(0x9A); /* shiftKey + MOVE */
398    else {KbRepeatTable[0x9A]=0;}
399    if (shiftKey && !controlKey && !(keyboard[7] & 0x08)) addToKeyboardBuffer(0x9B); /* shiftKey + STORE */
400    else {KbRepeatTable[0x9B]=0;}
401    if (shiftKey && !controlKey && !(keyboard[7] & 0x10)) addToKeyboardBuffer(0x9C); /* shiftKey + INSERT */
402    else {KbRepeatTable[0x9C]=0;}
403    if (shiftKey && !controlKey && !(keyboard[7] & 0x20)) addToKeyboardBuffer(0x9D); /* shiftKey + PRINT */
404    else {KbRepeatTable[0x9D]=0;}
405    if (shiftKey && !controlKey && !(keyboard[7] & 0x40)) addToKeyboardBuffer(0x9E); /* shiftKey + CLEAR */
406    else {KbRepeatTable[0x9E]=0;}
407    if (shiftKey && !controlKey && !(keyboard[7] & 0x80)) addToKeyboardBuffer(0x9F); /* shiftKey + DELETE */
408    else {KbRepeatTable[0x9F]=0;}
409
410
411
412    if (controlKey && !shiftKey && !(keyboard[8] & 0x02)) addToKeyboardBuffer(0xA4); /* controlKey + UP ARROW */
413    else {KbRepeatTable[0xA4]=0;}
414    if (controlKey && !shiftKey && !(keyboard[8] & 0x10)) addToKeyboardBuffer(0xA5); /* controlKey + RIGHT ARROW */
415    else {KbRepeatTable[0xA5]=0;}
416    if (controlKey && !shiftKey && !(keyboard[8] & 0x04)) addToKeyboardBuffer(0xA6); /* controlKey + DOWN ARROW */
417    else {KbRepeatTable[0xA6]=0;}
418    if (controlKey && !shiftKey && !(keyboard[8] & 0x08)) addToKeyboardBuffer(0xA7); /* controlKey + LEFT ARROW */
419    else {KbRepeatTable[0xA7]=0;}
420
421404    if (controlKey && !shiftKey && !(keyboard[7] & 0x80)) addToKeyboardBuffer(0x7F); /* controlKey + DELETE */
422405    else {KbRepeatTable[0x7F]=0;}
423406
424
425
426
427    if ((controlKey && !shiftKey && !(keyboard[5] & 0x80)) || !(keyboard[0] & 0x01)) addToKeyboardBuffer(0x1B); /* controlKey + [ or WP/ESCAPE */
428    else {KbRepeatTable[0x1B]=0;}
429    if (controlKey && !shiftKey && !(keyboard[5] & 0x04)) addToKeyboardBuffer(0x1C); /* controlKey + \ *//****** Not sure ******/
430    else {KbRepeatTable[0x1C]=0;}
431    if (controlKey && !shiftKey && !(keyboard[3] & 0x08)) addToKeyboardBuffer(0x1D); /* controlKey + ] */
432    else {KbRepeatTable[0x1D]=0;}
433    if (controlKey && !shiftKey && !(keyboard[3] & 0x20)) addToKeyboardBuffer(0x1E); /* controlKey + ^ */
434    else {KbRepeatTable[0x1E]=0;}
435
436   
437    if (!controlKey && !shiftKey && !(keyboard[6] & 0x40)) addToKeyboardBuffer(0x20); /* SPACEBAR */
438    else {KbRepeatTable[0x20]=0;}
439    if (shiftKey && !controlKey && !(keyboard[5] & 0x04)) addToKeyboardBuffer(0x27); /* ' */
440    else {KbRepeatTable[0x27]=0;}
441
442    if (!controlKey && !shiftKey && !(keyboard[5] & 0x08)) addToKeyboardBuffer(0x2B); /* + */
443    else {KbRepeatTable[0x2B]=0;}
444    if (!controlKey && !shiftKey && !(keyboard[5] & 0x10)) addToKeyboardBuffer(0x2C); /* , */
445    else {KbRepeatTable[0x2C]=0;}
446    if (!controlKey && !shiftKey && !(keyboard[3] & 0x40)) addToKeyboardBuffer(0x2D); /* - */
447    else {KbRepeatTable[0x2D]=0;}
448    if (!controlKey && !shiftKey && !(keyboard[5] & 0x20)) addToKeyboardBuffer(0x2E); /* . */
449    else {KbRepeatTable[0x2E]=0;}
450    if (!controlKey && !shiftKey && !(keyboard[5] & 0x40)) addToKeyboardBuffer(0x2F); /* / */
451    else {KbRepeatTable[0x2F]=0;}
452   
453
454    if (!controlKey && !shiftKey && !(keyboard[3] & 0x80)) addToKeyboardBuffer(0x3B); /* ; */
455    else {KbRepeatTable[0x3B]=0;}
456
457
458    if (!controlKey && !shiftKey && !(keyboard[5] & 0x80)) addToKeyboardBuffer(0x5B); /* [ */
459    else {KbRepeatTable[0x5B]=0;}
460    if (!controlKey && !shiftKey && !(keyboard[5] & 0x04)) addToKeyboardBuffer(0x5C); /* \ *//****** Not sure ******/
461    else {KbRepeatTable[0x5C]=0;}
462    if (!controlKey && !shiftKey && !(keyboard[3] & 0x08)) addToKeyboardBuffer(0x5D); /* ] */
463    else {KbRepeatTable[0x5D]=0;}
464    if (!controlKey && !shiftKey && !(keyboard[3] & 0x20)) addToKeyboardBuffer(0x5E); /* ^ */
465    else {KbRepeatTable[0x5E]=0;}
466
467
468407    if (!shiftKey && !(keyboard[8] & 0x01)) addToKeyboardBuffer(0x80); /* HOME */
469408    else {KbRepeatTable[0x80]=0;}
470409    if (!shiftKey && !(keyboard[6] & 0x01)) addToKeyboardBuffer(0x81); /* I */
r1220r1221
479418    else {KbRepeatTable[0x85]=0;}
480419    if (!shiftKey && !(keyboard[6] & 0x20)) addToKeyboardBuffer(0x86); /* VI */
481420    else {KbRepeatTable[0x86]=0;}
421    /* 0x87 - Unused */
482422
423    /* 0x88 - Unused */
424    if (shiftKey && !controlKey && !(keyboard[6] & 0x01)) addToKeyboardBuffer(0x89); /* shiftKey + I */
425    else {KbRepeatTable[0x89]=0;}
426    if (shiftKey && !controlKey && !(keyboard[6] & 0x02)) addToKeyboardBuffer(0x8A); /* shiftKey + II */
427    else {KbRepeatTable[0x8A]=0;}
428    if (shiftKey && !controlKey && !(keyboard[6] & 0x04)) addToKeyboardBuffer(0x8B); /* shiftKey + III */
429    else {KbRepeatTable[0x8B]=0;}
430    if (shiftKey && !controlKey && !(keyboard[6] & 0x08)) addToKeyboardBuffer(0x8C); /* shiftKey + IV */
431    else {KbRepeatTable[0x8C]=0;}
432    if (shiftKey && !controlKey && !(keyboard[6] & 0x10)) addToKeyboardBuffer(0x8D); /* shiftKey + V */
433    else {KbRepeatTable[0x8D]=0;}
434    if (shiftKey && !controlKey && !(keyboard[6] & 0x20)) addToKeyboardBuffer(0x8E); /* shiftKey + VI */
435    else {KbRepeatTable[0x8E]=0;}
436    /* 0x8F - Unused */
437
483438    if (!shiftKey && !(keyboard[7] & 0x01)) addToKeyboardBuffer(0x90); /* WILD CARD */
484439    else {KbRepeatTable[0x90]=0;}
485440    if (!shiftKey && !(keyboard[7] & 0x02)) addToKeyboardBuffer(0x91); /* UNDO */
r1220r1221
496451    else {KbRepeatTable[0x96]=0;}
497452    if (!shiftKey && !(keyboard[7] & 0x80)) addToKeyboardBuffer(0x97); /* DELETE */
498453    else {KbRepeatTable[0x97]=0;}
499   
500454
455    if (shiftKey && !controlKey && !(keyboard[7] & 0x01)) addToKeyboardBuffer(0x98); /* shiftKey + WILD CARD */
456    else {KbRepeatTable[0x98]=0;}
457    if (shiftKey && !controlKey && !(keyboard[7] & 0x02)) addToKeyboardBuffer(0x99); /* shiftKey + UNDO */
458    else {KbRepeatTable[0x99]=0;}
459    if (shiftKey && !controlKey && !(keyboard[7] & 0x04)) addToKeyboardBuffer(0x9A); /* shiftKey + MOVE */
460    else {KbRepeatTable[0x9A]=0;}
461    if (shiftKey && !controlKey && !(keyboard[7] & 0x08)) addToKeyboardBuffer(0x9B); /* shiftKey + STORE */
462    else {KbRepeatTable[0x9B]=0;}
463    if (shiftKey && !controlKey && !(keyboard[7] & 0x10)) addToKeyboardBuffer(0x9C); /* shiftKey + INSERT */
464    else {KbRepeatTable[0x9C]=0;}
465    if (shiftKey && !controlKey && !(keyboard[7] & 0x20)) addToKeyboardBuffer(0x9D); /* shiftKey + PRINT */
466    else {KbRepeatTable[0x9D]=0;}
467    if (shiftKey && !controlKey && !(keyboard[7] & 0x40)) addToKeyboardBuffer(0x9E); /* shiftKey + CLEAR */
468    else {KbRepeatTable[0x9E]=0;}
469    if (shiftKey && !controlKey && !(keyboard[7] & 0x80)) addToKeyboardBuffer(0x9F); /* shiftKey + DELETE */
470    else {KbRepeatTable[0x9F]=0;}
471
501472    if (!controlKey && !(keyboard[8] & 0x02)) addToKeyboardBuffer(0xA0); /* UP ARROW */
502473    else {KbRepeatTable[0xA0]=0;}
503474    if (!controlKey && !(keyboard[8] & 0x10)) addToKeyboardBuffer(0xA1); /* RIGHT ARROW */
r1220r1221
506477    else {KbRepeatTable[0xA2]=0;}
507478    if (!controlKey && !(keyboard[8] & 0x08)) addToKeyboardBuffer(0xA3); /* LEFT ARROW */
508479    else {KbRepeatTable[0xA3]=0;}
480    if (controlKey && !shiftKey && !(keyboard[8] & 0x02)) addToKeyboardBuffer(0xA4); /* controlKey + UP ARROW */
481    else {KbRepeatTable[0xA4]=0;}
482    if (controlKey && !shiftKey && !(keyboard[8] & 0x10)) addToKeyboardBuffer(0xA5); /* controlKey + RIGHT ARROW */
483    else {KbRepeatTable[0xA5]=0;}
484    if (controlKey && !shiftKey && !(keyboard[8] & 0x04)) addToKeyboardBuffer(0xA6); /* controlKey + DOWN ARROW */
485    else {KbRepeatTable[0xA6]=0;}
486    if (controlKey && !shiftKey && !(keyboard[8] & 0x08)) addToKeyboardBuffer(0xA7); /* controlKey + LEFT ARROW */
487    else {KbRepeatTable[0xA7]=0;}
509488
510489    if (!controlKey && !(keyboard[8] & 0x02) && !(keyboard[8] & 0x10)) addToKeyboardBuffer(0xA8); /* UP ARROW + RIGHT ARROW */
511490    else {KbRepeatTable[0xA8]=0;}
r1220r1221
524503    if (!controlKey && !(keyboard[8] & 0x01) && !(keyboard[8] & 0x08)) addToKeyboardBuffer(0xAF); /* HOME + LEFT ARROW */
525504    else {KbRepeatTable[0xAF]=0;}
526505
506    /* 0xB0-0xB7 - Unused */
507
508    if (shiftKey && !controlKey && !(keyboard[9] & 0x02)) addToKeyboardBuffer(0xB8); /* shiftKey + BACKSPACE */
509    else {KbRepeatTable[0xB8]=0;}
510    if (shiftKey && !controlKey && !(keyboard[8] & 0x20)) addToKeyboardBuffer(0xB9); /* shiftKey + TAB */
511    else {KbRepeatTable[0xB9]=0;}
512    /* 0xBA-0xEF - Unused */
513
514    /* 0xF0-0xFF - Reserved for internal use by keyboard software */
527515}
528516
529517void master6801_behaviour(int offset, int data)
r1220r1221
813801 READ8_HANDLER ( adam_paddle_r )
814802{
815803
816    if (!(input_port_6_r(0) & 0x0F)) return (0xFF); /* If no controllers enabled */
804    if (!(readinputportbytag("controllers") & 0x0F)) return (0xFF); /* If no controllers enabled */
817805   /* Player 1 */
818806   if ((offset & 0x02)==0)
819807   {
r1220r1221
822810      {
823811         int inport0,inport1,inport6,data;
824812
825         inport0 = input_port_0_r(0);
826         inport1 = input_port_1_r(0);
827         inport6 = input_port_6_r(0);
813         inport0 = readinputportbytag("controller1_keypad1");
814         inport1 = readinputportbytag("controller1_keypad2");
815         inport6 = readinputportbytag("controllers");
828816         
829817         /* Numeric pad buttons are not independent on a real ColecoVision, if you push more
830818         than one, a real ColecoVision think that it is a third button, so we are going to emulate
831819         the right behaviour */
832820         
833821         data = 0x0F;   /* No key pressed by default */
834         if (!(inport6&0x01)) /* If Driving Controller enabled -> no keypad 1*/
822         if (!(inport6&0x01)) /* If Driving Controller enabled -> no keypad 1 */
835823         {
836824             if (!(inport0 & 0x01)) data &= 0x0A; /* 0 */
837825             if (!(inport0 & 0x02)) data &= 0x0D; /* 1 */
r1220r1221
851839      /* Joystick and fire 2 (SAC Red Button) */
852840      else
853841      {
854         int data = input_port_2_r(0) & 0xCF;
855         int inport6 = input_port_6_r(0);
842         int data = readinputportbytag("controller1_joystick") & 0xCF;
843         int inport6 = readinputportbytag("controllers");
856844         
857845         if (inport6&0x07) /* If Extra Contollers enabled */
858846         {
859847             if (adam_joy_stat[0]==0)
860               data |= 0x30; /* Spinner Move Left*/
848               data |= 0x30; /* Spinner Move Left */
861849             else if (adam_joy_stat[0]==1)
862850               data |= 0x20; /* Spinner Move Right */
863851         } 
r1220r1221
872860      {
873861         int inport3,inport4,data;
874862
875         inport3 = input_port_3_r(0);
876         inport4 = input_port_4_r(0);
863         inport3 = readinputportbytag("controller2_keypad1");
864         inport4 = readinputportbytag("controller2_keypad2");
877865
878866         /* Numeric pad buttons are not independent on a real ColecoVision, if you push more
879867         than one, a real ColecoVision think that it is a third button, so we are going to emulate
r1220r1221
898886      /* Joystick and fire 2*/
899887      else
900888      {
901         int data = input_port_5_r(0) & 0xCF;
902         int inport6 = input_port_6_r(0);
889         int data = readinputportbytag("controller2_joystick") & 0xCF;
890         int inport6 = readinputportbytag("controllers");
903891         
904892         if (inport6&0x02) /* If Roller Controller enabled */
905893         {
src/mess/drivers/adam.c
r1220r1221
183183
184184
185185#include "driver.h"
186#include "inputx.h"
186187#include "sound/sn76496.h"
187188#include "video/tms9928a.h"
188189#include "includes/adam.h"
r1220r1221
221222#endif
222223
223224INPUT_PORTS_START( adam )
224    PORT_START  /* IN0 */
225    PORT_START_TAG( "controller1_keypad1" )  /* IN0 */
226    PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("P1 Keypad 0") PORT_CODE(KEYCODE_0)         PORT_PLAYER(1)
227    PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("P1 Keypad 1") PORT_CODE(KEYCODE_1)         PORT_PLAYER(1)
228    PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_NAME("P1 Keypad 2") PORT_CODE(KEYCODE_2)         PORT_PLAYER(1)
229    PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON8 ) PORT_NAME("P1 Keypad 3") PORT_CODE(KEYCODE_3)         PORT_PLAYER(1)
230    PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON9 ) PORT_NAME("P1 Keypad 4") PORT_CODE(KEYCODE_4)         PORT_PLAYER(1)
231    PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON10) PORT_NAME("P1 Keypad 5") PORT_CODE(KEYCODE_5)         PORT_PLAYER(1)
232    PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON11) PORT_NAME("P1 Keypad 6") PORT_CODE(KEYCODE_6)         PORT_PLAYER(1)
233    PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON12) PORT_NAME("P1 Keypad 7") PORT_CODE(KEYCODE_7)         PORT_PLAYER(1)
225234
226    PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("0 (pad 1)") PORT_CODE(KEYCODE_0)
227    PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("1 (pad 1)") PORT_CODE(KEYCODE_1)
228    PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("2 (pad 1)") PORT_CODE(KEYCODE_2)
229    PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("3 (pad 1)") PORT_CODE(KEYCODE_3)
230    PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("4 (pad 1)") PORT_CODE(KEYCODE_4)
231    PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("5 (pad 1)") PORT_CODE(KEYCODE_5)
232    PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("6 (pad 1)") PORT_CODE(KEYCODE_6)
233    PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("7 (pad 1)") PORT_CODE(KEYCODE_7)
235    PORT_START_TAG( "controller1_keypad2" )  /* IN1 */
236    PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON13) PORT_NAME("P1 Keypad 8") PORT_CODE(KEYCODE_8)         PORT_PLAYER(1)
237    PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON14) PORT_NAME("P1 Keypad 9") PORT_CODE(KEYCODE_9)         PORT_PLAYER(1)
238    PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON15) PORT_NAME("P1 Keypad #") PORT_CODE(KEYCODE_MINUS)     PORT_PLAYER(1)
239    PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON16) PORT_NAME("P1 Keypad *") PORT_CODE(KEYCODE_EQUALS)    PORT_PLAYER(1)
240    PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P1 Button 2 (SAC Red Button)")             PORT_PLAYER(1)
241    PORT_BIT( 0xB0, IP_ACTIVE_LOW, IPT_UNUSED )
242 
243    PORT_START_TAG( "controller1_joystick" )  /* IN2 */
244    PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )                                                   PORT_PLAYER(1) PORT_8WAY
245    PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT )                                                PORT_PLAYER(1) PORT_8WAY
246    PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )                                                 PORT_PLAYER(1) PORT_8WAY
247    PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )                                                 PORT_PLAYER(1) PORT_8WAY
248    PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P1 Button 1 (SAC Yellow Button)")          PORT_PLAYER(1)
249    PORT_BIT( 0xB0, IP_ACTIVE_LOW, IPT_UNUSED )
234250
235    PORT_START  /* IN1 */
236    PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("8 (pad 1)") PORT_CODE(KEYCODE_8)
237    PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("9 (pad 1)") PORT_CODE(KEYCODE_9)
238    PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("# (pad 1)") PORT_CODE(KEYCODE_MINUS)
239    PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(". (pad 1)") PORT_CODE(KEYCODE_EQUALS)
240    PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 )
241    PORT_BIT ( 0xB0, IP_ACTIVE_LOW, IPT_UNKNOWN )
251    PORT_START_TAG( "controller2_keypad1" )  /* IN3 */
252    PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("P2 Keypad 0") PORT_CODE(KEYCODE_0_PAD)     PORT_PLAYER(2)
253    PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("P2 Keypad 1") PORT_CODE(KEYCODE_1_PAD)     PORT_PLAYER(2)
254    PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_NAME("P2 Keypad 2") PORT_CODE(KEYCODE_2_PAD)     PORT_PLAYER(2)
255    PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON8 ) PORT_NAME("P2 Keypad 3") PORT_CODE(KEYCODE_3_PAD)     PORT_PLAYER(2)
256    PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON9 ) PORT_NAME("P2 Keypad 4") PORT_CODE(KEYCODE_4_PAD)     PORT_PLAYER(2)
257    PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON10) PORT_NAME("P2 Keypad 5") PORT_CODE(KEYCODE_5_PAD)     PORT_PLAYER(2)
258    PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON11) PORT_NAME("P2 Keypad 6") PORT_CODE(KEYCODE_6_PAD)     PORT_PLAYER(2)
259    PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON12) PORT_NAME("P2 Keypad 7") PORT_CODE(KEYCODE_7_PAD)     PORT_PLAYER(2)
242260
243    PORT_START  /* IN2 */
244    PORT_BIT ( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )
245    PORT_BIT ( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT )
246    PORT_BIT ( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )
247    PORT_BIT ( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )
248    PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 )
249    PORT_BIT ( 0xB0, IP_ACTIVE_LOW, IPT_UNKNOWN )
261    PORT_START_TAG( "controller2_keypad2" )  /* IN4 */
262    PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON13) PORT_NAME("P2 Keypad 8") PORT_CODE(KEYCODE_8_PAD)     PORT_PLAYER(2)
263    PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON14) PORT_NAME("P2 Keypad 9") PORT_CODE(KEYCODE_9_PAD)     PORT_PLAYER(2)
264    PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON15) PORT_NAME("P2 Keypad #") PORT_CODE(KEYCODE_MINUS_PAD) PORT_PLAYER(2)
265    PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON16) PORT_NAME("P2 Keypad *") PORT_CODE(KEYCODE_PLUS_PAD)  PORT_PLAYER(2)
266    PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2)  PORT_NAME("P2 Button 2 (SAC Red Button)")             PORT_PLAYER(2)
267    PORT_BIT( 0xB0, IP_ACTIVE_LOW, IPT_UNKNOWN )
250268
251    PORT_START  /* IN3 */
252    PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("0 (pad 2)") PORT_CODE(KEYCODE_0_PAD)
253    PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("1 (pad 2)") PORT_CODE(KEYCODE_1_PAD)
254    PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("2 (pad 2)") PORT_CODE(KEYCODE_2_PAD)
255    PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("3 (pad 2)") PORT_CODE(KEYCODE_3_PAD)
256    PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("4 (pad 2)") PORT_CODE(KEYCODE_4_PAD)
257    PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("5 (pad 2)") PORT_CODE(KEYCODE_5_PAD)
258    PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("6 (pad 2)") PORT_CODE(KEYCODE_6_PAD)
259    PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("7 (pad 2)") PORT_CODE(KEYCODE_7_PAD)
269    PORT_START_TAG( "controller2_joystick" )  /* IN5 */
270    PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP)                                                    PORT_PLAYER(2) PORT_8WAY
271    PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT)                                                 PORT_PLAYER(2) PORT_8WAY
272    PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN)                                                  PORT_PLAYER(2) PORT_8WAY
273    PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT)                                                  PORT_PLAYER(2) PORT_8WAY
274    PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1) PORT_NAME("P2 Button 1 (SAC Yellow Button)")           PORT_PLAYER(2)
275    PORT_BIT( 0xB0, IP_ACTIVE_LOW, IPT_UNUSED )
260276
261    PORT_START  /* IN4 */
262    PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("8 (pad 2)") PORT_CODE(KEYCODE_8_PAD)
263    PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("9 (pad 2)") PORT_CODE(KEYCODE_9_PAD)
264    PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("# (pad 2)") PORT_CODE(KEYCODE_MINUS_PAD)
265    PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(". (pad 2)") PORT_CODE(KEYCODE_PLUS_PAD)
266    PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2) PORT_PLAYER(2)
267    PORT_BIT ( 0xB0, IP_ACTIVE_LOW, IPT_UNKNOWN )
277    PORT_START_TAG( "controllers" ) /* IN6 */
278    PORT_CONFNAME(0x0F, 0x00, "Controllers")
279    PORT_CONFSETTING(0x00, DEF_STR( None ) )
280    PORT_CONFSETTING(0x01, "Driving Controller" )
281    PORT_CONFSETTING(0x02, "Roller Controller" )
282    PORT_CONFSETTING(0x04, "Super Action Controllers" )
283    PORT_CONFSETTING(0x08, "Standard Controllers" )
268284
269    PORT_START  /* IN5 */
270    PORT_BIT ( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP) PORT_PLAYER(2)
271    PORT_BIT ( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT) PORT_PLAYER(2)
272    PORT_BIT ( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN) PORT_PLAYER(2)
273    PORT_BIT ( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT) PORT_PLAYER(2)
274    PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1) PORT_PLAYER(2)
275    PORT_BIT ( 0xB0, IP_ACTIVE_LOW, IPT_UNKNOWN )
285    PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON3) PORT_NAME("P1 SAC Blue Button")   PORT_CODE(KEYCODE_Z) PORT_PLAYER(1)
286    PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON4) PORT_NAME("P1 SAC Purple Button") PORT_CODE(KEYCODE_X) PORT_PLAYER(1)
287    PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3) PORT_NAME("P2 SAC Blue Button")   PORT_CODE(KEYCODE_Q) PORT_PLAYER(2)
288    PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON4) PORT_NAME("P2 SAC Purple Button") PORT_CODE(KEYCODE_W) PORT_PLAYER(2)
276289
277    PORT_START /* IN6 */
278    PORT_DIPNAME(0x0F, 0x00, "Controllers")
279    PORT_DIPSETTING(0x00, DEF_STR( None ) )
280    PORT_DIPSETTING(0x01, "Driving Controller" )
281    PORT_DIPSETTING(0x02, "Roller Controller" )
282    PORT_DIPSETTING(0x04, "Super Action Controllers" )
283    PORT_DIPSETTING(0x08, "Standard Controllers" )
290    PORT_START_TAG( "controller1_analog" ) /* IN7, to emulate Extra Controls (Driving Controller, SAC P1 slider, Roller Controller X Axis) */
291    PORT_BIT( 0x0f, 0x00, IPT_TRACKBALL_X) \
292              PORT_SENSITIVITY(20) \
293              PORT_KEYDELTA(10) \
294              PORT_CODE_DEC(KEYCODE_J) \
295              PORT_CODE_INC(KEYCODE_L) \
296              PORT_PLAYER(1) \
297              PORT_RESET
284298
285    PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON3) PORT_NAME("SAC Blue Button P1") PORT_CODE(KEYCODE_Z)
286    PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON4) PORT_NAME("SAC Purple Button P1") PORT_CODE(KEYCODE_X)
287    PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3) PORT_NAME("SAC Blue Button P2") PORT_CODE(KEYCODE_Q) PORT_PLAYER(2)
288    PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON4) PORT_NAME("SAC Purple Button P2") PORT_CODE(KEYCODE_W) PORT_PLAYER(2)
299    PORT_START_TAG( "controller2_analog" ) /* IN8, to emulate Extra Controls (SAC P2 slider, Roller Controller Y Axis) */
300    PORT_BIT( 0x0f, 0x00, IPT_TRACKBALL_X) \
301              PORT_SENSITIVITY(20) \
302              PORT_KEYDELTA(10) \
303              PORT_CODE_DEC(KEYCODE_I) \
304              PORT_CODE_INC(KEYCODE_K) \
305              PORT_PLAYER(2) \
306              PORT_RESET
289307
290    PORT_START   /* IN7, to emulate Extra Controls (Driving Controller, SAC P1 slider, Roller Controller X Axis) */
291    PORT_BIT( 0x0f, 0x00, IPT_TRACKBALL_X) PORT_SENSITIVITY(20) PORT_KEYDELTA(10) PORT_CODE_DEC(KEYCODE_L) PORT_CODE_INC(KEYCODE_J) PORT_RESET
292
293    PORT_START   /* IN8, to emulate Extra Controls (SAC P2 slider, Roller Controller Y Axis) */
294    PORT_BIT( 0x0f, 0x00, IPT_TRACKBALL_Y) PORT_SENSITIVITY(20) PORT_KEYDELTA(10) PORT_CODE_DEC(KEYCODE_I) PORT_CODE_INC(KEYCODE_K) PORT_PLAYER(2) PORT_RESET
295
296
297/* Keyboard with 75 Keys */
308/* Keyboard with 75 Keys - TODO: Discover if the keys are actually organized this way on real hardware */
298309   
299   PORT_START /* IN9 0*/
300   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("WP/ESCAPE") PORT_CODE(KEYCODE_ESC)
301   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("A") PORT_CODE(KEYCODE_A)
302   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("B") PORT_CODE(KEYCODE_B)
303   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("C") PORT_CODE(KEYCODE_C)
304   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("D") PORT_CODE(KEYCODE_D)
305   PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("E") PORT_CODE(KEYCODE_E)
306   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F") PORT_CODE(KEYCODE_F)
307   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G") PORT_CODE(KEYCODE_G)
310   PORT_START_TAG("keyboard_1") /* IN9 0*/
311   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Escape/WP")    PORT_CODE(KEYCODE_ESC)        PORT_CHAR(27)
312   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_A)          PORT_CHAR('a') PORT_CHAR('A')
313   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_B)          PORT_CHAR('b') PORT_CHAR('B')
314   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_C)          PORT_CHAR('c') PORT_CHAR('C')
315   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_D)          PORT_CHAR('d') PORT_CHAR('D')
316   PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_E)          PORT_CHAR('e') PORT_CHAR('E')
317   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_F)          PORT_CHAR('f') PORT_CHAR('F')
318   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_G)          PORT_CHAR('g') PORT_CHAR('G')
308319
309   PORT_START /* IN10 1*/
310   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("H") PORT_CODE(KEYCODE_H)
311   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("I") PORT_CODE(KEYCODE_I)
312   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("J") PORT_CODE(KEYCODE_J)
313   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("K") PORT_CODE(KEYCODE_K)
314   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("L") PORT_CODE(KEYCODE_L)
315   PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("M") PORT_CODE(KEYCODE_M)
316   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("N") PORT_CODE(KEYCODE_N)
317   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("O") PORT_CODE(KEYCODE_O)
320   PORT_START_TAG("keyboard_2") /* IN10 1*/
321   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_H)          PORT_CHAR('h') PORT_CHAR('H') PORT_CHAR(8)
322   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_I)          PORT_CHAR('i') PORT_CHAR('I') PORT_CHAR(9)
323   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_J)          PORT_CHAR('j') PORT_CHAR('J')
324   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_K)          PORT_CHAR('k') PORT_CHAR('K')
325   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_L)          PORT_CHAR('l') PORT_CHAR('L')
326   PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("m M Return")   PORT_CODE(KEYCODE_M)          PORT_CHAR('m') PORT_CHAR('M') PORT_CHAR(13)
327   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_N)          PORT_CHAR('n') PORT_CHAR('N')
328   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_O)          PORT_CHAR('o') PORT_CHAR('O')
318329
319   PORT_START /* IN11 2*/
320   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("P") PORT_CODE(KEYCODE_P)
321   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Q") PORT_CODE(KEYCODE_Q)
322   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("R") PORT_CODE(KEYCODE_R)
323   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("S") PORT_CODE(KEYCODE_S)
324   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("T") PORT_CODE(KEYCODE_T)
325   PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("U") PORT_CODE(KEYCODE_U)
326   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("V") PORT_CODE(KEYCODE_V)
327   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("W") PORT_CODE(KEYCODE_W)
330   PORT_START_TAG("keyboard_3") /* IN11 2*/
331   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_P)          PORT_CHAR('p') PORT_CHAR('P')
332   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_Q)          PORT_CHAR('q') PORT_CHAR('Q')
333   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_R)          PORT_CHAR('r') PORT_CHAR('R')
334   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_S)          PORT_CHAR('s') PORT_CHAR('S')
335   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_T)          PORT_CHAR('t') PORT_CHAR('T')
336   PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_U)          PORT_CHAR('u') PORT_CHAR('U')
337   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_V)          PORT_CHAR('v') PORT_CHAR('V')
338   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_W)          PORT_CHAR('w') PORT_CHAR('W')
328339
329   PORT_START /* IN12 3*/
330   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("X") PORT_CODE(KEYCODE_X)
331   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Y") PORT_CODE(KEYCODE_Y)
332   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Z") PORT_CODE(KEYCODE_Z)
333   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("] }") PORT_CODE(KEYCODE_CLOSEBRACE)
334   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("\\ |") PORT_CODE(KEYCODE_BACKSLASH)
335   PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("^ ~") PORT_CODE(KEYCODE_TILDE)
336   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("- `") PORT_CODE(KEYCODE_MINUS)
337   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("; :") PORT_CODE(KEYCODE_COLON)
340   PORT_START_TAG("keyboard_4") /* IN12 3*/
341   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_X)          PORT_CHAR('x') PORT_CHAR('X')
342   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_Y)          PORT_CHAR('y') PORT_CHAR('Y')
343   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_Z)          PORT_CHAR('z') PORT_CHAR('Z')
344   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR(']') PORT_CHAR('}')
345   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_BACKSLASH)  PORT_CHAR('\\') PORT_CHAR('|')
346   PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_TILDE)      PORT_CHAR('^') PORT_CHAR('~')
347   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_MINUS)      PORT_CHAR('-') PORT_CHAR('`')
348   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_COLON)      PORT_CHAR(';') PORT_CHAR(':')
338349
339   PORT_START /* IN13 4*/
340   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("0 )") PORT_CODE(KEYCODE_0)
341   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("1 !") PORT_CODE(KEYCODE_1)
342   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("2 @") PORT_CODE(KEYCODE_2)
343   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("3 #") PORT_CODE(KEYCODE_3)
344   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("4 $") PORT_CODE(KEYCODE_4)
345   PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("5 %") PORT_CODE(KEYCODE_5)
346   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("6 _") PORT_CODE(KEYCODE_6)
347   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("7 &") PORT_CODE(KEYCODE_7)
350   PORT_START_TAG("keyboard_5") /* IN13 4*/
351   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_0)          PORT_CHAR('0') PORT_CHAR(')')
352   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_1)          PORT_CHAR('1') PORT_CHAR('!')
353   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_2)          PORT_CHAR('2') PORT_CHAR('@')
354   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_3)          PORT_CHAR('3') PORT_CHAR('#')
355   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_4)          PORT_CHAR('4') PORT_CHAR('$')
356   PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_5)          PORT_CHAR('5') PORT_CHAR('%')
357   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_6)          PORT_CHAR('6') PORT_CHAR('_')
358   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_7)          PORT_CHAR('7') PORT_CHAR('&')
348359
349   PORT_START /* IN14 5*/
350   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("8 *") PORT_CODE(KEYCODE_8)
351   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("9 (") PORT_CODE(KEYCODE_9)
352   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("' \"") PORT_CODE(KEYCODE_QUOTE)
353   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("+ =") PORT_CODE(KEYCODE_EQUALS)
354   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(", <") PORT_CODE(KEYCODE_COMMA)
355   PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(". >") PORT_CODE(KEYCODE_STOP)
356   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("/ ?") PORT_CODE(KEYCODE_SLASH)
357   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("[ {") PORT_CODE(KEYCODE_OPENBRACE)
360   PORT_START_TAG("keyboard_6") /* IN14 5*/
361   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_8)          PORT_CHAR('8') PORT_CHAR('*')
362   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_9)          PORT_CHAR('9') PORT_CHAR('(')
363   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_QUOTE)      PORT_CHAR('\'') PORT_CHAR('\"')
364   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_EQUALS)     PORT_CHAR('+') PORT_CHAR('=')
365   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_COMMA)      PORT_CHAR(',') PORT_CHAR('<')
366   PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_STOP)       PORT_CHAR('.') PORT_CHAR('>')
367   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_SLASH)      PORT_CHAR('/') PORT_CHAR('?')
368   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_OPENBRACE)  PORT_CHAR('[') PORT_CHAR('{')
358369   
359   PORT_START /* IN15 6*/
360   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("SoftKey I") PORT_CODE(KEYCODE_F1)
361   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("SoftKey II") PORT_CODE(KEYCODE_F2)
362   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("SoftKey III") PORT_CODE(KEYCODE_F3)
363   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("SoftKey IV") PORT_CODE(KEYCODE_F4)
364   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("SoftKey V") PORT_CODE(KEYCODE_F5)
365   PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("SoftKey VI") PORT_CODE(KEYCODE_F6)
366   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("SPACE") PORT_CODE(KEYCODE_SPACE)
367   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("RETURN") PORT_CODE(KEYCODE_ENTER)
370   PORT_START_TAG("keyboard_7") /* IN15 6*/
371   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("\xE2\x85\xA0") PORT_CODE(KEYCODE_F1)         PORT_CHAR(UCHAR_MAMEKEY(F1))
372   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("\xE2\x85\xA1") PORT_CODE(KEYCODE_F2)         PORT_CHAR(UCHAR_MAMEKEY(F2))
373   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("\xE2\x85\xA2") PORT_CODE(KEYCODE_F3)         PORT_CHAR(UCHAR_MAMEKEY(F3))
374   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("\xE2\x85\xA3") PORT_CODE(KEYCODE_F4)         PORT_CHAR(UCHAR_MAMEKEY(F4))
375   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("\xE2\x85\xA4") PORT_CODE(KEYCODE_F5)         PORT_CHAR(UCHAR_MAMEKEY(F5))
376   PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("\xE2\x85\xA5") PORT_CODE(KEYCODE_F6)         PORT_CHAR(UCHAR_MAMEKEY(F6))
377   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Space")        PORT_CODE(KEYCODE_SPACE)      PORT_CHAR(32)
378   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Return")       PORT_CODE(KEYCODE_ENTER)      PORT_CHAR(13)
368379
369   PORT_START /* IN16 7*/
370   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("WILD CARD") PORT_CODE(KEYCODE_F7)
371   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("UNDO") PORT_CODE(KEYCODE_F8)
372   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("MOVE") PORT_CODE(KEYCODE_HOME)
373   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("STORE") PORT_CODE(KEYCODE_END)
374   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("INSERT") PORT_CODE(KEYCODE_INSERT)
375   PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("PRINT") PORT_CODE(KEYCODE_PRTSCR)
376   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("CLEAR") PORT_CODE(KEYCODE_DEL)
377   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("DELETE") PORT_CODE(KEYCODE_BACKSPACE)
380   PORT_START_TAG("keyboard_8") /* IN16 7*/
381   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Wild Card")    PORT_CODE(KEYCODE_F7)         PORT_CHAR(UCHAR_MAMEKEY(F7))
382   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Undo")         PORT_CODE(KEYCODE_F8)         PORT_CHAR(UCHAR_MAMEKEY(F8))
383   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Move/Copy")    PORT_CODE(KEYCODE_PGUP)       PORT_CHAR(UCHAR_MAMEKEY(PGUP))
384   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Store/Get")    PORT_CODE(KEYCODE_PGDN)       PORT_CHAR(UCHAR_MAMEKEY(PGDN))
385   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Insert")       PORT_CODE(KEYCODE_INSERT)     PORT_CHAR(UCHAR_MAMEKEY(INSERT))
386   PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Print")        PORT_CODE(KEYCODE_PRTSCR)     PORT_CHAR(UCHAR_MAMEKEY(PRTSCR))
387   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Clear")        PORT_CODE(KEYCODE_DEL_PAD)    PORT_CHAR(UCHAR_MAMEKEY(DEL_PAD))
388   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Delete")       PORT_CODE(KEYCODE_DEL)        PORT_CHAR(UCHAR_MAMEKEY(DEL))
378389
379   PORT_START /* IN17 8*/
380   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("HOME") PORT_CODE(KEYCODE_5_PAD)
381   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("UP ARROW") PORT_CODE(KEYCODE_UP)
382   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("DOWN ARROW") PORT_CODE(KEYCODE_DOWN)
383   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("LEFT ARROW") PORT_CODE(KEYCODE_LEFT)
384   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("RIGHT ARROW") PORT_CODE(KEYCODE_RIGHT)
385   PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("TAB") PORT_CODE(KEYCODE_TAB)
386   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("LSHIFT") PORT_CODE(KEYCODE_LSHIFT)
387   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("RSHIFT") PORT_CODE(KEYCODE_RSHIFT)
390   PORT_START_TAG("keyboard_9") /* IN17 8*/
391   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Home")         PORT_CODE(KEYCODE_HOME)       PORT_CHAR(UCHAR_MAMEKEY(HOME))
392   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("\xE2\x87\xA7") PORT_CODE(KEYCODE_UP)         PORT_CHAR(UCHAR_MAMEKEY(UP))
393   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("\xE2\x87\xA9") PORT_CODE(KEYCODE_DOWN)       PORT_CHAR(UCHAR_MAMEKEY(DOWN))
394   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("\xE2\x87\xA6") PORT_CODE(KEYCODE_LEFT)       PORT_CHAR(UCHAR_MAMEKEY(LEFT))
395   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("\xE2\x87\xA8") PORT_CODE(KEYCODE_RIGHT)      PORT_CHAR(UCHAR_MAMEKEY(RIGHT))
396   PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Tab")          PORT_CODE(KEYCODE_TAB)        PORT_CHAR(UCHAR_MAMEKEY(TAB))
397   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Left Shift")   PORT_CODE(KEYCODE_LSHIFT)     PORT_CHAR(UCHAR_SHIFT_1)
398   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Right Shift")  PORT_CODE(KEYCODE_RSHIFT)     PORT_CHAR(UCHAR_SHIFT_1)
388399   
389   PORT_START /* IN18 9*/
390   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("LCONTROL") PORT_CODE(KEYCODE_LCONTROL)
391   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("RCONTROL") PORT_CODE(KEYCODE_RCONTROL)
392   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("SHIFT LOCK") PORT_CODE(KEYCODE_CAPSLOCK) PORT_TOGGLE
393   PORT_BIT (0xF8, IP_ACTIVE_LOW, IPT_UNKNOWN )
400   PORT_START_TAG("keyboard_10") /* IN18 9*/
401   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Control")      PORT_CODE(KEYCODE_LCONTROL)   PORT_CHAR(UCHAR_SHIFT_2)
402   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Backspace")    PORT_CODE(KEYCODE_BACKSPACE)  PORT_CHAR(8)
403   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Lock")         PORT_CODE(KEYCODE_CAPSLOCK)   PORT_CHAR(UCHAR_MAMEKEY(CAPSLOCK)) PORT_TOGGLE
404   PORT_BIT(0xF8, IP_ACTIVE_LOW, IPT_UNUSED )
394405   
395406INPUT_PORTS_END
396407
r1220r1221
428439
429440static TIMER_CALLBACK(adam_paddle_callback)
430441{
431   int port7 = input_port_7_r (0);
432   int port8 = input_port_8_r (0);
442   int port7 = readinputportbytag("controller1_analog");
443   int port8 = readinputportbytag("controller2_analog");
433444
434445   if (port7 == 0)
435446      adam_joy_stat[0] = 0;
r1220r1221
713724***************************************************************************/
714725
715726/*    YEAR  NAME    PARENT   COMPAT   MACHINE INPUT   INIT   CONFIG   COMPANY FULLNAME */
716COMP( 1982, adam,   0,      coleco,   adam,   adam,   0,      adam,   "Adam", "ColecoAdam" , 0)
727COMP( 1982, adam,   0,      coleco,   adam,   adam,   0,      adam,   "Coleco", "Adam" , 0)
717728
docs/messnew.txt
r1220r1221
1111
1212System Driver Changes:
1313----------------------
14- [ADAM] Input ports cleanup, natural keyboard support.  [Stefano Priore]
15
1416- [COCO] Updated to use MAME's 6242 RTC implementation.  [tim lindner]
1517
1618- [COCO] Modified the CoCo's keyboard handler to pass along the tri-state

Previous 15994 Revisions Next


© 1998-2018 The MESS Team