Compare commits

..

8 commits

Author SHA1 Message Date
361c24e21a
fix
All checks were successful
eden-license / license-header (pull_request) Successful in 23s
Signed-off-by: lizzie <lizzie@eden-emu.dev>
2025-09-27 00:43:17 +00:00
2c80917b85
no "guest" terminology
Signed-off-by: lizzie <lizzie@eden-emu.dev>
2025-09-27 00:43:17 +00:00
5c29c2671d
spellchecking
Signed-off-by: lizzie <lizzie@eden-emu.dev>
2025-09-27 00:43:17 +00:00
2ad860e363
[dist, docs] Clearer wording for settings, guidelines for new settings
Signed-off-by: lizzie <lizzie@eden-emu.dev>
2025-09-27 00:43:17 +00:00
020ad29a8c
[common] replace Common::BitSet with std::bitset (#2576)
Signed-off-by: lizzie <lizzie@eden-emu.dev>
Reviewed-on: #2576
Reviewed-by: crueter <crueter@eden-emu.dev>
Co-authored-by: lizzie <lizzie@eden-emu.dev>
Co-committed-by: lizzie <lizzie@eden-emu.dev>
2025-09-27 01:21:14 +02:00
4982dcfaa5
[cmake] Use siritConfig instead of the module (#2593)
Tested together with https://github.com/eden-emulator/sirit/pull/2

Signed-off-by: Marcin Serwin <marcin@serwin.dev>

Reviewed-on: #2593
Reviewed-by: crueter <crueter@eden-emu.dev>
Reviewed-by: MaranBr <maranbr@eden-emu.dev>
Co-authored-by: Marcin Serwin <marcin@serwin.dev>
Co-committed-by: Marcin Serwin <marcin@serwin.dev>
2025-09-27 01:02:49 +02:00
677148bdca
[cmake] PUBLIC link to mcl for dynarmic (#2595)
fixes comp error in core/arm

Signed-off-by: crueter <crueter@eden-emu.dev>

Reviewed-on: #2595
2025-09-27 01:02:34 +02:00
f088f028f3
[cmake] Fix building on aarch64-linux (#2591)
Reviewed-on: #2591
Reviewed-by: Lizzie <lizzie@eden-emu.dev>
Reviewed-by: crueter <crueter@eden-emu.dev>
Co-authored-by: Marcin Serwin <marcin@serwin.dev>
Co-committed-by: Marcin Serwin <marcin@serwin.dev>
2025-09-26 21:46:56 +02:00
11 changed files with 31 additions and 121 deletions

View file

@ -310,6 +310,7 @@ endif()
if (ARCHITECTURE_arm64 AND (ANDROID OR PLATFORM_LINUX)) if (ARCHITECTURE_arm64 AND (ANDROID OR PLATFORM_LINUX))
set(HAS_NCE 1) set(HAS_NCE 1)
add_compile_definitions(HAS_NCE=1) add_compile_definitions(HAS_NCE=1)
find_package(oaknut 2.0.1)
endif() endif()
if (YUZU_ROOM) if (YUZU_ROOM)

View file

@ -1,11 +0,0 @@
# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
# SPDX-License-Identifier: GPL-3.0-or-later
include(FindPackageHandleStandardArgs)
find_package(PkgConfig QUIET)
pkg_search_module(sirit QUIET IMPORTED_TARGET sirit)
find_package_handle_standard_args(sirit
REQUIRED_VARS sirit_LINK_LIBRARIES
VERSION_VAR sirit_VERSION
)

View file

@ -10,7 +10,7 @@
"repo": "eden-emulator/sirit", "repo": "eden-emulator/sirit",
"sha": "db1f1e8ab5", "sha": "db1f1e8ab5",
"hash": "73eb3a042848c63a10656545797e85f40d142009dfb7827384548a385e1e28e1ac72f42b25924ce530d58275f8638554281e884d72f9c7aaf4ed08690a414b05", "hash": "73eb3a042848c63a10656545797e85f40d142009dfb7827384548a385e1e28e1ac72f42b25924ce530d58275f8638554281e884d72f9c7aaf4ed08690a414b05",
"find_args": "MODULE", "find_args": "CONFIG",
"options": [ "options": [
"SIRIT_USE_SYSTEM_SPIRV_HEADERS ON" "SIRIT_USE_SYSTEM_SPIRV_HEADERS ON"
] ]

View file

@ -32,7 +32,6 @@ add_library(
atomic_ops.h atomic_ops.h
bit_cast.h bit_cast.h
bit_field.h bit_field.h
bit_set.h
bit_util.h bit_util.h
bounded_threadsafe_queue.h bounded_threadsafe_queue.h
cityhash.cpp cityhash.cpp

View file

@ -1,86 +0,0 @@
// SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include <array>
#include <bit>
#include "common/alignment.h"
#include "common/bit_util.h"
#include "common/common_types.h"
namespace Common {
namespace impl {
template <typename Storage, size_t N>
class BitSet {
public:
constexpr BitSet() = default;
constexpr void SetBit(size_t i) {
this->words[i / FlagsPerWord] |= GetBitMask(i % FlagsPerWord);
}
constexpr void ClearBit(size_t i) {
this->words[i / FlagsPerWord] &= ~GetBitMask(i % FlagsPerWord);
}
constexpr size_t CountLeadingZero() const {
for (size_t i = 0; i < NumWords; i++) {
if (this->words[i]) {
return FlagsPerWord * i + CountLeadingZeroImpl(this->words[i]);
}
}
return FlagsPerWord * NumWords;
}
constexpr size_t GetNextSet(size_t n) const {
for (size_t i = (n + 1) / FlagsPerWord; i < NumWords; i++) {
Storage word = this->words[i];
if (!IsAligned(n + 1, FlagsPerWord)) {
word &= GetBitMask(n % FlagsPerWord) - 1;
}
if (word) {
return FlagsPerWord * i + CountLeadingZeroImpl(word);
}
}
return FlagsPerWord * NumWords;
}
private:
static_assert(std::is_unsigned_v<Storage>);
static_assert(sizeof(Storage) <= sizeof(u64));
static constexpr size_t FlagsPerWord = BitSize<Storage>();
static constexpr size_t NumWords = AlignUp(N, FlagsPerWord) / FlagsPerWord;
static constexpr auto CountLeadingZeroImpl(Storage word) {
return std::countl_zero(static_cast<unsigned long long>(word)) -
(BitSize<unsigned long long>() - FlagsPerWord);
}
static constexpr Storage GetBitMask(size_t bit) {
return Storage(1) << (FlagsPerWord - 1 - bit);
}
std::array<Storage, NumWords> words{};
};
} // namespace impl
template <size_t N>
using BitSet8 = impl::BitSet<u8, N>;
template <size_t N>
using BitSet16 = impl::BitSet<u16, N>;
template <size_t N>
using BitSet32 = impl::BitSet<u32, N>;
template <size_t N>
using BitSet64 = impl::BitSet<u64, N>;
} // namespace Common

View file

@ -1224,7 +1224,7 @@ if (HAS_NCE)
arm/nce/patcher.h arm/nce/patcher.h
arm/nce/visitor_base.h arm/nce/visitor_base.h
) )
target_link_libraries(core PRIVATE merry::mcl merry::oaknut) target_link_libraries(core PRIVATE merry::oaknut)
endif() endif()
if (ARCHITECTURE_x86_64 OR ARCHITECTURE_arm64) if (ARCHITECTURE_x86_64 OR ARCHITECTURE_arm64)

View file

@ -27,11 +27,11 @@ template <>
struct std::hash<PatchCacheKey> { struct std::hash<PatchCacheKey> {
size_t operator()(const PatchCacheKey& key) const { size_t operator()(const PatchCacheKey& key) const {
// Simple XOR hash of first few bytes // Simple XOR hash of first few bytes
size_t hash = 0; size_t hash_ = 0;
for (size_t i = 0; i < key.module_id.size(); ++i) { for (size_t i = 0; i < key.module_id.size(); ++i) {
hash ^= static_cast<size_t>(key.module_id[i]) << ((i % sizeof(size_t)) * 8); hash_ ^= static_cast<size_t>(key.module_id[i]) << ((i % sizeof(size_t)) * 8);
} }
return hash ^ std::hash<uintptr_t>{}(key.offset); return hash_ ^ std::hash<uintptr_t>{}(key.offset);
} }
}; };

View file

@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project // SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later // SPDX-License-Identifier: GPL-2.0-or-later
@ -5,10 +8,11 @@
#include <array> #include <array>
#include <bit> #include <bit>
#include <bitset>
#include <concepts> #include <concepts>
#include <cstddef>
#include "common/assert.h" #include "common/assert.h"
#include "common/bit_set.h"
#include "common/common_types.h" #include "common/common_types.h"
#include "common/concepts.h" #include "common/concepts.h"
@ -159,7 +163,7 @@ public:
} }
if (m_queues[priority].PushBack(core, member)) { if (m_queues[priority].PushBack(core, member)) {
m_available_priorities[core].SetBit(priority); m_available_priorities[core].set(std::size_t(priority));
} }
} }
@ -172,7 +176,7 @@ public:
} }
if (m_queues[priority].PushFront(core, member)) { if (m_queues[priority].PushFront(core, member)) {
m_available_priorities[core].SetBit(priority); m_available_priorities[core].set(std::size_t(priority));
} }
} }
@ -185,14 +189,14 @@ public:
} }
if (m_queues[priority].Remove(core, member)) { if (m_queues[priority].Remove(core, member)) {
m_available_priorities[core].ClearBit(priority); m_available_priorities[core].reset(std::size_t(priority));
} }
} }
constexpr Member* GetFront(s32 core) const { constexpr Member* GetFront(s32 core) const {
ASSERT(IsValidCore(core)); ASSERT(IsValidCore(core));
const s32 priority = static_cast<s32>(m_available_priorities[core].CountLeadingZero()); const s32 priority = s32((~m_available_priorities[core]).count());
if (priority <= LowestPriority) { if (priority <= LowestPriority) {
return m_queues[priority].GetFront(core); return m_queues[priority].GetFront(core);
} else { } else {
@ -216,11 +220,14 @@ public:
Member* next = member->GetPriorityQueueEntry(core).GetNext(); Member* next = member->GetPriorityQueueEntry(core).GetNext();
if (next == nullptr) { if (next == nullptr) {
const s32 priority = static_cast<s32>( s32 priority = member->GetPriority() + 1;
m_available_priorities[core].GetNextSet(member->GetPriority())); do {
if (priority <= LowestPriority) { if (m_available_priorities[core][priority]) {
next = m_queues[priority].GetFront(core); next = m_queues[priority].GetFront(core);
} break;
}
++priority;
} while (priority <= LowestPriority && priority < s32(m_available_priorities[core].size()));
} }
return next; return next;
} }
@ -250,7 +257,7 @@ public:
private: private:
std::array<KPerCoreQueue, NumPriority> m_queues{}; std::array<KPerCoreQueue, NumPriority> m_queues{};
std::array<Common::BitSet64<NumPriority>, NumCores> m_available_priorities{}; std::array<std::bitset<NumPriority>, NumCores> m_available_priorities{};
}; };
private: private:

