From b19754f3d5bc97280dc7736fc95ef115d908c13a Mon Sep 17 00:00:00 2001 From: giomba Date: Tue, 1 Jun 2021 21:53:34 +0200 Subject: [PATCH] "snake" movement is more fluid but not perfect, yet --- src/intro1.asm | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/src/intro1.asm b/src/intro1.asm index b9ecabd..29e04b6 100644 --- a/src/intro1.asm +++ b/src/intro1.asm @@ -552,19 +552,44 @@ XScrollInterruptL SUBROUTINE XScrollInterruptMoveAll SUBROUTINE dec $d019 ; EOI + tsx + dex + lda XCharOffset - cmp #9 + asl + asl + asl + sta $100,x + lda $d016 + and #$07 + ora $100,x + + inx + txs + + cmp #78 bcs .isEdge - cmp #2 + cmp #3 bcc .isEdge + cmp #70 + bcs .isMiddle + cmp #10 + bcc .isMiddle jmp .enter +.isMiddle: + lda counter + and #$01 + beq .enter + jmp .next + .isEdge: lda counter - and #$01 + and #$03 beq .enter ; ah, some good spaghetti code to accomodate for far branch jmp .next ; bounce slower +.isCenter: .enter: lda XScrollDirection and #$01