diff options
Diffstat (limited to '')
-rw-r--r-- | src/common/fs/file.h | 11 | ||||
-rw-r--r-- | src/core/hle/service/hid/hid.cpp | 11 | ||||
-rw-r--r-- | src/video_core/rasterizer_accelerated.cpp | 6 | ||||
-rw-r--r-- | src/video_core/rasterizer_accelerated.h | 12 |
4 files changed, 26 insertions, 14 deletions
diff --git a/src/common/fs/file.h b/src/common/fs/file.h index 209f9664b..50e270c5b 100644 --- a/src/common/fs/file.h +++ b/src/common/fs/file.h @@ -117,7 +117,7 @@ template <typename Path> } #endif -class IOFile final : NonCopyable { +class IOFile final { public: IOFile(); @@ -142,7 +142,10 @@ public: FileType type = FileType::BinaryFile, FileShareFlag flag = FileShareFlag::ShareReadOnly); - virtual ~IOFile(); + ~IOFile(); + + IOFile(const IOFile&) = delete; + IOFile& operator=(const IOFile&) = delete; IOFile(IOFile&& other) noexcept; IOFile& operator=(IOFile&& other) noexcept; @@ -441,8 +444,8 @@ public: private: std::filesystem::path file_path; - FileAccessMode file_access_mode; - FileType file_type; + FileAccessMode file_access_mode{}; + FileType file_type{}; std::FILE* file = nullptr; }; diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp index 49c17fd14..df0fe1c8e 100644 --- a/src/core/hle/service/hid/hid.cpp +++ b/src/core/hle/service/hid/hid.cpp @@ -1770,7 +1770,7 @@ public: {232, nullptr, "GetIrSensorState"}, {233, nullptr, "GetXcdHandleForNpadWithIrSensor"}, {301, nullptr, "ActivateNpadSystem"}, - {303, nullptr, "ApplyNpadSystemCommonPolicy"}, + {303, &HidSys::ApplyNpadSystemCommonPolicy, "ApplyNpadSystemCommonPolicy"}, {304, nullptr, "EnableAssigningSingleOnSlSrPress"}, {305, nullptr, "DisableAssigningSingleOnSlSrPress"}, {306, nullptr, "GetLastActiveNpad"}, @@ -1949,6 +1949,15 @@ public: RegisterHandlers(functions); } + +private: + void ApplyNpadSystemCommonPolicy(Kernel::HLERequestContext& ctx) { + // We already do this for homebrew so we can just stub it out + LOG_WARNING(Service_HID, "called"); + + IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(RESULT_SUCCESS); + } }; class HidTmp final : public ServiceFramework<HidTmp> { diff --git a/src/video_core/rasterizer_accelerated.cpp b/src/video_core/rasterizer_accelerated.cpp index 62d84c0f8..6decd2546 100644 --- a/src/video_core/rasterizer_accelerated.cpp +++ b/src/video_core/rasterizer_accelerated.cpp @@ -18,10 +18,10 @@ RasterizerAccelerated::~RasterizerAccelerated() = default; void RasterizerAccelerated::UpdatePagesCachedCount(VAddr addr, u64 size, int delta) { const auto page_end = Common::DivCeil(addr + size, Core::Memory::PAGE_SIZE); for (auto page = addr >> Core::Memory::PAGE_BITS; page != page_end; ++page) { - auto& count = cached_pages.at(page >> 3).Count(page); + auto& count = cached_pages.at(page >> 2).Count(page); if (delta > 0) { - ASSERT_MSG(count < UINT8_MAX, "Count may overflow!"); + ASSERT_MSG(count < UINT16_MAX, "Count may overflow!"); } else if (delta < 0) { ASSERT_MSG(count > 0, "Count may underflow!"); } else { @@ -29,7 +29,7 @@ void RasterizerAccelerated::UpdatePagesCachedCount(VAddr addr, u64 size, int del } // Adds or subtracts 1, as count is a unsigned 8-bit value - count += static_cast<u8>(delta); + count += static_cast<u16>(delta); // Assume delta is either -1 or 1 if (count == 0) { diff --git a/src/video_core/rasterizer_accelerated.h b/src/video_core/rasterizer_accelerated.h index 9227a4adc..ea879bfdd 100644 --- a/src/video_core/rasterizer_accelerated.h +++ b/src/video_core/rasterizer_accelerated.h @@ -29,20 +29,20 @@ private: public: CacheEntry() = default; - std::atomic_uint8_t& Count(std::size_t page) { - return values[page & 7]; + std::atomic_uint16_t& Count(std::size_t page) { + return values[page & 3]; } - const std::atomic_uint8_t& Count(std::size_t page) const { - return values[page & 7]; + const std::atomic_uint16_t& Count(std::size_t page) const { + return values[page & 3]; } private: - std::array<std::atomic_uint8_t, 8> values{}; + std::array<std::atomic_uint16_t, 4> values{}; }; static_assert(sizeof(CacheEntry) == 8, "CacheEntry should be 8 bytes!"); - std::array<CacheEntry, 0x800000> cached_pages; + std::array<CacheEntry, 0x1000000> cached_pages; Core::Memory::Memory& cpu_memory; }; |