src/mess/drivers/pc6001.c
| r8711 | r8712 | |
| 622 | 622 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY |
| 623 | 623 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY |
| 624 | 624 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) |
| 625 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 625 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) |
| 626 | 626 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 627 | 627 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 628 | 628 | |
| r8711 | r8712 | |
| 632 | 632 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) |
| 633 | 633 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) |
| 634 | 634 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) |
| 635 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 635 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) |
| 636 | 636 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 637 | 637 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 638 | 638 | |
| r8711 | r8712 | |
| 863 | 863 | |
| 864 | 864 | static UINT8 check_joy_press(running_machine *machine) |
| 865 | 865 | { |
| 866 | | /* check joycode */ |
| 867 | | { |
| 868 | | UINT8 p1_key = input_port_read(machine,"P1") ^ 0xff; |
| 866 | UINT8 p1_key = input_port_read(machine,"P1") ^ 0xff; |
| 867 | static UINT8 joy_press; |
| 869 | 868 | |
| 870 | | popmessage("%02x",p1_key); |
| 871 | | |
| 872 | 869 | /* |
| 873 | 870 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY |
| 874 | 871 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY |
| r8711 | r8712 | |
| 880 | 877 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 881 | 878 | */ |
| 882 | 879 | |
| 883 | | if(p1_key & 0x01) return 0x64; //up |
| 884 | | if(p1_key & 0x02) return 0x68; //down |
| 885 | | if(p1_key & 0x04) return 0x60; //left |
| 886 | | if(p1_key & 0x08) return 0x70; //right |
| 887 | | if(p1_key & 0x10) return 0x80; //fire |
| 880 | joy_press = 0; |
| 881 | |
| 882 | switch(p1_key & 0xf) |
| 883 | { |
| 884 | case 0x01: joy_press = 0x04; break; //up |
| 885 | case 0x02: joy_press = 0x08; break; //down |
| 886 | case 0x04: joy_press = 0x20; break; |
| 887 | case 0x05: joy_press = 0x24; break; //up-left |
| 888 | case 0x06: joy_press = 0x28; break; //down-left |
| 889 | case 0x08: joy_press = 0x10; break; //right |
| 890 | case 0x09: joy_press = 0x14; break; //up-right |
| 891 | case 0x0a: joy_press = 0x18; break;//down-right |
| 888 | 892 | } |
| 889 | 893 | |
| 890 | | return 0; |
| 894 | if(p1_key & 0x10) { joy_press |= 0x80; } //button 1 (space?) |
| 895 | if(p1_key & 0x20) { joy_press |= 0x01; } //button 2 (shift) |
| 896 | |
| 897 | return joy_press; |
| 891 | 898 | } |
| 892 | 899 | |
| 893 | 900 | static TIMER_CALLBACK(cassette_callback) |