diff --git a/desk.acc/calculator.s b/desk.acc/calculator.s index af70cd1..0ff744f 100644 --- a/desk.acc/calculator.s +++ b/desk.acc/calculator.s @@ -103,7 +103,7 @@ call_init: ;; ??? lda LCBANK1 lda LCBANK1 - bit L089D + bit redraw_flag bmi skip jsr UNKNOWN_CALL @@ -112,7 +112,7 @@ call_init: ;; ??? skip: lda #0 - sta L089D + sta redraw_flag lda ROMIN2 A2D_CALL A2D_QUERY_STATE, query_state_params A2D_CALL A2D_SET_STATE, state_params @@ -132,7 +132,7 @@ skip: lda #0 ;;; ================================================== -L089D: .byte 0 +redraw_flag: .byte 0 ; ??? ;; Called after window drag is complete ;; (called with window_id in A) @@ -142,7 +142,7 @@ L089D: .byte 0 cmp #screen_height - 1 bcc :+ lda #$80 - sta L089D + sta redraw_flag rts : A2D_CALL A2D_QUERY_STATE, query_state_params @@ -545,12 +545,12 @@ tall_button_bitmap: ; bitmap for '+' button saved_stack: .byte $00 ; restored after error -L0BC5: .byte $00 ; high bit set if pending op? +calc_p: .byte $00 ; high bit set if pending op? calc_op:.byte $00 calc_d: .byte $00 ; '.' if decimal present, 0 otherwise calc_e: .byte $00 ; exponential? calc_n: .byte $00 ; negative? -L0BCA: .byte $00 ; related to = key +calc_g: .byte $00 ; high bit set if last input digit calc_l: .byte $00 ; input length ;;; ================================================== @@ -575,7 +575,7 @@ white_pattern: .res 8, $FF .byte $00 - ;; ??? + ;; arg for $0C call ??? L0BEF: .byte $7F display_left := 10 @@ -792,11 +792,11 @@ init: sta ALTZPON sta calc_op lda #0 ; clear registers - sta L0BC5 + sta calc_p sta calc_d sta calc_e sta calc_n - sta L0BCA + sta calc_g sta calc_l .proc copy_to_b1 @@ -937,7 +937,7 @@ loop: lda routine,x lda input_state_params::key cmp #KEY_ESCAPE bne trydel - lda L0BC5 + lda calc_p bne clear ; empty state? lda calc_l beq exit ; if so, exit DA @@ -1109,7 +1109,7 @@ miss: clc lda #'=' sta calc_op lda #0 - sta L0BC5 + sta calc_p sta calc_l sta calc_d sta calc_e @@ -1117,13 +1117,13 @@ miss: clc jmp reset_buffers_and_display : cmp #'E' ; Exponential? - bne L0FC7 + bne try_eq ldx #btn_e::box lda #'e' jsr depress_button ldy calc_e - bne L0FC6 + bne rts1 ldy calc_l bne :+ inc calc_l @@ -1132,11 +1132,11 @@ miss: clc sta text_buffer2 + text_buffer_size : lda #'E' sta calc_e - jmp L1107 + jmp update -L0FC6: rts +rts1: rts -L0FC7: cmp #'=' ; Equals? +try_eq: cmp #'=' ; Equals? bne :+ pha ldx #