From 8fd727a221e46b447928fb9d150b3f8ac1e18996 Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Mon, 7 Jun 2021 01:18:45 -0400 Subject: [PATCH] gr: tunnel: difficult --- graphics/gr/tunnel/Makefile | 31 +++++++++++--- graphics/gr/tunnel/{weird.s => stargate.s} | 0 graphics/gr/tunnel/t.bas | 21 ++++----- graphics/gr/tunnel/t2.bas | 11 +++++ graphics/gr/tunnel/t3.bas | 12 ++++++ graphics/gr/tunnel/table.c | 26 +++++++++++ graphics/gr/tunnel/tunnel2.s | 50 +++++++++++++++------- 7 files changed, 118 insertions(+), 33 deletions(-) rename graphics/gr/tunnel/{weird.s => stargate.s} (100%) create mode 100644 graphics/gr/tunnel/t2.bas create mode 100644 graphics/gr/tunnel/t3.bas create mode 100644 graphics/gr/tunnel/table.c diff --git a/graphics/gr/tunnel/Makefile b/graphics/gr/tunnel/Makefile index cd0ba720..ade83062 100644 --- a/graphics/gr/tunnel/Makefile +++ b/graphics/gr/tunnel/Makefile @@ -12,12 +12,14 @@ all: tunnel.dsk $(DOS33): cd ../../utils/dos33fs-utils && make -tunnel.dsk: $(DOS33) HELLO TUNNEL.BAS TUNNEL WEIRD +tunnel.dsk: $(DOS33) HELLO TUNNEL.BAS TUNNEL TUNNEL2 STARGATE T.BAS cp $(EMPTYDISK)/empty.dsk tunnel.dsk $(DOS33) -y tunnel.dsk SAVE A HELLO $(DOS33) -y tunnel.dsk SAVE A TUNNEL.BAS + $(DOS33) -y tunnel.dsk SAVE A T.BAS $(DOS33) -y tunnel.dsk BSAVE -a 0xc00 TUNNEL - $(DOS33) -y tunnel.dsk BSAVE -a 0x37c WEIRD + $(DOS33) -y tunnel.dsk BSAVE -a 0xc00 TUNNEL2 + $(DOS33) -y tunnel.dsk BSAVE -a 0x37c STARGATE ### @@ -29,6 +31,12 @@ HELLO: hello.bas TUNNEL.BAS: tunnel.bas $(TOKENIZE) < tunnel.bas > TUNNEL.BAS +### + +T.BAS: t.bas + $(TOKENIZE) < t.bas > T.BAS + + ### @@ -40,16 +48,25 @@ tunnel.o: tunnel.s ### -WEIRD: weird.o - ld65 -o WEIRD weird.o -C $(LINKERSCRIPTS)/apple2_37c.inc +TUNNEL2: tunnel2.o + ld65 -o TUNNEL2 tunnel2.o -C $(LINKERSCRIPTS)/apple2_c00.inc -weird.o: weird.s - ca65 -o weird.o weird.s -l weird.lst +tunnel2.o: tunnel2.s + ca65 -o tunnel2.o tunnel2.s -l tunnel2.lst + + +### + +STARGATE: stargate.o + ld65 -o STARGATE stargate.o -C $(LINKERSCRIPTS)/apple2_37c.inc + +stargate.o: stargate.s + ca65 -o stargate.o stargate.s -l stargate.lst ### clean: - rm -f *~ *.o HELLO TUNNEL.BAS TUNNEL WEIRD *.lst + rm -f *~ *.o HELLO TUNNEL.BAS TUNNEL TUNNEL2 STARGATE *.lst diff --git a/graphics/gr/tunnel/weird.s b/graphics/gr/tunnel/stargate.s similarity index 100% rename from graphics/gr/tunnel/weird.s rename to graphics/gr/tunnel/stargate.s diff --git a/graphics/gr/tunnel/t.bas b/graphics/gr/tunnel/t.bas index 6f21c668..8c463f09 100644 --- a/graphics/gr/tunnel/t.bas +++ b/graphics/gr/tunnel/t.bas @@ -1,11 +1,12 @@ -5 REM BY @hisham_hm Mar 7 @AppleIIBot -10 GR:N=7 -20 FOR X=0 TO 4 -30 FOR I=X TO 15+X STEP 5 +7 DIM A(9,9):FOR I=0 TO 8:FOR J=0 TO 8:A(I,J)=40/(2+I+J/7):NEXTJ,I +10 GR:N=23 +15 FOR Q=0 TO 7 +20 T=19:FOR X=0 TO 7 +30 FOR I=T TO T-A(X,Q) STEP -1 40 Z=39-I:J=I+1:W=Z-1 -42 COLOR=0:HLIN J,W AT I:HLIN J,W AT Z:VLIN J,W AT I:VLIN J,W AT Z -46 COLOR=N:HLIN J,W AT J:HLIN J,W AT W:VLIN J,W AT J:VLIN J,W AT W -48 N=N+1 -50 NEXT:N=N-4 -60 NEXT:N=N-1:IF N=0 THEN N=12 -70 GOTO 20 +42 COLOR=N:HLIN J,W AT I:HLIN J,W AT Z:VLIN J,W AT I:VLIN J,W AT Z +50 NEXT:T=T-A(X,Q):N=N-1 +60 NEXT:N=N+9:IF N=16 THEN N=32 +65 NEXT +70 GOTO 15 + diff --git a/graphics/gr/tunnel/t2.bas b/graphics/gr/tunnel/t2.bas new file mode 100644 index 00000000..85a89700 --- /dev/null +++ b/graphics/gr/tunnel/t2.bas @@ -0,0 +1,11 @@ +5 REM BY @hisham_hm Mar 7 @AppleIIBot +10 GR:N=23 +20 FOR X=4 TO 0 STEP -1 +30 FOR I=15+X TO X STEP -5 +40 Z=39-I/2:J=I+1:W=Z-1 +42 COLOR=N:HLIN J,W AT I:HLIN J,W AT Z:VLIN J,W AT I:VLIN J,W AT Z +46 REM COLOR=N:HLIN J,W AT J:HLIN J,W AT W:VLIN J,W AT J:VLIN J,W AT W +48 N=N+1 +50 NEXT:N=N-4 +60 NEXT:N=N-1:IF N=16 THEN N=32 +70 GOTO 20 diff --git a/graphics/gr/tunnel/t3.bas b/graphics/gr/tunnel/t3.bas new file mode 100644 index 00000000..da2268c1 --- /dev/null +++ b/graphics/gr/tunnel/t3.bas @@ -0,0 +1,12 @@ +5 REM BY @hisham_hm Mar 7 @AppleIIBot +10 GR:N=23 +15 FOR X=2 TO 0 STEP -0.5 +17 N=23 +20 FOR D=20+X TO 2+X STEP -1 +40 H=40/D:L=20-H:R=19+H +42 COLOR=N +43 HLIN L,R AT L:HLIN L,R AT R:VLIN L,R AT L:VLIN L,R AT R +48 N=N-1 +60 NEXT:IF N<5 THEN N=23 +65 NEXT +70 GOTO 15 diff --git a/graphics/gr/tunnel/table.c b/graphics/gr/tunnel/table.c new file mode 100644 index 00000000..b7a0e361 --- /dev/null +++ b/graphics/gr/tunnel/table.c @@ -0,0 +1,26 @@ +#include + +int main(int argc, char **argv) { + + double x,y; + + for(y=0;y<1;y+=1.0/7.0) { + printf("%.2lf: ",y); + for(x=2.0+y;x<=9.0+y;x++) { + printf("%.2lf ",40/x); + } + printf("\n"); + } + + printf("\n"); + + for(y=0;y<1;y+=1.0/7.0) { + for(x=2.0+y;x<=9.0+y;x++) { +// printf("%.2lf ",40/x); + printf("%.1lf ",(40/x) - 40/(x+1)); + } + printf("\n"); + } + + return 0; +} diff --git a/graphics/gr/tunnel/tunnel2.s b/graphics/gr/tunnel/tunnel2.s index 7662db6a..64baa03a 100644 --- a/graphics/gr/tunnel/tunnel2.s +++ b/graphics/gr/tunnel/tunnel2.s @@ -33,7 +33,7 @@ tunnel: outer: ; 20 FOR X=0 TO 4 - lda #0 + lda #3 sta COUNT cycle: @@ -44,12 +44,15 @@ cycle: tax clc - adc #16 + adc #15 sta COUNTMAX +; sta COUNT + tax + iloop: - lda #0 - sta COLOR +; lda #0 +; sta COLOR ; 40 Z=39-I:J=I+1:W=Z-1 @@ -68,6 +71,11 @@ iloop: adc #1 sta J + ; COLOR=N + lda NEWCOLOR + jsr SETCOL + +.if 1 ; HLIN J,W AT I ; HLINE Y,$2C at A ldy J @@ -90,11 +98,11 @@ iloop: ldy Z lda J jsr VLINE - +.endif ; COLOR=N lda NEWCOLOR jsr SETCOL - +.if 0 ; HLIN J,W AT J ; HLINE Y,$2C at A ldy J @@ -116,8 +124,8 @@ iloop: lda J jsr VLINE - - lda #150 +.endif + lda #50 jsr WAIT ; N=N+1 @@ -126,13 +134,20 @@ iloop: ; 50 NEXT:N=N-4 +; txa +; clc +; adc #5 +; tax + txa - clc - adc #5 + sec + sbc #5 tax - cpx COUNTMAX - bcc iloop +; cpx COUNTMAX +; bcc iloop + + bpl iloop sec lda NEWCOLOR @@ -141,10 +156,13 @@ iloop: ; 60 NEXT:N=N-1:IF N=0 THEN N=12 - inc COUNT - lda COUNT - cmp #5 - bne cycle +; inc COUNT +; lda COUNT +; cmp #5 +; bne cycle + + dec COUNT + bpl cycle dec NEWCOLOR bne end