diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/common/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | src/common/break_points.cpp | 90 | ||||
| -rw-r--r-- | src/common/break_points.h | 49 | ||||
| -rw-r--r-- | src/common/misc.cpp | 2 | ||||
| -rw-r--r-- | src/core/hle/service/mm/mm_u.cpp | 83 | ||||
| -rw-r--r-- | src/core/hle/service/mm/mm_u.h | 15 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer_cache.h | 2 |
7 files changed, 55 insertions, 188 deletions
diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index d5d4f6f82..939b8a7d3 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt | |||
| @@ -29,8 +29,6 @@ add_library(common STATIC | |||
| 29 | assert.h | 29 | assert.h |
| 30 | bit_field.h | 30 | bit_field.h |
| 31 | bit_set.h | 31 | bit_set.h |
| 32 | break_points.cpp | ||
| 33 | break_points.h | ||
| 34 | cityhash.cpp | 32 | cityhash.cpp |
| 35 | cityhash.h | 33 | cityhash.h |
| 36 | color.h | 34 | color.h |
diff --git a/src/common/break_points.cpp b/src/common/break_points.cpp deleted file mode 100644 index fa367a4ca..000000000 --- a/src/common/break_points.cpp +++ /dev/null | |||
| @@ -1,90 +0,0 @@ | |||
| 1 | // Copyright 2013 Dolphin Emulator Project / 2014 Citra Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #include <algorithm> | ||
| 6 | #include <sstream> | ||
| 7 | #include "common/break_points.h" | ||
| 8 | |||
| 9 | bool BreakPoints::IsAddressBreakPoint(u32 iAddress) const { | ||
| 10 | auto cond = [&iAddress](const TBreakPoint& bp) { return bp.iAddress == iAddress; }; | ||
| 11 | auto it = std::find_if(m_BreakPoints.begin(), m_BreakPoints.end(), cond); | ||
| 12 | return it != m_BreakPoints.end(); | ||
| 13 | } | ||
| 14 | |||
| 15 | bool BreakPoints::IsTempBreakPoint(u32 iAddress) const { | ||
| 16 | auto cond = [&iAddress](const TBreakPoint& bp) { | ||
| 17 | return bp.iAddress == iAddress && bp.bTemporary; | ||
| 18 | }; | ||
| 19 | auto it = std::find_if(m_BreakPoints.begin(), m_BreakPoints.end(), cond); | ||
| 20 | return it != m_BreakPoints.end(); | ||
| 21 | } | ||
| 22 | |||
| 23 | BreakPoints::TBreakPointsStr BreakPoints::GetStrings() const { | ||
| 24 | TBreakPointsStr bps; | ||
| 25 | for (auto breakpoint : m_BreakPoints) { | ||
| 26 | if (!breakpoint.bTemporary) { | ||
| 27 | std::stringstream bp; | ||
| 28 | bp << std::hex << breakpoint.iAddress << " " << (breakpoint.bOn ? "n" : ""); | ||
| 29 | bps.push_back(bp.str()); | ||
| 30 | } | ||
| 31 | } | ||
| 32 | |||
| 33 | return bps; | ||
| 34 | } | ||
| 35 | |||
| 36 | void BreakPoints::AddFromStrings(const TBreakPointsStr& bps) { | ||
| 37 | for (auto bps_item : bps) { | ||
| 38 | TBreakPoint bp; | ||
| 39 | std::stringstream bpstr; | ||
| 40 | bpstr << std::hex << bps_item; | ||
| 41 | bpstr >> bp.iAddress; | ||
| 42 | bp.bOn = bps_item.find("n") != bps_item.npos; | ||
| 43 | bp.bTemporary = false; | ||
| 44 | Add(bp); | ||
| 45 | } | ||
| 46 | } | ||
| 47 | |||
| 48 | void BreakPoints::Add(const TBreakPoint& bp) { | ||
| 49 | if (!IsAddressBreakPoint(bp.iAddress)) { | ||
| 50 | m_BreakPoints.push_back(bp); | ||
| 51 | // if (jit) | ||
| 52 | // jit->GetBlockCache()->InvalidateICache(bp.iAddress, 4); | ||
| 53 | } | ||
| 54 | } | ||
| 55 | |||
| 56 | void BreakPoints::Add(u32 em_address, bool temp) { | ||
| 57 | if (!IsAddressBreakPoint(em_address)) // only add new addresses | ||
| 58 | { | ||
| 59 | TBreakPoint pt; // breakpoint settings | ||
| 60 | pt.bOn = true; | ||
| 61 | pt.bTemporary = temp; | ||
| 62 | pt.iAddress = em_address; | ||
| 63 | |||
| 64 | m_BreakPoints.push_back(pt); | ||
| 65 | |||
| 66 | // if (jit) | ||
| 67 | // jit->GetBlockCache()->InvalidateICache(em_address, 4); | ||
| 68 | } | ||
| 69 | } | ||
| 70 | |||
| 71 | void BreakPoints::Remove(u32 em_address) { | ||
| 72 | auto cond = [&em_address](const TBreakPoint& bp) { return bp.iAddress == em_address; }; | ||
| 73 | auto it = std::find_if(m_BreakPoints.begin(), m_BreakPoints.end(), cond); | ||
| 74 | if (it != m_BreakPoints.end()) | ||
| 75 | m_BreakPoints.erase(it); | ||
| 76 | } | ||
| 77 | |||
| 78 | void BreakPoints::Clear() { | ||
| 79 | // if (jit) | ||
| 80 | //{ | ||
| 81 | // std::for_each(m_BreakPoints.begin(), m_BreakPoints.end(), | ||
| 82 | // [](const TBreakPoint& bp) | ||
| 83 | // { | ||
| 84 | // jit->GetBlockCache()->InvalidateICache(bp.iAddress, 4); | ||
| 85 | // } | ||
| 86 | // ); | ||
| 87 | //} | ||
| 88 | |||
| 89 | m_BreakPoints.clear(); | ||
| 90 | } | ||
diff --git a/src/common/break_points.h b/src/common/break_points.h deleted file mode 100644 index e15b9f842..000000000 --- a/src/common/break_points.h +++ /dev/null | |||
| @@ -1,49 +0,0 @@ | |||
| 1 | // Copyright 2013 Dolphin Emulator Project / 2014 Citra Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #pragma once | ||
| 6 | |||
| 7 | #include <string> | ||
| 8 | #include <vector> | ||
| 9 | #include "common/common_types.h" | ||
| 10 | |||
| 11 | class DebugInterface; | ||
| 12 | |||
| 13 | struct TBreakPoint { | ||
| 14 | u32 iAddress; | ||
| 15 | bool bOn; | ||
| 16 | bool bTemporary; | ||
| 17 | }; | ||
| 18 | |||
| 19 | // Code breakpoints. | ||
| 20 | class BreakPoints { | ||
| 21 | public: | ||
| 22 | typedef std::vector<TBreakPoint> TBreakPoints; | ||
| 23 | typedef std::vector<std::string> TBreakPointsStr; | ||
| 24 | |||
| 25 | const TBreakPoints& GetBreakPoints() { | ||
| 26 | return m_BreakPoints; | ||
| 27 | } | ||
| 28 | |||
| 29 | TBreakPointsStr GetStrings() const; | ||
| 30 | void AddFromStrings(const TBreakPointsStr& bps); | ||
| 31 | |||
| 32 | // is address breakpoint | ||
| 33 | bool IsAddressBreakPoint(u32 iAddress) const; | ||
| 34 | bool IsTempBreakPoint(u32 iAddress) const; | ||
| 35 | |||
| 36 | // Add BreakPoint | ||
| 37 | void Add(u32 em_address, bool temp = false); | ||
| 38 | void Add(const TBreakPoint& bp); | ||
| 39 | |||
| 40 | // Remove Breakpoint | ||
| 41 | void Remove(u32 iAddress); | ||
| 42 | void Clear(); | ||
| 43 | |||
| 44 | void DeleteByAddress(u32 Address); | ||
| 45 | |||
| 46 | private: | ||
| 47 | TBreakPoints m_BreakPoints; | ||
| 48 | u32 m_iBreakOnCount; | ||
| 49 | }; | ||
diff --git a/src/common/misc.cpp b/src/common/misc.cpp index 217a87098..3fa8a3bc4 100644 --- a/src/common/misc.cpp +++ b/src/common/misc.cpp | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | 4 | ||
| 5 | #include <cstddef> | 5 | #include <cstddef> |
| 6 | #ifdef _WIN32 | 6 | #ifdef _WIN32 |
| 7 | #include <Windows.h> | 7 | #include <windows.h> |
| 8 | #else | 8 | #else |
| 9 | #include <cerrno> | 9 | #include <cerrno> |
| 10 | #include <cstring> | 10 | #include <cstring> |
diff --git a/src/core/hle/service/mm/mm_u.cpp b/src/core/hle/service/mm/mm_u.cpp index 08f45b78a..7b91bb258 100644 --- a/src/core/hle/service/mm/mm_u.cpp +++ b/src/core/hle/service/mm/mm_u.cpp | |||
| @@ -9,42 +9,63 @@ | |||
| 9 | 9 | ||
| 10 | namespace Service::MM { | 10 | namespace Service::MM { |
| 11 | 11 | ||
| 12 | void InstallInterfaces(SM::ServiceManager& service_manager) { | 12 | class MM_U final : public ServiceFramework<MM_U> { |
| 13 | std::make_shared<MM_U>()->InstallAsService(service_manager); | 13 | public: |
| 14 | } | 14 | explicit MM_U() : ServiceFramework{"mm:u"} { |
| 15 | // clang-format off | ||
| 16 | static const FunctionInfo functions[] = { | ||
| 17 | {0, &MM_U::Initialize, "InitializeOld"}, | ||
| 18 | {1, &MM_U::Finalize, "FinalizeOld"}, | ||
| 19 | {2, &MM_U::SetAndWait, "SetAndWaitOld"}, | ||
| 20 | {3, &MM_U::Get, "GetOld"}, | ||
| 21 | {4, &MM_U::Initialize, "Initialize"}, | ||
| 22 | {5, &MM_U::Finalize, "Finalize"}, | ||
| 23 | {6, &MM_U::SetAndWait, "SetAndWait"}, | ||
| 24 | {7, &MM_U::Get, "Get"}, | ||
| 25 | }; | ||
| 26 | // clang-format on | ||
| 15 | 27 | ||
| 16 | void MM_U::Initialize(Kernel::HLERequestContext& ctx) { | 28 | RegisterHandlers(functions); |
| 17 | LOG_WARNING(Service_MM, "(STUBBED) called"); | 29 | } |
| 18 | IPC::ResponseBuilder rb{ctx, 2}; | ||
| 19 | rb.Push(RESULT_SUCCESS); | ||
| 20 | } | ||
| 21 | 30 | ||
| 22 | void MM_U::SetAndWait(Kernel::HLERequestContext& ctx) { | 31 | private: |
| 23 | IPC::RequestParser rp{ctx}; | 32 | void Initialize(Kernel::HLERequestContext& ctx) { |
| 24 | min = rp.Pop<u32>(); | 33 | LOG_WARNING(Service_MM, "(STUBBED) called"); |
| 25 | max = rp.Pop<u32>(); | 34 | IPC::ResponseBuilder rb{ctx, 2}; |
| 26 | current = min; | 35 | rb.Push(RESULT_SUCCESS); |
| 36 | } | ||
| 27 | 37 | ||
| 28 | LOG_WARNING(Service_MM, "(STUBBED) called, min=0x{:X}, max=0x{:X}", min, max); | 38 | void Finalize(Kernel::HLERequestContext& ctx) { |
| 29 | IPC::ResponseBuilder rb{ctx, 2}; | 39 | LOG_WARNING(Service_MM, "(STUBBED) called"); |
| 30 | rb.Push(RESULT_SUCCESS); | 40 | IPC::ResponseBuilder rb{ctx, 2}; |
| 31 | } | 41 | rb.Push(RESULT_SUCCESS); |
| 42 | } | ||
| 32 | 43 | ||
| 33 | void MM_U::Get(Kernel::HLERequestContext& ctx) { | 44 | void SetAndWait(Kernel::HLERequestContext& ctx) { |
| 34 | LOG_WARNING(Service_MM, "(STUBBED) called"); | 45 | IPC::RequestParser rp{ctx}; |
| 35 | IPC::ResponseBuilder rb{ctx, 3}; | 46 | min = rp.Pop<u32>(); |
| 36 | rb.Push(RESULT_SUCCESS); | 47 | max = rp.Pop<u32>(); |
| 37 | rb.Push(current); | 48 | current = min; |
| 38 | } | ||
| 39 | 49 | ||
| 40 | MM_U::MM_U() : ServiceFramework("mm:u") { | 50 | LOG_WARNING(Service_MM, "(STUBBED) called, min=0x{:X}, max=0x{:X}", min, max); |
| 41 | static const FunctionInfo functions[] = { | 51 | IPC::ResponseBuilder rb{ctx, 2}; |
| 42 | {0, nullptr, "InitializeOld"}, {1, nullptr, "FinalizeOld"}, | 52 | rb.Push(RESULT_SUCCESS); |
| 43 | {2, nullptr, "SetAndWaitOld"}, {3, nullptr, "GetOld"}, | 53 | } |
| 44 | {4, &MM_U::Initialize, "Initialize"}, {5, nullptr, "Finalize"}, | 54 | |
| 45 | {6, &MM_U::SetAndWait, "SetAndWait"}, {7, &MM_U::Get, "Get"}, | 55 | void Get(Kernel::HLERequestContext& ctx) { |
| 46 | }; | 56 | LOG_WARNING(Service_MM, "(STUBBED) called"); |
| 47 | RegisterHandlers(functions); | 57 | IPC::ResponseBuilder rb{ctx, 3}; |
| 58 | rb.Push(RESULT_SUCCESS); | ||
| 59 | rb.Push(current); | ||
| 60 | } | ||
| 61 | |||
| 62 | u32 min{0}; | ||
| 63 | u32 max{0}; | ||
| 64 | u32 current{0}; | ||
| 65 | }; | ||
| 66 | |||
| 67 | void InstallInterfaces(SM::ServiceManager& service_manager) { | ||
| 68 | std::make_shared<MM_U>()->InstallAsService(service_manager); | ||
| 48 | } | 69 | } |
| 49 | 70 | ||
| 50 | } // namespace Service::MM | 71 | } // namespace Service::MM |
diff --git a/src/core/hle/service/mm/mm_u.h b/src/core/hle/service/mm/mm_u.h index 79eeedf9c..5439fa653 100644 --- a/src/core/hle/service/mm/mm_u.h +++ b/src/core/hle/service/mm/mm_u.h | |||
| @@ -8,21 +8,6 @@ | |||
| 8 | 8 | ||
| 9 | namespace Service::MM { | 9 | namespace Service::MM { |
| 10 | 10 | ||
| 11 | class MM_U final : public ServiceFramework<MM_U> { | ||
| 12 | public: | ||
| 13 | MM_U(); | ||
| 14 | ~MM_U() = default; | ||
| 15 | |||
| 16 | private: | ||
| 17 | void Initialize(Kernel::HLERequestContext& ctx); | ||
| 18 | void SetAndWait(Kernel::HLERequestContext& ctx); | ||
| 19 | void Get(Kernel::HLERequestContext& ctx); | ||
| 20 | |||
| 21 | u32 min{0}; | ||
| 22 | u32 max{0}; | ||
| 23 | u32 current{0}; | ||
| 24 | }; | ||
| 25 | |||
| 26 | /// Registers all MM services with the specified service manager. | 11 | /// Registers all MM services with the specified service manager. |
| 27 | void InstallInterfaces(SM::ServiceManager& service_manager); | 12 | void InstallInterfaces(SM::ServiceManager& service_manager); |
| 28 | 13 | ||
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.h b/src/video_core/renderer_opengl/gl_rasterizer_cache.h index 36a41522b..0de87d8c2 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer_cache.h +++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.h | |||
| @@ -396,6 +396,8 @@ struct SurfaceParams { | |||
| 396 | UNREACHABLE(); | 396 | UNREACHABLE(); |
| 397 | case Tegra::Texture::TextureFormat::ZF32: | 397 | case Tegra::Texture::TextureFormat::ZF32: |
| 398 | return PixelFormat::Z32F; | 398 | return PixelFormat::Z32F; |
| 399 | case Tegra::Texture::TextureFormat::Z16: | ||
| 400 | return PixelFormat::Z16; | ||
| 399 | case Tegra::Texture::TextureFormat::Z24S8: | 401 | case Tegra::Texture::TextureFormat::Z24S8: |
| 400 | return PixelFormat::Z24S8; | 402 | return PixelFormat::Z24S8; |
| 401 | case Tegra::Texture::TextureFormat::DXT1: | 403 | case Tegra::Texture::TextureFormat::DXT1: |