From da0ad65c3e5e2a7a49fa0fa91b96002a89d86029 Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Fri, 16 Oct 2020 16:53:20 -0400 Subject: [PATCH] appleiibot: compress the boxes --- appleiibot/Makefile | 21 ++++++++++++++++++--- appleiibot/make_boxes.c | 30 ++++++++++++++++++++++++++++++ appleiibot/pumpkin_small.bas | 2 ++ 3 files changed, 50 insertions(+), 3 deletions(-) create mode 100644 appleiibot/make_boxes.c create mode 100644 appleiibot/pumpkin_small.bas diff --git a/appleiibot/Makefile b/appleiibot/Makefile index 50a6bb1f..8ca1f7e5 100644 --- a/appleiibot/Makefile +++ b/appleiibot/Makefile @@ -3,12 +3,12 @@ include ../Makefile.inc DOS33 = ../dos33fs-utils/dos33 TOKENIZE = ../asoft_basic-utils/tokenize_asoft -all: appleiibot.dsk convert_to convert_back convert_qkumba +all: appleiibot.dsk convert_to convert_back convert_qkumba make_boxes appleiibot.dsk: E2.BAS FLAME.BAS FLAME2.BAS \ CIRCLES.BAS AUTUMN.BAS QKUMBA.BAS ASTEROID.BAS PERSON.BAS SHIP.BAS \ CONCERT.BAS NYAN.BAS RASTER.BAS RASTER2.BAS RASTER3.BAS LOTS.BAS LOAD \ - RASTER4.BAS RASTER5.BAS PUMPKIN.BAS + RASTER4.BAS RASTER5.BAS PUMPKIN.BAS PUMPKIN_SMALL.BAS cp empty.dsk appleiibot.dsk $(DOS33) -y appleiibot.dsk BSAVE -a 0x0300 LOAD $(DOS33) -y appleiibot.dsk SAVE A E2.BAS @@ -29,6 +29,16 @@ appleiibot.dsk: E2.BAS FLAME.BAS FLAME2.BAS \ $(DOS33) -y appleiibot.dsk SAVE A RASTER5.BAS $(DOS33) -y appleiibot.dsk SAVE A LOTS.BAS $(DOS33) -y appleiibot.dsk SAVE A PUMPKIN.BAS + $(DOS33) -y appleiibot.dsk SAVE A PUMPKIN_SMALL.BAS + +### + +make_boxes: make_boxes.o + $(CC) $(LFLAGS) -o make_boxes make_boxes.o + +make_boxes.o: make_boxes.c + $(CC) $(CFLAGS) -c make_boxes.c + ### @@ -158,10 +168,15 @@ PUMPKIN.BAS: pumpkin.bas #### +PUMPKIN_SMALL.BAS: pumpkin_small.bas + $(TOKENIZE) < pumpkin_small.bas > PUMPKIN_SMALL.BAS + +#### + LOTS.BAS: lots.bas $(TOKENIZE) < lots.bas > LOTS.BAS #### clean: - rm -f *~ *.o *.lst convert_to convert_from convert_qkumba convert_back LOAD *.BAS + rm -f *~ *.o *.lst convert_to convert_from convert_qkumba make_boxes convert_back LOAD *.BAS diff --git a/appleiibot/make_boxes.c b/appleiibot/make_boxes.c new file mode 100644 index 00000000..08eaf3cf --- /dev/null +++ b/appleiibot/make_boxes.c @@ -0,0 +1,30 @@ +#include + +int main(int argc, char **argv) { + + char buffer[1024]; + char *ptr; + int color,x1,x2,y1,y2; + char output[1024]; + int out_ptr=0; + + while(1) { + + ptr=fgets(buffer,1024,stdin); + if (ptr==NULL) break; + + sscanf(buffer,"%d %d %d %d %d", + &color,&x1,&x2,&y1,&y2); + + output[out_ptr]=color+32; + output[out_ptr+1]=x1+32; + output[out_ptr+2]=x2+32; + output[out_ptr+3]=y1+32; + output[out_ptr+4]=y2+32; + out_ptr+=5; + } + output[out_ptr]=0; + printf("%s\n",output); + + return 0; +} diff --git a/appleiibot/pumpkin_small.bas b/appleiibot/pumpkin_small.bas new file mode 100644 index 00000000..d432d44d --- /dev/null +++ b/appleiibot/pumpkin_small.bas @@ -0,0 +1,2 @@ +0REM! G?O)+;*L)(>-J)&@0E)%A4>$15$)-+/26-8<26-*