Stratosphere: Properly overwrite appInit/appExit for libnx in loader

This commit is contained in:
Michael Scire 2018-04-19 07:07:43 -06:00
parent f0759b0afc
commit d39c3b8efc

View file

@ -13,6 +13,7 @@
#include "ldr_debug_monitor.hpp" #include "ldr_debug_monitor.hpp"
#include "ldr_shell.hpp" #include "ldr_shell.hpp"
extern "C" {
extern u32 __start__; extern u32 __start__;
u32 __nx_applet_type = AppletType_None; u32 __nx_applet_type = AppletType_None;
@ -21,6 +22,13 @@ u32 __nx_applet_type = AppletType_None;
size_t nx_inner_heap_size = INNER_HEAP_SIZE; size_t nx_inner_heap_size = INNER_HEAP_SIZE;
char nx_inner_heap[INNER_HEAP_SIZE]; char nx_inner_heap[INNER_HEAP_SIZE];
void __libnx_initheap(void);
void __appInit(void);
void __appExit(void);
}
void __libnx_initheap(void) { void __libnx_initheap(void) {
void* addr = nx_inner_heap; void* addr = nx_inner_heap;
size_t size = nx_inner_heap_size; size_t size = nx_inner_heap_size;
@ -49,9 +57,11 @@ void __appInit(void) {
if (R_FAILED(rc)) if (R_FAILED(rc))
fatalSimple(0xCAFE << 4 | 1); fatalSimple(0xCAFE << 4 | 1);
/* Disable.
rc = fsldrInitialize(); rc = fsldrInitialize();
if (R_FAILED(rc)) if (R_FAILED(rc))
fatalSimple(0xCAFE << 4 | 2); fatalSimple(0xCAFE << 4 | 2);
*/
fsdevInit(); fsdevInit();
} }