diff --git a/appleiibot/Makefile b/appleiibot/Makefile index 613dd644..55b1cbe3 100644 --- a/appleiibot/Makefile +++ b/appleiibot/Makefile @@ -9,7 +9,7 @@ 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 PUMPKIN_SMALL.BAS LADY.BAS \ - A2.BAS + A2.BAS FOURAM.BAS cp empty.dsk appleiibot.dsk $(DOS33) -y appleiibot.dsk BSAVE -a 0x0300 LOAD $(DOS33) -y appleiibot.dsk SAVE A E2.BAS @@ -33,6 +33,7 @@ appleiibot.dsk: E2.BAS FLAME.BAS FLAME2.BAS \ $(DOS33) -y appleiibot.dsk SAVE A PUMPKIN_SMALL.BAS $(DOS33) -y appleiibot.dsk SAVE A LADY.BAS $(DOS33) -y appleiibot.dsk SAVE A A2.BAS + $(DOS33) -y appleiibot.dsk SAVE A FOURAM.BAS ### @@ -191,5 +192,11 @@ A2.BAS: a2.bas #### +FOURAM.BAS: fouram.bas + $(TOKENIZE) < fouram.bas > FOURAM.BAS + + +#### + clean: rm -f *~ *.o *.lst convert_to convert_from convert_qkumba make_boxes convert_back LOAD *.BAS diff --git a/appleiibot/fouram.bas b/appleiibot/fouram.bas new file mode 100644 index 00000000..185b0133 --- /dev/null +++ b/appleiibot/fouram.bas @@ -0,0 +1,5 @@ +1REM_'> $^__XW?#__'\][C__!>W\Y_/&W:?\_SC=W/^?^1_]G_G_P=_Y_8>ZTHENINVERSE +3Z=Q:PRINT" ";:NEXT I,Y:GETA + + diff --git a/gr-utils/Makefile b/gr-utils/Makefile index 74af67be..c30ff4b2 100644 --- a/gr-utils/Makefile +++ b/gr-utils/Makefile @@ -2,7 +2,8 @@ include ../Makefile.inc CFLAGS = -g -Wall -O2 -all: text2gr png2gr png2gr_text png2rle png2lz4 png_to_40x48d png_to_40x96 +all: text2gr png2gr png2gr_text png2rle png2lz4 png_to_40x48d png_to_40x96 \ + png2sixbitmap ### @@ -38,6 +39,15 @@ png2gr_text.o: png2gr_text.c loadpng.h ### +png2sixbitmap: png2sixbitmap.o loadpng.o + $(CC) $(LFLAGS) -o png2sixbitmap png2sixbitmap.o loadpng.o -lpng + +png2sixbitmap.o: png2sixbitmap.c loadpng.h + $(CC) $(CFLAGS) -c png2sixbitmap.c + + +### + png2rle: png2rle.o loadpng.o rle_common.o $(CC) $(LFLAGS) -o png2rle png2rle.o loadpng.o rle_common.o -lpng @@ -75,8 +85,8 @@ png_to_40x96.o: png_to_40x96.c loadpng.h rle_common.h ### install: - cp png2gr png2gr_text png2rle png2lz4 png_to_40x48d png_to_40x96 $(INSTALL_LOC) + cp png2gr png2gr_text png2rle png2lz4 png_to_40x48d png_to_40x96 png2sixbitmap $(INSTALL_LOC) clean: - rm -f *~ *.o png2gr png2gr_text png2rle png2lz4 png_to_40x48d png_to_40x96 + rm -f *~ *.o png2gr png2gr_text png2rle png2lz4 png_to_40x48d png_to_40x96 png2sixbitmap diff --git a/gr-utils/png2sixbitmap.c b/gr-utils/png2sixbitmap.c new file mode 100644 index 00000000..4414db26 --- /dev/null +++ b/gr-utils/png2sixbitmap.c @@ -0,0 +1,55 @@ +#include +#include + +#include +#include +#include +#include +#include + +#include "loadpng.h" + +/* Converts a PNG to a shifted 6 bitmap */ + +int main(int argc, char **argv) { + + int row=0; + int col=0; + + unsigned char ch; + + unsigned char *image; + int xsize,ysize; + + if (argc<2) { + fprintf(stderr,"Usage:\t%s INFILE\n\n",argv[0]); + exit(-1); + } + + if (loadpng(argv[1],&image,&xsize,&ysize,PNG_WHOLETHING)<0) { + fprintf(stderr,"Error loading png!\n"); + exit(-1); + } + + fprintf(stderr,"Loaded image %d by %d\n",xsize,ysize); + + ch=0; + for(row=0;row<24;row++) { + for(col=0;col<40;col++) { + if (image[row*xsize+col]) { + ch|=1<<5; + } + if ((row*xsize+col)%6==5) { + printf("%c",ch+32); + ch=0; + } + else { + ch>>=1; + } + } + } + + printf("\n"); + + return 0; +}