Re: [stella] reading the driving controllers, generic thoughts

Subject: Re: [stella] reading the driving controllers, generic thoughts
From: "Eckhard Stolberg" <Eckhard_Stolberg@xxxxxx>
Date: Mon, 29 Oct 2001 17:36:45 +0100
> This would probably be faster.  Don't know how the ROM usage would
> compare.  What do you guys think?

I don't know about this approach, but the way I would read
the driving controller would be something like this:

RightTable: .byte $02,$00,$03,$01
LeftTable:  .byte $01,$03,$00,$02

; X = player to check (0 or 1)
 lda SWCHA
 cpx #$01
 beq .Player1
 and #%00000011
 cmp LastDCstate
 beq .NoDCmovement
 ldy LastDCstate
 sta LastDCstate
 cmp RightTable,y
 bne .NotRight
 jmp DoRightTurn
 cmp LeftTable,y
 bne .NotLeft
 jmp DoLeftTurn

> BTW, as Bob Colbert demonstrated, you can read a trackball in trackball
> mode on the 2600.  I'd be interested to know, however, how fast you can
> glide the ball before the 1/60th of a second reads are insufficient.  I
> would assume that even the Atari trackballs were higher resolution than
> driving controllers, but maybe they are the same.  I'll have to dig up my
> CX-80 trackball and test this code on one axis to see.  It would be
> interesting to see Missile Command get modified for trackball mode ;)

Reading the trackball only 60 times per second is way too
inacurate. You need about 20 reads per frame to get a good
control over the cursor. Doing it only once per frame
would only result in jerky movement, as you would never be
able to read the next value of the code sequence. You
just won't be able to move the ball slow enough. (Well I
wasn't, so I'm assuming most other people would also have
difficulties. ;-) )

I have attatched a little program I was playing around with
a while ago. It lets you move a single pixel across the screen
with a CX-80 trackball in trackball mode, or a ST mouse, which
are compatible. As you can see, reading the mouse/trackball takes
quite a lot of processor time during the display and/or a lot
of RAM, so it might not be too usefull for most games.

Ciao, Eckhard Stolberg

Attachment: track1.das
Description: Binary data

Attachment: Track1.bin
Description: Binary data

Current Thread