PALib Tips
I’ve been working on a homebrew game for the Nintendo DS. Before starting the game, I spent some time with libnds and PALib (which is built on top of libnds) before deciding which API to write to. I chose PALib because I knew I could get the game working sooner. I also knew that I’d run into limitations with PALib, eventually. I haven’t hit those limits, yet, but I feel they are right around the corner.
Meanwhile, I have some tips for programmers who are just starting out with PALib:
- Using Stephen Stair’s wifi lib is hit or miss with PALib’s wrapper. If your app will rely on wifi communication, know that you will have to call through to the libnds wifi lib directly rather than relying on the PALib wrapper. In my experience, the wrapper locks up when you try to connect if there is no network present. It should fail gracefully.
- Don’t call PA_DeleteSprite. If you need to hide a sprite, move it offscreen or change it’s gfx setting to an image made of transparent pixels. Using PA_DeleteSprite and PA_CreateSprite over and over will eventually corrupt your VRAM.
- If you are setting tiles on a background that is 512×256, use PA_SetLargeMapTile. I originally thought that function was reserved for larger maps, but I was wrong.