Skip to content

Commit 4932bc0

Browse files
Control Flow Macros: Adopt FALL_THROUGH_TO
No binary changes
1 parent fe151de commit 4932bc0

17 files changed

Lines changed: 46 additions & 71 deletions

File tree

docs/Coding_Style.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,7 @@ xcoord .word
138138

139139
```asm
140140
...
141-
lda #alert_num
142-
FALL_THROUGH_TO ShowAlert
141+
FALL_THROUGH_TO ShowAlert, A=#alert_num
143142
.endproc
144143
145144
.proc ShowAlert

src/desk_acc/change.type.s

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -425,8 +425,7 @@ yes: RETURN C=0
425425
.endproc ; ExitOK
426426

427427
.proc ExitCancel
428-
lda #0
429-
FALL_THROUGH_TO Exit
428+
FALL_THROUGH_TO Exit, A=#0
430429
.endproc ; ExitCancel
431430

432431
.proc Exit

src/desk_acc/international.s

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,7 @@ ret: rts
270270
adc #1
271271
cmp #Field::LAST+1
272272
bcc UpdateSelection
273-
lda #Field::FIRST
274-
FALL_THROUGH_TO UpdateSelection
273+
FALL_THROUGH_TO UpdateSelection, A=#Field::FIRST
275274
.endproc ; OnKeyNext
276275

277276
.proc UpdateSelection

src/desk_acc/print.catalog.s

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -949,8 +949,7 @@ vector: jsr SLOT1 ; self-modified
949949
copy8 #0, ch
950950

951951
CALL COut, A=#CHAR_RETURN
952-
lda #CHAR_DOWN
953-
FALL_THROUGH_TO COut
952+
FALL_THROUGH_TO COut, A=#CHAR_DOWN
954953
.endproc ; CROut
955954

956955
.proc COut

src/desk_acc/show.image.file.s

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -621,8 +621,7 @@ next:
621621
IF NS
622622
JUMP_TABLE_MLI_CALL READ, read_lores_params
623623
END_IF
624-
lda #$80 ; main
625-
FALL_THROUGH_TO convert
624+
FALL_THROUGH_TO convert, A=#$80 ; main
626625

627626
convert:
628627
sta is_main
@@ -1509,8 +1508,7 @@ saw_header_flag: ; bit7
15091508
beq ChangeFile ; always
15101509
.endproc ; PreviousFile
15111510
.proc FirstFile
1512-
lda #$40
1513-
FALL_THROUGH_TO ChangeFile
1511+
FALL_THROUGH_TO ChangeFile, A=#$40
15141512
.endproc ; FirstFile
15151513

15161514
;;; Input: A = flags, bit6 = modified, bit7 = advance

src/desktop/auxmem.s

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -583,8 +583,7 @@ start:
583583

584584
copy8 #AlertOptions::Beep|AlertOptions::SaveBack, alert_params+AlertParams::options
585585

586-
ldax #alert_params
587-
FALL_THROUGH_TO Alert
586+
FALL_THROUGH_TO Alert, AX=#alert_params
588587
.endproc ; AlertByIdImpl
589588
AlertById := AlertByIdImpl::start
590589

src/desktop/lc.s

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,7 @@ params: .res 3
169169

170170
;;; A=alert number, with default options
171171
.proc ShowAlert
172-
ldx #kShowAlertUseDefaultOptionsForId
173-
FALL_THROUGH_TO ShowAlertOption
172+
FALL_THROUGH_TO ShowAlertOption, X=#kShowAlertUseDefaultOptionsForId
174173
.endproc ; ShowAlert
175174

176175
;;; A=alert number, X=`AlertButtonOptions::*`

src/desktop/main.s

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2196,8 +2196,7 @@ CmdAbout := AboutDialogProc
21962196
;;; ============================================================
21972197

21982198
.proc CmdAboutThisApple
2199-
ldax #str_about_this_apple
2200-
FALL_THROUGH_TO LaunchPassedPathOnSystemDisk
2199+
FALL_THROUGH_TO LaunchPassedPathOnSystemDisk, AX=#str_about_this_apple
22012200
.endproc ; CmdAboutThisApple
22022201

22032202
;;; ============================================================
@@ -2274,8 +2273,7 @@ CmdDeskAcc := CmdDeskAccImpl::start
22742273
END_IF
22752274
CALL IconToAnimate, AX=#tmp_path_buf
22762275
tay
2277-
ldax #tmp_path_buf
2278-
FALL_THROUGH_TO InvokeDeskAccWithIcon
2276+
FALL_THROUGH_TO InvokeDeskAccWithIcon, AX=#tmp_path_buf
22792277
.endproc ; InvokeDeskAccByPath
22802278

22812279
;;; ============================================================
@@ -5343,8 +5341,7 @@ alert: jmp ShowAlert ; either `ERR_INVALID_PATHNAME` or `ERR_FILE_NOT
53435341
;;; Same inputs/outputs as `ActivateAndRefreshWindowOrClose`
53445342

53455343
.proc UpdateActivateAndRefreshSelectedWindow
5346-
lda selected_window_id
5347-
FALL_THROUGH_TO UpdateActivateAndRefreshWindow
5344+
FALL_THROUGH_TO UpdateActivateAndRefreshWindow, A=selected_window_id
53485345
.endproc ; UpdateActivateAndRefreshSelectedWindow
53495346

