summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/file_sys/errors.h3
-rw-r--r--src/core/file_sys/system_archive/system_version.cpp20
-rw-r--r--src/core/file_sys/system_archive/system_version.h3
-rw-r--r--src/core/hle/service/set/set_sys.cpp18
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 {
11constexpr ResultCode ERROR_PATH_NOT_FOUND{ErrorModule::FS, 1}; 11constexpr ResultCode ERROR_PATH_NOT_FOUND{ErrorModule::FS, 1};
12constexpr ResultCode ERROR_ENTITY_NOT_FOUND{ErrorModule::FS, 1002}; 12constexpr ResultCode ERROR_ENTITY_NOT_FOUND{ErrorModule::FS, 1002};
13constexpr ResultCode ERROR_SD_CARD_NOT_FOUND{ErrorModule::FS, 2001}; 13constexpr ResultCode ERROR_SD_CARD_NOT_FOUND{ErrorModule::FS, 2001};
14constexpr ResultCode ERROR_OUT_OF_BOUNDS{ErrorModule::FS, 3005};
15constexpr ResultCode ERROR_FAILED_MOUNT_ARCHIVE{ErrorModule::FS, 3223};
16constexpr ResultCode ERROR_INVALID_ARGUMENT{ErrorModule::FS, 6001};
14constexpr ResultCode ERROR_INVALID_OFFSET{ErrorModule::FS, 6061}; 17constexpr ResultCode ERROR_INVALID_OFFSET{ErrorModule::FS, 6061};
15constexpr ResultCode ERROR_INVALID_SIZE{ErrorModule::FS, 6062}; 18constexpr 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;
16constexpr u8 VERSION_MINOR = 1; 16constexpr u8 VERSION_MINOR = 1;
17constexpr u8 VERSION_MICRO = 0; 17constexpr u8 VERSION_MICRO = 0;
18 18
19constexpr u8 REVISION_MAJOR = 0; 19constexpr u8 REVISION_MAJOR = 3;
20constexpr u8 REVISION_MINOR = 0; 20constexpr u8 REVISION_MINOR = 0;
21 21
22constexpr char PLATFORM_STRING[] = "YUZU"; 22constexpr char PLATFORM_STRING[] = "NX";
23constexpr char VERSION_HASH[] = ""; 23constexpr char VERSION_HASH[] = "23f9df53e25709d756e0c76effcb2473bd3447dd";
24constexpr char DISPLAY_VERSION[] = "5.1.0"; 24constexpr char DISPLAY_VERSION[] = "5.1.0";
25constexpr char DISPLAY_TITLE[] = "YuzuEmulated Firmware for NX 5.1.0-0.0"; 25constexpr char DISPLAY_TITLE[] = "NintendoSDK Firmware for NX 5.1.0-3.0";
26 26
27} // namespace SystemVersionData 27} // namespace SystemVersionData
28 28
29std::string GetLongDisplayVersion() {
30 return SystemVersionData::DISPLAY_TITLE;
31}
32
29VirtualDir SystemVersion() { 33VirtualDir 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
9namespace FileSys::SystemArchive { 10namespace FileSys::SystemArchive {
10 11
12std::string GetLongDisplayVersion();
13
11VirtualDir SystemVersion(); 14VirtualDir 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
15constexpr u64 SYSTEM_VERSION_FILE_MINOR_REVISION_OFFSET = 0x05; 16constexpr u64 SYSTEM_VERSION_FILE_MINOR_REVISION_OFFSET = 0x05;
16 17
17constexpr ResultCode ERROR_FAILED_MOUNT_ARCHIVE(ErrorModule::FS, 3223);
18constexpr ResultCode ERROR_READ_TOO_LARGE(ErrorModule::FS, 3005);
19constexpr ResultCode ERROR_INVALID_NAME(ErrorModule::FS, 6001);
20
21enum class GetFirmwareVersionType { 18enum class GetFirmwareVersionType {
22 Version1, 19 Version1,
23 Version2, 20 Version2,
@@ -25,9 +22,8 @@ enum class GetFirmwareVersionType {
25 22
26namespace { 23namespace {
27void GetFirmwareVersionImpl(Kernel::HLERequestContext& ctx, GetFirmwareVersionType type) { 24void 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
81void SET_SYS::GetFirmwareVersion(Kernel::HLERequestContext& ctx) { 77void SET_SYS::GetFirmwareVersion(Kernel::HLERequestContext& ctx) {
82 LOG_DEBUG(Service_SET, "called"); 78 LOG_DEBUG(Service_SET, "called");