print full path when writing to file

This commit is contained in:
4am 2021-04-14 12:40:53 -04:00
parent ed060454fd
commit de98679962
4 changed files with 93 additions and 44 deletions

View File

@ -32,7 +32,7 @@ PRODOSMLI = $BF00 ; [callable] MLI entry point
RAMFileName !text "PASSPORTTMP.DSK"
RAMFileName_e
HardDirName !text "PASSPORT.IMG"
HardDirName !text "PASSPORT"
HardDirName_e
HardDiskName !text "/IMG0000.DSK"
@ -62,23 +62,7 @@ WriteTrackMLI
and gUsingRAMDisk
beq +
jsr ReorderBuffer
+ lda DRIVE ; ProDOS "unit number" is
sec
sbc #$31
lsr ; DSSS0000, where D is the
lda #00 ; drive number (0=drive 1,
ror ; 1=drive 2) and SSS is
; the slot number (1-7).
; "Beneath Apple ProDOS"
; page 6-19
sta mliparam+1
lda SLOT
asl
asl
asl
asl
ora mliparam+1
sta mliparam+1
+ jsr CalculateAndStoreUnitNumber
lda #$00
sta mliparam+2 ; lo byte of data buffer
lda #$08
@ -128,6 +112,37 @@ WriteTrackMLI
.blockcount !byte $FF
}
;-------------------------------
; CalculateAndStoreUnitNumber
;
; ProDOS 'unit number' is DSSS0000, where
; D is the drive number (0=drive 1, 1=drive 2) and
; SSS is the slot number (1-7)
; c.f. 'Beneath Apple ProDOS' page 6-19
;
; in: @SLOT contains (slot x 16) + $30
; @DRIVE contains drive + $30
; out: mliparam+1 contains ProDOS unit number
;-------------------------------
!zone {
CalculateAndStoreUnitNumber
lda DRIVE ; drive number is stored as ASCII text
sec
sbc #$31
lsr
lda #0
ror
sta mliparam+1
lda SLOT
asl
asl
asl
asl
ora mliparam+1
sta mliparam+1
rts
}
;-------------------------------
; SaveFile1Shot
; save a file to disk all at once,
@ -744,11 +759,13 @@ CreateHardDir
; in: A = unit number (DSSS0000)
; out: if no disk in drive or any MLI error, C set and A contains error code
; if disk found, C clear and @VolumeName contains volume name
; (length byte + up to 14 character name, no leading slash)
; (up to 15 character name, no leading slash)
; note: lower 4 bits of @OnlineReturn contain length of @VolumeName
;-------------------------------
!zone {
GetVolumeName
sta mliparam+1
GetVolumeNameInternal
lda #<OnlineReturn
sta mliparam+2
lda #>OnlineReturn

View File

@ -183,6 +183,12 @@ MainMenu
jsr PrintByID
lda #s_mainmenu
jsr PrintByID
lda #s_targetdisk
ldx gUsingHardDisk
bne .printtargettype
lda #s_targetfile
.printtargettype
jsr PrintByID
.getkey
jsr WaitForKey
cmp #$80
@ -536,7 +542,9 @@ Pass
beq +
lda gUsingRAMDisk
bne +
lda #s_writing
lda #s_writingto
jsr PrintByID
lda #s_slotanddrive
jsr PrintByID
jsr WriteRAMToDisk
bcc +
@ -682,16 +690,30 @@ WriteTrackNA ; entry point used by Special Delivery tracer
bit gMode
bpl .exit ; verify mode -> no write
lda gSaidWriting
beq .write
lda #s_writehard ; only print "writing to hard disk" message once
beq .write ; only print 'writing to' message once
lda #s_writingto
jsr PrintByID
ldx gUsingHardDisk
beq +
lda #s_writeram ; only print "writing to RAM disk" message once
bne +
lda DiskImgPath
sta .volumelen
ldx #0
- lda DiskImgPath+1, x
ora #$80
jsr PrintA
inx
.volumelen=*+1
cpx #$FD ; SMC
bcc -
lda #$8D
jsr PrintA
bvc ++ ; always branches
+ lda #s_ramdisk
ldx gUsingRAMDisk
beq +
lda #s_writing ; only print "writing to slot/drive" message once
lda #s_slotanddrive
+ jsr PrintByID
lda #TRUE
++ lda #TRUE
sta gSaidWriting
.write
jsr WriteTrackMLI

View File

@ -25,7 +25,7 @@ StringTableLow
!byte <.optimum
!byte <.builtin
!byte <.switch
!byte <.writing
!byte <.slotanddrive
!byte <.unformat
!byte <.f7
!byte <.sync
@ -99,7 +99,7 @@ StringTableLow
!byte <.bbf9
!byte <.micrograms
!byte <.cmpbne0
!byte <.writeram
!byte <.ramdisk
!byte <.d5timing
!byte <.advint
!byte <.dos32boot0
@ -154,7 +154,9 @@ StringTableLow
!byte <.timingbits
!byte <.acceptsany
!byte <.addressepilogue
!byte <.writehard
!byte <.writingto
!byte <.targetdisk
!byte <.targetfile
StringTableHigh
!byte >.header
@ -167,7 +169,7 @@ StringTableHigh
!byte >.optimum
!byte >.builtin
!byte >.switch
!byte >.writing
!byte >.slotanddrive
!byte >.unformat
!byte >.f7
!byte >.sync
@ -241,7 +243,7 @@ StringTableHigh
!byte >.bbf9
!byte >.micrograms
!byte >.cmpbne0
!byte >.writeram
!byte >.ramdisk
!byte >.d5timing
!byte >.advint
!byte >.dos32boot0
@ -296,7 +298,9 @@ StringTableHigh
!byte >.timingbits
!byte >.acceptsany
!byte >.addressepilogue
!byte >.writehard
!byte >.writingto
!byte >.targetdisk
!byte >.targetfile
;
; Text can contain substitution strings, which
@ -332,7 +336,7 @@ StringTableHigh
.passport
!text "Passport ",$00
.header
!text "@",s_passport,"by 4am@",s_space7,"@",s_space7," 2021-04-13",$00
!text "@",s_passport,"by 4am@",s_space7,"@",s_space7," 2021-04-14",$00
.bar9
!text "_________",$00
.bar18
@ -352,9 +356,13 @@ StringTableHigh
!text " @",s_space7,"@",s_space7
!scrxor $40,"Q"
!text "uit",$8D,$8D,$8D,$8D,$8D,$8D,$8D,$8D
!text "source: S6,D1@",s_space7,"@",s_space7,"target: "
!text "source: S6,D1@",s_space7,"target: "
!scrxor $40,"S"
!text "%S,D%D",$00
!text "%S,D%D (",$00
.targetdisk
!text "disk)",$00
.targetfile
!text "file)",$00
.progbar
!byte $8D
!text " _@",s_bar,"_",$8D
@ -364,6 +372,8 @@ StringTableHigh
!scrxor $00," ",$8D,$8D,$8D,$00
.reading
!text "Reading from S6,D1",$8D,$00
.writingto
!text "Writing to ",$00
.diskrwts
!text "Using disk's own RWTS",$8D,$00
.found
@ -407,8 +417,10 @@ StringTableHigh
!text "Using @",s_builtinrwts,$8D,$00
.switch
!text "T%t,S%s Switching to @",s_builtinrwts,$8D,$00
.writing
!text "Writing to S%S,D%D",$8D,$00
.slotanddrive
!text "S%S,D%D",$8D,$00
.ramdisk
!text "RAM disk",$8D,$00
.unformat
!text "T%t is unformatted",$8D,$00
.f7
@ -620,8 +632,6 @@ StringTableHigh
.cmpnopnop
!text "@",s_rwts,"@",s_acceptsany,$8D
!text "second @",s_addressepilogue,"nibble",$8D,$00
.writeram
!text "Writing to RAM disk",$8D,$00
.d5timing
!text "@",s_rwts,"accepts $D5 + @",s_timingbits,$8D
!text "as the entire address prologue",$8D,$00
@ -697,6 +707,4 @@ StringTableHigh
!text "T00,S01 Erasing site license information",$00
.badblock
!text "@",s_found,"bad block @",s_protectioncheck,$00
.writehard
!text "Writing to hard disk",$8D,$00
}

View File

@ -12,7 +12,7 @@ s_sunburst = $06
s_optimum = $07
s_builtin = $08
s_switch = $09
s_writing = $0A
s_slotanddrive = $0A
s_unformat = $0B
s_f7 = $0C
s_sync = $0D
@ -86,7 +86,7 @@ s_laureate = $50
s_bbf9 = $51
s_micrograms = $52
s_cmpbne0 = $53
s_writeram = $54
s_ramdisk = $54
s_d5timing = $55
s_advint = $56
s_dos32b0 = $57
@ -141,4 +141,6 @@ s_thedisk = $87
s_timingbits = $88
s_acceptsany = $89
s_addressepilogue = $8A
s_writehard = $8B
s_writingto = $8B
s_targetdisk = $8C
s_targetfile = $8D