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 > Mad Lib porting anyone have experience?

#101370 - smoothingeye - Mon Sep 04, 2006 7:27 pm

I am trying to do a MP3 player using Mad lib . anyone can give me some pointers ?



thanks

#101623 - agentq - Wed Sep 06, 2006 10:00 pm

I ported Madlib for the DS port of ScummVM. It built without any problems on the ds.

The build command I used is:

Code:
./configure --host=arm-elf --enable-speed --enable-sso -enable-fpm=arm CFLAGS='-specs=ds_arm9.specs -mthumb-interwork'
make


Simplicity itself! It even has some ARM optimisations compiled in.

#101639 - josath - Wed Sep 06, 2006 11:26 pm

Someone should make a ds version of Mad Lib which lets you write in your responses.

#101710 - GPFerror - Thu Sep 07, 2006 4:12 pm

josath wrote:
Someone should make a ds version of Mad Lib which lets you write in your responses.


LOL, yeah Mad Lib is cool.

Troy(GPF)
http://gpf.dcemu.co.uk

#101892 - smoothingeye - Fri Sep 08, 2006 6:50 pm

I got the following error please help when i try to compile Mp3player . why libmad cannot be compoile? for arms?



not support `smull r1,r2,r0,r3'
C:/DOCUME~1/seewan/LOCALS~1/Temp/ccXmYU4C.s:1009: Error: unshifted register requ
ired -- `adc r3,r1,r2,lsl#4'
make[2]: *** [layer12.o] Error 1
make[1]: *** [build] Error 2
make[1]: Leaving directory `/d/Projects/nds/mp3play/arm9'
make: *** [arm9/mp3play.elf] Error 2

seewan@SEEWAN02 /d/Projects/nds/mp3play
$ make
make -C arm7
make[1]: Entering directory `/d/Projects/nds/mp3play/arm7'
make[2]: `/d/Projects/nds/mp3play/mp3play.arm7' is up to date.
make[1]: Leaving directory `/d/Projects/nds/mp3play/arm7'
make -C arm9 -f Makefile
make[1]: Entering directory `/d/Projects/nds/mp3play/arm9'
layer12.c
arm-eabi-gcc -MMD -MP -MF /d/Projects/nds/mp3play/arm9/build/layer12.d -Wall -Os
-mcpu=arm9tdmi -mtune=arm9tdmi -ffast-math -mthumb -mthumb-interwork -I/d/Proje
cts/nds/mp3play/arm9/include -I/d/Projects/nds/mp3play/arm9/build -I/c/devkitPro
/libnds/include -I/d/Projects/nds/mp3play/arm9/build -DARM9 -DFPM_ARM -DOPT_ACCU
RACY -DROMVER=\"\" -c /d/Projects/nds/mp3play/arm9/source/libmad/layer12.c -o l
ayer12.o
C:/DOCUME~1/seewan/LOCALS~1/Temp/ccqkI1f7.s: Assembler messages:
C:/DOCUME~1/seewan/LOCALS~1/Temp/ccqkI1f7.s:71: Error: selected processor does n
ot support `smull r1,ip,r2,r3'
C:/DOCUME~1/seewan/LOCALS~1/Temp/ccqkI1f7.s:73: Error: unshifted register requir
ed -- `adc r3,r1,ip,lsl#4'
C:/DOCUME~1/seewan/LOCALS~1/Temp/ccqkI1f7.s:114: Error: selected processor does
not support `smull r2,r1,r0,r3'
C:/DOCUME~1/seewan/LOCALS~1/Temp/ccqkI1f7.s:116: Error: unshifted register requi
red -- `adc r0,r2,r1,lsl#4'
C:/DOCUME~1/seewan/LOCALS~1/Temp/ccqkI1f7.s:489: Error: selected processor does
not support `smull r0,r1,r3,r2'
C:/DOCUME~1/seewan/LOCALS~1/Temp/ccqkI1f7.s:491: Error: unshifted register requi
red -- `adc r3,r0,r1,lsl#4'
C:/DOCUME~1/seewan/LOCALS~1/Temp/ccqkI1f7.s:495: Error: selected processor does
not support `smull r0,ip,r3,r2'
C:/DOCUME~1/seewan/LOCALS~1/Temp/ccqkI1f7.s:497: Error: unshifted register requi
red -- `adc r1,r0,ip,lsl#4'
C:/DOCUME~1/seewan/LOCALS~1/Temp/ccqkI1f7.s:503: Error: selected processor does
not support `smull r1,r0,r3,r2'
C:/DOCUME~1/seewan/LOCALS~1/Temp/ccqkI1f7.s:505: Error: unshifted register requi
red -- `adc r2,r1,r0,lsl#4'
C:/DOCUME~1/seewan/LOCALS~1/Temp/ccqkI1f7.s:640: Error: selected processor does
not support `smull r0,r1,r3,r2'
C:/DOCUME~1/seewan/LOCALS~1/Temp/ccqkI1f7.s:642: Error: unshifted register requi
red -- `adc r3,r0,r1,lsl#4'
C:/DOCUME~1/seewan/LOCALS~1/Temp/ccqkI1f7.s:646: Error: selected processor does
not support `smull r0,ip,r3,r2'
C:/DOCUME~1/seewan/LOCALS~1/Temp/ccqkI1f7.s:648: Error: unshifted register requi
red -- `adc r1,r0,ip,lsl#4'
C:/DOCUME~1/seewan/LOCALS~1/Temp/ccqkI1f7.s:654: Error: selected processor does
not support `smull r1,r0,r3,r2'
C:/DOCUME~1/seewan/LOCALS~1/Temp/ccqkI1f7.s:656: Error: unshifted register requi
red -- `adc r2,r1,r0,lsl#4'
C:/DOCUME~1/seewan/LOCALS~1/Temp/ccqkI1f7.s:930: Error: selected processor does
not support `smull r2,ip,r0,r3'
C:/DOCUME~1/seewan/LOCALS~1/Temp/ccqkI1f7.s:932: Error: unshifted register requi
red -- `adc r1,r2,ip,lsl#4'
C:/DOCUME~1/seewan/LOCALS~1/Temp/ccqkI1f7.s:1007: Error: selected processor does
not support `smull r1,r2,r0,r3'
C:/DOCUME~1/seewan/LOCALS~1/Temp/ccqkI1f7.s:1009: Error: unshifted register requ
ired -- `adc r3,r1,r2,lsl#4'
make[2]: *** [layer12.o] Error 1
make[1]: *** [build] Error 2
make[1]: Leaving directory `/d/Projects/nds/mp3play/arm9'
make: *** [arm9/mp3play.elf] Error

