2024-05-28 21:18:36 +00:00
|
|
|
|
|
|
|
;================================
|
|
|
|
; move_and_print
|
|
|
|
;================================
|
|
|
|
; get X,Y from OUTL/OUTH
|
|
|
|
; then print following string to that address
|
|
|
|
; stop at NUL
|
|
|
|
; convert to APPLE ASCII (or with 0x80)
|
|
|
|
; leave OUTL/OUTH pointing to next string
|
|
|
|
|
|
|
|
move_and_print:
|
|
|
|
ldy #0
|
|
|
|
lda (OUTL),Y
|
|
|
|
sta CH
|
|
|
|
iny
|
|
|
|
lda (OUTL),Y
|
|
|
|
asl
|
|
|
|
tay
|
|
|
|
lda gr_offsets,Y ; lookup low-res memory address
|
|
|
|
clc
|
|
|
|
adc CH ; add in xpos
|
|
|
|
sta BASL ; store out low byte of addy
|
|
|
|
|
|
|
|
lda gr_offsets+1,Y ; look up high byte
|
|
|
|
adc DRAW_PAGE ;
|
|
|
|
sta BASH ; and store it out
|
|
|
|
; BASH:BASL now points at right place
|
|
|
|
|
|
|
|
clc
|
|
|
|
lda OUTL
|
|
|
|
adc #2
|
|
|
|
sta OUTL
|
|
|
|
lda OUTH
|
|
|
|
adc #0
|
|
|
|
sta OUTH
|
|
|
|
|
|
|
|
;================================
|
|
|
|
; print_string
|
|
|
|
;================================
|
|
|
|
|
|
|
|
print_string:
|
|
|
|
ldy #0
|
|
|
|
print_string_loop:
|
|
|
|
lda (OUTL),Y
|
|
|
|
beq done_print_string
|
2024-07-01 18:48:25 +00:00
|
|
|
|
|
|
|
; adjust for upper/lowercase
|
|
|
|
cmp #$60
|
|
|
|
bcc not_lowercase
|
|
|
|
ps_smc2:
|
|
|
|
and #$ff
|
|
|
|
|
|
|
|
not_lowercase:
|
|
|
|
|
|
|
|
; adjust for inverse/flash/normal
|
2024-05-28 21:18:36 +00:00
|
|
|
ps_smc1:
|
|
|
|
and #$3f ; make sure we are inverse
|
|
|
|
sta (BASL),Y
|
|
|
|
iny
|
|
|
|
bne print_string_loop
|
|
|
|
done_print_string:
|
|
|
|
iny
|
|
|
|
clc
|
|
|
|
tya
|
|
|
|
adc OUTL
|
|
|
|
sta OUTL
|
|
|
|
lda OUTH
|
|
|
|
adc #0
|
|
|
|
sta OUTH
|
|
|
|
|
|
|
|
rts
|
|
|
|
|
2024-07-01 18:48:25 +00:00
|
|
|
; want $E1 -> $81
|
|
|
|
; 1110 1000
|
|
|
|
; so and with $9f?
|
|
|
|
force_uppercase:
|
|
|
|
lda #$9f
|
|
|
|
sta ps_smc2+1
|
|
|
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
2024-05-28 21:18:36 +00:00
|
|
|
; set normal text
|
|
|
|
set_normal:
|
|
|
|
lda #$80
|
|
|
|
sta ps_smc1+1
|
|
|
|
|
|
|
|
lda #09 ; ora
|
|
|
|
sta ps_smc1
|
|
|
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
; restore inverse text
|
|
|
|
set_inverse:
|
2024-07-01 18:48:25 +00:00
|
|
|
lda #$3f ;
|
2024-05-28 21:18:36 +00:00
|
|
|
sta ps_smc1+1
|
|
|
|
|
2024-07-01 18:48:25 +00:00
|
|
|
lda #$29 ; and
|
|
|
|
sta ps_smc1
|
|
|
|
|
2024-05-28 21:18:36 +00:00
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
|
|
;================================
|
|
|
|
; move and print a list of lines
|
|
|
|
;================================
|
|
|
|
; look for negative X meaning done
|
|
|
|
move_and_print_list:
|
|
|
|
jsr move_and_print
|
|
|
|
ldy #0
|
|
|
|
lda (OUTL),Y
|
|
|
|
bpl move_and_print_list
|
|
|
|
|
|
|
|
rts
|
2024-07-01 17:34:58 +00:00
|
|
|
|
|
|
|
;==============================
|
|
|
|
; clear bottom of text screen
|
|
|
|
;==============================
|
|
|
|
clear_bottom:
|
|
|
|
ldx #20
|
|
|
|
clear_bottom_loop_outer:
|
|
|
|
txa
|
|
|
|
asl
|
2024-07-01 18:48:25 +00:00
|
|
|
tay
|
|
|
|
lda gr_offsets,Y
|
2024-07-01 17:34:58 +00:00
|
|
|
sta OUTL
|
2024-07-01 18:48:25 +00:00
|
|
|
iny
|
|
|
|
lda gr_offsets,Y
|
2024-07-01 17:34:58 +00:00
|
|
|
sta OUTH
|
|
|
|
|
|
|
|
lda #' '+$80
|
|
|
|
ldy #39
|
2024-07-01 18:48:25 +00:00
|
|
|
clear_bottom_loop_inner:
|
2024-07-01 17:34:58 +00:00
|
|
|
sta (OUTL),Y
|
|
|
|
dey
|
|
|
|
bpl clear_bottom_loop_inner
|
|
|
|
|
|
|
|
inx
|
|
|
|
cpx #24
|
|
|
|
|
|
|
|
bne clear_bottom_loop_outer
|
|
|
|
|
|
|
|
rts
|