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

Subject: Re: [stella] reading the driving controllers, generic thoughts
From: Glenn Saunders <cybpunks2@xxxxxxxxxxxxx>
Date: Tue, 30 Oct 2001 09:09:01 -0800
This certainly looks like the most compact version. I'll give it a shot. How does your code handle isolating the left or right nybble (controller 0 or controller 1)?

Last night I was thinking of yet another way to do it where you store the possible previous and next controller states (which could be done with two nybbles or strip out the always set bits and store the entire thing in one nybble per byte.

Then you could mask and shift bits in order to merge the real-time last and current controller state and scan once through the table. Depending on the number range of the match, it will be in the left or right half of the table.

At 11:45 AM 10/30/2001 +0100, you wrote:
        lda SWCHA
        eor last        ; 01 or 10 (else: abrupt twist)
        sty last
        dey             ; -> y = -1..2
        cpy  #2
        sbc  #1 ; -> a = -1, 0, 1
        beq .right

Glenn Saunders - Producer - Cyberpunks Entertainment Personal homepage: Cyberpunks Entertainment:

- Archives (includes files) at Unsub & more at

Current Thread