gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Coding > Krawall + Custom ISR

#96682 - devmelon - Fri Aug 04, 2006 6:58 pm

Hello everyone. I'm currently learning about audio and interrupts. I want to use Krawall for audio (s3m's) and when using HAMs irq routines things flow supersmooth, but when I make my own routine (I want to steer away from HAM) the sound jitters and sparks a bit every second or so.

What I've done is I've made a regular function to act as my Interrupt Service Routine (ISR) and inside it I've got if statements to check for interrupts. I currently only have code for handling Timer1 interrupts (where I call kradInterrupt(); and acknowldge the interrupt). I've set up the pointer for my ISR and the routine gets called. Then I init kraw and I enable Timer1, and turn on master enable. krapPlay(&mod_inspiration, KRAP_MODE_LOOP, 0xff); is called next and then I enter my loop where I call kramWorker(); ONCE every new frame (I poll VCounter and ensure I only call it once utilizing a bool). That's all! I tried using VBL interrupts for kramWorker(); too but it yeilds the same result. The exact same code works using HAMs interrupt routines, and I wonder what magic extra there is that I'm not understanding here.

If you really must, I can paste some code but It's all a mess right now and looks like crap. I've tried all sorts of fixes and testing so the code looks rather glued together with bubblegum.

#96759 - devmelon - Sat Aug 05, 2006 10:48 am

Never mind, I got it working.

#97155 - racarate - Tue Aug 08, 2006 6:32 am

What were you doing wrong?
_________________
Neko: I love meow-tain climbing!
Need anything? I'll even save your game!