// HEL Library \\ |
debug
and release
library of HEL
.
HEL Library comes in two forms. One for debug purposes, using Assertion Checking and one for the final release, which does not include ASSERT
and is faster and smaller.
The debug
library consumes more memory (ROM/IWRAM/EWRAM) than the release
library and is also slower and bigger in its filesize. The more memory consumtion is archieved because it includes a few variables for reference-counting which are located in EWRAM (< 500byte) and some self-modifing-code which must be in IWRAM (< 400byte).
While working on a project, it's recommended to use the debug library. This is just because the debug library includes ASSERT
checking and so it will display an errormessage when you pass an invalid parameter to one of HEL's functions. ASSERT
calls seem to be a bit overhead for the little GBA, but they help a lot in the development process and therefore they are implemented in the debug version of HEL.
All ASSERT
calls, Reference-Counter variables as well as Debugging Functions are removed in the release library. Even a lot of functions get replaced with macros when you switch to release mode to gain maximum speed. As of version HEL 1.5, this includes the Object/Window/DMA/System/SpecialFX/etc... modules!
Switch between Debug and Release Library:
Since sooner or later you want to switch between the debug and release library, here is an explanation how this can be done.
Copy libhel.a as described in the Installation guide into the correct directory. Now, depending on what version you copied (debug or release) you have to either enable or disable HAM_DEBUGGER
which is located in mygba.h. The file mygba.h is the header file of HAM
and located into the 'ham/include' directory in your HAM installation. Make a stringsearch in this file for HAM_DEBUGGER
. You should come across this text:
#define HAM_DEBUGGER 1
That is the default setting! If you want to turn off debugging just comment out this line as demonstrated below:
//#define HAM_DEBUGGER 1
HEL is now also forced to use macros for a lot of functions, please see notes in this context.
When to use the Release Library:
A disadvantage of the debug library is that you don't have the full performance as mentioned earlier. At some point of time you want to see how your game really runs on the GBA. This is a good moment to rebuild the project in release mode and then watch it in all its glory and full speed on hardware. Basically, whenever I think my game is bugfree and I want to test it on hardware, I rebuild the entire project with the release library and switch back to the debug version when I continue developing by using an emulator.
Notes:
Due to the fact that several modules in HEL are almost entirely replaced with macros in release mode, you can encounter an error that it cannot find a symbol (function) in the library. This error occurs when you use the release library but you did not remove the HAM_DEBUGGER
define. In this case HEL still thinks it should use the functions which are located in the library instead of using the macros.