This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright 2022 TotalJustice. | |
// SPDX-License-Identifier: GPL-3.0-only | |
#pragma once | |
#ifndef SCHEDULER_USE_BOOST | |
#define SCHEDULER_USE_BOOST 1 | |
#endif | |
// set this to 0 if the scheduler can be empty, 1 by default | |
// due to the reset event always being set! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <switch.h> | |
#include <cstdlib> | |
#include <cstring> | |
#include <cstdio> | |
#include <cstdarg> | |
#include <vector> | |
#include <memory> | |
#include <bit> | |
#include <experimental/scope> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SOURCE: https://github.com/nba-emu/NanoBoyAdvance/blob/master/src/platform/core/src/device/shader/color_agb.glsl.hpp | |
// GODBOLT: https://godbolt.org/z/1cfaedavK | |
#include <cstdint> | |
#include <cmath> | |
#include <algorithm> | |
uint32_t gba_shader(uint16_t bgr555) { | |
constexpr auto darken_screen = 1.0; | |
constexpr auto target_gamma = 2.2; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdint.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <libdragon.h> | |
#include <sms.h> | |
// todo: use timer_ticks() for benchmarking | |
// add timer_ticks() after functions and log the diff | |
// then sort the logs that way. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <switch.h> | |
#include <string.h> | |
#include <stdlib.h> | |
static char g_argv[2048]; | |
static char g_nextArgv[2048]; | |
static char g_nextNroPath[FS_MAX_PATH]; | |
static enum { | |
CodeMemoryUnavailable = 0, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
auto nro_parse(FsFileSystem* fs, const char* path, const char* star_path, NroEntry& entry) -> bool { | |
Result rc{}; | |
FsFile f{}; | |
u64 bytes_read{}; | |
if (R_FAILED(rc = fsFsOpenFile(fs, path, FsOpenMode_Read, &f))) { | |
// std::printf("failed to open: %s\n", path); | |
return false; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "minGlue.h" | |
#include <string.h> | |
static bool ini_open(const char* filename, struct NxFile* nxfile, u32 mode) { | |
Result rc = {0}; | |
char filename_buf[FS_MAX_PATH] = {0}; | |
if (R_FAILED(rc = fsOpenSdCardFileSystem(&nxfile->system))) { | |
return false; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct EmummcPaths { | |
char unk[0x80]; | |
char nintendo[0x80]; | |
}; | |
void smcAmsGetEmunandConfig(EmummcPaths* out_paths) { | |
SecmonArgs args{}; | |
args.X[0] = 0xF0000404; /* smcAmsGetEmunandConfig */ | |
args.X[1] = 0; /* EXO_EMUMMC_MMC_NAND*/ | |
args.X[2] = (u64)out_paths; /* out path */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#--------------------------------------------------------------------------------- | |
.SUFFIXES: | |
#--------------------------------------------------------------------------------- | |
ifeq ($(strip $(DEVKITPRO)),) | |
$(error "Please set DEVKITPRO in your environment. export DEVKITPRO=<path to>/devkitpro") | |
endif | |
TOPDIR ?= $(CURDIR) | |
include $(DEVKITPRO)/libnx/switch_rules |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Include the most common headers from the C standard library | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <stdarg.h> | |
// Include the main libnx system header, for Switch development | |
#include <switch.h> | |
// Size of the inner heap (adjust as necessary). |