early-access version 1662

This commit is contained in:
pineappleEA 2021-05-07 19:41:23 +02:00
parent 60e7a70bd0
commit 0632b43f3b
4 changed files with 13 additions and 14 deletions

View file

@ -1,7 +1,7 @@
yuzu emulator early access
=============
This is the source code for early-access 1661.
This is the source code for early-access 1662.
## Legal Notice

View file

@ -387,11 +387,9 @@ public:
const VAddr bss_end_addr{
Common::AlignUp(bss_start + nro_header.bss_size, Kernel::PageSize)};
auto CopyCode{[&](VAddr src_addr, VAddr dst_addr, u64 size) {
std::vector<u8> source_data(size);
system.Memory().ReadBlock(src_addr, source_data.data(), source_data.size());
system.Memory().WriteBlock(dst_addr, source_data.data(), source_data.size());
}};
const auto CopyCode = [this, process](VAddr src_addr, VAddr dst_addr, u64 size) {
system.Memory().CopyBlock(*process, dst_addr, src_addr, size);
};
CopyCode(nro_addr + nro_header.segment_headers[TEXT_INDEX].memory_offset, text_start,
nro_header.segment_headers[TEXT_INDEX].memory_size);
CopyCode(nro_addr + nro_header.segment_headers[RO_INDEX].memory_offset, ro_start,

View file

@ -139,15 +139,15 @@ std::optional<u64> NVFlinger::CreateLayer(u64 display_id) {
}
const u64 layer_id = next_layer_id++;
CreateLayerAtId(display, layer_id);
CreateLayerAtId(*display, layer_id);
return layer_id;
}
void NVFlinger::CreateLayerAtId(VI::Display* display, u64 layer_id) {
void NVFlinger::CreateLayerAtId(VI::Display& display, u64 layer_id) {
const u32 buffer_queue_id = next_buffer_queue_id++;
buffer_queues.emplace_back(
std::make_unique<BufferQueue>(system.Kernel(), buffer_queue_id, layer_id));
display->CreateLayer(layer_id, *buffer_queues.back());
display.CreateLayer(layer_id, *buffer_queues.back());
}
void NVFlinger::CloseLayer(u64 layer_id) {
@ -236,7 +236,7 @@ const VI::Layer* NVFlinger::FindLayer(u64 display_id, u64 layer_id) const {
return display->FindLayer(layer_id);
}
VI::Layer* Service::NVFlinger::NVFlinger::FindOrCreateLayer(u64 display_id, u64 layer_id) {
VI::Layer* NVFlinger::FindOrCreateLayer(u64 display_id, u64 layer_id) {
auto* const display = FindDisplay(display_id);
if (display == nullptr) {
@ -247,9 +247,10 @@ VI::Layer* Service::NVFlinger::NVFlinger::FindOrCreateLayer(u64 display_id, u64
if (layer == nullptr) {
LOG_DEBUG(Service, "Layer at id {} not found. Trying to create it.", layer_id);
CreateLayerAtId(display, layer_id);
CreateLayerAtId(*display, layer_id);
return display->FindLayer(layer_id);
}
return layer;
}

View file

@ -61,9 +61,6 @@ public:
/// If an invalid display ID is specified, then an empty optional is returned.
[[nodiscard]] std::optional<u64> CreateLayer(u64 display_id);
/// Creates a layer with the specified layer ID in the desired display.
void CreateLayerAtId(VI::Display* display, u64 layer_id);
/// Closes a layer on all displays for the given layer ID.
void CloseLayer(u64 layer_id);
@ -108,6 +105,9 @@ private:
/// To be used when the system expects the specified ID to already exist.
[[nodiscard]] VI::Layer* FindOrCreateLayer(u64 display_id, u64 layer_id);
/// Creates a layer with the specified layer ID in the desired display.
void CreateLayerAtId(VI::Display& display, u64 layer_id);
static void VSyncThread(NVFlinger& nv_flinger);
void SplitVSync();