★ MOVIE TOOLS GUIDE ★ Cinepak for SEGA SaturnThe Cinepak library is a library for easily playing QuickTime (Cinepak compressed) movies on SEGA SATURN.
Figure 4.1 Cinepak library configuration diagram
Figure 4.2 Movie playback procedure during memory playback
#define WORK_BUF_SIZE 200 * 1024L #define PCM_ADDR ((void *) 0x25a20000) #define PCM_SIZE (4096L * 16)/ * Work buffer * / Uint32 movie_work [CPK_24WORK_DSIZE]; / * Ring buffer * / Uint32 movie_buf [WORK_BUF_SIZE / sizeof (Uint32)]; StmHn stm; CpkHn cpk; Sint32 movie_x = 320;
/* Initialize */ CPK_Init ();
/ * Screen display settings * / Use INT_ ??? to set a V blank IN interrupt. Call CPK_VblIn (); in a V-blank IN interrupt. Make settings such as sprite commands.
/ * File initialization * / GFS_Init (‥); STM_Init (‥); STM_OpenGrp (); STM_SetExecGrp (‥); / * Open stream * / stm = STM_OpenFid (‥);
/ * Generate movie handle * / CPK_PARA_WORK_ADDR (& para) = movie_work; CPK_PARA_WORK_SIZE (& para) = CPK_24WORK_BSIZE; CPK_PARA_BUF_ADDR (& para) = movie_buf; CPK_PARA_BUF_SIZE (& para) = WORK_BUF_SIZE; CPK_PARA_PCM_ADDR (& para) = PCM_ADDR; CPK_PARA_PCM_SIZE (& para) = PCM_SIZE; cpk = CPK_CreateStmMovie (& para, stm);
/ * Setting the number of display colors * / CPK_SetColor (cpk, CPK_COLOR_15BIT); / * Setting the destination address * / CPK_SetDecodeAddr (cpk, ADDR_VRAM, 2 * movie_x); / * Start playing the movie * / CPK_Start (cpk); while (TRUE) { / * Movie playback process * / CPK_Task (cpk); if (CPK_IsDispTime (cpk) == TRUE) { / * Waiting for frame buffer switching * / SCL_DisplayFrame (); CPK_CompleteDisp (cpk); } / * Judgment of the end of the movie * / if (CPK_GetPlayStatus (cpk) == CPK_STAT_PLAY_END) break; } / * Abandonment of Mobi * / CPK_DestroyStmMovie (cpk); / * Close stream * / STM_Close (stm);
★ MOVIE TOOLS GUIDE ★ Cinepak for SEGA Saturn