#101909 - agentq - Fri Sep 08, 2006 8:59 pm

Sorry, the command I posted was for Devkitarm v18. In v19 and above, the target has changed, so the command should be:
Code:
./configure --host=arm-eabi --enable-speed --enable-sso -enable-fpm=arm CFLAGS='-specs=ds_arm9.specs -mthumb-interwork'
make


I'm not sure what the error messages above are caused by. It looks like the compiler is set to use the wrong instruction set. I'd check that you're passing -specs=ds_arm9.specs on the command line properly in single quotes.

If you can't get it to work, you can remove the --enable-fpm=arm parameter and it will compe in pure C.

#102084 - smoothingeye - Sun Sep 10, 2006 6:44 pm

how about these mesage ??? can u tell me how u port the libmad ?


$ make
linking .arm9.elf
plug_mp3.o: In function `FreeMP3':
plug_mp3.c:(.text+0x39c): undefined reference to `mad_frame_finish'
plug_mp3.c:(.text+0x3a2): undefined reference to `mad_stream_finish'
plug_mp3.c:(.text+0x3b2): undefined reference to `mad_decoder_finish'
plug_mp3.o: In function `madusr_decode_exec':
plug_mp3.c:(.text+0x404): undefined reference to `mad_header_decode'
plug_mp3.c:(.text+0x45e): undefined reference to `mad_frame_decode'
plug_mp3.c:(.text+0x4e0): undefined reference to `mad_synth_frame'
plug_mp3.o: In function `error':
plug_mp3.c:(.text+0x584): undefined reference to `mad_stream_errorstr'
plug_mp3.o: In function `input':
plug_mp3.c:(.text+0x60c): undefined reference to `mad_stream_buffer'
plug_mp3.o: In function `StartMP3':
plug_mp3.c:(.text+0x76c): undefined reference to `mad_decoder_init'
plug_mp3.c:(.text+0x790): undefined reference to `mad_stream_init'
plug_mp3.c:(.text+0x798): undefined reference to `mad_frame_init'
plug_mp3.c:(.text+0x7a0): undefined reference to `mad_synth_init'
collect2: ld returned 1 exit status
make[1]: *** [/d/Projects/NDS/mp3play/arm9/.arm9.elf] Error 1

#102085 - Lick - Sun Sep 10, 2006 7:03 pm

You prolly need to link the library. It would be something along '-lmad'. Add it behind '-lnds' in the Makefile.
_________________
http://licklick.wordpress.com

#102231 - smsisko - Tue Sep 12, 2006 12:40 am

agentq wrote:
Sorry, the command I posted was for Devkitarm v18. In v19 and above, the target has changed, so the command should be:
Code:
./configure --host=arm-eabi --enable-speed --enable-sso -enable-fpm=arm CFLAGS='-specs=ds_arm9.specs -mthumb-interwork'
make


From my personal experience,
Code:
--enable-speed
is slower then without it on the DS.

But looking back at your configure parameters, I did not have
Code:
--enable-sso
either, maybe that's part of the reason ?

#102404 - smoothingeye - Wed Sep 13, 2006 6:51 pm

I manage to get the lib to work but now the audio is very choppy . can i know where is it like this?

could it be some timing issue or the Fat lib problem i am using Super card