diff --git a/Makefile b/Makefile index b4751a43..85c7690d 100644 --- a/Makefile +++ b/Makefile @@ -5,19 +5,21 @@ all: cd asoft_presenter && make cd dos33fs-utils && make cd hgr-utils && make + cd gr-utils && make install: cd asoft_basic-utils && make install cd asoft_presenter && make install cd dos33fs-utils && make install cd hgr-utils && make install - + cd gr-utils && make install clean: cd asoft_basic-utils && make clean cd asoft_presenter && make clean cd dos33fs-utils && make clean cd hgr-utils && make clean + cd gr-utils && make clean rm -f *~ test: diff --git a/gr-utils/Makefile b/gr-utils/Makefile new file mode 100644 index 00000000..d3637d59 --- /dev/null +++ b/gr-utils/Makefile @@ -0,0 +1,18 @@ +include ../Makefile.inc + +all: png2gr + +png2gr: png2gr.o + $(CC) $(LFLAGS) -lpng -o png2gr png2gr.o + +png2gr.o: png2gr.c + $(CC) $(CFLAGS) -c png2gr.c + + +install: + cp png2gr $(INSTALL_LOC) + +clean: + rm -f *~ *.o png2gr + + diff --git a/gr-utils/png2gr.c b/gr-utils/png2gr.c new file mode 100644 index 00000000..9f65c429 --- /dev/null +++ b/gr-utils/png2gr.c @@ -0,0 +1,203 @@ +#include +#include + +#include +#include +#include +#include +#include + +#include + +/* TODO: */ +/* 40x48 images */ +/* 80x40, 80x48 double-highres images */ + +int main(int argc, char **argv) { + + int image[40][40]; + int x,y; + FILE *infile,*outfile; + int debug=0; + + if (argc<3) { + fprintf(stderr,"Usage:\t%s INFILE OUTFILE\n\n",argv[0]); + exit(-1); + } + + outfile=fopen(argv[2],"w"); + if (outfile==NULL) { + fprintf(stderr,"Error! Could not open %s\n",argv[2]); + exit(-1); + } + + int width, height; + png_byte color_type; + png_byte bit_depth; + + png_structp png_ptr; + png_infop info_ptr; + int number_of_passes; + png_bytep * row_pointers; + + unsigned char header[8]; + + /* open file and test for it being a png */ + infile = fopen(argv[1], "rb"); + if (infile==NULL) { + fprintf(stderr,"Error! Could not open %s\n",argv[1]); + exit(-1); + } + + /* Check the header */ + fread(header, 1, 8, infile); + if (png_sig_cmp(header, 0, 8)) { + fprintf(stderr,"Error! %s is not a PNG file\n",argv[1]); + exit(-1); + } + + /* initialize stuff */ + png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); + if (!png_ptr) { + fprintf(stderr,"Error create_read_struct\n"); + exit(-1); + } + + info_ptr = png_create_info_struct(png_ptr); + if (!info_ptr) { + fprintf(stderr,"Error png_create_info_struct\n"); + exit(-1); + } + + png_init_io(png_ptr, infile); + png_set_sig_bytes(png_ptr, 8); + + png_read_info(png_ptr, info_ptr); + + width = png_get_image_width(png_ptr, info_ptr); + height = png_get_image_height(png_ptr, info_ptr); + color_type = png_get_color_type(png_ptr, info_ptr); + bit_depth = png_get_bit_depth(png_ptr, info_ptr); + + if (debug) { + printf("PNG: width=%d height=%d depth=%d\n",width,height,bit_depth); + } + + number_of_passes = png_set_interlace_handling(png_ptr); + png_read_update_info(png_ptr, info_ptr); + + row_pointers = (png_bytep*) malloc(sizeof(png_bytep) * height); + for (y=0; y0x3f8) break; + enough++; + if (enough>119) { + fputc(0,outfile); + fputc(0,outfile); + fputc(0,outfile); + fputc(0,outfile); + fputc(0,outfile); + fputc(0,outfile); + fputc(0,outfile); + fputc(0,outfile); + enough=0; + } + + col++; + if (col>39) { + col=0; + row+=16; + if (row>47) row-=46; + } + } + + fclose(outfile); + + return 0; +} diff --git a/tfv/Apple II Lowres.gpl b/tfv/Apple II Lowres.gpl new file mode 100644 index 00000000..ba091f41 --- /dev/null +++ b/tfv/Apple II Lowres.gpl @@ -0,0 +1,21 @@ +GIMP Palette +Name: Apple II Lowres +Columns: 0 +# + 0 0 0 Untitled +227 30 96 Untitled + 96 78 189 Untitled +255 68 253 Untitled + 0 163 96 Untitled +156 156 156 Untitled + 20 207 253 Untitled +208 195 255 Untitled + 96 114 3 Untitled +255 106 60 Untitled +157 157 157 Untitled +255 160 208 Untitled + 20 245 60 Untitled +208 221 141 Untitled +114 255 208 Untitled +255 255 255 Untitled + diff --git a/tfv/Makefile b/tfv/Makefile new file mode 100644 index 00000000..d9ca7174 --- /dev/null +++ b/tfv/Makefile @@ -0,0 +1,22 @@ +include ../Makefile.inc + +DOS33 = ../dos33fs-utils/dos33 +PNG2GR = ../gr-utils/png2gr + +all: tfv.dsk + +tfv.dsk: TITLE.GR ED + $(DOS33) -y tfv.dsk BSAVE -a 0x400 TITLE.GR + $(DOS33) -y tfv.dsk BSAVE -a 0x900 ED + +ED: duet.o + ld65 -o ED duet.o -C ./apple2_900.inc + +duet.o: duet.s + ca65 -o duet.o duet.s -l duet.lst + +TITLE.GR: title.png + $(PNG2GR) title.png TITLE.GR + +clean: + rm -f *~ TITLE.GR *.o *.lst ED diff --git a/tfv/apple2_900.inc b/tfv/apple2_900.inc new file mode 100644 index 00000000..945c1003 --- /dev/null +++ b/tfv/apple2_900.inc @@ -0,0 +1,12 @@ +MEMORY { + ZP: start = $00, size = $1A, type = rw; + RAM: start = $900, size = $8E00, file = %O; +} + +SEGMENTS { +CODE: load = RAM, type = ro; +RODATA: load = RAM, type = ro; +DATA: load = RAM, type = rw; +BSS: load = RAM, type = bss, define = yes; +ZEROPAGE: load = ZP, type = zp; +} diff --git a/tfv/duet.s b/tfv/duet.s new file mode 100644 index 00000000..3215bd78 --- /dev/null +++ b/tfv/duet.s @@ -0,0 +1,153 @@ +; *************************************************************************** +; * Copyright (C) 1979-2015 by Paul Lutus * +; * http://arachnoid.com/administration * +; * * +; * This program is free software; you can redistribute it and/or modify * +; * it under the terms of the GNU General Public License as published by * +; * the Free Software Foundation; either version 2 of the License, or * +; * (at your option) any later version. * +; * * +; * This program is distributed in the hope that it will be useful, * +; * but WITHOUT ANY WARRANTY; without even the implied warranty of * +; * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +; * GNU General Public License for more details. * +; * * +; * You should have received a copy of the GNU General Public License * +; * along with this program; if not, write to the * +; * Free Software Foundation, Inc., * +; * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * +; *************************************************************************** + +; Electric Duet Player Routine circa 1980 + + LDA #$01 ; $0900> A9 01 ; 2 *!* + STA $09 ; $0902> 85 09 ; 3 + STA $1D ; $0904> 85 1D ; 3 + PHA ; $0906> 48: PHA ; 3 + PHA ; $0907> 48: PHA ; 3 + PHA ; $0908> 48: PHA ; 3 + BNE label1 ; $0909> D0 15: BNE $0920 ; 4 *!* +label2: + INY ; $090B> C8: INY ; 2 + LDA ($1E),Y ; $090C> B1 1E: LDA ($1E),Y ; 5 *!* + STA $09 ; $090E> 85 09: STA $09 ; 3 + INY ; $0910> C8: INY ; 2 + LDA ($1E),Y ; $0911> B1 1E: LDA ($1E),Y ; 5 *!* + STA $1D ; $0913> 85 1D: STA $1D ; 3 + LDA $1E ; $0915> A5 1E: LDA $1E ; 3 *!* + CLC ; $0917> 18: CLC ; 2 + ADC #$03 ; $0918> 69 03: ADC #$03 ; 2 *!* + STA $1E ; $091A> 85 1E: STA $1E ; 3 + BCC label1 ; $091C> 90 02: BCC $0920 ; 4 *!* + INC $1F ; $091E> E6 1F: INC $1F ; 5 +label1: + LDY #$00 ; $0920> A0 00: LDY #$00 ; 2 *!* + LDA ($1E),Y ; $0922> B1 1E: LDA ($1E),Y ; 5 *!* + CMP #$01 ; $0924> C9 01: CMP #$01 ; 2 + BEQ label2 ; $0926> F0 E3: BEQ $090B ; 4 *!* + BCS label3 ; $0928> B0 0D: BCS $0937 ; 4 *!* + PLA ; $092A> 68: PLA ; 4 + PLA ; $092B> 68: PLA ; 4 + PLA ; $092C> 68: PLA ; 4 + LDX #$49 ; $092D> A2 49: LDX #$49 ; 2 *!* + INY ; $092F> C8: INY ; 2 + LDA ($1E),Y ; $0930> B1 1E: LDA ($1E),Y ; 5 *!* + BNE label4 ; $0932> D0 02: BNE $0936 ; 4 *!* + LDX #$C9 ; $0934> A2 C9: LDX #$c9 ; 2 *!* +label4: + RTS ; $0936> 60: RTS ; 6 +label3: + STA $08 ; $0937> 85 08: STA $08 ; 3 + JSR $092D ; $0939> 20 2D09: JSR $092D ; 6 + STX $0983 ; $093C> 8E 8309: STX $0983 ; 4 + STA $06 ; $093F> 85 06: STA $06 ; 3 + LDX $09 ; $0941> A6 09: LDX $09 ; 3 *!* +label5: + LSR A ; $0943> 4A: LSR A ; 2 + DEX ; $0944> CA: DEX ; 2 + BNE label5 ; $0945> D0 FC: BNE $0943 ; 4 *!* + STA $097C ; $0947> 8D 7C09: STA $097C ; 4 + JSR $092D ; $094A> 20 2D09: JSR $092D ; 6 + STX $09BB ; $094D> 8E BB09: STX $09BB ; 4 + STA $07 ; $0950> 85 07: STA $07 ; 3 + LDX $1D ; $0952> A6 1D: LDX $1D ; 3 *!* +label6: + LSR A ; $0954> 4A: LSR A ; 2 + DEX ; $0955> CA: DEX ; 2 + BNE label6 ; $0956> D0 FC: BNE $0954 ; 4 *!* + STA $09B4 ; $0958> 8D B409: STA $09B4 ; 4 + PLA ; $095B> 68: PLA ; 4 + TAY ; $095C> A8: TAY ; 2 + PLA ; $095D> 68: PLA ; 4 + TAX ; $095E> AA: TAX ; 2 + PLA ; $095F> 68: PLA ; 4 + BNE label8 ; $0960> D0 03: BNE $0965 ; 4 *!* +label99: + BIT $C030 ; $0962> 2C 30C0: BIT $C030 ; 4 +label8: + CMP #$00 ; $0965> C9 00: CMP #$00 ; 2 + BMI label7 ; $0967> 30 03: BMI $096C ; 4 *!* + NOP ; $0969> EA: NOP ; 2 + BPL label9 ; $096A> 10 03: BPL $096F ; 4 *!* +label7: + BIT $C030 ; $096C> 2C 30C0: BIT $C030 ; 4 +label9: + STA $4E ; $096F> 85 4E: STA $4E ; 3 + BIT $C000 ; $0971> 2C 00C0: BIT $C000 ; 4 + BMI label4 ; $0974> 30 C0: BMI $0936 ; 4 *!* + DEY ; $0976> 88: DEY ; 2 + BNE label10 ; $0977> D0 02: BNE $097B ; 4 *!* + BEQ label11 ; $0979> F0 06: BEQ $0981 ; 4 *!* +label10: + CPY #$00 ; $097B> C0 00: CPY #$00 ; 2 + BEQ label12 ; $097D> F0 04: BEQ $0983 ; 4 *!* + BNE label13 ; $097F> D0 04: BNE $0985 ; 4 *!* +label11: + LDY $06 ; $0981> A4 06: LDY $06 ; 3 *!* +label12: + EOR #$40 ; $0983> 49 40: EOR #$40 ; 2 *!* +label13: + BIT $4E ; $0985> 24 4E: BIT $4E ; 3 + BVC label14 ; $0987> 50 07: BVC $0990 ; 4 *!* + BVS label15 ; $0989> 70 00: BVS $098B ; 4 *!* +label15: + BPL label16 ; $098B> 10 09: BPL $0996 ; 4 *!* + NOP ; $098D> EA: NOP ; 2 + BMI label17 ; $098E> 30 09: BMI $0999 ; 4 *!* +label14: + NOP ; $0990> EA: NOP ; 2 + BMI label16 ; $0991> 30 03: BMI $0996 ; 4 *!* + NOP ; $0993> EA: NOP ; 2 + BPL label17 ; $0994> 10 03: BPL $0999 ; 4 *!* +label16: + CMP $C030 ; $0996> CD 30C0: CMP $C030 ; 4 +label17: + DEC $4F ; $0999> C6 4F: DEC $4F ; 5 + BNE label18 ; $099B> D0 11: BNE $09AE ; 4 *!* + DEC $08 ; $099D> C6 08: DEC $08 ; 5 + BNE label18 ; $099F> D0 0D: BNE $09AE ; 4 *!* + BVC label19 ; $09A1> 50 03: BVC $09A6 ; 4 *!* + BIT $C030 ; $09A3> 2C 30C0: BIT $C030 ; 4 +label19: + PHA ; $09A6> 48: PHA ; 3 + TXA ; $09A7> 8A: TXA ; 2 + PHA ; $09A8> 48: PHA ; 3 + TYA ; $09A9> 98: TYA ; 2 + PHA ; $09AA> 48: PHA ; 3 + JMP $0915 ; $09AB> 4C 1509: JMP $0915 ; 3 +label18: + DEX ; $09AE> CA: DEX ; 2 + BNE label20 ; $09AF> D0 02: BNE $09B3 ; 4 *!* + BEQ label21 ; $09B1> F0 06: BEQ $09B9 ; 4 *!* +label20: + CPX #$00 ; $09B3> E0 00: CPX #$00 ; 2 + BEQ label22 ; $09B5> F0 04: BEQ $09BB ; 4 *!* + BNE label23 ; $09B7> D0 04: BNE $09BD ; 4 *!* +label21: + LDX $07 ; $09B9> A6 07: LDX $07 ; 3 *!* +label22: + EOR #$80 ; $09BB> 49 80: EOR #$80 ; 2 *!* +label23: + BVS label99 ; $09BD> 70 A3: BVS $0962 ; 4 *!* + NOP ; $09BF> EA: NOP ; 2 + BVC label8 ; $09C0> 50 A3: BVC $0965 ; 4 *!* diff --git a/tfv/sprites.piskel b/tfv/sprites.piskel new file mode 100644 index 00000000..7d98c8f5 --- /dev/null +++ b/tfv/sprites.piskel @@ -0,0 +1 @@ +{"modelVersion":2,"piskel":{"name":"sprites","description":"","fps":2,"height":40,"width":80,"layers":["{\"name\":\"Layer 1\",\"opacity\":0.5,\"frameCount\":2,\"chunks\":[{\"layout\":[[0],[1]],\"base64PNG\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAAoCAYAAAB5LPGYAAABF0lEQVR4nO3YzW3CMBiAYaSuxZEzM/TMsXt0BxZhhyzQUZB7wRG1FLX+aWyj55F85FPyYieIwwEAAAAAAICdLF+f4Xn1vp7Z6FcphgvXJYTrImAm/R5KT+BWwNx5sz8J9Ku0hrgcQ7gcq288d97sTwL9KtWenPfzLTyv0hMcA84WUr9KrQKWzpv9FaLfL9IL3Fql82pPcPoFjEa/RloF3Jr36gH1a6RVwHRebcC4wukewuk+bNDR+5Vex+5a/WZYA368/Vh//fx04R5G7Tf6AV7l/m3wX/Nm2YDx/tLVa960T77IBsyT3l+rDVg6L+02S8eVDVind7+X2YCtQha/Sgp/+/TWu1/aa7Z+AAAAAAAAAAAAwP6+AVvhyi6VmIOlAAAAAElFTkSuQmCC\"}]}"]}} \ No newline at end of file diff --git a/tfv/sprites.png b/tfv/sprites.png new file mode 100644 index 00000000..be3c6b5e Binary files /dev/null and b/tfv/sprites.png differ diff --git a/tfv/tfv.dsk b/tfv/tfv.dsk new file mode 100644 index 00000000..18d460b4 Binary files /dev/null and b/tfv/tfv.dsk differ diff --git a/tfv/title.piskel b/tfv/title.piskel new file mode 100644 index 00000000..c9ce7933 --- /dev/null +++ b/tfv/title.piskel @@ -0,0 +1 @@ +{"modelVersion":2,"piskel":{"name":"tfv","description":"","fps":12,"height":40,"width":80,"layers":["{\"name\":\"Layer 1\",\"opacity\":1,\"frameCount\":1,\"chunks\":[{\"layout\":[[0]],\"base64PNG\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAAAoCAYAAABpYH0BAAAB0klEQVRoge3avW3DMBAFYA3hOpOkTJ0ZtJA3YBHAc2SGaAFXniGloRQSBZjg6XiPx9/QwANsESbIz0dTsjxN07SORGV7Mn9+N58qAC8/T2/cwUqP+/qmILi+qX6MMasx5mWCj7fZm+m2hfwwuHYUMLQ9BAZ9XTWgtMIQQLRv7nhTgCUqEAF0IS2MGxeObA/dRGIrMAR3AIKA6CbSFGCLOQNMfhpjYwfRcooCjoCA1O7aa5IBcl/coRsDcpoj6S92k1Nc7jJAaTsKGNrOwRYDRAcmnbC0YpsB5CaGVpoUEK1Qrv/qK1ALEB1XN4Cpl3B1Ffhfog5oU/oqoparluPaWQo48goYAFl+sDVAAXB+wMvve1RSTHK5X9flfg0+HgMIRBnwNm8pAIeAqgMesRBMKMCYXS4lHHWPBFi6DOAebhfTBLQQsamjApmQS1cBcP1aoHQBGPPrcE5AhaWLAaaoPBJwf9h27njTgBr3JXJUYPZNJEfliQA/nlt6AdS8I+bupl44D2ATu3CK8z0RYMDSHYADUAfQvrZA1PeUbafefxb3Q+gCkJskFY2+uwRMMWH7E392wCM7XGuA1D0UhbFhb0z5hx5qsmcpABcHmCIInBY0mj+cujaiUF9VMQAAAABJRU5ErkJggg==\"}]}"]}} \ No newline at end of file diff --git a/tfv/title.png b/tfv/title.png new file mode 100644 index 00000000..5bcb17c3 Binary files /dev/null and b/tfv/title.png differ diff --git a/tfv/worldmap.piskel b/tfv/worldmap.piskel new file mode 100644 index 00000000..17d84504 --- /dev/null +++ b/tfv/worldmap.piskel @@ -0,0 +1 @@ +{"modelVersion":2,"piskel":{"name":"worldmap","description":"","fps":12,"height":40,"width":80,"layers":["{\"name\":\"Layer 1\",\"opacity\":1,\"frameCount\":1,\"chunks\":[{\"layout\":[[0]],\"base64PNG\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAAAoCAYAAABpYH0BAAABwklEQVRoge3YwW3DMAwFUAFeIeNkGJ979B7dQDp1oGaBjtFjoJ5kxHQZkhIdSg4F/EOcRA6fKdlIuHzfs6c+wfoHjB4HdEAH7CJwqANiw7pwLbDa+lBA6bAG0Ybj1icCjDGuGQ2ydYgBS2KMOaXUfCLrPF78Zw0AP0fNy94D4cTSE/USClI632nuwlYrYHhAbAk6oBDOAYWZlynPy7QDLMep799+Plk5PSAV7Pv548pKN4Dlii75Jkr4mjcphUGo8n557KIgu+lAWCAWKSA2D7fzMGB4IZo7kAtQG63OW/c8pAMhVHmdUsoxRhwSGewaewPE5sHgKNASuLQhYAghhxB2NyMzQOslK13S2HlfDgg3YS4gtVdxQbgd+AxIBG7deRggtVS5sFjK3khdsPJgjkJaw3E78ail3Lz0ewWE4e6hrUDcu7waoBacVri/WwIHl/EG8myAUsjaznVAIeR/XTgvkwNKQdX3QGtI+NypVQ87owFag11+r5uoP0ifDW4HBo4f/meCFpx1p2E5HHC0UB3ngEw470AhXC3k2wKSMMjndvDWhfQGJwa1LsgasBnWuqBeOk8KvM5tXdirASlQaUf+Ae/t6N9rwExgAAAAAElFTkSuQmCC\"}]}"]}} \ No newline at end of file diff --git a/tfv/worldmap.png b/tfv/worldmap.png new file mode 100644 index 00000000..92520019 Binary files /dev/null and b/tfv/worldmap.png differ