From 64e16a16291e10a8b9719bfd60ff9ce4417c7d32 Mon Sep 17 00:00:00 2001 From: pineappleEA Date: Tue, 3 Oct 2023 01:58:51 +0200 Subject: [PATCH] early-access version 3910 --- CMakeModules/GenerateSCMRev.cmake | 2 +- README.md | 2 +- .../renderer/command/mix/depop_prepare.h | 2 +- src/common/string_util.cpp | 5 +++++ src/common/string_util.h | 1 + src/core/debugger/gdbstub.cpp | 17 +++++++++++++++-- src/core/file_sys/program_metadata.cpp | 8 ++++++++ src/core/file_sys/program_metadata.h | 1 + src/core/file_sys/vfs.h | 2 +- src/core/hle/kernel/k_memory_layout.cpp | 2 +- src/core/hle/service/am/am.cpp | 10 ++++++---- src/core/hle/service/caps/caps_a.cpp | 18 +++++++++--------- src/core/hle/service/caps/caps_a.h | 3 ++- .../loader/deconstructed_rom_directory.cpp | 2 +- src/input_common/drivers/virtual_gamepad.h | 2 +- .../joycon_protocol/generic_functions.h | 2 +- .../backend/glasm/emit_glasm_composite.cpp | 2 +- src/video_core/dma_pusher.h | 2 +- src/video_core/texture_cache/image_base.h | 2 +- src/video_core/texture_cache/util.cpp | 2 +- src/video_core/vulkan_common/vulkan_device.h | 2 +- 21 files changed, 60 insertions(+), 29 deletions(-) diff --git a/CMakeModules/GenerateSCMRev.cmake b/CMakeModules/GenerateSCMRev.cmake index 40c6411f8..2f50cd734 100755 --- a/CMakeModules/GenerateSCMRev.cmake +++ b/CMakeModules/GenerateSCMRev.cmake @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2019 yuzu Emulator Project # SPDX-License-Identifier: GPL-2.0-or-later -# Gets a UTC timstamp and sets the provided variable to it +# Gets a UTC timestamp and sets the provided variable to it function(get_timestamp _var) string(TIMESTAMP timestamp UTC) set(${_var} "${timestamp}" PARENT_SCOPE) diff --git a/README.md b/README.md index 07bbeafac..85aaaf758 100755 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ yuzu emulator early access ============= -This is the source code for early-access 3909. +This is the source code for early-access 3910. ## Legal Notice diff --git a/src/audio_core/renderer/command/mix/depop_prepare.h b/src/audio_core/renderer/command/mix/depop_prepare.h index dee88878a..c32bc5764 100755 --- a/src/audio_core/renderer/command/mix/depop_prepare.h +++ b/src/audio_core/renderer/command/mix/depop_prepare.h @@ -16,7 +16,7 @@ namespace AudioCore::Renderer { /** * AudioRenderer command for preparing depop. - * Adds the previusly output last samples to the depop buffer. + * Adds the previously output last samples to the depop buffer. */ struct DepopPrepareCommand : ICommand { /** diff --git a/src/common/string_util.cpp b/src/common/string_util.cpp index d9b68cf12..eaa362a91 100755 --- a/src/common/string_util.cpp +++ b/src/common/string_util.cpp @@ -135,6 +135,11 @@ std::u16string UTF8ToUTF16(std::string_view input) { return convert.from_bytes(input.data(), input.data() + input.size()); } +std::u32string UTF8ToUTF32(std::string_view input) { + std::wstring_convert, char32_t> convert; + return convert.from_bytes(input.data(), input.data() + input.size()); +} + #ifdef _WIN32 static std::wstring CPToUTF16(u32 code_page, std::string_view input) { const auto size = diff --git a/src/common/string_util.h b/src/common/string_util.h index e8cc5ef26..068a6be2e 100755 --- a/src/common/string_util.h +++ b/src/common/string_util.h @@ -38,6 +38,7 @@ bool SplitPath(const std::string& full_path, std::string* _pPath, std::string* _ [[nodiscard]] std::string UTF16ToUTF8(std::u16string_view input); [[nodiscard]] std::u16string UTF8ToUTF16(std::string_view input); +[[nodiscard]] std::u32string UTF8ToUTF32(std::string_view input); #ifdef _WIN32 [[nodiscard]] std::string UTF16ToUTF8(std::wstring_view input); diff --git a/src/core/debugger/gdbstub.cpp b/src/core/debugger/gdbstub.cpp index 865ed809c..d92792ffd 100755 --- a/src/core/debugger/gdbstub.cpp +++ b/src/core/debugger/gdbstub.cpp @@ -2,6 +2,8 @@ // SPDX-License-Identifier: GPL-2.0-or-later #include +#include +#include #include #include #include @@ -12,6 +14,7 @@ #include "common/logging/log.h" #include "common/scope_exit.h" #include "common/settings.h" +#include "common/string_util.h" #include "core/arm/arm_interface.h" #include "core/core.h" #include "core/debugger/gdbstub.h" @@ -68,10 +71,16 @@ static std::string EscapeGDB(std::string_view data) { } static std::string EscapeXML(std::string_view data) { + std::u32string converted = U"[Encoding error]"; + try { + converted = Common::UTF8ToUTF32(data); + } catch (std::range_error&) { + } + std::string escaped; escaped.reserve(data.size()); - for (char c : data) { + for (char32_t c : converted) { switch (c) { case '&': escaped += "&"; @@ -86,7 +95,11 @@ static std::string EscapeXML(std::string_view data) { escaped += ">"; break; default: - escaped += c; + if (c > 0x7f) { + escaped += fmt::format("&#{};", static_cast(c)); + } else { + escaped += static_cast(c); + } break; } } diff --git a/src/core/file_sys/program_metadata.cpp b/src/core/file_sys/program_metadata.cpp index d51b51d7a..b26656624 100755 --- a/src/core/file_sys/program_metadata.cpp +++ b/src/core/file_sys/program_metadata.cpp @@ -5,6 +5,7 @@ #include #include "common/logging/log.h" +#include "common/scope_exit.h" #include "core/file_sys/program_metadata.h" #include "core/file_sys/vfs.h" #include "core/loader/loader.h" @@ -95,6 +96,13 @@ Loader::ResultStatus ProgramMetadata::Load(VirtualFile file) { return Loader::ResultStatus::Success; } +Loader::ResultStatus ProgramMetadata::Reload(VirtualFile file) { + const u64 original_program_id = aci_header.title_id; + SCOPE_EXIT({ aci_header.title_id = original_program_id; }); + + return this->Load(file); +} + /*static*/ ProgramMetadata ProgramMetadata::GetDefault() { // Allow use of cores 0~3 and thread priorities 1~63. constexpr u32 default_thread_info_capability = 0x30007F7; diff --git a/src/core/file_sys/program_metadata.h b/src/core/file_sys/program_metadata.h index 44d6ee266..2c6359c97 100755 --- a/src/core/file_sys/program_metadata.h +++ b/src/core/file_sys/program_metadata.h @@ -56,6 +56,7 @@ public: static ProgramMetadata GetDefault(); Loader::ResultStatus Load(VirtualFile file); + Loader::ResultStatus Reload(VirtualFile file); /// Load from parameters instead of NPDM file, used for KIP void LoadManual(bool is_64_bit, ProgramAddressSpaceType address_space, s32 main_thread_prio, diff --git a/src/core/file_sys/vfs.h b/src/core/file_sys/vfs.h index 536d2fa7c..844dad5f3 100755 --- a/src/core/file_sys/vfs.h +++ b/src/core/file_sys/vfs.h @@ -175,7 +175,7 @@ public: return Write(reinterpret_cast(&data), sizeof(T), offset); } - // Renames the file to name. Returns whether or not the operation was successsful. + // Renames the file to name. Returns whether or not the operation was successful. virtual bool Rename(std::string_view name) = 0; // Returns the full path of this file as a string, recursively diff --git a/src/core/hle/kernel/k_memory_layout.cpp b/src/core/hle/kernel/k_memory_layout.cpp index 27f18749a..a90e183ec 100755 --- a/src/core/hle/kernel/k_memory_layout.cpp +++ b/src/core/hle/kernel/k_memory_layout.cpp @@ -61,7 +61,7 @@ bool KMemoryRegionTree::Insert(u64 address, size_t size, u32 type_id, u32 new_at found->Reset(address, inserted_region_last, old_pair, new_attr, type_id); this->insert(*found); } else { - // If we can't re-use, adjust the old region. + // If we can't reuse, adjust the old region. found->Reset(old_address, address - 1, old_pair, old_attr, old_type); this->insert(*found); diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp index 73929e56e..8ab50992f 100755 --- a/src/core/hle/service/am/am.cpp +++ b/src/core/hle/service/am/am.cpp @@ -786,7 +786,9 @@ void ILockAccessor::TryLock(HLERequestContext& ctx) { IPC::RequestParser rp{ctx}; const auto return_handle = rp.Pop(); - LOG_INFO(Service_AM, "called, return_handle={}", return_handle); + LOG_WARNING(Service_AM, "(STUBBED) called, return_handle={}", return_handle); + + // TODO: When return_handle is true this function should return the lock handle is_locked = true; @@ -796,7 +798,7 @@ void ILockAccessor::TryLock(HLERequestContext& ctx) { } void ILockAccessor::Unlock(HLERequestContext& ctx) { - LOG_WARNING(Service_AM, "called"); + LOG_INFO(Service_AM, "called"); is_locked = false; @@ -805,7 +807,7 @@ void ILockAccessor::Unlock(HLERequestContext& ctx) { } void ILockAccessor::GetEvent(HLERequestContext& ctx) { - LOG_WARNING(Service_AM, "called"); + LOG_INFO(Service_AM, "called"); lock_event->Signal(); @@ -815,7 +817,7 @@ void ILockAccessor::GetEvent(HLERequestContext& ctx) { } void ILockAccessor::IsLocked(HLERequestContext& ctx) { - LOG_WARNING(Service_AM, "called"); + LOG_INFO(Service_AM, "called"); IPC::ResponseBuilder rb{ctx, 2}; rb.Push(ResultSuccess); diff --git a/src/core/hle/service/caps/caps_a.cpp b/src/core/hle/service/caps/caps_a.cpp index 1feb4b5e8..89d288954 100755 --- a/src/core/hle/service/caps/caps_a.cpp +++ b/src/core/hle/service/caps/caps_a.cpp @@ -40,7 +40,7 @@ IAlbumAccessorService::IAlbumAccessorService(Core::System& system_) {0, nullptr, "GetAlbumFileCount"}, {1, nullptr, "GetAlbumFileList"}, {2, nullptr, "LoadAlbumFile"}, - {3, &IAlbumAccessorService::DeleteAlbumFile, "DeleteAlbumFile"}, + {3, &IAlbumAccessorService::DeleteAlbumFile, "DeleteAlbumFile"}, {4, nullptr, "StorageCopyAlbumFile"}, {5, &IAlbumAccessorService::IsAlbumMounted, "IsAlbumMounted"}, {6, nullptr, "GetAlbumUsage"}, @@ -282,8 +282,8 @@ Result IAlbumAccessorService::GetAlbumEntry(AlbumEntry& out_entry, std::getline(line_stream, date, '_'); std::getline(line_stream, time, '_'); - std::istringstream line_stream2(date); - std::istringstream line_stream3(time); + std::istringstream date_stream(date); + std::istringstream time_stream(time); std::string year; std::string month; std::string day; @@ -291,13 +291,13 @@ Result IAlbumAccessorService::GetAlbumEntry(AlbumEntry& out_entry, std::string minute; std::string second; - std::getline(line_stream2, year, '-'); - std::getline(line_stream2, month, '-'); - std::getline(line_stream2, day, '-'); + std::getline(date_stream, year, '-'); + std::getline(date_stream, month, '-'); + std::getline(date_stream, day, '-'); - std::getline(line_stream3, hour, '-'); - std::getline(line_stream3, minute, '-'); - std::getline(line_stream3, second, '-'); + std::getline(time_stream, hour, '-'); + std::getline(time_stream, minute, '-'); + std::getline(time_stream, second, '-'); try { out_entry = { diff --git a/src/core/hle/service/caps/caps_a.h b/src/core/hle/service/caps/caps_a.h index 24c6b79c6..51931e71e 100755 --- a/src/core/hle/service/caps/caps_a.h +++ b/src/core/hle/service/caps/caps_a.h @@ -39,7 +39,7 @@ private: enum class ScreenShotOrientation : u32 { None, Rotate90, - Rotat180, + Rotate180, Rotate270, }; @@ -50,6 +50,7 @@ private: u32 unknown_2; INSERT_PADDING_BYTES(0x30); }; + static_assert(sizeof(ScreenShotAttribute) == 0x40, "ScreenShotAttribute is an invalid size"); struct ScreenShotDecodeOption { ScreenShotDecoderFlag flags; diff --git a/src/core/loader/deconstructed_rom_directory.cpp b/src/core/loader/deconstructed_rom_directory.cpp index db48ee7a9..730b19f32 100755 --- a/src/core/loader/deconstructed_rom_directory.cpp +++ b/src/core/loader/deconstructed_rom_directory.cpp @@ -118,7 +118,7 @@ AppLoader_DeconstructedRomDirectory::LoadResult AppLoader_DeconstructedRomDirect return {ResultStatus::ErrorMissingNPDM, {}}; } - const ResultStatus result2 = metadata.Load(npdm); + const ResultStatus result2 = metadata.Reload(npdm); if (result2 != ResultStatus::Success) { return {result2, {}}; } diff --git a/src/input_common/drivers/virtual_gamepad.h b/src/input_common/drivers/virtual_gamepad.h index dfbc45a28..3a40e3fd3 100755 --- a/src/input_common/drivers/virtual_gamepad.h +++ b/src/input_common/drivers/virtual_gamepad.h @@ -67,7 +67,7 @@ public: * @param player_index the player number that will take this action * @param delta_timestamp time passed since last reading * @param gyro_x,gyro_y,gyro_z the gyro sensor readings - * @param accel_x,accel_y,accel_z the acelerometer reading + * @param accel_x,accel_y,accel_z the accelerometer reading */ void SetMotionState(std::size_t player_index, u64 delta_timestamp, float gyro_x, float gyro_y, float gyro_z, float accel_x, float accel_y, float accel_z); diff --git a/src/input_common/helpers/joycon_protocol/generic_functions.h b/src/input_common/helpers/joycon_protocol/generic_functions.h index 90fcd17f6..b94567f82 100755 --- a/src/input_common/helpers/joycon_protocol/generic_functions.h +++ b/src/input_common/helpers/joycon_protocol/generic_functions.h @@ -55,7 +55,7 @@ public: /** * Configures the motion sensor with the specified parameters - * @param gsen gyroscope sensor sensitvity in degrees per second + * @param gsen gyroscope sensor sensitivity in degrees per second * @param gfrec gyroscope sensor frequency in hertz * @param asen accelerometer sensitivity in G force * @param afrec accelerometer frequency in hertz diff --git a/src/shader_recompiler/backend/glasm/emit_glasm_composite.cpp b/src/shader_recompiler/backend/glasm/emit_glasm_composite.cpp index 569712eaa..dd0582f0d 100755 --- a/src/shader_recompiler/backend/glasm/emit_glasm_composite.cpp +++ b/src/shader_recompiler/backend/glasm/emit_glasm_composite.cpp @@ -55,7 +55,7 @@ void CompositeInsert(EmitContext& ctx, IR::Inst& inst, Register composite, Objec "MOV.{} {}.{},{};", type, ret, composite, type, ret, swizzle, object); } else { - // The return value is alised so we can just insert the object, it doesn't matter if it's + // The return value is aliased so we can just insert the object, it doesn't matter if it's // aliased ctx.Add("MOV.{} {}.{},{};", type, ret, swizzle, object); } diff --git a/src/video_core/dma_pusher.h b/src/video_core/dma_pusher.h index 981fcffbe..78ae941ea 100755 --- a/src/video_core/dma_pusher.h +++ b/src/video_core/dma_pusher.h @@ -161,7 +161,7 @@ private: u32 method_count; ///< Current method count u32 length_pending; ///< Large NI command length pending GPUVAddr dma_get; ///< Currently read segment - u64 dma_word_offset; ///< Current word ofset from address + u64 dma_word_offset; ///< Current word offset from address bool non_incrementing; ///< Current command's NI flag bool is_last_call; }; diff --git a/src/video_core/texture_cache/image_base.h b/src/video_core/texture_cache/image_base.h index 3d247cb9e..0e74e9d9a 100755 --- a/src/video_core/texture_cache/image_base.h +++ b/src/video_core/texture_cache/image_base.h @@ -41,7 +41,7 @@ enum class ImageFlagBits : u32 { IsRescalable = 1 << 15, AsynchronousDecode = 1 << 16, - IsDecoding = 1 << 17, ///< Is currently being decoded asynchornously. + IsDecoding = 1 << 17, ///< Is currently being decoded asynchronously. }; DECLARE_ENUM_FLAG_OPERATORS(ImageFlagBits) diff --git a/src/video_core/texture_cache/util.cpp b/src/video_core/texture_cache/util.cpp index 45daeee97..76b0c6d48 100755 --- a/src/video_core/texture_cache/util.cpp +++ b/src/video_core/texture_cache/util.cpp @@ -1195,7 +1195,7 @@ std::optional FindSubresource(const ImageInfo& candidate, const return std::nullopt; } } else { - // Format comaptibility is not relaxed, ensure we are creating a view on a compatible format + // Format compatibility is not relaxed, ensure we are creating a view on a compatible format if (!IsViewCompatible(existing.format, candidate.format, broken_views, native_bgr)) { return std::nullopt; } diff --git a/src/video_core/vulkan_common/vulkan_device.h b/src/video_core/vulkan_common/vulkan_device.h index f292540bd..08247862a 100755 --- a/src/video_core/vulkan_common/vulkan_device.h +++ b/src/video_core/vulkan_common/vulkan_device.h @@ -314,7 +314,7 @@ public: return GetDriverID() != VK_DRIVER_ID_QUALCOMM_PROPRIETARY; } - /// Returns true if the device suppors float64 natively. + /// Returns true if the device supports float64 natively. bool IsFloat64Supported() const { return features.features.shaderFloat64; }