diff options
| -rw-r--r-- | externals/CMakeLists.txt | 4 | ||||
| m--------- | externals/dynarmic | 0 | ||||
| -rw-r--r-- | externals/find-modules/FindLibzip.cmake | 72 | ||||
| -rw-r--r-- | externals/find-modules/Findlibzip.cmake | 72 | ||||
| -rw-r--r-- | src/core/arm/dynarmic/arm_dynarmic_32.cpp | 35 | ||||
| -rw-r--r-- | src/core/arm/dynarmic/arm_dynarmic_32.h | 5 | ||||
| -rw-r--r-- | src/core/arm/dynarmic/arm_dynarmic_64.cpp | 42 | ||||
| -rw-r--r-- | src/core/arm/dynarmic/arm_dynarmic_64.h | 5 | ||||
| -rw-r--r-- | src/core/hle/service/am/am.cpp | 17 | ||||
| -rw-r--r-- | src/core/hle/service/am/am.h | 1 | ||||
| -rw-r--r-- | src/core/hle/service/hid/controllers/npad.cpp | 8 |
11 files changed, 131 insertions, 130 deletions
diff --git a/externals/CMakeLists.txt b/externals/CMakeLists.txt index c629bbc5c..851c282b4 100644 --- a/externals/CMakeLists.txt +++ b/externals/CMakeLists.txt | |||
| @@ -64,8 +64,8 @@ endif() | |||
| 64 | add_subdirectory(sirit) | 64 | add_subdirectory(sirit) |
| 65 | 65 | ||
| 66 | # libzip | 66 | # libzip |
| 67 | find_package(Libzip 1.5) | 67 | find_package(libzip 1.5) |
| 68 | if (NOT LIBZIP_FOUND) | 68 | if (NOT libzip_FOUND) |
| 69 | message(STATUS "libzip 1.5 or newer not found, falling back to externals") | 69 | message(STATUS "libzip 1.5 or newer not found, falling back to externals") |
| 70 | add_subdirectory(libzip EXCLUDE_FROM_ALL) | 70 | add_subdirectory(libzip EXCLUDE_FROM_ALL) |
| 71 | endif() | 71 | endif() |
diff --git a/externals/dynarmic b/externals/dynarmic | |||
| Subproject c28f13af9797c0319d9a38b5b5c8470ff906e2c | Subproject c788bcdf17e6bc1d1a1dd315106b952013f5ecb | ||
diff --git a/externals/find-modules/FindLibzip.cmake b/externals/find-modules/FindLibzip.cmake deleted file mode 100644 index f36b1687a..000000000 --- a/externals/find-modules/FindLibzip.cmake +++ /dev/null | |||
| @@ -1,72 +0,0 @@ | |||
| 1 | |||
| 2 | find_package(PkgConfig QUIET) | ||
| 3 | pkg_check_modules(PC_LIBZIP QUIET libzip) | ||
| 4 | |||
| 5 | find_path(LIBZIP_INCLUDE_DIR | ||
| 6 | NAMES zip.h | ||
| 7 | PATHS ${PC_LIBZIP_INCLUDE_DIRS} | ||
| 8 | "$ENV{LIB_DIR}/include" | ||
| 9 | "$ENV{INCLUDE}" | ||
| 10 | /usr/local/include | ||
| 11 | /usr/include | ||
| 12 | ) | ||
| 13 | find_path(LIBZIP_INCLUDE_DIR_ZIPCONF | ||
| 14 | NAMES zipconf.h | ||
| 15 | HINTS ${PC_LIBZIP_INCLUDE_DIRS} | ||
| 16 | "$ENV{LIB_DIR}/include" | ||
| 17 | "$ENV{LIB_DIR}/lib/libzip/include" | ||
| 18 | "$ENV{LIB}/lib/libzip/include" | ||
| 19 | /usr/local/lib/libzip/include | ||
| 20 | /usr/lib/libzip/include | ||
| 21 | /usr/local/include | ||
| 22 | /usr/include | ||
| 23 | "$ENV{INCLUDE}" | ||
| 24 | ) | ||
| 25 | find_library(LIBZIP_LIBRARY | ||
| 26 | NAMES zip | ||
| 27 | PATHS ${PC_LIBZIP_LIBRARY_DIRS} | ||
| 28 | "$ENV{LIB_DIR}/lib" "$ENV{LIB}" /usr/local/lib /usr/lib | ||
| 29 | ) | ||
| 30 | |||
| 31 | if (LIBZIP_INCLUDE_DIR_ZIPCONF) | ||
| 32 | FILE(READ "${LIBZIP_INCLUDE_DIR_ZIPCONF}/zipconf.h" _LIBZIP_VERSION_CONTENTS) | ||
| 33 | if (_LIBZIP_VERSION_CONTENTS) | ||
| 34 | STRING(REGEX REPLACE ".*#define LIBZIP_VERSION \"([0-9.]+)\".*" "\\1" LIBZIP_VERSION "${_LIBZIP_VERSION_CONTENTS}") | ||
| 35 | endif() | ||
| 36 | unset(_LIBZIP_VERSION_CONTENTS) | ||
| 37 | endif() | ||
| 38 | |||
| 39 | set(LIBZIP_VERSION ${LIBZIP_VERSION} CACHE STRING "Version number of libzip") | ||
| 40 | |||
| 41 | include(FindPackageHandleStandardArgs) | ||
| 42 | find_package_handle_standard_args(Libzip | ||
| 43 | FOUND_VAR LIBZIP_FOUND | ||
| 44 | REQUIRED_VARS | ||
| 45 | LIBZIP_LIBRARY | ||
| 46 | LIBZIP_INCLUDE_DIR | ||
| 47 | LIBZIP_INCLUDE_DIR_ZIPCONF | ||
| 48 | LIBZIP_VERSION | ||
| 49 | VERSION_VAR LIBZIP_VERSION | ||
| 50 | ) | ||
| 51 | |||
| 52 | if(LIBZIP_FOUND) | ||
| 53 | set(LIBZIP_LIBRARIES ${LIBZIP_LIBRARY}) | ||
| 54 | set(LIBZIP_INCLUDE_DIRS ${LIBZIP_INCLUDE_DIR}) | ||
| 55 | set(LIBZIP_DEFINITIONS ${PC_LIBZIP_CFLAGS_OTHER}) | ||
| 56 | endif() | ||
| 57 | |||
| 58 | if(LIBZIP_FOUND AND NOT TARGET libzip::libzip) | ||
| 59 | add_library(libzip::libzip UNKNOWN IMPORTED) | ||
| 60 | set_target_properties(libzip::libzip PROPERTIES | ||
| 61 | IMPORTED_LOCATION "${LIBZIP_LIBRARY}" | ||
| 62 | INTERFACE_COMPILE_OPTIONS "${PC_LIBZIP_CFLAGS_OTHER}" | ||
| 63 | INTERFACE_INCLUDE_DIRECTORIES "${LIBZIP_INCLUDE_DIR}" | ||
| 64 | ) | ||
| 65 | endif() | ||
| 66 | |||
| 67 | mark_as_advanced( | ||
| 68 | LIBZIP_INCLUDE_DIR | ||
| 69 | LIBZIP_INCLUDE_DIR_ZIPCONF | ||
| 70 | LIBZIP_LIBRARY | ||
| 71 | LIBZIP_VERSION | ||
| 72 | ) | ||
diff --git a/externals/find-modules/Findlibzip.cmake b/externals/find-modules/Findlibzip.cmake new file mode 100644 index 000000000..8934de3b8 --- /dev/null +++ b/externals/find-modules/Findlibzip.cmake | |||
| @@ -0,0 +1,72 @@ | |||
| 1 | |||
| 2 | find_package(PkgConfig QUIET) | ||
| 3 | pkg_check_modules(PC_libzip QUIET libzip) | ||
| 4 | |||
| 5 | find_path(libzip_INCLUDE_DIR | ||
| 6 | NAMES zip.h | ||
| 7 | PATHS ${PC_libzip_INCLUDE_DIRS} | ||
| 8 | "$ENV{LIB_DIR}/include" | ||
| 9 | "$ENV{INCLUDE}" | ||
| 10 | /usr/local/include | ||
| 11 | /usr/include | ||
| 12 | ) | ||
| 13 | find_path(libzip_INCLUDE_DIR_ZIPCONF | ||
| 14 | NAMES zipconf.h | ||
| 15 | HINTS ${PC_libzip_INCLUDE_DIRS} | ||
| 16 | "$ENV{LIB_DIR}/include" | ||
| 17 | "$ENV{LIB_DIR}/lib/libzip/include" | ||
| 18 | "$ENV{LIB}/lib/libzip/include" | ||
| 19 | /usr/local/lib/libzip/include | ||
| 20 | /usr/lib/libzip/include | ||
| 21 | /usr/local/include | ||
| 22 | /usr/include | ||
| 23 | "$ENV{INCLUDE}" | ||
| 24 | ) | ||
| 25 | find_library(libzip_LIBRARY | ||
| 26 | NAMES zip | ||
| 27 | PATHS ${PC_libzip_LIBRARY_DIRS} | ||
| 28 | "$ENV{LIB_DIR}/lib" "$ENV{LIB}" /usr/local/lib /usr/lib | ||
| 29 | ) | ||
| 30 | |||
| 31 | if (libzip_INCLUDE_DIR_ZIPCONF) | ||
| 32 | FILE(READ "${libzip_INCLUDE_DIR_ZIPCONF}/zipconf.h" _libzip_VERSION_CONTENTS) | ||
| 33 | if (_libzip_VERSION_CONTENTS) | ||
| 34 | STRING(REGEX REPLACE ".*#define LIBZIP_VERSION \"([0-9.]+)\".*" "\\1" libzip_VERSION "${_libzip_VERSION_CONTENTS}") | ||
| 35 | endif() | ||
| 36 | unset(_libzip_VERSION_CONTENTS) | ||
| 37 | endif() | ||
| 38 | |||
| 39 | set(libzip_VERSION ${libzip_VERSION} CACHE STRING "Version number of libzip") | ||
| 40 | |||
| 41 | include(FindPackageHandleStandardArgs) | ||
| 42 | find_package_handle_standard_args(libzip | ||
| 43 | FOUND_VAR libzip_FOUND | ||
| 44 | REQUIRED_VARS | ||
| 45 | libzip_LIBRARY | ||
| 46 | libzip_INCLUDE_DIR | ||
| 47 | libzip_INCLUDE_DIR_ZIPCONF | ||
| 48 | libzip_VERSION | ||
| 49 | VERSION_VAR libzip_VERSION | ||
| 50 | ) | ||
| 51 | |||
| 52 | if(libzip_FOUND) | ||
| 53 | set(libzip_LIBRARIES ${libzip_LIBRARY}) | ||
| 54 | set(libzip_INCLUDE_DIRS ${libzip_INCLUDE_DIR}) | ||
| 55 | set(libzip_DEFINITIONS ${PC_libzip_CFLAGS_OTHER}) | ||
| 56 | endif() | ||
| 57 | |||
| 58 | if(libzip_FOUND AND NOT TARGET libzip::libzip) | ||
| 59 | add_library(libzip::libzip UNKNOWN IMPORTED) | ||
| 60 | set_target_properties(libzip::libzip PROPERTIES | ||
| 61 | IMPORTED_LOCATION "${libzip_LIBRARY}" | ||
| 62 | INTERFACE_COMPILE_OPTIONS "${PC_libzip_CFLAGS_OTHER}" | ||
| 63 | INTERFACE_INCLUDE_DIRECTORIES "${libzip_INCLUDE_DIR}" | ||
| 64 | ) | ||
| 65 | endif() | ||
| 66 | |||
| 67 | mark_as_advanced( | ||
| 68 | libzip_INCLUDE_DIR | ||
| 69 | libzip_INCLUDE_DIR_ZIPCONF | ||
| 70 | libzip_LIBRARY | ||
| 71 | libzip_VERSION | ||
| 72 | ) | ||
diff --git a/src/core/arm/dynarmic/arm_dynarmic_32.cpp b/src/core/arm/dynarmic/arm_dynarmic_32.cpp index 53d78de32..08d889135 100644 --- a/src/core/arm/dynarmic/arm_dynarmic_32.cpp +++ b/src/core/arm/dynarmic/arm_dynarmic_32.cpp | |||
| @@ -114,18 +114,17 @@ public: | |||
| 114 | static constexpr u64 minimum_run_cycles = 1000U; | 114 | static constexpr u64 minimum_run_cycles = 1000U; |
| 115 | }; | 115 | }; |
| 116 | 116 | ||
| 117 | std::shared_ptr<Dynarmic::A32::Jit> ARM_Dynarmic_32::MakeJit(Common::PageTable& page_table, | 117 | std::shared_ptr<Dynarmic::A32::Jit> ARM_Dynarmic_32::MakeJit(Common::PageTable* page_table) const { |
| 118 | std::size_t address_space_bits) const { | ||
| 119 | Dynarmic::A32::UserConfig config; | 118 | Dynarmic::A32::UserConfig config; |
| 120 | config.callbacks = cb.get(); | 119 | config.callbacks = cb.get(); |
| 121 | // TODO(bunnei): Implement page table for 32-bit | ||
| 122 | // config.page_table = &page_table.pointers; | ||
| 123 | config.coprocessors[15] = cp15; | 120 | config.coprocessors[15] = cp15; |
| 124 | config.define_unpredictable_behaviour = true; | 121 | config.define_unpredictable_behaviour = true; |
| 125 | static constexpr std::size_t PAGE_BITS = 12; | 122 | static constexpr std::size_t PAGE_BITS = 12; |
| 126 | static constexpr std::size_t NUM_PAGE_TABLE_ENTRIES = 1 << (32 - PAGE_BITS); | 123 | static constexpr std::size_t NUM_PAGE_TABLE_ENTRIES = 1 << (32 - PAGE_BITS); |
| 127 | config.page_table = reinterpret_cast<std::array<std::uint8_t*, NUM_PAGE_TABLE_ENTRIES>*>( | 124 | if (page_table) { |
| 128 | page_table.pointers.data()); | 125 | config.page_table = reinterpret_cast<std::array<std::uint8_t*, NUM_PAGE_TABLE_ENTRIES>*>( |
| 126 | page_table->pointers.data()); | ||
| 127 | } | ||
| 129 | config.absolute_offset_page_table = true; | 128 | config.absolute_offset_page_table = true; |
| 130 | config.page_table_pointer_mask_bits = Common::PageTable::ATTRIBUTE_BITS; | 129 | config.page_table_pointer_mask_bits = Common::PageTable::ATTRIBUTE_BITS; |
| 131 | config.detect_misaligned_access_via_page_table = 16 | 32 | 64 | 128; | 130 | config.detect_misaligned_access_via_page_table = 16 | 32 | 64 | 128; |
| @@ -138,6 +137,10 @@ std::shared_ptr<Dynarmic::A32::Jit> ARM_Dynarmic_32::MakeJit(Common::PageTable& | |||
| 138 | // Timing | 137 | // Timing |
| 139 | config.wall_clock_cntpct = uses_wall_clock; | 138 | config.wall_clock_cntpct = uses_wall_clock; |
| 140 | 139 | ||
| 140 | // Code cache size | ||
| 141 | config.code_cache_size = 512 * 1024 * 1024; | ||
| 142 | config.far_code_offset = 256 * 1024 * 1024; | ||
| 143 | |||
| 141 | // Safe optimizations | 144 | // Safe optimizations |
| 142 | if (Settings::values.cpu_accuracy == Settings::CPUAccuracy::DebugMode) { | 145 | if (Settings::values.cpu_accuracy == Settings::CPUAccuracy::DebugMode) { |
| 143 | if (!Settings::values.cpuopt_page_tables) { | 146 | if (!Settings::values.cpuopt_page_tables) { |
| @@ -201,7 +204,8 @@ ARM_Dynarmic_32::ARM_Dynarmic_32(System& system, CPUInterrupts& interrupt_handle | |||
| 201 | : ARM_Interface{system, interrupt_handlers, uses_wall_clock}, | 204 | : ARM_Interface{system, interrupt_handlers, uses_wall_clock}, |
| 202 | cb(std::make_unique<DynarmicCallbacks32>(*this)), | 205 | cb(std::make_unique<DynarmicCallbacks32>(*this)), |
| 203 | cp15(std::make_shared<DynarmicCP15>(*this)), core_index{core_index}, | 206 | cp15(std::make_shared<DynarmicCP15>(*this)), core_index{core_index}, |
| 204 | exclusive_monitor{dynamic_cast<DynarmicExclusiveMonitor&>(exclusive_monitor)} {} | 207 | exclusive_monitor{dynamic_cast<DynarmicExclusiveMonitor&>(exclusive_monitor)}, |
| 208 | jit(MakeJit(nullptr)) {} | ||
| 205 | 209 | ||
| 206 | ARM_Dynarmic_32::~ARM_Dynarmic_32() = default; | 210 | ARM_Dynarmic_32::~ARM_Dynarmic_32() = default; |
| 207 | 211 | ||
| @@ -256,9 +260,6 @@ void ARM_Dynarmic_32::ChangeProcessorID(std::size_t new_core_id) { | |||
| 256 | } | 260 | } |
| 257 | 261 | ||
| 258 | void ARM_Dynarmic_32::SaveContext(ThreadContext32& ctx) { | 262 | void ARM_Dynarmic_32::SaveContext(ThreadContext32& ctx) { |
| 259 | if (!jit) { | ||
| 260 | return; | ||
| 261 | } | ||
| 262 | Dynarmic::A32::Context context; | 263 | Dynarmic::A32::Context context; |
| 263 | jit->SaveContext(context); | 264 | jit->SaveContext(context); |
| 264 | ctx.cpu_registers = context.Regs(); | 265 | ctx.cpu_registers = context.Regs(); |
| @@ -268,9 +269,6 @@ void ARM_Dynarmic_32::SaveContext(ThreadContext32& ctx) { | |||
| 268 | } | 269 | } |
| 269 | 270 | ||
| 270 | void ARM_Dynarmic_32::LoadContext(const ThreadContext32& ctx) { | 271 | void ARM_Dynarmic_32::LoadContext(const ThreadContext32& ctx) { |
| 271 | if (!jit) { | ||
| 272 | return; | ||
| 273 | } | ||
| 274 | Dynarmic::A32::Context context; | 272 | Dynarmic::A32::Context context; |
| 275 | context.Regs() = ctx.cpu_registers; | 273 | context.Regs() = ctx.cpu_registers; |
| 276 | context.ExtRegs() = ctx.extension_registers; | 274 | context.ExtRegs() = ctx.extension_registers; |
| @@ -284,23 +282,14 @@ void ARM_Dynarmic_32::PrepareReschedule() { | |||
| 284 | } | 282 | } |
| 285 | 283 | ||
| 286 | void ARM_Dynarmic_32::ClearInstructionCache() { | 284 | void ARM_Dynarmic_32::ClearInstructionCache() { |
| 287 | if (!jit) { | ||
| 288 | return; | ||
| 289 | } | ||
| 290 | jit->ClearCache(); | 285 | jit->ClearCache(); |
| 291 | } | 286 | } |
| 292 | 287 | ||
| 293 | void ARM_Dynarmic_32::InvalidateCacheRange(VAddr addr, std::size_t size) { | 288 | void ARM_Dynarmic_32::InvalidateCacheRange(VAddr addr, std::size_t size) { |
| 294 | if (!jit) { | ||
| 295 | return; | ||
| 296 | } | ||
| 297 | jit->InvalidateCacheRange(static_cast<u32>(addr), size); | 289 | jit->InvalidateCacheRange(static_cast<u32>(addr), size); |
| 298 | } | 290 | } |
| 299 | 291 | ||
| 300 | void ARM_Dynarmic_32::ClearExclusiveState() { | 292 | void ARM_Dynarmic_32::ClearExclusiveState() { |
| 301 | if (!jit) { | ||
| 302 | return; | ||
| 303 | } | ||
| 304 | jit->ClearExclusiveState(); | 293 | jit->ClearExclusiveState(); |
| 305 | } | 294 | } |
| 306 | 295 | ||
| @@ -316,7 +305,7 @@ void ARM_Dynarmic_32::PageTableChanged(Common::PageTable& page_table, | |||
| 316 | LoadContext(ctx); | 305 | LoadContext(ctx); |
| 317 | return; | 306 | return; |
| 318 | } | 307 | } |
| 319 | jit = MakeJit(page_table, new_address_space_size_in_bits); | 308 | jit = MakeJit(&page_table); |
| 320 | LoadContext(ctx); | 309 | LoadContext(ctx); |
| 321 | jit_cache.emplace(key, jit); | 310 | jit_cache.emplace(key, jit); |
| 322 | } | 311 | } |
diff --git a/src/core/arm/dynarmic/arm_dynarmic_32.h b/src/core/arm/dynarmic/arm_dynarmic_32.h index f6c4d4db9..d40aef7a9 100644 --- a/src/core/arm/dynarmic/arm_dynarmic_32.h +++ b/src/core/arm/dynarmic/arm_dynarmic_32.h | |||
| @@ -68,8 +68,7 @@ public: | |||
| 68 | std::size_t new_address_space_size_in_bits) override; | 68 | std::size_t new_address_space_size_in_bits) override; |
| 69 | 69 | ||
| 70 | private: | 70 | private: |
| 71 | std::shared_ptr<Dynarmic::A32::Jit> MakeJit(Common::PageTable& page_table, | 71 | std::shared_ptr<Dynarmic::A32::Jit> MakeJit(Common::PageTable* page_table) const; |
| 72 | std::size_t address_space_bits) const; | ||
| 73 | 72 | ||
| 74 | using JitCacheKey = std::pair<Common::PageTable*, std::size_t>; | 73 | using JitCacheKey = std::pair<Common::PageTable*, std::size_t>; |
| 75 | using JitCacheType = | 74 | using JitCacheType = |
| @@ -80,10 +79,10 @@ private: | |||
| 80 | 79 | ||
| 81 | std::unique_ptr<DynarmicCallbacks32> cb; | 80 | std::unique_ptr<DynarmicCallbacks32> cb; |
| 82 | JitCacheType jit_cache; | 81 | JitCacheType jit_cache; |
| 83 | std::shared_ptr<Dynarmic::A32::Jit> jit; | ||
| 84 | std::shared_ptr<DynarmicCP15> cp15; | 82 | std::shared_ptr<DynarmicCP15> cp15; |
| 85 | std::size_t core_index; | 83 | std::size_t core_index; |
| 86 | DynarmicExclusiveMonitor& exclusive_monitor; | 84 | DynarmicExclusiveMonitor& exclusive_monitor; |
| 85 | std::shared_ptr<Dynarmic::A32::Jit> jit; | ||
| 87 | }; | 86 | }; |
| 88 | 87 | ||
| 89 | } // namespace Core | 88 | } // namespace Core |
diff --git a/src/core/arm/dynarmic/arm_dynarmic_64.cpp b/src/core/arm/dynarmic/arm_dynarmic_64.cpp index b36b7d918..e12e50658 100644 --- a/src/core/arm/dynarmic/arm_dynarmic_64.cpp +++ b/src/core/arm/dynarmic/arm_dynarmic_64.cpp | |||
| @@ -142,7 +142,7 @@ public: | |||
| 142 | static constexpr u64 minimum_run_cycles = 1000U; | 142 | static constexpr u64 minimum_run_cycles = 1000U; |
| 143 | }; | 143 | }; |
| 144 | 144 | ||
| 145 | std::shared_ptr<Dynarmic::A64::Jit> ARM_Dynarmic_64::MakeJit(Common::PageTable& page_table, | 145 | std::shared_ptr<Dynarmic::A64::Jit> ARM_Dynarmic_64::MakeJit(Common::PageTable* page_table, |
| 146 | std::size_t address_space_bits) const { | 146 | std::size_t address_space_bits) const { |
| 147 | Dynarmic::A64::UserConfig config; | 147 | Dynarmic::A64::UserConfig config; |
| 148 | 148 | ||
| @@ -150,13 +150,15 @@ std::shared_ptr<Dynarmic::A64::Jit> ARM_Dynarmic_64::MakeJit(Common::PageTable& | |||
| 150 | config.callbacks = cb.get(); | 150 | config.callbacks = cb.get(); |
| 151 | 151 | ||
| 152 | // Memory | 152 | // Memory |
| 153 | config.page_table = reinterpret_cast<void**>(page_table.pointers.data()); | 153 | if (page_table) { |
| 154 | config.page_table_address_space_bits = address_space_bits; | 154 | config.page_table = reinterpret_cast<void**>(page_table->pointers.data()); |
| 155 | config.page_table_pointer_mask_bits = Common::PageTable::ATTRIBUTE_BITS; | 155 | config.page_table_address_space_bits = address_space_bits; |
| 156 | config.silently_mirror_page_table = false; | 156 | config.page_table_pointer_mask_bits = Common::PageTable::ATTRIBUTE_BITS; |
| 157 | config.absolute_offset_page_table = true; | 157 | config.silently_mirror_page_table = false; |
| 158 | config.detect_misaligned_access_via_page_table = 16 | 32 | 64 | 128; | 158 | config.absolute_offset_page_table = true; |
| 159 | config.only_detect_misalignment_via_page_table_on_page_boundary = true; | 159 | config.detect_misaligned_access_via_page_table = 16 | 32 | 64 | 128; |
| 160 | config.only_detect_misalignment_via_page_table_on_page_boundary = true; | ||
| 161 | } | ||
| 160 | 162 | ||
| 161 | // Multi-process state | 163 | // Multi-process state |
| 162 | config.processor_id = core_index; | 164 | config.processor_id = core_index; |
| @@ -175,6 +177,10 @@ std::shared_ptr<Dynarmic::A64::Jit> ARM_Dynarmic_64::MakeJit(Common::PageTable& | |||
| 175 | // Timing | 177 | // Timing |
| 176 | config.wall_clock_cntpct = uses_wall_clock; | 178 | config.wall_clock_cntpct = uses_wall_clock; |
| 177 | 179 | ||
| 180 | // Code cache size | ||
| 181 | config.code_cache_size = 512 * 1024 * 1024; | ||
| 182 | config.far_code_offset = 256 * 1024 * 1024; | ||
| 183 | |||
| 178 | // Safe optimizations | 184 | // Safe optimizations |
| 179 | if (Settings::values.cpu_accuracy == Settings::CPUAccuracy::DebugMode) { | 185 | if (Settings::values.cpu_accuracy == Settings::CPUAccuracy::DebugMode) { |
| 180 | if (!Settings::values.cpuopt_page_tables) { | 186 | if (!Settings::values.cpuopt_page_tables) { |
| @@ -237,7 +243,8 @@ ARM_Dynarmic_64::ARM_Dynarmic_64(System& system, CPUInterrupts& interrupt_handle | |||
| 237 | std::size_t core_index) | 243 | std::size_t core_index) |
| 238 | : ARM_Interface{system, interrupt_handlers, uses_wall_clock}, | 244 | : ARM_Interface{system, interrupt_handlers, uses_wall_clock}, |
| 239 | cb(std::make_unique<DynarmicCallbacks64>(*this)), core_index{core_index}, | 245 | cb(std::make_unique<DynarmicCallbacks64>(*this)), core_index{core_index}, |
| 240 | exclusive_monitor{dynamic_cast<DynarmicExclusiveMonitor&>(exclusive_monitor)} {} | 246 | exclusive_monitor{dynamic_cast<DynarmicExclusiveMonitor&>(exclusive_monitor)}, |
| 247 | jit(MakeJit(nullptr, 48)) {} | ||
| 241 | 248 | ||
| 242 | ARM_Dynarmic_64::~ARM_Dynarmic_64() = default; | 249 | ARM_Dynarmic_64::~ARM_Dynarmic_64() = default; |
| 243 | 250 | ||
| @@ -294,9 +301,6 @@ void ARM_Dynarmic_64::ChangeProcessorID(std::size_t new_core_id) { | |||
| 294 | } | 301 | } |
| 295 | 302 | ||
| 296 | void ARM_Dynarmic_64::SaveContext(ThreadContext64& ctx) { | 303 | void ARM_Dynarmic_64::SaveContext(ThreadContext64& ctx) { |
| 297 | if (!jit) { | ||
| 298 | return; | ||
| 299 | } | ||
| 300 | ctx.cpu_registers = jit->GetRegisters(); | 304 | ctx.cpu_registers = jit->GetRegisters(); |
| 301 | ctx.sp = jit->GetSP(); | 305 | ctx.sp = jit->GetSP(); |
| 302 | ctx.pc = jit->GetPC(); | 306 | ctx.pc = jit->GetPC(); |
| @@ -308,9 +312,6 @@ void ARM_Dynarmic_64::SaveContext(ThreadContext64& ctx) { | |||
| 308 | } | 312 | } |
| 309 | 313 | ||
| 310 | void ARM_Dynarmic_64::LoadContext(const ThreadContext64& ctx) { | 314 | void ARM_Dynarmic_64::LoadContext(const ThreadContext64& ctx) { |
| 311 | if (!jit) { | ||
| 312 | return; | ||
| 313 | } | ||
| 314 | jit->SetRegisters(ctx.cpu_registers); | 315 | jit->SetRegisters(ctx.cpu_registers); |
| 315 | jit->SetSP(ctx.sp); | 316 | jit->SetSP(ctx.sp); |
| 316 | jit->SetPC(ctx.pc); | 317 | jit->SetPC(ctx.pc); |
| @@ -326,23 +327,14 @@ void ARM_Dynarmic_64::PrepareReschedule() { | |||
| 326 | } | 327 | } |
| 327 | 328 | ||
| 328 | void ARM_Dynarmic_64::ClearInstructionCache() { | 329 | void ARM_Dynarmic_64::ClearInstructionCache() { |
| 329 | if (!jit) { | ||
| 330 | return; | ||
| 331 | } | ||
| 332 | jit->ClearCache(); | 330 | jit->ClearCache(); |
| 333 | } | 331 | } |
| 334 | 332 | ||
| 335 | void ARM_Dynarmic_64::InvalidateCacheRange(VAddr addr, std::size_t size) { | 333 | void ARM_Dynarmic_64::InvalidateCacheRange(VAddr addr, std::size_t size) { |
| 336 | if (!jit) { | ||
| 337 | return; | ||
| 338 | } | ||
| 339 | jit->InvalidateCacheRange(addr, size); | 334 | jit->InvalidateCacheRange(addr, size); |
| 340 | } | 335 | } |
| 341 | 336 | ||
| 342 | void ARM_Dynarmic_64::ClearExclusiveState() { | 337 | void ARM_Dynarmic_64::ClearExclusiveState() { |
| 343 | if (!jit) { | ||
| 344 | return; | ||
| 345 | } | ||
| 346 | jit->ClearExclusiveState(); | 338 | jit->ClearExclusiveState(); |
| 347 | } | 339 | } |
| 348 | 340 | ||
| @@ -358,7 +350,7 @@ void ARM_Dynarmic_64::PageTableChanged(Common::PageTable& page_table, | |||
| 358 | LoadContext(ctx); | 350 | LoadContext(ctx); |
| 359 | return; | 351 | return; |
| 360 | } | 352 | } |
| 361 | jit = MakeJit(page_table, new_address_space_size_in_bits); | 353 | jit = MakeJit(&page_table, new_address_space_size_in_bits); |
| 362 | LoadContext(ctx); | 354 | LoadContext(ctx); |
| 363 | jit_cache.emplace(key, jit); | 355 | jit_cache.emplace(key, jit); |
| 364 | } | 356 | } |
diff --git a/src/core/arm/dynarmic/arm_dynarmic_64.h b/src/core/arm/dynarmic/arm_dynarmic_64.h index 329b59a32..edef04376 100644 --- a/src/core/arm/dynarmic/arm_dynarmic_64.h +++ b/src/core/arm/dynarmic/arm_dynarmic_64.h | |||
| @@ -61,7 +61,7 @@ public: | |||
| 61 | std::size_t new_address_space_size_in_bits) override; | 61 | std::size_t new_address_space_size_in_bits) override; |
| 62 | 62 | ||
| 63 | private: | 63 | private: |
| 64 | std::shared_ptr<Dynarmic::A64::Jit> MakeJit(Common::PageTable& page_table, | 64 | std::shared_ptr<Dynarmic::A64::Jit> MakeJit(Common::PageTable* page_table, |
| 65 | std::size_t address_space_bits) const; | 65 | std::size_t address_space_bits) const; |
| 66 | 66 | ||
| 67 | using JitCacheKey = std::pair<Common::PageTable*, std::size_t>; | 67 | using JitCacheKey = std::pair<Common::PageTable*, std::size_t>; |
| @@ -71,10 +71,11 @@ private: | |||
| 71 | friend class DynarmicCallbacks64; | 71 | friend class DynarmicCallbacks64; |
| 72 | std::unique_ptr<DynarmicCallbacks64> cb; | 72 | std::unique_ptr<DynarmicCallbacks64> cb; |
| 73 | JitCacheType jit_cache; | 73 | JitCacheType jit_cache; |
| 74 | std::shared_ptr<Dynarmic::A64::Jit> jit; | ||
| 75 | 74 | ||
| 76 | std::size_t core_index; | 75 | std::size_t core_index; |
| 77 | DynarmicExclusiveMonitor& exclusive_monitor; | 76 | DynarmicExclusiveMonitor& exclusive_monitor; |
| 77 | |||
| 78 | std::shared_ptr<Dynarmic::A64::Jit> jit; | ||
| 78 | }; | 79 | }; |
| 79 | 80 | ||
| 80 | } // namespace Core | 81 | } // namespace Core |
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp index 8e1fe9438..d91237cba 100644 --- a/src/core/hle/service/am/am.cpp +++ b/src/core/hle/service/am/am.cpp | |||
| @@ -295,7 +295,7 @@ ISelfController::ISelfController(Core::System& system_, NVFlinger::NVFlinger& nv | |||
| 295 | {80, nullptr, "SetWirelessPriorityMode"}, | 295 | {80, nullptr, "SetWirelessPriorityMode"}, |
| 296 | {90, &ISelfController::GetAccumulatedSuspendedTickValue, "GetAccumulatedSuspendedTickValue"}, | 296 | {90, &ISelfController::GetAccumulatedSuspendedTickValue, "GetAccumulatedSuspendedTickValue"}, |
| 297 | {91, &ISelfController::GetAccumulatedSuspendedTickChangedEvent, "GetAccumulatedSuspendedTickChangedEvent"}, | 297 | {91, &ISelfController::GetAccumulatedSuspendedTickChangedEvent, "GetAccumulatedSuspendedTickChangedEvent"}, |
| 298 | {100, nullptr, "SetAlbumImageTakenNotificationEnabled"}, | 298 | {100, &ISelfController::SetAlbumImageTakenNotificationEnabled, "SetAlbumImageTakenNotificationEnabled"}, |
| 299 | {110, nullptr, "SetApplicationAlbumUserData"}, | 299 | {110, nullptr, "SetApplicationAlbumUserData"}, |
| 300 | {1000, nullptr, "GetDebugStorageChannel"}, | 300 | {1000, nullptr, "GetDebugStorageChannel"}, |
| 301 | }; | 301 | }; |
| @@ -560,6 +560,21 @@ void ISelfController::GetAccumulatedSuspendedTickChangedEvent(Kernel::HLERequest | |||
| 560 | rb.PushCopyObjects(accumulated_suspended_tick_changed_event->GetReadableEvent()); | 560 | rb.PushCopyObjects(accumulated_suspended_tick_changed_event->GetReadableEvent()); |
| 561 | } | 561 | } |
| 562 | 562 | ||
| 563 | void ISelfController::SetAlbumImageTakenNotificationEnabled(Kernel::HLERequestContext& ctx) { | ||
| 564 | IPC::RequestParser rp{ctx}; | ||
| 565 | |||
| 566 | // This service call sets an internal flag whether a notification is shown when an image is | ||
| 567 | // captured. Currently we do not support capturing images via the capture button, so this can be | ||
| 568 | // stubbed for now. | ||
| 569 | const bool album_image_taken_notification_enabled = rp.Pop<bool>(); | ||
| 570 | |||
| 571 | LOG_WARNING(Service_AM, "(STUBBED) called. album_image_taken_notification_enabled={}", | ||
| 572 | album_image_taken_notification_enabled); | ||
| 573 | |||
| 574 | IPC::ResponseBuilder rb{ctx, 2}; | ||
| 575 | rb.Push(RESULT_SUCCESS); | ||
| 576 | } | ||
| 577 | |||
| 563 | AppletMessageQueue::AppletMessageQueue(Kernel::KernelCore& kernel) { | 578 | AppletMessageQueue::AppletMessageQueue(Kernel::KernelCore& kernel) { |
| 564 | on_new_message = Kernel::KEvent::Create(kernel, "AMMessageQueue:OnMessageReceived"); | 579 | on_new_message = Kernel::KEvent::Create(kernel, "AMMessageQueue:OnMessageReceived"); |
| 565 | on_new_message->Initialize(); | 580 | on_new_message->Initialize(); |
diff --git a/src/core/hle/service/am/am.h b/src/core/hle/service/am/am.h index 6911f0d6e..f6a453ab7 100644 --- a/src/core/hle/service/am/am.h +++ b/src/core/hle/service/am/am.h | |||
| @@ -146,6 +146,7 @@ private: | |||
| 146 | void IsAutoSleepDisabled(Kernel::HLERequestContext& ctx); | 146 | void IsAutoSleepDisabled(Kernel::HLERequestContext& ctx); |
| 147 | void GetAccumulatedSuspendedTickValue(Kernel::HLERequestContext& ctx); | 147 | void GetAccumulatedSuspendedTickValue(Kernel::HLERequestContext& ctx); |
| 148 | void GetAccumulatedSuspendedTickChangedEvent(Kernel::HLERequestContext& ctx); | 148 | void GetAccumulatedSuspendedTickChangedEvent(Kernel::HLERequestContext& ctx); |
| 149 | void SetAlbumImageTakenNotificationEnabled(Kernel::HLERequestContext& ctx); | ||
| 149 | 150 | ||
| 150 | enum class ScreenshotPermission : u32 { | 151 | enum class ScreenshotPermission : u32 { |
| 151 | Inherit = 0, | 152 | Inherit = 0, |
diff --git a/src/core/hle/service/hid/controllers/npad.cpp b/src/core/hle/service/hid/controllers/npad.cpp index 70b9f3824..1df62f98e 100644 --- a/src/core/hle/service/hid/controllers/npad.cpp +++ b/src/core/hle/service/hid/controllers/npad.cpp | |||
| @@ -413,12 +413,16 @@ void Controller_NPad::RequestPadStateUpdate(u32 npad_id) { | |||
| 413 | lstick_entry.y = static_cast<s32>(stick_l_y_f * HID_JOYSTICK_MAX); | 413 | lstick_entry.y = static_cast<s32>(stick_l_y_f * HID_JOYSTICK_MAX); |
| 414 | } | 414 | } |
| 415 | 415 | ||
| 416 | if (controller_type == NPadControllerType::JoyLeft || | 416 | if (controller_type == NPadControllerType::JoyLeft) { |
| 417 | controller_type == NPadControllerType::JoyRight) { | ||
| 418 | pad_state.left_sl.Assign(button_state[SL - BUTTON_HID_BEGIN]->GetStatus()); | 417 | pad_state.left_sl.Assign(button_state[SL - BUTTON_HID_BEGIN]->GetStatus()); |
| 419 | pad_state.left_sr.Assign(button_state[SR - BUTTON_HID_BEGIN]->GetStatus()); | 418 | pad_state.left_sr.Assign(button_state[SR - BUTTON_HID_BEGIN]->GetStatus()); |
| 420 | } | 419 | } |
| 421 | 420 | ||
| 421 | if (controller_type == NPadControllerType::JoyRight) { | ||
| 422 | pad_state.right_sl.Assign(button_state[SL - BUTTON_HID_BEGIN]->GetStatus()); | ||
| 423 | pad_state.right_sr.Assign(button_state[SR - BUTTON_HID_BEGIN]->GetStatus()); | ||
| 424 | } | ||
| 425 | |||
| 422 | if (controller_type == NPadControllerType::GameCube) { | 426 | if (controller_type == NPadControllerType::GameCube) { |
| 423 | trigger_entry.l_analog = static_cast<s32>( | 427 | trigger_entry.l_analog = static_cast<s32>( |
| 424 | button_state[ZL - BUTTON_HID_BEGIN]->GetStatus() ? HID_TRIGGER_MAX : 0); | 428 | button_state[ZL - BUTTON_HID_BEGIN]->GetStatus() ? HID_TRIGGER_MAX : 0); |