#35378 - headspin - Thu Feb 03, 2005 8:35 pm
This seems like such a trivial thing, but for the life of me can't get it happening. Any help would be greatly appreciated.
I'm trying to implement AFM (Another F**king MOD Player) by http://www.hitmen-console.org/ to run along side my own VBlank & HBlank interrupts. I can get my own interrupt to work or the AFM interrupts, but not both at the same time.
I'll give you some code to explain what I'm trying to achieve
Acording to the AFM docs, only Timer0, Timer1, dma1, dma2 and dma3 interrupts are used, so I can't see why my code would be conflicting.
Until I get some resolution I can't use my own custom interrupts with AFM which is a total bitch.[/code]
_________________
Warhawk DS | Manic Miner: The Lost Levels | The Detective Game
I'm trying to implement AFM (Another F**king MOD Player) by http://www.hitmen-console.org/ to run along side my own VBlank & HBlank interrupts. I can get my own interrupt to work or the AFM interrupts, but not both at the same time.
I'll give you some code to explain what I'm trying to achieve
Code: |
void initInterrupt()
{ REG_IME=0; // Or'ing REG_IE should keep the settings done by AFM??? REG_IE |= INT_VBLANK | INT_HBLANK; // These bits enable the VBlank & HBlank interrupts // This is where the program will crash & burn REG_DISPSTAT |= BIT03 | BIT04; REG_IME=1; //enable interrupt } void killInterrupt() { // this function is not required to work as of yet, but // comments on the code is welcome REG_IME=0; // disable interrupt REG_IE = 0; REG_DISPSTAT = 0; } void HBlankInterrupt(void) { unsigned long int regs = REG_IE; REG_IF |= INT_HBLANK; // do stuff REG_IE = regs; } void VBlankInterrupt(void) { unsigned long int regs = REG_IE; REG_IF |= INT_VBLANK; // do stuff REG_IE = regs; } //IntrTable for crt0 void (*IntrTable[])() = { 0, // v-blank 0, // h-blank 0, // vcount 0, // timer0 0, // timer1 0, // timer2 0, // timer3 0, // serial 0, // dma0 0, // dma1 0, // dma2 0, // dma3 0, // key 0 // cart }; int main(void) { FILEPTR = find_first_gbfs_file(find_first_gbfs_file); IntrTable[0] = VBlankInterrupt; IntrTable[1] = HBlankInterrupt; // install player afm_install(); // now setup my vblank and hblank interrupts initInterrupt(); afm_init(gbfs_get_obj(FILEPTR, "Afraid.mod", NULL)); afm_sound_param(0xff,1); // volume, 1 = Mono, 0 = Stereo while (1) { // call this every frame this routine may be delayed afm_update(); WaitVBlank(); // must call this right at the start of vblank with minimum delay afm_sync(); } } |
Acording to the AFM docs, only Timer0, Timer1, dma1, dma2 and dma3 interrupts are used, so I can't see why my code would be conflicting.
Until I get some resolution I can't use my own custom interrupts with AFM which is a total bitch.[/code]
_________________
Warhawk DS | Manic Miner: The Lost Levels | The Detective Game