diff options
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/api_version.h | 14 | ||||
-rw-r--r-- | src/core/hle/service/am/applets/applet_software_keyboard.cpp | 6 | ||||
-rw-r--r-- | src/core/hle/service/ns/language.cpp | 1 | ||||
-rw-r--r-- | src/core/hle/service/nvdrv/devices/nvhost_nvdec_common.cpp | 58 | ||||
-rw-r--r-- | src/core/hle/service/nvdrv/devices/nvhost_nvdec_common.h | 45 | ||||
-rw-r--r-- | src/core/hle/service/set/set.cpp | 23 | ||||
-rw-r--r-- | src/core/hle/service/set/set.h | 1 | ||||
-rw-r--r-- | src/core/network/network.cpp | 2 |
8 files changed, 31 insertions, 119 deletions
diff --git a/src/core/hle/api_version.h b/src/core/hle/api_version.h index 5e10a7ad9..43d5670a9 100644 --- a/src/core/hle/api_version.h +++ b/src/core/hle/api_version.h @@ -12,9 +12,9 @@ namespace HLE::ApiVersion { // Horizon OS version constants. -constexpr u8 HOS_VERSION_MAJOR = 11; -constexpr u8 HOS_VERSION_MINOR = 0; -constexpr u8 HOS_VERSION_MICRO = 1; +constexpr u8 HOS_VERSION_MAJOR = 12; +constexpr u8 HOS_VERSION_MINOR = 1; +constexpr u8 HOS_VERSION_MICRO = 0; // NintendoSDK version constants. @@ -22,15 +22,15 @@ constexpr u8 SDK_REVISION_MAJOR = 1; constexpr u8 SDK_REVISION_MINOR = 0; constexpr char PLATFORM_STRING[] = "NX"; -constexpr char VERSION_HASH[] = "69103fcb2004dace877094c2f8c29e6113be5dbf"; -constexpr char DISPLAY_VERSION[] = "11.0.1"; -constexpr char DISPLAY_TITLE[] = "NintendoSDK Firmware for NX 11.0.1-1.0"; +constexpr char VERSION_HASH[] = "76b10c2dab7d3aa73fc162f8dff1655e6a21caf4"; +constexpr char DISPLAY_VERSION[] = "12.1.0"; +constexpr char DISPLAY_TITLE[] = "NintendoSDK Firmware for NX 12.1.0-1.0"; // Atmosphere version constants. constexpr u8 ATMOSPHERE_RELEASE_VERSION_MAJOR = 0; constexpr u8 ATMOSPHERE_RELEASE_VERSION_MINOR = 19; -constexpr u8 ATMOSPHERE_RELEASE_VERSION_MICRO = 4; +constexpr u8 ATMOSPHERE_RELEASE_VERSION_MICRO = 5; constexpr u32 GetTargetFirmware() { return u32{HOS_VERSION_MAJOR} << 24 | u32{HOS_VERSION_MINOR} << 16 | diff --git a/src/core/hle/service/am/applets/applet_software_keyboard.cpp b/src/core/hle/service/am/applets/applet_software_keyboard.cpp index 7cae90609..c89aa1bbf 100644 --- a/src/core/hle/service/am/applets/applet_software_keyboard.cpp +++ b/src/core/hle/service/am/applets/applet_software_keyboard.cpp @@ -377,7 +377,8 @@ void SoftwareKeyboard::SubmitForTextCheck(std::u16string submitted_text) { if (swkbd_config_common.use_utf8) { std::string utf8_submitted_text = Common::UTF16ToUTF8(current_text); - const u64 buffer_size = sizeof(u64) + utf8_submitted_text.size(); + // Include the null terminator in the buffer size. + const u64 buffer_size = utf8_submitted_text.size() + 1; LOG_DEBUG(Service_AM, "\nBuffer Size: {}\nUTF-8 Submitted Text: {}", buffer_size, utf8_submitted_text); @@ -386,7 +387,8 @@ void SoftwareKeyboard::SubmitForTextCheck(std::u16string submitted_text) { std::memcpy(out_data.data() + sizeof(u64), utf8_submitted_text.data(), utf8_submitted_text.size()); } else { - const u64 buffer_size = sizeof(u64) + current_text.size() * sizeof(char16_t); + // Include the null terminator in the buffer size. + const u64 buffer_size = (current_text.size() + 1) * sizeof(char16_t); LOG_DEBUG(Service_AM, "\nBuffer Size: {}\nUTF-16 Submitted Text: {}", buffer_size, Common::UTF16ToUTF8(current_text)); diff --git a/src/core/hle/service/ns/language.cpp b/src/core/hle/service/ns/language.cpp index 54b644830..7d9e4a20b 100644 --- a/src/core/hle/service/ns/language.cpp +++ b/src/core/hle/service/ns/language.cpp @@ -339,6 +339,7 @@ std::optional<ApplicationLanguage> ConvertToApplicationLanguage( case Set::LanguageCode::FR_CA: return ApplicationLanguage::CanadianFrench; case Set::LanguageCode::PT: + case Set::LanguageCode::PT_BR: return ApplicationLanguage::Portuguese; case Set::LanguageCode::RU: return ApplicationLanguage::Russian; diff --git a/src/core/hle/service/nvdrv/devices/nvhost_nvdec_common.cpp b/src/core/hle/service/nvdrv/devices/nvhost_nvdec_common.cpp index 1403a39d0..845de724d 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_nvdec_common.cpp +++ b/src/core/hle/service/nvdrv/devices/nvhost_nvdec_common.cpp @@ -166,8 +166,6 @@ NvResult nvhost_nvdec_common::MapBuffer(const std::vector<u8>& input, std::vecto LOG_ERROR(Service_NVDRV, "failed to map size={}", object->size); } else { cmd_buffer.map_address = object->dma_map_addr; - AddBufferMap(object->dma_map_addr, object->size, object->addr, - object->status == nvmap::Object::Status::Allocated); } } std::memcpy(output.data(), ¶ms, sizeof(IoctlMapBuffer)); @@ -178,30 +176,11 @@ NvResult nvhost_nvdec_common::MapBuffer(const std::vector<u8>& input, std::vecto } NvResult nvhost_nvdec_common::UnmapBuffer(const std::vector<u8>& input, std::vector<u8>& output) { - IoctlMapBuffer params{}; - std::memcpy(¶ms, input.data(), sizeof(IoctlMapBuffer)); - std::vector<MapBufferEntry> cmd_buffer_handles(params.num_entries); - SliceVectors(input, cmd_buffer_handles, params.num_entries, sizeof(IoctlMapBuffer)); - - auto& gpu = system.GPU(); - - for (auto& cmd_buffer : cmd_buffer_handles) { - const auto object{nvmap_dev->GetObject(cmd_buffer.map_handle)}; - if (!object) { - LOG_ERROR(Service_NVDRV, "invalid cmd_buffer nvmap_handle={:X}", cmd_buffer.map_handle); - std::memcpy(output.data(), ¶ms, output.size()); - return NvResult::InvalidState; - } - if (const auto size{RemoveBufferMap(object->dma_map_addr)}; size) { - gpu.MemoryManager().Unmap(object->dma_map_addr, *size); - } else { - // This occurs quite frequently, however does not seem to impact functionality - LOG_DEBUG(Service_NVDRV, "invalid offset=0x{:X} dma=0x{:X}", object->addr, - object->dma_map_addr); - } - object->dma_map_addr = 0; - } + // This is intntionally stubbed. + // Skip unmapping buffers here, as to not break the continuity of the VP9 reference frame + // addresses, and risk invalidating data before the async GPU thread is done with it std::memset(output.data(), 0, output.size()); + LOG_DEBUG(Service_NVDRV, "(STUBBED) called"); return NvResult::Success; } @@ -212,33 +191,4 @@ NvResult nvhost_nvdec_common::SetSubmitTimeout(const std::vector<u8>& input, return NvResult::Success; } -std::optional<nvhost_nvdec_common::BufferMap> nvhost_nvdec_common::FindBufferMap( - GPUVAddr gpu_addr) const { - const auto it = std::find_if( - buffer_mappings.begin(), buffer_mappings.upper_bound(gpu_addr), [&](const auto& entry) { - return (gpu_addr >= entry.second.StartAddr() && gpu_addr < entry.second.EndAddr()); - }); - - ASSERT(it != buffer_mappings.end()); - return it->second; -} - -void nvhost_nvdec_common::AddBufferMap(GPUVAddr gpu_addr, std::size_t size, VAddr cpu_addr, - bool is_allocated) { - buffer_mappings.insert_or_assign(gpu_addr, BufferMap{gpu_addr, size, cpu_addr, is_allocated}); -} - -std::optional<std::size_t> nvhost_nvdec_common::RemoveBufferMap(GPUVAddr gpu_addr) { - const auto iter{buffer_mappings.find(gpu_addr)}; - if (iter == buffer_mappings.end()) { - return std::nullopt; - } - std::size_t size = 0; - if (iter->second.IsAllocated()) { - size = iter->second.Size(); - } - buffer_mappings.erase(iter); - return size; -} - } // namespace Service::Nvidia::Devices diff --git a/src/core/hle/service/nvdrv/devices/nvhost_nvdec_common.h b/src/core/hle/service/nvdrv/devices/nvhost_nvdec_common.h index da10f5f41..af59f00d2 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_nvdec_common.h +++ b/src/core/hle/service/nvdrv/devices/nvhost_nvdec_common.h @@ -23,45 +23,6 @@ public: ~nvhost_nvdec_common() override; protected: - class BufferMap final { - public: - constexpr BufferMap() = default; - - constexpr BufferMap(GPUVAddr start_addr_, std::size_t size_) - : start_addr{start_addr_}, end_addr{start_addr_ + size_} {} - - constexpr BufferMap(GPUVAddr start_addr_, std::size_t size_, VAddr cpu_addr_, - bool is_allocated_) - : start_addr{start_addr_}, end_addr{start_addr_ + size_}, cpu_addr{cpu_addr_}, - is_allocated{is_allocated_} {} - - constexpr VAddr StartAddr() const { - return start_addr; - } - - constexpr VAddr EndAddr() const { - return end_addr; - } - - constexpr std::size_t Size() const { - return end_addr - start_addr; - } - - constexpr VAddr CpuAddr() const { - return cpu_addr; - } - - constexpr bool IsAllocated() const { - return is_allocated; - } - - private: - GPUVAddr start_addr{}; - GPUVAddr end_addr{}; - VAddr cpu_addr{}; - bool is_allocated{}; - }; - struct IoctlSetNvmapFD { s32_le nvmap_fd{}; }; @@ -154,17 +115,11 @@ protected: NvResult UnmapBuffer(const std::vector<u8>& input, std::vector<u8>& output); NvResult SetSubmitTimeout(const std::vector<u8>& input, std::vector<u8>& output); - std::optional<BufferMap> FindBufferMap(GPUVAddr gpu_addr) const; - void AddBufferMap(GPUVAddr gpu_addr, std::size_t size, VAddr cpu_addr, bool is_allocated); - std::optional<std::size_t> RemoveBufferMap(GPUVAddr gpu_addr); - s32_le nvmap_fd{}; u32_le submit_timeout{}; std::shared_ptr<nvmap> nvmap_dev; SyncpointManager& syncpoint_manager; std::array<u32, MaxSyncPoints> device_syncpoints{}; - // This is expected to be ordered, therefore we must use a map, not unordered_map - std::map<GPUVAddr, BufferMap> buffer_mappings; }; }; // namespace Devices } // namespace Service::Nvidia diff --git a/src/core/hle/service/set/set.cpp b/src/core/hle/service/set/set.cpp index 522a604a5..8795eb6b7 100644 --- a/src/core/hle/service/set/set.cpp +++ b/src/core/hle/service/set/set.cpp @@ -12,7 +12,7 @@ namespace Service::Set { namespace { -constexpr std::array<LanguageCode, 17> available_language_codes = {{ +constexpr std::array<LanguageCode, 18> available_language_codes = {{ LanguageCode::JA, LanguageCode::EN_US, LanguageCode::FR, @@ -30,6 +30,7 @@ constexpr std::array<LanguageCode, 17> available_language_codes = {{ LanguageCode::ES_419, LanguageCode::ZH_HANS, LanguageCode::ZH_HANT, + LanguageCode::PT_BR, }}; enum class KeyboardLayout : u64 { @@ -50,7 +51,7 @@ enum class KeyboardLayout : u64 { ChineseTraditional = 14, }; -constexpr std::array<std::pair<LanguageCode, KeyboardLayout>, 17> language_to_layout{{ +constexpr std::array<std::pair<LanguageCode, KeyboardLayout>, 18> language_to_layout{{ {LanguageCode::JA, KeyboardLayout::Japanese}, {LanguageCode::EN_US, KeyboardLayout::EnglishUs}, {LanguageCode::FR, KeyboardLayout::French}, @@ -68,10 +69,11 @@ constexpr std::array<std::pair<LanguageCode, KeyboardLayout>, 17> language_to_la {LanguageCode::ES_419, KeyboardLayout::SpanishLatin}, {LanguageCode::ZH_HANS, KeyboardLayout::ChineseSimplified}, {LanguageCode::ZH_HANT, KeyboardLayout::ChineseTraditional}, + {LanguageCode::PT_BR, KeyboardLayout::Portuguese}, }}; -constexpr std::size_t pre4_0_0_max_entries = 15; -constexpr std::size_t post4_0_0_max_entries = 17; +constexpr std::size_t PRE_4_0_0_MAX_ENTRIES = 0xF; +constexpr std::size_t POST_4_0_0_MAX_ENTRIES = 0x40; constexpr ResultCode ERR_INVALID_LANGUAGE{ErrorModule::Settings, 625}; @@ -81,9 +83,10 @@ void PushResponseLanguageCode(Kernel::HLERequestContext& ctx, std::size_t num_la rb.Push(static_cast<u32>(num_language_codes)); } -void GetAvailableLanguageCodesImpl(Kernel::HLERequestContext& ctx, std::size_t max_size) { +void GetAvailableLanguageCodesImpl(Kernel::HLERequestContext& ctx, std::size_t max_entries) { const std::size_t requested_amount = ctx.GetWriteBufferSize() / sizeof(LanguageCode); - const std::size_t copy_amount = std::min(requested_amount, max_size); + const std::size_t max_amount = std::min(requested_amount, max_entries); + const std::size_t copy_amount = std::min(available_language_codes.size(), max_amount); const std::size_t copy_size = copy_amount * sizeof(LanguageCode); ctx.WriteBuffer(available_language_codes.data(), copy_size); @@ -118,7 +121,7 @@ LanguageCode GetLanguageCodeFromIndex(std::size_t index) { void SET::GetAvailableLanguageCodes(Kernel::HLERequestContext& ctx) { LOG_DEBUG(Service_SET, "called"); - GetAvailableLanguageCodesImpl(ctx, pre4_0_0_max_entries); + GetAvailableLanguageCodesImpl(ctx, PRE_4_0_0_MAX_ENTRIES); } void SET::MakeLanguageCode(Kernel::HLERequestContext& ctx) { @@ -140,19 +143,19 @@ void SET::MakeLanguageCode(Kernel::HLERequestContext& ctx) { void SET::GetAvailableLanguageCodes2(Kernel::HLERequestContext& ctx) { LOG_DEBUG(Service_SET, "called"); - GetAvailableLanguageCodesImpl(ctx, post4_0_0_max_entries); + GetAvailableLanguageCodesImpl(ctx, POST_4_0_0_MAX_ENTRIES); } void SET::GetAvailableLanguageCodeCount(Kernel::HLERequestContext& ctx) { LOG_DEBUG(Service_SET, "called"); - PushResponseLanguageCode(ctx, pre4_0_0_max_entries); + PushResponseLanguageCode(ctx, PRE_4_0_0_MAX_ENTRIES); } void SET::GetAvailableLanguageCodeCount2(Kernel::HLERequestContext& ctx) { LOG_DEBUG(Service_SET, "called"); - PushResponseLanguageCode(ctx, post4_0_0_max_entries); + PushResponseLanguageCode(ctx, POST_4_0_0_MAX_ENTRIES); } void SET::GetQuestFlag(Kernel::HLERequestContext& ctx) { diff --git a/src/core/hle/service/set/set.h b/src/core/hle/service/set/set.h index d5bd7828d..acabebeaa 100644 --- a/src/core/hle/service/set/set.h +++ b/src/core/hle/service/set/set.h @@ -31,6 +31,7 @@ enum class LanguageCode : u64 { ES_419 = 0x00003931342D7365, ZH_HANS = 0x00736E61482D687A, ZH_HANT = 0x00746E61482D687A, + PT_BR = 0x00000052422D7470, }; LanguageCode GetLanguageCodeFromIndex(std::size_t idx); diff --git a/src/core/network/network.cpp b/src/core/network/network.cpp index 526bfa110..375bc79ec 100644 --- a/src/core/network/network.cpp +++ b/src/core/network/network.cpp @@ -570,7 +570,7 @@ std::pair<s32, Errno> Socket::SendTo(u32 flags, const std::vector<u8>& message, ASSERT(flags == 0); const sockaddr* to = nullptr; - const int tolen = addr ? 0 : sizeof(sockaddr); + const int tolen = addr ? sizeof(sockaddr) : 0; sockaddr host_addr_in; if (addr) { |