new goals

make goals a jump table
add light speed
add crystals and bosses
add crystals only
move XY preservation to CountBits and utilize stack instead of Y for temp storage
This commit is contained in:
spannerisms
2021-04-06 02:00:25 -04:00
parent 70933b01f8
commit ed9c6681e8
5 changed files with 180 additions and 40 deletions

View File

@@ -627,15 +627,17 @@ RTL
; caller is responsible for setting 8-bit mode and preserving X and Y
;--------------------------------------------------------------------------------
CountBits:
PHX
TAX ; Save a copy of value
LSR #4 ; Shift down hi nybble, Leave <3> in C
TAY ; And save <7:4> in Y
PHA ; And save <7:4> in Stack
TXA ; Recover value
AND.b #$07 ; Put out <2:0> in X
TAX ; And save in X
LDA.l NybbleBitCounts, X ; Fetch count for <2:0>
TYX ; get <7:4>
ADC.l NybbleBitCounts, X ; Add count for Y & C
PLX ; get <7:4>
ADC.l NybbleBitCounts, X ; Add count for S & C
PLX
RTL
; Look up table of bit counts in the values $00-$0F