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