1
0
mirror of https://git.suyu.dev/suyu/suyu synced 2025-08-30 16:06:30 -05:00

Full rebrand

This commit is contained in:
JuanCStar
2024-03-08 09:06:48 +00:00
committed by Crimson Hawk
parent c445fa1e3e
commit 88b901a24e
427 changed files with 55946 additions and 56077 deletions

View File

@@ -1223,11 +1223,11 @@ else()
hle/service/ssl/ssl_backend_none.cpp)
endif()
if (YUZU_USE_PRECOMPILED_HEADERS)
if (SUYU_USE_PRECOMPILED_HEADERS)
target_precompile_headers(core PRIVATE precompiled_headers.h)
endif()
if (YUZU_ENABLE_LTO)
if (SUYU_ENABLE_LTO)
set_property(TARGET core PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
endif()

View File

@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project & 2024 suyu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include <cinttypes>
@@ -160,8 +160,8 @@ bool ArmNce::HandleGuestAccessFault(GuestContext* guest_ctx, void* raw_info, voi
// Try to handle an invalid access.
// TODO: handle accesses which split a page?
const Common::ProcessAddress addr =
(reinterpret_cast<u64>(info->si_addr) & ~Memory::YUZU_PAGEMASK);
if (guest_ctx->system->ApplicationMemory().InvalidateNCE(addr, Memory::YUZU_PAGESIZE)) {
(reinterpret_cast<u64>(info->si_addr) & ~Memory::SUYU_PAGEMASK);
if (guest_ctx->system->ApplicationMemory().InvalidateNCE(addr, Memory::SUYU_PAGESIZE)) {
// We handled the access successfully and are returning to guest code.
return true;
}

View File

@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project & 2024 suyu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include "common/arm64/native_clock.h"
@@ -213,7 +213,7 @@ bool Patcher::RelocateAndCopy(Common::ProcessAddress load_base,
}
size_t Patcher::GetSectionSize() const noexcept {
return Common::AlignUp(m_patch_instructions.size() * sizeof(u32), Core::Memory::YUZU_PAGESIZE);
return Common::AlignUp(m_patch_instructions.size() * sizeof(u32), Core::Memory::SUYU_PAGESIZE);
}
void Patcher::WriteLoadContext() {

View File

@@ -6,7 +6,7 @@
#include <array>
#include "common/common_types.h"
// This is to consolidate system-wide constants that are used by multiple components of yuzu.
// This is to consolidate system-wide constants that are used by multiple components of suyu.
// This is especially to prevent the case of something in frontend duplicating a constexpr array or
// directly including some service header for the sole purpose of data.
namespace Core::Constants {

View File

@@ -640,22 +640,22 @@ KeyManager::KeyManager() {
void KeyManager::ReloadKeys() {
// Initialize keys
const auto yuzu_keys_dir = Common::FS::GetSuyuPath(Common::FS::SuyuPath::KeysDir);
const auto suyu_keys_dir = Common::FS::GetSuyuPath(Common::FS::SuyuPath::KeysDir);
if (!Common::FS::CreateDir(yuzu_keys_dir)) {
if (!Common::FS::CreateDir(suyu_keys_dir)) {
LOG_ERROR(Core, "Failed to create the keys directory.");
}
if (Settings::values.use_dev_keys) {
dev_mode = true;
LoadFromFile(yuzu_keys_dir / "dev.keys", false);
LoadFromFile(suyu_keys_dir / "dev.keys", false);
} else {
dev_mode = false;
LoadFromFile(yuzu_keys_dir / "prod.keys", false);
LoadFromFile(suyu_keys_dir / "prod.keys", false);
}
LoadFromFile(yuzu_keys_dir / "title.keys", true);
LoadFromFile(yuzu_keys_dir / "console.keys", false);
LoadFromFile(suyu_keys_dir / "title.keys", true);
LoadFromFile(suyu_keys_dir / "console.keys", false);
}
static bool ValidCryptoRevisionString(std::string_view base, size_t begin, size_t length) {
@@ -861,17 +861,17 @@ void KeyManager::SetKey(S256KeyType id, Key256 key, u64 field1, u64 field2) {
}
bool KeyManager::KeyFileExists(bool title) {
const auto yuzu_keys_dir = Common::FS::GetSuyuPath(Common::FS::SuyuPath::KeysDir);
const auto suyu_keys_dir = Common::FS::GetSuyuPath(Common::FS::SuyuPath::KeysDir);
if (title) {
return Common::FS::Exists(yuzu_keys_dir / "title.keys");
return Common::FS::Exists(suyu_keys_dir / "title.keys");
}
if (Settings::values.use_dev_keys) {
return Common::FS::Exists(yuzu_keys_dir / "dev.keys");
return Common::FS::Exists(suyu_keys_dir / "dev.keys");
}
return Common::FS::Exists(yuzu_keys_dir / "prod.keys");
return Common::FS::Exists(suyu_keys_dir / "prod.keys");
}
void KeyManager::DeriveSDSeedLazy() {

View File

@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project & 2024 suyu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include <atomic>
@@ -132,7 +132,7 @@ struct EmptyAllocator {
template <typename DTraits>
struct DeviceMemoryManagerAllocator {
static constexpr size_t device_virtual_bits = DTraits::device_virtual_bits;
static constexpr DAddr first_address = 1ULL << Memory::YUZU_PAGEBITS;
static constexpr DAddr first_address = 1ULL << Memory::SUYU_PAGEBITS;
static constexpr DAddr max_device_area = 1ULL << device_virtual_bits;
DeviceMemoryManagerAllocator() : main_allocator(first_address) {}
@@ -162,18 +162,18 @@ struct DeviceMemoryManagerAllocator {
template <typename Traits>
DeviceMemoryManager<Traits>::DeviceMemoryManager(const DeviceMemory& device_memory_)
: physical_base{reinterpret_cast<const uintptr_t>(device_memory_.buffer.BackingBasePointer())},
device_inter{nullptr}, compressed_physical_ptr(device_as_size >> Memory::YUZU_PAGEBITS),
device_inter{nullptr}, compressed_physical_ptr(device_as_size >> Memory::SUYU_PAGEBITS),
compressed_device_addr(1ULL << ((Settings::values.memory_layout_mode.GetValue() ==
Settings::MemoryLayout::Memory_4Gb
? physical_min_bits
: physical_max_bits) -
Memory::YUZU_PAGEBITS)),
continuity_tracker(device_as_size >> Memory::YUZU_PAGEBITS),
cpu_backing_address(device_as_size >> Memory::YUZU_PAGEBITS) {
Memory::SUYU_PAGEBITS)),
continuity_tracker(device_as_size >> Memory::SUYU_PAGEBITS),
cpu_backing_address(device_as_size >> Memory::SUYU_PAGEBITS) {
impl = std::make_unique<DeviceMemoryManagerAllocator<Traits>>();
cached_pages = std::make_unique<CachedPages>();
const size_t total_virtual = device_as_size >> Memory::YUZU_PAGEBITS;
const size_t total_virtual = device_as_size >> Memory::SUYU_PAGEBITS;
for (size_t i = 0; i < total_virtual; i++) {
compressed_physical_ptr[i] = 0;
continuity_tracker[i] = 1;
@@ -183,7 +183,7 @@ DeviceMemoryManager<Traits>::DeviceMemoryManager(const DeviceMemory& device_memo
Settings::MemoryLayout::Memory_4Gb
? physical_min_bits
: physical_max_bits) -
Memory::YUZU_PAGEBITS);
Memory::SUYU_PAGEBITS);
for (size_t i = 0; i < total_phys; i++) {
compressed_device_addr[i] = 0;
}
@@ -216,17 +216,17 @@ template <typename Traits>
void DeviceMemoryManager<Traits>::Map(DAddr address, VAddr virtual_address, size_t size, Asid asid,
bool track) {
Core::Memory::Memory* process_memory = registered_processes[asid.id];
size_t start_page_d = address >> Memory::YUZU_PAGEBITS;
size_t num_pages = Common::AlignUp(size, Memory::YUZU_PAGESIZE) >> Memory::YUZU_PAGEBITS;
size_t start_page_d = address >> Memory::SUYU_PAGEBITS;
size_t num_pages = Common::AlignUp(size, Memory::SUYU_PAGESIZE) >> Memory::SUYU_PAGEBITS;
std::scoped_lock lk(mapping_guard);
for (size_t i = 0; i < num_pages; i++) {
const VAddr new_vaddress = virtual_address + i * Memory::YUZU_PAGESIZE;
const VAddr new_vaddress = virtual_address + i * Memory::SUYU_PAGESIZE;
auto* ptr = process_memory->GetPointerSilent(Common::ProcessAddress(new_vaddress));
if (ptr == nullptr) [[unlikely]] {
compressed_physical_ptr[start_page_d + i] = 0;
continue;
}
auto phys_addr = static_cast<u32>(GetRawPhysicalAddr(ptr) >> Memory::YUZU_PAGEBITS) + 1U;
auto phys_addr = static_cast<u32>(GetRawPhysicalAddr(ptr) >> Memory::SUYU_PAGEBITS) + 1U;
compressed_physical_ptr[start_page_d + i] = phys_addr;
InsertCPUBacking(start_page_d + i, new_vaddress, asid);
const u32 base_dev = compressed_device_addr[phys_addr - 1U];
@@ -249,8 +249,8 @@ void DeviceMemoryManager<Traits>::Map(DAddr address, VAddr virtual_address, size
template <typename Traits>
void DeviceMemoryManager<Traits>::Unmap(DAddr address, size_t size) {
size_t start_page_d = address >> Memory::YUZU_PAGEBITS;
size_t num_pages = Common::AlignUp(size, Memory::YUZU_PAGESIZE) >> Memory::YUZU_PAGEBITS;
size_t start_page_d = address >> Memory::SUYU_PAGEBITS;
size_t num_pages = Common::AlignUp(size, Memory::SUYU_PAGESIZE) >> Memory::SUYU_PAGEBITS;
device_inter->InvalidateRegion(address, size);
std::scoped_lock lk(mapping_guard);
for (size_t i = 0; i < num_pages; i++) {
@@ -278,13 +278,13 @@ template <typename Traits>
void DeviceMemoryManager<Traits>::TrackContinuityImpl(DAddr address, VAddr virtual_address,
size_t size, Asid asid) {
Core::Memory::Memory* process_memory = registered_processes[asid.id];
size_t start_page_d = address >> Memory::YUZU_PAGEBITS;
size_t num_pages = Common::AlignUp(size, Memory::YUZU_PAGESIZE) >> Memory::YUZU_PAGEBITS;
size_t start_page_d = address >> Memory::SUYU_PAGEBITS;
size_t num_pages = Common::AlignUp(size, Memory::SUYU_PAGESIZE) >> Memory::SUYU_PAGEBITS;
uintptr_t last_ptr = 0;
size_t page_count = 1;
for (size_t i = num_pages; i > 0; i--) {
size_t index = i - 1;
const VAddr new_vaddress = virtual_address + index * Memory::YUZU_PAGESIZE;
const VAddr new_vaddress = virtual_address + index * Memory::SUYU_PAGESIZE;
const uintptr_t new_ptr = reinterpret_cast<uintptr_t>(
process_memory->GetPointerSilent(Common::ProcessAddress(new_vaddress)));
if (new_ptr + page_size == last_ptr) {
@@ -333,26 +333,26 @@ void DeviceMemoryManager<Traits>::InnerGatherDeviceAddresses(Common::ScratchBuff
template <typename Traits>
template <typename T>
T* DeviceMemoryManager<Traits>::GetPointer(DAddr address) {
const size_t index = address >> Memory::YUZU_PAGEBITS;
const size_t offset = address & Memory::YUZU_PAGEMASK;
const size_t index = address >> Memory::SUYU_PAGEBITS;
const size_t offset = address & Memory::SUYU_PAGEMASK;
auto phys_addr = compressed_physical_ptr[index];
if (phys_addr == 0) [[unlikely]] {
return nullptr;
}
return GetPointerFromRaw<T>((static_cast<PAddr>(phys_addr - 1) << Memory::YUZU_PAGEBITS) +
return GetPointerFromRaw<T>((static_cast<PAddr>(phys_addr - 1) << Memory::SUYU_PAGEBITS) +
offset);
}
template <typename Traits>
template <typename T>
const T* DeviceMemoryManager<Traits>::GetPointer(DAddr address) const {
const size_t index = address >> Memory::YUZU_PAGEBITS;
const size_t offset = address & Memory::YUZU_PAGEMASK;
const size_t index = address >> Memory::SUYU_PAGEBITS;
const size_t offset = address & Memory::SUYU_PAGEMASK;
auto phys_addr = compressed_physical_ptr[index];
if (phys_addr == 0) [[unlikely]] {
return nullptr;
}
return GetPointerFromRaw<T>((static_cast<PAddr>(phys_addr - 1) << Memory::YUZU_PAGEBITS) +
return GetPointerFromRaw<T>((static_cast<PAddr>(phys_addr - 1) << Memory::SUYU_PAGEBITS) +
offset);
}
@@ -382,15 +382,15 @@ template <typename Traits>
void DeviceMemoryManager<Traits>::WalkBlock(DAddr addr, std::size_t size, auto on_unmapped,
auto on_memory, auto increment) {
std::size_t remaining_size = size;
std::size_t page_index = addr >> Memory::YUZU_PAGEBITS;
std::size_t page_offset = addr & Memory::YUZU_PAGEMASK;
std::size_t page_index = addr >> Memory::SUYU_PAGEBITS;
std::size_t page_offset = addr & Memory::SUYU_PAGEMASK;
while (remaining_size) {
const size_t next_pages = static_cast<std::size_t>(continuity_tracker[page_index]);
const std::size_t copy_amount =
std::min((next_pages << Memory::YUZU_PAGEBITS) - page_offset, remaining_size);
std::min((next_pages << Memory::SUYU_PAGEBITS) - page_offset, remaining_size);
const auto current_vaddr =
static_cast<u64>((page_index << Memory::YUZU_PAGEBITS) + page_offset);
static_cast<u64>((page_index << Memory::SUYU_PAGEBITS) + page_offset);
SCOPE_EXIT{
page_index += next_pages;
page_offset = 0;
@@ -404,7 +404,7 @@ void DeviceMemoryManager<Traits>::WalkBlock(DAddr addr, std::size_t size, auto o
continue;
}
auto* mem_ptr = GetPointerFromRaw<u8>(
(static_cast<PAddr>(phys_addr - 1) << Memory::YUZU_PAGEBITS) + page_offset);
(static_cast<PAddr>(phys_addr - 1) << Memory::SUYU_PAGEBITS) + page_offset);
on_memory(copy_amount, mem_ptr);
}
}
@@ -516,31 +516,31 @@ void DeviceMemoryManager<Traits>::UpdatePagesCachedCount(DAddr addr, size_t size
const auto MarkRegionCaching = &DeviceMemoryManager<Traits>::DeviceMethods::MarkRegionCaching;
std::atomic_thread_fence(std::memory_order_acquire);
const size_t page_end = Common::DivCeil(addr + size, Memory::YUZU_PAGESIZE);
size_t page = addr >> Memory::YUZU_PAGEBITS;
const size_t page_end = Common::DivCeil(addr + size, Memory::SUYU_PAGESIZE);
size_t page = addr >> Memory::SUYU_PAGEBITS;
auto [asid, base_vaddress] = ExtractCPUBacking(page);
auto* memory_device_inter = registered_processes[asid.id];
const auto release_pending = [&] {
if (uncache_bytes > 0) {
if (memory_device_inter != nullptr) {
MarkRegionCaching(memory_device_inter, uncache_begin << Memory::YUZU_PAGEBITS,
MarkRegionCaching(memory_device_inter, uncache_begin << Memory::SUYU_PAGEBITS,
uncache_bytes, false);
}
uncache_bytes = 0;
}
if (cache_bytes > 0) {
if (memory_device_inter != nullptr) {
MarkRegionCaching(memory_device_inter, cache_begin << Memory::YUZU_PAGEBITS,
MarkRegionCaching(memory_device_inter, cache_begin << Memory::SUYU_PAGEBITS,
cache_bytes, true);
}
cache_bytes = 0;
}
};
size_t old_vpage = (base_vaddress >> Memory::YUZU_PAGEBITS) - 1;
size_t old_vpage = (base_vaddress >> Memory::SUYU_PAGEBITS) - 1;
for (; page != page_end; ++page) {
CounterAtomicType& count = cached_pages->at(page >> subentries_shift).Count(page);
auto [asid_2, vpage] = ExtractCPUBacking(page);
vpage >>= Memory::YUZU_PAGEBITS;
vpage >>= Memory::SUYU_PAGEBITS;
if (vpage == 0) [[unlikely]] {
release_pending();
@@ -566,9 +566,9 @@ void DeviceMemoryManager<Traits>::UpdatePagesCachedCount(DAddr addr, size_t size
if (uncache_bytes == 0) {
uncache_begin = vpage;
}
uncache_bytes += Memory::YUZU_PAGESIZE;
uncache_bytes += Memory::SUYU_PAGESIZE;
} else if (uncache_bytes > 0) {
MarkRegionCaching(memory_device_inter, uncache_begin << Memory::YUZU_PAGEBITS,
MarkRegionCaching(memory_device_inter, uncache_begin << Memory::SUYU_PAGEBITS,
uncache_bytes, false);
uncache_bytes = 0;
}
@@ -576,9 +576,9 @@ void DeviceMemoryManager<Traits>::UpdatePagesCachedCount(DAddr addr, size_t size
if (cache_bytes == 0) {
cache_begin = vpage;
}
cache_bytes += Memory::YUZU_PAGESIZE;
cache_bytes += Memory::SUYU_PAGESIZE;
} else if (cache_bytes > 0) {
MarkRegionCaching(memory_device_inter, cache_begin << Memory::YUZU_PAGEBITS,
MarkRegionCaching(memory_device_inter, cache_begin << Memory::SUYU_PAGEBITS,
cache_bytes, true);
cache_bytes = 0;
}

View File

@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project & 2024 suyu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include <algorithm>
@@ -370,7 +370,7 @@ std::optional<NcaID> RegisteredCache::GetNcaIDFromMetadata(u64 title_id,
if (type == ContentRecordType::Meta && meta_id.find(title_id) != meta_id.end())
return meta_id.at(title_id);
const auto res1 = CheckMapForContentRecord(yuzu_meta, title_id, type);
const auto res1 = CheckMapForContentRecord(suyu_meta, title_id, type);
if (res1)
return res1;
return CheckMapForContentRecord(meta, title_id, type);
@@ -437,8 +437,8 @@ void RegisteredCache::ProcessFiles(const std::vector<NcaID>& ids) {
}
}
void RegisteredCache::AccumulateYuzuMeta() {
const auto meta_dir = dir->GetSubdirectory("yuzu_meta");
void RegisteredCache::AccumulateSuyuMeta() {
const auto meta_dir = dir->GetSubdirectory("suyu_meta");
if (meta_dir == nullptr) {
return;
}
@@ -449,7 +449,7 @@ void RegisteredCache::AccumulateYuzuMeta() {
}
CNMT cnmt(file);
yuzu_meta.insert_or_assign(cnmt.GetTitleID(), std::move(cnmt));
suyu_meta.insert_or_assign(cnmt.GetTitleID(), std::move(cnmt));
}
}
@@ -460,7 +460,7 @@ void RegisteredCache::Refresh() {
const auto ids = AccumulateFiles();
ProcessFiles(ids);
AccumulateYuzuMeta();
AccumulateSuyuMeta();
}
RegisteredCache::RegisteredCache(VirtualDir dir_, ContentProviderParsingFunction parsing_function)
@@ -485,9 +485,9 @@ std::optional<u32> RegisteredCache::GetEntryVersion(u64 title_id) const {
return meta_iter->second.GetTitleVersion();
}
const auto yuzu_meta_iter = yuzu_meta.find(title_id);
if (yuzu_meta_iter != yuzu_meta.cend()) {
return yuzu_meta_iter->second.GetTitleVersion();
const auto suyu_meta_iter = suyu_meta.find(title_id);
if (suyu_meta_iter != suyu_meta.cend()) {
return suyu_meta_iter->second.GetTitleVersion();
}
return std::nullopt;
@@ -519,7 +519,7 @@ void RegisteredCache::IterateAllMetadata(
}
}
}
for (const auto& kv : yuzu_meta) {
for (const auto& kv : suyu_meta) {
const auto& cnmt = kv.second;
for (const auto& rec : cnmt.GetContentRecords()) {
if (GetFileAtID(rec.nca_id) != nullptr && filter(cnmt, rec)) {
@@ -668,7 +668,7 @@ InstallResult RegisteredCache::InstallEntry(const NCA& nca, TitleType type,
mbedtls_sha256_ret(data.data(), data.size(), c_rec.hash.data(), 0);
std::memcpy(&c_rec.nca_id, &c_rec.hash, 16);
const CNMT new_cnmt(header, opt_header, {c_rec}, {});
if (!RawInstallYuzuMeta(new_cnmt)) {
if (!RawInstallSuyuMeta(new_cnmt)) {
return InstallResult::ErrorMetaFailed;
}
return RawInstallNCA(nca, copy, overwrite_if_exists, c_rec.nca_id);
@@ -693,7 +693,7 @@ InstallResult RegisteredCache::InstallEntry(const NCA& nca, const CNMTHeader& ba
};
const OptionalHeader opt_header{0, 0};
const CNMT new_cnmt(header, opt_header, {base_record}, {});
if (!RawInstallYuzuMeta(new_cnmt)) {
if (!RawInstallSuyuMeta(new_cnmt)) {
return InstallResult::ErrorMetaFailed;
}
return RawInstallNCA(nca, copy, overwrite_if_exists, base_record.nca_id);
@@ -749,9 +749,9 @@ bool RegisteredCache::RemoveExistingEntry(u64 title_id) const {
deleted_html || deleted_legal);
}
// If patch entries for any program exist in yuzu meta, remove them
// If patch entries for any program exist in suyu meta, remove them
for (u8 i = 0; i < 0x10; i++) {
const auto meta_dir = dir->CreateDirectoryRelative("yuzu_meta");
const auto meta_dir = dir->CreateDirectoryRelative("suyu_meta");
const auto filename = GetCNMTName(TitleType::Update, title_id + i);
if (meta_dir->GetFile(filename)) {
removed_data |= meta_dir->DeleteFile(filename);
@@ -802,9 +802,9 @@ InstallResult RegisteredCache::RawInstallNCA(const NCA& nca, const VfsCopyFuncti
: InstallResult::ErrorCopyFailed;
}
bool RegisteredCache::RawInstallYuzuMeta(const CNMT& cnmt) {
bool RegisteredCache::RawInstallSuyuMeta(const CNMT& cnmt) {
// Reasoning behind this method can be found in the comment for InstallEntry, NCA overload.
const auto meta_dir = dir->CreateDirectoryRelative("yuzu_meta");
const auto meta_dir = dir->CreateDirectoryRelative("suyu_meta");
const auto filename = GetCNMTName(cnmt.GetType(), cnmt.GetTitleID());
if (meta_dir->GetFile(filename) == nullptr) {
auto out = meta_dir->CreateFile(filename);
@@ -823,11 +823,11 @@ bool RegisteredCache::RawInstallYuzuMeta(const CNMT& cnmt) {
}
}
Refresh();
return std::find_if(yuzu_meta.begin(), yuzu_meta.end(),
return std::find_if(suyu_meta.begin(), suyu_meta.end(),
[&cnmt](const std::pair<u64, CNMT>& kv) {
return kv.second.GetType() == cnmt.GetType() &&
kv.second.GetTitleID() == cnmt.GetTitleID();
}) != yuzu_meta.end();
}) != suyu_meta.end();
}
ContentProviderUnion::~ContentProviderUnion() = default;

View File

@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project & 2024 suyu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
@@ -164,8 +164,8 @@ public:
const VfsCopyFunction& copy = &VfsRawCopy);
// Due to the fact that we must use Meta-type NCAs to determine the existence of files, this
// poses quite a challenge. Instead of creating a new meta NCA for this file, yuzu will create a
// dir inside the NAND called 'yuzu_meta' and store the raw CNMT there.
// poses quite a challenge. Instead of creating a new meta NCA for this file, suyu will create a
// dir inside the NAND called 'suyu_meta' and store the raw CNMT there.
// TODO(DarkLordZach): Author real meta-type NCAs and install those.
InstallResult InstallEntry(const NCA& nca, TitleType type, bool overwrite_if_exists = false,
const VfsCopyFunction& copy = &VfsRawCopy);
@@ -184,13 +184,13 @@ private:
std::function<bool(const CNMT&, const ContentRecord&)> filter) const;
std::vector<NcaID> AccumulateFiles() const;
void ProcessFiles(const std::vector<NcaID>& ids);
void AccumulateYuzuMeta();
void AccumulateSuyuMeta();
std::optional<NcaID> GetNcaIDFromMetadata(u64 title_id, ContentRecordType type) const;
VirtualFile GetFileAtID(NcaID id) const;
VirtualFile OpenFileOrDirectoryConcat(const VirtualDir& open_dir, std::string_view path) const;
InstallResult RawInstallNCA(const NCA& nca, const VfsCopyFunction& copy,
bool overwrite_if_exists, std::optional<NcaID> override_id = {});
bool RawInstallYuzuMeta(const CNMT& cnmt);
bool RawInstallSuyuMeta(const CNMT& cnmt);
VirtualDir dir;
ContentProviderParsingFunction parser;
@@ -199,8 +199,8 @@ private:
std::map<u64, NcaID> meta_id;
// maps tid -> meta
std::map<u64, CNMT> meta;
// maps tid -> meta for CNMT in yuzu_meta
std::map<u64, CNMT> yuzu_meta;
// maps tid -> meta for CNMT in suyu_meta
std::map<u64, CNMT> suyu_meta;
};
enum class ContentProviderUnionSlot {

View File

@@ -18,7 +18,7 @@ class System;
namespace FileSys {
constexpr const char* GetSaveDataSizeFileName() {
return ".yuzu_save_size";
return ".suyu_save_size";
}
using ProgramId = u64;

View File

@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project & 2024 suyu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include <thread>
@@ -65,7 +65,7 @@ void DefaultSoftwareKeyboardApplet::ShowNormalKeyboard() const {
LOG_WARNING(Service_AM,
"(STUBBED) called, backend requested to show the normal software keyboard.");
SubmitNormalText(u"yuzu");
SubmitNormalText(u"suyu");
}
void DefaultSoftwareKeyboardApplet::ShowTextCheckDialog(
@@ -100,7 +100,7 @@ void DefaultSoftwareKeyboardApplet::ShowInlineKeyboard(
appear_parameters.key_top_as_floating, appear_parameters.enable_backspace_button,
appear_parameters.enable_return_button, appear_parameters.disable_cancel_button);
std::thread([this] { SubmitInlineText(u"yuzu"); }).detach();
std::thread([this] { SubmitInlineText(u"suyu"); }).detach();
}
void DefaultSoftwareKeyboardApplet::HideInlineKeyboard() const {

View File

@@ -1,11 +1,11 @@
// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project & 2024 suyu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include "common/common_types.h"
// This file contains yuzu's HLE API version constants.
// This file contains suyu's HLE API version constants.
namespace HLE::ApiVersion {

View File

@@ -442,7 +442,7 @@ void KScheduler::ScheduleImplFiber() {
// The next thread is nullptr!
// Switch to the idle thread. Note: HOS treats idling as a special case for
// performance. This is not *required* for yuzu's purposes, and for singlecore
// performance. This is not *required* for suyu's purposes, and for singlecore
// compatibility, we can just move the logic that would go here into the execution
// of the idle thread. If we ever remove singlecore, we should implement this
// accurately to HOS.

View File

@@ -833,7 +833,7 @@ Result Module::Interface::InitializeApplicationInfoBase() {
case FileSys::StorageId::Host:
case FileSys::StorageId::NandUser:
case FileSys::StorageId::SdCard:
case FileSys::StorageId::None: // Yuzu specific, differs from hardware
case FileSys::StorageId::None: // Suyu specific, differs from hardware
application_info.application_type = ApplicationType::Digital;
break;
default:
@@ -891,7 +891,7 @@ void Module::Interface::InitializeApplicationInfoV2(HLERequestContext& ctx) {
void Module::Interface::BeginUserRegistration(HLERequestContext& ctx) {
const auto user_id = Common::UUID::MakeRandom();
profile_manager->CreateNewUser(user_id, "yuzu");
profile_manager->CreateNewUser(user_id, "suyu");
LOG_INFO(Service_ACC, "called, uuid={}", user_id.FormattedString());

View File

@@ -46,7 +46,7 @@ ProfileManager::ProfileManager() {
// Create an user if none are present
if (user_count == 0) {
CreateNewUser(UUID::MakeRandom(), "yuzu");
CreateNewUser(UUID::MakeRandom(), "suyu");
WriteUserSaveFile();
}
@@ -383,14 +383,14 @@ void ProfileManager::ParseUserSaveFile() {
if (!save.IsOpen()) {
LOG_WARNING(Service_ACC, "Failed to load profile data from save data... Generating new "
"user 'yuzu' with random UUID.");
"user 'suyu' with random UUID.");
return;
}
ProfileDataRaw data;
if (!save.ReadObject(data)) {
LOG_WARNING(Service_ACC, "profiles.dat is smaller than expected... Generating new user "
"'yuzu' with random UUID.");
"'suyu' with random UUID.");
return;
}

View File

@@ -340,7 +340,7 @@ Result ISelfController::GetAccumulatedSuspendedTickValue(
LOG_DEBUG(Service_AM, "called.");
// This command returns the total number of system ticks since ISelfController creation
// where the game was suspended. Since Yuzu doesn't implement game suspension, this command
// where the game was suspended. Since Suyu doesn't implement game suspension, this command
// can just always return 0 ticks.
std::scoped_lock lk{m_applet->lock};
*out_accumulated_suspended_tick_value = m_applet->suspended_ticks;

View File

@@ -66,7 +66,7 @@ enum class FatalType : u32 {
static void GenerateErrorReport(Core::System& system, Result error_code, const FatalInfo& info) {
const auto title_id = system.GetApplicationProcessProgramID();
std::string crash_report = fmt::format(
"Yuzu {}-{} crash report\n"
"Suyu {}-{} crash report\n"
"Title ID: {:016x}\n"
"Result: 0x{:X} ({:04}-{:04d})\n"
"Set flags: 0x{:16X}\n"

View File

@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project
// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project & 2024 suyu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
@@ -109,7 +109,7 @@ protected:
void SendPacket(const Network::LDNPacket& packet);
static const LanEventFunc empty_func;
static constexpr Ssid fake_ssid{"YuzuFakeSsidForLdn"};
static constexpr Ssid fake_ssid{"SuyuFakeSsidForLdn"};
bool inited{};
std::mutex packet_mutex;

View File

@@ -271,9 +271,9 @@ void Cipher(const DerivedKeys& keys, const NTAG215File& in_data, NTAG215File& ou
}
bool LoadKeys(InternalKey& locked_secret, InternalKey& unfixed_info) {
const auto yuzu_keys_dir = Common::FS::GetSuyuPath(Common::FS::SuyuPath::KeysDir);
const auto suyu_keys_dir = Common::FS::GetSuyuPath(Common::FS::SuyuPath::KeysDir);
const Common::FS::IOFile keys_file{yuzu_keys_dir / "key_retail.bin",
const Common::FS::IOFile keys_file{suyu_keys_dir / "key_retail.bin",
Common::FS::FileAccessMode::Read,
Common::FS::FileType::BinaryFile};
@@ -295,8 +295,8 @@ bool LoadKeys(InternalKey& locked_secret, InternalKey& unfixed_info) {
}
bool IsKeyAvailable() {
const auto yuzu_keys_dir = Common::FS::GetSuyuPath(Common::FS::SuyuPath::KeysDir);
return Common::FS::Exists(yuzu_keys_dir / "key_retail.bin");
const auto suyu_keys_dir = Common::FS::GetSuyuPath(Common::FS::SuyuPath::KeysDir);
return Common::FS::Exists(suyu_keys_dir / "key_retail.bin");
}
bool DecodeAmiibo(const EncryptedNTAG215File& encrypted_tag_data, NTAG215File& tag_data) {

View File

@@ -623,7 +623,7 @@ Result NfcDevice::Restore() {
}
}
// Restore mii data in case is corrupted by previous instances of yuzu
// Restore mii data in case is corrupted by previous instances of suyu
if (tag_data.settings.settings.amiibo_initialized && !tag_data.owner_mii.IsValid()) {
LOG_ERROR(Service_NFP, "Regenerating mii data");
Mii::StoreData new_mii{};
@@ -1261,11 +1261,11 @@ Result NfcDevice::BreakTag(NFP::BreakType break_type) {
Result NfcDevice::HasBackup(const UniqueSerialNumber& uid, std::size_t uuid_size) const {
ASSERT_MSG(uuid_size < sizeof(UniqueSerialNumber), "Invalid UUID size");
constexpr auto backup_dir = "backup";
const auto yuzu_amiibo_dir = Common::FS::GetSuyuPath(Common::FS::SuyuPath::AmiiboDir);
const auto suyu_amiibo_dir = Common::FS::GetSuyuPath(Common::FS::SuyuPath::AmiiboDir);
const auto file_name =
fmt::format("{0:02x}.bin", fmt::join(uid.begin(), uid.begin() + uuid_size, ""));
if (!Common::FS::Exists(yuzu_amiibo_dir / backup_dir / file_name)) {
if (!Common::FS::Exists(suyu_amiibo_dir / backup_dir / file_name)) {
return ResultUnableToAccessBackupFile;
}
@@ -1282,11 +1282,11 @@ Result NfcDevice::ReadBackupData(const UniqueSerialNumber& uid, std::size_t uuid
std::span<u8> data) const {
ASSERT_MSG(uuid_size < sizeof(UniqueSerialNumber), "Invalid UUID size");
constexpr auto backup_dir = "backup";
const auto yuzu_amiibo_dir = Common::FS::GetSuyuPath(Common::FS::SuyuPath::AmiiboDir);
const auto suyu_amiibo_dir = Common::FS::GetSuyuPath(Common::FS::SuyuPath::AmiiboDir);
const auto file_name =
fmt::format("{0:02x}.bin", fmt::join(uid.begin(), uid.begin() + uuid_size, ""));
const Common::FS::IOFile keys_file{yuzu_amiibo_dir / backup_dir / file_name,
const Common::FS::IOFile keys_file{suyu_amiibo_dir / backup_dir / file_name,
Common::FS::FileAccessMode::Read,
Common::FS::FileType::BinaryFile};
@@ -1313,21 +1313,21 @@ Result NfcDevice::WriteBackupData(const UniqueSerialNumber& uid, std::size_t uui
std::span<const u8> data) {
ASSERT_MSG(uuid_size < sizeof(UniqueSerialNumber), "Invalid UUID size");
constexpr auto backup_dir = "backup";
const auto yuzu_amiibo_dir = Common::FS::GetSuyuPath(Common::FS::SuyuPath::AmiiboDir);
const auto suyu_amiibo_dir = Common::FS::GetSuyuPath(Common::FS::SuyuPath::AmiiboDir);
const auto file_name =
fmt::format("{0:02x}.bin", fmt::join(uid.begin(), uid.begin() + uuid_size, ""));
if (HasBackup(uid, uuid_size).IsError()) {
if (!Common::FS::CreateDir(yuzu_amiibo_dir / backup_dir)) {
if (!Common::FS::CreateDir(suyu_amiibo_dir / backup_dir)) {
return ResultBackupPathAlreadyExist;
}
if (!Common::FS::NewFile(yuzu_amiibo_dir / backup_dir / file_name)) {
if (!Common::FS::NewFile(suyu_amiibo_dir / backup_dir / file_name)) {
return ResultBackupPathAlreadyExist;
}
}
const Common::FS::IOFile keys_file{yuzu_amiibo_dir / backup_dir / file_name,
const Common::FS::IOFile keys_file{suyu_amiibo_dir / backup_dir / file_name,
Common::FS::FileAccessMode::ReadWrite,
Common::FS::FileType::BinaryFile};

View File

@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project & 2024 suyu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include "core/core.h"
@@ -396,11 +396,11 @@ void IGeneralService::GetCurrentNetworkProfile(HLERequestContext& ctx) {
.mtu{1500},
},
.uuid{0xdeadbeef, 0xdeadbeef},
.network_name{"yuzu Network"},
.network_name{"suyu Network"},
.wireless_setting_data{
.ssid_length{12},
.ssid{"yuzu Network"},
.passphrase{"yuzupassword"},
.ssid{"suyu Network"},
.passphrase{"suyupassword"},
},
};
}();

View File

@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2022 yuzu Emulator Project
// SPDX-FileCopyrightText: 2022 yuzu Emulator Project & 2024 suyu Emulator Project
// SPDX-FileCopyrightText: 2022 Skyline Team and Contributors
// SPDX-License-Identifier: GPL-3.0-or-later
@@ -13,8 +13,8 @@
#include "core/memory.h"
#include "video_core/host1x/host1x.h"
using Core::Memory::YUZU_PAGESIZE;
constexpr size_t BIG_PAGE_SIZE = YUZU_PAGESIZE * 16;
using Core::Memory::SUYU_PAGESIZE;
constexpr size_t BIG_PAGE_SIZE = SUYU_PAGESIZE * 16;
namespace Service::Nvidia::NvCore {
NvMap::Handle::Handle(u64 size_, Id id_)
@@ -32,7 +32,7 @@ NvResult NvMap::Handle::Alloc(Flags pFlags, u32 pAlign, u8 pKind, u64 pAddress,
flags = pFlags;
kind = pKind;
align = pAlign < YUZU_PAGESIZE ? YUZU_PAGESIZE : pAlign;
align = pAlign < SUYU_PAGESIZE ? SUYU_PAGESIZE : pAlign;
session_id = pSessionId;
// This flag is only applicable for handles with an address passed
@@ -43,7 +43,7 @@ NvResult NvMap::Handle::Alloc(Flags pFlags, u32 pAlign, u8 pKind, u64 pAddress,
"Mapping nvmap handles without a CPU side address is unimplemented!");
}
size = Common::AlignUp(size, YUZU_PAGESIZE);
size = Common::AlignUp(size, SUYU_PAGESIZE);
aligned_size = Common::AlignUp(size, align);
address = pAddress;
allocated = true;

View File

@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2021 yuzu Emulator Project
// SPDX-FileCopyrightText: 2021 yuzu Emulator Project & 2024 suyu Emulator Project
// SPDX-FileCopyrightText: 2021 Skyline Team and Contributors
// SPDX-License-Identifier: GPL-3.0-or-later
@@ -152,7 +152,7 @@ NvResult nvhost_as_gpu::AllocateSpace(IoctlAllocSpace& params) {
return NvResult::BadValue;
}
if (params.page_size != VM::YUZU_PAGESIZE && params.page_size != vm.big_page_size) {
if (params.page_size != VM::SUYU_PAGESIZE && params.page_size != vm.big_page_size) {
return NvResult::BadValue;
}
@@ -162,10 +162,10 @@ NvResult nvhost_as_gpu::AllocateSpace(IoctlAllocSpace& params) {
return NvResult::NotImplemented;
}
const u32 page_size_bits{params.page_size == VM::YUZU_PAGESIZE ? VM::PAGE_SIZE_BITS
const u32 page_size_bits{params.page_size == VM::SUYU_PAGESIZE ? VM::PAGE_SIZE_BITS
: vm.big_page_size_bits};
auto& allocator{params.page_size == VM::YUZU_PAGESIZE ? *vm.small_page_allocator
auto& allocator{params.page_size == VM::SUYU_PAGESIZE ? *vm.small_page_allocator
: *vm.big_page_allocator};
if ((params.flags & MappingFlags::Fixed) != MappingFlags::None) {
@@ -189,7 +189,7 @@ NvResult nvhost_as_gpu::AllocateSpace(IoctlAllocSpace& params) {
.mappings{},
.page_size = params.page_size,
.sparse = (params.flags & MappingFlags::Sparse) != MappingFlags::None,
.big_pages = params.page_size != VM::YUZU_PAGESIZE,
.big_pages = params.page_size != VM::SUYU_PAGESIZE,
};
return NvResult::Success;
@@ -201,7 +201,7 @@ void nvhost_as_gpu::FreeMappingLocked(u64 offset) {
if (!mapping->fixed) {
auto& allocator{mapping->big_page ? *vm.big_page_allocator : *vm.small_page_allocator};
u32 page_size_bits{mapping->big_page ? vm.big_page_size_bits : VM::PAGE_SIZE_BITS};
u32 page_size{mapping->big_page ? vm.big_page_size : VM::YUZU_PAGESIZE};
u32 page_size{mapping->big_page ? vm.big_page_size : VM::SUYU_PAGESIZE};
u64 aligned_size{Common::AlignUp(mapping->size, page_size)};
allocator.Free(static_cast<u32>(mapping->offset >> page_size_bits),
@@ -248,9 +248,9 @@ NvResult nvhost_as_gpu::FreeSpace(IoctlFreeSpace& params) {
gmmu->Unmap(params.offset, allocation.size);
}
auto& allocator{params.page_size == VM::YUZU_PAGESIZE ? *vm.small_page_allocator
auto& allocator{params.page_size == VM::SUYU_PAGESIZE ? *vm.small_page_allocator
: *vm.big_page_allocator};
u32 page_size_bits{params.page_size == VM::YUZU_PAGESIZE ? VM::PAGE_SIZE_BITS
u32 page_size_bits{params.page_size == VM::SUYU_PAGESIZE ? VM::PAGE_SIZE_BITS
: vm.big_page_size_bits};
allocator.Free(static_cast<u32>(params.offset >> page_size_bits),
@@ -360,7 +360,7 @@ NvResult nvhost_as_gpu::MapBufferEx(IoctlMapBufferEx& params) {
bool big_page{[&]() {
if (Common::IsAligned(handle->align, vm.big_page_size)) {
return true;
} else if (Common::IsAligned(handle->align, VM::YUZU_PAGESIZE)) {
} else if (Common::IsAligned(handle->align, VM::SUYU_PAGESIZE)) {
return false;
} else {
ASSERT(false);
@@ -387,7 +387,7 @@ NvResult nvhost_as_gpu::MapBufferEx(IoctlMapBufferEx& params) {
mapping_map[params.offset] = mapping;
} else {
auto& allocator{big_page ? *vm.big_page_allocator : *vm.small_page_allocator};
u32 page_size{big_page ? vm.big_page_size : VM::YUZU_PAGESIZE};
u32 page_size{big_page ? vm.big_page_size : VM::SUYU_PAGESIZE};
u32 page_size_bits{big_page ? vm.big_page_size_bits : VM::PAGE_SIZE_BITS};
params.offset = static_cast<u64>(allocator.Allocate(
@@ -461,7 +461,7 @@ void nvhost_as_gpu::GetVARegionsImpl(IoctlGetVaRegions& params) {
params.regions = std::array<VaRegion, 2>{
VaRegion{
.offset = vm.small_page_allocator->GetVAStart() << VM::PAGE_SIZE_BITS,
.page_size = VM::YUZU_PAGESIZE,
.page_size = VM::SUYU_PAGESIZE,
._pad0_{},
.pages = vm.small_page_allocator->GetVALimit() - vm.small_page_allocator->GetVAStart(),
},

View File

@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2021 yuzu Emulator Project
// SPDX-FileCopyrightText: 2021 yuzu Emulator Project & 2024 suyu Emulator Project
// SPDX-FileCopyrightText: 2021 Skyline Team and Contributors
// SPDX-License-Identifier: GPL-3.0-or-later
@@ -190,8 +190,8 @@ private:
std::mutex mutex; //!< Locks all AS operations
struct VM {
static constexpr u32 YUZU_PAGESIZE{0x1000};
static constexpr u32 PAGE_SIZE_BITS{std::countr_zero(YUZU_PAGESIZE)};
static constexpr u32 SUYU_PAGESIZE{0x1000};
static constexpr u32 PAGE_SIZE_BITS{std::countr_zero(SUYU_PAGESIZE)};
static constexpr u32 SUPPORTED_BIG_PAGE_SIZES{0x30000};
static constexpr u32 DEFAULT_BIG_PAGE_SIZE{0x20000};

View File

@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project & 2024 suyu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include <algorithm>
@@ -17,7 +17,7 @@
#include "core/hle/service/nvdrv/devices/nvmap.h"
#include "core/memory.h"
using Core::Memory::YUZU_PAGESIZE;
using Core::Memory::SUYU_PAGESIZE;
namespace Service::Nvidia::Devices {
@@ -82,7 +82,7 @@ NvResult nvmap::IocCreate(IocCreateParams& params) {
std::shared_ptr<NvCore::NvMap::Handle> handle_description{};
auto result =
file.CreateHandle(Common::AlignUp(params.size, YUZU_PAGESIZE), handle_description);
file.CreateHandle(Common::AlignUp(params.size, SUYU_PAGESIZE), handle_description);
if (result != NvResult::Success) {
LOG_CRITICAL(Service_NVDRV, "Failed to create Object");
return result;
@@ -108,8 +108,8 @@ NvResult nvmap::IocAlloc(IocAllocParams& params, DeviceFD fd) {
}
// Force page size alignment at a minimum
if (params.align < YUZU_PAGESIZE) {
params.align = YUZU_PAGESIZE;
if (params.align < SUYU_PAGESIZE) {
params.align = SUYU_PAGESIZE;
}
auto handle_description{file.GetHandle(params.handle)};

View File

@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project & 2024 suyu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include <mbedtls/sha256.h>
@@ -228,10 +228,10 @@ struct ProcessContext {
R_UNLESS(bss_size == expected_bss_size, RO::ResultInvalidNro);
// Validate all sizes are aligned.
R_UNLESS(Common::IsAligned(text_size, Core::Memory::YUZU_PAGESIZE), RO::ResultInvalidNro);
R_UNLESS(Common::IsAligned(ro_size, Core::Memory::YUZU_PAGESIZE), RO::ResultInvalidNro);
R_UNLESS(Common::IsAligned(rw_size, Core::Memory::YUZU_PAGESIZE), RO::ResultInvalidNro);
R_UNLESS(Common::IsAligned(bss_size, Core::Memory::YUZU_PAGESIZE), RO::ResultInvalidNro);
R_UNLESS(Common::IsAligned(text_size, Core::Memory::SUYU_PAGESIZE), RO::ResultInvalidNro);
R_UNLESS(Common::IsAligned(ro_size, Core::Memory::SUYU_PAGESIZE), RO::ResultInvalidNro);
R_UNLESS(Common::IsAligned(rw_size, Core::Memory::SUYU_PAGESIZE), RO::ResultInvalidNro);
R_UNLESS(Common::IsAligned(bss_size, Core::Memory::SUYU_PAGESIZE), RO::ResultInvalidNro);
// Validate sections are in order.
R_UNLESS(text_ofs <= ro_ofs, RO::ResultInvalidNro);
@@ -286,16 +286,16 @@ private:
};
Result ValidateAddressAndNonZeroSize(u64 address, u64 size) {
R_UNLESS(Common::IsAligned(address, Core::Memory::YUZU_PAGESIZE), RO::ResultInvalidAddress);
R_UNLESS(Common::IsAligned(address, Core::Memory::SUYU_PAGESIZE), RO::ResultInvalidAddress);
R_UNLESS(size != 0, RO::ResultInvalidSize);
R_UNLESS(Common::IsAligned(size, Core::Memory::YUZU_PAGESIZE), RO::ResultInvalidSize);
R_UNLESS(Common::IsAligned(size, Core::Memory::SUYU_PAGESIZE), RO::ResultInvalidSize);
R_UNLESS(address < address + size, RO::ResultInvalidSize);
R_SUCCEED();
}
Result ValidateAddressAndSize(u64 address, u64 size) {
R_UNLESS(Common::IsAligned(address, Core::Memory::YUZU_PAGESIZE), RO::ResultInvalidAddress);
R_UNLESS(Common::IsAligned(size, Core::Memory::YUZU_PAGESIZE), RO::ResultInvalidSize);
R_UNLESS(Common::IsAligned(address, Core::Memory::SUYU_PAGESIZE), RO::ResultInvalidAddress);
R_UNLESS(Common::IsAligned(size, Core::Memory::SUYU_PAGESIZE), RO::ResultInvalidSize);
R_UNLESS(size == 0 || address < address + size, RO::ResultInvalidSize);
R_SUCCEED();
}
@@ -369,7 +369,7 @@ public:
ASSERT(context != nullptr);
// Validate address.
R_UNLESS(Common::IsAligned(nrr_address, Core::Memory::YUZU_PAGESIZE),
R_UNLESS(Common::IsAligned(nrr_address, Core::Memory::SUYU_PAGESIZE),
RO::ResultInvalidAddress);
// Check the NRR is loaded.
@@ -436,7 +436,7 @@ public:
ASSERT(context != nullptr);
// Validate address.
R_UNLESS(Common::IsAligned(nro_address, Core::Memory::YUZU_PAGESIZE),
R_UNLESS(Common::IsAligned(nro_address, Core::Memory::SUYU_PAGESIZE),
RO::ResultInvalidAddress);
// Check the NRO is loaded.

View File

@@ -932,7 +932,7 @@ Result ISystemSettingsServer::SetPrimaryAlbumStorage(PrimaryAlbumStorage primary
Result ISystemSettingsServer::GetBatteryLot(Out<BatteryLot> out_battery_lot) {
LOG_INFO(Service_SET, "called");
*out_battery_lot = {"YUZU0EMULATOR14022024"};
*out_battery_lot = {"SUYU0EMULATOR14022024"};
R_SUCCEED();
}

View File

@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project & 2024 suyu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include <mutex>
@@ -34,7 +34,7 @@ static void OneTimeInit() {
SCH_USE_STRONG_CRYPTO | // don't allow insecure protocols
SCH_CRED_NO_SERVERNAME_CHECK | // don't validate server names
SCH_CRED_NO_DEFAULT_CREDS; // don't automatically present a client certificate
// ^ I'm assuming that nobody would want to connect Yuzu to a
// ^ I'm assuming that nobody would want to connect Suyu to a
// service that requires some OS-provided corporate client
// certificate, and presenting one to some arbitrary server
// might be a privacy concern? Who knows, though.

View File

@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project & 2024 suyu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include <random>
@@ -23,7 +23,7 @@ namespace {
Result AllocateSharedBufferMemory(std::unique_ptr<Kernel::KPageGroup>* out_page_group,
Core::System& system, u32 size) {
using Core::Memory::YUZU_PAGESIZE;
using Core::Memory::SUYU_PAGESIZE;
// Allocate memory for the system shared buffer.
auto& kernel = system.Kernel();
@@ -34,7 +34,7 @@ Result AllocateSharedBufferMemory(std::unique_ptr<Kernel::KPageGroup>* out_page_
// Allocate memory from secure pool.
R_TRY(kernel.MemoryManager().AllocateAndOpen(
pg.get(), size / YUZU_PAGESIZE,
pg.get(), size / SUYU_PAGESIZE,
Kernel::KMemoryManager::EncodeOption(Kernel::KMemoryManager::Pool::Secure,
Kernel::KMemoryManager::Direction::FromBack)));
@@ -58,13 +58,13 @@ Result AllocateSharedBufferMemory(std::unique_ptr<Kernel::KPageGroup>* out_page_
Result MapSharedBufferIntoProcessAddressSpace(Common::ProcessAddress* out_map_address,
std::unique_ptr<Kernel::KPageGroup>& pg,
Kernel::KProcess* process, Core::System& system) {
using Core::Memory::YUZU_PAGESIZE;
using Core::Memory::SUYU_PAGESIZE;
auto& page_table = process->GetPageTable();
// Get bounds of where mapping is possible.
const VAddr alias_code_begin = GetInteger(page_table.GetAliasCodeRegionStart());
const VAddr alias_code_size = page_table.GetAliasCodeRegionSize() / YUZU_PAGESIZE;
const VAddr alias_code_size = page_table.GetAliasCodeRegionSize() / SUYU_PAGESIZE;
const auto state = Kernel::KMemoryState::IoMemory;
const auto perm = Kernel::KMemoryPermission::UserReadWrite;
std::mt19937_64 rng{process->GetRandomEntropy(0)};
@@ -73,7 +73,7 @@ Result MapSharedBufferIntoProcessAddressSpace(Common::ProcessAddress* out_map_ad
Result res = ResultSuccess;
int i;
for (i = 0; i < 64; i++) {
*out_map_address = alias_code_begin + ((rng() % alias_code_size) * YUZU_PAGESIZE);
*out_map_address = alias_code_begin + ((rng() % alias_code_size) * SUYU_PAGESIZE);
res = page_table.MapPageGroup(*out_map_address, *pg, state, perm);
if (R_SUCCEEDED(res)) {
break;

View File

@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project
// SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project & 2024 suyu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include <cstring>
@@ -14,7 +14,7 @@ namespace Loader {
namespace {
constexpr u32 PageAlignSize(u32 size) {
return static_cast<u32>((size + Core::Memory::YUZU_PAGEMASK) & ~Core::Memory::YUZU_PAGEMASK);
return static_cast<u32>((size + Core::Memory::SUYU_PAGEMASK) & ~Core::Memory::SUYU_PAGEMASK);
}
} // Anonymous namespace

View File

@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project & 2024 suyu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include <utility>
@@ -140,7 +140,7 @@ bool AppLoader_NRO::IsHomebrew() {
}
static constexpr u32 PageAlignSize(u32 size) {
return static_cast<u32>((size + Core::Memory::YUZU_PAGEMASK) & ~Core::Memory::YUZU_PAGEMASK);
return static_cast<u32>((size + Core::Memory::SUYU_PAGEMASK) & ~Core::Memory::SUYU_PAGEMASK);
}
static bool LoadNroImpl(Core::System& system, Kernel::KProcess& process,

View File

@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project & 2024 suyu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include <cinttypes>
@@ -49,7 +49,7 @@ std::vector<u8> DecompressSegment(const std::vector<u8>& compressed_data,
}
constexpr u32 PageAlignSize(u32 size) {
return static_cast<u32>((size + Core::Memory::YUZU_PAGEMASK) & ~Core::Memory::YUZU_PAGEMASK);
return static_cast<u32>((size + Core::Memory::SUYU_PAGEMASK) & ~Core::Memory::SUYU_PAGEMASK);
}
} // Anonymous namespace

View File

@@ -1,5 +1,5 @@
// SPDX-FileCopyrightText: 2015 Citra Emulator Project
// SPDX-FileCopyrightText: 2018 yuzu Emulator Project
// SPDX-FileCopyrightText: 2018 yuzu Emulator Project & 2024 suyu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include <algorithm>
@@ -67,11 +67,11 @@ struct Memory::Impl {
void MapMemoryRegion(Common::PageTable& page_table, Common::ProcessAddress base, u64 size,
Common::PhysicalAddress target, Common::MemoryPermission perms,
bool separate_heap) {
ASSERT_MSG((size & YUZU_PAGEMASK) == 0, "non-page aligned size: {:016X}", size);
ASSERT_MSG((base & YUZU_PAGEMASK) == 0, "non-page aligned base: {:016X}", GetInteger(base));
ASSERT_MSG((size & SUYU_PAGEMASK) == 0, "non-page aligned size: {:016X}", size);
ASSERT_MSG((base & SUYU_PAGEMASK) == 0, "non-page aligned base: {:016X}", GetInteger(base));
ASSERT_MSG(target >= DramMemoryMap::Base, "Out of bounds target: {:016X}",
GetInteger(target));
MapPages(page_table, base / YUZU_PAGESIZE, size / YUZU_PAGESIZE, target,
MapPages(page_table, base / SUYU_PAGESIZE, size / SUYU_PAGESIZE, target,
Common::PageType::Memory);
if (current_page_table->fastmem_arena) {
@@ -82,9 +82,9 @@ struct Memory::Impl {
void UnmapRegion(Common::PageTable& page_table, Common::ProcessAddress base, u64 size,
bool separate_heap) {
ASSERT_MSG((size & YUZU_PAGEMASK) == 0, "non-page aligned size: {:016X}", size);
ASSERT_MSG((base & YUZU_PAGEMASK) == 0, "non-page aligned base: {:016X}", GetInteger(base));
MapPages(page_table, base / YUZU_PAGESIZE, size / YUZU_PAGESIZE, 0,
ASSERT_MSG((size & SUYU_PAGEMASK) == 0, "non-page aligned size: {:016X}", size);
ASSERT_MSG((base & SUYU_PAGEMASK) == 0, "non-page aligned base: {:016X}", GetInteger(base));
MapPages(page_table, base / SUYU_PAGESIZE, size / SUYU_PAGESIZE, 0,
Common::PageType::Unmapped);
if (current_page_table->fastmem_arena) {
@@ -94,8 +94,8 @@ struct Memory::Impl {
void ProtectRegion(Common::PageTable& page_table, VAddr vaddr, u64 size,
Common::MemoryPermission perms) {
ASSERT_MSG((size & YUZU_PAGEMASK) == 0, "non-page aligned size: {:016X}", size);
ASSERT_MSG((vaddr & YUZU_PAGEMASK) == 0, "non-page aligned base: {:016X}", vaddr);
ASSERT_MSG((size & SUYU_PAGEMASK) == 0, "non-page aligned size: {:016X}", size);
ASSERT_MSG((vaddr & SUYU_PAGEMASK) == 0, "non-page aligned base: {:016X}", vaddr);
if (!current_page_table->fastmem_arena) {
return;
@@ -103,9 +103,9 @@ struct Memory::Impl {
u64 protect_bytes{};
u64 protect_begin{};
for (u64 addr = vaddr; addr < vaddr + size; addr += YUZU_PAGESIZE) {
for (u64 addr = vaddr; addr < vaddr + size; addr += SUYU_PAGESIZE) {
const Common::PageType page_type{
current_page_table->pointers[addr >> YUZU_PAGEBITS].Type()};
current_page_table->pointers[addr >> SUYU_PAGEBITS].Type()};
switch (page_type) {
case Common::PageType::RasterizerCachedMemory:
if (protect_bytes > 0) {
@@ -117,7 +117,7 @@ struct Memory::Impl {
if (protect_bytes == 0) {
protect_begin = addr;
}
protect_bytes += YUZU_PAGESIZE;
protect_bytes += SUYU_PAGESIZE;
}
}
@@ -128,7 +128,7 @@ struct Memory::Impl {
[[nodiscard]] u8* GetPointerFromRasterizerCachedMemory(u64 vaddr) const {
const Common::PhysicalAddress paddr{
current_page_table->backing_addr[vaddr >> YUZU_PAGEBITS]};
current_page_table->backing_addr[vaddr >> SUYU_PAGEBITS]};
if (!paddr) {
return {};
@@ -139,7 +139,7 @@ struct Memory::Impl {
[[nodiscard]] u8* GetPointerFromDebugMemory(u64 vaddr) const {
const Common::PhysicalAddress paddr{
current_page_table->backing_addr[vaddr >> YUZU_PAGEBITS]};
current_page_table->backing_addr[vaddr >> SUYU_PAGEBITS]};
if (paddr == 0) {
return {};
@@ -248,8 +248,8 @@ struct Memory::Impl {
auto on_memory, auto on_rasterizer, auto increment) {
const auto& page_table = *current_page_table;
std::size_t remaining_size = size;
std::size_t page_index = addr >> YUZU_PAGEBITS;
std::size_t page_offset = addr & YUZU_PAGEMASK;
std::size_t page_index = addr >> SUYU_PAGEBITS;
std::size_t page_offset = addr & SUYU_PAGEMASK;
bool user_accessible = true;
if (!AddressSpaceContains(page_table, addr, size)) [[unlikely]] {
@@ -259,9 +259,9 @@ struct Memory::Impl {
while (remaining_size) {
const std::size_t copy_amount =
std::min(static_cast<std::size_t>(YUZU_PAGESIZE) - page_offset, remaining_size);
std::min(static_cast<std::size_t>(SUYU_PAGESIZE) - page_offset, remaining_size);
const auto current_vaddr =
static_cast<u64>((page_index << YUZU_PAGEBITS) + page_offset);
static_cast<u64>((page_index << SUYU_PAGEBITS) + page_offset);
const auto [pointer, type] = page_table.pointers[page_index].PointerType();
switch (type) {
@@ -272,7 +272,7 @@ struct Memory::Impl {
}
case Common::PageType::Memory: {
u8* mem_ptr =
reinterpret_cast<u8*>(pointer + page_offset + (page_index << YUZU_PAGEBITS));
reinterpret_cast<u8*>(pointer + page_offset + (page_index << SUYU_PAGEBITS));
on_memory(copy_amount, mem_ptr);
break;
}
@@ -337,16 +337,16 @@ struct Memory::Impl {
}
const u8* GetSpan(const VAddr src_addr, const std::size_t size) const {
if (current_page_table->blocks[src_addr >> YUZU_PAGEBITS] ==
current_page_table->blocks[(src_addr + size) >> YUZU_PAGEBITS]) {
if (current_page_table->blocks[src_addr >> SUYU_PAGEBITS] ==
current_page_table->blocks[(src_addr + size) >> SUYU_PAGEBITS]) {
return GetPointerSilent(src_addr);
}
return nullptr;
}
u8* GetSpan(const VAddr src_addr, const std::size_t size) {
if (current_page_table->blocks[src_addr >> YUZU_PAGEBITS] ==
current_page_table->blocks[(src_addr + size) >> YUZU_PAGEBITS]) {
if (current_page_table->blocks[src_addr >> SUYU_PAGEBITS] ==
current_page_table->blocks[(src_addr + size) >> SUYU_PAGEBITS]) {
return GetPointerSilent(src_addr);
}
return nullptr;
@@ -500,10 +500,10 @@ struct Memory::Impl {
// Iterate over a contiguous CPU address space, marking/unmarking the region.
// The region is at a granularity of CPU pages.
const u64 num_pages = ((vaddr + size - 1) >> YUZU_PAGEBITS) - (vaddr >> YUZU_PAGEBITS) + 1;
for (u64 i = 0; i < num_pages; ++i, vaddr += YUZU_PAGESIZE) {
const u64 num_pages = ((vaddr + size - 1) >> SUYU_PAGEBITS) - (vaddr >> SUYU_PAGEBITS) + 1;
for (u64 i = 0; i < num_pages; ++i, vaddr += SUYU_PAGESIZE) {
const Common::PageType page_type{
current_page_table->pointers[vaddr >> YUZU_PAGEBITS].Type()};
current_page_table->pointers[vaddr >> SUYU_PAGEBITS].Type()};
if (debug) {
// Switch page type to debug if now debug
switch (page_type) {
@@ -515,7 +515,7 @@ struct Memory::Impl {
// Page is already marked.
break;
case Common::PageType::Memory:
current_page_table->pointers[vaddr >> YUZU_PAGEBITS].Store(
current_page_table->pointers[vaddr >> SUYU_PAGEBITS].Store(
0, Common::PageType::DebugMemory);
break;
default:
@@ -532,9 +532,9 @@ struct Memory::Impl {
// Don't mess with already non-debug or rasterizer memory.
break;
case Common::PageType::DebugMemory: {
u8* const pointer{GetPointerFromDebugMemory(vaddr & ~YUZU_PAGEMASK)};
current_page_table->pointers[vaddr >> YUZU_PAGEBITS].Store(
reinterpret_cast<uintptr_t>(pointer) - (vaddr & ~YUZU_PAGEMASK),
u8* const pointer{GetPointerFromDebugMemory(vaddr & ~SUYU_PAGEMASK)};
current_page_table->pointers[vaddr >> SUYU_PAGEBITS].Store(
reinterpret_cast<uintptr_t>(pointer) - (vaddr & ~SUYU_PAGEMASK),
Common::PageType::Memory);
break;
}
@@ -566,10 +566,10 @@ struct Memory::Impl {
// granularity of CPU pages, hence why we iterate on a CPU page basis (note: GPU page size
// is different). This assumes the specified GPU address region is contiguous as well.
const u64 num_pages = ((vaddr + size - 1) >> YUZU_PAGEBITS) - (vaddr >> YUZU_PAGEBITS) + 1;
for (u64 i = 0; i < num_pages; ++i, vaddr += YUZU_PAGESIZE) {
const u64 num_pages = ((vaddr + size - 1) >> SUYU_PAGEBITS) - (vaddr >> SUYU_PAGEBITS) + 1;
for (u64 i = 0; i < num_pages; ++i, vaddr += SUYU_PAGESIZE) {
const Common::PageType page_type{
current_page_table->pointers[vaddr >> YUZU_PAGEBITS].Type()};
current_page_table->pointers[vaddr >> SUYU_PAGEBITS].Type()};
if (cached) {
// Switch page type to cached if now cached
switch (page_type) {
@@ -579,7 +579,7 @@ struct Memory::Impl {
break;
case Common::PageType::DebugMemory:
case Common::PageType::Memory:
current_page_table->pointers[vaddr >> YUZU_PAGEBITS].Store(
current_page_table->pointers[vaddr >> SUYU_PAGEBITS].Store(
0, Common::PageType::RasterizerCachedMemory);
break;
case Common::PageType::RasterizerCachedMemory:
@@ -602,16 +602,16 @@ struct Memory::Impl {
// that this area is already unmarked as cached.
break;
case Common::PageType::RasterizerCachedMemory: {
u8* const pointer{GetPointerFromRasterizerCachedMemory(vaddr & ~YUZU_PAGEMASK)};
u8* const pointer{GetPointerFromRasterizerCachedMemory(vaddr & ~SUYU_PAGEMASK)};
if (pointer == nullptr) {
// It's possible that this function has been called while updating the
// pagetable after unmapping a VMA. In that case the underlying VMA will no
// longer exist, and we should just leave the pagetable entry blank.
current_page_table->pointers[vaddr >> YUZU_PAGEBITS].Store(
current_page_table->pointers[vaddr >> SUYU_PAGEBITS].Store(
0, Common::PageType::Unmapped);
} else {
current_page_table->pointers[vaddr >> YUZU_PAGEBITS].Store(
reinterpret_cast<uintptr_t>(pointer) - (vaddr & ~YUZU_PAGEMASK),
current_page_table->pointers[vaddr >> SUYU_PAGEBITS].Store(
reinterpret_cast<uintptr_t>(pointer) - (vaddr & ~SUYU_PAGEMASK),
Common::PageType::Memory);
}
break;
@@ -637,7 +637,7 @@ struct Memory::Impl {
auto base = GetInteger(base_address);
LOG_DEBUG(HW_Memory, "Mapping {:016X} onto {:016X}-{:016X}", GetInteger(target),
base * YUZU_PAGESIZE, (base + size) * YUZU_PAGESIZE);
base * SUYU_PAGESIZE, (base + size) * SUYU_PAGESIZE);
const auto end = base + size;
ASSERT_MSG(end <= page_table.pointers.size(), "out of range mapping at {:016X}",
@@ -645,7 +645,7 @@ struct Memory::Impl {
if (!target) {
ASSERT_MSG(type != Common::PageType::Memory,
"Mapping memory page without a pointer @ {:016x}", base * YUZU_PAGESIZE);
"Mapping memory page without a pointer @ {:016x}", base * SUYU_PAGESIZE);
while (base != end) {
page_table.pointers[base].Store(0, type);
@@ -658,17 +658,17 @@ struct Memory::Impl {
while (base != end) {
auto host_ptr =
reinterpret_cast<uintptr_t>(system.DeviceMemory().GetPointer<u8>(target)) -
(base << YUZU_PAGEBITS);
auto backing = GetInteger(target) - (base << YUZU_PAGEBITS);
(base << SUYU_PAGEBITS);
auto backing = GetInteger(target) - (base << SUYU_PAGEBITS);
page_table.pointers[base].Store(host_ptr, type);
page_table.backing_addr[base] = backing;
page_table.blocks[base] = orig_base << YUZU_PAGEBITS;
page_table.blocks[base] = orig_base << SUYU_PAGEBITS;
ASSERT_MSG(page_table.pointers[base].Pointer(),
"memory mapping base yield a nullptr within the table");
base += 1;
target += YUZU_PAGESIZE;
target += SUYU_PAGESIZE;
}
}
}
@@ -683,7 +683,7 @@ struct Memory::Impl {
}
// Avoid adding any extra logic to this fast-path block
const uintptr_t raw_pointer = current_page_table->pointers[vaddr >> YUZU_PAGEBITS].Raw();
const uintptr_t raw_pointer = current_page_table->pointers[vaddr >> SUYU_PAGEBITS].Raw();
if (const uintptr_t pointer = Common::PageTable::PageInfo::ExtractPointer(raw_pointer)) {
return reinterpret_cast<u8*>(pointer + vaddr);
}
@@ -838,7 +838,7 @@ struct Memory::Impl {
};
gpu_device_memory->ApplyOpOnPointer(p, scratch_buffers[core], [&](DAddr address) {
auto& current_area = rasterizer_write_areas[core];
PAddr subaddress = address >> YUZU_PAGEBITS;
PAddr subaddress = address >> SUYU_PAGEBITS;
bool do_collection = current_area.last_address == subaddress;
if (!do_collection) [[unlikely]] {
do_collection = system.GPU().OnCPUWrite(address, size);
@@ -926,7 +926,7 @@ void Memory::ProtectRegion(Common::PageTable& page_table, Common::ProcessAddress
bool Memory::IsValidVirtualAddress(const Common::ProcessAddress vaddr) const {
const auto& page_table = *impl->current_page_table;
const size_t page = vaddr >> YUZU_PAGEBITS;
const size_t page = vaddr >> SUYU_PAGEBITS;
if (page >= page_table.pointers.size()) {
return false;
}
@@ -937,9 +937,9 @@ bool Memory::IsValidVirtualAddress(const Common::ProcessAddress vaddr) const {
bool Memory::IsValidVirtualAddressRange(Common::ProcessAddress base, u64 size) const {
Common::ProcessAddress end = base + size;
Common::ProcessAddress page = Common::AlignDown(GetInteger(base), YUZU_PAGESIZE);
Common::ProcessAddress page = Common::AlignDown(GetInteger(base), SUYU_PAGESIZE);
for (; page < end; page += YUZU_PAGESIZE) {
for (; page < end; page += SUYU_PAGESIZE) {
if (!IsValidVirtualAddress(page)) {
return false;
}

View File

@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2014 Citra Emulator Project
// SPDX-FileCopyrightText: 2014 Citra Emulator Project & 2024 suyu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
@@ -39,9 +39,9 @@ namespace Core::Memory {
* Page size used by the ARM architecture. This is the smallest granularity with which memory can
* be mapped.
*/
constexpr std::size_t YUZU_PAGEBITS = 12;
constexpr u64 YUZU_PAGESIZE = 1ULL << YUZU_PAGEBITS;
constexpr u64 YUZU_PAGEMASK = YUZU_PAGESIZE - 1;
constexpr std::size_t SUYU_PAGEBITS = 12;
constexpr u64 SUYU_PAGESIZE = 1ULL << SUYU_PAGEBITS;
constexpr u64 SUYU_PAGEMASK = SUYU_PAGESIZE - 1;
/// Virtual user-space memory regions
enum : u64 {

View File

@@ -261,7 +261,7 @@ struct CheatVmOpcode {
class DmntCheatVm {
public:
/// Helper Type for DmntCheatVm <=> yuzu Interface
/// Helper Type for DmntCheatVm <=> suyu Interface
class Callbacks {
public:
virtual ~Callbacks();

View File

@@ -51,7 +51,7 @@ void SaveToFile(const json& json, const std::filesystem::path& filename) {
file << std::setw(4) << json << std::endl;
}
json GetYuzuVersionData() {
json GetSuyuVersionData() {
return {
{"scm_rev", std::string(Common::g_scm_rev)},
{"scm_branch", std::string(Common::g_scm_branch)},
@@ -112,7 +112,7 @@ json GetProcessorStateData(const std::string& architecture, u64 entry_point, u64
json GetFullDataAuto(const std::string& timestamp, u64 title_id, Core::System& system) {
json out;
out["yuzu_version"] = GetYuzuVersionData();
out["suyu_version"] = GetSuyuVersionData();
out["report_common"] = GetReportCommonData(title_id, ResultSuccess, timestamp);
return out;
@@ -180,7 +180,7 @@ void Reporter::SaveCrashReport(u64 title_id, Result result, u64 set_flags, u64 e
const auto timestamp = GetTimestamp();
json out;
out["yuzu_version"] = GetYuzuVersionData();
out["suyu_version"] = GetSuyuVersionData();
out["report_common"] = GetReportCommonData(title_id, result, timestamp);
auto proc_out = GetProcessorStateData(arch, entry_point, sp, pc, pstate, registers, backtrace);
@@ -291,7 +291,7 @@ void Reporter::SavePlayReport(PlayReportType type, u64 title_id,
const auto timestamp = GetTimestamp();
json out;
out["yuzu_version"] = GetYuzuVersionData();
out["suyu_version"] = GetSuyuVersionData();
out["report_common"] = GetReportCommonData(title_id, ResultSuccess, timestamp, user_id);
auto data_out = json::array();
@@ -319,7 +319,7 @@ void Reporter::SaveErrorReport(u64 title_id, Result result,
const auto timestamp = GetTimestamp();
json out;
out["yuzu_version"] = GetYuzuVersionData();
out["suyu_version"] = GetSuyuVersionData();
out["report_common"] = GetReportCommonData(title_id, result, timestamp);
out["error_custom_text"] = {

View File

@@ -35,7 +35,7 @@ static u64 GenerateTelemetryId() {
mbedtls_entropy_context entropy;
mbedtls_entropy_init(&entropy);
mbedtls_ctr_drbg_context ctr_drbg;
static constexpr std::array<char, 18> personalization{{"yuzu Telemetry ID"}};
static constexpr std::array<char, 18> personalization{{"suyu Telemetry ID"}};
mbedtls_ctr_drbg_init(&ctr_drbg);
ASSERT(mbedtls_ctr_drbg_seed(&ctr_drbg, mbedtls_entropy_func, &entropy,
@@ -192,8 +192,8 @@ TelemetrySession::~TelemetrySession() {
#ifdef ENABLE_WEB_SERVICE
auto backend = std::make_unique<WebService::TelemetryJson>(
Settings::values.web_api_url.GetValue(), Settings::values.yuzu_username.GetValue(),
Settings::values.yuzu_token.GetValue());
Settings::values.web_api_url.GetValue(), Settings::values.suyu_username.GetValue(),
Settings::values.suyu_token.GetValue());
#else
auto backend = std::make_unique<Telemetry::NullVisitor>();
#endif
@@ -282,8 +282,8 @@ void TelemetrySession::AddInitialInfo(Loader::AppLoader& app_loader,
bool TelemetrySession::SubmitTestcase() {
#ifdef ENABLE_WEB_SERVICE
auto backend = std::make_unique<WebService::TelemetryJson>(
Settings::values.web_api_url.GetValue(), Settings::values.yuzu_username.GetValue(),
Settings::values.yuzu_token.GetValue());
Settings::values.web_api_url.GetValue(), Settings::values.suyu_username.GetValue(),
Settings::values.suyu_token.GetValue());
field_collection.Accept(*backend);
return backend->SubmitTestcase();
#else

View File

@@ -92,8 +92,8 @@ u64 RegenerateTelemetryId();
/**
* Verifies the username and token.
* @param username yuzu username to use for authentication.
* @param token yuzu token to use for authentication.
* @param username suyu username to use for authentication.
* @param token suyu token to use for authentication.
* @returns Future with bool indicating whether the verification succeeded
*/
bool VerifyLogin(const std::string& username, const std::string& token);