mirror of
https://github.com/a2-4am/passport.git
synced 2025-01-03 08:33:18 +00:00
[WIP] ScanForRAMDisk
This commit is contained in:
parent
8ee9b11c95
commit
47acabad9a
41
src/mli.a
41
src/mli.a
@ -1,6 +1,8 @@
|
|||||||
; MLI command codes
|
; MLI command codes
|
||||||
CMD_CREATE = $C0 ; create new file
|
CMD_CREATE = $C0 ; create new file
|
||||||
CMD_DESTROY = $C1 ; delete a 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_SETPREFIX = $C6 ; change default pathname prefix
|
||||||
CMD_OPEN = $C8 ; open a file
|
CMD_OPEN = $C8 ; open a file
|
||||||
CMD_NEWLINE = $C9 ; set line-by-line read mode
|
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
|
; MLI parameter counts
|
||||||
PC_CREATE = $07
|
PC_CREATE = $07
|
||||||
PC_DESTROY = $01
|
PC_DESTROY = $01
|
||||||
|
PC_GETFILEINFO = $0A
|
||||||
|
PC_ONLINE = $02
|
||||||
PC_SETPREFIX = $01
|
PC_SETPREFIX = $01
|
||||||
PC_OPEN = $03
|
PC_OPEN = $03
|
||||||
PC_NEWLINE = $03
|
PC_NEWLINE = $03
|
||||||
@ -501,6 +505,43 @@ SetPrefix
|
|||||||
jsr mli
|
jsr mli
|
||||||
rts
|
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
|
; low-level MLI wrapper
|
||||||
; in: A = MLI command code
|
; in: A = MLI command code
|
||||||
|
@ -87,6 +87,7 @@ cmp1 = $F8 ; word
|
|||||||
cmp2 = $FA ; word
|
cmp2 = $FA ; word
|
||||||
counter = $FC ; byte
|
counter = $FC ; byte
|
||||||
tmp = $FC ; byte
|
tmp = $FC ; byte
|
||||||
|
iunit = $FC ; byte
|
||||||
tmpa = $FC ; byte
|
tmpa = $FC ; byte
|
||||||
tmpx = $FD ; byte
|
tmpx = $FD ; byte
|
||||||
tmpy = $FE ; byte
|
tmpy = $FE ; byte
|
||||||
@ -94,7 +95,7 @@ flag = $FF ; byte
|
|||||||
}
|
}
|
||||||
|
|
||||||
; Application constants (not zero addresses)
|
; 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
|
; so that it's out of the way
|
||||||
LOWPOINT = $4300 ; lowest available address for code
|
LOWPOINT = $4300 ; lowest available address for code
|
||||||
BASEPAGE = $10 ; Special Delivery tracer assumes
|
BASEPAGE = $10 ; Special Delivery tracer assumes
|
||||||
@ -185,6 +186,7 @@ OneTimeSetup
|
|||||||
bne .founds6
|
bne .founds6
|
||||||
jmp FatalNoSlot6
|
jmp FatalNoSlot6
|
||||||
.founds6
|
.founds6
|
||||||
|
jsr ScanForRAMDisk
|
||||||
jsr LoadPrefs ; load preferences (if available)
|
jsr LoadPrefs ; load preferences (if available)
|
||||||
bcc ResetVector
|
bcc ResetVector
|
||||||
jsr SavePrefs ; save preferences (if possible)
|
jsr SavePrefs ; save preferences (if possible)
|
||||||
|
27
src/slots.a
27
src/slots.a
@ -76,3 +76,30 @@ NextSlot
|
|||||||
.reallydone
|
.reallydone
|
||||||
rts
|
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
|
||||||
|
}
|
||||||
|
@ -210,7 +210,7 @@ StringTable
|
|||||||
; can be set directly before calling PrintByID.
|
; can be set directly before calling PrintByID.
|
||||||
;
|
;
|
||||||
.header
|
.header
|
||||||
!text "Passport by 4am 2017-05-14",00
|
!text "Passport by 4am 2017-05-16",00
|
||||||
.mainmenu
|
.mainmenu
|
||||||
!text "________________________________________",$8D,$8D,$8D,$8D,$8D,$8D,$8D
|
!text "________________________________________",$8D,$8D,$8D,$8D,$8D,$8D,$8D
|
||||||
!text " "
|
!text " "
|
||||||
|
Loading…
Reference in New Issue
Block a user