MOVIE TOOLS GUIDECinepak for SEGA Saturn
BackForward
Cinepak for SEGA Saturn


4.6 Function details

 Title
Function specifications
 Data
Initialize
 Data Name
CPK_Init
 No
1.1

 Format Bool CPK_Init (void)
If it can be initialized to None None input output function value normal TRUE
   If it cannot be initialized normally FALSE
Immediately after starting the function program, it will be initialized to use this library.
Remarks When using this library, be sure to call this function at the beginning of the program.
 Title
Function specifications
 Data
End processing
 Data Name
CPK_Finish
 No
1.2

 Format void CPK_Finish (void)
The reproduction of None None input output function value without function movie if you do not take place later, please call this function.
 Title
Function specifications
 Data
Creating a handle (memory)
 Data Name
CPK_CreateMemMovie
 No
2.1

 Format CpkHn CPK_CreateMemMovie (CpkCreatePara * para)
Input para: None creating parameter output function value movie handle (If you can not create NULL)
Function Creates a move handle to play a move file in memory.
remarks
    • You can create 32 movies at the same time.
    • Load the movie file into memory with the application program.
    • For the movie handle generated by CPK_CreateMemMovie, be sure to notify the size of the movie file with CPK_NotifyWriteSize.
 Title
Function specifications
 Data
Erase handle (memory)
 Data Name
CPK_DestroyMemMovi
 No
2.2

 Format void CPK_DestroyMemMovie (CpkHn cpk)
Input cpk: movie clears the handle without the output function value without function movie handle.
  Once you erase a handle, that movie handle can no longer be used.
 Title
Function specifications
 Data
Creating a handle (file system)
 Data Name
CPK_CreateGfsMovie
 No
2.3

 Format CpkHn CPK_CreateGfsMovie (CpkCreatePara * para, GfsHn gfs)
Input para: Creation parameter  gfs: No file handle output function value movie handle (NULL if you can not create)
Features Creates a movie handle for playing movie files on the file system.
remarks
    • You can create 32 movies at the same time.
    • Obtain the file handle with the application program in advance.
 Title
Function specifications
 Data
Erase handle (file system)
 Data Name
CPK_DestroyGfsMovi
 No
2.4

 Format void CPK_DestroyGfsMovie (CpkHn cpk)
Input cpk: movie handle output No function value No function
    • Erase the movie handle.
    • Once you erase a handle, that movie handle can no longer be used.
    • Erase the movie handle before closing the file handle.
 Title
Function specifications
 Data
Creating a handle (stream system)
 Data Name
CPK_CreateStmMovie
 No
2.5

 Format CpkHn CPK_CreateStmMovie (CpkCreatePara * para, StmHn stm)
Input para: Creation parameter  stm: No file handle output function value movie handle (NULL if you can not create)
Function Creates a movie handle for playing a movie file on a stream system.
remarks
    • You can create 32 movies at the same time.
    • Obtain the stream handle in the application program in advance.
 Title
Function specifications
 Data
Erase handle (stream system)
 Data Name
CPK_DestroyStmMovi
 No
2.6

 Format void CPK_DestroyStmMovie (CpkHn cpk)
Input cpk: movie handle output No function value No function
    • Erase the movie handle.
    • Once you erase a handle, that movie handle can no longer be used.
    • Erase the movie handle before closing the stream handle.
 Title
Function specifications
 Data
Play task
 Data Name
CPK_Task
 No
2.7 2.7

 Format void CPK_Task (CpkHn cpk)
Input cpk: movie and extract processing of file reading and image from the handle output No function value No function CD.
Remarks Call this function periodically during movie playback.
  Make the calling interval longer than the number of playback frames. Smooth when the number of frames is less than  Cannot play.
  After reading this function, make sure that the display timing is set by CPK_IsDispTime.  Please. If CPK_IsDispTime returns TRUE, the tie to display the image  Since it is ming, if it is deployed in sprite VRAM, change the frame  Please. If it was expanded to memory, transfer it to VRAM.
  Then be sure to call CPK_CompleteDisp.
  If the extraction destination address is specified in VRAM, it will be expanded before the display timing.  So please be careful.
 Title
