;Assembler header file for RamFS
;written by DefMod (Mar  9 1999) on Thu Apr  8 04:36:27 1999
;Jonathan Coxhead, jonathan@doves.demon.co.uk, 12 May 1995

        [       :LNOT: :DEF: Get_Types
        GBLS    Get_Types
        ]
        [       :LNOT: :DEF: Types_Hdr
Get_Types                       SETS    "GET OS:Hdr.Types"
        |
Get_Types                       SETS    ""
        ]
        $Get_Types

        [       :LNOT: :DEF: Get_OS
        GBLS    Get_OS
        ]
        [       :LNOT: :DEF: OS_Hdr
Get_OS                          SETS    "GET OS:Hdr.OS"
        |
Get_OS                          SETS    ""
        ]
        $Get_OS

        [       :LNOT: :DEF: Get_FileCore
        GBLS    Get_FileCore
        ]
        [       :LNOT: :DEF: FileCore_Hdr
Get_FileCore                    SETS    "GET OS:Hdr.FileCore"
        |
Get_FileCore                    SETS    ""
        ]
        $Get_FileCore

        [       :LNOT: :DEF: RamFS_Hdr
        GBLS    RamFS_Hdr

;Symbols for SWIs and SWI reason codes
XRamFS_DiscOp                   *       &60780
RamFS_DiscOp                    *       &40780

RamFSDiscOp_Verify              *       &0
   ;Entry
   ;  R1 = &0 :OR: flags (Bits)
   ;  R2 = disc_addr (FileCore_DiscAddress)
   ;  R4 = size (Int)
   ;Exit
   ;  R2 = next_disc_addr (FileCore_DiscAddress)
   ;  R4 = unverified (Int)

RamFSDiscOp_ReadSectors         *       &1
   ;Entry
   ;  R1 = &1 :OR: flags (Bits)
   ;  R2 = disc_addr (FileCore_DiscAddress)
   ;  R3 = data (pointer to data)
   ;  R4 = size (Int)
   ;Exit
   ;  R2 = next_disc_addr (FileCore_DiscAddress)
   ;  R3 = next_data (pointer to data)
   ;  R4 = unread (Int)

RamFSDiscOp_WriteSectors        *       &2
   ;Entry
   ;  R1 = &2 :OR: flags (Bits)
   ;  R2 = disc_addr (FileCore_DiscAddress)
   ;  R3 -> data (data)
   ;  R4 = size (Int)
   ;Exit
   ;  R2 = next_disc_addr (FileCore_DiscAddress)
   ;  R3 -> next_data (data)
   ;  R4 = unwritten (Int)

RamFSDiscOp_ReadTrack           *       &3
   ;Entry
   ;  R1 = &3 :OR: flags (Bits)
   ;  R2 = disc_addr (FileCore_DiscAddress)
   ;  R3 = data (pointer to data)

RamFSDiscOp_ReadId              *       &3
   ;Entry
   ;  R1 = &3 :OR: flags (Bits)
   ;  R2 = disc_addr (FileCore_DiscAddress)
   ;  R3 = data (pointer to data)

RamFSDiscOp_WriteTrack          *       &4
   ;Entry
   ;  R1 = &4 :OR: flags (Bits)
   ;  R2 = disc_addr (FileCore_DiscAddress)
   ;  R3 -> data (data)

RamFSDiscOp_FormatTrack         *       &4
   ;Entry
   ;  R1 = &4 :OR: flags (Bits)
   ;  R2 = disc_addr (FileCore_DiscAddress)
   ;  R3 = &0
   ;  R4 -> track_format (FileCore_TrackFormat)

RamFSDiscOp_Seek                *       &5
   ;Entry
   ;  R1 = &5 :OR: flags (Bits)
   ;  R2 = disc_addr (FileCore_DiscAddress)

RamFSDiscOp_Restore             *       &6
   ;Entry
   ;  R1 = &6 :OR: flags (Bits)
   ;  R2 = disc_addr (FileCore_DiscAddress)

RamFSDiscOp_StepIn              *       &7
   ;Entry
   ;  R1 = &7 :OR: flags (Bits)

RamFSDiscOp_StepOut             *       &8
   ;Entry
   ;  R1 = &8 :OR: flags (Bits)

RamFSDiscOp_ReadSectorsViaCache *       &9
   ;Entry
   ;  R1 = &9 :OR: flags (Bits)
   ;  R2 = disc_addr (FileCore_DiscAddress)
   ;  R3 = data (pointer to data)
   ;  R4 = size (Int)
   ;  R6 = cache_handle (Int)
   ;Exit
   ;  R2 = next_disc_addr (FileCore_DiscAddress)
   ;  R3 = next_data (pointer to data)
   ;  R4 = unread (Int)
   ;  R6 = cache_handle_out (Int)

RamFSDiscOp_Specify             *       &F
   ;Entry
   ;  R1 = &F :OR: flags (Bits)
   ;  R2 = disc_addr (FileCore_DiscAddress)

XRamFS_Drives                   *       &60782
RamFS_Drives                    *       &40782
   ;Exit
   ;  R0 = default_drive (Int)
   ;  R1 = floppy_count (Int)
   ;  R2 = hard_disc_count (Int)

XRamFS_FreeSpace                *       &60783
RamFS_FreeSpace                 *       &40783
   ;Entry
   ;  R0 -> disc_name (String)
   ;Exit
   ;  R0 = free (Int)
   ;  R1 = max (Int)

XRamFS_DescribeDisc             *       &60785
RamFS_DescribeDisc              *       &40785
   ;Entry
   ;  R0 -> disc_name (String)
   ;  R1 = disc (pointer to FileCore_Disc)

        ]

        END
