atmosphere: extract API version management to common folder

This commit is contained in:
Michael Scire
2018-10-16 17:54:50 -07:00
parent 412511f32a
commit 6711cd93a8
19 changed files with 92 additions and 57 deletions

View File

@@ -15,6 +15,7 @@
*/
#include <stdint.h>
#include <atmosphere/version.h>
#include "bootconfig.h"
#include "configitem.h"
@@ -25,7 +26,6 @@
#include "utils.h"
#include "masterkey.h"
#include "exocfg.h"
#include "version.h"
static bool g_battery_profile = false;
@@ -151,11 +151,11 @@ uint32_t configitem_get(ConfigItem item, uint64_t *p_outvalue) {
break;
case CONFIGITEM_EXOSPHERE_VERSION:
/* UNOFFICIAL: Gets information about the current exosphere version. */
*p_outvalue = ((ATMOSPHERE_RELEASE_VERSION_MAJOR & 0xFF) << 24) |
((ATMOSPHERE_RELEASE_VERSION_MINOR & 0xFF) << 16) |
((ATMOSPHERE_RELEASE_VERSION_MICRO & 0x3F) << 10) |
((exosphere_get_target_firmware() & 0x1F) << 6) |
((mkey_get_revision() & 0x1F) << 0);
*p_outvalue = ((uint64_t)(ATMOSPHERE_RELEASE_VERSION_MAJOR & 0xFF) << 32ull) |
((uint64_t)(ATMOSPHERE_RELEASE_VERSION_MINOR & 0xFF) << 24ull) |
((uint64_t)(ATMOSPHERE_RELEASE_VERSION_MICRO & 0xFF) << 16ull) |
((uint64_t)(exosphere_get_target_firmware() & 0xFF) << 8ull) |
((uint64_t)(mkey_get_revision() & 0xFF) << 0ull);
break;
default:
result = 2;

View File

@@ -1,24 +0,0 @@
/*
* 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/>.
*/
#ifndef EXOSPHERE_VERSION_H
#define EXOSPHERE_VERSION_H
#define ATMOSPHERE_RELEASE_VERSION_MAJOR 0
#define ATMOSPHERE_RELEASE_VERSION_MINOR 7
#define ATMOSPHERE_RELEASE_VERSION_MICRO 0
#endif