void sysInit()
{
INT_SetMsk((INT_MSK_HBLK_IN | INT_MSK_VBLK_OUT),
(INT_MSK_SPR | INT_MSK_DMA1));
/ * Enable "H-blank-IN" and "V-blank-OUT" * /
/ * Disable "Sprite Drawing End" and "Level 0-DMA" * /
...
}
void anyPrg()
{
Uint32 status_bit;
status_bit = INT_GET_STAT (); / * Get status * /
if(INT_JudgeStat(status_bit,INT_ST_VBLK_OUT,INT_ST_VBLK_IN) == TRUE){
/ * V-blank-OUT interrupt occurs, * /
/ * When V-blank-IN interrupt has not occurred * /
...
}
}
File A #pragma interrupt (vblkIn) / * Use the vblkIn function as an interrupt function * /void vblkIn(void) { ... }
File B void systemInit(void) { INT_SetFunc(INT_SCU_VBLK_IN, vblkIn); / * Change vblkIn interrupt function to V-blank-IN interrupt vector * / / * Register in the data table. ** / INT_SetScuFunc(INT_SCU_VBLK_OUT, vblkOut); / * VblkOut function with V-blank-OUT interrupt vector * / / * Register with the SCU interrupt function. */ ... }
void vblkOut(void) { ... }