Compare commits

..

3 Commits

Author SHA1 Message Date
yuzubot
8c40bfcd89 Android 204 2024-01-22 17:14:17 +00:00
yuzubot
9199ea8aed Merge yuzu-emu#12749 2024-01-22 17:14:17 +00:00
yuzubot
12209cd2ee Merge yuzu-emu#12499 2024-01-22 17:14:17 +00:00
9 changed files with 17 additions and 40 deletions

View File

@@ -1,6 +1,6 @@
| Pull Request | Commit | Title | Author | Merged? |
|----|----|----|----|----|
| [12499](https://github.com/yuzu-emu/yuzu-android//pull/12499) | [`fc30a84fc`](https://github.com/yuzu-emu/yuzu-android//pull/12499/files) | Rework time services | [Kelebek1](https://github.com/Kelebek1/) | Yes |
| [12499](https://github.com/yuzu-emu/yuzu-android//pull/12499) | [`31f015adc`](https://github.com/yuzu-emu/yuzu-android//pull/12499/files) | Rework time services | [Kelebek1](https://github.com/Kelebek1/) | Yes |
| [12749](https://github.com/yuzu-emu/yuzu-android//pull/12749) | [`e3171486d`](https://github.com/yuzu-emu/yuzu-android//pull/12749/files) | general: workarounds for SMMU syncing issues | [liamwhite](https://github.com/liamwhite/) | Yes |

View File

@@ -31,8 +31,9 @@ public:
buffer.resize(0);
size_t index = 0;
const auto add_value = [&](u32 value) {
buffer.resize(index + 1);
buffer[index++] = value;
buffer[index] = value;
index++;
buffer.resize(index);
};
u32 iter_entry = start_entry;

View File

@@ -67,29 +67,25 @@ constexpr std::array<SystemArchiveDescriptor, SYSTEM_ARCHIVE_COUNT> SYSTEM_ARCHI
}};
VirtualFile SynthesizeSystemArchive(const u64 title_id) {
if (title_id < SYSTEM_ARCHIVES.front().title_id || title_id > SYSTEM_ARCHIVES.back().title_id) {
if (title_id < SYSTEM_ARCHIVES.front().title_id || title_id > SYSTEM_ARCHIVES.back().title_id)
return nullptr;
}
const auto& desc = SYSTEM_ARCHIVES[title_id - SYSTEM_ARCHIVE_BASE_TITLE_ID];
LOG_INFO(Service_FS, "Synthesizing system archive '{}' (0x{:016X}).", desc.name, desc.title_id);
if (desc.supplier == nullptr) {
if (desc.supplier == nullptr)
return nullptr;
}
const auto dir = desc.supplier();
if (dir == nullptr) {
if (dir == nullptr)
return nullptr;
}
const auto romfs = CreateRomFS(dir);
if (romfs == nullptr) {
if (romfs == nullptr)
return nullptr;
}
LOG_INFO(Service_FS, " - System archive generation successful!");
return romfs;

View File

@@ -89,8 +89,7 @@ Service::PSC::Time::LocationName GetTimeZoneString(Service::PSC::Time::LocationN
std::min(configured_name.name.size(), configured_zone.size()));
}
ASSERT_MSG(IsTimeZoneBinaryValid(configured_name), "Invalid time zone {}!",
configured_name.name.data());
ASSERT_MSG(IsTimeZoneBinaryValid(configured_name), "Invalid time zone!");
return configured_name;
}

View File

@@ -61,16 +61,6 @@ Result MountTimeZoneBinary(Core::System& system) {
g_time_zone_binary_romfs = FileSys::ExtractRomFS(nca->GetRomFS());
}
if (g_time_zone_binary_romfs) {
// Validate that the romfs is readable, using invalid firmware keys can cause this to get
// set but the files to be garbage. In that case, we want to hit the next path and
// synthesise them instead.
Service::PSC::Time::LocationName name{"Etc/GMT"};
if (!IsTimeZoneBinaryValid(name)) {
ResetTimeZoneBinary();
}
}
if (!g_time_zone_binary_romfs) {
g_time_zone_binary_romfs = FileSys::ExtractRomFS(
FileSys::SystemArchive::SynthesizeSystemArchive(TimeZoneBinaryId));
@@ -112,7 +102,6 @@ bool IsTimeZoneBinaryValid(Service::PSC::Time::LocationName& name) {
auto vfs_file{g_time_zone_binary_romfs->GetFileRelative(path)};
if (!vfs_file) {
LOG_INFO(Service_Time, "Could not find timezone file {}", path);
return false;
}
return vfs_file->GetSize() != 0;

View File

@@ -4,7 +4,6 @@
#include "common/logging/log.h"
#include "common/scope_exit.h"
#include "common/string_util.h"
#include "core/core.h"
#include "core/hle/kernel/k_event.h"
#include "core/hle/kernel/k_process.h"
@@ -30,7 +29,7 @@ void NVDRV::Open(HLERequestContext& ctx) {
}
const auto& buffer = ctx.ReadBuffer();
const std::string device_name(Common::StringFromBuffer(buffer));
const std::string device_name(buffer.begin(), buffer.end());
if (device_name == "/dev/nvhost-prof-gpu") {
rb.Push<DeviceFD>(0);

View File

@@ -709,12 +709,12 @@ void ISystemSettingsServer::GetSettingsItemValueSize(HLERequestContext& ctx) {
// The category of the setting. This corresponds to the top-level keys of
// system_settings.ini.
const auto setting_category_buf{ctx.ReadBuffer(0)};
const std::string setting_category{Common::StringFromBuffer(setting_category_buf)};
const std::string setting_category{setting_category_buf.begin(), setting_category_buf.end()};
// The name of the setting. This corresponds to the second-level keys of
// system_settings.ini.
const auto setting_name_buf{ctx.ReadBuffer(1)};
const std::string setting_name{Common::StringFromBuffer(setting_name_buf)};
const std::string setting_name{setting_name_buf.begin(), setting_name_buf.end()};
auto settings{GetSettings()};
u64 response_size{0};
@@ -732,12 +732,12 @@ void ISystemSettingsServer::GetSettingsItemValue(HLERequestContext& ctx) {
// The category of the setting. This corresponds to the top-level keys of
// system_settings.ini.
const auto setting_category_buf{ctx.ReadBuffer(0)};
const std::string setting_category{Common::StringFromBuffer(setting_category_buf)};
const std::string setting_category{setting_category_buf.begin(), setting_category_buf.end()};
// The name of the setting. This corresponds to the second-level keys of
// system_settings.ini.
const auto setting_name_buf{ctx.ReadBuffer(1)};
const std::string setting_name{Common::StringFromBuffer(setting_name_buf)};
const std::string setting_name{setting_name_buf.begin(), setting_name_buf.end()};
std::vector<u8> value;
auto response = GetSettingsItemValue(value, setting_category, setting_name);

View File

@@ -15,7 +15,6 @@
#include "common/logging/log.h"
#include "common/math_util.h"
#include "common/settings.h"
#include "common/string_util.h"
#include "common/swap.h"
#include "core/core_timing.h"
#include "core/hle/kernel/k_readable_event.h"
@@ -695,7 +694,9 @@ private:
void OpenLayer(HLERequestContext& ctx) {
IPC::RequestParser rp{ctx};
const auto name_buf = rp.PopRaw<std::array<u8, 0x40>>();
const std::string display_name(Common::StringFromBuffer(name_buf));
const auto end = std::find(name_buf.begin(), name_buf.end(), '\0');
const std::string display_name(name_buf.begin(), end);
const u64 layer_id = rp.Pop<u64>();
const u64 aruid = rp.Pop<u64>();

View File

@@ -10,7 +10,6 @@
#include "core/file_sys/nca_metadata.h"
#include "core/file_sys/patch_manager.h"
#include "core/file_sys/registered_cache.h"
#include "core/file_sys/romfs_factory.h"
#include "core/file_sys/submission_package.h"
#include "core/hle/kernel/k_process.h"
#include "core/hle/service/filesystem/filesystem.h"
@@ -110,13 +109,6 @@ AppLoader_NSP::LoadResult AppLoader_NSP::Load(Kernel::KProcess& process, Core::S
return result;
}
if (nsp->IsExtractedType()) {
system.GetFileSystemController().RegisterProcess(
process.GetProcessId(), {},
std::make_shared<FileSys::RomFSFactory>(*this, system.GetContentProvider(),
system.GetFileSystemController()));
}
FileSys::VirtualFile update_raw;
if (ReadUpdateRaw(update_raw) == ResultStatus::Success && update_raw != nullptr) {
system.GetFileSystemController().SetPackedUpdate(process.GetProcessId(),