"snake" movement is more fluid

but not perfect, yet
This commit is contained in:
giomba 2021-06-01 21:53:34 +02:00
parent 61515025a5
commit b19754f3d5

View File

@ -552,19 +552,44 @@ XScrollInterruptL SUBROUTINE
XScrollInterruptMoveAll SUBROUTINE XScrollInterruptMoveAll SUBROUTINE
dec $d019 ; EOI dec $d019 ; EOI
tsx
dex
lda XCharOffset lda XCharOffset
cmp #9 asl
asl
asl
sta $100,x
lda $d016
and #$07
ora $100,x
inx
txs
cmp #78
bcs .isEdge bcs .isEdge
cmp #2 cmp #3
bcc .isEdge bcc .isEdge
cmp #70
bcs .isMiddle
cmp #10
bcc .isMiddle
jmp .enter jmp .enter
.isMiddle:
lda counter
and #$01
beq .enter
jmp .next
.isEdge: .isEdge:
lda counter lda counter
and #$01 and #$03
beq .enter ; ah, some good spaghetti code to accomodate for far branch beq .enter ; ah, some good spaghetti code to accomodate for far branch
jmp .next ; bounce slower jmp .next ; bounce slower
.isCenter:
.enter: .enter:
lda XScrollDirection lda XScrollDirection
and #$01 and #$01