mirror of
https://github.com/deater/dos33fsprogs.git
synced 2024-09-10 08:54:51 +00:00
appleiibot: trying to shrink snow
This commit is contained in:
parent
62858a0c57
commit
c6f00818c2
@ -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?
|
||||
|
14
hgr/Makefile
14
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
|
||||
|
208
hgr/snow2.s
208
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 #<flake
|
||||
sta ll_smc+1
|
||||
|
||||
lda #$18
|
||||
sta c_smc
|
||||
lda #$69
|
||||
sta dir_smc
|
||||
lda #23
|
||||
sta line
|
||||
sta LINE
|
||||
|
||||
inc ybase
|
||||
lda ybase
|
||||
sta ylo
|
||||
cmp #160
|
||||
bne snow_loop
|
||||
inc YBASE
|
||||
lda YBASE
|
||||
sta YLO
|
||||
; cmp #160
|
||||
; bcc snow_loop
|
||||
|
||||
lda #0
|
||||
sta ybase
|
||||
; lda #0
|
||||
and #$7f
|
||||
sta YBASE
|
||||
|
||||
snow_loop:
|
||||
ldy xhi
|
||||
ldx xlo
|
||||
lda ylo
|
||||
ldy #$0 ; xhi
|
||||
ldx #130 ; xlo -- (mult of 16)+2 for code to work
|
||||
ylo_smc:
|
||||
lda YLO ; ylo
|
||||
jsr HPOSN
|
||||
|
||||
ldx #0
|
||||
ldx XIDX
|
||||
line_loop:
|
||||
ll_smc:
|
||||
|
||||
lda flake,X
|
||||
sta (GBASL),Y
|
||||
|
||||
inx
|
||||
iny
|
||||
cpx #6
|
||||
bne line_loop
|
||||
tya
|
||||
and #$8
|
||||
beq line_loop
|
||||
|
||||
lda ll_smc+1
|
||||
c_smc:
|
||||
|
||||
lda XIDX
|
||||
|
||||
ldx LINE
|
||||
cpx #13
|
||||
bcc do_sub
|
||||
|
||||
do_add:
|
||||
clc
|
||||
dir_smc:
|
||||
adc #6
|
||||
sta ll_smc+1
|
||||
bne done_math
|
||||
do_sub:
|
||||
sec
|
||||
sbc #6
|
||||
|
||||
inc ylo
|
||||
dec line
|
||||
beq forever
|
||||
done_math:
|
||||
sta XIDX
|
||||
|
||||
lda line
|
||||
cmp #12
|
||||
inc YLO
|
||||
dec LINE
|
||||
beq move_snow
|
||||
bne snow_loop
|
||||
|
||||
lda #$E9 ; sbc imm
|
||||
sta dir_smc
|
||||
|
||||
lda #$38 ; sec
|
||||
sta c_smc
|
||||
|
||||
jmp snow_loop
|
||||
|
||||
forever:
|
||||
jmp move_snow
|
||||
|
||||
xhi: .byte $00
|
||||
xlo: .byte 77
|
||||
ybase: .byte 100
|
||||
ylo: .byte 100
|
||||
line: .byte 23
|
||||
|
||||
|
||||
; 6*12 = 72 bytes
|
||||
flake:
|
||||
.byte $00,$00,$40,$01,$00,$00
|
||||
.byte $00,$00,$0C,$18,$00,$00
|
||||
@ -118,3 +123,66 @@ flake:
|
||||
.byte $00,$18,$0F,$78,$0C,$00
|
||||
.byte $00,$60,$40,$01,$03,$00
|
||||
|
||||
;fluke:
|
||||
; .byte $00,$00,$40,$01,$00,$00
|
||||
; .byte $0C,$18,$00,$00
|
||||
; .byte $70,$07,$00,$00
|
||||
; .byte $43,$61,$00,$00
|
||||
; .byte $4C,$19,$00,$00
|
||||
; .byte $33,$00,$70,$07,$00,$66
|
||||
; .byte $30,$06,$40,$01,$30,$06
|
||||
; .byte $3f,$06,$40,$01,$30,$7e
|
||||
; .byte $40,$07,$30,$06,$70,$01
|
||||
; .byte $7c,$07,$30,$06,$70,$1f
|
||||
; .byte $00,$18,$0F,$78,$0C,$00
|
||||
; .byte $00,$60,$40,$01,$03,$00
|
||||
|
||||
;offsets:
|
||||
; .byte 0,4,8,12,16,
|
||||
|
||||
;floke:
|
||||
; .byte $0,$0,$1,$2,$0,$0
|
||||
; .byte $0,$0,$3,$4,$0,$0
|
||||
; .byte $0,$0,$5,$6,$0,$0
|
||||
; .byte $0,$0,$7,$8,$0,$0
|
||||
; .byte $0,$0,$9,$A,$0,$0
|
||||
; .byte $B,$0,$5,$6,$0,$C
|
||||
; .byte $D,$E,$1,$2,$d,$E
|
||||
; .byte $F,$E,$1,$2,$d,$7e
|
||||
; .byte $1,$6,$d,$e,$5,$01
|
||||
; .byte $7c,$6,$d,$e,$5,$1f
|
||||
; .byte $0,$4,$0F,$78,$3,$0
|
||||
; .byte $0,$60,$1,$2,$03,$0
|
||||
|
||||
|
||||
;tokens:
|
||||
; .byte $00,$40,$01,$0C
|
||||
; .byte $18,$70,$07,$43
|
||||
; .byte $61,$4C,$19,$33
|
||||
; .byte $66,$30,$06,$3F
|
||||
|
||||
; 00 000000 -> 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
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user