This OoT/MM mod allows functions to be embedded into and run from within player model files once per frame, enabling us to do fun effects like flowing capes, glowing materials, physics, scrolling textures, alternate costume/tunic models, HUD elements, and more.
z64playas
z64convert
z64ovl
orSharp Ocarina
- Your
z64playas
manifest must use thePOOL
feature!
- Change the
#include
s to be for your specific version or game. - Run
make clean && make
func.ovl
andmod.bin
are generated.
- This is how most people will use it.
- Adjust the
#include
in your source code to be for the game and version you're targeting. - Use
Custom Actor Toolkit
to buildfunc.c
(it's super straightforward). func.ovl
will be generated, which you then use inz64playas
.
- The assembly at the start of
func.c
is a hacky way of trying to guarantee a jump to therenderinit
function will be at the beginning of the overlay's.text
section. - It is very important that the beginning of the overlay's
.text
section berenderinit
, or a jump torenderinit
(see above).
OoT debug (bin/oot/debug
)
- Write
code_0xb8828.bin
at0xB4C828
(that is at0xB8828
incode
) - Write
0C0355A2
at0xB09264
(that is at0x75264
incode
) - Write
0C0355A2
at0xC1903C
(that is at0x17F8C
inovl_player_actor
) - Write
00000000
at0xFE17FC
(if using vanillaAdult Link
) (that is at0x57FC
in hiszobj
) - Write
00000000
at0x10197FC
(if using vanillaYoung Link
) (that is at0x57FC
in hiszobj
)
OoT NTSC 1.0 (bin/oot/ntsc10
)
- Write
code_0x9dac4.bin
at0xB24AC4
(that is at0x9DAC4
incode
) - Write
0C02BAD9
at0xAF2940
(that is at0x6B940
incode
) - Write
0C02BAD9
at0xBE5C4C
(that is at0x180DC
inovl_player_actor
) - Write
00000000
at0xF8B7FC
(if using vanillaAdult Link
) (that is at0x57FC
in hiszobj
) - Write
00000000
at0xFC37FC
(if using vanillaYoung Link
) (that is at0x57FC
in hiszobj
)
func.ovl
goes in theDynamic ZOVL
field inz64playas
- Make sure you have patched your game to be compatible with this tweak first using the instructions above.
This mod assumes a structure of this type resides at 0x57F8
in Link's 3D model file:
struct z64playerRenderInit
{
/* offsets are relative to the start of Link's model in ram */
uint32_t start; /* offset of start of overlay */
union
{
uint32_t header; /* offset of overlay header */
void (*exec)(void*); /* main routine after relocating */
} u;
} *rinit;
Immediately before Link's drawing routine, the mod checks rinit->u.header
. If its value is 0
, no overlay is present. If it's a ram address, the function at that address is executed. Otherwise, the overlay described by rinit
is relocated (a process which converts virtual ram addresses to physical ram addresses), and rinit->u.exec
is updated to point to the main routine in the overlay.
In other words, this mod executes code stored in Link's 3D model file, of all places.
My approach is meant to maximize accessibility, portability, and ease of use: apply a very small patch to the game and you're ready to write code for your play-as mod. You don't have to worry about setting up your own hook, or injecting code, or hardware/Wii-VC compatibility, or porting (just change build targets). All the hard work is already done for you so you can focus on the fun part: being creative.
An additional benefit from using this implementation is that your play-as mods are automatically compatible with Ocarina of Time Online.
E-Gor, CrookedPoe: N64 hardware testing
Mikau6: Wii VC testing