From 735f357728f2948a003fbefe0d64f31630c2b2b3 Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Sun, 6 Jun 2021 01:21:14 -0400 Subject: [PATCH] gr: tunnel: works now --- graphics/gr/tunnel/tunnel.s | 45 ++++++++++++++++++++++++------------- graphics/gr/tunnel/weird.s | 6 +++++ 2 files changed, 36 insertions(+), 15 deletions(-) diff --git a/graphics/gr/tunnel/tunnel.s b/graphics/gr/tunnel/tunnel.s index 203f74ea..7662db6a 100644 --- a/graphics/gr/tunnel/tunnel.s +++ b/graphics/gr/tunnel/tunnel.s @@ -15,8 +15,6 @@ NEWCOLOR = $FF FULLGR = $C052 - - HLINE = $F819 ;; HLINE Y,$2C at A VLINE = $F828 ;; VLINE A,$2D at Y SETCOL = $F864 ; COLOR=A @@ -27,25 +25,28 @@ tunnel: ; 10 GR:N=7 jsr SETGR - bit FULLGR +; bit FULLGR lda #$7 sta NEWCOLOR - +outer: ; 20 FOR X=0 TO 4 lda #0 sta COUNT - clc - adc #16 - sta COUNTMAX cycle: ; 30 FOR I=X TO 15+X STEP 5:COLOR=0 - ldx COUNT + lda COUNT + tax + + clc + adc #16 + sta COUNTMAX + iloop: lda #0 sta COLOR @@ -80,8 +81,15 @@ iloop: jsr HLINE ; VLIN J,W AT I ; VLINE A,$2D at Y - ; VLIN J,W AT Z ; VLINE A,$2D at Y + txa + tay + lda J + jsr VLINE + ; VLIN J,W AT Z ; VLINE A,$2D at Y + ldy Z + lda J + jsr VLINE ; COLOR=N lda NEWCOLOR @@ -99,16 +107,23 @@ iloop: jsr HLINE ; VLIN J,W AT J ; VLINE A,$2D at Y + ldy J + lda J + jsr VLINE + ; VLIN J,W AT W ; VLINE A,$2D at Y + ldy V2 + lda J + jsr VLINE + + + lda #150 + jsr WAIT ; N=N+1 inc NEWCOLOR - - lda #75 - jsr WAIT - ; 50 NEXT:N=N-4 txa @@ -128,7 +143,7 @@ iloop: inc COUNT lda COUNT - cmp #4 + cmp #5 bne cycle dec NEWCOLOR @@ -140,4 +155,4 @@ iloop: end: ; 70 GOTO 20 - jmp cycle + jmp outer diff --git a/graphics/gr/tunnel/weird.s b/graphics/gr/tunnel/weird.s index cd364612..d957c7e5 100644 --- a/graphics/gr/tunnel/weird.s +++ b/graphics/gr/tunnel/weird.s @@ -1,5 +1,11 @@ ; 5 REM BY @hisham_hm Mar 7 @AppleIIBot +; buggy version that looks cool + +; took a while, but there are two bugs. COUNT (and thus X) gets the wrong +; value and never resets, mostly due to the jmp at the end going +; to the wrong place. The init of COUNTMAX is wrong too + H2 = $2C V2 = $2D COLOR = $30