src/mess/layout/px4.lay
| r4231 | r4232 | |
| 1 | 1 | <?xml version="1.0"?> |
| 2 | 2 | <mamelayout version="2"> |
| 3 | <element name="background"> |
| 4 | </element> |
| 5 | <element name="led" defstate="0"> |
| 6 | <rect state="0"> |
| 7 | <color red="0" green="0.2" blue="0" /> |
| 8 | </rect> |
| 9 | <rect state="1"> |
| 10 | <color red="0" green="0.8" blue="0" /> |
| 11 | </rect> |
| 12 | </element> |
| 3 | 13 | <view name="LCD with square pixels"> |
| 14 | <bezel element="background"> |
| 15 | <bounds x="0" y="0" width="68" height="16" /> |
| 16 | </bezel> |
| 4 | 17 | <screen index="0"> |
| 5 | | <bounds left="0" top="0" right="15" bottom="4" /> |
| 18 | <bounds left="0" top="0" right="60" bottom="16" /> |
| 6 | 19 | </screen> |
| 20 | <bezel name="led_0" element="led"> |
| 21 | <bounds x="62" y="1" width="4" height="1" /> |
| 22 | </bezel> |
| 23 | <bezel name="led_1" element="led"> |
| 24 | <bounds x="62" y="3" width="4" height="1" /> |
| 25 | </bezel> |
| 26 | <bezel name="led_2" element="led"> |
| 27 | <bounds x="62" y="5" width="4" height="1" /> |
| 28 | </bezel> |
| 7 | 29 | </view> |
| 8 | 30 | </mamelayout> |
src/mess/drivers/px4.c
| r4231 | r4232 | |
| 300 | 300 | px4->sior = 0xc1 | px4->interrupt_status; |
| 301 | 301 | px4->interrupt_status = 0x00; |
| 302 | 302 | } |
| 303 | | else if (px4->key_status != 0x00) |
| 303 | else if (px4->key_status != 0xff) |
| 304 | 304 | { |
| 305 | 305 | px4->sior = px4->key_status; |
| 306 | | px4->key_status = 0x00; |
| 306 | px4->key_status = 0xff; |
| 307 | 307 | } |
| 308 | 308 | else |
| 309 | 309 | { |
| r4231 | r4232 | |
| 483 | 483 | static WRITE8_HANDLER( px4_ioctlr_w ) |
| 484 | 484 | { |
| 485 | 485 | logerror("%s: px4_ioctlr_w (0x%02x)\n", cpuexec_describe_context(space->machine), data); |
| 486 | |
| 487 | output_set_value("led_0", BIT(data, 4)); /* caps lock */ |
| 488 | output_set_value("led_1", BIT(data, 5)); /* num lock */ |
| 489 | output_set_value("led_2", BIT(data, 6)); |
| 486 | 490 | } |
| 487 | 491 | |
| 488 | 492 | |
| r4231 | r4232 | |
| 510 | 514 | px4_state *px4 = field->port->machine->driver_data; |
| 511 | 515 | UINT32 oldvalue = oldval * field->mask, newvalue = newval * field->mask; |
| 512 | 516 | UINT32 delta = oldvalue ^ newvalue; |
| 513 | | int i, scancode = 0, down = 0; |
| 517 | int i, scancode = 0xff, down = 0; |
| 514 | 518 | |
| 515 | 519 | for (i = 0; i < 32; i++) |
| 516 | 520 | { |
| 517 | 521 | if (delta & (1 << i)) |
| 518 | 522 | { |
| 519 | | down = (newvalue & (1 << i)) ? 0x00 : 0x10; |
| 523 | down = (newvalue & (1 << i)) ? 0x10 : 0x00; |
| 520 | 524 | scancode = (int)param * 32 + i; |
| 521 | 525 | |
| 522 | 526 | /* control keys */ |
| 523 | | if (scancode >= 0xa0) |
| 527 | if ((scancode & 0xa0) == 0xa0) |
| 524 | 528 | scancode |= down; |
| 525 | 529 | |
| 526 | 530 | logerror("upd7508: key callback, key=0x%02x\n", scancode); |
| r4231 | r4232 | |
| 529 | 533 | } |
| 530 | 534 | } |
| 531 | 535 | |
| 532 | | if (down || scancode >= 0xa0) |
| 536 | if (down || (scancode & 0xa0) == 0xa0) |
| 533 | 537 | { |
| 534 | 538 | px4->key_status = scancode; |
| 535 | 539 | |