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 > libmad on Windows

#113995 - zon7 - Tue Jan 02, 2007 2:37 pm

Hi. I'm trying to get libmad working on a project, but I'm stuck trying to link to libmad.
I supose I must build the lib first, but I don't know how. I0ve searched over the forum and found this post.
http://forum.gbadev.org/viewtopic.php?t=11048
But it's for linux.

Actually, I get this errors:
Code:
arm-eabi-gcc -MMD -MP -MF /c/devkitPro/examples/nds/TouchTest9/build/layer12.d -Wall -O2 -mcpu=arm9tdmi -mtune=arm9tdmi -fomit-frame-pointer -ffast-math -mthumb -mthumb-interwork -I/c/devkitPro/examples/nds/TouchTest9/include -I/c/devkitPro/examples/nds/TouchTest9/build -I/c/devkitPro/libnds/include -I/c/devkitPro/libnds/include -I/c/devkitPro/examples/nds/TouchTest9/build -DARM9 -DFPM_ARM -DASO_INTERLEAVE1 -DASO_IMDCT -DOPT_ACCURACY -c /c/devkitPro/examples/nds/TouchTest9/source/libmad/layer12.c -o layer12.o
C:/DOCUME~1/zon7/CONFIG~1/Temp/ccUnAz2v.s: Assembler messages:
C:/DOCUME~1/zon7/CONFIG~1/Temp/ccUnAz2v.s:58: Error: selected processor does not support `smull r1,ip,r2,r3'
C:/DOCUME~1/zon7/CONFIG~1/Temp/ccUnAz2v.s:60: Error: unshifted register required -- `adc r3,r1,ip,lsl#4
...'

#114004 - Mighty Max - Tue Jan 02, 2007 5:06 pm

Dont use the imdct_l_arm.s

It is utilizing an arm that has an fpu, which the DS hasn't.

Dont set "FPM_ARM"
_________________
GBAMP Multiboot

#114061 - zon7 - Wed Jan 03, 2007 12:42 pm

Well, now it compiles, but I run out of ideas. So I took the Moonshell code and give it a try.
The problem is with the interrupt handler.It uses register IE and IF. Both of them are not declared and I have searched for them in the devkitarm with no luck.
Is there a new name in r19 or I miss something?

#114062 - Mighty Max - Wed Jan 03, 2007 12:47 pm

They got renamed to REG_IE, REG_IF to match the naming sheme.
_________________
GBAMP Multiboot

#114067 - zon7 - Wed Jan 03, 2007 2:05 pm

hehehe, I figured it. Now I only got error in this line
IPC_SYNC=IPC_SYNC_IRQ_ENABLE;

I have searched in the CVS and found that now its called REG_IPC_SYNC
Now it compiles ok but no sound.
Actually it doesnt enter the update if into the InterruptHandler.
Code:
void InterruptHandler(void) {
    u32 flags = REG_IF;

  if(flags&IRQ_IPC_SYNC){
   iprintf("\nHOlA");
    strpcmUpdate();
    REG_IF = IRQ_IPC_SYNC;
    return;
  }

    if (flags & IRQ_VBLANK) {
        VBLANK_INTR_WAIT_FLAGS=IRQ_VBLANK;
        REG_IF = IRQ_VBLANK;
        return;
    }
}

So IRQ_IPC_SYNC is never activated.

#114070 - zon7 - Wed Jan 03, 2007 2:43 pm

I have uploaded the code so someone could find the error.
https://www.alu.ua.es/j/jma27/nds/Test.zip
Thanks

#114071 - Mighty Max - Wed Jan 03, 2007 3:20 pm

Quote:

Authorization Required
This server could not verify that you are authorized to access the document requested. Either you supplied the wrong credentials (e.g., bad password), or your browser doesn't understand how to supply the credentials required.

_________________
GBAMP Multiboot

#114077 - zon7 - Wed Jan 03, 2007 5:46 pm

Ups, I put an s :P

http://www.alu.ua.es/j/jma27/nds/Test.zip

#114080 - Mighty Max - Wed Jan 03, 2007 6:39 pm

Code:

REG_IF = IRQ_IPC_SYNC;


in InitInterrupts should have been REG_IE=...

Using the irqInit/irqSet/irqEnable functions of libnds could be usefull ;)
_________________
GBAMP Multiboot

#114100 - zon7 - Wed Jan 03, 2007 11:57 pm

Well, that was a line I wrote there to activate the Sync bit at the beginning but it did't work. I checked the code and it had other things not corrected.
I have uploaded it again with the original Moonshell code and the register and irq names updated to r19. But it still doesn't work.
Same link as above

#114102 - Mighty Max - Thu Jan 04, 2007 12:15 am

I have overseen that last time, but where is the arm7 code?

The default arm7 bin does not do anything with the FIFO. So you'll wait forever for an sync to happen when it never gets triggered from the other side.
_________________
GBAMP Multiboot

#114110 - zon7 - Thu Jan 04, 2007 2:26 am

hehehe.
I have begin with the ndsexamples code. Is there anyway to add the arm7 files and to compile arm7 and arm9 separated?
I'm using the programmers Notepad :P
To lazy to boot on linux.
thanks

#114111 - zon7 - Thu Jan 04, 2007 2:40 am

Well, finally have it working!
Thanks a lot Mighty Max.
If anyone wants the code (is the moonshell original code but tweaked to work on r19, no many changes.) I can upload it.

#114283 - Jevin - Sat Jan 06, 2007 6:36 am

Please do! I would like to use it.

#114606 - zon7 - Tue Jan 09, 2007 1:09 pm

Sorry but I've been out last weekend
Here you have the code uploaded.
http://www.alu.ua.es/j/jma27/nds/20050807_mp3playtestVA.zip