src/mess/machine/pc_joy.c
| r14748 | r14749 | |
| 16 | 16 | |
| 17 | 17 | READ8_HANDLER ( pc_JOY_r ) |
| 18 | 18 | { |
| 19 | | UINT8 data = 0; |
| 19 | UINT8 data = 0xf; |
| 20 | 20 | int delta; |
| 21 | 21 | attotime new_time = space->machine().time(); |
| 22 | 22 | const input_port_config *joystick_port = space->machine().m_portlist.find("pc_joy"); |
| 23 | delta = ((new_time - JOY_time) * 256 * 1000).seconds; |
| 23 | 24 | |
| 24 | 25 | if (joystick_port != NULL) |
| 25 | 26 | { |
| r14748 | r14749 | |
| 32 | 33 | //} |
| 33 | 34 | //else |
| 34 | 35 | { |
| 35 | | delta = ((new_time - JOY_time) * 256 * 1000).seconds; |
| 36 | 36 | if (input_port_read(space->machine(), "pc_joy_1") < delta) data &= ~0x01; |
| 37 | 37 | if (input_port_read(space->machine(), "pc_joy_2") < delta) data &= ~0x02; |
| 38 | 38 | if (input_port_read(space->machine(), "pc_joy_3") < delta) data &= ~0x04; |
| 39 | 39 | if (input_port_read(space->machine(), "pc_joy_4") < delta) data &= ~0x08; |
| 40 | 40 | } |
| 41 | 41 | } |
| 42 | else |
| 43 | { |
| 44 | data = 0xf0; |
| 45 | // TODO: find decay rate with no joystick connected |
| 46 | } |
| 42 | 47 | return data; |
| 43 | 48 | } |
| 44 | 49 | |