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;