WIP: manual almost werks

This commit is contained in:
2023-08-02 00:59:05 -04:00
parent ff5c5eb2fa
commit defaf1d1e3
3 changed files with 44 additions and 9 deletions
+43 -8
View File
@@ -7,9 +7,12 @@ screen = $1000 ; start - 40*screen_height
org screen+screen_height*40 ; after the screen org screen+screen_height*40 ; after the screen
src = $80 .zpvar src .word = $80
dest = $82 .zpvar dest .word
top_src = $84 .zpvar top_src .word
.zpvar next_line_begin .byte
.zpvar end_address .word
.zpvar start_address .word
start start
mwa #dl dlptrs mwa #dl dlptrs
@@ -23,21 +26,40 @@ main_loop
ldx #screen_height-1 ldx #screen_height-1
screen_copy screen_copy
mwa top_src start_address
ldy #0 ldy #0
@ @
lda (src),y lda (src),y
cmp #$ff ; end of line marker cmp #$ff ; end of line marker
bne not_eol bne not_eol
sty next_line_begin
lda #$00
@ sta (dest),y
iny
cpy #screen_width
bne @-
jmp next_line
not_eol not_eol
sta (dest),y sta (dest),y
iny iny
cpy #screen_width cpy #screen_width
bne @- bne @-1
adw src #screen_width mva #screen_width-1 next_line_begin
next_line
adw dest #screen_width adw dest #screen_width
; adw src #screen_width
inc next_line_begin
clc
lda src
adc next_line_begin
sta src
scc:inc src+1
dex dex
bpl screen_copy bpl screen_copy
; save the current end of the printed text source
mwa src end_address
jsr GetKey jsr GetKey
cmp #@kbcode._down cmp #@kbcode._down
@@ -47,9 +69,22 @@ not_eol
jmp main_loop jmp main_loop
scroll_down scroll_down
adw top_src #screen_width ; find first $ff after top_src and move it there
cpw top_src #(man_text_en_end-screen_height*screen_width) ldy #-1
scc:mwa #(man_text_en_end-screen_height*screen_width) top_src @ iny
lda (top_src),y
cmp #$ff
bne @-
iny
tya
clc
adc top_src
sta top_src
scc:inc top_src+1
;adw top_src #screen_width
cpw end_address #man_text_en_end
scc:mwa start_address top_src
jmp main_loop jmp main_loop
scroll_up scroll_up
Binary file not shown.
Binary file not shown.