src/mess/machine/coco.c
| r1167 | r1168 | |
| 1227 | 1227 | |
| 1228 | 1228 | static UINT8 coco_update_keyboard(void) |
| 1229 | 1229 | { |
| 1230 | | UINT8 porta = 0x7F; |
| 1230 | UINT8 porta = 0x7F, port_za = 0x7f; |
| 1231 | 1231 | int joyval; |
| 1232 | 1232 | static const int joy_rat_table[] = {15, 24, 42, 33 }; |
| 1233 | 1233 | static const int dclg_table[] = {0, 14, 30, 49 }; |
| r1167 | r1168 | |
| 1248 | 1248 | if ((input_port_5_r(0) | pia0_pb) != 0xff) porta &= ~0x20; |
| 1249 | 1249 | if ((input_port_6_r(0) | pia0_pb) != 0xff) porta &= ~0x40; |
| 1250 | 1250 | |
| 1251 | if ((input_port_0_r(0) | pia_get_port_b_z_mask(0)) != 0xff) port_za &= ~0x01; |
| 1252 | if ((input_port_1_r(0) | pia_get_port_b_z_mask(0)) != 0xff) port_za &= ~0x02; |
| 1253 | if ((input_port_2_r(0) | pia_get_port_b_z_mask(0)) != 0xff) port_za &= ~0x04; |
| 1254 | if ((input_port_3_r(0) | pia_get_port_b_z_mask(0)) != 0xff) port_za &= ~0x08; |
| 1255 | if ((input_port_4_r(0) | pia_get_port_b_z_mask(0)) != 0xff) port_za &= ~0x10; |
| 1256 | if ((input_port_5_r(0) | pia_get_port_b_z_mask(0)) != 0xff) port_za &= ~0x20; |
| 1257 | if ((input_port_6_r(0) | pia_get_port_b_z_mask(0)) != 0xff) port_za &= ~0x40; |
| 1258 | |
| 1251 | 1259 | switch(get_input_device(joystick ? INPUTPORT_LEFT_JOYSTICK : INPUTPORT_RIGHT_JOYSTICK)) |
| 1252 | 1260 | { |
| 1253 | 1261 | case INPUTDEVICE_RIGHT_JOYSTICK: |
| r1167 | r1168 | |
| 1315 | 1323 | |
| 1316 | 1324 | /* sample joystick buttons */ |
| 1317 | 1325 | porta &= ~readinputportbytag_safe("joystick_buttons", 0); |
| 1326 | port_za &= ~readinputportbytag_safe("joystick_buttons", 0); |
| 1318 | 1327 | |
| 1319 | | pia_set_input_a(0, porta, 0); |
| 1328 | pia_set_input_a(0, porta, port_za); |
| 1320 | 1329 | return porta; |
| 1321 | 1330 | } |
| 1322 | 1331 | |