diff --git a/desk.acc/show_text_file.s b/desk.acc/show_text_file.s index 3296a6b..c0bdc2d 100644 --- a/desk.acc/show_text_file.s +++ b/desk.acc/show_text_file.s @@ -888,7 +888,7 @@ store: sta window_params::hspos sta window_params::box::voffset sta window_params::box::voffset+1 ldx update_scroll_params::pos -loop: beq L0D9B +loop: beq adjust_box_height clc lda window_params::box::voffset adc #50 @@ -899,8 +899,7 @@ loop: beq L0D9B jmp loop .endproc -.proc L0D9B ; ?? part of vscroll - ;; increase window_params::box height to cover full window (offset + height) +.proc adjust_box_height clc lda window_params::box::voffset adc window_height @@ -974,7 +973,7 @@ end: rts .proc draw_content lda #0 sta L0949 - jsr overwrite_font_width_table + jsr assign_fixed_font_width_table_if_needed jsr set_file_mark lda #default_buffer? beq L102B @@ -1208,6 +1221,8 @@ L102B: lda #0 inc read_params::buffer+1 L103D: rts +;;; ================================================== + .proc L103E lda read_params::buffer sta store+1 @@ -1261,6 +1276,8 @@ end: rts ;; fall through .endproc +;;; ================================================== + ;; calculate line offset ? .proc L10A5 lda window_params::box::height @@ -1289,6 +1306,8 @@ loop: lda L0966 end: rts .endproc +;;; ================================================== + .proc div_by_16 ; input in $06/$07, output in a ldx #4 loop: clc @@ -1322,7 +1341,11 @@ loop: clc rts .endproc -.proc restore_font_table +;;; ================================================== +;;; Restore the font glyph width table when switching +;;; back to proportional mode. + +.proc restore_proportional_font_table_if_needed lda fixed_mode_flag ; if not fixed (i.e. proportional) beq done ; then exit @@ -1347,7 +1370,11 @@ loop: clc done: rts .endproc -.proc overwrite_font_width_table +;;; ================================================== +;;; Overwrite the font glyph width table (with 7s) +;;; when switching to fixed width mode. + +.proc assign_fixed_font_width_table_if_needed lda fixed_mode_flag ; if not fixed (i.e. proportional) beq end ; then exit ldx font_size_count @@ -1373,7 +1400,7 @@ end: rts lda fixed_mode_flag beq set_flag dec fixed_mode_flag ; clear flag (mode = proportional) - jsr restore_font_table + jsr restore_proportional_font_table_if_needed jmp redraw set_flag: