Re: [cc65] Joystick support

Date view Thread view Subject view

From: Ullrich von Bassewitz (uz_at_musoftware.de)
Date: 2002-12-23 19:30:28


Hi!

On Mon, Dec 23, 2002 at 03:24:46AM +0100, Groepaz wrote:
> with 4 controllers connected like this i would really like to have a common
> joy_poll() routine here which should be called once before calls to
> joy_read()...this routine can simply do nothing for drivers that dont need
> it. (most drivers would probably benefit from it though, however)

I don't like the idea of polluting the API just to handle this special
hardware feature. What I do not like is that all programs would have to call
joy_poll just to make the program work with one special controller.

My suggestion would be to poll all joysticks when joy_read is called for the
first joystick and document this somewhere. So the values for the other
joysticks would be saved somewhere and joy_read just returns the in memory
value. To make it super safe, you can also check the clock and do a poll even
for other joysticks than the first one if the last call is older than 2 ticks
or so. This solution does not add a burden for programs that don't care about
this joystick.

Regards


        Uz


-- 
Ullrich von Bassewitz                                  uz_at_musoftware.de
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo_at_musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.


Date view Thread view Subject view

This archive was generated by hypermail 2.1.3 : 2002-12-23 19:30:35 CET