2021-08-15 01:10:56 +00:00
|
|
|
;===========================
|
|
|
|
; hgr text box
|
|
|
|
;===========================
|
|
|
|
; point OUTL:OUTH at it
|
|
|
|
; x1h,x1l,y1 x2h,x2l,y2
|
|
|
|
; then X,Y of text
|
|
|
|
; CR moves to next line
|
|
|
|
; 0 ends
|
|
|
|
|
|
|
|
hgr_text_box:
|
|
|
|
ldy #0
|
|
|
|
|
|
|
|
;====================
|
|
|
|
; draw text box
|
|
|
|
|
|
|
|
lda (OUTL),Y
|
|
|
|
sta BOX_X1H
|
|
|
|
iny
|
|
|
|
lda (OUTL),Y
|
|
|
|
sta BOX_X1L
|
|
|
|
iny
|
|
|
|
lda (OUTL),Y
|
|
|
|
sta BOX_Y1
|
|
|
|
iny
|
|
|
|
|
|
|
|
lda (OUTL),Y
|
|
|
|
sta BOX_X2H
|
|
|
|
iny
|
|
|
|
lda (OUTL),Y
|
|
|
|
sta BOX_X2L
|
|
|
|
iny
|
|
|
|
lda (OUTL),Y
|
|
|
|
sta BOX_Y2
|
|
|
|
|
2021-09-29 01:08:46 +00:00
|
|
|
skip_box_save_smc:
|
|
|
|
lda #1
|
|
|
|
beq skip_box_save
|
|
|
|
|
2021-12-28 22:56:28 +00:00
|
|
|
lda BOX_Y1
|
|
|
|
sta SAVED_Y1
|
|
|
|
|
|
|
|
ldx BOX_Y2
|
|
|
|
stx SAVED_Y2
|
|
|
|
|
|
|
|
; jsr hgr_partial_save
|
|
|
|
|
2021-09-29 01:08:46 +00:00
|
|
|
skip_box_save:
|
2021-08-16 05:31:49 +00:00
|
|
|
|
2021-08-15 01:10:56 +00:00
|
|
|
jsr draw_box
|
|
|
|
|
|
|
|
clc
|
|
|
|
lda OUTL
|
|
|
|
adc #6
|
|
|
|
sta OUTL
|
|
|
|
lda OUTH
|
|
|
|
adc #0
|
|
|
|
sta OUTH
|
|
|
|
|
2021-08-31 05:15:12 +00:00
|
|
|
; fallthrough
|
2021-08-15 01:10:56 +00:00
|
|
|
|
2021-08-31 05:15:12 +00:00
|
|
|
;=======================
|
|
|
|
; disp_put_string
|
|
|
|
; OUTL:OUTH has co-ords followed by string
|
|
|
|
; CR (13) goes to next line
|
|
|
|
disp_put_string:
|
2021-08-15 01:10:56 +00:00
|
|
|
ldy #0
|
|
|
|
lda (OUTL),Y
|
|
|
|
sta CURSOR_X
|
|
|
|
|
2021-08-31 05:15:12 +00:00
|
|
|
jsr inc_outl
|
|
|
|
lda (OUTL),Y
|
|
|
|
sta CURSOR_Y
|
|
|
|
jsr inc_outl
|
|
|
|
|
2021-09-03 04:05:06 +00:00
|
|
|
disp_put_string_cursor:
|
|
|
|
lda CURSOR_X
|
|
|
|
sta SAVED_X
|
|
|
|
|
2021-08-31 05:15:12 +00:00
|
|
|
disp_one_line:
|
|
|
|
|
2021-08-15 01:10:56 +00:00
|
|
|
disp_put_string_loop:
|
2021-08-31 05:15:12 +00:00
|
|
|
ldy #0
|
|
|
|
lda (OUTL),Y
|
|
|
|
beq disp_put_string_done
|
2021-11-16 01:39:43 +00:00
|
|
|
bmi disp_use_lookup
|
|
|
|
|
2021-08-15 01:10:56 +00:00
|
|
|
cmp #13
|
|
|
|
beq disp_end_of_line
|
|
|
|
|
|
|
|
jsr hgr_put_char_cursor
|
|
|
|
|
|
|
|
inc CURSOR_X
|
|
|
|
jsr inc_outl
|
|
|
|
jmp disp_put_string_loop
|
|
|
|
|
|
|
|
disp_end_of_line:
|
|
|
|
clc
|
|
|
|
lda CURSOR_Y
|
2022-01-08 03:52:05 +00:00
|
|
|
adc #9 ; skip 9 so descenders don't interfere
|
2021-08-15 01:10:56 +00:00
|
|
|
sta CURSOR_Y
|
|
|
|
|
|
|
|
lda SAVED_X
|
|
|
|
sta CURSOR_X
|
|
|
|
|
2021-11-16 04:10:43 +00:00
|
|
|
disp_inc_done:
|
|
|
|
|
2021-08-15 01:10:56 +00:00
|
|
|
jsr inc_outl
|
|
|
|
|
|
|
|
jmp disp_put_string_loop
|
|
|
|
|
|
|
|
disp_put_string_done:
|
|
|
|
|
2021-09-20 05:13:16 +00:00
|
|
|
jsr inc_outl ; put to next
|
|
|
|
|
2021-08-15 01:10:56 +00:00
|
|
|
rts
|
|
|
|
|
2021-11-16 04:10:43 +00:00
|
|
|
;====================
|
|
|
|
; use text lookup
|
|
|
|
|
2021-11-16 01:39:43 +00:00
|
|
|
disp_use_lookup:
|
|
|
|
and #$7f
|
|
|
|
tax
|
|
|
|
lda text_offset_table,X
|
2021-11-16 04:10:43 +00:00
|
|
|
|
|
|
|
tax
|
|
|
|
disp_word_loop:
|
|
|
|
txa
|
|
|
|
stx disp_loop_smc+1
|
|
|
|
lda word_table,X
|
|
|
|
php
|
|
|
|
|
2021-11-16 01:39:43 +00:00
|
|
|
jsr hgr_put_char_cursor
|
|
|
|
inc CURSOR_X
|
2021-11-16 04:10:43 +00:00
|
|
|
plp
|
|
|
|
bmi disp_inc_done
|
|
|
|
|
|
|
|
disp_loop_smc:
|
|
|
|
ldx #$dd
|
|
|
|
inx
|
|
|
|
bne disp_word_loop ; bra
|
|
|
|
|
2021-09-29 01:08:46 +00:00
|
|
|
|
|
|
|
;============================
|
|
|
|
; like above, but don't save
|
|
|
|
;============================
|
|
|
|
hgr_text_box_nosave:
|
|
|
|
lda #0
|
|
|
|
sta skip_box_save_smc+1
|
|
|
|
jsr hgr_text_box
|
|
|
|
lda #1
|
|
|
|
sta skip_box_save_smc+1
|
|
|
|
rts
|
2021-11-16 01:39:43 +00:00
|
|
|
|
|
|
|
.include "text/word_list.s"
|