diff --git a/desktop/auxmem.s b/desktop/auxmem.s index 0142bcc6..cbfb12c1 100644 --- a/desktop/auxmem.s +++ b/desktop/auxmem.s @@ -430,8 +430,7 @@ str_alert_unreadable_format: ;;; 1 = Cancel ;;; 2 = OK -.proc AlertById - jmp start +.proc AlertByIdImpl ;;; -------------------------------------------------- ;;; Messages @@ -572,7 +571,8 @@ start: ldax #alert_params FALL_THROUGH_TO Alert -.endproc ; AlertById +.endproc ; AlertByIdImpl +AlertById := AlertByIdImpl::start ;;; ============================================================ ;;; Display alert diff --git a/desktop/init.s b/desktop/init.s index 1c298fc1..c3ed5b8e 100644 --- a/desktop/init.s +++ b/desktop/init.s @@ -1100,11 +1100,11 @@ loop: ldy #0 lda #$80 sta main::copy_new_window_bounds_flag - sta main::OpenDirectory::suppress_error_on_open_flag + sta main::OpenDirectoryImpl::suppress_error_on_open_flag jsr _MaybeOpenWindow lda #0 sta main::copy_new_window_bounds_flag - sta main::OpenDirectory::suppress_error_on_open_flag + sta main::OpenDirectoryImpl::suppress_error_on_open_flag next: jsr PopPointers diff --git a/desktop/main.s b/desktop/main.s index 1b63076a..64a23405 100644 --- a/desktop/main.s +++ b/desktop/main.s @@ -1074,14 +1074,14 @@ sys_disk: jsr SetCursorWatch ; before invoking + ;; Easiest to assume absolute path later. + jsr _MakeSrcPathAbsolute ; Trashes `INVOKER_INTERPRETER` + ;; Assume no interpreter to start lda #0 sta INVOKER_INTERPRETER sta INVOKER_BITSY_COMPAT - ;; Easiest to assume absolute path later. - param_call MakePathAbsolute, src_path_buf - ;; Get the file info to determine type. retry: jsr GetSrcFileInfo bcc :+ @@ -1142,7 +1142,7 @@ interpreter: ;; Construct absolute path ldax ptr1 - jsr _GetPrefixAndAppendToInvokerInterpreter + jsr _MakeRelPathAbsoluteIntoInvokerInterpreter FALL_THROUGH_TO launch ;; -------------------------------------------------- @@ -1260,7 +1260,7 @@ _CheckBasisSystem := _CheckBasixSystemImpl::basis .proc _CheckBasicSystem ldax #str_extras_basic - jsr _GetPrefixAndAppendToInvokerInterpreter + jsr _MakeRelPathAbsoluteIntoInvokerInterpreter param_call GetFileInfo, INVOKER_INTERPRETER jcs _CheckBasixSystemImpl::basic ; nope, look relative to launch path rts @@ -1270,7 +1270,7 @@ _CheckBasisSystem := _CheckBasixSystemImpl::basis ;;; Input: A,X = relative path to append ;;; Output: `INVOKER_INTERPRETER` has absolute path -.proc _GetPrefixAndAppendToInvokerInterpreter +.proc _MakeRelPathAbsoluteIntoInvokerInterpreter pha txa pha @@ -1281,7 +1281,7 @@ _CheckBasisSystem := _CheckBasixSystemImpl::basis tax pla FALL_THROUGH_TO _AppendToInvokerInterpreter -.endproc ; _GetPrefixAndAppendToInvokerInterpreter +.endproc ; _MakeRelPathAbsoluteIntoInvokerInterpreter ;;; -------------------------------------------------- @@ -1369,13 +1369,35 @@ check_header: .endproc ; _InvokeLink +;;; -------------------------------------------------- + +;;; Trashes: `INVOKER_INTERPRETER` +.proc _MakeSrcPathAbsolute + ;; Already absolute? + lda src_path_buf+1 + cmp #'/' + IF_NE + ;; Get prefix and append path + ldax #src_path_buf + jsr _MakeRelPathAbsoluteIntoInvokerInterpreter + + ;; Copy back to original buffer + ldy INVOKER_INTERPRETER +: lda INVOKER_INTERPRETER,y + sta src_path_buf,y + dey + bpl :- + END_IF + + rts +.endproc ; _MakeSrcPathAbsolute + ;;; -------------------------------------------------- DEFINE_GET_PREFIX_PARAMS get_prefix_params, INVOKER_INTERPRETER .endproc ; LaunchFileWithPath LaunchFileWithPathOnSystemDisk := LaunchFileWithPath::sys_disk -MakePathAbsoluteInInvokerInterpreter := LaunchFileWithPath::_GetPrefixAndAppendToInvokerInterpreter ;;; ============================================================ @@ -2025,34 +2047,6 @@ main_length: .word 0 ;;; ============================================================ -;;; Make a path absolute using current prefix. No-op if already absolute. -;;; Inputs: A,X = path -;;; Outputs: $06 is path, which is updated -;;; Trashes: `INVOKER_INTERPRETER` -.proc MakePathAbsolute - ptr := $06 - stax ptr - - ;; Already absolute? - ldy #1 - lda (ptr),y - cmp #'/' - beq ret - - ;; Get prefix and append path - ldax ptr - jsr MakePathAbsoluteInInvokerInterpreter - - ;; Copy back to original buffer - ldy INVOKER_INTERPRETER -: lda INVOKER_INTERPRETER,y - sta (ptr),y - dey - bpl :- - -ret: rts -.endproc ; MakePathAbsolute - ;;; ============================================================ ;;; Inputs: A,X = absolute path @@ -2565,9 +2559,7 @@ done: rts ;;; ============================================================ -.proc CmdDiskCopy - jmp start - +.proc CmdDiskCopyImpl DEFINE_OPEN_PARAMS open_params, str_disk_copy, IO_BUFFER DEFINE_READ_PARAMS read_params, DISK_COPY_BOOTSTRAP, kDiskCopyBootstrapLength DEFINE_CLOSE_PARAMS close_params @@ -2631,7 +2623,8 @@ start: bit ROMIN2 jmp DISK_COPY_BOOTSTRAP -.endproc ; CmdDiskCopy +.endproc ; CmdDiskCopyImpl +CmdDiskCopy := CmdDiskCopyImpl::start ;;; ============================================================ @@ -6921,9 +6914,7 @@ found_windows_list: ;;; ============================================================ -.proc OpenDirectory - jmp _Start - +.proc OpenDirectoryImpl DEFINE_OPEN_PARAMS open_params, src_path_buf, $800 dir_buffer := $C00 @@ -7227,7 +7218,8 @@ suppress_error_on_open_flag: .endproc ; _DoClose ;;; -------------------------------------------------- -.endproc ; OpenDirectory +.endproc ; OpenDirectoryImpl +OpenDirectory := OpenDirectoryImpl::_Start ;;; ============================================================ ;;; Inputs: `src_path_buf` set to full path (not modified) diff --git a/disk_copy/auxlc.s b/disk_copy/auxlc.s index ee3c2046..2bff26e0 100644 --- a/disk_copy/auxlc.s +++ b/disk_copy/auxlc.s @@ -2065,8 +2065,7 @@ ret: rts ;;; ============================================================ -.proc ShowAlertDialog - jmp start +.proc ShowAlertDialogImpl ;;; -------------------------------------------------- ;;; Messages @@ -2291,7 +2290,8 @@ find_in_alert_table: : rts .endproc ; _IsDriveEjectable -.endproc ; ShowAlertDialog +.endproc ; ShowAlertDialogImpl +ShowAlertDialog := ShowAlertDialogImpl::start ;;; ============================================================ diff --git a/toolkits/icontk.s b/toolkits/icontk.s index 775039d3..1ab3fe7f 100644 --- a/toolkits/icontk.s +++ b/toolkits/icontk.s @@ -1175,7 +1175,7 @@ done: rts ;;; ============================================================ ;;; IconInRect -.proc IconInRectImpl +.proc IconInRectImplImpl params := $06 .struct IconInRectParams icon .byte @@ -1184,8 +1184,6 @@ done: rts ptr := $06 - jmp start - icon: .byte 0 DEFINE_RECT rect, 0, 0, 0, 0 @@ -1245,7 +1243,8 @@ outside: inside: return #1 -.endproc ; IconInRectImpl +.endproc ; IconInRectImplImpl +IconInRectImpl := IconInRectImplImpl::start ;;; ============================================================ ;;; GetIconBounds @@ -2171,8 +2170,7 @@ empty: return #$FF ;;; paint call is needed, and `more_drawing_needed_flag` is non-zero ;;; if another call to this proc is needed after the paint. Returns ;;; C=1 if no clipping rect remains, so no drawing is needed. -.proc CalcWindowIntersections - jmp start +.proc CalcWindowIntersectionsImpl .params findwindow_params mousex: .word 0 @@ -2409,7 +2407,8 @@ case2: : copy #0, more_drawing_needed_flag sec ; C=1 means no clipping rect remains rts -.endproc ; CalcWindowIntersections +.endproc ; CalcWindowIntersectionsImpl +CalcWindowIntersections := CalcWindowIntersectionsImpl::start ;;; ============================================================ ;;; Used when doing clipped drawing to map viewport and icon