Optimize and fix comments (thanks to Oliver Schmidt)

This commit is contained in:
Colin Leroy-Mira 2023-08-18 14:36:52 +02:00 committed by Oliver Schmidt
parent 1f68846116
commit 148be69f97
2 changed files with 12 additions and 11 deletions

View File

@ -9,14 +9,10 @@
.include "apple2.inc"
.include "mli.inc"
mli_parameters:
.byte $01 ; number of parameters
.addr __cwd ; address of parameter
initcwd:
; Check for ProDOS 8
lda __dos_type
beq oserr
beq done
; Save random counter
lda RNDL
@ -25,17 +21,19 @@ initcwd:
pha
; Call MLI
; We're not using mli.s' callmli because its
; mliparam is in BSS and this will be called
; before LC code is moved to the Language Card.
jsr $BF00 ; MLI call entry point
.byte GET_PREFIX_CALL ; MLI command
.addr mli_parameters ; MLI parameter
; Restore random counter
tax
pla
sta RNDH
pla
sta RNDL
txa
; Check for null prefix
ldx __cwd
@ -57,6 +55,8 @@ initcwd:
done: rts
oserr: lda #$01 ; "Bad system call number"
sec
rts
.rodata
mli_parameters:
.byte $01 ; Number of parameters
.addr __cwd ; Address of parameter

View File

@ -29,7 +29,8 @@ __syschdir:
bcs cleanup
; Update current working directory
jsr initcwd ; Returns with A = 0
jsr initcwd
lda #$00
; Cleanup name
cleanup:jsr popname ; Preserves A