Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void timer_handler()
- {
- //if(precise_timer_on)
- //{
- precise_timer_int_cnt++;
- //}
- /* Run one frame of sound driver here. */
- /* VB manual recommends this. */
- HW_REGS[TCR] &= ~TIMER_INT;
- HW_REGS[TCR] |= TIMER_ZCLR;
- HW_REGS[TCR] |= TIMER_INT;
- }
- void init_timer_hw()
- {
- /* Timer interrupt will fire once every 10ms. */
- HW_REGS[TLR] = 0;
- HW_REGS[TLR] = TIME_MS(10);
- HW_REGS[TCR] = TIMER_100US | TIMER_INT | TIMER_ENB;
- }
- //In another file...
- extern unsigned char precise_timer_int_cnt;
- void fade_and_wait()
- {
- vbFXFadeIn(3);
- while(!vbPadKeyDown())
- {
- (* (short *)(BGMap(0) + 27)) = (short) precise_timer_int_cnt;
- }
- vbFXFadeOut(3);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement