[WIP] ScanForRAMDisk

This commit is contained in:
4am 2017-05-16 12:14:20 -04:00
parent 8ee9b11c95
commit 47acabad9a
4 changed files with 72 additions and 2 deletions

View File

@ -1,6 +1,8 @@
; MLI command codes
CMD_CREATE = $C0 ; create new file
CMD_DESTROY = $C1 ; delete a file
CMD_GETFILEINFO = $C4 ; get file (or volume) info
CMD_ONLINE = $C5 ; check online volume(s)
CMD_SETPREFIX = $C6 ; change default pathname prefix
CMD_OPEN = $C8 ; open a file
CMD_NEWLINE = $C9 ; set line-by-line read mode
@ -12,6 +14,8 @@ CMD_SETMARK = $CE ; change position in an open file
; MLI parameter counts
PC_CREATE = $07
PC_DESTROY = $01
PC_GETFILEINFO = $0A
PC_ONLINE = $02
PC_SETPREFIX = $01
PC_OPEN = $03
PC_NEWLINE = $03
@ -501,6 +505,43 @@ SetPrefix
jsr mli
rts
;-------------------------------
; get volume name of disk in specific slot+drive
; 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)
;-------------------------------
!zone {
GetVolumeName
sta mliparam+1
lda #<OnlineReturn
sta mliparam+2
lda #>OnlineReturn
sta mliparam+3
jsr Online
rts
OnlineReturn
!byte $FF
VolumeName
!byte $FF,$FF,$FF,$FF,$FF,$FF,$FF
!byte $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
}
;-------------------------------
; check if volume is online
; using ProDOS MLI
; in: caller has filled @mliparam
; with unit number
; out: if error, C set and A contains error code
; if success, C clear
;-------------------------------
Online
lda #CMD_ONLINE
ldy #PC_ONLINE
jsr mli
rts
;-------------------------------
; low-level MLI wrapper
; in: A = MLI command code

View File

@ -87,6 +87,7 @@ cmp1 = $F8 ; word
cmp2 = $FA ; word
counter = $FC ; byte
tmp = $FC ; byte
iunit = $FC ; byte
tmpa = $FC ; byte
tmpx = $FD ; byte
tmpy = $FE ; byte
@ -94,7 +95,7 @@ flag = $FF ; byte
}
; Application constants (not zero addresses)
RELBASE = $6100 ; address to move Passport code
RELBASE = $6000 ; address to move Passport code
; so that it's out of the way
LOWPOINT = $4300 ; lowest available address for code
BASEPAGE = $10 ; Special Delivery tracer assumes
@ -185,6 +186,7 @@ OneTimeSetup
bne .founds6
jmp FatalNoSlot6
.founds6
jsr ScanForRAMDisk
jsr LoadPrefs ; load preferences (if available)
bcc ResetVector
jsr SavePrefs ; save preferences (if possible)

View File

@ -76,3 +76,30 @@ NextSlot
.reallydone
rts
}
!zone {
ScanForRAMDisk
rts
lda #$00
sta $0800
sta $0801
lda #$00
sta iunit
- lda iunit
clc
adc #$10
sta iunit
beq .done
cmp #$80
beq -
jsr GetVolumeName
bcs -
lda #<VolumeName
sta $0800
lda #>VolumeName
sta $0801
.done
jmp $ff59
}

View File

@ -210,7 +210,7 @@ StringTable
; can be set directly before calling PrintByID.
;
.header
!text "Passport by 4am 2017-05-14",00
!text "Passport by 4am 2017-05-16",00
.mainmenu
!text "________________________________________",$8D,$8D,$8D,$8D,$8D,$8D,$8D
!text " "