diff --git a/graphics/3d/3d.dsk b/graphics/3d_glasses/3d.dsk similarity index 100% rename from graphics/3d/3d.dsk rename to graphics/3d_glasses/3d.dsk diff --git a/graphics/3d/Makefile b/graphics/3d_glasses/Makefile similarity index 100% rename from graphics/3d/Makefile rename to graphics/3d_glasses/Makefile diff --git a/graphics/3d/README b/graphics/3d_glasses/README similarity index 100% rename from graphics/3d/README rename to graphics/3d_glasses/README diff --git a/graphics/3d/cube_black_bg.png b/graphics/3d_glasses/cube_black_bg.png similarity index 100% rename from graphics/3d/cube_black_bg.png rename to graphics/3d_glasses/cube_black_bg.png diff --git a/graphics/3d/cube_dhgr_test.png b/graphics/3d_glasses/cube_dhgr_test.png similarity index 100% rename from graphics/3d/cube_dhgr_test.png rename to graphics/3d_glasses/cube_dhgr_test.png diff --git a/graphics/3d/cube_pink_bg.png b/graphics/3d_glasses/cube_pink_bg.png similarity index 100% rename from graphics/3d/cube_pink_bg.png rename to graphics/3d_glasses/cube_pink_bg.png diff --git a/graphics/3d/cube_white_bg.png b/graphics/3d_glasses/cube_white_bg.png similarity index 100% rename from graphics/3d/cube_white_bg.png rename to graphics/3d_glasses/cube_white_bg.png diff --git a/graphics/3d/empty.dsk b/graphics/3d_glasses/empty.dsk similarity index 100% rename from graphics/3d/empty.dsk rename to graphics/3d_glasses/empty.dsk diff --git a/graphics/3d/hello.bas b/graphics/3d_glasses/hello.bas similarity index 100% rename from graphics/3d/hello.bas rename to graphics/3d_glasses/hello.bas diff --git a/graphics/3d/load.bas b/graphics/3d_glasses/load.bas similarity index 100% rename from graphics/3d/load.bas rename to graphics/3d_glasses/load.bas diff --git a/graphics/Makefile b/graphics/Makefile index ef5614b1..37c6ab0e 100644 --- a/graphics/Makefile +++ b/graphics/Makefile @@ -1,7 +1,7 @@ all: - cd 3d && make + cd 3d_glasses && make cd dhgr && make - cd dhgr_viewer && make + cd dgr_viewer && make cd dgr && make cd galaxy && make cd gr && make @@ -10,9 +10,9 @@ all: # cd hgr_viewer && make clean: - cd 3d && make clean + cd 3d_glasses && make clean cd dhgr && make clean - cd dhgr_viewer && make clean + cd dgr_viewer && make clean cd dgr && make clean cd galaxy && make clean cd gr && make clean diff --git a/graphics/README b/graphics/README index 2ab938f6..ce1e967d 100644 --- a/graphics/README +++ b/graphics/README @@ -1,6 +1,6 @@ Testbeds for various graphics modes -+3d ++3d_glasses some attempts at getting anaglyph 3d (3d graphics) working on Apple II. Didn't work @@ -10,8 +10,8 @@ Testbeds for various graphics modes + dhgr code testing out double-hires -+ dhgr_viewer - a double-hires image viewer ++ dgr_viewer + a double-lores image viewer + galaxy an implementation of a galaxy algorithm that looked cool diff --git a/graphics/dhgr_viewer/CHANNELWOOD.DGRA b/graphics/dgr_viewer/CHANNELWOOD.DGRA similarity index 100% rename from graphics/dhgr_viewer/CHANNELWOOD.DGRA rename to graphics/dgr_viewer/CHANNELWOOD.DGRA diff --git a/graphics/dhgr_viewer/CHANNELWOOD.DGRB b/graphics/dgr_viewer/CHANNELWOOD.DGRB similarity index 100% rename from graphics/dhgr_viewer/CHANNELWOOD.DGRB rename to graphics/dgr_viewer/CHANNELWOOD.DGRB diff --git a/graphics/dhgr_viewer/MYST.DGRA b/graphics/dgr_viewer/MYST.DGRA similarity index 100% rename from graphics/dhgr_viewer/MYST.DGRA rename to graphics/dgr_viewer/MYST.DGRA diff --git a/graphics/dhgr_viewer/MYST.DGRB b/graphics/dgr_viewer/MYST.DGRB similarity index 100% rename from graphics/dhgr_viewer/MYST.DGRB rename to graphics/dgr_viewer/MYST.DGRB diff --git a/graphics/dhgr_viewer/Makefile b/graphics/dgr_viewer/Makefile similarity index 100% rename from graphics/dhgr_viewer/Makefile rename to graphics/dgr_viewer/Makefile diff --git a/graphics/dhgr_viewer/README b/graphics/dgr_viewer/README similarity index 62% rename from graphics/dhgr_viewer/README rename to graphics/dgr_viewer/README index 9a0eb154..23c3394a 100644 --- a/graphics/dhgr_viewer/README +++ b/graphics/dgr_viewer/README @@ -1,4 +1,4 @@ -a simple double-hires viewer +a simple double-lores viewer was used when writing my Kansasfest 2020 talk diff --git a/graphics/dhgr_viewer/SELENETIC.DGRA b/graphics/dgr_viewer/SELENETIC.DGRA similarity index 100% rename from graphics/dhgr_viewer/SELENETIC.DGRA rename to graphics/dgr_viewer/SELENETIC.DGRA diff --git a/graphics/dhgr_viewer/SELENETIC.DGRB b/graphics/dgr_viewer/SELENETIC.DGRB similarity index 100% rename from graphics/dhgr_viewer/SELENETIC.DGRB rename to graphics/dgr_viewer/SELENETIC.DGRB diff --git a/graphics/dhgr_viewer/dgr_view.dsk b/graphics/dgr_viewer/dgr_view.dsk similarity index 100% rename from graphics/dhgr_viewer/dgr_view.dsk rename to graphics/dgr_viewer/dgr_view.dsk diff --git a/graphics/dhgr_viewer/dgr_view.s b/graphics/dgr_viewer/dgr_view.s similarity index 100% rename from graphics/dhgr_viewer/dgr_view.s rename to graphics/dgr_viewer/dgr_view.s diff --git a/graphics/dhgr_viewer/empty.dsk b/graphics/dgr_viewer/empty.dsk similarity index 100% rename from graphics/dhgr_viewer/empty.dsk rename to graphics/dgr_viewer/empty.dsk diff --git a/graphics/dhgr_viewer/zp.inc b/graphics/dgr_viewer/zp.inc similarity index 100% rename from graphics/dhgr_viewer/zp.inc rename to graphics/dgr_viewer/zp.inc diff --git a/graphics/dhgr/Makefile b/graphics/dhgr/Makefile index 48dde762..15ebb017 100644 --- a/graphics/dhgr/Makefile +++ b/graphics/dhgr/Makefile @@ -5,8 +5,10 @@ TOKENIZE = ../../utils/asoft_basic-utils/tokenize_asoft all: dhgr.dsk -dhgr.dsk: RASTER RASTER2 RASTER3 RASTER4 BITS LOTS + +dhgr.dsk: HELLO RASTER RASTER2 RASTER3 RASTER4 BITS LOTS cp empty.dsk dhgr.dsk + $(DOS33) -y plasma.dsk SAVE A HELLO $(DOS33) -y dhgr.dsk BSAVE -a 0x0300 RASTER $(DOS33) -y dhgr.dsk BSAVE -a 0x0300 RASTER2 $(DOS33) -y dhgr.dsk BSAVE -a 0x0300 RASTER3 @@ -16,6 +18,11 @@ dhgr.dsk: RASTER RASTER2 RASTER3 RASTER4 BITS LOTS ### +HELLO: hello.bas + $(TOKENIZE) < hello.bas > HELLO + +### + RASTER: raster.o ld65 -o RASTER raster.o -C ../../linker_scripts/apple2_300.inc diff --git a/graphics/dhgr/hello.bas b/graphics/dhgr/hello.bas new file mode 100644 index 00000000..133a44bb --- /dev/null +++ b/graphics/dhgr/hello.bas @@ -0,0 +1,2 @@ +5 HOME +10 PRINT CHR$(4);"CATALOG" diff --git a/graphics/hgr/README b/graphics/hgr/README new file mode 100644 index 00000000..78eb1d52 --- /dev/null +++ b/graphics/hgr/README @@ -0,0 +1,7 @@ +some hgr programs + + +snowflake -- falling snowflake, used in an appleiibot demo + +starfield -- initial work on small starfield + diff --git a/graphics/hgr/Makefile b/graphics/hgr/snowflake/Makefile similarity index 100% rename from graphics/hgr/Makefile rename to graphics/hgr/snowflake/Makefile diff --git a/graphics/hgr/snowflake/README b/graphics/hgr/snowflake/README new file mode 100644 index 00000000..18f33827 --- /dev/null +++ b/graphics/hgr/snowflake/README @@ -0,0 +1,2 @@ +code for making a falling snowflake + diff --git a/graphics/hgr/apple2_custom.inc b/graphics/hgr/snowflake/apple2_custom.inc similarity index 100% rename from graphics/hgr/apple2_custom.inc rename to graphics/hgr/snowflake/apple2_custom.inc diff --git a/graphics/hgr/snowflake/blah.c b/graphics/hgr/snowflake/blah.c new file mode 100644 index 00000000..47c774d0 --- /dev/null +++ b/graphics/hgr/snowflake/blah.c @@ -0,0 +1,47 @@ +#include + +char data[12*6]={ + 0x00,0x00,0x40,0x01,0x00,0x00, + 0x00,0x00,0x0C,0x18,0x00,0x00, + 0x00,0x00,0x70,0x07,0x00,0x00, + 0x00,0x00,0x43,0x61,0x00,0x00, + 0x00,0x00,0x4C,0x19,0x00,0x00, + 0x33,0x00,0x70,0x07,0x00,0x66, + 0x30,0x06,0x40,0x01,0x30,0x06, + 0x3f,0x06,0x40,0x01,0x30,0x7e, + 0x40,0x07,0x30,0x06,0x70,0x01, + 0x7c,0x07,0x30,0x06,0x70,0x1f, + 0x00,0x18,0x0F,0x78,0x0C,0x00, + 0x00,0x60,0x40,0x01,0x03,0x00, +}; + +int main(int argc, char **argv) { + + int i,j,k,b,n,total=0,min=72; + + for(k=0;k<255;k++) { + for(j=0;j<255;j++) { + total=0; + for(i=0;i<12*6;i++) { + b=data[i]; + n=b; + + n=n>>j; + n=n^k; + +// n=n/2; + +// if ((n<0x20) || (n>0x5f)) { + if ((n<0x20) || (n>0x7e)) { +// printf("%x %x out of range\n",b,n); + total++; + } + } + printf("%d,%d: Total %d / %d\n",j,k,total,12*6); + if (total + +char data[12*6]={ + 0x00,0x00,0x40,0x01,0x00,0x00, + 0x00,0x00,0x0C,0x18,0x00,0x00, + 0x00,0x00,0x70,0x07,0x00,0x00, + 0x00,0x00,0x43,0x61,0x00,0x00, + 0x00,0x00,0x4C,0x19,0x00,0x00, + 0x33,0x00,0x70,0x07,0x00,0x66, + 0x30,0x06,0x40,0x01,0x30,0x06, + 0x3f,0x06,0x40,0x01,0x30,0x7e, + 0x40,0x07,0x30,0x06,0x70,0x01, + 0x7c,0x07,0x30,0x06,0x70,0x1f, + 0x00,0x18,0x0F,0x78,0x0C,0x00, + 0x00,0x60,0x40,0x01,0x03,0x00, +}; + +char tokens[100]; +char freq[100]; + +int main(int argc, char **argv) { + + int i,j,b,total=0; + + for(i=0;i<12*6;i++) { + b=data[i]; + for(j=0;j + +char data[12*6]={ + 0x00,0x00,0x40,0x01,0x00,0x00, + 0x00,0x00,0x0C,0x18,0x00,0x00, + 0x00,0x00,0x70,0x07,0x00,0x00, + 0x00,0x00,0x43,0x61,0x00,0x00, + 0x00,0x00,0x4C,0x19,0x00,0x00, + 0x33,0x00,0x70,0x07,0x00,0x66, + 0x30,0x06,0x40,0x01,0x30,0x06, + 0x3f,0x06,0x40,0x01,0x30,0x7e, + 0x40,0x07,0x30,0x06,0x70,0x01, + 0x7c,0x07,0x30,0x06,0x70,0x1f, + 0x00,0x18,0x0F,0x78,0x0C,0x00, + 0x00,0x60,0x40,0x01,0x03,0x00, +}; + +int tokens[100]; +int freq[100]; + +int main(int argc, char **argv) { + + int i,j,b,total=0; + + for(i=0;i<12*6;i+=2) { + b=(data[i]<<8)|data[i+1]; + for(j=0;j 32 multiply + ;===================== + ;===================== + ; destroys NUM2 +mult16: + lda #0 ; Initialize RESULT to 0 + sta RESULT+2 + ldx #16 ; There are 16 bits in NUM2 +L1: + lsr NUM2+1 ; top part of 16 bit shift right + ror NUM2 + bcc L2 ; 0 or 1? + tay ; If 1, add NUM1 (hi byte of RESULT is in A) + clc + lda NUM1 + adc RESULT+2 + sta RESULT+2 + tya + adc NUM1+1 +L2: + ror ; "Stairstep" shift + ror RESULT+2 + ror RESULT+1 + ror RESULT + dex + bne L1 + sta RESULT+3 + + rts diff --git a/graphics/hgr/starfield/stars.s b/graphics/hgr/starfield/stars.s new file mode 100644 index 00000000..df202606 --- /dev/null +++ b/graphics/hgr/starfield/stars.s @@ -0,0 +1,49 @@ +GBASL = $26 +GBASH = $27 +HGRPAGE = $E6 + +PAGE0 = $C054 +PAGE1 = $C055 + +HGR = $F3E2 +HGR2 = $F3D8 +HCLR = $F3F2 +HPOSN = $F411 +WAIT = $FCA8 ;; delay 1/2(26+27A+5A^2) us + +stars: + jsr HGR + jsr HGR2 +; lda #0 +; sta ybase + lda #$20 + sta HGRPAGE + +move_stars: + lda HGRPAGE + cmp #$20 + beq show_page1 +show_page2: + bit PAGE1 + lsr HGRPAGE + bne doit + +show_page1: + bit PAGE0 + asl HGRPAGE + +doit: + jsr HCLR + + ; FORI=1TO10 + ; A=X(I) + ; B=Y(I) + ; C=Z(I)*.1 + ; X(I)=A+(A-140)*C + ; Y(I)=B+(B-96)*C + ; Z(I)=Z(I)+.1 + ; IFX(I)<0ORX(I)>279ORY(I)<0ORY(I)>191THENX(I)=RND(1)*280:Y(I)=RND(1)*192:Z(I)=0:GOTO7 + ;HPLOTA,BTOX(I),Y(I) + ;NEXTI + + jmp move_stars