Skip to content

Commit

Permalink
Make ovlloader not crash everything when ovlmenu isn't found. Exit sa…
Browse files Browse the repository at this point in the history
…nely
  • Loading branch information
WerWolv committed Feb 2, 2020
1 parent 5da25ae commit a3158f7
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 6 deletions.
43 changes: 43 additions & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"configurations": [
{
"name": "DKP Aarch64 Windows",
"includePath": [
"C:/devkitPro/devkitA64/aarch64-none-elf/include/**",
"C:/devkitPro/devkitA64/lib/gcc/aarch64-none-elf/8.3.0/include/**",
"C:/devkitPro/libnx/include/**",
"C:/devkitPro/portlibs/switch/include/**"
],
"defines": [
"SWITCH",
"VERSION=\"\"",
"__SWITCH__",
"__aarch64__"
],
"compilerPath": "C:/devkitPro/devkitA64/bin/aarch64-none-elf-g++",
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "gcc-x64"
},
{
"name": "DKP Aarch64 Linux",
"includePath": [
"/opt/devkitpro/devkitA64/aarch64-none-elf/include/**",
"/opt/devkitpro/devkitA64/lib/gcc/aarch64-none-elf/8.3.0/include/**",
"/opt/devkitpro/libnx/include/**",
"/opt/devkitpro/portlibs/switch/include/**"
],
"defines": [
"SWITCH",
"VERSION=\"\"",
"__SWITCH__",
"__aarch64__"
],
"compilerPath": "/opt/devkitpro/devkitA64/bin/aarch64-none-elf-g++",
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "gcc-x64"
}
],
"version": 4
}
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,11 @@ include $(DEVKITPRO)/libnx/switch_rules
# of a homebrew executable (.nro). This is intended to be used for sysmodules.
# NACP building is skipped as well.
#---------------------------------------------------------------------------------
TARGET := hbl
TARGET := ovll
BUILD := build
SOURCES := source
DATA := data
INCLUDES := include
#ROMFS := romfs
APP_VERSION := 1.0.0

ifeq ($(RELEASE),)
Expand Down
2 changes: 1 addition & 1 deletion hbl.json → ovll.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "edizon",
"name": "ovlloader",
"title_id": "0x010000000007E51A",
"title_id_range_min": "0x010000000007E51A",
"title_id_range_max": "0x010000000007E51A",
Expand Down
12 changes: 9 additions & 3 deletions source/main.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#include <switch.h>

#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
Expand Down Expand Up @@ -71,8 +73,12 @@ void __appInit(void)

void __wrap_exit(void)
{
// exit() effectively never gets called, so let's stub it out.
fatalThrow(MAKERESULT(Module_HomebrewLoader, 39));
pmshellInitialize();
pmshellTerminateProgram(0x010000000007E51A);
pmshellExit();

while (1)
svcSleepThread(INT64_MAX);
}

static void* g_heapAddr;
Expand Down Expand Up @@ -203,7 +209,7 @@ void loadNro(void)

int fd = open(g_nextNroPath, O_RDONLY);
if (fd < 0)
fatalThrow(MAKERESULT(Module_HomebrewLoader, 3));
exit(1);

// Reset NRO path to load hbmenu by default next time.
g_nextNroPath[0] = '\0';
Expand Down

0 comments on commit a3158f7

Please sign in to comment.