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

Subject: Re: [stella] reading the driving controllers, generic thoughts
From: Thomas Jentzsch <tjentzsch@xxxxxx>
Date: Tue, 30 Oct 2001 18:53:08 +0100
Glenn Saunders wrote:

>How does your code handle isolating the left or right nybble 
>(controller 0 or controller 1)?

It doesn't :-)

But after lda SWCHA you could insert the same code as Eckhard 

	lda SWCHA
	cpx #1		; x = player number (0,1)
	beq .player1

BTW: Did you notice, that Eckhard's solution is nearly 
identical with my first one? 

>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.

That should work too, but I'm sure, it would be slower 
(scanning!) and larger than the other solutions.

Have fun!

Archives (includes files) at
Unsub & more at

Current Thread