home *** CD-ROM | disk | FTP | other *** search
/ Falcon 030 Power 2 / F030_POWER2.iso / ST_STE / MAGS / ICTARI09.ARJ / ictari.09 / ASSEMBLY / MOUSPROB.ANS / MOUSE2.DOC < prev    next >
Text File  |  1994-04-14  |  3KB  |  54 lines

  1.  
  2.     About MOUSE2.S, MOUSE2.TOS & MOUSE2.DOC (this!)
  3.  
  4.     Hi MIC, I'm Si(gh) [aka  PoshPaws]  and  I'm teaching myself to correct
  5.     assembler!
  6.  
  7.     Lesson 1 - Don't believe all  you  read  in  books - they have too many
  8.     errors and omissions to be anything more than a rough guide!
  9.  
  10.     Lesson 2 - The ST  always  has  at  least  three  correct ways of doing
  11.     anything! (and usually two or three incorrect ways as well).
  12.  
  13.     Your understanding of the  IKBD  is  pretty  good.  It  talks through a
  14.     MC6850 ACIA which interrupts  through  the  68901  MFP  chip at level 6
  15.     (internal to this chip) and the 68901  interrupts the 68000 at level 6.
  16.     All of which is irrelevant (just as well really!).
  17.  
  18.     Your understanding of the mouse  packet  routine  is fine, but note the
  19.     following:-
  20.  
  21.     The OS points a0 (and the longword  on  the  stack) to the start of the
  22.     data packet. It not only requires  the  routine  to end with an RTS but
  23.     requires all used registers to be  saved  at  the start and restored at
  24.     the end of the routine. Also 1ms is a LONG time in instructions - about
  25.     500-1000!
  26.  
  27.     Now down to the Nitty Gritty...
  28.  
  29.     Your theory is what lets you down. Interrupts can happen at Anytime!
  30.     This means that  just  saving  the  packets  is  not  good  enough; the
  31.     interrupt will  just  overwrite  the  last  packet  with  the  new one,
  32.     regardless of whether or not you  have  processed the old one. Clearing
  33.     the packet after processing it only  compounds  the problem; you may be
  34.     clearing a packet that isn't the one you have been working on. What you
  35.     need to do is to add the new packet's  x & y data to any old ones still
  36.     not processed. When you take  out  the  value,  you need to subtract it
  37.     from the unprocessed data (in  case  the  interrupt has added new since
  38.     you took the old value out and before you cleared it) and then carry on
  39.     as normal.
  40.  
  41.     The source code has  been  modified  (with  comments)  - most are picky
  42.     things, but there are some explanations  of  use in there as well. Note
  43.     that adding  negative  numbers  is  the  same  as  subtracting positive
  44.     numbers.
  45.  
  46.     Lastly, Why are you not using  the  LINE-A variables for monitoring the
  47.     mouse positions? I have enclosed a routine for this in Mouse3. It would
  48.     certainly be a lot easier,  although,  as  usual  with Atari, its mouse
  49.     packet handler is not the fastest of routines!
  50.  
  51.     Any comments on my comments are most welcome,
  52.  
  53.                              Si(gh).
  54.