; Assembler header file for SCSIFS
; Written by DefMod (Dec  9 2012) on Sun Dec  9 15:43:44 2012
; Jonathan Coxhead, jonathan@doves.demon.co.uk, 27 June 1995

; OSLib---efficient, type-safe, transparent, extensible,
; register-safe API coverage of RISC OS
; 
; Copyright (c) 1994-2012 Jonathan Coxhead and OSLib maintainers
; 
; Licence:
; 
;    OSLib is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation; either version 1, or (at your option)
; any later version - and this with the following clarification and
; special exception:
; 
;    Linking this library statically or dynamically with other modules
; is making a combined work based on this library. Thus, the terms
; and conditions of the GNU General Public License cover the whole
; combination.
; 
;    As a special exception, the copyright holders of this library
; give you permission to link this library with independent modules
; to produce an executable, regardless of the license terms of these
; independent modules, and to copy and distribute the resulting
; executable under terms of your choice, provided that you also meet,
; for each linked independent module, the terms and conditions of the
; license of that module. An independent module is a module which is
; not derived from or based on this library. If you modify this
; library, you may extend this exception to your version of the library,
; but you are not obliged to do so. If you do not wish to do so, delete
; this exception statement from your version.
; 
;    OSLib is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
; GNU General Public License for more details.
; 
;    You should have received a copy of the GNU General Public License
; along with this programme; if not, write to the Free Software
; Foundation, Inc, 675 Mass Ave, Cambridge, MA 02139, USA.

        [       :LNOT: :DEF: SCSIFS_Hdr
        GBLS    SCSIFS_Hdr

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

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

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

;Symbols for constants
SCSIFS_DriveAbsent              *       &0
SCSIFS_DriveUnready             *       &1
SCSIFS_DriveReady               *       &2

;Symbols for structure offsets and sizes
        ^       0
        #       Int
SCSIFS_DriveStatus              *       @


;Symbols for SWI's and SWI reason codes
XSCSIFS_DiscOp                  *       &60980
SCSIFS_DiscOp                   *       &40980

SCSIFSDiscOp_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)

SCSIFSDiscOp_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)

SCSIFSDiscOp_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)

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

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

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

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

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

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

SCSIFSDiscOp_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)

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

XSCSIFS_Drives                  *       &60982
SCSIFS_Drives                   *       &40982
   ;Exit
   ;  R0 = default_drive (Int)
   ;  R1 = floppy_count (Int)
   ;  R2 = hard_disc_count (Int)

XSCSIFS_FreeSpace               *       &60983
SCSIFS_FreeSpace                *       &40983
   ;Entry
   ;  R0 -> disc_name (String)
   ;Exit
   ;  R0 = free (Int)
   ;  R1 = max (Int)

XSCSIFS_DescribeDisc            *       &60985
SCSIFS_DescribeDisc             *       &40985
   ;Entry
   ;  R0 -> disc_name (String)
   ;  R1 = disc (pointer to FileCore_Disc)

XSCSIFS_TestReady               *       &60986
SCSIFS_TestReady                *       &40986
   ;Entry
   ;  R1 = drive_no (Int)
   ;Exit
   ;  R0 = status (SCSIFS_DriveStatus)

XSCSIFS_TestMounted             *       &60987
SCSIFS_TestMounted              *       &40987
   ;Exit
   ;  R0 = flags (Bits)

XSCSIFS_MiscOp                  *       &6098C
SCSIFS_MiscOp                   *       &4098C

XSCSIFS_SectorDiscOp            *       &6098D
SCSIFS_SectorDiscOp             *       &4098D

XSCSIFS_FreeSpace64             *       &60992
SCSIFS_FreeSpace64              *       &40992
   ;Entry
   ;  R0 -> disc_name (String)
   ;Exit
   ;  R0 = free_lo (Bits)
   ;  R1 = free_hi (Int)
   ;  R2 = max (Int)

        ]
        END
