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 > Running NDSLib & LibNDS side by side

#53745 - headspin - Sun Sep 11, 2005 1:27 pm

I have been using NDSLib for a while now, and since I hear that it's no longer being updated, I would like to move my current stuff over to LibNDS.

How do I add LibNDS alongside NDSLib, so that I can compile with both?

Currently the structure for NDSLib...

devkitPro\devkitARM\include\c++\4.0.1\NDS\*

devkitPro\devkitARM\lib\gcc\arm-elf\4.0.1\libnds7.a
devkitPro\devkitARM\lib\gcc\arm-elf\4.0.1\libnds9.a

Where do I place LibNDS, and will there be any conflicts?
_________________
Warhawk DS | Manic Miner: The Lost Levels | The Detective Game

#53761 - wintermute - Sun Sep 11, 2005 5:46 pm

libnds and ndslib were almost identical until the recent move to devkitPro CVS. There is no need to run them side by side. The only real difference was in placement of nds.h and capitalisation of the include files.

As devkitARM and libnds progress there will soon be a point where ndslib will not compile. Use of the older library is to be discouraged.

Placement of external libraries within the compiler directories is not a good idea, especially in a place dependent on the compiler version. The old directories should be removed when upgrading the toolchain.

The recommended layout is shown in the setting up instructions on devkitpro.org - http://www.devkitpro.org/setup.shtml . The example makefiles use files within the toolchain to help ameliorate the differences between the environment on the supported host platforms. Please use the example templates and report any problems to the appropriate devkitPro mailing list or via the bug tracker - http://sourceforge.net/tracker/?group_id=114505&atid=668551 .

#53778 - headspin - Sun Sep 11, 2005 9:03 pm

Thanks, I have successfully moved to LibNDS. It is very similar like you say, and I recommend others to do the same.

The only issues I had was trying to use the new sound functions in nds/arm9/sound.h; playSound() and playGenericSound(). I just used the original playGenericSound() from NDSLib (renamed to playSnd()) and it works ok.

Code:
__attribute__ ((section (".ewram"))) TransferSound snd;

void playSnd(const void* data, u32 length)
{
   snd.count = 1;
   snd.data[0].data = data;
   snd.data[0].len = length;
   snd.data[0].rate = 44100;
   snd.data[0].pan = 63;
   snd.data[0].vol = 127;
   snd.data[0].format = 0; // 1 = 8-bit

   playSound(snd.data);
   DC_FlushAll();
   IPC->soundData = &snd;
}


Can anyone show me how to achieve the above with the new functions?
_________________
Warhawk DS | Manic Miner: The Lost Levels | The Detective Game

#56996 - Didou - Wed Oct 12, 2005 11:28 pm

Hi,

Unfortunalety for me, moving from NDSlib to libnds is still a real problem... Behaviour seems not to be the same, especially against emulators... Or I missed something...

-- Didou

#57001 - josath - Thu Oct 13, 2005 12:02 am

Didou wrote:

Unfortunalety for me, moving from NDSlib to libnds is still a real problem... Behaviour seems not to be the same, especially against emulators... Or I missed something...


You need to give more information than just "there's a problem" and "something is different"

Also, the emulators are very very inaccurate. I wouldn't use them for anything serious if at all possible.

#57042 - Didou - Thu Oct 13, 2005 6:46 am

Hi

[quote="josath]You need to give more information than just "there's a problem" and "something is different"[/quote]

In fact, I posted a detailed topic in the forum as "devkitpro R12 -> R16, NDSlib -> libnds, issues".

Quote:
Also, the emulators are very very inaccurate. I wouldn't use them for anything serious if at all possible.

Yep, I know, but there are differences both on emulator and real hadware !

-- Didou