Function specifications
 Data
Judgment of display timing
 Data Name
CPK_IsDispTime
 No
2.8

 Format Bool CPK_IsDispTime (CpkHn cpk)
Input cpk: movie and handle ends the deployment of no output function value movie frame images, TRUE when the time when displaying
   FALSE when it is not yet time to display
Function When this function returns to TRUE, it is time to display a one-frame image.  So, if it was expanded to Sprite VRAM, change the frame. memory  If it was expanded to, transfer the expanded contents to VRAM.
  Be sure to call CPK_CompleteDisp after that.
 Title
Function specifications
 Data
Notification of display completion
 Data Name
CPK_CompleteDisp
 No
2.9

 Format void CPK_CompleteDisp (CpkHn cpk)
Input cpk: movie handle output No function value None function image display will notify the library that it has finished.
Remarks Call this function when CPK_IsDispFrame becomes TRUE.
  If you don't call it, the movie won't play.
 Title
Function specifications
 Data
V blank IN processing function
 Data Name
CPK_VblIn
 No
2.10

 Format void CPK_VblIn (void)
Make the management of playback time of None None input output function value without function movie.
Remarks When using this library, be sure to call this function with a V blank IN interrupt.
 Title
Function specifications
 Data
Start playing
 Data Name
CPK_Start
 No
3.1 3.1

 Format void CPK_Start (CpkHn cpk)
Input cpk: the movie to start playing the handle without an output function value without function movie.
remarks
    • You can play a movie only once for the generated movie handle. If you want to play the same movie over and over again, generate a movie handle each time.
 Title
Function specifications
 Data
Stop playing
 Data Name
CPK_Stop
 No
3.2

 Format void CPK_Stop (CpkHn cpk)
Input cpk: movie to stop playing the handle without an output function value without function movie.
 Title
Function specifications
 Data
Pause
 Data Name
CPK_Pause
 No
3.3

 Format void CPK_Pause (CpkHn cpk, CpkPauseCmd cmd)
Input cpk: movie handle  cmd: Pause the playback of the pause of the control command no output function value without function movie, and release.
 Title
Function specifications
 Data
Registration of the next movie to play
 Data Name
CPK_EntryNext
 No
3.4 3.4

 Format void CPK_EntryNext (CpkHn cpk)
Input cpk: movie Register the movie handle to play next handle without an output function value without function. If you register the movie with this function,
  When the currently playing movie ends, it will automatically switch to the next movie.
  If you specify NULL, the registration will be canceled.
  Even when forced switching is performed with CPK_Change, the movie registered with this function will be played next.  Will be done.
 Title
Function specifications
 Data
Forced switching of movie
 Data Name
CPK_Change
 No
3.5

 Format void CPK_Change (void)
Interrupt the movie being None None Input Output function value no function currently playing, playing the movie that is registered in CPK_EntryNext    let's start doing.
 Title
Function specifications
 Data
Get the switching status of the movie
 Data Name
CPK_CheckChange
 No
3.6

 Format CpkChangeStatus CPK_CheckChange (void)
Returns the possibility of switching at the time of the forced switching without without input output function value Force switching possibility check value function CPK_Change.
 Title
Function specifications
 Data
Expansion of specified frame
 Data Name
CPK_DecodeFrame
 No
3.7

 Format void CPK_DecodeFrame (CpkHn cpk, Sint32 frame_no)
Input cpk: movie handle  frame_no: Expand the image of the number without an output function value without function specified frame of the frame to expand.
Remarks This function can be used only for the movie loaded in the memory.
  In the application program, read the movie file and
  After creating a movie handle with CPK_CreateMemMovie, call this function    Please give me.
  In the movie handle created by CPK_CreateGfsMovie and CPK_CreateStmMovie,
  This function cannot be used.
  Use a keyframe-only movie file with no sound.
 Title
