From 1647653f8ef0ee0cf733bdf19652eeebe0d823b7 Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Sat, 28 Jan 2023 23:24:49 -0500 Subject: [PATCH] lovebyte: more prep --- demos/lovebyte2023/gears_128/Makefile | 46 ++++ demos/lovebyte2023/gears_128/apple2_50_zp.inc | 12 + demos/lovebyte2023/gears_128/file_id.diz | 11 + demos/lovebyte2023/gears_128/gears_fancy.s | 208 ++++++++++++++++++ demos/lovebyte2023/gears_128/hello.bas | 9 + demos/lovebyte2023/lemm_256/file_id.diz | 6 +- demos/lovebyte2023/ooze_32/file_id.diz | 5 +- demos/lovebyte2023/ooze_32/hello.bas | 2 +- demos/lovebyte2023/pied_64/hello.bas | 2 +- graphics/hgr/shape_table/Makefile | 15 +- graphics/hgr/shape_table/gears_fancy.s | 208 ++++++++++++++++++ 11 files changed, 514 insertions(+), 10 deletions(-) create mode 100644 demos/lovebyte2023/gears_128/Makefile create mode 100644 demos/lovebyte2023/gears_128/apple2_50_zp.inc create mode 100644 demos/lovebyte2023/gears_128/file_id.diz create mode 100644 demos/lovebyte2023/gears_128/gears_fancy.s create mode 100644 demos/lovebyte2023/gears_128/hello.bas create mode 100644 graphics/hgr/shape_table/gears_fancy.s diff --git a/demos/lovebyte2023/gears_128/Makefile b/demos/lovebyte2023/gears_128/Makefile new file mode 100644 index 00000000..8593131c --- /dev/null +++ b/demos/lovebyte2023/gears_128/Makefile @@ -0,0 +1,46 @@ +include ../../../Makefile.inc + +DOS33 = ../../../utils/dos33fs-utils/dos33 +TOKENIZE = ../../../utils/asoft_basic-utils/tokenize_asoft +EMPTYDISK = ../../../empty_disk/empty.dsk + +all: parallax128.dsk + +parallax128.dsk: HELLO PAR_TINY + cp $(EMPTYDISK) parallax128.dsk + $(DOS33) -y parallax128.dsk SAVE A HELLO + $(DOS33) -y parallax128.dsk BSAVE -a 0x80 PAR_TINY + +### + +submit: parallax128.zip + +parallax128.zip: PAR_TINY par_tiny.s file_id.diz parallax128.dsk + mkdir -p lovebyte2023_parallax + cp PAR_TINY ./lovebyte2023_parallax + cp par_tiny.s ./lovebyte2023_parallax + cp file_id.diz ./lovebyte2023_parallax + cp parallax128.dsk ./lovebyte2023_parallax + cp parallax_720p.mp4 ./lovebyte2023_parallax + zip -r parallax128.zip lovebyte2023_parallax + +#### + + +#### + +HELLO: hello.bas + $(TOKENIZE) < hello.bas > HELLO + +### + +PAR_TINY: par_tiny.o + ld65 -o PAR_TINY par_tiny.o -C ./apple2_80_zp.inc + +par_tiny.o: par_tiny.s + ca65 -o par_tiny.o par_tiny.s -l par_tiny.lst + +#### + +clean: + rm -f *~ *.o *.lst HELLO PAR_TINY *.zip diff --git a/demos/lovebyte2023/gears_128/apple2_50_zp.inc b/demos/lovebyte2023/gears_128/apple2_50_zp.inc new file mode 100644 index 00000000..27eded04 --- /dev/null +++ b/demos/lovebyte2023/gears_128/apple2_50_zp.inc @@ -0,0 +1,12 @@ +MEMORY { + ZP: start = $50, size = $80, type = rw; + RAM: start = $50, 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 = ro; +} diff --git a/demos/lovebyte2023/gears_128/file_id.diz b/demos/lovebyte2023/gears_128/file_id.diz new file mode 100644 index 00000000..64927f30 --- /dev/null +++ b/demos/lovebyte2023/gears_128/file_id.diz @@ -0,0 +1,11 @@ +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + Gears 128 +------------------------------------- +Hi-res gear animation with clicking + +by Deater / dSr + +124-byte Intro for Apple II +(With 4-byte header) +Lovebyte 2023 + diff --git a/demos/lovebyte2023/gears_128/gears_fancy.s b/demos/lovebyte2023/gears_128/gears_fancy.s new file mode 100644 index 00000000..cf146a9f --- /dev/null +++ b/demos/lovebyte2023/gears_128/gears_fancy.s @@ -0,0 +1,208 @@ +; Rotating Gears (Fancy) +; 128 bytes (124 bytes + 4 byte header) + +; by Vince `deater` Weaver / dsr + +; Lovebyte 2023 + +; 95 bytes -- previous code +; 99 bytes -- add clicking +; 124 bytes -- add escapement (was originally trying for logo, but oh well) + +; zero page locations +HGR_SHAPE = $1A +HGR_SHAPE2 = $1B +HGR_BITS = $1C +GBASL = $26 +GBASH = $27 +A5H = $45 +XREG = $46 +YREG = $47 + ; C0-CF should be clear + ; D0-DF?? D0-D5 = HGR scratch? +HGR_DX = $D0 ; HGLIN +HGR_DX2 = $D1 ; HGLIN +HGR_DY = $D2 ; HGLIN +HGR_QUADRANT = $D3 +HGR_E = $D4 +HGR_E2 = $D5 +HGR_X = $E0 +HGR_X2 = $E1 +HGR_Y = $E2 +HGR_COLOR = $E4 +HGR_HORIZ = $E5 +HGR_SCALE = $E7 +HGR_SHAPE_TABLE = $E8 +HGR_SHAPE_TABLE2= $E9 +HGR_COLLISIONS = $EA + +ROTATION = $FA +;SMALLER = $FB +CURRENT_ROT = $FF + +; Soft Switches +PAGE1 = $C054 ; Page1 +PAGE2 = $C055 ; Page2 + + +; ROM calls +HGR2 = $F3D8 +HGR = $F3E2 +HPOSN = $F411 +DRAW0 = $F601 +XDRAW0 = $F65D +XDRAW1 = $F661 +WAIT = $FCA8 ;; delay 1/2(26+27A+5A^2) us +RESTORE = $FF3F + +.zeropage +.globalzp rot_smc +.globalzp smaller_smc +.globalzp which_smc +.globalzp dsr_rot_smc + +gears_tiny: + + ;============================ + ; scene 1 + ;============================ + + jsr HGR ; Hi-res, full screen ; 3 + ; Y=0, A=0 after this call + + lda #8 + sta HGR_SCALE + + jsr draw_scene + + ;=================== + ; scene2 + ;=================== + + jsr HGR2 ; set to hires PAGE2, full screen + ; Y=0, A=0 after + + + lda #shape_dsr + jsr XDRAW0 + + ; Y is zero from HGR/HGR2 + ldy #0 + ldx #110 + lda #10 + jsr HPOSN ; set screen position to X= (y,x) Y=(a) + ; saves X,Y,A to zero page + ; after Y= orig X/7 + ; A and X are ?? + + ldy #32 ; Y = steps to draw + lda #2 ; A = rotation increment + jsr draw_gear + ; A and X zero on return + + + tay ; set Y to 0 + ldx #235 + lda #100 + jsr HPOSN ; set screen position to X= (y,x) Y=(a) + ; saves X,Y,A to zero page + ; after Y= orig X/7 + ; A and X are ?? + + ldy #16 ; only 16 repeats + lda #4 ; A = rotation increment + + ; fall through + + ;=============================== + ;=============================== + ;=============================== + ;=============================== +draw_gear: + sty ROTATION ; set number of rotations + sta smaller_smc+1 ; set rotation increment + +gear1_loop: + + clc + lda rot_smc+1 +smaller_smc: + adc #2 + sta rot_smc+1 + +not_smaller: + +which_smc: + ldx #gear1_table ; point to top byte of shape address + ; this is always 0 if in zero page + +rot_smc: + lda #1 ; ROT=1 at first + + jsr XDRAW0 ; XDRAW 1 AT X,Y + ; Both A and X are 0 at exit + ; Z flag set on exit + ; Y varies + + dec ROTATION + bne gear1_loop + rts + + +gear1_table: +.byte $25,$35,$00 ; 37,53,0 +gear2_table: +.byte $2c,$2e,$00 ; 44,46,0 + + +shape_dsr: +.byte $2d,$36,$ff,$3f +;.byte $24,$ad,$22,$24,$94,$21,$2c,$4d +;.byte $91,$3f,$36 +.byte $00 + diff --git a/demos/lovebyte2023/gears_128/hello.bas b/demos/lovebyte2023/gears_128/hello.bas new file mode 100644 index 00000000..da6ab55a --- /dev/null +++ b/demos/lovebyte2023/gears_128/hello.bas @@ -0,0 +1,9 @@ +5 HOME +10 PRINT " GEARS -- A 124 BYTE APPLE II INTRO" +12 PRINT " FOR LOVEBYTE 2023" +15 PRINT " BY DEATER / DSR" +20 PRINT CHR$(4)"CATALOG" +25 PRINT:PRINT "PRESS ANY KEY TO 'BRUN GEARS_FANCY'" +30 GET A$ +35 PRINT +40 PRINT CHR$(4)"BRUN GEARS_FANCY" diff --git a/demos/lovebyte2023/lemm_256/file_id.diz b/demos/lovebyte2023/lemm_256/file_id.diz index 1a91e08f..5becff39 100644 --- a/demos/lovebyte2023/lemm_256/file_id.diz +++ b/demos/lovebyte2023/lemm_256/file_id.diz @@ -2,7 +2,9 @@ LEMM256 ------------------------------------- Animated Hi-res Lemming Walking Demo -251 byte BASIC program for Apple II -Lovebyte 2023 by Deater / dSr +251 byte BASIC program for Apple II +Lovebyte 2023 + + diff --git a/demos/lovebyte2023/ooze_32/file_id.diz b/demos/lovebyte2023/ooze_32/file_id.diz index 4b117f5a..0bbae941 100644 --- a/demos/lovebyte2023/ooze_32/file_id.diz +++ b/demos/lovebyte2023/ooze_32/file_id.diz @@ -2,10 +2,7 @@ Ooze32 --------------------------------------- Hi-res oozing waterfall +by Deater / dSr 31-byte Intro for Apple II Lovebyte 2023 - -by Deater / dSr - - diff --git a/demos/lovebyte2023/ooze_32/hello.bas b/demos/lovebyte2023/ooze_32/hello.bas index 97908663..8fca8ad5 100644 --- a/demos/lovebyte2023/ooze_32/hello.bas +++ b/demos/lovebyte2023/ooze_32/hello.bas @@ -1,5 +1,5 @@ 5 HOME -10 PRINT " OOZE32 -- A 31 BYTE APPLE II INTRO" +10 PRINT " OOZE32 -- A 31 BYTE APPLE II INTRO" 12 PRINT " FOR LOVEBYTE 2023" 15 PRINT " BY DEATER / DSR" 20 PRINT CHR$(4)"CATALOG" diff --git a/demos/lovebyte2023/pied_64/hello.bas b/demos/lovebyte2023/pied_64/hello.bas index 2db013d3..8429a953 100644 --- a/demos/lovebyte2023/pied_64/hello.bas +++ b/demos/lovebyte2023/pied_64/hello.bas @@ -1,5 +1,5 @@ 5 HOME -10 PRINT " PIED57 -- A 57 BYTE APPLE II INTRO" +10 PRINT " PIED57 -- A 57 BYTE APPLE II INTRO" 12 PRINT " FOR LOVEBYTE 2023" 15 PRINT " BY DEATER / DSR" 20 PRINT CHR$(4)"CATALOG" diff --git a/graphics/hgr/shape_table/Makefile b/graphics/hgr/shape_table/Makefile index c22fada6..c70b1b46 100644 --- a/graphics/hgr/shape_table/Makefile +++ b/graphics/hgr/shape_table/Makefile @@ -11,13 +11,14 @@ shape_table.dsk: HELLO APPLE.BAS GEARS.BAS \ APPLE2 GEARS LINE32 PATTERN PATTERN_LOGO SQUARE_WAVE \ AGONY17 HERRING16 STRIPE17 COOL_WAVE TEETH32 TICK_TOCK \ GEARS_TINY WEAVE15 COLUMNS16 CATS16 TEST EGGS16 WAVY16 \ - MIRROR15 FIELD15 + MIRROR15 FIELD15 GEARS_FANCY cp $(EMPTYDISK) shape_table.dsk $(DOS33) -y shape_table.dsk SAVE A HELLO $(DOS33) -y shape_table.dsk SAVE A GEARS.BAS $(DOS33) -y shape_table.dsk SAVE A APPLE.BAS $(DOS33) -y shape_table.dsk BSAVE -a 0x3f5 GEARS $(DOS33) -y shape_table.dsk BSAVE -a 0x60 GEARS_TINY + $(DOS33) -y shape_table.dsk BSAVE -a 0x50 GEARS_FANCY $(DOS33) -y shape_table.dsk BSAVE -a 0xc00 APPLE2 $(DOS33) -y shape_table.dsk BSAVE -a 0xc00 LINE32 $(DOS33) -y shape_table.dsk BSAVE -a 0xe7 AGONY17 @@ -70,6 +71,15 @@ GEARS_TINY: gears_tiny.o gears_tiny.o: gears_tiny.s ca65 -o gears_tiny.o gears_tiny.s -l gears_tiny.lst +### + +GEARS_FANCY: gears_fancy.o + ld65 -o GEARS_FANCY gears_fancy.o -C $(LINKERSCRIPTS)/apple2_50_zp.inc + +gears_fancy.o: gears_fancy.s + ca65 -o gears_fancy.o gears_fancy.s -l gears_fancy.lst + + ### @@ -244,5 +254,6 @@ clean: rm -f *~ *.o *.lst HELLO GEAR.BAS GEARS PATTERN APPLE.BAS \ PATTERN_LOGO COOL_WAVE SQUARE_WAVE TEETH32 TICK_TOCK \ HERRING16 STRIPE17 AGONY17 LINE32 APPLE2 GEARS_TINY WEAVE15 \ - COLUMNS16 CATS16 TEST EGGS16 WAVY16 MIRROR15 FIELD15 + COLUMNS16 CATS16 TEST EGGS16 WAVY16 MIRROR15 FIELD15 \ + GEARS_FANCY diff --git a/graphics/hgr/shape_table/gears_fancy.s b/graphics/hgr/shape_table/gears_fancy.s new file mode 100644 index 00000000..cf146a9f --- /dev/null +++ b/graphics/hgr/shape_table/gears_fancy.s @@ -0,0 +1,208 @@ +; Rotating Gears (Fancy) +; 128 bytes (124 bytes + 4 byte header) + +; by Vince `deater` Weaver / dsr + +; Lovebyte 2023 + +; 95 bytes -- previous code +; 99 bytes -- add clicking +; 124 bytes -- add escapement (was originally trying for logo, but oh well) + +; zero page locations +HGR_SHAPE = $1A +HGR_SHAPE2 = $1B +HGR_BITS = $1C +GBASL = $26 +GBASH = $27 +A5H = $45 +XREG = $46 +YREG = $47 + ; C0-CF should be clear + ; D0-DF?? D0-D5 = HGR scratch? +HGR_DX = $D0 ; HGLIN +HGR_DX2 = $D1 ; HGLIN +HGR_DY = $D2 ; HGLIN +HGR_QUADRANT = $D3 +HGR_E = $D4 +HGR_E2 = $D5 +HGR_X = $E0 +HGR_X2 = $E1 +HGR_Y = $E2 +HGR_COLOR = $E4 +HGR_HORIZ = $E5 +HGR_SCALE = $E7 +HGR_SHAPE_TABLE = $E8 +HGR_SHAPE_TABLE2= $E9 +HGR_COLLISIONS = $EA + +ROTATION = $FA +;SMALLER = $FB +CURRENT_ROT = $FF + +; Soft Switches +PAGE1 = $C054 ; Page1 +PAGE2 = $C055 ; Page2 + + +; ROM calls +HGR2 = $F3D8 +HGR = $F3E2 +HPOSN = $F411 +DRAW0 = $F601 +XDRAW0 = $F65D +XDRAW1 = $F661 +WAIT = $FCA8 ;; delay 1/2(26+27A+5A^2) us +RESTORE = $FF3F + +.zeropage +.globalzp rot_smc +.globalzp smaller_smc +.globalzp which_smc +.globalzp dsr_rot_smc + +gears_tiny: + + ;============================ + ; scene 1 + ;============================ + + jsr HGR ; Hi-res, full screen ; 3 + ; Y=0, A=0 after this call + + lda #8 + sta HGR_SCALE + + jsr draw_scene + + ;=================== + ; scene2 + ;=================== + + jsr HGR2 ; set to hires PAGE2, full screen + ; Y=0, A=0 after + + + lda #shape_dsr + jsr XDRAW0 + + ; Y is zero from HGR/HGR2 + ldy #0 + ldx #110 + lda #10 + jsr HPOSN ; set screen position to X= (y,x) Y=(a) + ; saves X,Y,A to zero page + ; after Y= orig X/7 + ; A and X are ?? + + ldy #32 ; Y = steps to draw + lda #2 ; A = rotation increment + jsr draw_gear + ; A and X zero on return + + + tay ; set Y to 0 + ldx #235 + lda #100 + jsr HPOSN ; set screen position to X= (y,x) Y=(a) + ; saves X,Y,A to zero page + ; after Y= orig X/7 + ; A and X are ?? + + ldy #16 ; only 16 repeats + lda #4 ; A = rotation increment + + ; fall through + + ;=============================== + ;=============================== + ;=============================== + ;=============================== +draw_gear: + sty ROTATION ; set number of rotations + sta smaller_smc+1 ; set rotation increment + +gear1_loop: + + clc + lda rot_smc+1 +smaller_smc: + adc #2 + sta rot_smc+1 + +not_smaller: + +which_smc: + ldx #gear1_table ; point to top byte of shape address + ; this is always 0 if in zero page + +rot_smc: + lda #1 ; ROT=1 at first + + jsr XDRAW0 ; XDRAW 1 AT X,Y + ; Both A and X are 0 at exit + ; Z flag set on exit + ; Y varies + + dec ROTATION + bne gear1_loop + rts + + +gear1_table: +.byte $25,$35,$00 ; 37,53,0 +gear2_table: +.byte $2c,$2e,$00 ; 44,46,0 + + +shape_dsr: +.byte $2d,$36,$ff,$3f +;.byte $24,$ad,$22,$24,$94,$21,$2c,$4d +;.byte $91,$3f,$36 +.byte $00 +