Previous 15994 Revisions Next

r6208 Wednesday 28th October, 2009 at 20:15:33 UTC by Fabio Priuli
[COCO] I think this should fix the Tandy HiRes interface for good.
[src/mess/machine]coco.c

src/mess/machine/coco.c
r6207r6208
13641364   UINT8 pia0_pb;
13651365   UINT8 dac = pia6821_get_output_a(state->pia_1) & 0xfc;
13661366   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;
13681368
13691369   static const char *const portnames[2][4][2] =
13701370         {
r6207r6208
13861386
13871387   /* is any Hi-Res Interface turned on? prepare masks to check it */
13881388   hires_val = joystick ? 0x03 : 0x01;
1389   ccm3_val = joystick ? 0x04 : 0x02;
1389   cc3m_val = joystick ? 0x04 : 0x02;
13901390
13911391   /* poll keyboard keys */
13921392   if ((input_port_read(machine, "row0") | pia0_pb) != 0xff) porta &= ~0x01;
r6207r6208
14081408   switch (ctrl)
14091409   {
14101410      case 0x01: /* Joystick */
1411         if (hires == hires_val || hires == ccm3_val)
1411         if (hires == hires_val || hires == cc3m_val)
14121412         {
14131413            /* Hi-Res Joystick or Hi-Res CoCo3Max Joystick */
14141414            if (joystick_axis ? coco_hiresjoy_ry(machine) : coco_hiresjoy_rx(machine))
r6207r6208
16161616   (*update_keyboard)(device->machine);
16171617
16181618   /* 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)
16201620      coco_hiresjoy_w(device->machine, dac >= 0x80, 0);
1621   else if ((ctrl & 0xf0) == 0x40 && hires == 0x03)
1621   else if ((ctrl & 0xf0) == 0x10 && hires == 0x03)
16221622      coco_hiresjoy_w(device->machine, dac >= 0x80, 1);
16231623
16241624   /* Handle printer output, serial for CoCos, parallel for Dragons */

Previous 15994 Revisions Next


© 1998-2018 The MESS Team