PROGRAMMER'S GUIDEFile system library
BackForward
File system library

8. Function specifications-5


8.5 Read parameter settings


 List
 Title

Function specifications

 Function

Eject mode setting (resident / discard)

 Function Name

GFS_SetGmode

 No
5.1

Form
Sint32 GFS_SetGmode (GfsHn gfs, Sint32 gmode)
input
 gfs
 : File handle
 gmode
 : Eject mode (GFS_GMODE_ ~)
output
none
Function value
Eject mode before setting. Negative error code in case of error.
function
Set the eject mode.

 List
 Title

Function specifications

 Function

Transfer mode setting
(Software / DMA, etc.)

 Function Name

GFS_SetTmode

 No

5.2.

Form
Sint32 GFS_SetTmode (GfsHn gfs, Sint32 tmode)
input
 gfs
 : File handle
 tmode
 : Transfer mode (GFS_TMODE_ ~)
output
none
Function value
Transfer mode before setting. Negative error code in case of error.
function
Set the transfer method from the CD buffer.
remarks
 Even if the transfer mode is set to GFS_TMODE_SCU, software transfer by the CPU is forced if the transfer destination address is included in the following space.
WORKRAM-L space 00200000H ~ 002FFFFFH
A-Bus space 02000000H ~ 058FFFFFH

 List
 Title

Function specifications

 Function

Setting the amount of reading to the CD buffer

 Function Name

GFS_SetReadPara

 No

5.3 5.3

Form
Sint32 GFS_SetReadPara (GfsHn gfs, Sint32 cdr size)
input
 gfs
 : File handle
 cdrsize
 : Maximum amount of reading to CD buffer at one time (unit: sector)
output
none
Function value
Read amount before setting. Negative error code in case of error.
function
Set the maximum value of the amount of one read to the CD buffer.

 List
 Title

Function specifications

 Function

Setting the transfer amount from the CD buffer

 Function Name

GFS_SetTransPara

 No

5.4

Form
Sint32 GFS_SetTransPara (GfsHn gfs, Sint32 tsize)
input
 gfs
 : File handle
 tsize
 : Amount transferred to the specified area at one time (unit: sector)
output
none
Function value
Transfer amount before setting. Negative error code in case of error.
function
Set the amount of data to be transferred to the transfer destination area in one retrieval process.
[remarks]
  For convenience of processing, the DOS file retrieval parameter can only transfer one sector at a time. Setting the retrieval parameter to a value other than 1 is invalid.

 List
 Title

Function specifications

 Function

Transfer function registration

 Function Name

GFS_SetTrFunc

 No

5.5 5.5

Form
void GFS_SetTrFunc (GfsHn gfs, GfsTrFunc func)
input
 gfs
 : File handle
 func
 : Transfer function
output
none
Function value
none
function
Registers the transfer function for the specified file.
The registration function is called during the file transfer process.
remarks

  1. The registration function has the following format.
    Sint32 (* GfsTrFunc) (GfsHn gfs, Sint32 nsct)
     gfs
     : File handle
     nsct
     : Number of transferable sectors

  2. The transfer function can transfer data in up to nsct sectors.

  3. The function value returns the number of sectors actually transferred. If the transfer function is being transferred at the end of the transfer function due to DMA, etc., it is necessary to return (-1).

example
/ * Example of transfer function * /
Uint32 read_buf [BUFSIZE];
Sint32 transFunc (GfsHn gfs, Sint32 nsct)
{
Uint32 * ptr;
Sint32 dadr;
Sint32 i;
ptr = GFS_StartTrans (gfs, & dadr);
for (i = 0; i <2048 * nsct; i ++) {
read_buf [i] = * ptr;
ptr + = dadr;
}
return (nsct);
}

 List
 Title

Function specifications

 Function

Start transfer in transfer function

 Function Name

GFS_StartTrans

 No

5.6

Form
Uint32 * GFS_StartTrans (GfsHn gfs, Sint32 * dadr)
input
 gfs
 : File handle
 dadr
 1: The amount of change in the transfer source address for each longword transfer.
output
none
Function value
Forwarding address
function
The data transfer process is started in the transfer function.

BackForward
PROGRAMMER'S GUIDEFile system library
Copyright SEGA ENTERPRISES, LTD., 1997