diff --git a/autumn/Makefile b/autumn/Makefile deleted file mode 100644 index 3827c269..00000000 --- a/autumn/Makefile +++ /dev/null @@ -1,34 +0,0 @@ -include ../Makefile.inc - -DOS33 = ../dos33fs-utils/dos33 -PNG_TO_40x96 = ../gr-utils/png_to_40x96 -PNG_TO_40x48D = ../gr-utils/png_to_40x48d -PNG2RLE = ../gr-utils/png2rle -B2D = ../bmp2dhr/b2d - -all: autumn.dsk - -autumn.dsk: HELLO AUTUMN - cp empty.dsk autumn.dsk - $(DOS33) -y autumn.dsk SAVE A HELLO - $(DOS33) -y autumn.dsk BSAVE -a 0x1000 AUTUMN - - -AUTUMN: autumn.o - ld65 -o AUTUMN autumn.o -C ../linker_scripts/apple2_1000.inc - -autumn.o: autumn.s - ca65 -o autumn.o autumn.s -l autumn.lst - -### - - -HELLO: hello.bas - ../asoft_basic-utils/tokenize_asoft < hello.bas > HELLO - -#### - -clean: - rm -f *~ *.o *.lst HELLO AUTUMN - - diff --git a/autumn/hello.bas b/autumn/hello.bas deleted file mode 100644 index c29c77a7..00000000 --- a/autumn/hello.bas +++ /dev/null @@ -1,4 +0,0 @@ -5 HOME -100 PRINT "SOME DEMOS BASED ON" -110 PRINT "HELLMOOD'S AUTUMN" -120 PRINT CHR$(4);"CATALOG" diff --git a/seasons/Makefile b/seasons/Makefile new file mode 100644 index 00000000..4a40e26b --- /dev/null +++ b/seasons/Makefile @@ -0,0 +1,35 @@ +include ../Makefile.inc + +DOS33 = ../dos33fs-utils/dos33 +PNG_TO_40x96 = ../gr-utils/png_to_40x96 +PNG_TO_40x48D = ../gr-utils/png_to_40x48d +PNG2RLE = ../gr-utils/png2rle +B2D = ../bmp2dhr/b2d + +all: seasons.dsk + +seasons.dsk: HELLO SEASONS + cp empty.dsk seasons.dsk + $(DOS33) -y seasons.dsk SAVE A HELLO + $(DOS33) -y seasons.dsk BSAVE -a 0x50 SEASONS + + +SEASONS: seasons.o +# ld65 -o SEASONS seasons.o -C ../linker_scripts/apple2_1000.inc + ld65 -o SEASONS seasons.o -C ../linker_scripts/apple2_50_zp.inc + +seasons.o: seasons.s + ca65 -o seasons.o seasons.s -l seasons.lst + +### + + +HELLO: hello.bas + ../asoft_basic-utils/tokenize_asoft < hello.bas > HELLO + +#### + +clean: + rm -f *~ *.o *.lst HELLO SEASONS + + diff --git a/autumn/empty.dsk b/seasons/empty.dsk similarity index 100% rename from autumn/empty.dsk rename to seasons/empty.dsk diff --git a/seasons/hello.bas b/seasons/hello.bas new file mode 100644 index 00000000..99f60e6d --- /dev/null +++ b/seasons/hello.bas @@ -0,0 +1,6 @@ +5 HOME +100 PRINT " APPLE II SEASONS 128B DEMO" +110 PRINT " -=DESIRE=- / OUTLINE 2020" +115 PRINT +117 PRINT "TO RUN, TYPE: BRUN SEASONS":PRINT +120 PRINT CHR$(4);"CATALOG" diff --git a/autumn/autumn.s b/seasons/seasons.s similarity index 69% rename from autumn/autumn.s rename to seasons/seasons.s index 2ddf5278..b4975dc5 100644 --- a/autumn/autumn.s +++ b/seasons/seasons.s @@ -1,26 +1,31 @@ -; Autumn, based on the code in Hellmood's Autumn +; Apple II Seasons -=DESiRE=- 128B Demo for Outline 2020 +; based on the code in Hellmood's 64B x86 demo "Autumn" ; by deater (Vince Weaver) ; DOS version is 64 bytes ; original Apple II 6502 port was 167 bytes ; I got it down to 126 bytes ; qkumba got it down to 116 +; color-cycling brought it back up to 127 bytes + +; To save space, runs from the zero page starting at $50 +; need to avoid $E0-$E5 used by the hgr/hplot routines ; Zero Page Addresses -XCOORDL = $F0 -XCOORDH = $F1 -YCOORDL = $F2 -YCOORDH = $F3 -EBP1 = $F4 -EBP2 = $F5 -EBP3 = $F6 -EBP4 = $F7 -COLORL = $F8 -COLORH = $F9 -SOUND = $FA -FRAMEL = $FB -FRAMEH = $FC +XCOORDL = $F3 +XCOORDH = $F4 +YCOORDL = $F5 +YCOORDH = $F6 +EBP1 = $F7 +EBP2 = $F8 +EBP3 = $F9 +EBP4 = $FA +COLORL = $FB +COLORH = $FC +SOUND = $FD +FRAMEL = $FE +FRAMEH = $FF ; Soft Switches KEYPRESS= $C000 @@ -37,9 +42,10 @@ HGR2 = $F3D8 ; Set full-screen hi-res mode using page 2 ($4000) HPLOT0 = $F457 ; Plot point, (Y,X) = Horizontal, (A=Vertical) HCOLOR = $F6EC ; Set color in X, must be 0..7 -XDRAW1 = $F661 +; use zero-page addressing to save space +.zeropage -autumn: +seasons: ;=================== ; init screen ; Instruction Length @@ -61,7 +67,7 @@ autumn: ; stx COLORH ; 2 -autumn_forever: +seasons_forever: ; save old Xcoord value to X/Y for later ; push/pop is 1 byte each but have to get @@ -156,7 +162,7 @@ label_11f: and #$7 ; 2 smc: - ora #$1 ; 2 + ora #$2 ; 2 tax ; 1 ; if using color lookup table @@ -165,46 +171,62 @@ smc: ; if ycoord negative, loop lda YCOORDH ; 2 - bmi autumn_forever ; 2 + bmi seasons_forever ; 2 ; if top bits of xcoord, loop lda XCOORDH ; 2 and #$f0 ; 2 - bne autumn_forever ; 2 + bne seasons_forever ; 2 put_pixel: ; actually set the color - jsr HCOLOR ; 3 + jsr HCOLOR ; 3 ; color is in X - ; set up paramaters for HPLOT call - ldx XCOORDL ; 2 + ; set up paramaters for HPLOT ROM call + ldx XCOORDL ; 2 ; x coord in (y:x) ldy XCOORDH ; 2 - lda YCOORDL ; 2 + lda YCOORDL ; 2 ; y coord in A jsr HPLOT0 ; 3 -; inc FRAMEL ; 2 -; bne no_frame ; 2 -; inc FRAMEH ; 2 -;no_frame: -; lda smc -; eor #$3 -; sta smc + ; flip palettes when color at $4200 (roughly 0,32 on screen) + ; changes. This is sort of arbitrary, but having a 16-bit counter + ; takes too many instructions and Apple II doesn't have a + ; programmable timer + lda $4200 ; 3 ; check colors at 0,32 + bmi seasons_forever ; 2 + + ; flip between blue/purple and orange/green palettes + ; with self-modifying code. 2 bytes are saved when + ; we execute in the zero page + lda smc+1 ; 2 + eor #$3 ; 2 + sta smc+1 ; 2 + + ; the adc/sbc in HPLOT0 leave the V flag clear + ; so we can save a byte (over jump) by using bvc + bvc seasons_forever ; 2 + + + + + ; Thankfully not necessary for a 128B demo? ; lda KEYPRESS ; 3 ; see if key pressed -; bpl autumn_forever ; 2 ; loop if not - - bvc autumn_forever ; 2 ; smaller than jump - ; V flag clear because - ; the adc/sbc in HPOSN - ; never overflows? - - +; bpl seasons_forever ; 2 ; loop if not +; bit KEYRESET exit_to_prompt: ; jsr TEXT ; 3 ; return to text mode ; jmp $3D0 ; 3 ; return to Applesoft prompt +;======================================================== +;======================================================== +; color lookup tables used when testing +; some of them look better, but make the executable bigger +; than the AND/OR version of setting colors + + ; Apple II Hi-Res Colors ; It's all NTSC artifacting and complex ; There can be color-clash at a 3.5 pixel level @@ -221,54 +243,27 @@ exit_to_prompt: color_lookup: - ; my default, colorful palette + ; colorful palette ; .byte $01,$01,$02,$03, $05,$05,$06,$07 -; or 10 -; 0000 0010 2 2 -; 0001 0011 3 2 -; 0010 0010 2 3 -; 0011 0011 3 6 -; 0100 0110 6 6 -; 0101 0111 7 6 -; 0110 0110 6 2 -; 0111 0111 7 7 - -; want eor1 -; 0000 0010 0001 -; 0001 0010 0000 -; 0010 0011 0011 -; 0011 0110 0010 -; 0100 0110 0101 -; 0101 0110 0100 -; 0110 0010 0111 -; 0111 0111 0110 - ; blue and purple palette ; .byte $02,$02,$03,$06, $06,$06,$02,$07 ; qkumba ora2 white/blue/purple ; .byte $02,$03,$02,$03, $06,$07,$06,$07 + ; ora1 white/orange/green +; .byte $01,$01,$03,$03, $05,$05,$07,$07 + + ; better mixed orange/green/white +; .byte $01,$03,$03,$03, $05,$05,$07,$07 + ; orange and green palette ; .byte $01,$01,$03,$05, $05,$05,$01,$07 -; .byte $01,$03,$01,$03, $05,$07,$05,$07 -; .byte $01,$01,$03,$03, $05,$05,$07,$07 - +; .byte $01,$00,$01,$00, $05,$00,$05,$00 ; "Leaf" Locations ; TOP-LEFT ?? CENTER-TOP TOP-RIGHT LEFT ?? CENTER-BOTTOM ?? - -; FANCY OPENER - -; SET ADDRESS in 1a/Ab -; lda #xx ; 2 -; sta 1a ; 2 -; lda #xx ; 2 -; sta 1b ; 2 -; lda angle ; 2 -; jsr xdraw1 ; 3 - diff --git a/autumn/x86/Makefile b/seasons/x86/Makefile similarity index 100% rename from autumn/x86/Makefile rename to seasons/x86/Makefile diff --git a/autumn/x86/autumn.c b/seasons/x86/autumn.c similarity index 100% rename from autumn/x86/autumn.c rename to seasons/x86/autumn.c diff --git a/autumn/x86/autumn_asm.s b/seasons/x86/autumn_asm.s similarity index 100% rename from autumn/x86/autumn_asm.s rename to seasons/x86/autumn_asm.s diff --git a/autumn/x86/hellmood_autumn.c b/seasons/x86/hellmood_autumn.c similarity index 100% rename from autumn/x86/hellmood_autumn.c rename to seasons/x86/hellmood_autumn.c