53505347
.proc UpdateActivateAndRefreshWindow
@@ -5412,8 +5409,7 @@ alert: jmp ShowAlert ; either `ERR_INVALID_PATHNAME` or `ERR_FILE_NOT
54125409
ITK_CALL IconTK::UnhighlightIcon, icon_param
54135410
ITK_CALL IconTK::DrawIcon, icon_param
54145411

5415-
lda icon_param
5416-
FALL_THROUGH_TO RemoveFromSelectionList
5412+
FALL_THROUGH_TO RemoveFromSelectionList, A=icon_param
54175413
.endproc ; UnhighlightAndDeselectIcon
54185414

54195415
;;; ============================================================
@@ -5776,8 +5772,7 @@ beyond:
57765772

57775773
;;; Close the active window
57785774
.proc CloseActiveWindow
5779-
lda active_window_id
5780-
FALL_THROUGH_TO CloseSpecifiedWindow
5775+
FALL_THROUGH_TO CloseSpecifiedWindow, A=active_window_id
57815776
.endproc ; CloseActiveWindow
57825777

57835778
;;; Inputs: A = window_id
@@ -5898,8 +5893,7 @@ validate_windows_flag:
58985893
;;; ============================================================
58995894

59005895
.proc ApplyActiveWinfoToWindowGrafport
5901-
lda active_window_id
5902-
FALL_THROUGH_TO ApplyWinfoToWindowGrafport
5896+
FALL_THROUGH_TO ApplyWinfoToWindowGrafport, A=active_window_id
59035897
.endproc ; ApplyActiveWinfoToWindowGrafport
59045898

59055899
.proc ApplyWinfoToWindowGrafport
@@ -6687,8 +6681,7 @@ slash: cpy #1
66876681
;;; ============================================================
66886682

66896683
.proc FindWindowForSrcPath
6690-
ldax #src_path_buf
6691-
FALL_THROUGH_TO FindWindowForPath
6684+
FALL_THROUGH_TO FindWindowForPath, AX=#src_path_buf
66926685
.endproc ; FindWindowForSrcPath
66936686

66946687
;;; ============================================================
@@ -7595,8 +7588,7 @@ draw: MGTK_CALL MGTK::DrawString, text_input_buf
75957588
.endproc ; _PrepAvailable
75967589

75977590
.proc _Measure
7598-
ldax #text_input_buf
7599-
FALL_THROUGH_TO _MeasureString
7591+
FALL_THROUGH_TO _MeasureString, AX=#text_input_buf
76007592
.endproc ; _Measure
76017593

76027594
;;; Measure text, pascal string address in A,X; result in A,X
@@ -8324,8 +8316,7 @@ set_pos:
83248316

83258317
blocks := list_view_filerecord + FileRecord::blocks
83268318

8327-
ldax blocks
8328-
FALL_THROUGH_TO ComposeSizeString
8319+
FALL_THROUGH_TO ComposeSizeString, AX=blocks
83298320
.endproc ; _PrepareColSize
83308321

83318322
.endproc ; DrawListViewRow
@@ -8790,8 +8781,7 @@ map_delta_y: .word 0
87908781
;;; Trashes: $08
87918782

87928783
.proc PrepActiveWindowScreenMapping
8793-
lda active_window_id
8794-
FALL_THROUGH_TO PrepWindowScreenMapping
8784+
FALL_THROUGH_TO PrepWindowScreenMapping, A=active_window_id
87958785
.endproc ; PrepActiveWindowScreenMapping
87968786

87978787
PROC_USED_CLEARING_UPDATES
@@ -13353,8 +13343,7 @@ RestoreDynamicRoutine := LoadDynamicRoutineImpl::restore
1335313343
;;; A,X = A * 64
1335413344
PROC_USED_IN_OVERLAY
1335513345
.proc ATimes64
13356-
ldx #6
13357-
FALL_THROUGH_TO AShiftX
13346+
FALL_THROUGH_TO AShiftX, X=#6
1335813347
.endproc ; ATimes64
1335913348

1336013349
;;; A,X = A << X
@@ -13679,8 +13668,7 @@ ignore: RETURN C=1
1367913668
;;; ============================================================
1368013669

1368113670
.proc DrawDialogPathBuf0
13682-
ldax #path_buf0
13683-
FALL_THROUGH_TO DrawDialogPath
13671+
FALL_THROUGH_TO DrawDialogPath, AX=#path_buf0
1368413672
.endproc ; DrawDialogPathBuf0
1368513673

1368613674
.include "../lib/drawdialogpath.s"

src/desktop/ovl_selector_pick.s

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -401,8 +401,7 @@ clean_flag: ; high bit set if "clean", cleared if "dirty"
401401
TAIL_CALL DrawTitleCentered, AX=#label_del
402402
END_IF
403403

404-
ldax #label_run
405-
FALL_THROUGH_TO DrawTitleCentered
404+
FALL_THROUGH_TO DrawTitleCentered, AX=#label_run
406405
.endproc ; OpenWindow
407406

408407
;;; ============================================================

src/extras/asmtest.system.s

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
.include "../inc/macros.inc"
4444

4545
;;; ============================================================
46-
;;; Flow Control Macros - Branch & Loop
46+
;;; Control Flow Macros - Branch & Loop
4747
;;; ============================================================
4848

4949
;;; --------------------------------------------------
@@ -930,7 +930,7 @@ table := *
930930
WHILE POS
931931

932932
;;; ============================================================
933-
;;; Flow Control Macros - Functions
933+
;;; Control Flow Macros - Functions
934934
;;; ============================================================
935935

936936
var:

0 commit comments

Comments
 (0)