Previous 15994 Revisions Next

r1590 Thursday 24th January, 2008 at 00:17:28 UTC by Nathan Woods
1. [GENEVE] Fixed memory mapping error that would cause an emulated crash on
reset. [Michael Zapf]

2. [TI99] Fixed Mechatronic Mouse axis swapping. (bug #966) [Miachel Zapf]
[docs]messnew.txt
[src/mess/machine]geneve.c ti99_4x.c

src/mess/machine/geneve.c
r1589r1590
610610
611611   offset &= 0x1fff;
612612
613   /* Although we could have 128K boot ROM (page f0...ff), the stock
614      Geneve only has 16K. The address is incompletely decoded, so page
615      f0 is mirrored on all even pages up to fe, and f1 is mirrored on
616      f3, f5, ... ff.
617      Currently, MESS is delivered with the 16K ROM only. So for the time
618      being, we won't lose much if we mask the page bits.
619      Michael Zapf, 2008-01-23
620   */
621   if (page > 0xf1) page &= 0xf1;
622   
613623   switch (page)
614624   {
615625   case 0xf0:
r1589r1590
897907
898908   offset &= 0x1fff;
899909
910   /* ROM is incompletely decoded. Pages f0, f2, f4 ... fe all map to the
911      first 8K Boot ROM; f1, ..., ff to the second 8K. See above. */
912   if (page > 0xf1) page &= 0xf1;
913     
900914   switch (page)
901915   {
902916   case 0xf0:
src/mess/machine/ti99_4x.c
r1589r1590
19941994#pragma mark MECHATRONICS MOUSE
19951995#endif
19961996
1997static void mecmouse_select(int sel)
1997static void mecmouse_select(int selnow, int stick1, int stick2)
19981998{
1999   if (mecmouse_sel != (sel != 0))
2000   {
2001      mecmouse_sel = (sel != 0);
2002      if (mecmouse_sel)
2003      {
1999   /* The Mechatronic mouse is connected to the joystick port and occupies
2000      both joystick select lines and the switch lines. From these five
2001      lines, left/right/down are used for the motion (i.e. 3 motion steps
2002      for positive and four for negative motion and one for rest),
2003      the fire line is used for the secondary mouse button, and the up
2004      line is used for the primary button.
2005      The mouse motion is delivered by the same lines for both directions;
2006      this requires swapping the axes. According to the source code of
2007      the accompanying mouse driver, the readout of the current axis is
2008      done by selecting joystick 1, then joystick 2. The axis swapping is
2009      achieved by selecting stick 1 again. When selecting stick 2, the
2010      second axis is seen on the input lines.
2011      Interrupting this sequence will lead to swapped axes. This is
2012      prevented by resetting the toggle when the mouse is deselected
2013      (neither 1 nor 2 are selected).
2014
2015      The joystick lines are selected as follows:
2016      TI-99/4:  Stick 1: P4=1, P3=0, P2=1 (5)
2017                Stick 2: P4=1, P3=1, P2=0 (6)
2018     
2019      TI-99/4A: Stick 1: P4=1, P3=1, P2=0 (6)
2020                Stick 2: P4=1, P3=1, P2=1 (7)
2021
2022      TI-99/8:  Stick 1: P3=1, P2=1, P1=1, P0=0 (14)
2023                Stick 2: P3=1, P2=1, P1=1, P0=1 (15)
2024           
2025      Geneve: n/a, has own mouse handling via v9938
2026     
2027      As we can only deliver at max 3 steps positive and 4 steps negative,
2028      we split the delta so that subsequent queries add up to the actual
2029      delta. That is, one delta of +10 yields a 3+3+3+1.
2030     
2031      mecmouse_x holds the current delta to be counted down for x
2032      (y accordingly)
2033
2034      mecmouse_x_buf is the current step count reported to CRU
2035     
2036      Michael Zapf, 2008-01-22
2037   */
2038   
2039   if (selnow==stick2) {
2040      if (mecmouse_sel==stick1) {
20042041         if (! mecmouse_read_y)
20052042         {
2006            /* sample mouse data for both axes */
2043            /* Sample x motion. */
20072044            if (mecmouse_x < -4)
20082045               mecmouse_x_buf = -4;
20092046            else if (mecmouse_x > 3)
r1589r1590
20122049               mecmouse_x_buf = mecmouse_x;
20132050            mecmouse_x -= mecmouse_x_buf;
20142051            mecmouse_x_buf = (mecmouse_x_buf-1) & 7;
2015
2052         }
2053         else
2054         {
2055            /* Sample y motion. */
20162056            if (mecmouse_y < -4)
20172057               mecmouse_y_buf = -4;
20182058            else if (mecmouse_y > 3)
r1589r1590
20232063            mecmouse_y_buf = (mecmouse_y_buf-1) & 7;
20242064         }
20252065      }
2026      else
2066      mecmouse_sel = selnow;
2067   }
2068   else if (selnow==stick1)
2069   {
2070      if (mecmouse_sel==stick2)
2071      {
2072         /* Swap the axes. */
20272073         mecmouse_read_y = ! mecmouse_read_y;
2074      }
2075      mecmouse_sel = selnow;
20282076   }
2077   else
2078   {
2079      /* Reset the axis toggle when the mouse is deselected */
2080      mecmouse_read_y = 0;
2081   }
20292082}
20302083
20312084static void mecmouse_poll(void)
r1589r1590
20392092
20402093   /* compute x delta */
20412094   delta_x = new_mx - last_mx;
2042
2095   
20432096   /* check for wrap */
20442097   if (delta_x > 0x80)
2045      delta_x = 0x100-delta_x;
2098      delta_x = -0x100+delta_x;
20462099   if  (delta_x < -0x80)
2047      delta_x = -0x100-delta_x;
2100      delta_x = 0x100+delta_x;
20482101
2102   /* Prevent unplausible values at startup. */
2103   if (delta_x > 100 || delta_x<-100) delta_x = 0;
2104
20492105   last_mx = new_mx;
20502106
20512107   /* compute y delta */
r1589r1590
20532109
20542110   /* check for wrap */
20552111   if (delta_y > 0x80)
2056      delta_y = 0x100-delta_y;
2112      delta_y = -0x100+delta_y;
20572113   if  (delta_y < -0x80)
2058      delta_y = -0x100-delta_y;
2114      delta_y = 0x100+delta_y;
20592115
2116   if (delta_y > 100 || delta_y<-100) delta_y = 0;
2117
20602118   last_my = new_my;
20612119
20622120   /* update state */
r1589r1590
20642122   mecmouse_y += delta_y;
20652123}
20662124
2067
20682125/*===========================================================================*/
20692126#if 0
20702127#pragma mark -
r1589r1590
22582315      KeyCol |= 1 << (offset-2);
22592316   else
22602317      KeyCol &= ~ (1 << (offset-2));
2261
2262   if (has_mecmouse)
2263      mecmouse_select(KeyCol == ((ti99_model == model_99_4) ? 6 : 7));
2318   
2319        if (has_mecmouse)
2320                mecmouse_select(KeyCol, (ti99_model == model_99_4) ? 5 : 6,
2321               (ti99_model == model_99_4) ? 6 : 7);
22642322}
22652323
22662324/*
r1589r1590
23482406      KeyCol &= ~ (1 << offset);
23492407
23502408   if (has_mecmouse)
2351      mecmouse_select(KeyCol == 15);
2409      mecmouse_select(KeyCol, 14, 15);
23522410}
23532411
23542412static void ti99_8_WCRUS(int offset, int data)
docs/messnew.txt
r1589r1590
2020
2121- [GBPOCKET] Fixed video startup state to match that of a real unit.  [Wilbert
2222  Pol]
23 
24- [GENEVE] Fixed memory mapping error that would cause an emulated crash on
25  reset.  [Michael Zapf]
2326
2427- [MTX] Rewrote keyboard emulation, added natural keyboard support and started
2528  to cleanup the driver.  [Dirk Best]
r1589r1590
3639
3740- [ORIC] Fixed tape loading.  (bug #241) [Wilbert Pol]
3841
42- [TI99] Fixed Mechatronic Mouse axis swapping.  (bug #966)  [Miachel Zapf]
43
3944- [TI99/GENEVE] More floppy cleanups; fixed TI99_8 regression and made the
4045  floppy drive usable.  (bug #1450)  [Michael Zapf]
4146

Previous 15994 Revisions Next


© 1998-2018 The MESS Team