-
Notifications
You must be signed in to change notification settings - Fork 2
LibUser
LibUser is custom code file assembled from the source files inside src/lib_user/
. This file is injected into 80700000
address in the memory. This code will be available for all custom actors and most of the code. Boot won't necessary be able to access this code as loading this will not happen immediately on boot. It will be available for boot title and after that.
Main usage for this would be to do your system changes while having good amount of room to change game behaviour.
Another usage would be having your own "PlayState"
here, where you have values or states going on. This will be accesible for all files that has #include <uLib.h>
included for them.
LibUser has only 724.00kB
reserved for it. Having a ton of data here might not be optimal but can definitely be done.
This will behave somewhat same as LibCode but the difference is in that it will only write a hook into this function. This way you do not need to care about the original code size limitations.
In order to hook a function into here you'll have to have the function name matching exactly to what the z64hdr has that function named. Basically having overlapping name. Also on top of that you'll have to use Asm_VanillaHook
macro in order for the hooking to be possible.
Example:
Asm_VanillaHook(Player_IsChildWithHylianShield);
s32 Player_IsChildWithHylianShield(Player* this) {
#if Patch_WieldHylianShieldLikeKokiriShield == true
return 0;
#endif
return gSaveContext.linkAge && (this->currentShield == PLAYER_SHIELD_HYLIAN);
}
Debug_Text(r, g, b, x, y, fmt, ...)
- Draw text on screen
osLibPrintf(fmt, ...)
- Print text on console, by default the vanilla prints are muted
-
Sound
-
System
-
Other