Professional Documents
Culture Documents
LiveMove 2
RSO how-to
========================
The LiveMove package comes with an RSO library intended for use with Nintendo's
RSO package. This document will describe how to import LiveMove 2 as an RSO.
There are five steps to getting your application to use the RSO correctly:
Step 2: Ensure the linker includes all base functionality in the base .elf
In order to ensure that all basic system functions that libLM.rso requires are
present in the final .elf functions, you will also need to set the lcf file
used by the linker to be $(LM_DIR)/lib/libLM.lcf. Do this by replacing the
existing "-lcf <filename>" parameter on the linker command line with
-lcf $(LM_DIR)/lib/libLM.lcf
In your application, add a routine that loads libLM.rso into memory, allocates
a buffer for the bss segment, and then calls RSOLinkList() on the memory
block. An example of how to do this can be found in the Nintendo RSO
documentation.
After the libLM.rso module has been loaded and linked, call the module prolog
function to execute any necessary setup code:
((u32(*)(void)) module->prolog)();
libLMstub.lib provides functions to automatically resolve all the symbols
defined in liveMove2.h to locations in libLM.rso. To access these, include the
header file "libLMstub.h". It will define 2 functions:
Once you have called the prolog function from the RSOObjectHeader, you can
pass it to loadLMrso() to properly link the static function stubs with the
dynamic locations of the functions loaded from libLM.rso.
At this point, you will be able to use LiveMove normally, as if it had been
linked with the ELF statically.
When you are finished with libLM functions, you can unlink the rso from
libLMstub by calling unloadLMrso(). Once you have done this, you can call the
epilog function and RSOUnLinkList() on the module as described in the Nintendo
documentation, which will prepare the memory block for deallocation.