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.

DS development > Trouble with interrupts

#122224 - link12827 - Sat Mar 17, 2007 11:15 pm

I'm relatively new to developing ds homebrew, and I've been following various tutorials. But, I get an error message when using interrupts, saying DISP_SR undeclared


Code:
C:\Homebrew\Practice>make
main.c
arm-eabi-gcc -MMD -MP -MF /c/Homebrew/Practice/build/main.d -g -Wall -O2 -march=
armv5te -mtune=arm946e-s -fomit-frame-pointer -ffast-math -mthumb -mthumb-interw
ork -I/c/Homebrew/Practice/include -I/c/devkitPro/libnds/include -I/c/Homebrew/P
ractice/build -DARM9 -c /c/Homebrew/Practice/source/main.c -o main.o
c:/Homebrew/Practice/source/main.c: In function 'InitInterruptHandler':
c:/Homebrew/Practice/source/main.c:51: error: 'DISP_SR' undeclared (first use in
 this function)
c:/Homebrew/Practice/source/main.c:51: error: (Each undeclared identifier is rep
orted only once
c:/Homebrew/Practice/source/main.c:51: error: for each function it appears in.)
make[1]: *** [main.o] Error 1
make: *** [build] Error 2


and the actual method:

Code:
void InitInterruptHandler()
{
   REG_IME = 0;
   IRQ_HANDLER = on_irq;
   REG_IE = IRQ_VBLANK;
   REG_IF = ~0;
   DISP_SR = DISP_VBLANK_IRQ;
   REG_IME = 1;
}


I'm probably just completely missing something, or doing it wrong, but can anyone help me?

#122237 - tepples - Sun Mar 18, 2007 12:42 am

DISP_SR has become REG_DISP[somethingorother], as wintermute is using GBATEK as a de facto standard for register naming. Try reading .../libnds/include/nds/arm9/video.h to see what the newest values are, or use the compatibility header:
Code:
#include <nds/registers_alt.h>


EDIT: deconfuse
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.


Last edited by tepples on Sun Mar 18, 2007 7:17 pm; edited 1 time in total

#122240 - link12827 - Sun Mar 18, 2007 1:07 am

Thanks, it worked

#122318 - FRuMMaGe - Sun Mar 18, 2007 6:16 pm

The actual equivalent to DISP_SR is REG_DISPSTAT