2018-09-07 15:00:13 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2018 Atmosphère-NX
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms and conditions of the GNU General Public License,
|
|
|
|
* version 2, as published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope it will be useful, but WITHOUT
|
|
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
|
|
* more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2018-06-10 17:11:05 +00:00
|
|
|
#pragma once
|
|
|
|
#include <switch.h>
|
|
|
|
#include <stratosphere.hpp>
|
|
|
|
|
|
|
|
class Utils {
|
|
|
|
public:
|
2018-06-14 23:50:01 +00:00
|
|
|
static bool IsSdInitialized();
|
2018-06-10 17:11:05 +00:00
|
|
|
static Result OpenSdFile(const char *fn, int flags, FsFile *out);
|
2018-06-14 23:50:01 +00:00
|
|
|
static Result OpenSdFileForAtmosphere(u64 title_id, const char *fn, int flags, FsFile *out);
|
|
|
|
static Result OpenRomFSSdFile(u64 title_id, const char *fn, int flags, FsFile *out);
|
|
|
|
static Result OpenSdDir(const char *path, FsDir *out);
|
|
|
|
static Result OpenSdDirForAtmosphere(u64 title_id, const char *path, FsDir *out);
|
2018-11-04 20:45:29 +00:00
|
|
|
static Result OpenRomFSSdDir(u64 title_id, const char *path, FsDir *out);
|
2018-06-14 23:50:01 +00:00
|
|
|
|
|
|
|
static Result OpenRomFSFile(FsFileSystem *fs, u64 title_id, const char *fn, int flags, FsFile *out);
|
|
|
|
static Result OpenRomFSDir(FsFileSystem *fs, u64 title_id, const char *path, FsDir *out);
|
2018-07-28 03:15:06 +00:00
|
|
|
|
2018-11-04 20:45:29 +00:00
|
|
|
static bool HasSdRomfsContent(u64 title_id);
|
2018-07-28 19:29:54 +00:00
|
|
|
|
|
|
|
/* SD card Initialization + MitM detection. */
|
|
|
|
static void InitializeSdThreadFunc(void *args);
|
|
|
|
static bool HasSdMitMFlag(u64 tid);
|
2018-10-17 03:41:19 +00:00
|
|
|
static bool HasSdDisableMitMFlag(u64 tid);
|
2018-10-17 02:01:41 +00:00
|
|
|
|
|
|
|
|
|
|
|
static bool IsHidInitialized();
|
|
|
|
static void InitializeHidThreadFunc(void *args);
|
|
|
|
static Result GetKeysDown(u64 *keys);
|
|
|
|
static bool HasOverrideButton(u64 tid);
|
|
|
|
private:
|
2018-10-23 05:53:40 +00:00
|
|
|
static void RefreshConfiguration();
|
2018-06-10 17:11:05 +00:00
|
|
|
};
|