graphics: update some more

This commit is contained in:
Vince Weaver 2021-01-05 18:36:47 -05:00
parent aca81442f5
commit 2f8fd94602
5 changed files with 149 additions and 6 deletions

23
graphics/gr/Makefile Normal file
View File

@ -0,0 +1,23 @@
include ../../Makefile.inc
DOS33 = ../../utils/dos33fs-utils/dos33
TOKENIZE = ../../utils/asoft_basic-utils/tokenize_asoft
all: gr.dsk
gr.dsk: SNOW
cp empty.dsk gr.dsk
$(DOS33) -y gr.dsk BSAVE -a 0x0300 SNOW
###
SNOW: snow.o
ld65 -o SNOW snow.o -C ../../linker_scripts/apple2_300.inc
snow.o: snow.s
ca65 -o snow.o snow.s -l snow.lst
###
clean:
rm -f *~ *.o *.lst SNOW

BIN
graphics/gr/empty.dsk Normal file

Binary file not shown.

BIN
graphics/gr/gr.dsk Normal file

Binary file not shown.

120
graphics/gr/snow.s Normal file
View File

@ -0,0 +1,120 @@
GBASL = $26
GBASH = $27
HGRPAGE = $E6
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
move_snow:
lda HGRPAGE
cmp #$20
beq show_page1
show_page2:
bit PAGE1
lsr HGRPAGE
bne doit
show_page1:
bit PAGE0
asl HGRPAGE
doit:
jsr HCLR
lda #<flake
sta ll_smc+1
lda #$18
sta c_smc
lda #$69
sta dir_smc
lda #23
sta line
inc ybase
lda ybase
sta ylo
cmp #160
bne snow_loop
lda #0
sta ybase
snow_loop:
ldy xhi
ldx xlo
lda ylo
jsr HPOSN
ldx #0
line_loop:
ll_smc:
lda flake,X
sta (GBASL),Y
inx
iny
cpx #6
bne line_loop
lda ll_smc+1
c_smc:
clc
dir_smc:
adc #6
sta ll_smc+1
inc ylo
dec line
beq forever
lda line
cmp #12
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
flake:
.byte $00,$00,$40,$01,$00,$00
.byte $00,$00,$0C,$18,$00,$00
.byte $00,$00,$70,$07,$00,$00
.byte $00,$00,$43,$61,$00,$00
.byte $00,$00,$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

View File

@ -1,8 +1,8 @@
include ../Makefile.inc
include ../../Makefile.inc
DOS33 = ../dos33fs-utils/dos33
TOKENIZE = ../asoft_basic-utils/tokenize_asoft
PNG2DHGR = ../hgr-utils/png2dhgr
DOS33 = ../../utils/dos33fs-utils/dos33
TOKENIZE = ../../utils/asoft_basic-utils/tokenize_asoft
PNG2DHGR = ../../utils/hgr-utils/png2dhgr
all: gr_viewer.dsk
@ -15,12 +15,12 @@ gr_viewer.dsk: HELLO LOADER
###
HELLO: hello.bas
../asoft_basic-utils/tokenize_asoft < hello.bas > HELLO
$(TOKENIZER) < hello.bas > HELLO
###
LOADER: loader.o
ld65 -o LOADER loader.o -C ../linker_scripts/apple2_1000.inc
ld65 -o LOADER loader.o -C ../../linker_scripts/apple2_1000.inc
loader.o: loader.s
ca65 -o loader.o loader.s -l loader.lst