Re: [cc65] Joystick support

Date view Thread view Subject view

From: Groepaz (groepaz_at_gmx.net)
Date: 2002-12-24 03:35:56


On Monday 23 December 2002 19:30, Ullrich von Bassewitz wrote:
> 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.

well its ofcoz no problem to do what you suggest, i just would like to have a 
way to bypass the additional overhead caused by reading those controllers 
over and over ("documenting" them somewhere or even checking the clock like 
you suggest isnt an option really, thats doomed to fail one way or another).

also, besides removing the possibility of reading controllers more than 
needed, a common poll-function would remove the need of copying the 
controller-state into a local variable (which in turn in a real application 
is most probably done in a common "poll" function :=P)...i am almost sure 
that even the standard driver can benefit from that (it would certainly not 
get worse).

however...i'll make a version of these drivers for the current api first and 
then we'll see :o)

-- 
          ___ ___ .___________________ .___________ _______.
    c=64 /   |   \|   \__    ___/     \ \_   _____/ \      \ [groepaz]
     gb /    '    \   | |    | /  \ /  \ |    __)_  /   |   \ gp32
    cgb \    .    /   | |    |/    '    \|        \/    |    \ psx
     gba \___|_  /|___| |____|\____|__  /_______  /\____|__  / dc
          -----\/-----'---------------\/--------\/---------\/
       http://www.hitmen-console.org    Hitmen WWW Headquarters
       http://fly.to/hitmen-groepaz     my personal playground
       http://rr.c64.org/silversurfer   home of the RR debugger
       ftp.musoftware.de/pub/groepaz    cc65 dump site

----------------------------------------------------------------------
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-24 03:37:29 CET