[stella] Reflex: Status update

Hey everyone,
I've been hacking at Reflex in smaller increments than before, but I've made
some serious headway in a few areas. There have been lots of optimizations
in the reflection and paddle code, partly due to the fact that I ran out of
cycles in my vblank (!!!). The reflection code is still a little bulky, but
I think it's forgiveable considering I'm a n00b and it's a key component to
the game. The paddle movement/drawing code is MUCH faster than before. I
scrapped it completely and rebuilt it from scratch... it was primarily
responsible for my vblank cycle woes.
I added support for the driving controller despite a sobering limitation I
learned about it during its cleaning. It is not a potentiometer, but a
series of switches with a very low resolution (only 16 updates per full
rotation). This was unacceptably slow in my first implementation, so I now
detect if there was movement in the last frame and then multiply the current
movement by two if there was. It's quite playable and it takes a bit of a
ZING to get the switches in the controller to misregister.
I'm making lots of progress towards two player support. Both
joysicks/driving controllers work, the two player game kernel is written,
but I still need to do a two player paddle update and a two player
(competition) score kernel.
And here's my contribution to the Stella development world today:
lda spinTab,y ; Load A with bit pattern matching a move
RIGHT
and playerMask,x ; Isolate appropriate nibble (again)
cmp temp ; Compare with last controller state
bne .dcLeft ; If not equal, then move left
.dcRight lda #1 ; Else, move right (clockwise)
jmp .dcEndLoop
.dcLeft lda #-1 ; Move left (counterclockwise)
jmp .dcEndLoop
spinTab byte $DD ; 1100 -> 1101
byte $FF ; 1101 -> 1111
byte $CC ; 1110 -> 1100
byte $EE ; 1111 -> 1110
This is just a snippet of code that illustrate how Reflex detects the
direction of driving controller spin. spinTab is the key. You index by the
two driving controller bits (0-3) and it returns the bits rotated left by
one for comparison. There's some supporting code that's not shown here.
I'll post full source and binary soon...
Anyway... late for work! Have a great day!
-Lee
----------------------------------------------------------------------------------------------
Archives (includes files) at http://www.biglist.com/lists/stella/archives/
Unsub & more at http://www.biglist.com/lists/stella/