@ GNU AS assembler header file for RamFS
@ Written by DefMod (Dec  9 2012) on Sun Dec  9 15:44:51 2012
@ Jonathan Coxhead, jonathan@doves.demon.co.uk, 12 May 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.

#ifndef RamFS_Hdr
#  define RamFS_Hdr

#  ifndef Get_Types
#    define Get_Types
#    include "oslib/Types.Hdr"
#  endif

#  ifndef Get_OS
#    define Get_OS
#    include "oslib/OS.Hdr"
#  endif

#  ifndef Get_FileCore
#    define Get_FileCore
#    include "oslib/FileCore.Hdr"
#  endif

@Symbols for SWI's and SWI reason codes
.set XRamFS_DiscOp,0x60780
.set RamFS_DiscOp,0x40780

#  define RamFSDiscOp_Verify 0x0
   @Entry
   @  R1 = &0 :OR: flags (Bits)
   @  R2 = disc_addr (FileCore_DiscAddress)
   @  R4 = size (Int)
   @Exit
   @  R2 = next_disc_addr (FileCore_DiscAddress)
   @  R4 = unverified (Int)

#  define RamFSDiscOp_ReadSectors 0x1
   @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)

#  define RamFSDiscOp_WriteSectors 0x2
   @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)

#  define RamFSDiscOp_ReadTrack 0x3
   @Entry
   @  R1 = &3 :OR: flags (Bits)
   @  R2 = disc_addr (FileCore_DiscAddress)
   @  R3 = data (pointer to data)

#  define RamFSDiscOp_ReadId 0x3
   @Entry
   @  R1 = &3 :OR: flags (Bits)
   @  R2 = disc_addr (FileCore_DiscAddress)
   @  R3 = data (pointer to data)

#  define RamFSDiscOp_WriteTrack 0x4
   @Entry
   @  R1 = &4 :OR: flags (Bits)
   @  R2 = disc_addr (FileCore_DiscAddress)
   @  R3 -> data (data)

#  define RamFSDiscOp_FormatTrack 0x4
   @Entry
   @  R1 = &4 :OR: flags (Bits)
   @  R2 = disc_addr (FileCore_DiscAddress)
   @  R3 = &0
   @  R4 -> track_format (FileCore_TrackFormat)

#  define RamFSDiscOp_Seek 0x5
   @Entry
   @  R1 = &5 :OR: flags (Bits)
   @  R2 = disc_addr (FileCore_DiscAddress)

#  define RamFSDiscOp_Restore 0x6
   @Entry
   @  R1 = &6 :OR: flags (Bits)
   @  R2 = disc_addr (FileCore_DiscAddress)

#  define RamFSDiscOp_StepIn 0x7
   @Entry
   @  R1 = &7 :OR: flags (Bits)

#  define RamFSDiscOp_StepOut 0x8
   @Entry
   @  R1 = &8 :OR: flags (Bits)

#  define RamFSDiscOp_ReadSectorsViaCache 0x9
   @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)

#  define RamFSDiscOp_Specify 0xf
   @Entry
   @  R1 = &F :OR: flags (Bits)
   @  R2 = disc_addr (FileCore_DiscAddress)

.set XRamFS_Drives,0x60782
.set RamFS_Drives,0x40782
   @Exit
   @  R0 = default_drive (Int)
   @  R1 = floppy_count (Int)
   @  R2 = hard_disc_count (Int)

.set XRamFS_FreeSpace,0x60783
.set RamFS_FreeSpace,0x40783
   @Entry
   @  R0 -> disc_name (String)
   @Exit
   @  R0 = free (Int)
   @  R1 = max (Int)

.set XRamFS_DescribeDisc,0x60785
.set RamFS_DescribeDisc,0x40785
   @Entry
   @  R0 -> disc_name (String)
   @  R1 = disc (pointer to FileCore_Disc)

#endif
