Japanese
PROGRAMMER'S GUIDECD communication I/F (CD part)
BackForward
CD communication interface user's manual (CD part)

Function details-6


8.2.6 Buffer information


 one
View
table
 Title

function specification

 Function

Get CD buffer size

 Function Name[S-]

CDC_GetBufSiz

 No

6.1

Format
Sint32 CDC_GetBufSiz(Sint32 *totalsiz, Sint32 *bufnum, Sint32 *freesiz)
input
none
output
 total size
 : Total buffer size (in sector units, 200 sectors = C8H)
 bufnum
 : Total number of buffer sections (24 sections = 18H)
 free size
 :Free buffer size (in sectors)
function value
Returns an error code.
function
Obtains the entire CD buffer size, the number of buffer partitions (both fixed values), and the current free size.
The number of selectors (or number of apertures) is equal to the total number of buffer compartments.
remarks
Even if the free size is 0, there are sectors in use by the system, so the buffer does not necessarily become full.

 one
View
table
 Title

function specification

 Function

Obtaining the number of sectors in the CD buffer partition

 Function Name[S-]

CDC_GetSctNum

 No

6.2

Format
Sint32 CDC_GetSctNum(Sint32 bufno, Sint32 *snum)
input
bufno: Buffer partition number
output
snum: Number of sectors in the buffer partition (buffer partition size)
function value
Returns an error code.
function
Gets the current number of sectors in the buffer partition (buffer partition size).

 one
View
table
 Title

function specification

 Function

Calculating actual data size

 Function Name[SR]

CDC_CalActSiz

 No

6.3

Format
Sint32 CDC_CalActSiz(Sint32 bufno, Sint32 spos, Sint32 snum)
input
 bufno
 :Buffer section number
 spos
 : Sector position ( CDC_SPOS_END : Indicates the last sector of the partition)
 snum
 : Number of sectors (CDC_SNUM_END: Indicates the number of sectors from spos to the end of the partition)
output
none
function value
Returns an error code.
end flag
ESEL flag
function
Calculates the actual data size (number of words when fetching to the host) from the specified sector range of the buffer partition. To obtain the calculation result, execute Get Actual Data Size (CDC_GetActSiz).
In case of an error, the actual data size will be the following value.
 constant name
 explanation
 CDC_ACTSIZ_ERR
 Could not perform calculation.
The length of one sector can be changed by setting the sector length ( CDC_SetSctLen ).
remarks
Any connectors already connected to the partition output connector will be disconnected.

 one
View
table
 Title

function specification

 Function

Obtaining actual data size

 Function Name[S-]

CDC_GetActSiz

 No

6.4

Format
Sint32 CDC_GetActSiz(Sint32 *actwnum)
input
none
output
actwnum: Actual data size (number of words)
function value
Returns an error code.
end flag
ESEL flag (only checked)
function
Get the calculation result of the actual data size (initial value 0).
The previous calculation result is retained until the next calculation ( CDC_CalActSiz ) is performed.

 one
View
table
 Title

function specification

 Function

Get sector information

 Function Name[S-]

CDC_GetSctInfo

 No

6.5

Format
Sint32 CDC_GetSctInfo(Sint32 bufno, Sint32 spos, CdcSct *sct)
input
 bufno
 :Buffer section number
 spos
 : Sector position ( CDC_SPOS_END : Indicates the last sector of the partition)
output
sct: Sector information
function value
Returns an error code.
function
Gets the header information (FAD) and subheader information of the specified sector of the buffer partition.

 one
View
table
 Title

function specification

 Function

Executing frame address search

 Function Name[SR]

CDC_ExeFadSearch

 No

6.6

Format
Sint32 CDC_ExeFadSearch(Sint32 bufno, Sint32 spos, Sint32 fad)
input
 bufno
 :Buffer section number
 spos
 : Sector position ( CDC_SPOS_END : Indicates the last sector of the partition)
 fad
 :Frame address
output
none
function value
Returns an error code.
end flag
ESEL flag
function
Searches for a sector from the specified sector position in the buffer partition using the frame address as a key. To obtain the search results, execute Get Frame Address Search Results (CDC_GetFadSearch).

(1)Search direction
Search towards the back of the buffer compartment. (from the smallest sector position to the largest sector position)

(2)Search results
The contents retained as search results are the buffer partition number, the sector position obtained by the search, and the frame address of that sector.

(3)Search conditions
If no matching FAD exists, searches for the closest sector that does not exceed the specified FAD. In other words, the FAD of the search result is the largest FAD that satisfies FAD≦specified FAD.
In case of an error, the sector position and FAD of the search result will have the following values.
 sector position
 frame address
 explanation
 CDC_SPOS_ERR
 0
 There are no sectors that meet the search conditions.
 CDC_FAD_ERR
 Search could not be performed.
remarks
Any connectors already connected to the partition output connector will be disconnected.

 one
View
table
 Title

function specification

 Function

Obtain frame address search results

 Function Name[S-]

CDC_GetFadSearch

 No

6.7

Format
Sint32 CDC_GetFadSearch(Sint32 *bufno, Sint32 *spos, Sint32 *fad)
input
none
output
 bufno
 :Buffer section number
 spos
 : Sector position
 fad
 :Frame address
function value
Returns an error code.
end flag
ESEL flag (only checked)
function
Gets the frame address search execution result (initial value is all 0).
The previous search results are retained until the next search ( CDC_ExeFadSearch ).

BackForward
PROGRAMMER'S GUIDECD communication I/F (CD part)
Copyright SEGA ENTERPRISES, LTD., 1997