Update my_first_rpl sample to use new rpl importing functionality.

This commit is contained in:
James Benton 2020-06-06 16:01:40 +01:00 committed by James
parent 191200b5cb
commit ff25fe18d0
5 changed files with 44 additions and 5 deletions

View File

@ -2,11 +2,15 @@ cmake_minimum_required(VERSION 3.2)
project(my_first_rpl C)
include("${DEVKITPRO}/wut/share/wut.cmake" REQUIRED)
add_executable(my_first_rpl
my_first_rpl.c)
add_executable(my_first_rpl my_first_rpl.c)
wut_add_exports(my_first_rpl exports.def)
wut_create_rpl(my_first_rpl)
add_executable(my_first_rpx my_first_rpx.c)
wut_link_rpl(my_first_rpx my_first_rpl)
wut_create_rpx(my_first_rpx)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/my_first_rpx.rpx"
DESTINATION "${CMAKE_INSTALL_PREFIX}")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/my_first_rpl.rpl"
DESTINATION "${CMAKE_INSTALL_PREFIX}")

View File

@ -1,2 +1,4 @@
:NAME my_first_rpl
:TEXT
my_first_export

View File

@ -1,9 +1,11 @@
#include "my_first_rpl.h"
#include <coreinit/dynload.h>
int
const char *
my_first_export()
{
return 1;
return "Hello from my_first_rpl!";
}
int

View File

@ -0,0 +1,6 @@
#ifndef MY_FIRST_RPL_H
#define MY_FIRST_RPL_H
const char *my_first_export();
#endif // MY_FIRST_RPL_H

View File

@ -0,0 +1,25 @@
#include "my_first_rpl.h"
#include <coreinit/thread.h>
#include <coreinit/time.h>
#include <whb/proc.h>
#include <whb/log.h>
#include <whb/log_console.h>
int
main(int argc, char **argv)
{
WHBProcInit();
WHBLogConsoleInit();
WHBLogPrintf(my_first_export());
while(WHBProcIsRunning()) {
WHBLogConsoleDraw();
OSSleepTicks(OSMillisecondsToTicks(30));
}
WHBLogConsoleFree();
WHBProcShutdown();
return 0;
}