; -> Notes


; ********** Useful things to remember ********

 Page 836 of PRM

--------------------------------
 File attributes ( eg WR / RL )
--------------------------------

 bit 0    - Object has read access  ( owner )
 bit 1    - Object has write access ( owner )
 bit 2    - Undefined
 bit 3    - Object is locked against deletion
 bit 4    - Object has read access  ( public )
 bit 5    - Object has write access ( public )
 bit 6    - Undefined
 bit 7    - Undefined

 bit 8    - used by Leonardo to represent the ! in a name (not valid in ISO)

--------------------------------
 Load and execution address page 837 PRM
--------------------------------

 Load address       XXXLLLLL

 Execution address  GGGGGGGG


 actual load address    = &LLLLL
 actual execute address = &GGGGGGGG


 When a file is *Run, it is loaded at address &XXXLLLLL and execution starts
at &GGGGGGGG. The execution address must be within the program or an error
is given.




 IF 'XXX' = 'FFF' then the file is date-stamped
       {
        execution address = lower 4 bytes of number of centi-seconds
                            since 1st Jan 1900

        load address l/b  = h/b of number of centi-seconds

        load address = FFFtttdd
                       where ttt = file type, eg sprite, data

       }


--------------------------------
 OS_File 5, 13, 15 and 17  see page 850
--------------------------------

 Read catalogue information for a named object

 IF OS_File 5  THEN File$Path system variable used
 IF OS_File 13 THEN string pointed to by R4
 IF OS_File 15 THEN variable pointed to by R4
 IF OS_File 15 THEN none

--------------------------------
 OS_File 12, 14, 16 and 255  see page 855
--------------------------------

 Load a named file

entry:

 R1 -> wildcarded object name


 IF R3 AND 255 = 0 THEN R2 = address to load file at


 IF OS_File 12 THEN R4 -> control-character terminated path string

 IF OS_File 14 THEN R4 -> path variable, terminated by control char

 IF OS_File 16 THEN none

 IF OS_File 255 THEN R0 -> File$Path system variable


*************************************************************************
*************************************************************************
    Description of each buffer
*************************************************************************
*************************************************************************


*************************************************************************
    Description of each directory buffer
*************************************************************************

 Offset            Contents

 0                 LBA of entry

 4                 Load address

 8                 Execution address

 12                Length

 16                Time / Date ( cs since 1/1/1900 ) - 0 if not stamped

 21                Object type

 22                File attributes

 23                Object name ( null terminated )


*************************************************************************
    Description of each list of discs in buffer
*************************************************************************

 Offset            Contents

 0                 Disc

 4                 PointerToBuffer

 8                 LBA from which directory came ( root = PVD )

*************************************************************************
    Description of buffer used by 'Open'
*************************************************************************


 0                 LBA of entry

 4                 Unique Disc Number

 8                 Block size of disc

 12                Size of file

 16                File switch handle

 20                Drive number

 21                Disc mode

 22                Disc Name - as given by the CD

 54

*************************************************************************
    Description ofLibrary and User Root Directory
*************************************************************************

 If the number_of_drives_configured = 0 THEN
                                             x = 1
                                        ELSE
                                             x = number_of_drives_configured
 ENDIF

Amount of space reserved for LIB and URD paths= x * ( LIBLENGTH + URDLENGTH )

 First ( x * LIBLENGTH ) bytes of reserved space is for library

 Next ( x * URDLENGTH ) bytes of reserved space is for user root directory



 Library and URD are shown as NOT being selected if first byte of the path
= 0.


*************************************************************************
    Description of data laid on an ISO ARCHY disc
*************************************************************************

 "ARCHIMEDES"             10 bytes

 LOAD ADDRESS             1 word     ( not aligned )

 EXECUTION ADDRESS        1 word     ( not aligned )

 FILE ATTRIBUTES          1 byte

 PLING BYTE               1 byte

 RESERVED                 2 bytes

 RESERVED                10 bytes

File attributes :
                bits 0 to 7 as normal
                bit  8 = 1 THEN file is !filename
 
*************************************************************************
    Description of byte in CMOS RAM and its use
*************************************************************************

 byte number = &8A

 bits 0 to 4   =   Number of drives attached to computer

 bits 5 to 7   =   UNUSED

*************************************************************************
    Description of FSEntry_Func calls
