diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/file_sys/errors.h | 3 | ||||
| -rw-r--r-- | src/core/file_sys/system_archive/system_version.cpp | 20 | ||||
| -rw-r--r-- | src/core/file_sys/system_archive/system_version.h | 3 | ||||
| -rw-r--r-- | src/core/hle/service/set/set_sys.cpp | 18 |
4 files changed, 25 insertions, 19 deletions
diff --git a/src/core/file_sys/errors.h b/src/core/file_sys/errors.h index e4a4ee4ab..bb4654366 100644 --- a/src/core/file_sys/errors.h +++ b/src/core/file_sys/errors.h | |||
| @@ -11,6 +11,9 @@ namespace FileSys { | |||
| 11 | constexpr ResultCode ERROR_PATH_NOT_FOUND{ErrorModule::FS, 1}; | 11 | constexpr ResultCode ERROR_PATH_NOT_FOUND{ErrorModule::FS, 1}; |
| 12 | constexpr ResultCode ERROR_ENTITY_NOT_FOUND{ErrorModule::FS, 1002}; | 12 | constexpr ResultCode ERROR_ENTITY_NOT_FOUND{ErrorModule::FS, 1002}; |
| 13 | constexpr ResultCode ERROR_SD_CARD_NOT_FOUND{ErrorModule::FS, 2001}; | 13 | constexpr ResultCode ERROR_SD_CARD_NOT_FOUND{ErrorModule::FS, 2001}; |
| 14 | constexpr ResultCode ERROR_OUT_OF_BOUNDS{ErrorModule::FS, 3005}; | ||
| 15 | constexpr ResultCode ERROR_FAILED_MOUNT_ARCHIVE{ErrorModule::FS, 3223}; | ||
| 16 | constexpr ResultCode ERROR_INVALID_ARGUMENT{ErrorModule::FS, 6001}; | ||
| 14 | constexpr ResultCode ERROR_INVALID_OFFSET{ErrorModule::FS, 6061}; | 17 | constexpr ResultCode ERROR_INVALID_OFFSET{ErrorModule::FS, 6061}; |
| 15 | constexpr ResultCode ERROR_INVALID_SIZE{ErrorModule::FS, 6062}; | 18 | constexpr ResultCode ERROR_INVALID_SIZE{ErrorModule::FS, 6062}; |
| 16 | 19 | ||
diff --git a/src/core/file_sys/system_archive/system_version.cpp b/src/core/file_sys/system_archive/system_version.cpp index 52df10f55..6e22f97b0 100644 --- a/src/core/file_sys/system_archive/system_version.cpp +++ b/src/core/file_sys/system_archive/system_version.cpp | |||
| @@ -16,16 +16,20 @@ constexpr u8 VERSION_MAJOR = 5; | |||
| 16 | constexpr u8 VERSION_MINOR = 1; | 16 | constexpr u8 VERSION_MINOR = 1; |
| 17 | constexpr u8 VERSION_MICRO = 0; | 17 | constexpr u8 VERSION_MICRO = 0; |
| 18 | 18 | ||
| 19 | constexpr u8 REVISION_MAJOR = 0; | 19 | constexpr u8 REVISION_MAJOR = 3; |
| 20 | constexpr u8 REVISION_MINOR = 0; | 20 | constexpr u8 REVISION_MINOR = 0; |
| 21 | 21 | ||
| 22 | constexpr char PLATFORM_STRING[] = "YUZU"; | 22 | constexpr char PLATFORM_STRING[] = "NX"; |
| 23 | constexpr char VERSION_HASH[] = ""; | 23 | constexpr char VERSION_HASH[] = "23f9df53e25709d756e0c76effcb2473bd3447dd"; |
| 24 | constexpr char DISPLAY_VERSION[] = "5.1.0"; | 24 | constexpr char DISPLAY_VERSION[] = "5.1.0"; |
| 25 | constexpr char DISPLAY_TITLE[] = "YuzuEmulated Firmware for NX 5.1.0-0.0"; | 25 | constexpr char DISPLAY_TITLE[] = "NintendoSDK Firmware for NX 5.1.0-3.0"; |
| 26 | 26 | ||
| 27 | } // namespace SystemVersionData | 27 | } // namespace SystemVersionData |
| 28 | 28 | ||
| 29 | std::string GetLongDisplayVersion() { | ||
| 30 | return SystemVersionData::DISPLAY_TITLE; | ||
| 31 | } | ||
| 32 | |||
| 29 | VirtualDir SystemVersion() { | 33 | VirtualDir SystemVersion() { |
| 30 | VirtualFile file = std::make_shared<VectorVfsFile>(std::vector<u8>(0x100), "file"); | 34 | VirtualFile file = std::make_shared<VectorVfsFile>(std::vector<u8>(0x100), "file"); |
| 31 | file->WriteObject(SystemVersionData::VERSION_MAJOR, 0); | 35 | file->WriteObject(SystemVersionData::VERSION_MAJOR, 0); |
| @@ -34,13 +38,13 @@ VirtualDir SystemVersion() { | |||
| 34 | file->WriteObject(SystemVersionData::REVISION_MAJOR, 4); | 38 | file->WriteObject(SystemVersionData::REVISION_MAJOR, 4); |
| 35 | file->WriteObject(SystemVersionData::REVISION_MINOR, 5); | 39 | file->WriteObject(SystemVersionData::REVISION_MINOR, 5); |
| 36 | file->WriteArray(SystemVersionData::PLATFORM_STRING, | 40 | file->WriteArray(SystemVersionData::PLATFORM_STRING, |
| 37 | std::min<u64>(sizeof(SystemVersionData::PLATFORM_STRING), 0x20ull), 0x8); | 41 | std::min<u64>(sizeof(SystemVersionData::PLATFORM_STRING), 0x20ULL), 0x8); |
| 38 | file->WriteArray(SystemVersionData::VERSION_HASH, | 42 | file->WriteArray(SystemVersionData::VERSION_HASH, |
| 39 | std::min<u64>(sizeof(SystemVersionData::VERSION_HASH), 0x40ull), 0x28); | 43 | std::min<u64>(sizeof(SystemVersionData::VERSION_HASH), 0x40ULL), 0x28); |
| 40 | file->WriteArray(SystemVersionData::DISPLAY_VERSION, | 44 | file->WriteArray(SystemVersionData::DISPLAY_VERSION, |
| 41 | std::min<u64>(sizeof(SystemVersionData::DISPLAY_VERSION), 0x18ull), 0x68); | 45 | std::min<u64>(sizeof(SystemVersionData::DISPLAY_VERSION), 0x18ULL), 0x68); |
| 42 | file->WriteArray(SystemVersionData::DISPLAY_TITLE, | 46 | file->WriteArray(SystemVersionData::DISPLAY_TITLE, |
| 43 | std::min<u64>(sizeof(SystemVersionData::DISPLAY_TITLE), 0x80ull), 0x80); | 47 | std::min<u64>(sizeof(SystemVersionData::DISPLAY_TITLE), 0x80ULL), 0x80); |
| 44 | return std::make_shared<VectorVfsDirectory>(std::vector<VirtualFile>{file}, | 48 | return std::make_shared<VectorVfsDirectory>(std::vector<VirtualFile>{file}, |
| 45 | std::vector<VirtualDir>{}, "data"); | 49 | std::vector<VirtualDir>{}, "data"); |
| 46 | } | 50 | } |
diff --git a/src/core/file_sys/system_archive/system_version.h b/src/core/file_sys/system_archive/system_version.h index 9fb794b36..deed79b26 100644 --- a/src/core/file_sys/system_archive/system_version.h +++ b/src/core/file_sys/system_archive/system_version.h | |||
| @@ -4,10 +4,13 @@ | |||
| 4 | 4 | ||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| 7 | #include <string> | ||
| 7 | #include "core/file_sys/vfs_types.h" | 8 | #include "core/file_sys/vfs_types.h" |
| 8 | 9 | ||
| 9 | namespace FileSys::SystemArchive { | 10 | namespace FileSys::SystemArchive { |
| 10 | 11 | ||
| 12 | std::string GetLongDisplayVersion(); | ||
| 13 | |||
| 11 | VirtualDir SystemVersion(); | 14 | VirtualDir SystemVersion(); |
| 12 | 15 | ||
| 13 | } // namespace FileSys::SystemArchive | 16 | } // namespace FileSys::SystemArchive |
diff --git a/src/core/hle/service/set/set_sys.cpp b/src/core/hle/service/set/set_sys.cpp index 225062c0f..917b4e3a5 100644 --- a/src/core/hle/service/set/set_sys.cpp +++ b/src/core/hle/service/set/set_sys.cpp | |||
| @@ -4,6 +4,7 @@ | |||
| 4 | 4 | ||
| 5 | #include "common/assert.h" | 5 | #include "common/assert.h" |
| 6 | #include "common/logging/log.h" | 6 | #include "common/logging/log.h" |
| 7 | #include "core/file_sys/errors.h" | ||
| 7 | #include "core/file_sys/system_archive/system_version.h" | 8 | #include "core/file_sys/system_archive/system_version.h" |
| 8 | #include "core/hle/ipc_helpers.h" | 9 | #include "core/hle/ipc_helpers.h" |
| 9 | #include "core/hle/kernel/client_port.h" | 10 | #include "core/hle/kernel/client_port.h" |
| @@ -14,10 +15,6 @@ namespace Service::Set { | |||
| 14 | 15 | ||
| 15 | constexpr u64 SYSTEM_VERSION_FILE_MINOR_REVISION_OFFSET = 0x05; | 16 | constexpr u64 SYSTEM_VERSION_FILE_MINOR_REVISION_OFFSET = 0x05; |
| 16 | 17 | ||
| 17 | constexpr ResultCode ERROR_FAILED_MOUNT_ARCHIVE(ErrorModule::FS, 3223); | ||
| 18 | constexpr ResultCode ERROR_READ_TOO_LARGE(ErrorModule::FS, 3005); | ||
| 19 | constexpr ResultCode ERROR_INVALID_NAME(ErrorModule::FS, 6001); | ||
| 20 | |||
| 21 | enum class GetFirmwareVersionType { | 18 | enum class GetFirmwareVersionType { |
| 22 | Version1, | 19 | Version1, |
| 23 | Version2, | 20 | Version2, |
| @@ -25,9 +22,8 @@ enum class GetFirmwareVersionType { | |||
| 25 | 22 | ||
| 26 | namespace { | 23 | namespace { |
| 27 | void GetFirmwareVersionImpl(Kernel::HLERequestContext& ctx, GetFirmwareVersionType type) { | 24 | void GetFirmwareVersionImpl(Kernel::HLERequestContext& ctx, GetFirmwareVersionType type) { |
| 28 | LOG_WARNING( | 25 | LOG_WARNING(Service_SET, "called - Using hardcoded firmware version '{}'", |
| 29 | Service_SET, | 26 | FileSys::SystemArchive::GetLongDisplayVersion()); |
| 30 | "called - Using hardcoded firmware version 'YuzuEmulated Firmware for NX 5.1.0-0.0'"); | ||
| 31 | 27 | ||
| 32 | ASSERT_MSG(ctx.GetWriteBufferSize() == 0x100, | 28 | ASSERT_MSG(ctx.GetWriteBufferSize() == 0x100, |
| 33 | "FirmwareVersion output buffer must be 0x100 bytes in size!"); | 29 | "FirmwareVersion output buffer must be 0x100 bytes in size!"); |
| @@ -47,21 +43,21 @@ void GetFirmwareVersionImpl(Kernel::HLERequestContext& ctx, GetFirmwareVersionTy | |||
| 47 | 43 | ||
| 48 | if (archive == nullptr) { | 44 | if (archive == nullptr) { |
| 49 | early_exit_failure("The system version archive couldn't be synthesized.", | 45 | early_exit_failure("The system version archive couldn't be synthesized.", |
| 50 | ERROR_FAILED_MOUNT_ARCHIVE); | 46 | FileSys::ERROR_FAILED_MOUNT_ARCHIVE); |
| 51 | return; | 47 | return; |
| 52 | } | 48 | } |
| 53 | 49 | ||
| 54 | const auto ver_file = archive->GetFile("file"); | 50 | const auto ver_file = archive->GetFile("file"); |
| 55 | if (ver_file == nullptr) { | 51 | if (ver_file == nullptr) { |
| 56 | early_exit_failure("The system version archive didn't contain the file 'file'.", | 52 | early_exit_failure("The system version archive didn't contain the file 'file'.", |
| 57 | ERROR_INVALID_NAME); | 53 | FileSys::ERROR_INVALID_ARGUMENT); |
| 58 | return; | 54 | return; |
| 59 | } | 55 | } |
| 60 | 56 | ||
| 61 | auto data = ver_file->ReadAllBytes(); | 57 | auto data = ver_file->ReadAllBytes(); |
| 62 | if (data.size() != 0x100) { | 58 | if (data.size() != 0x100) { |
| 63 | early_exit_failure("The system version file 'file' was not the correct size.", | 59 | early_exit_failure("The system version file 'file' was not the correct size.", |
| 64 | ERROR_READ_TOO_LARGE); | 60 | FileSys::ERROR_OUT_OF_BOUNDS); |
| 65 | return; | 61 | return; |
| 66 | } | 62 | } |
| 67 | 63 | ||
| @@ -76,7 +72,7 @@ void GetFirmwareVersionImpl(Kernel::HLERequestContext& ctx, GetFirmwareVersionTy | |||
| 76 | IPC::ResponseBuilder rb{ctx, 2}; | 72 | IPC::ResponseBuilder rb{ctx, 2}; |
| 77 | rb.Push(RESULT_SUCCESS); | 73 | rb.Push(RESULT_SUCCESS); |
| 78 | } | 74 | } |
| 79 | } // namespace | 75 | } // Anonymous namespace |
| 80 | 76 | ||
| 81 | void SET_SYS::GetFirmwareVersion(Kernel::HLERequestContext& ctx) { | 77 | void SET_SYS::GetFirmwareVersion(Kernel::HLERequestContext& ctx) { |
| 82 | LOG_DEBUG(Service_SET, "called"); | 78 | LOG_DEBUG(Service_SET, "called"); |