diff --git a/basic/appleiibot/Makefile b/basic/appleiibot/Makefile index 234e9f2c..56ebf973 100644 --- a/basic/appleiibot/Makefile +++ b/basic/appleiibot/Makefile @@ -27,7 +27,7 @@ appleiibot.dsk: E2.BAS FLAME.BAS FLAME2.BAS HELLO \ OOZE.BAS HORIZ_STAR.BAS PLANET.BAS SECRET_COLLECT.BAS PLANET_GR.BAS \ BOXES.BAS SOLARIS.BAS SOLARIS2.BAS ASPLODE.BAS SOLARIS3.BAS \ TARGET.BAS ELITE.BAS MYSTERY.BAS OFFICE.BAS GR_XOR.BAS \ - LARGE_XOR.BAS + LARGE_XOR.BAS PAR_XOR.BAS cp $(EMPTY_DISK)/empty_lots_of_dirents.dsk appleiibot.dsk # cp empty.dsk appleiibot.dsk # $(DOS33) -y appleiibot.dsk BSAVE -a 0x0300 LOAD @@ -143,6 +143,7 @@ appleiibot.dsk: E2.BAS FLAME.BAS FLAME2.BAS HELLO \ $(DOS33) -y appleiibot.dsk SAVE A OFFICE.BAS $(DOS33) -y appleiibot.dsk SAVE A GR_XOR.BAS $(DOS33) -y appleiibot.dsk SAVE A LARGE_XOR.BAS + $(DOS33) -y appleiibot.dsk SAVE A PAR_XOR.BAS #### @@ -800,6 +801,11 @@ GR_XOR.BAS: gr_xor.bas LARGE_XOR.BAS: large_xor.bas $(TOKENIZE) < large_xor.bas > LARGE_XOR.BAS +#### + +PAR_XOR.BAS: par_xor.bas + $(TOKENIZE) < par_xor.bas > PAR_XOR.BAS + #### diff --git a/basic/appleiibot/par_xor.bas b/basic/appleiibot/par_xor.bas new file mode 100644 index 00000000..d4da9aa7 --- /dev/null +++ b/basic/appleiibot/par_xor.bas @@ -0,0 +1,2 @@ +1FORI=0TO126:POKE889+I,4*PEEK(2125+I)-204+(PEEK(2252+I/3)-35)/4^(I-INT(I/3)*3):NEXT +2&"/@qJ3'3Z5X$G$GPG@#@',C#5& diff --git a/graphics/gr/parallax/Makefile b/graphics/gr/parallax/Makefile index 3c405d1c..079e6b61 100644 --- a/graphics/gr/parallax/Makefile +++ b/graphics/gr/parallax/Makefile @@ -8,13 +8,15 @@ TOKENIZE = ../../../utils/asoft_basic-utils/tokenize_asoft all: paralax.dsk -paralax.dsk: HELLO BOXES BOXES_BOT LARGE LARGE_BOT +paralax.dsk: HELLO BOXES BOXES_BOT LARGE LARGE_BOT PAR PAR_BOT cp $(EMPTY_DISK) paralax.dsk $(DOS33) -y paralax.dsk SAVE A HELLO $(DOS33) -y paralax.dsk BSAVE -a 0xc00 BOXES $(DOS33) -y paralax.dsk BSAVE -a 0x3B7 BOXES_BOT $(DOS33) -y paralax.dsk BSAVE -a 0xc00 LARGE $(DOS33) -y paralax.dsk BSAVE -a 0x386 LARGE_BOT + $(DOS33) -y paralax.dsk BSAVE -a 0xc00 PAR + $(DOS33) -y paralax.dsk BSAVE -a 0x379 PAR_BOT ### @@ -32,6 +34,15 @@ LARGE: large.o large.o: large.s ca65 -o large.o large.s -l large.lst +### + +PAR: par.o + ld65 -o PAR par.o -C $(LINKER_DIR)/apple2_c00.inc + +par.o: par.s + ca65 -o par.o par.s -l par.lst + + ### @@ -52,6 +63,15 @@ large_bot.o: large_bot.s ### +PAR_BOT: par_bot.o + ld65 -o PAR_BOT par_bot.o -C $(LINKER_DIR)/apple2_379.inc + +par_bot.o: par_bot.s + ca65 -o par_bot.o par_bot.s -l par_bot.lst + + +### + HELLO: hello.bas $(TOKENIZE) < hello.bas > HELLO @@ -60,5 +80,5 @@ HELLO: hello.bas clean: - rm -f *~ *.o *.lst HELLO BOXES *.zip + rm -f *~ *.o *.lst HELLO BOXES BOXES_BOT LARGE LARGE_BOT PAR PAR_BOT diff --git a/graphics/gr/parallax/par.s b/graphics/gr/parallax/par.s new file mode 100644 index 00000000..9b8462e2 --- /dev/null +++ b/graphics/gr/parallax/par.s @@ -0,0 +1,225 @@ +; Parallax + +; by deater (Vince Weaver) + + +; Zero Page +GBASL = $26 +GBASH = $27 +H2 = $2C +COLOR = $30 + +FRAME = $EA +FRAME2 = $EB +FRAME4 = $EC + +X2 = $FB +COLORS = $FC + +PAGE = $FD + +; Soft Switches +KEYPRESS= $C000 +KEYRESET= $C010 +SET_GR = $C050 ; Enable graphics +FULLGR = $C052 ; Full screen, no text +PAGE1 = $C054 ; Page1 +PAGE2 = $C055 ; Page2 +LORES = $C056 ; Enable LORES graphics + +; ROM routines + +PLOT = $F800 ; plot, horiz=y, vert=A (A trashed, XY Saved) +SETCOL = $F864 +GBASCALC= $F847 ;; take Y-coord/2 in A, put address in GBASL/H ( a trashed, C clear) + +SETGR = $FB40 +HOME = $FC58 ;; Clear the text screen +WAIT = $FCA8 ;; delay 1/2(26+27A+5A^2) us +HLINE = $F819 + + + +parallax: + + ;=================== + ; init screen + jsr SETGR ; 3 + bit FULLGR ; 3 + + lda #$0 + sta PAGE + +parallax_forever: + + inc FRAME ; 2 + lda FRAME + lsr + sta FRAME2 + lsr + sta FRAME4 + + ;======================== + ; update color + + lda FRAME + +; lsr +; lsr +; lsr +; lsr +; lsr +; and #$3 + +; tax +; lda colors,X +; sta COLORS + + + ;========================== + ; flip page + + lda PAGE + pha + + lsr + lsr + tay + lda PAGE1,Y + + pla + + eor #$4 + sta PAGE + + + ;======================== + ; setup for 23 lines + + ldx #23 ; 2 + +yloop: + + ;============== + ; point GBASL/GBSAH to current line + + txa + jsr GBASCALC + lda GBASH + clc + adc PAGE + sta GBASH + + ;============== + ; current column (work backwards) + + ldy #39 ; 2 +xloop: + + lda #0 + sta COLORS + + ; calculate colors + ; color = (XX-FRAME)^(YY) + + + ;=========================== + ; SMALL + + sec ; subtract frame from Y + tya + + sbc FRAME4 + + sta X2 + + txa + + eor X2 + and #$2 + + beq skip_color_small + lda #$4c +; lda #$1b + sta COLORS +skip_color_small: + + + ;=========================== + ; MEDIUM + + sec ; subtract frame from Y + tya + + sbc FRAME2 + + sta X2 + + txa + clc + adc #1 + + eor X2 + and #$4 + + beq skip_color_medium + lda #$26 + sta COLORS +skip_color_medium: + + + + ;=========================== + ; LARGE + + sec ; subtract frame from Y + tya + + sbc FRAME + + sta X2 + + txa + clc + adc #2 + + eor X2 + and #$8 + + beq skip_color_large + lda #$1B +; lda #$4c + sta COLORS +skip_color_large: + + ;======================== + ; actually draw color + + + lda COLORS + sta (GBASL),Y + + + dey ; 1 + bpl xloop ; 2 + + dex ; 1 + + bpl yloop ; 2 + + bmi parallax_forever ; 2 + + ; 00 = right + ; 01 = up + ; 10 = left + ; 11 = down + ; adc = $65 + ; sbc = $E5 + + + + +; for bot + ; $3F5 - 127 + 3 = $379 + + jmp parallax diff --git a/graphics/gr/parallax/par_bot.s b/graphics/gr/parallax/par_bot.s new file mode 100644 index 00000000..9b8462e2 --- /dev/null +++ b/graphics/gr/parallax/par_bot.s @@ -0,0 +1,225 @@ +; Parallax + +; by deater (Vince Weaver) + + +; Zero Page +GBASL = $26 +GBASH = $27 +H2 = $2C +COLOR = $30 + +FRAME = $EA +FRAME2 = $EB +FRAME4 = $EC + +X2 = $FB +COLORS = $FC + +PAGE = $FD + +; Soft Switches +KEYPRESS= $C000 +KEYRESET= $C010 +SET_GR = $C050 ; Enable graphics +FULLGR = $C052 ; Full screen, no text +PAGE1 = $C054 ; Page1 +PAGE2 = $C055 ; Page2 +LORES = $C056 ; Enable LORES graphics + +; ROM routines + +PLOT = $F800 ; plot, horiz=y, vert=A (A trashed, XY Saved) +SETCOL = $F864 +GBASCALC= $F847 ;; take Y-coord/2 in A, put address in GBASL/H ( a trashed, C clear) + +SETGR = $FB40 +HOME = $FC58 ;; Clear the text screen +WAIT = $FCA8 ;; delay 1/2(26+27A+5A^2) us +HLINE = $F819 + + + +parallax: + + ;=================== + ; init screen + jsr SETGR ; 3 + bit FULLGR ; 3 + + lda #$0 + sta PAGE + +parallax_forever: + + inc FRAME ; 2 + lda FRAME + lsr + sta FRAME2 + lsr + sta FRAME4 + + ;======================== + ; update color + + lda FRAME + +; lsr +; lsr +; lsr +; lsr +; lsr +; and #$3 + +; tax +; lda colors,X +; sta COLORS + + + ;========================== + ; flip page + + lda PAGE + pha + + lsr + lsr + tay + lda PAGE1,Y + + pla + + eor #$4 + sta PAGE + + + ;======================== + ; setup for 23 lines + + ldx #23 ; 2 + +yloop: + + ;============== + ; point GBASL/GBSAH to current line + + txa + jsr GBASCALC + lda GBASH + clc + adc PAGE + sta GBASH + + ;============== + ; current column (work backwards) + + ldy #39 ; 2 +xloop: + + lda #0 + sta COLORS + + ; calculate colors + ; color = (XX-FRAME)^(YY) + + + ;=========================== + ; SMALL + + sec ; subtract frame from Y + tya + + sbc FRAME4 + + sta X2 + + txa + + eor X2 + and #$2 + + beq skip_color_small + lda #$4c +; lda #$1b + sta COLORS +skip_color_small: + + + ;=========================== + ; MEDIUM + + sec ; subtract frame from Y + tya + + sbc FRAME2 + + sta X2 + + txa + clc + adc #1 + + eor X2 + and #$4 + + beq skip_color_medium + lda #$26 + sta COLORS +skip_color_medium: + + + + ;=========================== + ; LARGE + + sec ; subtract frame from Y + tya + + sbc FRAME + + sta X2 + + txa + clc + adc #2 + + eor X2 + and #$8 + + beq skip_color_large + lda #$1B +; lda #$4c + sta COLORS +skip_color_large: + + ;======================== + ; actually draw color + + + lda COLORS + sta (GBASL),Y + + + dey ; 1 + bpl xloop ; 2 + + dex ; 1 + + bpl yloop ; 2 + + bmi parallax_forever ; 2 + + ; 00 = right + ; 01 = up + ; 10 = left + ; 11 = down + ; adc = $65 + ; sbc = $E5 + + + + +; for bot + ; $3F5 - 127 + 3 = $379 + + jmp parallax diff --git a/linker_scripts/apple2_379.inc b/linker_scripts/apple2_379.inc new file mode 100644 index 00000000..847195ff --- /dev/null +++ b/linker_scripts/apple2_379.inc @@ -0,0 +1,12 @@ +MEMORY { + ZP: start = $00, size = $1A, type = rw; + RAM: start = $379, 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; +}