*************************************************************************

 0   used by *command 'Dir'

 1   used by *command 'LIB'

 2   used by *command 'CAT'

 3   used by *command 'EX'

 4   used by *command 'LCAT'

 5   used by *command 'LEX'

 6   used by *command 'INFO'

 7

 8

 9

 10   attempts to boot from the disc ( $.!Boot ? )

 11   reads the name of the disc and the boot option on it

 12   returns the CSD path and owner/public status

 13 - same as 12 but for LIB

 14 - used by OS_GBPB 9 & 8

 15 - used by desktop, OS_GBPB 10

 16 - shutdown

 17

 18

 19 - used by OS_GBPB 11


 20


*************************************************************************
    Description of data returned by 'Enumerate Device'
*************************************************************************


0      Read-only           10 Mbytes SONY     CD-ROM CDU-541   2.5a

device number    = 7 characters
type             = 20 characters
capacity         = 10 characters
vendor           = 9 characters
product          = 10 characters
revision number  = 4 characters
null termination = 1 character

TOTAL            = 61 characters



; Reason codes passed to fscb^.File

fsfile_Load          *  &FF     d
fsfile_Save          *  0       n/a
fsfile_WriteInfo     *  1       n/a
fsfile_WriteLoad     *  2       n/a
fsfile_WriteExec     *  3       n/a
fsfile_WriteAttr     *  4       n/a
fsfile_ReadInfo      *  5
fsfile_Delete        *  6       n/a
fsfile_Create        *  7       n/a
fsfile_CreateDir     *  8       n/a
fsfile_ReadInfoNoLen *  9       not called


; Reason codes passed to fscb^.Args

                        ^ 0
fsargs_ReadPTR          # 1      ARGS 0        not supported             0
fsargs_SetPTR           # 1      ARGS 1        not supported             1
fsargs_ReadEXT          # 1      ARGS 2        not supported             2
fsargs_SetEXT           # 1      ARGS 3        All fs                    3
fsargs_ReadSize         # 1      ARGS 4        All FS                    4
fsargs_EOFCheck         # 1      ARGS 5        not supported             5
fsargs_Flush            # 1      ARGS 255      not supported (or Nick)   6
fsargs_EnsureSize       # 1      ARGS 6        All fs                    7
fsargs_WriteZeroes      # 1      internal      Only buffered fs          8
fsargs_ReadLoadExec     # 1      internal      All fs                    9


; Reason codes passed to fscb^.Func

                        ^ 0
fsfunc_Dir              # 1 ; FSC 0                      0 d
fsfunc_Lib              # 1 ; FSC 1                      1
fsfunc_Cat              # 1 ; FSC 5                      2 d
fsfunc_Ex               # 1 ; FSC 6                      3 d
fsfunc_LCat             # 1 ; FSC 7                      4
fsfunc_LEx              # 1 ; FSC 8                      5
fsfunc_Info             # 1 ; FSC 9                      6
fsfunc_Opt              # 1 ; FSC 10                     7 n/a
fsfunc_Rename           # 1 ; FSC 25                     8 n/a
fsfunc_Access           # 1 ; FSC 24                     9 n/a
fsfunc_Bootup           # 1 ; FSC 15                    10
fsfunc_ReadDiscName     # 1 ; GBPB 5                    11 d
fsfunc_ReadCSDName      # 1 ; GBPB 6                    12
fsfunc_ReadLIBName      # 1 ; GBPB 7                    13
fsfunc_ReadDirEntries   # 1 ; GBPB 9                    14 d
fsfunc_ReadDirEntriesInfo # 1 ; GBPB 10                 15 d
fsfunc_ShutDown         # 1 ; FSC 23                    16
fsfunc_PrintBanner      # 1 ; internal                  17
fsfunc_SetContexts      # 1 ; FSC ??                    18 not used
fsfunc_CatalogObjects   # 1 ; GBPB 11                   19 d
fsfunc_FileInfo         # 1 ; FSC 32 *FileInfo          20 not used

***************************************************************************
              Details of file containing new file types
***************************************************************************

Pathname for redirecting extension names = CDFSNewFileTypePath$File


 File format:

             xxx<SPACE>yyyyyy<CR>

 Where xxx is up to three characters followed by a space ( char 32 ) to      indicate which extension is to be converted.
 Where yyyyyy is up to 6 digits ( including base specifier ) for the file    type, followed by a return ( char 13 ).

***************************************************************************
              Details of drive types
***************************************************************************

 Drive type             Description
 ----------             -----------

     0                  SONY CDU 6111-11
     1                  PHILIPS LMS CM212 ( also CM231 family presumably )
     2                  TOSHIBA 3222  ( Not the latest Toshiba ! )
     3                  HITACHI 1650S ( probably 1750S also )
     4                  CHINON/CUMANA

***************************************************************************



