early-access version 2896

This commit is contained in:
pineappleEA 2022-08-10 05:03:38 +02:00
parent 3a1b8212aa
commit d347b68f4a
8 changed files with 41 additions and 58 deletions

View file

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

View file

@ -195,14 +195,16 @@ std::shared_ptr<Dynarmic::A32::Jit> ARM_Dynarmic_32::MakeJit(Common::PageTable*
if (page_table) {
config.page_table = reinterpret_cast<std::array<std::uint8_t*, NUM_PAGE_TABLE_ENTRIES>*>(
page_table->pointers.data());
config.absolute_offset_page_table = true;
config.page_table_pointer_mask_bits = Common::PageTable::ATTRIBUTE_BITS;
config.detect_misaligned_access_via_page_table = 16 | 32 | 64 | 128;
config.only_detect_misalignment_via_page_table_on_page_boundary = true;
config.fastmem_pointer = page_table->fastmem_arena;
config.fastmem_exclusive_access = config.fastmem_pointer != nullptr;
config.recompile_on_exclusive_fastmem_failure = true;
}
config.absolute_offset_page_table = true;
config.page_table_pointer_mask_bits = Common::PageTable::ATTRIBUTE_BITS;
config.detect_misaligned_access_via_page_table = 16 | 32 | 64 | 128;
config.only_detect_misalignment_via_page_table_on_page_boundary = true;
config.fastmem_exclusive_access = true;
config.recompile_on_exclusive_fastmem_failure = true;
// Multi-process state
config.processor_id = core_index;
@ -254,6 +256,7 @@ std::shared_ptr<Dynarmic::A32::Jit> ARM_Dynarmic_32::MakeJit(Common::PageTable*
}
if (!Settings::values.cpuopt_fastmem) {
config.fastmem_pointer = nullptr;
config.fastmem_exclusive_access = false;
}
if (!Settings::values.cpuopt_fastmem_exclusives) {
config.fastmem_exclusive_access = false;

View file

@ -250,7 +250,7 @@ std::shared_ptr<Dynarmic::A64::Jit> ARM_Dynarmic_64::MakeJit(Common::PageTable*
config.fastmem_address_space_bits = address_space_bits;
config.silently_mirror_fastmem = false;
config.fastmem_exclusive_access = true;
config.fastmem_exclusive_access = config.fastmem_pointer != nullptr;
config.recompile_on_exclusive_fastmem_failure = true;
}
@ -314,6 +314,7 @@ std::shared_ptr<Dynarmic::A64::Jit> ARM_Dynarmic_64::MakeJit(Common::PageTable*
}
if (!Settings::values.cpuopt_fastmem) {
config.fastmem_pointer = nullptr;
config.fastmem_exclusive_access = false;
}
if (!Settings::values.cpuopt_fastmem_exclusives) {
config.fastmem_exclusive_access = false;

View file

@ -86,54 +86,16 @@ void EmulatedController::ReloadFromSettings() {
}
controller.colors_state.fullkey = {
.body =
{
.b = static_cast<u8>((player.body_color_left >> 16) & 0xFF),
.g = static_cast<u8>((player.body_color_left >> 8) & 0xFF),
.r = static_cast<u8>(player.body_color_left & 0xFF),
.a = 0xff,
},
.button =
{
.b = static_cast<u8>((player.button_color_left >> 16) & 0xFF),
.g = static_cast<u8>((player.button_color_left >> 8) & 0xFF),
.r = static_cast<u8>(player.button_color_left & 0xFF),
.a = 0xff,
},
.body = GetNpadColor(player.body_color_left),
.button = GetNpadColor(player.button_color_left),
};
controller.colors_state.left = {
.body =
{
.b = static_cast<u8>((player.body_color_left >> 16) & 0xFF),
.g = static_cast<u8>((player.body_color_left >> 8) & 0xFF),
.r = static_cast<u8>(player.body_color_left & 0xFF),
.a = 0xff,
},
.button =
{
.b = static_cast<u8>((player.button_color_left >> 16) & 0xFF),
.g = static_cast<u8>((player.button_color_left >> 8) & 0xFF),
.r = static_cast<u8>(player.button_color_left & 0xFF),
.a = 0xff,
},
.body = GetNpadColor(player.body_color_left),
.button = GetNpadColor(player.button_color_left),
};
controller.colors_state.right = {
.body =
{
.b = static_cast<u8>((player.body_color_right >> 16) & 0xFF),
.g = static_cast<u8>((player.body_color_right >> 8) & 0xFF),
.r = static_cast<u8>(player.body_color_right & 0xFF),
.a = 0xff,
},
.button =
{
.b = static_cast<u8>((player.button_color_right >> 16) & 0xFF),
.g = static_cast<u8>((player.button_color_right >> 8) & 0xFF),
.r = static_cast<u8>(player.button_color_right & 0xFF),
.a = 0xff,
},
controller.colors_state.left = {
.body = GetNpadColor(player.body_color_right),
.button = GetNpadColor(player.button_color_right),
};
// Other or debug controller should always be a pro controller
@ -1386,6 +1348,15 @@ const CameraState& EmulatedController::GetCamera() const {
return controller.camera_state;
}
NpadColor EmulatedController::GetNpadColor(u32 color) {
return {
.r = static_cast<u8>((color >> 16) & 0xFF),
.g = static_cast<u8>((color >> 8) & 0xFF),
.b = static_cast<u8>(color & 0xFF),
.a = 0xff,
};
}
void EmulatedController::TriggerOnChange(ControllerTriggerType type, bool is_npad_service_update) {
std::scoped_lock lock{callback_mutex};
for (const auto& poller_pair : callback_list) {

View file

@ -424,6 +424,13 @@ private:
*/
void SetCamera(const Common::Input::CallbackStatus& callback);
/**
* Converts a color format from bgra to rgba
* @param color in bgra format
* @return NpadColor in rgba format
*/
NpadColor GetNpadColor(u32 color);
/**
* Triggers a callback that something has changed on the controller status
* @param type Input type of the event to trigger

View file

@ -328,9 +328,9 @@ struct TouchState {
static_assert(sizeof(TouchState) == 0x28, "Touchstate is an invalid size");
struct NpadColor {
u8 b{};
u8 g{};
u8 r{};
u8 g{};
u8 b{};
u8 a{};
};
static_assert(sizeof(NpadColor) == 4, "NpadColor is an invalid size");

View file

@ -33,10 +33,11 @@ VkSurfaceFormatKHR ChooseSwapSurfaceFormat(vk::Span<VkSurfaceFormatKHR> formats)
}
VkPresentModeKHR ChooseSwapPresentMode(vk::Span<VkPresentModeKHR> modes) {
// Mailbox doesn't lock the application like fifo (vsync), prefer it
// Mailbox (triple buffering) doesn't lock the application like fifo (vsync),
// prefer it if vsync option is not selected
const auto found_mailbox = std::find(modes.begin(), modes.end(), VK_PRESENT_MODE_MAILBOX_KHR);
if (Settings::values.fullscreen_mode.GetValue() == Settings::FullscreenMode::Borderless &&
found_mailbox != modes.end()) {
found_mailbox != modes.end() && !Settings::values.use_vsync.GetValue()) {
return VK_PRESENT_MODE_MAILBOX_KHR;
}
if (!Settings::values.use_speed_limit.GetValue()) {

View file

@ -75,7 +75,7 @@
<string>VSync prevents the screen from tearing, but some graphics cards have lower performance with VSync enabled. Keep it enabled if you don't notice a performance difference.</string>
</property>
<property name="text">
<string>Use VSync (OpenGL only)</string>
<string>Use VSync</string>
</property>
</widget>
</item>