View file

@ -374,7 +374,7 @@ endif()
target_compile_options(dynarmic PRIVATE ${DYNARMIC_CXX_FLAGS}) target_compile_options(dynarmic PRIVATE ${DYNARMIC_CXX_FLAGS})
target_link_libraries(dynarmic target_link_libraries(dynarmic
PRIVATE PUBLIC
fmt::fmt fmt::fmt
merry::mcl merry::mcl
) )

View file

@ -69,7 +69,7 @@ std::unique_ptr<TranslationMap> InitializeTranslations(QObject* parent)
memory_layout_mode, memory_layout_mode,
tr("Memory Layout"), tr("Memory Layout"),
tr("Increases the amount of emulated RAM from 4GB of the board to the " tr("Increases the amount of emulated RAM from 4GB of the board to the "
"devkit 8/6GB.\nDoesn't affect performance/stability but allows HD texture " "devkit 8/6GB.\nDoesn't affect performance/stability but may allow HD texture "
"mods to load.")); "mods to load."));
INSERT(Settings, use_speed_limit, QString(), QString()); INSERT(Settings, use_speed_limit, QString(), QString());
INSERT(Settings, INSERT(Settings,
@ -98,7 +98,7 @@ std::unique_ptr<TranslationMap> InitializeTranslations(QObject* parent)
fast_cpu_time, fast_cpu_time,
tr("Fast CPU Time"), tr("Fast CPU Time"),
tr("Overclocks the emulated CPU to remove some FPS limiters. Weaker CPUs may see reduced performance, " tr("Overclocks the emulated CPU to remove some FPS limiters. Weaker CPUs may see reduced performance, "
"and certain games may behave improperly.\nUse Boost (1700MHz) to run at the highest native " "and certain games may behave improperly.\nUse Boost (1700MHz) to run at the Switch's highest native "
"clock, or Fast (2000MHz) to run at 2x clock.")); "clock, or Fast (2000MHz) to run at 2x clock."));
INSERT(Settings, use_custom_cpu_ticks, QString(), QString()); INSERT(Settings, use_custom_cpu_ticks, QString(), QString());
@ -189,7 +189,7 @@ std::unique_ptr<TranslationMap> InitializeTranslations(QObject* parent)
INSERT(Settings, INSERT(Settings,
aspect_ratio, aspect_ratio,
tr("Aspect Ratio:"), tr("Aspect Ratio:"),
tr("Stretches the renderer to fit the specified aspect ratio.\nMost programs only support " tr("Stretches the renderer to fit the specified aspect ratio.\nMost games only support "
"16:9, so modifications are required to get other ratios.\nAlso controls the " "16:9, so modifications are required to get other ratios.\nAlso controls the "
"aspect ratio of captured screenshots.")); "aspect ratio of captured screenshots."));
INSERT(Settings, INSERT(Settings,
@ -199,7 +199,7 @@ std::unique_ptr<TranslationMap> InitializeTranslations(QObject* parent)
"boots.\nDisabling it is only intended for debugging.")); "boots.\nDisabling it is only intended for debugging."));
INSERT(Settings, INSERT(Settings,
optimize_spirv_output, optimize_spirv_output,
tr("Optimize SPIRV shader"), tr("Optimize SPIRV output"),
tr("Runs an additional optimization pass over generated SPIRV shaders.\n" tr("Runs an additional optimization pass over generated SPIRV shaders.\n"
"Will increase time required for shader compilation.\nMay slightly improve " "Will increase time required for shader compilation.\nMay slightly improve "
"performance.\nThis feature is experimental.")); "performance.\nThis feature is experimental."));

View file

@ -373,13 +373,13 @@ bool ConfigureProfileManager::LoadAvatarData() {
const auto romfs = nca->GetRomFS(); const auto romfs = nca->GetRomFS();
if (!romfs) { if (!romfs) {
QMessageBox::warning(this, tr("Error loading archive"), QMessageBox::warning(this, tr("Error loading archive"),
tr("Archive does not contain romfs. It's probably corrupt.")); tr("Could not locate RomFS. Your file or decryption keys may be corrupted."));
return false; return false;
} }
const auto extracted = FileSys::ExtractRomFS(romfs); const auto extracted = FileSys::ExtractRomFS(romfs);
if (!extracted) { if (!extracted) {
QMessageBox::warning(this, tr("Error extracting archive"), QMessageBox::warning(this, tr("Error extracting archive"),
tr("Archive could not be extracted. It's probably corrupt.")); tr("Could not extract RomFS. Your file or decryption keys may be corrupted."));
return false; return false;
} }
const auto chara_dir = extracted->GetSubdirectory("chara"); const auto chara_dir = extracted->GetSubdirectory("chara");