[Coco] Webpage Update - Hires Mouse

Nick Marentes nickma at optusnet.com.au
Thu Oct 29 04:14:22 EDT 2015


The new mouse driver is certainly cycle-sensitive as Art stated.

It samples the area between two DAC positions. The change from one DAC 
position to the next happens very fast but we manage to obtain 5 samples 
during that transition period and another 5 in the opposite. The minimum 
timing we obtain with a stock 6809 is 4 cycles from the moment we set 
the second DAC point. Oversampling is timed to the clock cycle and the 
routine needs full access during that time to get the most accurate 
reads possible.

So, interrupts do need to be turned off. It may work under Nitros9 
without but you may get "mouse jiggle" due to the interrupts. That's 
what interrupts do, they interrupt the current flow of processing.

So turn off interrupt first and you should be fine.

Oh, and the current code is designed for 6809 timings. Putting a 6309 
into the 6309 timings mode may add post processing errors unless the 
sample weights are re-adjusted.

The code presented is also not relocatable so it would need to be 
modified to suit Nitros9's requirements. This is not impossible, it's 
just that RS-DOS apps have fixed loading points normally.

So, it's quite possible but as Art said, it will need a bit more work to 
make it Nitros-9 friendly.

Note also, that this routine, with all the post processing happening, is 
faster than the hardware hires mouse driver method. It too ideally wants 
the IRQ's off to obtains the most accurate results to avoid "mouse jitter".

Nick

On 29/10/2015 2:27 PM, Arthur Flexser wrote:
> Bill, I think you might be underestimating the difficulty of adapting the
> new joystick routine to NOS9.  As I see it, the problem is not so much
> getting it to run under NOS9, which you seem to be focusing on.  The
> problem is doing so without affecting the accuracy of the joystick
> reading.  After reading Nick's description at
> http://www.members.optusnet.com.au/nickma/ProjectArchive/hires.html
> I have the impression that the coding is quite cycle-sensitive.  As I
> understand it, you need to get a reading exactly 4 cycles after you set a
> new DAC voltage value. To accomplish this, at the least, you'd need to
> disable interrupt servicing during joystick reading, which I hope doesn't
> mess up too much stuff going on in other processes, particularly with
> respect to communications.  (Note the ORCC #$50 as the first instruction of
> the source Nick has posted.)  Also, rewriting the code to make it
> position-independent may play havoc with critical cycle counts.
>
> I'm certainly no authority on NOS9, but it strikes me that there may be
> significant problems involved that you haven't considered.
>
> Art





More information about the Coco mailing list