2021-09-29 01:08:46 +00:00
|
|
|
|
|
|
|
|
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-08-16 05:31:49 +00:00
|
|
|
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-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
|
|
|
|
adc #8
|
|
|
|
sta CURSOR_Y
|
|
|
|
|
|
|
|
lda SAVED_X
|
|
|
|
sta CURSOR_X
|
|
|
|
|
|
|
|
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-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
|