src/mess/drivers/x1.c
| r5599 | r5600 | |
| 359 | 359 | * |
| 360 | 360 | *************************************/ |
| 361 | 361 | |
| 362 | | static UINT8 sub_cmd,key_flag; |
| 362 | static UINT8 sub_cmd;//,key_flag; |
| 363 | 363 | static UINT8 sub_cmd_length; |
| 364 | 364 | static UINT8 sub_val[4]; |
| 365 | 365 | |
| r5599 | r5600 | |
| 446 | 446 | if(key3 & 0x00000008) ret |= 0x01; // C |
| 447 | 447 | break; |
| 448 | 448 | case 1: |
| 449 | | if(pad & 0x00000040) ret |= 0x80; // Tenkey 7 |
| 450 | | if(pad & 0x00000008) ret |= 0x40; // Tenkey 4 |
| 451 | | if(pad & 0x00000001) ret |= 0x20; // Tenkey 1 |
| 452 | | if(pad & 0x00000080) ret |= 0x10; // Tenkey 8 |
| 453 | | if(pad & 0x00000002) ret |= 0x08; // Tenkey 2 |
| 454 | | if(pad & 0x00000100) ret |= 0x04; // Tenkey 9 |
| 455 | | if(pad & 0x00000020) ret |= 0x02; // Tenkey 6 |
| 456 | | if(pad & 0x00000004) ret |= 0x01; // Tenkey 3 |
| 449 | if(pad & 0x00000080) ret |= 0x80; // Tenkey 7 |
| 450 | if(pad & 0x00000010) ret |= 0x40; // Tenkey 4 |
| 451 | if(pad & 0x00000002) ret |= 0x20; // Tenkey 1 |
| 452 | if(pad & 0x00000100) ret |= 0x10; // Tenkey 8 |
| 453 | if(pad & 0x00000004) ret |= 0x08; // Tenkey 2 |
| 454 | if(pad & 0x00000200) ret |= 0x04; // Tenkey 9 |
| 455 | if(pad & 0x00000040) ret |= 0x02; // Tenkey 6 |
| 456 | if(pad & 0x00000008) ret |= 0x01; // Tenkey 3 |
| 457 | 457 | break; |
| 458 | 458 | case 2: |
| 459 | 459 | if(key1 & 0x10000000) ret |= 0x80; // ESC |
| r5599 | r5600 | |
| 1637 | 1637 | static TIMER_CALLBACK(keyboard_callback) |
| 1638 | 1638 | { |
| 1639 | 1639 | const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); |
| 1640 | | UINT8 key_press; |
| 1641 | | static UINT8 old_key_val; |
| 1640 | UINT32 key1 = input_port_read(machine,"key1"); |
| 1641 | UINT32 key2 = input_port_read(machine,"key2"); |
| 1642 | UINT32 key3 = input_port_read(machine,"key3"); |
| 1643 | UINT32 key4 = input_port_read(machine,"tenkey"); |
| 1644 | static UINT32 old_key1,old_key2,old_key3,old_key4; |
| 1642 | 1645 | |
| 1643 | 1646 | if(key_irq_vector) |
| 1644 | 1647 | { |
| 1645 | | key_press = check_keyboard_press(machine); |
| 1646 | | if(key_press && key_press != old_key_val) |
| 1648 | if((key1 != old_key1) || (key2 != old_key2) || (key3 != old_key3) || (key4 != old_key4)) |
| 1647 | 1649 | { |
| 1648 | | old_key_val = key_press; |
| 1650 | // generate keyboard IRQ |
| 1649 | 1651 | sub_io_w(space,0,0xe6); |
| 1650 | | cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE); |
| 1651 | | } |
| 1652 | | else |
| 1653 | | { |
| 1654 | | old_key_val = key_press; |
| 1655 | | key_flag = 0; |
| 1656 | | } |
| 1652 | cputag_set_input_line(machine,"maincpu",0,ASSERT_LINE); |
| 1653 | old_key1 = key1; |
| 1654 | old_key2 = key2; |
| 1655 | old_key3 = key3; |
| 1656 | old_key4 = key4; |
| 1657 | } |
| 1657 | 1658 | } |
| 1658 | 1659 | } |
| 1659 | 1660 | |