mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-06-02 07:39:49 -04:00
erpt: reimplement the sysmodule (#875)
* erpt: reimplement the sysmodule * fatal: update for latest bindings * erpt: amend logic for culling orphan attachments
This commit is contained in:
parent
eca5ac01b8
commit
79b9e07ee9
117 changed files with 6716 additions and 59 deletions
|
@ -0,0 +1,68 @@
|
|||
/*
|
||||
* Copyright (c) 2018-2020 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/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include <vapours.hpp>
|
||||
#include <stratosphere/settings/settings_types.hpp>
|
||||
|
||||
namespace ams::settings::system {
|
||||
|
||||
struct alignas(4) FirmwareVersion {
|
||||
u8 major;
|
||||
u8 minor;
|
||||
u8 micro;
|
||||
u8 padding1;
|
||||
u8 revision_major;
|
||||
u8 revision_minor;
|
||||
u8 padding2;
|
||||
u8 padding3;
|
||||
char platform[0x20];
|
||||
char revision[0x40];
|
||||
char display_version[0x18];
|
||||
char display_name[0x80];
|
||||
|
||||
constexpr int GetComparableVersion() const {
|
||||
return (static_cast<int>(major) << 16) | (static_cast<int>(minor) << 8) | (static_cast<int>(micro) << 0);
|
||||
}
|
||||
|
||||
constexpr friend bool operator==(const FirmwareVersion &lhs, const FirmwareVersion &rhs) {
|
||||
return lhs.GetComparableVersion() == rhs.GetComparableVersion();
|
||||
}
|
||||
|
||||
constexpr friend bool operator!=(const FirmwareVersion &lhs, const FirmwareVersion &rhs) {
|
||||
return lhs.GetComparableVersion() != rhs.GetComparableVersion();
|
||||
}
|
||||
|
||||
constexpr friend bool operator<=(const FirmwareVersion &lhs, const FirmwareVersion &rhs) {
|
||||
return lhs.GetComparableVersion() <= rhs.GetComparableVersion();
|
||||
}
|
||||
|
||||
constexpr friend bool operator>=(const FirmwareVersion &lhs, const FirmwareVersion &rhs) {
|
||||
return lhs.GetComparableVersion() >= rhs.GetComparableVersion();
|
||||
}
|
||||
|
||||
constexpr friend bool operator<(const FirmwareVersion &lhs, const FirmwareVersion &rhs) {
|
||||
return lhs.GetComparableVersion() < rhs.GetComparableVersion();
|
||||
}
|
||||
|
||||
constexpr friend bool operator>(const FirmwareVersion &lhs, const FirmwareVersion &rhs) {
|
||||
return lhs.GetComparableVersion() > rhs.GetComparableVersion();
|
||||
}
|
||||
};
|
||||
|
||||
void GetFirmwareVersion(FirmwareVersion *out);
|
||||
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
/*
|
||||
* Copyright (c) 2018-2020 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/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include <vapours.hpp>
|
||||
#include <stratosphere/settings/settings_types.hpp>
|
||||
|
||||
namespace ams::settings::system {
|
||||
|
||||
enum ProductModel {
|
||||
ProductModel_Invalid = 0,
|
||||
ProductModel_Nx = 1,
|
||||
};
|
||||
|
||||
ProductModel GetProductModel();
|
||||
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* Copyright (c) 2018-2020 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/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include <vapours.hpp>
|
||||
#include <stratosphere/settings/settings_types.hpp>
|
||||
|
||||
namespace ams::settings::system {
|
||||
|
||||
enum RegionCode {
|
||||
RegionCode_Japan = 0,
|
||||
RegionCode_Usa = 1,
|
||||
RegionCode_Europe = 2,
|
||||
RegionCode_Australia = 3,
|
||||
RegionCode_HongKongTaiwanKorea = 4,
|
||||
RegionCode_China = 5,
|
||||
};
|
||||
|
||||
void GetRegionCode(RegionCode *out);
|
||||
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
/*
|
||||
* Copyright (c) 2018-2020 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/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include <vapours.hpp>
|
||||
#include <stratosphere/settings/settings_types.hpp>
|
||||
|
||||
namespace ams::settings::system {
|
||||
|
||||
struct SerialNumber {
|
||||
char str[0x18];
|
||||
};
|
||||
|
||||
void GetSerialNumber(SerialNumber *out);
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue