Skip to content

Commit

Permalink
File Dialog: Inline 3 more procs with single call sites. Save 9 bytes
Browse files Browse the repository at this point in the history
No functional changes.
  • Loading branch information
inexorabletash committed Oct 7, 2023
1 parent 6801807 commit d655b1c
Showing 1 changed file with 18 additions and 34 deletions.
52 changes: 18 additions & 34 deletions lib/file_dialog.s
Original file line number Diff line number Diff line change
Expand Up @@ -560,13 +560,28 @@ ret: rts
jeq _KeyEscape

cmp #CHAR_CTRL_O
jeq _KeyOpen
IF_EQ
jsr _IsOpenAllowed
RTS_IF_CS

BTK_CALL BTK::Flash, file_dialog_res::open_button_params
jmp _DoOpen
END_IF

cmp #CHAR_CTRL_D
jeq _KeyDrives
IF_EQ
BTK_CALL BTK::Flash, file_dialog_res::drives_button_params
jmp _DoDrives
END_IF

cmp #CHAR_CTRL_C
jeq _KeyClose
IF_EQ
jsr _IsCloseAllowed
RTS_IF_CS

BTK_CALL BTK::Flash, file_dialog_res::close_button_params
jmp _DoClose
END_IF

END_IF

Expand All @@ -585,37 +600,6 @@ exit: rts

;;; ============================================================

.proc _KeyOpen
jsr _IsOpenAllowed
bcs ret

BTK_CALL BTK::Flash, file_dialog_res::open_button_params
jsr _DoOpen

ret: rts
.endproc ; _KeyOpen

;;; ============================================================

.proc _KeyClose
jsr _IsCloseAllowed
bcs ret

BTK_CALL BTK::Flash, file_dialog_res::close_button_params
jsr _DoClose

ret: rts
.endproc ; _KeyClose

;;; ============================================================

.proc _KeyDrives
BTK_CALL BTK::Flash, file_dialog_res::drives_button_params
jmp _DoDrives
.endproc ; _KeyDrives

;;; ============================================================

.proc _KeyReturn
jsr _IsOKAllowed
bcs ret
Expand Down

0 comments on commit d655b1c

Please sign in to comment.