Add a simple .rpl file example.

This commit is contained in:
James Benton 2018-05-30 21:56:29 +01:00
parent f281be50ab
commit 86ea2f1466
3 changed files with 37 additions and 0 deletions

View File

@ -0,0 +1,15 @@
cmake_minimum_required(VERSION 3.2)
project(my_first_rpl C)
include("${WUT_ROOT}/share/wut.cmake" REQUIRED)
add_executable(my_first_rpl
my_first_rpl.c)
wut_add_exports(my_first_rpl
exports.def)
wut_create_rpl(my_first_rpl.rpl
my_first_rpl)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/my_first_rpl.rpl"
DESTINATION "${CMAKE_INSTALL_PREFIX}")

View File

@ -0,0 +1,2 @@
:TEXT
my_first_export

View File

@ -0,0 +1,20 @@
#include <coreinit/dynload.h>
int
my_first_export()
{
return 1;
}
int
rpl_main(OSDynLoad_Module module,
OSDynLoad_EntryReason reason)
{
if (reason == OS_DYNLOAD_LOADED) {
// Do stuff on load
} else if (reason == OS_DYNLOAD_UNLOADED) {
// Do stuff on unload
}
return 0;
}