Subversion Repositories Spectranet

[/] [trunk/] [rom/] [vfs.asm] - Diff between revs 483 and 570

Show entire file | Details | Blame | View Log

Rev 483 Rev 570
Line 59... Line 59...
; be provided.
; be provided.
.include        "moduledefs.inc"
.include        "moduledefs.inc"
.include        "sysvars.inc"
.include        "sysvars.inc"
.include        "sysdefs.inc"
.include        "sysdefs.inc"
.include        "sockdefs.inc"
.include        "sockdefs.inc"
 
.include    "errno.inc"
 
 
;----------------------------------------------------------------------------
;----------------------------------------------------------------------------
; Dispatcher routines.
; Dispatcher routines.
.globl F_fd_dispatch
.globl F_fd_dispatch
F_fd_dispatch:
F_fd_dispatch:
Line 222... Line 223...
; - If the proto is not recognised, return with Z set
; - If the proto is not recognised, return with Z set
.globl F_mount
.globl F_mount
F_mount:
F_mount:
        ; First search for a ROM that handles this protocol.
        ; First search for a ROM that handles this protocol.
        ld (v_mountnumber), a   ; save device number
        ld (v_mountnumber), a   ; save device number
 
        add a,VFSVECBASE % 256  ; Add the vector table base address to
 
        ld l, a                 ; form the LSB of the table address to fill.
 
        ld h, 0x3F              ; 0x3F = system variables block
 
        ld a,(hl)
 
        cp 0
 
        jr nz, .notfree ; the mountpoint is in use
 
 
 
        ; search for a ROM that handles this protocol.
 
        ld a,(v_mountnumber)
        ld hl, vectors
        ld hl, vectors
.findrom9:
.findrom9:
        ld a, (hl)              ; get ROM ID
        ld a, (hl)              ; get ROM ID
        and a                   ; check for the terminator
        and a                   ; check for the terminator
        jr z, .notfound9                ; no ROM found that handles this protocol
        jr z, .notfound9                ; no ROM found that handles this protocol
Line 263... Line 273...
        call F_poppageB         ; restore stack and page
        call F_poppageB         ; restore stack and page
        pop af                  ; unwind stack
        pop af                  ; unwind stack
        pop hl                  ; restore HL
        pop hl                  ; restore HL
        ex af, af'
        ex af, af'
        ret
        ret
 
 
 
.notfree:
 
    ld a, TMPBUSY   ; mount point already used
 
    scf
 
    ret
.notfound9:
.notfound9:
        ld a, 0xFE              ; TODO: proper return code here
        ld a, TUNKPROTO ; unknown VFS protocol
        scf
        scf
        ret
        ret
 
 
 
 
;--------------------------------------------------------------------------
;--------------------------------------------------------------------------
; F_freemountpoint
; F_freemountpoint
; Frees a mount point, passed in A
; Frees a mount point, passed in A
.globl F_freemountpoint
.globl F_freemountpoint
F_freemountpoint:
F_freemountpoint: