create prefs file as TXT

This commit is contained in:
4am 2021-06-18 20:26:26 -04:00
parent db9c045d11
commit 2ce68a439a
3 changed files with 12 additions and 16 deletions

View File

@ -238,13 +238,11 @@ DeleteFile
bne mli ; always branches
;-------------------------------
; CreateDir/CreateFile
; CreateDir/CreateBinFile/CreateTxtFile
;
; create a directory or file via ProDOS MLI
; always sets access bits to $C3 (full access)
; always sets creation to 0 (current date/time)
; always sets storage type to $0D (directory) or 1 (file)
; always sets file type to $0F (directory) or 6 (BIN file)
; in: caller has filled @mliparam+1 with address of pathname
; out: if error, C set and A contains error code
; if success, C clear and A clobbered
@ -252,15 +250,20 @@ DeleteFile
CreateDir
lda #$0D
ldy #$0F
bne +
CreateFile
lda #1
ldy #6
bne + ; always branches
CreateBinFile
ldy #$06
!byte $2C
CreateTxtFile
ldy #$04
lda #$01
+ sta mliparam+7 ; storage type (directory or file)
sty mliparam+4 ; file type (directory or binary)
lda #FULL_ACCESS
sta mliparam+3 ; access bits (full access)
lda #0
sta mliparam+5 ; aux type (none)
sta mliparam+6
sta mliparam+8 ; creation date (current)
sta mliparam+9
sta mliparam+10 ; creation time (current)

View File

@ -12,14 +12,7 @@
lda #>PREFSFILE
sta mliparam+2
jsr DeleteFile ; don't care if this fails
lda #FULL_ACCESS
sta mliparam+3
lda #$04 ; text file type
sta mliparam+4
lda #$00
sta mliparam+5 ; no aux file type
sta mliparam+6
jsr CreateFile
jsr CreateTxtFile
bcs +
lda #<PREFSBUFFER
sta mliparam+3

View File

@ -122,7 +122,7 @@ WriteTrackSecondPass
; C set on error, and A = MLI error code
;-------------------------------
Create140KFile
jsr CreateFile
jsr CreateBinFile
bcs @exit
lda #$00
sta mliparam+3 ; io_buffer at address $0800