From fad5af7ac2465ffc1c6577f13ea2796d93dd0465 Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Tue, 20 Apr 2021 16:30:05 -0400 Subject: [PATCH] text: move --- textmode/textscroll/Makefile | 31 ++++++++++++++ textmode/textscroll/hello.bas | 2 + textmode/textscroll/move.s | 80 +++++++++++++++++++++++++++++++++++ 3 files changed, 113 insertions(+) create mode 100644 textmode/textscroll/Makefile create mode 100644 textmode/textscroll/hello.bas create mode 100644 textmode/textscroll/move.s diff --git a/textmode/textscroll/Makefile b/textmode/textscroll/Makefile new file mode 100644 index 00000000..f4cfffd7 --- /dev/null +++ b/textmode/textscroll/Makefile @@ -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 diff --git a/textmode/textscroll/hello.bas b/textmode/textscroll/hello.bas new file mode 100644 index 00000000..133a44bb --- /dev/null +++ b/textmode/textscroll/hello.bas @@ -0,0 +1,2 @@ +5 HOME +10 PRINT CHR$(4);"CATALOG" diff --git a/textmode/textscroll/move.s b/textmode/textscroll/move.s new file mode 100644 index 00000000..56236135 --- /dev/null +++ b/textmode/textscroll/move.s @@ -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 +