A new release of PALib is here, it’s a programming library useful for mostly game coders.


New stuff:
[Input] Added functions for using the Guitar Hero grip controller. See the example code in /examples/input/GHController for how to use them. These functions were contributed by BassAceGold.

[Input] Added functions for using the Taito Paddle controller. See the example code in /examples/input/TaitoPaddle for how to use these functions. Thanks to Yasu for figuring out how it works.

[FAT Loading] A whole new library for loading graphics and sound assets from FAT (EFS or regular FAT with DLDI) is introduced to PAlib thanks to NightFox! You can now easily load backgrounds, sprites with their palettes, textures, sound effects and other files from FAT. See the examples in /examples/FAT/FATLoading and the PAlib documentation (English only, sorry) for how to use these great new functions.

[8/16bit] A new “fake” 16-bit bitmap drawing mode by fincs. This simulates a 16-bit background using an 8-bit background by changing palettes every HBlank, and thereby frees up the large chunk of VRAM needed for a true 16-bit mode. See the included example in /examples/Bitmap8-16bit/Fake16bit or the PAlib documentation for usage.

[3DSprites] MaaS wrote a new function, PA_3DSetSpritePalCol, for changing 3D sprite palette colors on the fly.

[ARM7] Added a new arm7 core with only aslib and no wireless stuff, so it SHOULD work on M3/G6 Real. For increaed compatibility, this is now the default ARM7 binary, so be sure to select a different one in your Makefile if you need DSWifi or other ARM7 features. (See the readme file in the template folder for information on how to edit the Makefile to select a different ARM7 binary.)

Updated Oldies
[Installer] Updated the PAlib installer. All items are now optional and the root path is user-selectable.

[AS_Lib/Sound] Noda provided a new AS_Lib version and defines for EFS were removed. Using ASlib with EFSlib v2 now only requires including the efs_lib.c/.h files in your project.

[Sound] PA_InitASLibForSounds, PA_InitASLibForMP3 and PA_InitSound have been removed. You should now use the following methods to initialize AS_Lib in the mode you desire:

/* Init AS_Lib for mp3s */
PA_VBLFunctionInit(AS_SoundVBL); // easy way to make sure that AS_SoundVBL() is called every frame
AS_Init(AS_MODE_MP3 | AS_MODE_SURROUND | AS_MODE_16CH); // initializes AS_Lib
AS_SetDefaultSettings(AS_PCM_8BIT, 11025, AS_SURROUND); // or your preferred default sound settings


/* Init AS_Lib for sounds only */
AS_Init(AS_MODE_SURROUND | AS_MODE_16CH); // initializes AS_Lib
AS_SetDefaultSettings(AS_PCM_8BIT, 11025, AS_SURROUND); // or your preferred default sound settings

[Random] OlliPolli has improved PAlib’s Random functions. They are now faster, better and bigger (bigger random numbers, that is) and PA_InitRand is no longer needed.

[Text] ThemePark has made a very useful change to PA_OutputText and PA_OutputSimpleText. They now support newlines (n) in the body of the text.

[Backgrounds] Maple identified a problem with PA_DeleteBg and improved the function so that it now fully resets the background instead of just deleteing the tiles and hiding it. This should solve problems when switching between large map backgrounds and regular backgrounds on the same layer.

[Makefile] Removed –gc-sections from the Makefile. Thanks to Noda.

[Makefile] The Makefile in your project directory now only contains lines that will commonly change from project to project with the bulk of the Makefile being moved to /palib/lib/PA_Makefile. This should solve some updating issues and make editing the Makefile easier. Thanks to crash for this change.

[Examples/3DSprites] All 3DSprites examples have been updated so that PA_3DProcess comes after the vblank. This is the prefered method for rendering the 3D sprites and can solve a problem with flickering or tearing textures if a lot of 3D sprites are on screen.

[Examples/EFS_Lib] The EFS_Lib examples in /examples/FAT/EFS_Lib and /examples/Sound/ASLib_with_EFSlib have been updated to use EFS_Lib v2.0. Huge thanks to Noda for creating this wonderful library!

[Emulators] Updated all emulators (iDeaS, DeSmuME, No$GBA, NeonDS) and provided Linux versions where available (iDeaS, DeSmuME).

Things Fixed
[Mic/Sound] Fixed PA_MicReplay by returning the old PA_PlaySoundEx2 to the PAlib source. This also provides a rudimentary alternative sound engine when ASlib cannot be used.

[8/16bit Drawing] Fixed bug in PA_8bitDraw and PA_16bitDraw that caused unwanted lines to appear when turning drawing on and off while the stylus was held down. Thanks to Maple for the solution.

[BMP Loading] Fixed declaration in PA_GetBmpWidth and PA_GetBmpHeight that caused compiler errors for C++ users. Thanks to Frosty Chaotix and others for this.

[Video] dmig has fixed the long time error in PA_LoadVid, which should now be working.

[3DSprites] Fixed misdefinition in PA_3DUpdateSpriteAnims. This fix may help problems with flickering and tearing of textures. Thanks to SevenString for the catch.

[Sprites] Sylus101 fixed an issue in PA_ResetSpriteSysScreen that stopped sprite animations from working after the function was called.

[Sprites] Fixed PA_GetSpriteNCycles returning wrong type and inconsistent definition for spriteanims.ncycles. Thanks to Salz` for catching this.

[Input] Fixed bug preventing Pad.xxx.Anykey from recognizing the Y button. Thanks to ant512 for uncovering this bug ages ago and now it’s finally been fixed in the source.

[GIF Loading] ThemePark fixed a bug in PA_3DCreateFromGif and many transparency related problems in PA_GifToTex/GifToTiles. These functions are optimized and should be working properly now. See the exmaples for new usage.

[Pathfinding] AntonioND updated the PA_Astar path-finding function. It’s more efficient, returns an error value (-1) if there is no solution and a possible infinite loop bug has been fixed.

[Window] Schyzophrenic fixed an error in PA_EnableWin that prevented full declaration of layer priorities against the windows.

[Palettes] MaaS fixed bug in PA_SetSpritePalCol that caused corruption of sprites.

[General] Fixed PA_CloseLidSound. Thanks to unkwar.

[General] Finally fixed PA_PowerOff.