mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2024-11-27 06:12:15 +00:00
Merge branch 'master' of github.com:Atmosphere-NX/Atmosphere
This commit is contained in:
commit
6ff90d8d30
6 changed files with 38 additions and 5 deletions
|
@ -9,6 +9,7 @@
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#include "masterkey.h"
|
#include "masterkey.h"
|
||||||
#include "exocfg.h"
|
#include "exocfg.h"
|
||||||
|
#include "version.h"
|
||||||
|
|
||||||
static bool g_battery_profile = false;
|
static bool g_battery_profile = false;
|
||||||
|
|
||||||
|
@ -132,6 +133,10 @@ uint32_t configitem_get(ConfigItem item, uint64_t *p_outvalue) {
|
||||||
result = 2;
|
result = 2;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case CONFIGITEM_EXOSPHERE_VERSION:
|
||||||
|
/* UNOFFICIAL: Gets information about the current exosphere version. */
|
||||||
|
*p_outvalue = (EXOSPHERE_RELEASE_VERSION_MAJOR << 24) | (EXOSPHERE_RELEASE_VERSION_MINOR << 16) | (exosphere_get_target_firmware() << 8) | (mkey_get_revision() << 0);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
result = 2;
|
result = 2;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -21,7 +21,10 @@ typedef enum {
|
||||||
CONFIGITEM_ODM4BIT10_4X = 14,
|
CONFIGITEM_ODM4BIT10_4X = 14,
|
||||||
CONFIGITEM_NEWHARDWARETYPE_5X = 15,
|
CONFIGITEM_NEWHARDWARETYPE_5X = 15,
|
||||||
CONFIGITEM_NEWKEYGENERATION_5X = 16,
|
CONFIGITEM_NEWKEYGENERATION_5X = 16,
|
||||||
CONFIGITEM_PACKAGE2HASH_5X = 17
|
CONFIGITEM_PACKAGE2HASH_5X = 17,
|
||||||
|
|
||||||
|
/* These are unofficial, for usage by Exosphere. */
|
||||||
|
CONFIGITEM_EXOSPHERE_VERSION = 65000
|
||||||
} ConfigItem;
|
} ConfigItem;
|
||||||
|
|
||||||
uint32_t configitem_set(ConfigItem item, uint64_t value);
|
uint32_t configitem_set(ConfigItem item, uint64_t value);
|
||||||
|
|
7
exosphere/src/version.h
Normal file
7
exosphere/src/version.h
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
#ifndef EXOSPHERE_VERSION_H
|
||||||
|
#define EXOSPHERE_VERSION_H
|
||||||
|
|
||||||
|
#define EXOSPHERE_RELEASE_VERSION_MAJOR 0
|
||||||
|
#define EXOSPHERE_RELEASE_VERSION_MINOR 1
|
||||||
|
|
||||||
|
#endif
|
|
@ -63,6 +63,18 @@ void __appInit(void) {
|
||||||
if (R_FAILED(rc)) {
|
if (R_FAILED(rc)) {
|
||||||
fatalSimple(0xCAFE << 4 | 2);
|
fatalSimple(0xCAFE << 4 | 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rc = splInitialize();
|
||||||
|
if (R_FAILED(rc)) {
|
||||||
|
fatalSimple(0xCAFE << 4 | 3);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Check for exosphere API compatibility. */
|
||||||
|
u64 exosphere_cfg;
|
||||||
|
if (R_FAILED(splGetConfig((SplConfigItem)65000, &exosphere_cfg))) {
|
||||||
|
fatalSimple(0xCAFE << 4 | 0xFF);
|
||||||
|
/* TODO: Does Loader need to know about target firmware/master key revision? If so, extract from exosphere_cfg. */
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void __appExit(void) {
|
void __appExit(void) {
|
||||||
|
|
|
@ -70,13 +70,19 @@ void __appInit(void) {
|
||||||
|
|
||||||
rc = smManagerInitialize();
|
rc = smManagerInitialize();
|
||||||
if (R_FAILED(rc)) {
|
if (R_FAILED(rc)) {
|
||||||
fatalSimple(0xCAFE << 4 | 4);
|
fatalSimple(0xCAFE << 4 | 5);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
rc = splInitialize();
|
rc = splInitialize();
|
||||||
if (R_FAILED(rc)) {
|
if (R_FAILED(rc)) {
|
||||||
fatalSimple(0xCAFE << 4 | 5);
|
fatalSimple(0xCAFE << 4 | 6);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Check for exosphere API compatibility. */
|
||||||
|
u64 exosphere_cfg;
|
||||||
|
if (R_FAILED(splGetConfig((SplConfigItem)65000, &exosphere_cfg))) {
|
||||||
|
fatalSimple(0xCAFE << 4 | 0xFF);
|
||||||
|
/* TODO: Does PM need to know about target firmware/master key revision? If so, extract from exosphere_cfg. */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,7 @@ void __libnx_initheap(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void __appInit(void) {
|
void __appInit(void) {
|
||||||
/* We must do nothing here, because we are sm. */
|
/* We must do no setup here, because we are sm. */
|
||||||
}
|
}
|
||||||
|
|
||||||
void __appExit(void) {
|
void __appExit(void) {
|
||||||
|
|
Loading…
Reference in a new issue