home *** CD-ROM | disk | FTP | other *** search
- #ifndef filecore_H
- #define filecore_H
-
- /* C header file for FileCore
- * written by DefMod (Sep 16 1994) on Thu Sep 22 16:40:24 1994
- * Copyright © Acorn Computers Ltd, 1994
- */
-
- /*************************************************************************
- * This source file was written by Acorn Computers Limited. It is part *
- * of the OSLib library for writing applications for RISC OS. It may be *
- * used freely in the creation of programs for RISC OS. *
- *************************************************************************/
-
- #ifndef types_H
- #include "types.h"
- #endif
-
- #ifndef os_H
- #include "os.h"
- #endif
-
- /**********************************
- * SWI names and SWI reason codes *
- **********************************/
- #undef FileCore_DiscOp
- #define FileCore_DiscOp 0x40540
- #undef XFileCore_DiscOp
- #define XFileCore_DiscOp 0x60540
- #undef FileCoreDiscOp_Verify
- #define FileCoreDiscOp_Verify 0x0
- #undef FileCoreDiscOp_ReadSectors
- #define FileCoreDiscOp_ReadSectors 0x1
- #undef FileCoreDiscOp_WriteSectors
- #define FileCoreDiscOp_WriteSectors 0x2
- #undef FileCoreDiscOp_ReadTrack
- #define FileCoreDiscOp_ReadTrack 0x3
- #undef FileCoreDiscOp_ReadId
- #define FileCoreDiscOp_ReadId 0x3
- #undef FileCoreDiscOp_WriteTrack
- #define FileCoreDiscOp_WriteTrack 0x4
- #undef FileCoreDiscOp_FormatTrack
- #define FileCoreDiscOp_FormatTrack 0x4
- #undef FileCoreDiscOp_Seek
- #define FileCoreDiscOp_Seek 0x5
- #undef FileCoreDiscOp_Restore
- #define FileCoreDiscOp_Restore 0x6
- #undef FileCoreDiscOp_StepIn
- #define FileCoreDiscOp_StepIn 0x7
- #undef FileCoreDiscOp_StepOut
- #define FileCoreDiscOp_StepOut 0x8
- #undef FileCoreDiscOp_ReadSectorsViaCache
- #define FileCoreDiscOp_ReadSectorsViaCache 0x9
- #undef FileCoreDiscOp_Specify
- #define FileCoreDiscOp_Specify 0xF
- #undef FileCore_Create
- #define FileCore_Create 0x40541
- #undef XFileCore_Create
- #define XFileCore_Create 0x60541
- #undef FileCore_Drives
- #define FileCore_Drives 0x40542
- #undef XFileCore_Drives
- #define XFileCore_Drives 0x60542
- #undef FileCore_FreeSpace
- #define FileCore_FreeSpace 0x40543
- #undef XFileCore_FreeSpace
- #define XFileCore_FreeSpace 0x60543
- #undef FileCore_FloppyStructure
- #define FileCore_FloppyStructure 0x40544
- #undef XFileCore_FloppyStructure
- #define XFileCore_FloppyStructure 0x60544
- #undef FileCore_DescribeDisc
- #define FileCore_DescribeDisc 0x40545
- #undef XFileCore_DescribeDisc
- #define XFileCore_DescribeDisc 0x60545
- #undef FileCore_DiscardReadSectorsCache
- #define FileCore_DiscardReadSectorsCache 0x40546
- #undef XFileCore_DiscardReadSectorsCache
- #define XFileCore_DiscardReadSectorsCache 0x60546
- #undef FileCore_DiscFormat
- #define FileCore_DiscFormat 0x40547
- #undef XFileCore_DiscFormat
- #define XFileCore_DiscFormat 0x60547
- #undef FileCore_LayoutStructure
- #define FileCore_LayoutStructure 0x40548
- #undef XFileCore_LayoutStructure
- #define XFileCore_LayoutStructure 0x60548
- #undef FileCore_MiscOp
- #define FileCore_MiscOp 0x40549
- #undef XFileCore_MiscOp
- #define XFileCore_MiscOp 0x60549
- #undef FileCoreMiscOp_Mount
- #define FileCoreMiscOp_Mount 0x0
- #undef FileCoreMiscOp_PollChanged
- #define FileCoreMiscOp_PollChanged 0x1
- #undef FileCoreMiscOp_LockDrive
- #define FileCoreMiscOp_LockDrive 0x2
- #undef FileCoreMiscOp_UnlockDrive
- #define FileCoreMiscOp_UnlockDrive 0x3
- #undef FileCoreMiscOp_PollPeriod
- #define FileCoreMiscOp_PollPeriod 0x4
- #undef FileCoreMiscOp_EjectDisc
- #define FileCoreMiscOp_EjectDisc 0x5
- #undef Service_IdentifyDisc
- #define Service_IdentifyDisc 0x69
-
- /************************************
- * Structure and union declarations *
- ************************************/
- typedef struct filecore_descriptor filecore_descriptor;
- typedef struct filecore_disc filecore_disc;
- typedef struct filecore_format filecore_format;
- typedef struct filecore_track_format filecore_track_format;
- typedef struct filecore_defect_list filecore_defect_list;
-
- /********************
- * Type definitions *
- ********************/
- struct filecore_descriptor
- { byte flags [3];
- byte fs_no;
- int title_offset;
- int boot_text_offset;
- int disc_op_offset;
- int misc_op_offset;
- };
-
- struct filecore_disc
- { byte log2secsize;
- byte secspertrack;
- byte heads;
- byte density;
- byte idlen;
- byte log2bpmb;
- byte skew;
- byte bootoption;
- byte lowsector;
- byte nzones;
- short zone_spare;
- int root;
- int disc_size;
- short disc_id;
- char disc_name [10];
- int disctype;
- byte reserved [24];
- };
-
- typedef bits filecore_disc_address;
-
- struct filecore_format
- { int sector_size;
- int gap1_side0;
- int gap1_side1;
- int gap3;
- byte secspertrack;
- byte density;
- byte options;
- byte lowsector;
- byte interleave;
- byte side_skew;
- byte track_skew;
- byte sector_fill;
- int track_count;
- byte reserved [36];
- };
-
- struct filecore_track_format
- { int sector_size;
- int gap1_side0;
- int gap1_side1;
- int gap3;
- byte secspertrack;
- byte density;
- byte options;
- byte sector_fill;
- int track_count;
- byte reserved [12];
- bits sectors [UNKNOWN];
- };
-
- #define filecore_TRACK_FORMAT(N) \
- struct \
- { int sector_size; \
- int gap1_side0; \
- int gap1_side1; \
- int gap3; \
- byte secspertrack; \
- byte density; \
- byte options; \
- byte sector_fill; \
- int track_count; \
- byte reserved [12]; \
- bits sectors [N]; \
- }
-
- #define filecore_SIZEOF_TRACK_FORMAT(N) \
- (offsetof (filecore_track_format, sectors) + \
- (N)*sizeof ((filecore_track_format *) NULL)->sectors)
-
- struct filecore_defect_list
- { int defect [UNKNOWN];
- };
-
- #define filecore_DEFECT_LIST(N) \
- struct \
- { int defect [N]; \
- }
-
- #define filecore_SIZEOF_DEFECT_LIST(N) \
- ((N)*sizeof ((filecore_defect_list *) NULL)->defect)
-
- /************************
- * Constant definitions *
- ************************/
- #define filecore_HARD_DISCS_NEED_FIQ 0x1u
- #define filecore_FLOPPIES_NEED_FIQ 0x2u
- #define filecore_USE_SCRATCH_FOR_TEMPORARY 0x8u
- #define filecore_HARD_DISCS_CAN_MOUNT 0x10u
- #define filecore_HARD_DISCS_CAN_POLL_CHANGE 0x20u
- #define filecore_FLOPPIES_CAN_EJECT 0x40u
- #define filecore_HARD_DISCS_CAN_EJECT 0x100u
- #define filecore_LOW_SECTOR_SEQUENCE_SIDES 0x40u
- #define filecore_LOW_SECTOR_DOUBLE_STEP 0x80u
- #define filecore_DISC_ADDRESS_OFFSET 0x1FFFFFFFu
- #define filecore_DISC_ADDRESS_DRIVE 0xE0000000u
- #define filecore_DISC_ADDRESS_OFFSET_SHIFT 0
- #define filecore_DISC_ADDRESS_DRIVE_SHIFT 29
- #define filecore_DISC_OP_GIVEN_ALTERNATIVE_DEFECT_LIST 0x10u
- #define filecore_DISC_OP_GIVEN_SECTOR_LIST 0x20u
- #define filecore_DISC_OP_IGNORE_ESCAPE 0x40u
- #define filecore_DISC_OP_IGNORE_TIMEOUT 0x80u
- #define filecore_DISC_OP_ALTERNATIVE_RECORD 0xFFFFFF00u
- #define filecore_DISC_OP_ALTERNATIVE_RECORD_SHIFT 6
- #define filecore_CREATE_FLOPPY_COUNT 0xFFu
- #define filecore_CREATE_FLOPPY_COUNT_SHIFT 0
- #define filecore_CREATE_HARD_DISC_COUNT 0xFF00u
- #define filecore_CREATE_HARD_DISC_COUNT_SHIFT 8
- #define filecore_CREATE_DEFAULT_DRIVE 0xFF0000u
- #define filecore_CREATE_DEFAULT_DRIVE_SHIFT 16
- #define filecore_CREATE_NO_DIR_STATE 0x40000000u
- #define filecore_FLOPPY_OLD_STRUCTURE 0x80u
- #define filecore_FLOPPY_OLD_MAP 0x100u
- #define filecore_FORMATL 128
- #define filecore_FORMATD 129
- #define filecore_FORMATE 130
- #define filecore_FORMATF 131
- #define filecore_POLL_NOT_CHANGED 0x1u
- #define filecore_POLL_MAY_BE_CHANGED 0x2u
- #define filecore_POLL_CHANGED 0x4u
- #define filecore_POLL_EMPTY 0x8u
- #define filecore_POLL_READY 0x10u
- #define filecore_POLL_FORTY_TRACK 0x20u
- #define filecore_POLL_EMPTY_WORKS 0x40u
- #define filecore_POLL_CHANGED_WORKS 0x80u
- #define filecore_POLL_HIGH_DENSITY 0x100u
- #define filecore_POLL_DENSITY_SENSE_WORKS 0x200u
- #define filecore_POLL_READY_WORKS 0x400u
-
- /*************************
- * Function declarations *
- *************************/
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- /*************************************************************
- * NOTE: The following functions provide direct access to *
- * the SWI's noted in the function description. *
- * Please read the relevant PRM section for more *
- * information on their input/output parameters. *
- *************************************************************/
-
- /* ------------------------------------------------------------------------
- * Function: filecorediscop_verify()
- *
- * Description: Verifies a disc
- *
- * Input: flags - value of R1 on entry
- * disc_addr - value of R2 on entry
- * size - value of R4 on entry
- * instance - value of R8 on entry
- *
- * Output: next_disc_addr - value of R2 on exit
- * unverified - value of R4 on exit (X version only)
- *
- * Returns: R4 (non-X version only)
- *
- * Other notes: Calls SWI 0x40540 with R1 |= 0x0.
- */
-
- extern os_error *xfilecorediscop_verify (bits flags,
- filecore_disc_address disc_addr,
- int size,
- void *instance,
- filecore_disc_address *next_disc_addr,
- int *unverified);
- extern int filecorediscop_verify (bits flags,
- filecore_disc_address disc_addr,
- int size,
- void *instance,
- filecore_disc_address *next_disc_addr);
-
- /* ------------------------------------------------------------------------
- * Function: filecorediscop_read_sectors()
- *
- * Description: Reads sectors from a disc
- *
- * Input: flags - value of R1 on entry
- * disc_addr - value of R2 on entry
- * data - value of R3 on entry
- * size - value of R4 on entry
- * instance - value of R8 on entry
- *
- * Output: next_disc_addr - value of R2 on exit
- * next_data - value of R3 on exit
- * unread - value of R4 on exit (X version only)
- *
- * Returns: R4 (non-X version only)
- *
- * Other notes: Calls SWI 0x40540 with R1 |= 0x1.
- */
-
- extern os_error *xfilecorediscop_read_sectors (bits flags,
- filecore_disc_address disc_addr,
- byte *data,
- int size,
- void *instance,
- filecore_disc_address *next_disc_addr,
- byte **next_data,
- int *unread);
- extern int filecorediscop_read_sectors (bits flags,
- filecore_disc_address disc_addr,
- byte *data,
- int size,
- void *instance,
- filecore_disc_address *next_disc_addr,
- byte **next_data);
-
- /* ------------------------------------------------------------------------
- * Function: filecorediscop_write_sectors()
- *
- * Description: Writes sectors to a disc
- *
- * Input: flags - value of R1 on entry
- * disc_addr - value of R2 on entry
- * data - value of R3 on entry
- * size - value of R4 on entry
- * instance - value of R8 on entry
- *
- * Output: next_disc_addr - value of R2 on exit
- * next_data - value of R3 on exit
- * unwritten - value of R4 on exit (X version only)
- *
- * Returns: R4 (non-X version only)
- *
- * Other notes: Calls SWI 0x40540 with R1 |= 0x2.
- */
-
- extern os_error *xfilecorediscop_write_sectors (bits flags,
- filecore_disc_address disc_addr,
- byte *data,
- int size,
- void *instance,
- filecore_disc_address *next_disc_addr,
- byte **next_data,
- int *unwritten);
- extern int filecorediscop_write_sectors (bits flags,
- filecore_disc_address disc_addr,
- byte *data,
- int size,
- void *instance,
- filecore_disc_address *next_disc_addr,
- byte **next_data);
-
- /* ------------------------------------------------------------------------
- * Function: filecorediscop_read_track()
- *
- * Description: Reads a track from a floppy disc
- *
- * Input: flags - value of R1 on entry
- * disc_addr - value of R2 on entry
- * data - value of R3 on entry
- * instance - value of R8 on entry
- *
- * Other notes: Calls SWI 0x40540 with R1 |= 0x3.
- */
-
- extern os_error *xfilecorediscop_read_track (bits flags,
- filecore_disc_address disc_addr,
- byte *data,
- void *instance);
- extern void filecorediscop_read_track (bits flags,
- filecore_disc_address disc_addr,
- byte *data,
- void *instance);
-
- /* ------------------------------------------------------------------------
- * Function: filecorediscop_read_id()
- *
- * Description: Reads a hard disc ID
- *
- * Input: flags - value of R1 on entry
- * disc_addr - value of R2 on entry
- * data - value of R3 on entry
- * instance - value of R8 on entry
- *
- * Other notes: Calls SWI 0x40540 with R1 |= 0x3.
- */
-
- extern os_error *xfilecorediscop_read_id (bits flags,
- filecore_disc_address disc_addr,
- byte *data,
- void *instance);
- extern void filecorediscop_read_id (bits flags,
- filecore_disc_address disc_addr,
- byte *data,
- void *instance);
-
- /* ------------------------------------------------------------------------
- * Function: filecorediscop_write_track()
- *
- * Description: Writes a track to a disc
- *
- * Input: flags - value of R1 on entry
- * disc_addr - value of R2 on entry
- * data - value of R3 on entry
- * instance - value of R8 on entry
- *
- * Other notes: Calls SWI 0x40540 with R1 |= 0x4.
- */
-
- extern os_error *xfilecorediscop_write_track (bits flags,
- filecore_disc_address disc_addr,
- byte *data,
- void *instance);
- extern void filecorediscop_write_track (bits flags,
- filecore_disc_address disc_addr,
- byte *data,
- void *instance);
-
- /* ------------------------------------------------------------------------
- * Function: filecorediscop_format_track()
- *
- * Description: Formats a track of a disc
- *
- * Input: flags - value of R1 on entry
- * disc_addr - value of R2 on entry
- * track_format - value of R4 on entry
- * instance - value of R8 on entry
- *
- * Other notes: Calls SWI 0x40540 with R1 |= 0x4, R3 = 0x0.
- */
-
- extern os_error *xfilecorediscop_format_track (bits flags,
- filecore_disc_address disc_addr,
- filecore_track_format *track_format,
- void *instance);
- extern void filecorediscop_format_track (bits flags,
- filecore_disc_address disc_addr,
- filecore_track_format *track_format,
- void *instance);
-
- /* ------------------------------------------------------------------------
- * Function: filecorediscop_seek()
- *
- * Description: Seeks to a disc location
- *
- * Input: flags - value of R1 on entry
- * disc_addr - value of R2 on entry
- * instance - value of R8 on entry
- *
- * Other notes: Calls SWI 0x40540 with R1 |= 0x5.
- */
-
- extern os_error *xfilecorediscop_seek (bits flags,
- filecore_disc_address disc_addr,
- void *instance);
- extern void filecorediscop_seek (bits flags,
- filecore_disc_address disc_addr,
- void *instance);
-
- /* ------------------------------------------------------------------------
- * Function: filecorediscop_restore()
- *
- * Description: Does a restore operation for a disc
- *
- * Input: flags - value of R1 on entry
- * disc_addr - value of R2 on entry
- * instance - value of R8 on entry
- *
- * Other notes: Calls SWI 0x40540 with R1 |= 0x6.
- */
-
- extern os_error *xfilecorediscop_restore (bits flags,
- filecore_disc_address disc_addr,
- void *instance);
- extern void filecorediscop_restore (bits flags,
- filecore_disc_address disc_addr,
- void *instance);
-
- /* ------------------------------------------------------------------------
- * Function: filecorediscop_step_in()
- *
- * Description: Steps a floppy disc in one track
- *
- * Input: flags - value of R1 on entry
- * instance - value of R8 on entry
- *
- * Other notes: Calls SWI 0x40540 with R1 |= 0x7.
- */
-
- extern os_error *xfilecorediscop_step_in (bits flags,
- void *instance);
- extern void filecorediscop_step_in (bits flags,
- void *instance);
-
- /* ------------------------------------------------------------------------
- * Function: filecorediscop_step_out()
- *
- * Description: Steps a floppy disc out one track
- *
- * Input: flags - value of R1 on entry
- * instance - value of R8 on entry
- *
- * Other notes: Calls SWI 0x40540 with R1 |= 0x8.
- */
-
- extern os_error *xfilecorediscop_step_out (bits flags,
- void *instance);
- extern void filecorediscop_step_out (bits flags,
- void *instance);
-
- /* ------------------------------------------------------------------------
- * Function: filecorediscop_read_sectors_via_cache()
- *
- * Description: Reads sectors of a disc using the RMA cache
- *
- * Input: flags - value of R1 on entry
- * disc_addr - value of R2 on entry
- * data - value of R3 on entry
- * size - value of R4 on entry
- * cache_handle - value of R6 on entry
- * instance - value of R8 on entry
- *
- * Output: next_disc_addr - value of R2 on exit
- * next_data - value of R3 on exit
- * unread - value of R4 on exit (X version only)
- * cache_handle_out - value of R6 on exit
- *
- * Returns: R4 (non-X version only)
- *
- * Other notes: Calls SWI 0x40540 with R1 |= 0x9.
- */
-
- extern os_error *xfilecorediscop_read_sectors_via_cache (bits flags,
- filecore_disc_address disc_addr,
- byte *data,
- int size,
- int cache_handle,
- void *instance,
- filecore_disc_address *next_disc_addr,
- byte **next_data,
- int *unread,
- int *cache_handle_out);
- extern int filecorediscop_read_sectors_via_cache (bits flags,
- filecore_disc_address disc_addr,
- byte *data,
- int size,
- int cache_handle,
- void *instance,
- filecore_disc_address *next_disc_addr,
- byte **next_data,
- int *cache_handle_out);
-
- /* ------------------------------------------------------------------------
- * Function: filecorediscop_specify()
- *
- * Description: Does a specify operation on a hard disc
- *
- * Input: flags - value of R1 on entry
- * disc_addr - value of R2 on entry
- * instance - value of R8 on entry
- *
- * Other notes: Calls SWI 0x40540 with R1 |= 0xF.
- */
-
- extern os_error *xfilecorediscop_specify (bits flags,
- filecore_disc_address disc_addr,
- void *instance);
- extern void filecorediscop_specify (bits flags,
- filecore_disc_address disc_addr,
- void *instance);
-
- /* ------------------------------------------------------------------------
- * Function: filecore_create()
- *
- * Description: Creates a new instantiation of an ADFS-like filing system
- *
- * Input: descriptor - value of R0 on entry
- * module_base - value of R1 on entry
- * word - value of R2 on entry
- * options - value of R3 on entry
- * dir_cache_size - value of R4 on entry
- * file_cache_buffer_count - value of R5 on entry
- * map_sizes - value of R6 on entry
- *
- * Output: instance - value of R0 on exit
- * floppy_done - value of R1 on exit
- * hard_disc_done - value of R2 on exit
- * release_fiq - value of R3 on exit
- *
- * Other notes: Calls SWI 0x40541.
- */
-
- extern os_error *xfilecore_create (filecore_descriptor *descriptor,
- byte *module_base,
- byte *word,
- bits options,
- int dir_cache_size,
- int file_cache_buffer_count,
- bits map_sizes,
- void **instance,
- void **floppy_done,
- void **hard_disc_done,
- void **release_fiq);
- extern void filecore_create (filecore_descriptor *descriptor,
- byte *module_base,
- byte *word,
- bits options,
- int dir_cache_size,
- int file_cache_buffer_count,
- bits map_sizes,
- void **instance,
- void **floppy_done,
- void **hard_disc_done,
- void **release_fiq);
-
- /* ------------------------------------------------------------------------
- * Function: filecore_drives()
- *
- * Description: Returns information on a filing system's drives
- *
- * Input: instance - value of R8 on entry
- *
- * Output: default_drive - value of R0 on exit
- * floppy_count - value of R1 on exit
- * hard_disc_count - value of R2 on exit
- *
- * Other notes: Calls SWI 0x40542.
- */
-
- extern os_error *xfilecore_drives (void *instance,
- int *default_drive,
- int *floppy_count,
- int *hard_disc_count);
- extern void filecore_drives (void *instance,
- int *default_drive,
- int *floppy_count,
- int *hard_disc_count);
-
- /* ------------------------------------------------------------------------
- * Function: filecore_free_space()
- *
- * Description: Returns information on a disc's free space
- *
- * Input: disc_name - value of R0 on entry
- * instance - value of R8 on entry
- *
- * Output: free - value of R0 on exit (X version only)
- * max - value of R1 on exit
- *
- * Returns: R0 (non-X version only)
- *
- * Other notes: Calls SWI 0x40543.
- */
-
- extern os_error *xfilecore_free_space (char *disc_name,
- void *instance,
- int *free,
- int *max);
- extern int filecore_free_space (char *disc_name,
- void *instance,
- int *max);
-
- /* ------------------------------------------------------------------------
- * Function: filecore_floppy_structure()
- *
- * Description: Creates a RAM image of a floppy disc map and root
- * directory entry
- *
- * Input: buffer - value of R0 on entry
- * disc - value of R1 on entry
- * flags - value of R2 on entry
- * defect_list - value of R3 on entry
- *
- * Output: used - value of R3 on exit
- *
- * Other notes: Calls SWI 0x40544.
- */
-
- extern os_error *xfilecore_floppy_structure (byte *buffer,
- filecore_disc *disc,
- bits flags,
- filecore_defect_list *defect_list,
- int *used);
- extern void filecore_floppy_structure (byte *buffer,
- filecore_disc *disc,
- bits flags,
- filecore_defect_list *defect_list,
- int *used);
-
- /* ------------------------------------------------------------------------
- * Function: filecore_describe_disc()
- *
- * Description: Returns a disc record describing a disc's shape and
- * format
- *
- * Input: disc_name - value of R0 on entry
- * disc - value of R1 on entry
- * instance - value of R8 on entry
- *
- * Other notes: Calls SWI 0x40545.
- */
-
- extern os_error *xfilecore_describe_disc (char *disc_name,
- filecore_disc *disc,
- void *instance);
- extern void filecore_describe_disc (char *disc_name,
- filecore_disc *disc,
- void *instance);
-
- /* ------------------------------------------------------------------------
- * Function: filecore_discard_read_sectors_cache()
- *
- * Description: Discards the cache of read sectors created by
- * FileCoreDiscOp_ReadSectorsViaCache
- *
- * Input: cache_handle - value of R6 on entry
- *
- * Other notes: Calls SWI 0x40546.
- */
-
- extern os_error *xfilecore_discard_read_sectors_cache (int cache_handle);
- extern void filecore_discard_read_sectors_cache (int cache_handle);
-
- /* ------------------------------------------------------------------------
- * Function: filecore_disc_format()
- *
- * Description: Fills in a disc format structure with parameters for the
- * specified format
- *
- * Input: buffer - value of R0 on entry
- * vet_format_swi - value of R1 on entry
- * vet_format_handle - value of R2 on entry
- * format - value of R3 on entry
- *
- * Other notes: Calls SWI 0x40547.
- */
-
- extern os_error *xfilecore_disc_format (filecore_format *buffer,
- int vet_format_swi,
- int vet_format_handle,
- int format);
- extern void filecore_disc_format (filecore_format *buffer,
- int vet_format_swi,
- int vet_format_handle,
- int format);
-
- /* ------------------------------------------------------------------------
- * Function: filecore_layout_structure()
- *
- * Description: Lays out into the specified file a set of structures for
- * its format
- *
- * Input: disc - value of R0 on entry
- * defect_list - value of R1 on entry
- * disc_name - value of R2 on entry
- * image_file - value of R3 on entry
- *
- * Other notes: Calls SWI 0x40548.
- */
-
- extern os_error *xfilecore_layout_structure (filecore_disc *disc,
- filecore_defect_list *defect_list,
- char *disc_name,
- os_f image_file);
- extern void filecore_layout_structure (filecore_disc *disc,
- filecore_defect_list *defect_list,
- char *disc_name,
- os_f image_file);
-
- /* ------------------------------------------------------------------------
- * Function: filecoremiscop_mount()
- *
- * Description: Mounts a disc, reading in the data asked for
- *
- * Input: drive_no - value of R1 on entry
- * disc_addr - value of R2 on entry
- * buffer - value of R3 on entry
- * size - value of R4 on entry
- * disc - value of R5 on entry
- * instance - value of R8 on entry
- *
- * Other notes: Calls SWI 0x40549 with R0 = 0x0.
- */
-
- extern os_error *xfilecoremiscop_mount (int drive_no,
- filecore_disc_address disc_addr,
- byte *buffer,
- int size,
- filecore_disc *disc,
- void *instance);
- extern void filecoremiscop_mount (int drive_no,
- filecore_disc_address disc_addr,
- byte *buffer,
- int size,
- filecore_disc *disc,
- void *instance);
-
- /* ------------------------------------------------------------------------
- * Function: filecoremiscop_poll_changed()
- *
- * Description: Polls the sequence number for a drive
- *
- * Input: drive_no - value of R1 on entry
- * sequence_no - value of R2 on entry
- * instance - value of R8 on entry
- *
- * Output: sequence_no_out - value of R2 on exit
- * result - value of R3 on exit
- *
- * Other notes: Calls SWI 0x40549 with R0 = 0x1.
- */
-
- extern os_error *xfilecoremiscop_poll_changed (int drive_no,
- int sequence_no,
- void *instance,
- int *sequence_no_out,
- bits *result);
- extern void filecoremiscop_poll_changed (int drive_no,
- int sequence_no,
- void *instance,
- int *sequence_no_out,
- bits *result);
-
- /* ------------------------------------------------------------------------
- * Function: filecoremiscop_lock_drive()
- *
- * Description: Locks a disc in a floppy drive
- *
- * Input: drive_no - value of R1 on entry
- * instance - value of R8 on entry
- *
- * Other notes: Calls SWI 0x40549 with R0 = 0x2.
- */
-
- extern os_error *xfilecoremiscop_lock_drive (int drive_no,
- void *instance);
- extern void filecoremiscop_lock_drive (int drive_no,
- void *instance);
-
- /* ------------------------------------------------------------------------
- * Function: filecoremiscop_unlock_drive()
- *
- * Description: Unlocks a disc in a floppy drive
- *
- * Input: drive_no - value of R1 on entry
- * instance - value of R8 on entry
- *
- * Other notes: Calls SWI 0x40549 with R0 = 0x3.
- */
-
- extern os_error *xfilecoremiscop_unlock_drive (int drive_no,
- void *instance);
- extern void filecoremiscop_unlock_drive (int drive_no,
- void *instance);
-
- /* ------------------------------------------------------------------------
- * Function: filecoremiscop_poll_period()
- *
- * Description: Informs FileCore of the minimum period between polling
- * for disc insertion
- *
- * Input: disc_name - value of R1 on entry
- * instance - value of R8 on entry
- *
- * Output: poll_period - value of R5 on exit
- * media_type - value of R6 on exit
- *
- * Other notes: Calls SWI 0x40549 with R0 = 0x4.
- */
-
- extern os_error *xfilecoremiscop_poll_period (char *disc_name,
- void *instance,
- int *poll_period,
- char **media_type);
- extern void filecoremiscop_poll_period (char *disc_name,
- void *instance,
- int *poll_period,
- char **media_type);
-
- /* ------------------------------------------------------------------------
- * Function: filecoremiscop_eject_disc()
- *
- * Description: Power-ejects the disc in the specified drive
- *
- * Input: drive_no - value of R1 on entry
- * instance - value of R8 on entry
- *
- * Other notes: Calls SWI 0x40549 with R0 = 0x5.
- */
-
- extern os_error *xfilecoremiscop_eject_disc (int drive_no,
- void *instance);
- extern void filecoremiscop_eject_disc (int drive_no,
- void *instance);
-
- /* ------------------------------------------------------------------------
- * Function: service_identify_disc()
- *
- * Description: Identifies disc format
- *
- * Input: format_name - value of R2 on entry
- * size - value of R3 on entry
- * disc - value of R5 on entry
- * cache_handle - value of R6 on entry
- * instance - value of R8 on entry
- *
- * Output: unclaimed - value of R1 on exit (X version only)
- * file_type - value of R2 on exit
- * cache_handle_out - value of R6 on exit
- *
- * Returns: R1 (non-X version only)
- *
- * Other notes: Calls SWI 0x30 with R1 = 0x69.
- */
-
- extern os_error *xservice_identify_disc (char *format_name,
- int size,
- filecore_disc *disc,
- int cache_handle,
- void *instance,
- bool *unclaimed,
- bits *file_type,
- int *cache_handle_out);
- extern bool service_identify_disc (char *format_name,
- int size,
- filecore_disc *disc,
- int cache_handle,
- void *instance,
- bits *file_type,
- int *cache_handle_out);
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif
-