Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@
#.gitignore #
###################

.devcontainer/

build/
out/
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "inipp"]
path = inipp
url = https://github.com/mcmtroffaes/inipp
[submodule "borealis"]
path = borealis
url = https://github.com/withertech/borealis
13 changes: 9 additions & 4 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
{
"configurations": [
{
"name": "Linux",
"name": "DKP aarch64",
"includePath": [
"${workspaceFolder}/**",
"${workspaceFolder}/inipp/",
"${workspaceFolder}/borealis/library/include/",
"/opt/devkitpro/devkitA64/aarch64-none-elf/include/",
"/opt/devkitpro/devkitA64/lib/gcc/aarch64-none-elf/**",
"/opt/devkitpro/libnx/include/",
"/opt/devkitpro/portlibs/switch/include/"
],
"defines": [],
"compilerPath": "/usr/bin/gcc",
"defines": [
"SWITCH",
"__SWITCH__",
"DEBUG"
],
"compilerPath": "/opt/devkitpro/devkitA64/bin/aarch64-none-elf-gcc",
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "gcc-x64"
"intelliSenseMode": "gcc-arm64"
}
],
"version": 4
Expand Down
172 changes: 91 additions & 81 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,84 +1,94 @@
{
"files.associations": {
"stdio.h": "c",
"cartridge.h": "c",
"stdint.h": "c",
"type_traits": "c",
"cpu.h": "c",
"cpu_tester.h": "c",
"instrs.h": "c",
"stddef.h": "c",
"string.h": "c",
"util.h": "c",
"standard_controller.h": "c",
"input_device.h": "c",
"renderer.h": "c",
"system.h": "c",
"sdl_audio.h": "c",
"hotkeys.h": "c",
"mappers.h": "c",
"nrom.h": "c",
"plutonium": "cpp",
"random": "cpp",
"vector": "cpp",
"map": "cpp",
"array": "cpp",
"atomic": "cpp",
"strstream": "cpp",
"*.tcc": "cpp",
"bitset": "cpp",
"cctype": "cpp",
"chrono": "cpp",
"clocale": "cpp",
"cmath": "cpp",
"complex": "cpp",
"condition_variable": "cpp",
"csignal": "cpp",
"cstdarg": "cpp",
"cstddef": "cpp",
"cstdint": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cstring": "cpp",
"ctime": "cpp",
"cwchar": "cpp",
"cwctype": "cpp",
"deque": "cpp",
"list": "cpp",
"unordered_map": "cpp",
"exception": "cpp",
"algorithm": "cpp",
"functional": "cpp",
"iterator": "cpp",
"memory": "cpp",
"memory_resource": "cpp",
"numeric": "cpp",
"optional": "cpp",
"ratio": "cpp",
"set": "cpp",
"string": "cpp",
"string_view": "cpp",
"system_error": "cpp",
"tuple": "cpp",
"utility": "cpp",
"fstream": "cpp",
"initializer_list": "cpp",
"iomanip": "cpp",
"iosfwd": "cpp",
"iostream": "cpp",
"istream": "cpp",
"limits": "cpp",
"mutex": "cpp",
"new": "cpp",
"ostream": "cpp",
"sstream": "cpp",
"stdexcept": "cpp",
"streambuf": "cpp",
"thread": "cpp",
"cfenv": "cpp",
"cinttypes": "cpp",
"typeindex": "cpp",
"typeinfo": "cpp",
"*.ipp": "cpp"
}
"stdio.h": "c",
"cartridge.h": "c",
"stdint.h": "c",
"type_traits": "c",
"cpu.h": "c",
"cpu_tester.h": "c",
"instrs.h": "c",
"stddef.h": "c",
"string.h": "c",
"util.h": "c",
"standard_controller.h": "c",
"input_device.h": "c",
"renderer.h": "c",
"system.h": "c",
"sdl_audio.h": "c",
"hotkeys.h": "c",
"mappers.h": "c",
"nrom.h": "c",
"plutonium": "cpp",
"random": "cpp",
"vector": "cpp",
"map": "cpp",
"array": "cpp",
"atomic": "cpp",
"strstream": "cpp",
"*.tcc": "cpp",
"bitset": "cpp",
"cctype": "cpp",
"chrono": "cpp",
"clocale": "cpp",
"cmath": "cpp",
"complex": "cpp",
"condition_variable": "cpp",
"csignal": "cpp",
"cstdarg": "cpp",
"cstddef": "cpp",
"cstdint": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cstring": "cpp",
"ctime": "cpp",
"cwchar": "cpp",
"cwctype": "cpp",
"deque": "cpp",
"list": "cpp",
"unordered_map": "cpp",
"exception": "cpp",
"algorithm": "cpp",
"functional": "cpp",
"iterator": "cpp",
"memory": "cpp",
"memory_resource": "cpp",
"numeric": "cpp",
"optional": "cpp",
"ratio": "cpp",
"set": "cpp",
"string": "cpp",
"string_view": "cpp",
"system_error": "cpp",
"tuple": "cpp",
"utility": "cpp",
"fstream": "cpp",
"initializer_list": "cpp",
"iomanip": "cpp",
"iosfwd": "cpp",
"iostream": "cpp",
"istream": "cpp",
"limits": "cpp",
"mutex": "cpp",
"new": "cpp",
"ostream": "cpp",
"sstream": "cpp",
"stdexcept": "cpp",
"streambuf": "cpp",
"thread": "cpp",
"cfenv": "cpp",
"cinttypes": "cpp",
"typeindex": "cpp",
"typeinfo": "cpp",
"*.ipp": "cpp",
"hash_map": "cpp",
"bit": "cpp",
"codecvt": "cpp",
"compare": "cpp",
"concepts": "cpp",
"regex": "cpp",
"ranges": "cpp",
"shared_mutex": "cpp",
"stop_token": "cpp",
"variant": "cpp"
}
}
14 changes: 10 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ EXEFS_SRC := exefs_src
#ROMFS := romfs
ICON := res/icon.jpg

