This file contains 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 "scheduler.h" | |
#include <stdbool.h> | |
#include <assert.h> | |
#ifndef SCHEDULER_UNUSED | |
#define SCHEDULER_UNUSED(x) (void)(x) | |
#endif // SCHEDULER_UNUSED | |
// this is the value that events are set to when disabled | |
enum { SCHEDULER_DISABLE_VALUE = INT_MAX }; |
This file contains 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
/* | |
io_ezfo.c | |
Hardware Routines for reading the EZ Flash Omega filesystem | |
*/ | |
#include "io_ezfo.h" | |
#include <gba_dma.h> |
This file contains 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 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 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 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 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 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 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 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 */ |
NewerOlder