mirror of
https://github.com/wiiu-env/WiiUPluginSystem.git
synced 2026-10-23 15:52:44 -05:00
[loader] Added minimal loader project
Added an empty project for the loader. This just logs a short string over udp.
This commit is contained in:
33
loader/src/common/common.h
Normal file
33
loader/src/common/common.h
Normal file
@@ -0,0 +1,33 @@
|
||||
#ifndef COMMON_H
|
||||
#define COMMON_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <dynamic_libs/os_defs.h>
|
||||
|
||||
#define CAFE_OS_SD_PATH "/vol/external01"
|
||||
#define GAME_MOD_FOLDER "/sdcafiine"
|
||||
#define SD_PATH "sd:"
|
||||
#define USB_PATH "usb:"
|
||||
#define DEFAULT_NAME_PACKAGE "DEFAULT"
|
||||
#define NAME_PREFIX_SD "sd: "
|
||||
#define NAME_PREFIX_USB "usb:"
|
||||
|
||||
#define ELF_DATA_ADDR (*(volatile unsigned int*)(MEM_BASE + 0x1300 + 0x00))
|
||||
#define ELF_DATA_SIZE (*(volatile unsigned int*)(MEM_BASE + 0x1300 + 0x04))
|
||||
#define MAIN_ENTRY_ADDR (*(volatile unsigned int*)(MEM_BASE + 0x1400 + 0x00))
|
||||
|
||||
#ifndef EXIT_SUCCESS
|
||||
#define EXIT_SUCCESS 0
|
||||
#endif
|
||||
#define EXIT_HBL_EXIT 0xFFFFFFFE
|
||||
#define EXIT_RELAUNCH_ON_LOAD 0xFFFFFFFD
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* COMMON_H */
|
||||
|
||||
2
loader/src/common/retain_vars.cpp
Normal file
2
loader/src/common/retain_vars.cpp
Normal file
@@ -0,0 +1,2 @@
|
||||
#include "retain_vars.h"
|
||||
|
||||
5
loader/src/common/retain_vars.h
Normal file
5
loader/src/common/retain_vars.h
Normal file
@@ -0,0 +1,5 @@
|
||||
#ifndef RETAINS_VARS_H_
|
||||
#define RETAINS_VARS_H_
|
||||
|
||||
|
||||
#endif // RETAINS_VARS_H_
|
||||
10
loader/src/entry.c
Normal file
10
loader/src/entry.c
Normal file
@@ -0,0 +1,10 @@
|
||||
#include <string.h>
|
||||
#include "main.h"
|
||||
|
||||
int __entry_menu(int argc, char **argv)
|
||||
{
|
||||
//! *******************************************************************
|
||||
//! * Jump to our application *
|
||||
//! *******************************************************************
|
||||
return Menu_Main();
|
||||
}
|
||||
40
loader/src/link.ld
Normal file
40
loader/src/link.ld
Normal file
@@ -0,0 +1,40 @@
|
||||
OUTPUT(wiiupluginloader.elf);
|
||||
|
||||
/* Tell linker where our application entry is so the garbage collect can work correct */
|
||||
ENTRY(__entry_menu);
|
||||
|
||||
SECTIONS {
|
||||
. = 0x00802000;
|
||||
.text : {
|
||||
*(.kernel_code*);
|
||||
*(.text*);
|
||||
/* Tell linker to not garbage collect this section as it is not referenced anywhere */
|
||||
KEEP(*(.kernel_code*));
|
||||
}
|
||||
.rodata : {
|
||||
*(.rodata*);
|
||||
}
|
||||
.data : {
|
||||
*(.data*);
|
||||
|
||||
__sdata_start = .;
|
||||
*(.sdata*);
|
||||
__sdata_end = .;
|
||||
|
||||
__sdata2_start = .;
|
||||
*(.sdata2*);
|
||||
__sdata2_end = .;
|
||||
}
|
||||
.bss : {
|
||||
__bss_start = .;
|
||||
*(.bss*);
|
||||
*(.sbss*);
|
||||
*(COMMON);
|
||||
__bss_end = .;
|
||||
}
|
||||
__CODE_END = .;
|
||||
|
||||
/DISCARD/ : {
|
||||
*(*);
|
||||
}
|
||||
}
|
||||
29
loader/src/main.cpp
Normal file
29
loader/src/main.cpp
Normal file
@@ -0,0 +1,29 @@
|
||||
#include <string>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <malloc.h>
|
||||
|
||||
#include <dynamic_libs/os_functions.h>
|
||||
#include <dynamic_libs/socket_functions.h>
|
||||
#include <utils/logger.h>
|
||||
#include <system/exception_handler.h>
|
||||
|
||||
#include "main.h"
|
||||
|
||||
|
||||
/* Entry point */
|
||||
extern "C" int Menu_Main(void){
|
||||
InitOSFunctionPointers();
|
||||
InitSocketFunctionPointers(); //For logging
|
||||
|
||||
log_init();
|
||||
|
||||
setup_os_exceptions();
|
||||
|
||||
DEBUG_FUNCTION_LINE("Application started.\n");
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
19
loader/src/main.h
Normal file
19
loader/src/main.h
Normal file
@@ -0,0 +1,19 @@
|
||||
#ifndef _MAIN_H_
|
||||
#define _MAIN_H_
|
||||
|
||||
#include <dynamic_libs/os_functions.h>
|
||||
#include <dynamic_libs/os_types.h>
|
||||
|
||||
/* Main */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
//! C wrapper for our C++ functions
|
||||
int Menu_Main(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
1
loader/src/version.h
Normal file
1
loader/src/version.h
Normal file
@@ -0,0 +1 @@
|
||||
#define APP_VERSION "pre-alpha"
|
||||
Reference in New Issue
Block a user