mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2026-09-17 16:41:28 +00:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4b03ec072f | |||
| 1203082a8f | |||
| 14235dc0d0 |
@@ -649,10 +649,10 @@ struct Values {
|
||||
|
||||
SwitchableSetting<bool> fix_bloom_effects{linkage, false, "fix_bloom_effects",
|
||||
Category::RendererHacks};
|
||||
|
||||
#ifdef __ANDROID__
|
||||
SwitchableSetting<bool> emulate_bgr565{linkage, false, "emulate_bgr565",
|
||||
Category::RendererHacks};
|
||||
|
||||
#endif
|
||||
SwitchableSetting<bool> rescale_hack{linkage, false, "rescale_hack",
|
||||
Category::RendererHacks};
|
||||
SwitchableSetting<bool> enable_gpu_buffer_readback{linkage,
|
||||
|
||||
@@ -38,7 +38,8 @@ void FreeMemoryPages(void* base, std::size_t size) noexcept;
|
||||
|
||||
/// A large page-aligned buffer that has optimized memory usage for zero-writes.
|
||||
template <typename T>
|
||||
requires std::is_trivially_copyable_v<T>
|
||||
// MSVC doesn't regard structs with atomics as trivially copyable
|
||||
// requires std::is_trivially_copyable_v<T>
|
||||
class SparseLargeVector final {
|
||||
public:
|
||||
constexpr SparseLargeVector() = default;
|
||||
|
||||
@@ -177,7 +177,7 @@ void ArmDynarmic32::MakeJit(Common::PageTable* page_table) {
|
||||
config.page_table = reinterpret_cast<std::array<std::uint8_t*, NumPageTableEntries>*>(
|
||||
const_cast<Common::PageTable::PageEntryData*>(page_table->entries.data()));
|
||||
config.page_table_pointer_mask = Common::PageTable::ATTRIBUTE_MASK;
|
||||
config.page_table_marked_bit = 0;
|
||||
config.page_table_marked_bit = uint8_t(0);
|
||||
config.absolute_offset_page_table = true;
|
||||
config.detect_misaligned_access_via_page_table = 16 | 32 | 64 | 128;
|
||||
config.only_detect_misalignment_via_page_table_on_page_boundary = true;
|
||||
@@ -193,7 +193,7 @@ void ArmDynarmic32::MakeJit(Common::PageTable* page_table) {
|
||||
Kernel::Board::Nintendo::Nx::KSystemControl::Init::GetIntendedMemorySize()) < (1ULL << 39)) {
|
||||
// Systems like FreeBSD allocate memory really low by default, and since we pack our page table entries,
|
||||
// we have to manually sign extend when our actual pointer is negative.
|
||||
config.page_table_sign_extension = Common::PageTable::SIGN_BIT;
|
||||
config.page_table_sign_extension = std::uint8_t(Common::PageTable::SIGN_BIT);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -216,7 +216,7 @@ void ArmDynarmic64::MakeJit(Common::PageTable* page_table, std::size_t address_s
|
||||
const_cast<Common::PageTable::PageEntryData*>(page_table->entries.data()));
|
||||
config.page_table_address_space_bits = std::uint32_t(address_space_bits);
|
||||
config.page_table_pointer_mask = Common::PageTable::ATTRIBUTE_MASK;
|
||||
config.page_table_marked_bit = 0;
|
||||
config.page_table_marked_bit = uint8_t(0);
|
||||
config.silently_mirror_page_table = false;
|
||||
config.absolute_offset_page_table = true;
|
||||
config.detect_misaligned_access_via_page_table = 16 | 32 | 64 | 128;
|
||||
@@ -235,7 +235,7 @@ void ArmDynarmic64::MakeJit(Common::PageTable* page_table, std::size_t address_s
|
||||
Kernel::Board::Nintendo::Nx::KSystemControl::Init::GetIntendedMemorySize()) < (1ULL << 39)) {
|
||||
// Systems like FreeBSD allocate memory really low by default, and since we pack our page table entries,
|
||||
// we have to manually sign extend when our actual pointer is negative.
|
||||
config.page_table_sign_extension = Common::PageTable::SIGN_BIT;
|
||||
config.page_table_sign_extension = std::uint8_t(Common::PageTable::SIGN_BIT);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -100,8 +100,7 @@ VirtualFile PatchIPS(const VirtualFile& in, const VirtualFile& ips) {
|
||||
|
||||
|
||||
struct IPSwitchRecord {
|
||||
std::array<uint8_t, 256 - sizeof(size_t)> data;
|
||||
size_t count;
|
||||
std::vector<uint8_t> data;
|
||||
};
|
||||
struct IPSwitchCompiler::IPSwitchPatch {
|
||||
::Common::unordered_map<u32, IPSwitchRecord> records;
|
||||
@@ -122,22 +121,23 @@ static IPSwitchRecord EscapeStringSequences(std::string_view sv) {
|
||||
IPSwitchRecord r{};
|
||||
for (auto it = sv.cbegin(); it < sv.cend(); ) {
|
||||
if (*it == '\\' && it + 1 < sv.cend()) {
|
||||
switch (it[1]) {
|
||||
case 'a': r.data[r.count] = '\a'; break;
|
||||
case 'b': r.data[r.count] = '\b'; break;
|
||||
case 'e': r.data[r.count] = '\e'; break;
|
||||
case 'f': r.data[r.count] = '\f'; break;
|
||||
case 'n': r.data[r.count] = '\n'; break;
|
||||
case 'r': r.data[r.count] = '\r'; break;
|
||||
case 't': r.data[r.count] = '\t'; break;
|
||||
case 'v': r.data[r.count] = '\v'; break;
|
||||
case '?': r.data[r.count] = '\?'; break;
|
||||
default: r.data[r.count] = it[1]; break;
|
||||
}
|
||||
++r.count;
|
||||
r.data.push_back([it]() {
|
||||
switch (it[1]) {
|
||||
case 'a': return '\a';
|
||||
case 'b': return '\b';
|
||||
case 'e': return '\e';
|
||||
case 'f': return '\f';
|
||||
case 'n': return '\n';
|
||||
case 'r': return '\r';
|
||||
case 't': return '\t';
|
||||
case 'v': return '\v';
|
||||
case '?': return '\?';
|
||||
default: return it[1];
|
||||
}
|
||||
}());
|
||||
it += 2;
|
||||
} else {
|
||||
++r.count;
|
||||
r.data.push_back(*it);
|
||||
++it;
|
||||
}
|
||||
}
|
||||
@@ -223,8 +223,8 @@ void IPSwitchCompiler::Parse(std::span<u8 const> bytes) {
|
||||
if (start <= line.cend() && end <= line.cend()) {
|
||||
// Actually IPS wants ordering from {lsb, ..., msb} -- so LE and BE are inverted, fun!
|
||||
auto const hs = Common::HexStringToVector({start, end}, is_little_endian);
|
||||
r.data.resize(hs.size());
|
||||
std::memcpy(r.data.data(), hs.data(), hs.size());
|
||||
r.count = hs.size();
|
||||
LOG_INFO(Loader, "[H] value @ {:#08X}", offset);
|
||||
patches.back().records.insert_or_assign(u32(offset), std::move(r));
|
||||
} else {
|
||||
@@ -293,7 +293,7 @@ VirtualFile IPSwitchCompiler::Apply(const VirtualFile& in) const {
|
||||
if (patch.enabled) {
|
||||
for (const auto& record : patch.records) {
|
||||
if (record.first < in_data.size()) {
|
||||
auto replace_size = record.second.count;
|
||||
auto replace_size = record.second.data.size();
|
||||
if (record.first + replace_size > in_data.size())
|
||||
replace_size = in_data.size() - record.first;
|
||||
std::memcpy(in_data.data() + record.first, record.second.data.data(), replace_size);
|
||||
|
||||
@@ -238,7 +238,7 @@ private:
|
||||
|
||||
Result GetSocketDescriptor(Out<u32> out_fd) {
|
||||
LOG_WARNING(Service_SSL, "(STUBBED)");
|
||||
*out_fd = socket->GetFD();
|
||||
*out_fd = uint32_t(socket->GetFD());
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
|
||||
@@ -993,7 +993,11 @@ bool Device::HasTimelineSemaphore() const {
|
||||
}
|
||||
|
||||
bool Device::MustEmulateBGR565() const {
|
||||
#ifdef __ANDROID__
|
||||
return Settings::values.emulate_bgr565.GetValue();
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool Device::GetSuitability(bool requires_swapchain) {
|
||||
|
||||
@@ -774,7 +774,7 @@ Builder::~Builder() = default;
|
||||
|
||||
static bool IsAndroidOnly(const Settings::BasicSetting& setting) {
|
||||
const std::string& label = setting.GetLabel();
|
||||
return label.starts_with("frame_gen") || label == "emulate_bgr565";
|
||||
return label.starts_with("frame_gen");
|
||||
}
|
||||
|
||||
Widget* Builder::BuildWidget(Settings::BasicSetting* setting,
|
||||
|
||||
Reference in New Issue
Block a user