Function specifications
 Data
Deployment destination address setting
 Data Name
CPK_SetDecodeAddr
 No
4.1

 Format void CPK_SetDecodeAddr (CpkHn cpk, void * dec_addr, Sint32 dec_line_size)
Input cpk: movie handle  dec_addr: Address of the image expansion destination  dec_line_size: Specifies the address to which you would like to forward the image deploy to one line image image that was the number of bytes output No function value None Function Deployment of the buffer.
  If the image expansion destination address is NULL, image expansion is not performed.
  The default is NULL.
  Call this function before playing the movie.
 Title
Function specifications
 Data
Setting the number of display colors
 Data Name
CPK_SetColor
 No
4.2

 Format void CPK_SetColor (CpkHn cpk, CpkColorType color)
Input cpk: movie handle  color: Specifies the number of display colors of the display color number of output No function value No function image.
  The default is 16 million colors.
  Call this function before playing the movie.
 Title
Function specifications
 Data
Setting the maximum number of transfer sectors
 Data Name
CPK_SetLoadNum
 No
4.3

 Format void CPK_SetLoadNum (CpkHn cpk, Sint32 load_sct)
Input cpk: movie handle  Load_sct: when transferring from the maximum transfer sector count output None function value No function CD buffer library into internal buffer, the maximum number of transfer sectors    Set.
  The default is 20 sectors.
  Call this function before playing the movie.
 Title
Function specifications
 Data
Playback PAN settings
 Data Name
CPK_SetPan
 No
4.4

 Format void CPK_SetPan (CpkHn cpk, Sint32 pan)
Input cpk: movie handle  pan: PAN value (0 to 31)
It specifies the PAN of no output function value without function music.
  The default is 0.

 Title
Function specifications
 Data
Playback volume setting
 Data Name
CPK_SetVolume
 No
4.5

 Format void CPK_SetVolume (CpkHn cpk, Sint32 volume)
Input cpk: movie handle  volume: Volume (0-7)
None Specifies the output function value without function volume. (No output at 0, maximum volume at 7)
  The default is 7.
 Title
Function specifications
 Data
PCM command block number setting
 Data Name
CPK_SetPcmCmdBlock
 No
4.6

 Format void C PK_SetPcmCmdBlockNo (CpkHn cpk, Sint32 blk_no)
Input cpk: movie handle  blk_no: PCM command block number (0-7)
Set the PCM command block number to be set to no output function value without function sound driver.
  The default is 0.
  For details on the PCM command block number, see "SEGA SATURN Sound Driver".  See Stem Interface.
  Call this function before playing the movie.
 Title
Function specifications
 Data
PCM stream playback number setting
 Data Name
CPK_SetPcmStreamNo
 No
4.7

 Format void CPK_SetPcmStreamNo (CpkHn cpk, Sint32 stream_no)
Input cpk: movie handle  stream_no: PCM stream playback number (0-7)
Set the PCM stream playback number to be set to no output function value without function sound driver.
  The default is 0.
  For more information on PCM stream playback numbers, see "SEGA SATURN Sound Driver System Interface."  See "Ace".
Remarks When playing multi-motion, use different stream playback numbers.
  Call this function before playing the movie.
 Title
Function specifications
 Data
Keyout range setting
 Data Name
CPK_SetKeyOutRange
 No
4.8

 Format void CPK_SetKeyOutRange (CpkHn cpk, Sint32 range)
Input cpk: movie handle  range: Sets the range for the transparent color in the key out range output No function value without function chroma key processing (color to be transparent).
remarks
    • In chroma key processing, the RGB value of the expanded point and the RGB value specified by the chroma key are compared by the following formula, and if the value is smaller than the keyout range, the color is made transparent. ABS (ckey.b --decode.b) + ABS (ckey.g --decode.g) + ABS (ckey.r --decode.r) ckey is the chroma key The specified RGB value decode is the RGB value of the expanded point
    • For 32000 colors, you can specify a range from 0 to 96.
    • For 16 million colors, you can specify a range from 0 to 768.
    • The default is 21.
 Title
