trunk/src/mess/machine/coco.c
| r18692 | r18693 | |
| 292 | 292 | |
| 293 | 293 | |
| 294 | 294 | //------------------------------------------------- |
| 295 | // pia0_pa_w |
| 296 | //------------------------------------------------- |
| 297 | |
| 298 | WRITE8_MEMBER( coco_state::pia0_pa_w ) |
| 299 | { |
| 300 | poll_keyboard(); |
| 301 | } |
| 302 | |
| 303 | |
| 304 | |
| 305 | //------------------------------------------------- |
| 295 | 306 | // pia0_pb_w |
| 296 | 307 | //------------------------------------------------- |
| 297 | 308 | |
| r18692 | r18693 | |
| 360 | 371 | DEVCB_NULL, /* CB1 input */ |
| 361 | 372 | DEVCB_NULL, /* CA2 input */ |
| 362 | 373 | DEVCB_NULL, /* CB2 input */ |
| 363 | | DEVCB_NULL, /* port A output */ |
| 374 | DEVCB_DRIVER_MEMBER(coco_state, pia0_pa_w), /* port A output */ |
| 364 | 375 | DEVCB_DRIVER_MEMBER(coco_state, pia0_pb_w), /* port B output */ |
| 365 | 376 | DEVCB_DRIVER_LINE_MEMBER(coco_state, pia0_ca2_w), /* CA2 output */ |
| 366 | 377 | DEVCB_DRIVER_LINE_MEMBER(coco_state, pia0_cb2_w), /* CB2 output */ |
| r18692 | r18693 | |
| 777 | 788 | { |
| 778 | 789 | /* hi-res joystick or hi-res CoCo3Max joystick */ |
| 779 | 790 | attotime remaining = m_hiresjoy_transition_timer[joystick_axis]->remaining(); |
| 780 | | joyin_value = remaining < attotime::zero; |
| 791 | joyin_value = remaining.is_zero() || remaining.is_never(); |
| 781 | 792 | } |
| 782 | 793 | else |
| 783 | 794 | { |
| r18692 | r18693 | |
| 854 | 865 | } |
| 855 | 866 | } |
| 856 | 867 | |
| 868 | /* hires joystick */ |
| 869 | poll_hires_joystick(); |
| 870 | |
| 857 | 871 | /* poll the joystick (*/ |
| 858 | 872 | bool joyin; |
| 859 | 873 | UINT8 buttons; |
| r18692 | r18693 | |
| 868 | 882 | |
| 869 | 883 | /* and write the result to PIA0 */ |
| 870 | 884 | update_keyboard_input(pia0_pa, pia0_pa_z); |
| 871 | | |
| 872 | | /* hires joystick */ |
| 873 | | poll_hires_joystick(); |
| 874 | 885 | } |
| 875 | 886 | |
| 876 | 887 | |
| r18692 | r18693 | |
| 1060 | 1071 | switch(hires_interface_type()) |
| 1061 | 1072 | { |
| 1062 | 1073 | case HIRES_RIGHT: |
| 1063 | | newvalue = (m_pia_0->a_output() & 0x04); |
| 1074 | newvalue = (dac_output() >= 0x20); |
| 1064 | 1075 | joystick_index = 0; |
| 1065 | 1076 | is_cocomax3 = false; |
| 1066 | 1077 | break; |
| 1067 | 1078 | |
| 1068 | 1079 | case HIRES_RIGHT_COCOMAX3: |
| 1069 | | newvalue = (dac_output() >= 0x20); |
| 1080 | newvalue = (m_pia_0->a_output() & 0x04); |
| 1070 | 1081 | joystick_index = 0; |
| 1071 | 1082 | is_cocomax3 = true; |
| 1072 | 1083 | break; |
| 1073 | 1084 | |
| 1074 | 1085 | case HIRES_LEFT: |
| 1075 | | newvalue = (m_pia_0->a_output() & 0x08); |
| 1086 | newvalue = (dac_output() >= 0x20); |
| 1076 | 1087 | joystick_index = 1; |
| 1077 | 1088 | is_cocomax3 = false; |
| 1078 | 1089 | break; |
| 1079 | 1090 | |
| 1080 | 1091 | case HIRES_LEFT_COCOMAX3: |
| 1081 | | newvalue = (dac_output() >= 0x20); |
| 1092 | newvalue = (m_pia_0->a_output() & 0x08); |
| 1082 | 1093 | joystick_index = 1; |
| 1083 | 1094 | is_cocomax3 = true; |
| 1084 | 1095 | break; |
| r18692 | r18693 | |
| 1102 | 1113 | double value = m_joystick.input(joystick_index, axis) / 255.0; |
| 1103 | 1114 | value *= is_cocomax3 ? 2500.0 : 4160.0; |
| 1104 | 1115 | value += is_cocomax3 ? 400.0 : 592.0; |
| 1105 | | attotime duration = m_maincpu->clocks_to_attotime((UINT64) value); |
| 1116 | attotime duration = m_maincpu->clocks_to_attotime((UINT64) value) * 8; |
| 1106 | 1117 | m_hiresjoy_transition_timer[axis]->adjust(duration); |
| 1107 | 1118 | } |
| 1108 | 1119 | else if (!m_hiresjoy_ca && newvalue) |