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 > DevkitARM r20 and new libnds? old code still compatible?

#127198 - patroclus02 - Mon Apr 30, 2007 9:09 pm

I've written some simple demos for GBA and NDS, now I want to go further, and I wonder if upgrading to new version will give me trouble, since I read some people talking about things that work before, not working anymore!

I don't want to upgrade if this is the case... I have version r17 and libnds that came with it....

I tried to compile my NDS demo and it does not work fine now. Screens are swaped in emulator (dualis) and on real system, touch coordinates don't work anymore in emulator, and sprites don't show up!

I managed to fix the screen thing.. this version requires a lcdOnBottom() call to set the main screen on bottom (r17 did this by default)... the invisible sprites might be caused by any define that changed... but I don't understand why touch coordinates don't work on Dualis emulator anymore when they worked GREAT in previous versions!

anyone knows?

thanks!

#127414 - josath - Wed May 02, 2007 8:58 am

touchscreen code has been updated to be more accurate on a real DS. if it doesn't work right in the emulator, probably it's the fault of the emulator itself.

#127462 - tepples - Wed May 02, 2007 6:37 pm

If the screens are swapped, then make sure to call lcdMainOnTop() or lcdMainOnBottom() first. Don't rely on what the boot code designates as the main or sub screen.

If IPC touch coordinates work on the DS but not on emulators, then this may be a bug in the high-level emulation that some emulators use for the touch screen. Use DSFTP instead of emulators.

If sprites aren't showing up on the DS, then you have the same problem I had when making LOCKJAW 0.34 for DS. The behavior of the constants controlling the main sprite bank in .../libnds/include/nds/arm9/video.h has changed:

Code:
// libnds of devkitARM R19 behaved like this
VRAM_B_MAIN_SPRITE_0x06400000 = 2,
VRAM_B_MAIN_SPRITE_0x06420000 = 2 | VRAM_OFFSET(1),
VRAM_B_MAIN_SPRITE = VRAM_B_MAIN_SPRITE_0x06400000,

// libnds of devkitARM R20 behaves like this
VRAM_B_MAIN_SPRITE_0x06400000 = 2,
VRAM_B_MAIN_SPRITE_0x06420000 = 2 | VRAM_OFFSET(1),
VRAM_B_MAIN_SPRITE = VRAM_B_MAIN_SPRITE_0x06420000,

Notice the change in the value of VRAM_B_MAIN_SPRITE.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.