Function specifications
 Data
Get timescale
 Data Name
CPK_GetTimeScale
 No
5.1

 Format Sint32 CPK_GetTimeScale (CpkHn cpk)
Input cpk: the movie to get the no handle output function value time scale function time scale value.
  Time schedule until the data supply of the film header part to the ring buffer is completed  The value of is invalid.
 Title
Function specifications
 Data
Get playback time
 Data Name
CPK_GetTime
 No
5.2.

 Format Sint32 CPK_GetTime (CpkHn cpk)
Input cpk: the movie to get the current time of the handle output No function value current time feature movie. The current time is the cow in time scale units  Value.
 Title
Function specifications
 Data
Get playback status
 Data Name
CPK_GetPlayStatus
 No
5.3 5.3

 Format CpkPlayStatus CPK_GetPlayStatus (CpkHn cpk)
Input cpk: Returns the movie handle the current playback status without function values playback status function movie output.
 Title
Function specifications
 Data
Get film header
 Data Name
CPK_GetHeader
 No
5.4

 Format CpkHeader * CPK_GetHeader (CpkHn cpk)
Input cpk: movie and Kaee the address of the film header portion of the handle output No function value film header function movie file.
  Until the data supply of the film header part to the buffer is completed, the contents of the structure will be  It is invalid.
 Title
Function specifications
 Data
Get write buffer
 Data Name
CPK_GetWriteBuf
 No
6.1

 Format Uint32 * CPK_GetWriteBuf (CpkHn cpk, Sint32 * free_size, Sint32 * free_total)
Input cpk: movie handle output free_size: The number of bytes of continuous writable area  free_total: discontinuous region is also tailored writable area the total number of bytes function values continuous writable area start address of the (NULL if you can not write)
Function Gets the buffer address of the write destination and the number of bytes that can be written.
Remarks Used when you want to supply data to the ring buffer independently.
 Title
Function specifications
 Data
Write size notification
 Data Name
CPK_NotifyWriteBuf
 No
6.2.

 Format void CPK_NotifyWriteSize (CpkHn cpk, Sint32 write_size)
Input cpk: movie handle  write_size: the number of bytes actually written without the number of bytes output function value without function buffer written to notify the library.
Remarks Used when you want to supply data to the ring buffer independently.
  Used when playing a movie file in memory.
 Title
Function specifications
 Data
Load the movie into the buffer
 Data Name
CPK_PreloadMovie
 No
7.1

 Format void CPK_PreloadMovie (CpkHn cpk, Uint32 size)
Input cpk: movie handle  size: the number of bytes output No function value without function movie file to be read will read to memory.
Remarks If the number of bytes read is smaller than the buffer managed by the library,
  Read up to the buffer size.
 Title
Function specifications
 Data
Load the film header into the buffer
 Data Name
CPK_PreloadHeader
 No
7.2

 Format void CPK_PreloadHeader (CpkHn cpk)
Input cpk: movie reads the film header portion of the handle without an output function value without function movie file in memory.
Remarks Move the pickup position to the beginning of the movie file before calling this function.    please.
 Title
Function specifications
 Data
Get error information
 Data Name
CPK_GetErr
 No
8.1

 Format CpkErrCode CPK_GetErr (void)
It returns an error code that occurred None None input output best function value error code function recently.
 Title
Function specifications
 Data
Error function registration
 Data Name
CPK_SetErrFunc
 No
8.2. 8.2

 Format void CPK_SetErrFunc (CpkErrFunc func, void * obj)
Input func: Function to call when an error occurs  obj: Sets a function to be called at the time of registration object output No function value No function error occurred. The registration object is the registration function  Passed to the first subtraction.

BackForward
MOVIE TOOLS GUIDECinepak for SEGA Saturn
Copyright SEGA ENTERPRISES, LTD ,. 1997