early-access version 1662
This commit is contained in:
parent
60e7a70bd0
commit
0632b43f3b
@ -1,7 +1,7 @@
|
|||||||
yuzu emulator early access
|
yuzu emulator early access
|
||||||
=============
|
=============
|
||||||
|
|
||||||
This is the source code for early-access 1661.
|
This is the source code for early-access 1662.
|
||||||
|
|
||||||
## Legal Notice
|
## Legal Notice
|
||||||
|
|
||||||
|
@ -387,11 +387,9 @@ public:
|
|||||||
const VAddr bss_end_addr{
|
const VAddr bss_end_addr{
|
||||||
Common::AlignUp(bss_start + nro_header.bss_size, Kernel::PageSize)};
|
Common::AlignUp(bss_start + nro_header.bss_size, Kernel::PageSize)};
|
||||||
|
|
||||||
auto CopyCode{[&](VAddr src_addr, VAddr dst_addr, u64 size) {
|
const auto CopyCode = [this, process](VAddr src_addr, VAddr dst_addr, u64 size) {
|
||||||
std::vector<u8> source_data(size);
|
system.Memory().CopyBlock(*process, dst_addr, src_addr, size);
|
||||||
system.Memory().ReadBlock(src_addr, source_data.data(), source_data.size());
|
};
|
||||||
system.Memory().WriteBlock(dst_addr, source_data.data(), source_data.size());
|
|
||||||
}};
|
|
||||||
CopyCode(nro_addr + nro_header.segment_headers[TEXT_INDEX].memory_offset, text_start,
|
CopyCode(nro_addr + nro_header.segment_headers[TEXT_INDEX].memory_offset, text_start,
|
||||||
nro_header.segment_headers[TEXT_INDEX].memory_size);
|
nro_header.segment_headers[TEXT_INDEX].memory_size);
|
||||||
CopyCode(nro_addr + nro_header.segment_headers[RO_INDEX].memory_offset, ro_start,
|
CopyCode(nro_addr + nro_header.segment_headers[RO_INDEX].memory_offset, ro_start,
|
||||||
|
@ -139,15 +139,15 @@ std::optional<u64> NVFlinger::CreateLayer(u64 display_id) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const u64 layer_id = next_layer_id++;
|
const u64 layer_id = next_layer_id++;
|
||||||
CreateLayerAtId(display, layer_id);
|
CreateLayerAtId(*display, layer_id);
|
||||||
return 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++;
|
const u32 buffer_queue_id = next_buffer_queue_id++;
|
||||||
buffer_queues.emplace_back(
|
buffer_queues.emplace_back(
|
||||||
std::make_unique<BufferQueue>(system.Kernel(), buffer_queue_id, layer_id));
|
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) {
|
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);
|
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);
|
auto* const display = FindDisplay(display_id);
|
||||||
|
|
||||||
if (display == nullptr) {
|
if (display == nullptr) {
|
||||||
@ -247,9 +247,10 @@ VI::Layer* Service::NVFlinger::NVFlinger::FindOrCreateLayer(u64 display_id, u64
|
|||||||
|
|
||||||
if (layer == nullptr) {
|
if (layer == nullptr) {
|
||||||
LOG_DEBUG(Service, "Layer at id {} not found. Trying to create it.", layer_id);
|
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 display->FindLayer(layer_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
return layer;
|
return layer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,9 +61,6 @@ public:
|
|||||||
/// If an invalid display ID is specified, then an empty optional is returned.
|
/// If an invalid display ID is specified, then an empty optional is returned.
|
||||||
[[nodiscard]] std::optional<u64> CreateLayer(u64 display_id);
|
[[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.
|
/// Closes a layer on all displays for the given layer ID.
|
||||||
void CloseLayer(u64 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.
|
/// To be used when the system expects the specified ID to already exist.
|
||||||
[[nodiscard]] VI::Layer* FindOrCreateLayer(u64 display_id, u64 layer_id);
|
[[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);
|
static void VSyncThread(NVFlinger& nv_flinger);
|
||||||
|
|
||||||
void SplitVSync();
|
void SplitVSync();
|
||||||
|
Loading…
Reference in New Issue
Block a user