mirror of
https://github.com/mi57730/a2d.git
synced 2024-11-29 07:49:20 +00:00
STF: more symbols; also add glyph definitions
This commit is contained in:
parent
1bff134a6d
commit
a9f8039a12
@ -303,10 +303,11 @@ A2D_QUERY_CLIENT:= $48
|
|||||||
;; .byte part (0 = client, 1 = vscroll, 2 = hscroll)
|
;; .byte part (0 = client, 1 = vscroll, 2 = hscroll)
|
||||||
;; .byte scroll (1 = up/left, 2 = down/right, 3 = above/before, 4 = below/after, 5 = thumb)
|
;; .byte scroll (1 = up/left, 2 = down/right, 3 = above/before, 4 = below/after, 5 = thumb)
|
||||||
|
|
||||||
A2D_RESIZE_WINDOW := $49
|
A2D_RESIZE_WINDOW := $49 ; ???
|
||||||
;; (input length 3 bytes)
|
;; (input length 3 bytes)
|
||||||
;; .byte ??
|
;; .byte ??? maybe part (i.e. HSCROLL or VSCROLL) ???
|
||||||
;; .byte ??
|
;; .byte ??? width fraction ??
|
||||||
|
;; .byte ???
|
||||||
|
|
||||||
A2D_DRAG_SCROLL := $4A
|
A2D_DRAG_SCROLL := $4A
|
||||||
;; (input length 5 bytes)
|
;; (input length 5 bytes)
|
||||||
@ -475,3 +476,9 @@ end:
|
|||||||
;; $0D = return (MT:M) $1D = check (MT:D)
|
;; $0D = return (MT:M) $1D = check (MT:D)
|
||||||
;; $0E = (C) $1E = solid apple (MT:@)
|
;; $0E = (C) $1E = solid apple (MT:@)
|
||||||
;; $0F = (R) $1F = open apple (MT:A)
|
;; $0F = (R) $1F = open apple (MT:A)
|
||||||
|
|
||||||
|
A2D_GLYPH_LARROW := $09
|
||||||
|
A2D_GLYPH_RARROW := $15
|
||||||
|
A2D_GLYPH_UARROW := $0B
|
||||||
|
A2D_GLYPH_DARROW := $0A
|
||||||
|
A2D_GLYPH_RETURN := $0D
|
||||||
|
@ -753,13 +753,13 @@ date_rect:
|
|||||||
.word $20,$0F,$9A,$23
|
.word $20,$0F,$9A,$23
|
||||||
|
|
||||||
label_ok:
|
label_ok:
|
||||||
A2D_DEFSTRING {"OK ",$0D} ; ends with newline
|
A2D_DEFSTRING {"OK ",A2D_GLYPH_RETURN} ;
|
||||||
label_cancel:
|
label_cancel:
|
||||||
A2D_DEFSTRING "Cancel ESC"
|
A2D_DEFSTRING "Cancel ESC"
|
||||||
label_uparrow:
|
label_uparrow:
|
||||||
A2D_DEFSTRING $0B ; up arrow
|
A2D_DEFSTRING A2D_GLYPH_UARROW
|
||||||
label_downarrow:
|
label_downarrow:
|
||||||
A2D_DEFSTRING $0A ; down arrow
|
A2D_DEFSTRING A2D_GLYPH_DARROW
|
||||||
|
|
||||||
label_cancel_pos:
|
label_cancel_pos:
|
||||||
.word $15,$38
|
.word $15,$38
|
||||||
|
@ -269,8 +269,9 @@ scroll: .byte 0 ; 1 = up, 2 = down, 3 = above, 4 = below, 5 = th
|
|||||||
|
|
||||||
;; param block used in dead code (resize?)
|
;; param block used in dead code (resize?)
|
||||||
.proc resize_window_params
|
.proc resize_window_params
|
||||||
L0986: .byte 0
|
part: .byte 0
|
||||||
L0987: .byte 0
|
L0987: .byte 0
|
||||||
|
;; needs one more byte?
|
||||||
.endproc
|
.endproc
|
||||||
|
|
||||||
.proc update_scroll_params ; called to update scroll bar position
|
.proc update_scroll_params ; called to update scroll bar position
|
||||||
@ -590,11 +591,12 @@ wider: lda window_params::hscroll
|
|||||||
ldx window_width+1
|
ldx window_width+1
|
||||||
cpx #>max_width
|
cpx #>max_width
|
||||||
bne enable
|
bne enable
|
||||||
and #(A2D_CWS_SCROLL_TRACK ^ $FF) ; disable scroll
|
and #(<~A2D_CWS_SCROLL_TRACK) ; disable scroll
|
||||||
jmp skip
|
jmp :+
|
||||||
|
|
||||||
enable: ora #A2D_CWS_SCROLL_TRACK ; enable scroll
|
enable: ora #A2D_CWS_SCROLL_TRACK ; enable scroll
|
||||||
skip: sta window_params::hscroll
|
|
||||||
|
: sta window_params::hscroll
|
||||||
sec
|
sec
|
||||||
lda #<max_width
|
lda #<max_width
|
||||||
sbc window_width
|
sbc window_width
|
||||||
@ -604,8 +606,8 @@ skip: sta window_params::hscroll
|
|||||||
sta $07
|
sta $07
|
||||||
jsr div_by_16
|
jsr div_by_16
|
||||||
sta resize_window_params::L0987
|
sta resize_window_params::L0987
|
||||||
lda #$02
|
lda #A2D_HSCROLL
|
||||||
sta resize_window_params::L0986
|
sta resize_window_params::part
|
||||||
A2D_CALL A2D_RESIZE_WINDOW, resize_window_params ; change to clamped size ???
|
A2D_CALL A2D_RESIZE_WINDOW, resize_window_params ; change to clamped size ???
|
||||||
jsr calc_and_draw_mode
|
jsr calc_and_draw_mode
|
||||||
jmp finish_resize
|
jmp finish_resize
|
||||||
@ -1010,7 +1012,7 @@ do_line:
|
|||||||
lda #1
|
lda #1
|
||||||
sbc line_pos::left+1
|
sbc line_pos::left+1
|
||||||
sta L095C
|
sta L095C
|
||||||
jsr L0EF3
|
jsr find_text_run
|
||||||
bcs L0ED7
|
bcs L0ED7
|
||||||
clc
|
clc
|
||||||
lda text_string::len
|
lda text_string::len
|
||||||
@ -1059,7 +1061,8 @@ L0ED7: jsr restore_proportional_font_table_if_needed
|
|||||||
|
|
||||||
;;; ==================================================
|
;;; ==================================================
|
||||||
|
|
||||||
L0EF3: lda #$FF
|
.proc find_text_run
|
||||||
|
lda #$FF
|
||||||
sta L0F9B
|
sta L0F9B
|
||||||
lda #0
|
lda #0
|
||||||
sta run_width
|
sta run_width
|
||||||
@ -1070,24 +1073,23 @@ L0EF3: lda #$FF
|
|||||||
sta text_string::addr
|
sta text_string::addr
|
||||||
lda $07
|
lda $07
|
||||||
sta text_string::addr+1
|
sta text_string::addr+1
|
||||||
L0F10: lda L0945
|
|
||||||
bne L0F22
|
loop: lda L0945
|
||||||
|
bne more
|
||||||
lda L0947
|
lda L0947
|
||||||
beq L0F1F
|
beq :+
|
||||||
jsr draw_text_run
|
jsr draw_text_run
|
||||||
sec
|
sec
|
||||||
rts
|
rts
|
||||||
|
|
||||||
;;; ==================================================
|
: jsr ensure_page_buffered
|
||||||
|
more: ldy text_string::len
|
||||||
L0F1F: jsr L100C
|
|
||||||
L0F22: ldy text_string::len
|
|
||||||
lda ($06),y
|
lda ($06),y
|
||||||
and #$7F ; clear high bit
|
and #$7F ; clear high bit
|
||||||
sta ($06),y
|
sta ($06),y
|
||||||
inc L0945
|
inc L0945
|
||||||
cmp #$0D ; return character
|
cmp #$0D ; return character
|
||||||
beq L0F86
|
beq finish_text_run
|
||||||
cmp #' ' ; space character
|
cmp #' ' ; space character
|
||||||
bne :+
|
bne :+
|
||||||
sty L0F9B
|
sty L0F9B
|
||||||
@ -1113,7 +1115,7 @@ L0F22: ldy text_string::len
|
|||||||
cmp run_width
|
cmp run_width
|
||||||
: bcc :+
|
: bcc :+
|
||||||
inc text_string::len
|
inc text_string::len
|
||||||
jmp L0F10
|
jmp loop
|
||||||
|
|
||||||
: lda #0
|
: lda #0
|
||||||
sta L095A
|
sta L095A
|
||||||
@ -1124,8 +1126,10 @@ L0F22: ldy text_string::len
|
|||||||
lda L0946
|
lda L0946
|
||||||
sta L0945
|
sta L0945
|
||||||
: inc text_string::len
|
: inc text_string::len
|
||||||
|
;; fall through
|
||||||
|
.endproc
|
||||||
|
|
||||||
L0F86: jsr draw_text_run
|
finish_text_run: jsr draw_text_run
|
||||||
ldy text_string::len
|
ldy text_string::len
|
||||||
lda ($06),y
|
lda ($06),y
|
||||||
cmp #$09 ; tab character?
|
cmp #$09 ; tab character?
|
||||||
@ -1167,10 +1171,10 @@ loop: lda times70+1,x
|
|||||||
sta line_pos::left
|
sta line_pos::left
|
||||||
lda times70+1,x
|
lda times70+1,x
|
||||||
sta line_pos::left+1
|
sta line_pos::left+1
|
||||||
jmp L0F86
|
jmp finish_text_run
|
||||||
done: lda #0
|
done: lda #0
|
||||||
sta L095A
|
sta L095A
|
||||||
jmp L0F86
|
jmp finish_text_run
|
||||||
|
|
||||||
times70:.word 70
|
times70:.word 70
|
||||||
.word 140
|
.word 140
|
||||||
@ -1197,7 +1201,8 @@ end: rts
|
|||||||
|
|
||||||
;;; ==================================================
|
;;; ==================================================
|
||||||
|
|
||||||
L100C: lda text_string::addr+1
|
.proc ensure_page_buffered
|
||||||
|
lda text_string::addr+1
|
||||||
cmp #$12 ; #>default_buffer?
|
cmp #$12 ; #>default_buffer?
|
||||||
beq L102B
|
beq L102B
|
||||||
|
|
||||||
@ -1215,31 +1220,35 @@ loop: lda $1300,y
|
|||||||
sta $07
|
sta $07
|
||||||
L102B: lda #0
|
L102B: lda #0
|
||||||
sta L0945
|
sta L0945
|
||||||
jsr L103E
|
jsr read_file_page
|
||||||
lda read_params::buffer+1
|
lda read_params::buffer+1
|
||||||
cmp #$12 ; #>default_buffer?
|
cmp #>default_buffer
|
||||||
bne L103D
|
bne :+
|
||||||
inc read_params::buffer+1
|
inc read_params::buffer+1
|
||||||
L103D: rts
|
: rts
|
||||||
|
.endproc
|
||||||
|
|
||||||
;;; ==================================================
|
;;; ==================================================
|
||||||
|
|
||||||
.proc L103E
|
.proc read_file_page
|
||||||
lda read_params::buffer
|
lda read_params::buffer
|
||||||
sta store+1
|
sta store+1
|
||||||
lda read_params::buffer+1
|
lda read_params::buffer+1
|
||||||
sta store+2
|
sta store+2
|
||||||
lda #$20
|
|
||||||
ldx #$00
|
lda #' ' ; fill buffer with spaces
|
||||||
|
ldx #0
|
||||||
sta RAMWRTOFF
|
sta RAMWRTOFF
|
||||||
store: sta default_buffer,x ; self-modified
|
store: sta default_buffer,x ; self-modified
|
||||||
inx
|
inx
|
||||||
bne store
|
bne store
|
||||||
sta RAMWRTON
|
|
||||||
|
sta RAMWRTON ; read file chunk
|
||||||
lda #$00
|
lda #$00
|
||||||
sta L0947
|
sta L0947
|
||||||
jsr read_file
|
jsr read_file
|
||||||
pha
|
|
||||||
|
pha ; copy read buffer main>aux
|
||||||
lda #$00
|
lda #$00
|
||||||
sta STARTLO
|
sta STARTLO
|
||||||
sta DESTINATIONLO
|
sta DESTINATIONLO
|
||||||
@ -1252,8 +1261,9 @@ store: sta default_buffer,x ; self-modified
|
|||||||
sec ; main>aux
|
sec ; main>aux
|
||||||
jsr AUXMOVE
|
jsr AUXMOVE
|
||||||
pla
|
pla
|
||||||
|
|
||||||
beq end
|
beq end
|
||||||
cmp #$4C
|
cmp #$4C ; ???
|
||||||
beq done
|
beq done
|
||||||
brk ; ????
|
brk ; ????
|
||||||
done: lda #$01
|
done: lda #$01
|
||||||
|
Loading…
Reference in New Issue
Block a user