src/mess/machine/coco.c
| r6207 | r6208 | |
| 1364 | 1364 | UINT8 pia0_pb; |
| 1365 | 1365 | UINT8 dac = pia6821_get_output_a(state->pia_1) & 0xfc; |
| 1366 | 1366 | UINT8 hires = input_port_read_safe(machine, "hires_intf", 0x00); |
| 1367 | | int joystick_axis, joystick, joy_mask, joy_shift, ctrl, hires_val, ccm3_val; |
| 1367 | int joystick_axis, joystick, joy_mask, joy_shift, ctrl, hires_val, cc3m_val; |
| 1368 | 1368 | |
| 1369 | 1369 | static const char *const portnames[2][4][2] = |
| 1370 | 1370 | { |
| r6207 | r6208 | |
| 1386 | 1386 | |
| 1387 | 1387 | /* is any Hi-Res Interface turned on? prepare masks to check it */ |
| 1388 | 1388 | hires_val = joystick ? 0x03 : 0x01; |
| 1389 | | ccm3_val = joystick ? 0x04 : 0x02; |
| 1389 | cc3m_val = joystick ? 0x04 : 0x02; |
| 1390 | 1390 | |
| 1391 | 1391 | /* poll keyboard keys */ |
| 1392 | 1392 | if ((input_port_read(machine, "row0") | pia0_pb) != 0xff) porta &= ~0x01; |
| r6207 | r6208 | |
| 1408 | 1408 | switch (ctrl) |
| 1409 | 1409 | { |
| 1410 | 1410 | case 0x01: /* Joystick */ |
| 1411 | | if (hires == hires_val || hires == ccm3_val) |
| 1411 | if (hires == hires_val || hires == cc3m_val) |
| 1412 | 1412 | { |
| 1413 | 1413 | /* Hi-Res Joystick or Hi-Res CoCo3Max Joystick */ |
| 1414 | 1414 | if (joystick_axis ? coco_hiresjoy_ry(machine) : coco_hiresjoy_rx(machine)) |
| r6207 | r6208 | |
| 1616 | 1616 | (*update_keyboard)(device->machine); |
| 1617 | 1617 | |
| 1618 | 1618 | /* Hi-Res Joystick (either in Left or in Right Port) writes here */ |
| 1619 | | if ((ctrl & 0x0f) == 0x04 && hires == 0x01) |
| 1619 | if ((ctrl & 0x0f) == 0x01 && hires == 0x01) |
| 1620 | 1620 | coco_hiresjoy_w(device->machine, dac >= 0x80, 0); |
| 1621 | | else if ((ctrl & 0xf0) == 0x40 && hires == 0x03) |
| 1621 | else if ((ctrl & 0xf0) == 0x10 && hires == 0x03) |
| 1622 | 1622 | coco_hiresjoy_w(device->machine, dac >= 0x80, 1); |
| 1623 | 1623 | |
| 1624 | 1624 | /* Handle printer output, serial for CoCos, parallel for Dragons */ |