Japanese
PROGRAMMER'S GUIDEFile system library
BackForward
file system library

8.Function specification-5


8.5 Load parameter settings


 one
View
table
 Title

function specification

 Function

Setting the retrieval mode (resident/discard)

 Function name

GFS_SetGmode

 No
5.1

Format
Sint32 GFS_SetGmode(GfsHn gfs, Sint32 gmode)
input
 gfs
 : file handle
 gmode
 : Retrieval mode (GFS_GMODE_〜)
output
none
function value
Eject mode before setting. Negative error code in case of error.
function
Set the eject mode.

 one
View
table
 Title

function specification

 Function

Transfer mode settings
(Software/DMA etc.)

 Function name

GFS_SetTmode

 No

5.2

Format
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 will be forced if the transfer destination address is included in the following space.
WORKRAM-L space 00200000H ~ 002FFFFFH
A-Bus space 02000000H ~ 058FFFFFH

 one
View
table
 Title

function specification

 Function

Setting the amount read into the CD buffer

 Function name

GFS_SetReadPara

 No

5.3

Format
Sint32 GFS_SetReadPara(GfsHn gfs, Sint32 cdrsize)
input
 gfs
 : file handle
 cdrsize
 : Maximum amount of one read into CD buffer (unit: sector)
output
none
function value
Load amount before setting. Negative error code in case of error.
function
Set the maximum amount of data that can be read into the CD buffer at one time.

 one
View
table
 Title

function specification

 Function

Setting the transfer amount from the CD buffer

 Function name

GFS_SetTransPara

 No

5.4

Format
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 destination area in one retrieval process.
[remarks]
  Due to processing reasons, the DOS file extraction parameters can only transfer one sector at a time. Setting the retrieval parameter to a value other than 1 has no effect.

 one
View
table
 Title

function specification

 Function

Registering a transfer function

 Function name

GFS_SetTrFunc

 No

5.5

Format
void GFS_SetTrFunc(GfsHn gfs, GfsTrFunc func)
input
 gfs
 : file handle
 func
 : transfer function
output
none
function value
none
function
Registers a 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 up to nsct sectors.

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

example
/* Transfer function example */
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);
}

 one
View
table
 Title

function specification

 Function

Transfer start in transfer function

 Function name

GFS_StartTrans

 No

5.6

Format
Uint32 *GFS_StartTrans(GfsHn gfs,Sint32 *dadr)
input
 gfs
 : file handle
 dadr
 : The amount of change in the transfer source address for each longword transfer.
output
none
function value
Transfer source address
function
Starts data transfer processing in the transfer function.

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