text: move

This commit is contained in:
Vince Weaver 2021-04-20 16:30:05 -04:00
parent 217a422ab7
commit fad5af7ac2
3 changed files with 113 additions and 0 deletions

View File

@ -0,0 +1,31 @@
include ../../Makefile.inc
DOS33 = ../../utils/dos33fs-utils/dos33
TOKENIZE = ../../utils/asoft_basic-utils/tokenize_asoft
LINKERSCRIPTS = ../../linker_scripts
EMPTYDISK = ../../empty_disk/empty.dsk
all: textscroll.dsk
textscroll.dsk: HELLO MOVE
cp $(EMPTYDISK) textscroll.dsk
$(DOS33) -y textscroll.dsk SAVE A HELLO
$(DOS33) -y textscroll.dsk BSAVE -a 0xC00 MOVE
###
HELLO: hello.bas
$(TOKENIZE) < hello.bas > HELLO
###
MOVE: move.o
ld65 -o MOVE move.o -C $(LINKERSCRIPTS)/apple2_c00.inc
move.o: move.s
ca65 -o move.o move.s -l move.lst
####
clean:
rm -f *~ *.o *.lst HELLO MOVE

View File

@ -0,0 +1,2 @@
5 HOME
10 PRINT CHR$(4);"CATALOG"

View File

@ -0,0 +1,80 @@
CH = $24
CV = $25
HGR = $F3E2
SETTXT = $FB39
TABV = $FB5B ; store A in CV and call MON_VTAB
STORADV = $FBF0 ; store A at (BASL),CH, advancing CH, trash Y
MON_VTAB = $FC22 ; VTAB to CV
VTABZ = $FC24 ; VTAB to value in A
HOME = $FC58
COUT = $FDED
COUT1 = $FDF0
COUTZ = $FDF6 ; cout but ignore inverse flag
ypos = $2000
xpos = $2100
move:
jsr HGR
jsr SETTXT
next_frame:
ldx #0
next_text:
lda xpos,X
bne not_new
new_text:
lda #30
sta xpos,X
txa
sta ypos,X
not_new:
lda xpos,X
sta CH
lda ypos,X
sta CV
jsr MON_VTAB
txa
pha
ldx #0
big_loop:
lda text,X
bmi big_done
ora #$80
jsr STORADV
inx
bne big_loop
big_done:
pla
tax
dec xpos,X
inx
cpx #20
bne next_text
jsr HOME
jmp next_frame
text:
.byte "HELL",'O'|$80