diff options
9 files changed, 55 insertions, 10 deletions
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/ui/main/MainActivity.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/ui/main/MainActivity.kt index d16f8a931..757463a0b 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/ui/main/MainActivity.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/ui/main/MainActivity.kt | |||
| @@ -498,7 +498,8 @@ class MainActivity : AppCompatActivity(), ThemeProvider { | |||
| 498 | this@MainActivity, | 498 | this@MainActivity, |
| 499 | titleId = R.string.content_install_notice, | 499 | titleId = R.string.content_install_notice, |
| 500 | descriptionId = R.string.content_install_notice_description, | 500 | descriptionId = R.string.content_install_notice_description, |
| 501 | positiveAction = { homeViewModel.setContentToInstall(documents) } | 501 | positiveAction = { homeViewModel.setContentToInstall(documents) }, |
| 502 | negativeAction = {} | ||
| 502 | ) | 503 | ) |
| 503 | } | 504 | } |
| 504 | }.show(supportFragmentManager, ProgressDialogFragment.TAG) | 505 | }.show(supportFragmentManager, ProgressDialogFragment.TAG) |
diff --git a/src/android/app/src/main/jni/emu_window/emu_window.cpp b/src/android/app/src/main/jni/emu_window/emu_window.cpp index 2768a01c9..06db55369 100644 --- a/src/android/app/src/main/jni/emu_window/emu_window.cpp +++ b/src/android/app/src/main/jni/emu_window/emu_window.cpp | |||
| @@ -23,6 +23,22 @@ void EmuWindow_Android::OnSurfaceChanged(ANativeWindow* surface) { | |||
| 23 | window_info.render_surface = reinterpret_cast<void*>(surface); | 23 | window_info.render_surface = reinterpret_cast<void*>(surface); |
| 24 | } | 24 | } |
| 25 | 25 | ||
| 26 | void EmuWindow_Android::OnTouchPressed(int id, float x, float y) { | ||
| 27 | const auto [touch_x, touch_y] = MapToTouchScreen(x, y); | ||
| 28 | EmulationSession::GetInstance().GetInputSubsystem().GetTouchScreen()->TouchPressed(touch_x, | ||
| 29 | touch_y, id); | ||
| 30 | } | ||
| 31 | |||
| 32 | void EmuWindow_Android::OnTouchMoved(int id, float x, float y) { | ||
| 33 | const auto [touch_x, touch_y] = MapToTouchScreen(x, y); | ||
| 34 | EmulationSession::GetInstance().GetInputSubsystem().GetTouchScreen()->TouchMoved(touch_x, | ||
| 35 | touch_y, id); | ||
| 36 | } | ||
| 37 | |||
| 38 | void EmuWindow_Android::OnTouchReleased(int id) { | ||
| 39 | EmulationSession::GetInstance().GetInputSubsystem().GetTouchScreen()->TouchReleased(id); | ||
| 40 | } | ||
| 41 | |||
| 26 | void EmuWindow_Android::OnFrameDisplayed() { | 42 | void EmuWindow_Android::OnFrameDisplayed() { |
| 27 | if (!m_first_frame) { | 43 | if (!m_first_frame) { |
| 28 | Common::Android::RunJNIOnFiber<void>( | 44 | Common::Android::RunJNIOnFiber<void>( |
diff --git a/src/android/app/src/main/jni/emu_window/emu_window.h b/src/android/app/src/main/jni/emu_window/emu_window.h index 34704ae95..d7b5fc6da 100644 --- a/src/android/app/src/main/jni/emu_window/emu_window.h +++ b/src/android/app/src/main/jni/emu_window/emu_window.h | |||
| @@ -38,6 +38,10 @@ public: | |||
| 38 | void OnSurfaceChanged(ANativeWindow* surface); | 38 | void OnSurfaceChanged(ANativeWindow* surface); |
| 39 | void OnFrameDisplayed() override; | 39 | void OnFrameDisplayed() override; |
| 40 | 40 | ||
| 41 | void OnTouchPressed(int id, float x, float y); | ||
| 42 | void OnTouchMoved(int id, float x, float y); | ||
| 43 | void OnTouchReleased(int id); | ||
| 44 | |||
| 41 | std::unique_ptr<Core::Frontend::GraphicsContext> CreateSharedContext() const override { | 45 | std::unique_ptr<Core::Frontend::GraphicsContext> CreateSharedContext() const override { |
| 42 | return {std::make_unique<GraphicsContext_Android>(m_driver_library)}; | 46 | return {std::make_unique<GraphicsContext_Android>(m_driver_library)}; |
| 43 | } | 47 | } |
diff --git a/src/android/app/src/main/jni/native_input.cpp b/src/android/app/src/main/jni/native_input.cpp index ddf2f297b..37a65f2b8 100644 --- a/src/android/app/src/main/jni/native_input.cpp +++ b/src/android/app/src/main/jni/native_input.cpp | |||
| @@ -190,8 +190,7 @@ void Java_org_yuzu_yuzu_1emu_features_input_NativeInput_onTouchPressed(JNIEnv* e | |||
| 190 | jint j_id, jfloat j_x_axis, | 190 | jint j_id, jfloat j_x_axis, |
| 191 | jfloat j_y_axis) { | 191 | jfloat j_y_axis) { |
| 192 | if (EmulationSession::GetInstance().IsRunning()) { | 192 | if (EmulationSession::GetInstance().IsRunning()) { |
| 193 | EmulationSession::GetInstance().GetInputSubsystem().GetTouchScreen()->TouchPressed( | 193 | EmulationSession::GetInstance().Window().OnTouchPressed(j_id, j_x_axis, j_y_axis); |
| 194 | j_id, j_x_axis, j_y_axis); | ||
| 195 | } | 194 | } |
| 196 | } | 195 | } |
| 197 | 196 | ||
| @@ -199,15 +198,14 @@ void Java_org_yuzu_yuzu_1emu_features_input_NativeInput_onTouchMoved(JNIEnv* env | |||
| 199 | jint j_id, jfloat j_x_axis, | 198 | jint j_id, jfloat j_x_axis, |
| 200 | jfloat j_y_axis) { | 199 | jfloat j_y_axis) { |
| 201 | if (EmulationSession::GetInstance().IsRunning()) { | 200 | if (EmulationSession::GetInstance().IsRunning()) { |
| 202 | EmulationSession::GetInstance().GetInputSubsystem().GetTouchScreen()->TouchMoved( | 201 | EmulationSession::GetInstance().Window().OnTouchMoved(j_id, j_x_axis, j_y_axis); |
| 203 | j_id, j_x_axis, j_y_axis); | ||
| 204 | } | 202 | } |
| 205 | } | 203 | } |
| 206 | 204 | ||
| 207 | void Java_org_yuzu_yuzu_1emu_features_input_NativeInput_onTouchReleased(JNIEnv* env, jobject j_obj, | 205 | void Java_org_yuzu_yuzu_1emu_features_input_NativeInput_onTouchReleased(JNIEnv* env, jobject j_obj, |
| 208 | jint j_id) { | 206 | jint j_id) { |
| 209 | if (EmulationSession::GetInstance().IsRunning()) { | 207 | if (EmulationSession::GetInstance().IsRunning()) { |
| 210 | EmulationSession::GetInstance().GetInputSubsystem().GetTouchScreen()->TouchReleased(j_id); | 208 | EmulationSession::GetInstance().Window().OnTouchReleased(j_id); |
| 211 | } | 209 | } |
| 212 | } | 210 | } |
| 213 | 211 | ||
diff --git a/src/core/file_sys/control_metadata.h b/src/core/file_sys/control_metadata.h index 555b9d8f7..667efbbab 100644 --- a/src/core/file_sys/control_metadata.h +++ b/src/core/file_sys/control_metadata.h | |||
| @@ -64,8 +64,8 @@ struct RawNACP { | |||
| 64 | u64_le cache_storage_size; | 64 | u64_le cache_storage_size; |
| 65 | u64_le cache_storage_journal_size; | 65 | u64_le cache_storage_journal_size; |
| 66 | u64_le cache_storage_data_and_journal_max_size; | 66 | u64_le cache_storage_data_and_journal_max_size; |
| 67 | u64_le cache_storage_max_index; | 67 | u16_le cache_storage_max_index; |
| 68 | INSERT_PADDING_BYTES(0xE70); | 68 | INSERT_PADDING_BYTES(0xE76); |
| 69 | }; | 69 | }; |
| 70 | static_assert(sizeof(RawNACP) == 0x4000, "RawNACP has incorrect size."); | 70 | static_assert(sizeof(RawNACP) == 0x4000, "RawNACP has incorrect size."); |
| 71 | 71 | ||
diff --git a/src/core/hle/service/am/service/application_functions.cpp b/src/core/hle/service/am/service/application_functions.cpp index b788fddd4..63dd12a47 100644 --- a/src/core/hle/service/am/service/application_functions.cpp +++ b/src/core/hle/service/am/service/application_functions.cpp | |||
| @@ -15,6 +15,7 @@ | |||
| 15 | #include "core/hle/service/cmif_serialization.h" | 15 | #include "core/hle/service/cmif_serialization.h" |
| 16 | #include "core/hle/service/filesystem/filesystem.h" | 16 | #include "core/hle/service/filesystem/filesystem.h" |
| 17 | #include "core/hle/service/filesystem/save_data_controller.h" | 17 | #include "core/hle/service/filesystem/save_data_controller.h" |
| 18 | #include "core/hle/service/glue/glue_manager.h" | ||
| 18 | #include "core/hle/service/ns/ns.h" | 19 | #include "core/hle/service/ns/ns.h" |
| 19 | #include "core/hle/service/sm/sm.h" | 20 | #include "core/hle/service/sm/sm.h" |
| 20 | 21 | ||
| @@ -40,7 +41,7 @@ IApplicationFunctions::IApplicationFunctions(Core::System& system_, std::shared_ | |||
| 40 | {26, D<&IApplicationFunctions::GetSaveDataSize>, "GetSaveDataSize"}, | 41 | {26, D<&IApplicationFunctions::GetSaveDataSize>, "GetSaveDataSize"}, |
| 41 | {27, D<&IApplicationFunctions::CreateCacheStorage>, "CreateCacheStorage"}, | 42 | {27, D<&IApplicationFunctions::CreateCacheStorage>, "CreateCacheStorage"}, |
| 42 | {28, D<&IApplicationFunctions::GetSaveDataSizeMax>, "GetSaveDataSizeMax"}, | 43 | {28, D<&IApplicationFunctions::GetSaveDataSizeMax>, "GetSaveDataSizeMax"}, |
| 43 | {29, nullptr, "GetCacheStorageMax"}, | 44 | {29, D<&IApplicationFunctions::GetCacheStorageMax>, "GetCacheStorageMax"}, |
| 44 | {30, D<&IApplicationFunctions::BeginBlockingHomeButtonShortAndLongPressed>, "BeginBlockingHomeButtonShortAndLongPressed"}, | 45 | {30, D<&IApplicationFunctions::BeginBlockingHomeButtonShortAndLongPressed>, "BeginBlockingHomeButtonShortAndLongPressed"}, |
| 45 | {31, D<&IApplicationFunctions::EndBlockingHomeButtonShortAndLongPressed>, "EndBlockingHomeButtonShortAndLongPressed"}, | 46 | {31, D<&IApplicationFunctions::EndBlockingHomeButtonShortAndLongPressed>, "EndBlockingHomeButtonShortAndLongPressed"}, |
| 46 | {32, D<&IApplicationFunctions::BeginBlockingHomeButton>, "BeginBlockingHomeButton"}, | 47 | {32, D<&IApplicationFunctions::BeginBlockingHomeButton>, "BeginBlockingHomeButton"}, |
| @@ -267,6 +268,22 @@ Result IApplicationFunctions::GetSaveDataSizeMax(Out<u64> out_max_normal_size, | |||
| 267 | R_SUCCEED(); | 268 | R_SUCCEED(); |
| 268 | } | 269 | } |
| 269 | 270 | ||
| 271 | Result IApplicationFunctions::GetCacheStorageMax(Out<u32> out_cache_storage_index_max, | ||
| 272 | Out<u64> out_max_journal_size) { | ||
| 273 | LOG_DEBUG(Service_AM, "called"); | ||
| 274 | |||
| 275 | std::vector<u8> nacp; | ||
| 276 | R_TRY(system.GetARPManager().GetControlProperty(&nacp, m_applet->program_id)); | ||
| 277 | |||
| 278 | auto raw_nacp = std::make_unique<FileSys::RawNACP>(); | ||
| 279 | std::memcpy(raw_nacp.get(), nacp.data(), std::min(sizeof(*raw_nacp), nacp.size())); | ||
| 280 | |||
| 281 | *out_cache_storage_index_max = static_cast<u32>(raw_nacp->cache_storage_max_index); | ||
| 282 | *out_max_journal_size = static_cast<u64>(raw_nacp->cache_storage_data_and_journal_max_size); | ||
| 283 | |||
| 284 | R_SUCCEED(); | ||
| 285 | } | ||
| 286 | |||
| 270 | Result IApplicationFunctions::BeginBlockingHomeButtonShortAndLongPressed(s64 unused) { | 287 | Result IApplicationFunctions::BeginBlockingHomeButtonShortAndLongPressed(s64 unused) { |
| 271 | LOG_WARNING(Service_AM, "(STUBBED) called"); | 288 | LOG_WARNING(Service_AM, "(STUBBED) called"); |
| 272 | 289 | ||
diff --git a/src/core/hle/service/am/service/application_functions.h b/src/core/hle/service/am/service/application_functions.h index 3548202f8..10025a152 100644 --- a/src/core/hle/service/am/service/application_functions.h +++ b/src/core/hle/service/am/service/application_functions.h | |||
| @@ -40,6 +40,7 @@ private: | |||
| 40 | Result CreateCacheStorage(Out<u32> out_target_media, Out<u64> out_required_size, u16 index, | 40 | Result CreateCacheStorage(Out<u32> out_target_media, Out<u64> out_required_size, u16 index, |
| 41 | u64 normal_size, u64 journal_size); | 41 | u64 normal_size, u64 journal_size); |
| 42 | Result GetSaveDataSizeMax(Out<u64> out_max_normal_size, Out<u64> out_max_journal_size); | 42 | Result GetSaveDataSizeMax(Out<u64> out_max_normal_size, Out<u64> out_max_journal_size); |
| 43 | Result GetCacheStorageMax(Out<u32> out_cache_storage_index_max, Out<u64> out_max_journal_size); | ||
| 43 | Result BeginBlockingHomeButtonShortAndLongPressed(s64 unused); | 44 | Result BeginBlockingHomeButtonShortAndLongPressed(s64 unused); |
| 44 | Result EndBlockingHomeButtonShortAndLongPressed(); | 45 | Result EndBlockingHomeButtonShortAndLongPressed(); |
| 45 | Result BeginBlockingHomeButton(s64 timeout_ns); | 46 | Result BeginBlockingHomeButton(s64 timeout_ns); |
diff --git a/src/core/hle/service/filesystem/fsp/fsp_srv.cpp b/src/core/hle/service/filesystem/fsp/fsp_srv.cpp index 63c2d3a58..2d49f30c8 100644 --- a/src/core/hle/service/filesystem/fsp/fsp_srv.cpp +++ b/src/core/hle/service/filesystem/fsp/fsp_srv.cpp | |||
| @@ -336,7 +336,7 @@ FSP_SRV::FSP_SRV(Core::System& system_) | |||
| 336 | {1012, nullptr, "GetFsStackUsage"}, | 336 | {1012, nullptr, "GetFsStackUsage"}, |
| 337 | {1013, nullptr, "UnsetSaveDataRootPath"}, | 337 | {1013, nullptr, "UnsetSaveDataRootPath"}, |
| 338 | {1014, nullptr, "OutputMultiProgramTagAccessLog"}, | 338 | {1014, nullptr, "OutputMultiProgramTagAccessLog"}, |
| 339 | {1016, nullptr, "FlushAccessLogOnSdCard"}, | 339 | {1016, &FSP_SRV::FlushAccessLogOnSdCard, "FlushAccessLogOnSdCard"}, |
| 340 | {1017, nullptr, "OutputApplicationInfoAccessLog"}, | 340 | {1017, nullptr, "OutputApplicationInfoAccessLog"}, |
| 341 | {1018, nullptr, "SetDebugOption"}, | 341 | {1018, nullptr, "SetDebugOption"}, |
| 342 | {1019, nullptr, "UnsetDebugOption"}, | 342 | {1019, nullptr, "UnsetDebugOption"}, |
| @@ -706,6 +706,13 @@ void FSP_SRV::GetProgramIndexForAccessLog(HLERequestContext& ctx) { | |||
| 706 | rb.Push(access_log_program_index); | 706 | rb.Push(access_log_program_index); |
| 707 | } | 707 | } |
| 708 | 708 | ||
| 709 | void FSP_SRV::FlushAccessLogOnSdCard(HLERequestContext& ctx) { | ||
| 710 | LOG_DEBUG(Service_FS, "(STUBBED) called"); | ||
| 711 | |||
| 712 | IPC::ResponseBuilder rb{ctx, 2}; | ||
| 713 | rb.Push(ResultSuccess); | ||
| 714 | } | ||
| 715 | |||
| 709 | void FSP_SRV::GetCacheStorageSize(HLERequestContext& ctx) { | 716 | void FSP_SRV::GetCacheStorageSize(HLERequestContext& ctx) { |
| 710 | IPC::RequestParser rp{ctx}; | 717 | IPC::RequestParser rp{ctx}; |
| 711 | const auto index{rp.Pop<s32>()}; | 718 | const auto index{rp.Pop<s32>()}; |
diff --git a/src/core/hle/service/filesystem/fsp/fsp_srv.h b/src/core/hle/service/filesystem/fsp/fsp_srv.h index 26980af99..59406e6f9 100644 --- a/src/core/hle/service/filesystem/fsp/fsp_srv.h +++ b/src/core/hle/service/filesystem/fsp/fsp_srv.h | |||
| @@ -58,6 +58,7 @@ private: | |||
| 58 | void SetGlobalAccessLogMode(HLERequestContext& ctx); | 58 | void SetGlobalAccessLogMode(HLERequestContext& ctx); |
| 59 | void GetGlobalAccessLogMode(HLERequestContext& ctx); | 59 | void GetGlobalAccessLogMode(HLERequestContext& ctx); |
| 60 | void OutputAccessLogToSdCard(HLERequestContext& ctx); | 60 | void OutputAccessLogToSdCard(HLERequestContext& ctx); |
| 61 | void FlushAccessLogOnSdCard(HLERequestContext& ctx); | ||
| 61 | void GetProgramIndexForAccessLog(HLERequestContext& ctx); | 62 | void GetProgramIndexForAccessLog(HLERequestContext& ctx); |
| 62 | void OpenMultiCommitManager(HLERequestContext& ctx); | 63 | void OpenMultiCommitManager(HLERequestContext& ctx); |
| 63 | void GetCacheStorageSize(HLERequestContext& ctx); | 64 | void GetCacheStorageSize(HLERequestContext& ctx); |