diff options
| author | 2021-06-15 03:35:43 -0400 | |
|---|---|---|
| committer | 2021-06-16 01:46:45 -0400 | |
| commit | e4318a191457f5e46eca20060c8ebcab3e6758eb (patch) | |
| tree | ccc04b267629c6767de9295ac76361c281ddea3e /src | |
| parent | spl: Add the general SPL interface (diff) | |
| download | yuzu-e4318a191457f5e46eca20060c8ebcab3e6758eb.tar.gz yuzu-e4318a191457f5e46eca20060c8ebcab3e6758eb.tar.xz yuzu-e4318a191457f5e46eca20060c8ebcab3e6758eb.zip | |
hle: api_version: Add HLE API version constants
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/CMakeLists.txt | 1 | ||||
| -rw-r--r-- | src/core/file_sys/system_archive/system_version.cpp | 48 | ||||
| -rw-r--r-- | src/core/hle/api_version.h | 38 |
3 files changed, 54 insertions, 33 deletions
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index ab60841d5..83b5b7676 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt | |||
| @@ -139,6 +139,7 @@ add_library(core STATIC | |||
| 139 | frontend/input.h | 139 | frontend/input.h |
| 140 | hardware_interrupt_manager.cpp | 140 | hardware_interrupt_manager.cpp |
| 141 | hardware_interrupt_manager.h | 141 | hardware_interrupt_manager.h |
| 142 | hle/api_version.h | ||
| 142 | hle/ipc.h | 143 | hle/ipc.h |
| 143 | hle/ipc_helpers.h | 144 | hle/ipc_helpers.h |
| 144 | hle/kernel/board/nintendo/nx/k_system_control.cpp | 145 | hle/kernel/board/nintendo/nx/k_system_control.cpp |
diff --git a/src/core/file_sys/system_archive/system_version.cpp b/src/core/file_sys/system_archive/system_version.cpp index 54704105b..9b76d007e 100644 --- a/src/core/file_sys/system_archive/system_version.cpp +++ b/src/core/file_sys/system_archive/system_version.cpp | |||
| @@ -4,47 +4,29 @@ | |||
| 4 | 4 | ||
| 5 | #include "core/file_sys/system_archive/system_version.h" | 5 | #include "core/file_sys/system_archive/system_version.h" |
| 6 | #include "core/file_sys/vfs_vector.h" | 6 | #include "core/file_sys/vfs_vector.h" |
| 7 | #include "core/hle/api_version.h" | ||
| 7 | 8 | ||
| 8 | namespace FileSys::SystemArchive { | 9 | namespace FileSys::SystemArchive { |
| 9 | 10 | ||
| 10 | namespace SystemVersionData { | ||
| 11 | |||
| 12 | // This section should reflect the best system version to describe yuzu's HLE api. | ||
| 13 | // TODO(DarkLordZach): Update when HLE gets better. | ||
| 14 | |||
| 15 | constexpr u8 VERSION_MAJOR = 11; | ||
| 16 | constexpr u8 VERSION_MINOR = 0; | ||
| 17 | constexpr u8 VERSION_MICRO = 1; | ||
| 18 | |||
| 19 | constexpr u8 REVISION_MAJOR = 1; | ||
| 20 | constexpr u8 REVISION_MINOR = 0; | ||
| 21 | |||
| 22 | constexpr char PLATFORM_STRING[] = "NX"; | ||
| 23 | constexpr char VERSION_HASH[] = "69103fcb2004dace877094c2f8c29e6113be5dbf"; | ||
| 24 | constexpr char DISPLAY_VERSION[] = "11.0.1"; | ||
| 25 | constexpr char DISPLAY_TITLE[] = "NintendoSDK Firmware for NX 11.0.1-1.0"; | ||
| 26 | |||
| 27 | } // namespace SystemVersionData | ||
| 28 | |||
| 29 | std::string GetLongDisplayVersion() { | 11 | std::string GetLongDisplayVersion() { |
| 30 | return SystemVersionData::DISPLAY_TITLE; | 12 | return HLE::ApiVersion::DISPLAY_TITLE; |
| 31 | } | 13 | } |
| 32 | 14 | ||
| 33 | VirtualDir SystemVersion() { | 15 | VirtualDir SystemVersion() { |
| 34 | VirtualFile file = std::make_shared<VectorVfsFile>(std::vector<u8>(0x100), "file"); | 16 | VirtualFile file = std::make_shared<VectorVfsFile>(std::vector<u8>(0x100), "file"); |
| 35 | file->WriteObject(SystemVersionData::VERSION_MAJOR, 0); | 17 | file->WriteObject(HLE::ApiVersion::HOS_VERSION_MAJOR, 0); |
| 36 | file->WriteObject(SystemVersionData::VERSION_MINOR, 1); | 18 | file->WriteObject(HLE::ApiVersion::HOS_VERSION_MINOR, 1); |
| 37 | file->WriteObject(SystemVersionData::VERSION_MICRO, 2); | 19 | file->WriteObject(HLE::ApiVersion::HOS_VERSION_MICRO, 2); |
| 38 | file->WriteObject(SystemVersionData::REVISION_MAJOR, 4); | 20 | file->WriteObject(HLE::ApiVersion::SDK_REVISION_MAJOR, 4); |
| 39 | file->WriteObject(SystemVersionData::REVISION_MINOR, 5); | 21 | file->WriteObject(HLE::ApiVersion::SDK_REVISION_MINOR, 5); |
| 40 | file->WriteArray(SystemVersionData::PLATFORM_STRING, | 22 | file->WriteArray(HLE::ApiVersion::PLATFORM_STRING, |
| 41 | std::min<u64>(sizeof(SystemVersionData::PLATFORM_STRING), 0x20ULL), 0x8); | 23 | std::min<u64>(sizeof(HLE::ApiVersion::PLATFORM_STRING), 0x20ULL), 0x8); |
| 42 | file->WriteArray(SystemVersionData::VERSION_HASH, | 24 | file->WriteArray(HLE::ApiVersion::VERSION_HASH, |
| 43 | std::min<u64>(sizeof(SystemVersionData::VERSION_HASH), 0x40ULL), 0x28); | 25 | std::min<u64>(sizeof(HLE::ApiVersion::VERSION_HASH), 0x40ULL), 0x28); |
| 44 | file->WriteArray(SystemVersionData::DISPLAY_VERSION, | 26 | file->WriteArray(HLE::ApiVersion::DISPLAY_VERSION, |
| 45 | std::min<u64>(sizeof(SystemVersionData::DISPLAY_VERSION), 0x18ULL), 0x68); | 27 | std::min<u64>(sizeof(HLE::ApiVersion::DISPLAY_VERSION), 0x18ULL), 0x68); |
| 46 | file->WriteArray(SystemVersionData::DISPLAY_TITLE, | 28 | file->WriteArray(HLE::ApiVersion::DISPLAY_TITLE, |
| 47 | std::min<u64>(sizeof(SystemVersionData::DISPLAY_TITLE), 0x80ULL), 0x80); | 29 | std::min<u64>(sizeof(HLE::ApiVersion::DISPLAY_TITLE), 0x80ULL), 0x80); |
| 48 | return std::make_shared<VectorVfsDirectory>(std::vector<VirtualFile>{file}, | 30 | return std::make_shared<VectorVfsDirectory>(std::vector<VirtualFile>{file}, |
| 49 | std::vector<VirtualDir>{}, "data"); | 31 | std::vector<VirtualDir>{}, "data"); |
| 50 | } | 32 | } |
diff --git a/src/core/hle/api_version.h b/src/core/hle/api_version.h new file mode 100644 index 000000000..811732179 --- /dev/null +++ b/src/core/hle/api_version.h | |||
| @@ -0,0 +1,38 @@ | |||
| 1 | // Copyright 2021 yuzu Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #include "common/common_types.h" | ||
| 6 | |||
| 7 | // This file contains yuzu's HLE API version constants. | ||
| 8 | |||
| 9 | namespace HLE::ApiVersion { | ||
| 10 | |||
| 11 | // Horizon OS version constants. | ||
| 12 | |||
| 13 | constexpr u8 HOS_VERSION_MAJOR = 11; | ||
| 14 | constexpr u8 HOS_VERSION_MINOR = 0; | ||
| 15 | constexpr u8 HOS_VERSION_MICRO = 1; | ||
| 16 | |||
| 17 | // NintendoSDK version constants. | ||
| 18 | |||
| 19 | constexpr u8 SDK_REVISION_MAJOR = 1; | ||
| 20 | constexpr u8 SDK_REVISION_MINOR = 0; | ||
| 21 | |||
| 22 | constexpr char PLATFORM_STRING[] = "NX"; | ||
| 23 | constexpr char VERSION_HASH[] = "69103fcb2004dace877094c2f8c29e6113be5dbf"; | ||
| 24 | constexpr char DISPLAY_VERSION[] = "11.0.1"; | ||
| 25 | constexpr char DISPLAY_TITLE[] = "NintendoSDK Firmware for NX 11.0.1-1.0"; | ||
| 26 | |||
| 27 | // Atmosphere version constants. | ||
| 28 | |||
| 29 | constexpr u8 ATMOSPHERE_RELEASE_VERSION_MAJOR = 0; | ||
| 30 | constexpr u8 ATMOSPHERE_RELEASE_VERSION_MINOR = 19; | ||
| 31 | constexpr u8 ATMOSPHERE_RELEASE_VERSION_MICRO = 4; | ||
| 32 | |||
| 33 | constexpr u32 GetTargetFirmware() { | ||
| 34 | return u32{HOS_VERSION_MAJOR} << 24 | u32{HOS_VERSION_MINOR} << 16 | | ||
| 35 | u32{HOS_VERSION_MICRO} << 8 | 0U; | ||
| 36 | } | ||
| 37 | |||
| 38 | } // namespace HLE::ApiVersion | ||