Difference between revisions of "PAlib"

From devkitPro
Jump to: navigation, search
(Information about PAlib was old and outdated, and invalid contradictions against PAlib were made - this has been resolved..)
 
(11 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 +
'''If you're just getting started with NDS homebrew development then you should avoid PAlib, PAlib users and PAlib tutorials at all costs. They will give you bad advice and teach you programming methodologies which will hinder your progress and ensure that your projects are plagued with problems that will be nigh on impossible to fix.'''
 +
 
In the early days of Nintendo DS development, while libnds was still building the low level support code, a library appeared with the goal of making things easier for novice programmers. This library, called PAlib ( standing for Programmer's Arsenal ), set out to provide a comprehensive set of wrapper functions which would allow someone with only the most basic knowledge of programming to get the skeleton of a DS game up and running quickly.
 
In the early days of Nintendo DS development, while libnds was still building the low level support code, a library appeared with the goal of making things easier for novice programmers. This library, called PAlib ( standing for Programmer's Arsenal ), set out to provide a comprehensive set of wrapper functions which would allow someone with only the most basic knowledge of programming to get the skeleton of a DS game up and running quickly.
  
As of today, PAlib is still readily avaliable and is still being updated and improved by fincs and n00bey, who have temporarily taken over the project. At the time of writing, PAlib is still compatible with the latest devkitPro binaries, abheit with a few bugs.  
+
Making the tools used for homebrew programming more accessible to a wider range of skillsets is a laudable goal - one that is shared wholeheartedly by devkitPro. Unfortunately PAlib was badly designed, made use of internal functions never intended for user code and didn't keep pace with development which has fixed several very nasty bugs over the years. It might seem easier to get up and running but problems are still being reported with SD card corruption, odd issues with flashcards and wifi connection problems that have all been resolved by not using PAlib wrappers for libnds code.
  
Making the tools used for homebrew programming more accessible to a wider range of skillsets is a laudable goal - one that is shared wholeheartedly by devkitPro.  
+
For this reason devkitPro will not provide support to users attempting to get PAlib working. If you have followed the instructions given on the PAlib site and other sites whose tools depend on PAlib then uninstall completely and start over from scratch without replacing the PAlib parts. This is the only way to avoid issues that have been long fixed.
  
 
At the time of writing we have plans to further improve the accessibility of the tools and libraries we release. Unfortunately it will not be possible to ensure that 3rd party releases remain compatible with our tools and the integrity of those tools will be placed in question if you install anything not released by devkitPro inside, or make modifications to, the file system provided by the automated installer.
 
At the time of writing we have plans to further improve the accessibility of the tools and libraries we release. Unfortunately it will not be possible to ensure that 3rd party releases remain compatible with our tools and the integrity of those tools will be placed in question if you install anything not released by devkitPro inside, or make modifications to, the file system provided by the automated installer.
  
 
If you require assistance with our tools then please use the [http://forums.devkitpro.org official support forums] and the irc channels listed in the [[Community Portal|Community Portal]] page.
 
If you require assistance with our tools then please use the [http://forums.devkitpro.org official support forums] and the irc channels listed in the [[Community Portal|Community Portal]] page.
 
There appears to be a general myth around that somehow using PAlib is always easier than using libnds which hasn't been true for quite some time. Something we've tried to do with libnds as it matured was to add wrappers and simple APIs where it made sense to do so while still maintaining the low level access for more experienced programmers.
 
 
One piece of code which illustrates a situation in which libnds can be easier than PAlib is the ubiquitous hello world example.
 
 
With PAlib the example given is this :-
 
 
// Includes
 
#include <PA9.h>      // Include for PA_Lib
 
 
 
// Function: main()
 
int main(int argc, char ** argv)
 
{
 
PA_Init();    // Initializes PA_Lib
 
PA_InitVBL(); // Initializes a standard VBL
 
 
PA_InitText(1, 2); // Tell it to put text on screen 1, background number 2
 
PA_OutputSimpleText(1, 1, 1, "Hello World !");  // Print the desired text on screen 1, with coordinate 1, 1
 
 
// Infinite loop to keep the program running
 
while (1)
 
{
 
PA_WaitForVBL();
 
}
 
 
return 0;
 
} // End of main()
 
 
 
With libnds, hello world looks like this :-
 
 
#include <nds.h>
 
#include <stdio.h>
 
 
//---------------------------------------------------------------------------------
 
int main(void) {
 
//---------------------------------------------------------------------------------
 
 
consoleDemoInit();
 
 
printf("Hello World!");
 
 
while(1) {
 
swiWaitForVBlank();
 
}
 
 
}
 
 
With the exception of the nds header include, consoleDemoInit function and the infinite loop the libnds version is identical to a simple hello world for almost any other platform you care to name.
 
 
For more advanced functions - such as animating sprites or scrolling backgrounds - PAlib does tend to be a lot easier in most aspects, though you may find that PAlib is slightly limiting. For this reason, PAlib is recommended for new, inexperienced to intermediate programmers, whilst libnds, as a relatively low-level library, is better suited for people who know exactly what they are doing.
 
 
This may start to change, though, as libnds becomes easier to use. Expect to see a balancing of scales in the future.
 

Latest revision as of 20:50, 16 February 2013

If you're just getting started with NDS homebrew development then you should avoid PAlib, PAlib users and PAlib tutorials at all costs. They will give you bad advice and teach you programming methodologies which will hinder your progress and ensure that your projects are plagued with problems that will be nigh on impossible to fix.

In the early days of Nintendo DS development, while libnds was still building the low level support code, a library appeared with the goal of making things easier for novice programmers. This library, called PAlib ( standing for Programmer's Arsenal ), set out to provide a comprehensive set of wrapper functions which would allow someone with only the most basic knowledge of programming to get the skeleton of a DS game up and running quickly.

Making the tools used for homebrew programming more accessible to a wider range of skillsets is a laudable goal - one that is shared wholeheartedly by devkitPro. Unfortunately PAlib was badly designed, made use of internal functions never intended for user code and didn't keep pace with development which has fixed several very nasty bugs over the years. It might seem easier to get up and running but problems are still being reported with SD card corruption, odd issues with flashcards and wifi connection problems that have all been resolved by not using PAlib wrappers for libnds code.

For this reason devkitPro will not provide support to users attempting to get PAlib working. If you have followed the instructions given on the PAlib site and other sites whose tools depend on PAlib then uninstall completely and start over from scratch without replacing the PAlib parts. This is the only way to avoid issues that have been long fixed.

At the time of writing we have plans to further improve the accessibility of the tools and libraries we release. Unfortunately it will not be possible to ensure that 3rd party releases remain compatible with our tools and the integrity of those tools will be placed in question if you install anything not released by devkitPro inside, or make modifications to, the file system provided by the automated installer.

If you require assistance with our tools then please use the official support forums and the irc channels listed in the Community Portal page.