From c6f00818c261f8106ade0b3c658cba82625a5505 Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Sun, 6 Dec 2020 00:47:52 -0500 Subject: [PATCH] appleiibot: trying to shrink snow --- appleiibot/convert_qkumba.c | 2 +- hgr/Makefile | 14 ++- hgr/snow2.s | 208 ++++++++++++++++++++++++------------ 3 files changed, 151 insertions(+), 73 deletions(-) diff --git a/appleiibot/convert_qkumba.c b/appleiibot/convert_qkumba.c index 605d4b12..33f36571 100644 --- a/appleiibot/convert_qkumba.c +++ b/appleiibot/convert_qkumba.c @@ -22,7 +22,7 @@ int main(int argc, char **argv) { enc[e]=0; printf("%s\n",enc); - printf("2FORI=0TO%d:C%%=(PEEK(%d+I/3)-32)/4^(I-INT(I/3)*3):POKE768+I,C%%+4*(PEEK(2054+I)-32-INT(C%%/4)):NEXT:CALL768\n", + printf("2FORI=0TO%d:C=(PEEK(%d+I/3)-32)/4^(I-INT(I/3)*3):POKE768+I,C+4*(PEEK(2054+I)-32-INT(C/4)):NEXT:CALL768\n", filesize,2054+filesize); // note, peek/poke truncate? diff --git a/hgr/Makefile b/hgr/Makefile index 6be621ff..3fe1e9ea 100644 --- a/hgr/Makefile +++ b/hgr/Makefile @@ -5,9 +5,10 @@ TOKENIZE = ../asoft_basic-utils/tokenize_asoft all: hgr.dsk -hgr.dsk: SNOW +hgr.dsk: SNOW SNOW2 cp empty.dsk hgr.dsk $(DOS33) -y hgr.dsk BSAVE -a 0x0300 SNOW + $(DOS33) -y hgr.dsk BSAVE -a 0x0300 SNOW2 ### @@ -19,5 +20,14 @@ snow.o: snow.s ### +SNOW2: snow2.o + ld65 -o SNOW2 snow2.o -C ../linker_scripts/apple2_300.inc + +snow2.o: snow2.s + ca65 -o snow2.o snow2.s -l snow2.lst + + +### + clean: - rm -f *~ *.o *.lst SNOW + rm -f *~ *.o *.lst SNOW SNOW2 diff --git a/hgr/snow2.s b/hgr/snow2.s index 54fe49ef..8cdc68f8 100644 --- a/hgr/snow2.s +++ b/hgr/snow2.s @@ -1,109 +1,114 @@ -GBASL = $26 -GBASH = $27 -HGRPAGE = $E6 +; a snowflake -PAGE0 = $C054 -PAGE1 = $C055 +; 216 bytes +; 209 -- remove extraneous call to HGR +; 207 -- use bvc to check page +; 203 -- hardcode x coords +; 199 -- line in ZP +; 192 -- ybase in ZP +; 171 -- remove self-modifying code +; 167 -- remove YBASE ininitialization +; 161 -- only fall to 128 then recycle -HGR = $F3E2 -HGR2 = $F3D8 +GBASL = $26 +GBASH = $27 +HGRPAGE = $E6 + +YLO = $FC +XIDX = $FD +YBASE = $FE +LINE = $FF + +PAGE0 = $C054 +PAGE1 = $C055 + +HGR = $F3E2 +HGR2 = $F3D8 HCLR = $F3F2 HPOSN = $F411 -WAIT = $FCA8 ;; delay 1/2(26+27A+5A^2) us + snow: - jsr HGR - jsr HGR2 - lda #0 - sta ybase - lda #$20 - sta HGRPAGE + jsr HGR2 ; 3 move_snow: - lda HGRPAGE - cmp #$20 - beq show_page1 + lda #0 ; 2 + sta XIDX ; 2 + + ; 17 bytes to set page + + bit HGRPAGE ; V set if $40 ; 3 + bvc show_page1 ; 2 + show_page2: - bit PAGE1 - lsr HGRPAGE - bne doit + bit PAGE1 ; 3 + lsr HGRPAGE ; 2 + bne doit ; 2 show_page1: - bit PAGE0 - asl HGRPAGE + bit PAGE0 ; 3 + asl HGRPAGE ; 2 doit: jsr HCLR - lda # 0 0 00 00 00 - 0 00 00 00 0 + ; 08 000100 -> 0 1 00 00 00 - 0 00 00 00 1 + +; lda flake2,X +; asl +; php +; ror out +; plp +; ror out + +;flake2: +; .byte $00,$08,$00 +; .byte $00,$22,$00 +; .byte $00,$1C,$00 +; .byte $00,$49,$00 +; .byte $00,$2A,$00 +; .byte $60,$1C,$05 +; .byte $14,$08,$14 +; .byte $74,$08,$17 +; .byte $0C,$14,$18 +; .byte $3C,$14,$1E +; .byte $02,$63,$20 +; .byte $01,$08,$40 + +