ROMFS := resources
BOREALIS_PATH := borealis
BOREALIS_RESOURCES := romfs:/

ARCH := -march=armv8-a -mtune=cortex-a57 -mtp=soft -fPIE

CFLAGS := -Wall -O3 -ffunction-sections \
Expand All @@ -34,17 +38,19 @@ CFLAGS := -Wall -O3 -ffunction-sections \
-D__VERSION_MICRO=${VERSION_MICRO} \
-D__VERSION="${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_MICRO}"

CFLAGS += $(INCLUDE) -D__SWITCH__

CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=c++17
CFLAGS += $(INCLUDE) -D__SWITCH__ -DBOREALIS_RESOURCES="\"$(BOREALIS_RESOURCES)\""

CXXFLAGS := $(CFLAGS) -std=c++17
#-fno-rtti -fno-exceptions
ASFLAGS := $(ARCH)
LDFLAGS = -specs=$(DEVKITPRO)/libnx/switch.specs $(ARCH) -Wl,-no-as-needed,-Map,$(notdir $*.map)

LIBS := -lnx
LIBS := -lsmm -lnx

LIBDIRS := $(PORTLIBS) $(LIBNX)

include $(TOPDIR)/borealis/library/borealis.mk

ifneq ($(BUILD),$(notdir $(CURDIR)))

export OUTPUT := $(CURDIR)/$(OUTDIR)/$(TARGET)
Expand Down
1 change: 1 addition & 0 deletions borealis
Submodule borealis added at c35d3e
53 changes: 36 additions & 17 deletions include/error_defs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,32 +26,51 @@
#pragma once

#include "console_helper.hpp"
#include "main.hpp"
#include <borealis.hpp>

#define FATAL(fmt, ...) CONSOLE_CLEAR_SCREEN(); \
CONSOLE_SET_COLOR(CONSOLE_COLOR_FG_RED); \
printf("Fatal error: " ); \
CONSOLE_SET_COLOR(CONSOLE_COLOR_FG_YELLOW); \
printf(fmt, ##__VA_ARGS__); \
CONSOLE_MOVE_DOWN(3); \
CONSOLE_MOVE_LEFT(99); \
CONSOLE_SET_COLOR(CONSOLE_COLOR_FG_GREEN); \
printf("Press (+) to exit.\n"); \
g_fatal_occurred = true
#define FATAL(fmt, ...) \
if (g_gui) \
{ \
char msg[100] = "Fatal Error: "; \
char err[100]; \
sprintf(err, fmt, ##__VA_ARGS__); \
strcat(msg, err); \
brls::Application::crash(msg); \
g_fatal_occurred = true; \
} \
else \
{ \
CONSOLE_CLEAR_SCREEN(); \
CONSOLE_SET_COLOR(CONSOLE_COLOR_FG_RED); \
printf("Fatal error: " ); \
CONSOLE_SET_COLOR(CONSOLE_COLOR_FG_YELLOW); \
printf(fmt, ##__VA_ARGS__); \
CONSOLE_MOVE_DOWN(3); \
CONSOLE_MOVE_LEFT(99); \
CONSOLE_SET_COLOR(CONSOLE_COLOR_FG_GREEN); \
printf("Press (+) to exit.\n"); \
g_fatal_occurred = true; \
}


#define FATAL_CODE(code, fmt, ...) FATAL(fmt " (code %d)", ##__VA_ARGS__, code)

#define PANIC() FATAL("Panic @ %s:%d\n\nPlease contact the developer", __FILE__, __LINE__)
#define PANIC() FATAL(("sky/fatal/panic"_i18n).c_str(), __FILE__, __LINE__)

#define RC_SUCCESS(rc) (rc == 0)
#define RC_FAILURE(rc) (rc != 0)

#define DO_OR_DIE(rc, task, fail_fmt, ...) if ((rc = RC_FAILURE((task)))) { \
FATAL_CODE(rc, fail_fmt, ##__VA_ARGS__); \
return -1; \
}
#define DO_OR_DIE(rc, task, fail_fmt, ...) \
if ((rc = RC_FAILURE((task)))) \
{ \
FATAL_CODE(rc, fail_fmt, ##__VA_ARGS__); \
return -1; \
}

static bool g_fatal_occurred = false;

inline bool fatal_occurred(void) {
return g_fatal_occurred;
inline bool fatal_occurred(void)
{
return g_fatal_occurred;
}
15 changes: 15 additions & 0 deletions include/frame_root.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#pragma once

#include <borealis.hpp>
#include <tab_mods.hpp>
#include <global.hpp>
#include "mod.hpp"

class frame_root : public brls::TabFrame
{

public:
frame_root();

bool onCancel() override;
};
9 changes: 9 additions & 0 deletions include/global.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#pragma once

#include <tab_mods.hpp>
#include <frame_root.hpp>
class tab_mods;

void setModsTabPtr(tab_mods *currentTabModBrowserPtr_);

tab_mods *getModsTabPtr(void);
17 changes: 17 additions & 0 deletions include/item_mod.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#pragma once

#include <borealis.hpp>
#include <borealis/list.hpp>
#include "mod.hpp"
#include "main.hpp"
#include "global.hpp"
using namespace brls;

class ModListItem : public ListItem
{

public:
ModListItem(std::string label, std::string description = "", std::string subLabel = "") : ListItem(label, description, subLabel){};
void onFocusLost();
void onFocusGained();
};
Loading