Previous 199869 Revisions Next

r18693 Wednesday 24th October, 2012 at 19:44:58 UTC by Sandro Ronco
(MESS) Fixed coco Hi-Res joystick (MT #05030)
[src/mess/includes]coco.h
[src/mess/machine]coco.c

trunk/src/mess/machine/coco.c
r18692r18693
292292
293293
294294//-------------------------------------------------
295//  pia0_pa_w
296//-------------------------------------------------
297
298WRITE8_MEMBER( coco_state::pia0_pa_w )
299{
300   poll_keyboard();
301}
302
303
304
305//-------------------------------------------------
295306//  pia0_pb_w
296307//-------------------------------------------------
297308
r18692r18693
360371   DEVCB_NULL,                                       /* CB1 input */
361372   DEVCB_NULL,                                       /* CA2 input */
362373   DEVCB_NULL,                                       /* CB2 input */
363   DEVCB_NULL,                                     /* port A output */
374   DEVCB_DRIVER_MEMBER(coco_state, pia0_pa_w),               /* port A output */
364375   DEVCB_DRIVER_MEMBER(coco_state, pia0_pb_w),               /* port B output */
365376   DEVCB_DRIVER_LINE_MEMBER(coco_state, pia0_ca2_w),         /* CA2 output */
366377   DEVCB_DRIVER_LINE_MEMBER(coco_state, pia0_cb2_w),         /* CB2 output */
r18692r18693
777788         {
778789            /* hi-res joystick or hi-res CoCo3Max joystick */
779790            attotime remaining = m_hiresjoy_transition_timer[joystick_axis]->remaining();
780            joyin_value = remaining < attotime::zero;
791            joyin_value = remaining.is_zero() || remaining.is_never();
781792         }
782793         else
783794         {
r18692r18693
854865      }
855866   }
856867
868   /* hires joystick */
869   poll_hires_joystick();
870
857871   /* poll the joystick (*/
858872   bool joyin;
859873   UINT8 buttons;
r18692r18693
868882
869883   /* and write the result to PIA0 */
870884   update_keyboard_input(pia0_pa, pia0_pa_z);
871
872   /* hires joystick */
873   poll_hires_joystick();
874885}
875886
876887
r18692r18693
10601071   switch(hires_interface_type())
10611072   {
10621073      case HIRES_RIGHT:
1063         newvalue = (m_pia_0->a_output() & 0x04);
1074         newvalue = (dac_output() >= 0x20);
10641075         joystick_index = 0;
10651076         is_cocomax3 = false;
10661077         break;
10671078
10681079      case HIRES_RIGHT_COCOMAX3:
1069         newvalue = (dac_output() >= 0x20);
1080         newvalue = (m_pia_0->a_output() & 0x04);
10701081         joystick_index = 0;
10711082         is_cocomax3 = true;
10721083         break;
10731084
10741085      case HIRES_LEFT:
1075         newvalue = (m_pia_0->a_output() & 0x08);
1086         newvalue = (dac_output() >= 0x20);
10761087         joystick_index = 1;
10771088         is_cocomax3 = false;
10781089         break;
10791090
10801091      case HIRES_LEFT_COCOMAX3:
1081         newvalue = (dac_output() >= 0x20);
1092         newvalue = (m_pia_0->a_output() & 0x08);
10821093         joystick_index = 1;
10831094         is_cocomax3 = true;
10841095         break;
r18692r18693
11021113         double value = m_joystick.input(joystick_index, axis) / 255.0;
11031114         value *= is_cocomax3 ? 2500.0 : 4160.0;
11041115         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;
11061117         m_hiresjoy_transition_timer[axis]->adjust(duration);
11071118      }
11081119      else if (!m_hiresjoy_ca && newvalue)
trunk/src/mess/includes/coco.h
r18692r18693
157157   virtual void update_cart_base(UINT8 *cart_base) = 0;
158158
159159   /* PIA0 */
160   DECLARE_WRITE8_MEMBER( pia0_pa_w );
160161   DECLARE_WRITE8_MEMBER( pia0_pb_w );
161162   DECLARE_WRITE_LINE_MEMBER( pia0_ca2_w );
162163   DECLARE_WRITE_LINE_MEMBER( pia0_cb2_w );

Previous 199869 Revisions Next


© 1997-2024 The MAME Team