From 5dde1f4baaf601802bcb162c761af737489960c1 Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Thu, 28 Jul 2022 02:43:59 -0400 Subject: [PATCH] appleiibot: asplode --- basic/appleiibot/Makefile | 18 ++++++++++-- basic/appleiibot/asplode.bas | 5 ++++ basic/appleiibot/asplode.points | 50 +++++++++++++++++++++++++++++++++ basic/appleiibot/make_points.c | 48 +++++++++++++++++++++++++++++++ 4 files changed, 119 insertions(+), 2 deletions(-) create mode 100644 basic/appleiibot/asplode.bas create mode 100644 basic/appleiibot/asplode.points create mode 100644 basic/appleiibot/make_points.c diff --git a/basic/appleiibot/Makefile b/basic/appleiibot/Makefile index d263be46..ee7a36b5 100644 --- a/basic/appleiibot/Makefile +++ b/basic/appleiibot/Makefile @@ -5,7 +5,7 @@ TOKENIZE = ../../utils/asoft_basic-utils/tokenize_asoft EMPTY_DISK = ../../empty_disk all: appleiibot.dsk \ - convert_to convert_back convert_qkumba make_boxes convert_vmw convert_tgreene make_hgr_boxes + convert_to convert_back convert_qkumba make_boxes convert_vmw convert_tgreene make_hgr_boxes make_points appleiibot.dsk: E2.BAS FLAME.BAS FLAME2.BAS HELLO \ CIRCLES.BAS AUTUMN.BAS QKUMBA.BAS ASTEROID.BAS PERSON.BAS SHIP.BAS \ @@ -25,7 +25,7 @@ appleiibot.dsk: E2.BAS FLAME.BAS FLAME2.BAS HELLO \ HORROR.BAS DIAMOND.BAS LEMM.BAS OOPS.BAS SPLIT.BAS PARTICLE.BAS \ PARTICLE_HGR.BAS DIAMOND_SCROLL.BAS RANDOM_SCROLL.BAS STAR_BOUNCE.BAS\ OOZE.BAS HORIZ_STAR.BAS SECRET_COLLECT.BAS PLANET.BAS PLANET_GR.BAS \ - BOXES.BAS SOLARIS.BAS SOLARIS2.BAS + BOXES.BAS SOLARIS.BAS SOLARIS2.BAS ASPLODE.BAS cp $(EMPTY_DISK)/empty.dsk appleiibot.dsk # cp empty.dsk appleiibot.dsk # $(DOS33) -y appleiibot.dsk BSAVE -a 0x0300 LOAD @@ -133,6 +133,7 @@ appleiibot.dsk: E2.BAS FLAME.BAS FLAME2.BAS HELLO \ $(DOS33) -y appleiibot.dsk SAVE A BOXES.BAS $(DOS33) -y appleiibot.dsk SAVE A SOLARIS.BAS $(DOS33) -y appleiibot.dsk SAVE A SOLARIS2.BAS + $(DOS33) -y appleiibot.dsk SAVE A ASPLODE.BAS #appleiibot2.dsk: BOXES.BAS HELLO # cp empty.dsk appleiibot2.dsk @@ -155,6 +156,14 @@ make_boxes.o: make_boxes.c ### +make_points: make_points.o + $(CC) $(LFLAGS) -o make_points make_points.o + +make_points.o: make_points.c + $(CC) $(CFLAGS) -c make_points.c + +### + make_hgr_boxes: make_hgr_boxes.o $(CC) $(LFLAGS) -o make_hgr_boxes make_hgr_boxes.o @@ -745,6 +754,11 @@ SOLARIS.BAS: solaris.bas SOLARIS2.BAS: solaris2.bas $(TOKENIZE) < solaris2.bas > SOLARIS2.BAS +#### + +ASPLODE.BAS: asplode.bas + $(TOKENIZE) < asplode.bas > ASPLODE.BAS + #### diff --git a/basic/appleiibot/asplode.bas b/basic/appleiibot/asplode.bas new file mode 100644 index 00000000..70e5a0b4 --- /dev/null +++ b/basic/appleiibot/asplode.bas @@ -0,0 +1,5 @@ +0REM~&!:):C&`~:)d)dC:C~dCz`~d)y!~L+T+X2X8V=R@L@I=F8F2L+~NN>N<~K.I2H8L=L;N9R9T;T=V7V2T.~K.J3P9T3T.T0P6L1K.~L5L7N8R8S7R5~N3N1R1R3! +1HGR:HCOLOR=5:DEFFNP(X)=3*PEEK(2054+I+X)-99 +2IFFNP(0)=279THENHPLOTFNP(1),FNP(2):I=I+3 +3HPLOTTOFNP(0),FNP(1):I=I+2:IFFNP(0)GOTO2 +4?"HEAD A SPLODE" diff --git a/basic/appleiibot/asplode.points b/basic/appleiibot/asplode.points new file mode 100644 index 00000000..704dd650 --- /dev/null +++ b/basic/appleiibot/asplode.points @@ -0,0 +1,50 @@ +279 16 0 77 25 # 0 Upper left + 77 103 # 1 Down + 15 189 # 2 Lower left +279 77 25 201 25 # 3 Right + 201 103 # 4 Down + 77 103 # 5 Done square +279 201 103 267 189 # 6 Lower Right +279 201 25 266 0 # 7 Upper right +279 129 30 153 30 # 8 Top head + 165 51 # 9 Right head + 165 69 # 10 Side head + 159 84 # 11 Side head + 147 93 # 12 Bottom right + 129 93 # 13 Bottom head + 120 84 # 14 Bottom left + 111 69 # 15 Left + 111 51 # 16 Left + 129 30 # 17 Top Left +279 135 81 147 81 # 18 Top mouth + 147 89 # 19 Right mouth + 135 89 # 20 Bottom Mouth + 135 81 # 21 Left Mouth +279 126 39 120 51 # 22 Left Horn + 117 69 # 23 Left + 129 84 # 24 Left + 129 78 # 25 Left + 135 72 # 26 Nose + 147 72 # 27 Right + 153 78 # 28 Right + 153 84 + 159 66 # 29 Right + 159 51 # 30 Right + 153 39 # 31 Right Horn +279 127 39 123 54 # 32 Left Horn again + 141 72 # 34 + 153 54 + 153 39 # Right Horn again + 153 45 + 141 63 # Bottom point + 129 48 + 127 39 # Back at start +279 129 60 129 66 # Left Eye + 135 69 + 147 69 + 150 66 + 147 60 +279 135 54 135 48 # Shield + 147 48 + 147 54 +0 diff --git a/basic/appleiibot/make_points.c b/basic/appleiibot/make_points.c new file mode 100644 index 00000000..bdcecd5c --- /dev/null +++ b/basic/appleiibot/make_points.c @@ -0,0 +1,48 @@ +#include +#include + +int main(int argc, char **argv) { + + char buffer[1024]; + char *ptr; + int a1,a2,a3,a4,a5; + char output[1024]; + int out_ptr=0; + int add=33; + + if (argc>1) { + add=atoi(argv[1]); + } + + while(1) { + + ptr=fgets(buffer,1024,stdin); + if (ptr==NULL) break; + if (buffer[0]=='#') continue; + sscanf(buffer,"%d %d %d %d %d", + &a1,&a2,&a3,&a4,&a5); + printf("%d %d %d %d %d\n",a1,a2,a3,a4,a5); + if (a1==279) { + output[out_ptr]=(a1/3)+add; + output[out_ptr+1]=(a2/3)+add; + output[out_ptr+2]=(a3/3)+add; + output[out_ptr+3]=(a4/3)+add; + output[out_ptr+4]=(a5/3)+add; + out_ptr+=5; + } + else if (a1==0) { + output[out_ptr]=(a1/3)+add; + out_ptr+=1; + break; + } + else { + output[out_ptr]=(a1/3)+add; + output[out_ptr+1]=(a2/3)+add; + out_ptr+=2; + } + } + output[out_ptr]=0; + printf("%s\n",output); + + return 0; +}