diff options
Diffstat (limited to 'src')
26 files changed, 121 insertions, 60 deletions
diff --git a/src/android/.gitignore b/src/android/.gitignore index 40b6c5cd0..121cc8484 100644 --- a/src/android/.gitignore +++ b/src/android/.gitignore | |||
| @@ -1,3 +1,6 @@ | |||
| 1 | # SPDX-FileCopyrightText: 2023 yuzu Emulator Project | ||
| 2 | # SPDX-License-Identifier: GPL-3.0-or-later | ||
| 3 | |||
| 1 | # Built application files | 4 | # Built application files |
| 2 | *.apk | 5 | *.apk |
| 3 | *.ap_ | 6 | *.ap_ |
diff --git a/src/android/app/build.gradle.kts b/src/android/app/build.gradle.kts index 4aa19c91a..ec5f78746 100644 --- a/src/android/app/build.gradle.kts +++ b/src/android/app/build.gradle.kts | |||
| @@ -1,3 +1,6 @@ | |||
| 1 | // SPDX-FileCopyrightText: 2023 yuzu Emulator Project | ||
| 2 | // SPDX-License-Identifier: GPL-3.0-or-later | ||
| 3 | |||
| 1 | plugins { | 4 | plugins { |
| 2 | id("com.android.application") | 5 | id("com.android.application") |
| 3 | id("org.jetbrains.kotlin.android") | 6 | id("org.jetbrains.kotlin.android") |
diff --git a/src/android/app/proguard-rules.pro b/src/android/app/proguard-rules.pro index 13cfff1ba..691e08fd0 100644 --- a/src/android/app/proguard-rules.pro +++ b/src/android/app/proguard-rules.pro | |||
| @@ -1,3 +1,6 @@ | |||
| 1 | # SPDX-FileCopyrightText: 2023 yuzu Emulator Project | ||
| 2 | # SPDX-License-Identifier: GPL-3.0-or-later | ||
| 3 | |||
| 1 | # To get usable stack traces | 4 | # To get usable stack traces |
| 2 | -dontobfuscate | 5 | -dontobfuscate |
| 3 | 6 | ||
diff --git a/src/android/app/src/main/AndroidManifest.xml b/src/android/app/src/main/AndroidManifest.xml index aed7f9dc4..43087f2c0 100644 --- a/src/android/app/src/main/AndroidManifest.xml +++ b/src/android/app/src/main/AndroidManifest.xml | |||
| @@ -1,4 +1,10 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | |||
| 3 | <!-- | ||
| 4 | SPDX-FileCopyrightText: 2023 yuzu Emulator Project | ||
| 5 | SPDX-License-Identifier: GPL-3.0-or-later | ||
| 6 | --> | ||
| 7 | |||
| 2 | <manifest xmlns:android="http://schemas.android.com/apk/res/android"> | 8 | <manifest xmlns:android="http://schemas.android.com/apk/res/android"> |
| 3 | <uses-feature | 9 | <uses-feature |
| 4 | android:name="android.hardware.touchscreen" | 10 | android:name="android.hardware.touchscreen" |
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/model/HomeViewModel.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/model/HomeViewModel.kt index b959ae4ba..263ee7144 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/model/HomeViewModel.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/model/HomeViewModel.kt | |||
| @@ -1,3 +1,6 @@ | |||
| 1 | // SPDX-FileCopyrightText: 2023 yuzu Emulator Project | ||
| 2 | // SPDX-License-Identifier: GPL-3.0-or-later | ||
| 3 | |||
| 1 | package org.yuzu.yuzu_emu.model | 4 | package org.yuzu.yuzu_emu.model |
| 2 | 5 | ||
| 3 | import androidx.lifecycle.LiveData | 6 | import androidx.lifecycle.LiveData |
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/overlay/InputOverlay.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/overlay/InputOverlay.kt index 95f358c21..f0b0af9e5 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/overlay/InputOverlay.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/overlay/InputOverlay.kt | |||
| @@ -866,9 +866,9 @@ class InputOverlay(context: Context, attrs: AttributeSet?) : SurfaceView(context | |||
| 866 | * Initializes an [InputOverlayDrawableDpad] | 866 | * Initializes an [InputOverlayDrawableDpad] |
| 867 | * | 867 | * |
| 868 | * @param context The current [Context]. | 868 | * @param context The current [Context]. |
| 869 | * @param defaultResId The [Bitmap] resource ID of the default sate. | 869 | * @param defaultResId The [Bitmap] resource ID of the default state. |
| 870 | * @param pressedOneDirectionResId The [Bitmap] resource ID of the pressed sate in one direction. | 870 | * @param pressedOneDirectionResId The [Bitmap] resource ID of the pressed state in one direction. |
| 871 | * @param pressedTwoDirectionsResId The [Bitmap] resource ID of the pressed sate in two directions. | 871 | * @param pressedTwoDirectionsResId The [Bitmap] resource ID of the pressed state in two directions. |
| 872 | * @return the initialized [InputOverlayDrawableDpad] | 872 | * @return the initialized [InputOverlayDrawableDpad] |
| 873 | */ | 873 | */ |
| 874 | private fun initializeOverlayDpad( | 874 | private fun initializeOverlayDpad( |
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/InputHandler.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/InputHandler.kt index 78b978fb5..24e999b29 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/InputHandler.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/InputHandler.kt | |||
| @@ -1,3 +1,6 @@ | |||
| 1 | // SPDX-FileCopyrightText: 2023 yuzu Emulator Project | ||
| 2 | // SPDX-License-Identifier: GPL-3.0-or-later | ||
| 3 | |||
| 1 | package org.yuzu.yuzu_emu.utils | 4 | package org.yuzu.yuzu_emu.utils |
| 2 | 5 | ||
| 3 | import android.view.KeyEvent | 6 | import android.view.KeyEvent |
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/InsetsHelper.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/InsetsHelper.kt index e587fea06..19c53c481 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/InsetsHelper.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/InsetsHelper.kt | |||
| @@ -1,3 +1,6 @@ | |||
| 1 | // SPDX-FileCopyrightText: 2023 yuzu Emulator Project | ||
| 2 | // SPDX-License-Identifier: GPL-3.0-or-later | ||
| 3 | |||
| 1 | package org.yuzu.yuzu_emu.utils | 4 | package org.yuzu.yuzu_emu.utils |
| 2 | 5 | ||
| 3 | import android.annotation.SuppressLint | 6 | import android.annotation.SuppressLint |
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/NfcReader.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/NfcReader.kt index 1ce220d42..344dd8a0a 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/NfcReader.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/NfcReader.kt | |||
| @@ -1,3 +1,6 @@ | |||
| 1 | // SPDX-FileCopyrightText: 2023 yuzu Emulator Project | ||
| 2 | // SPDX-License-Identifier: GPL-3.0-or-later | ||
| 3 | |||
| 1 | package org.yuzu.yuzu_emu.utils | 4 | package org.yuzu.yuzu_emu.utils |
| 2 | 5 | ||
| 3 | import android.app.Activity | 6 | import android.app.Activity |
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/SerializableHelper.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/SerializableHelper.kt index 23ffbaf68..87ee7f2e6 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/SerializableHelper.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/SerializableHelper.kt | |||
| @@ -1,3 +1,6 @@ | |||
| 1 | // SPDX-FileCopyrightText: 2023 yuzu Emulator Project | ||
| 2 | // SPDX-License-Identifier: GPL-3.0-or-later | ||
| 3 | |||
| 1 | package org.yuzu.yuzu_emu.utils | 4 | package org.yuzu.yuzu_emu.utils |
| 2 | 5 | ||
| 3 | import android.content.Intent | 6 | import android.content.Intent |
diff --git a/src/android/app/src/main/jni/CMakeLists.txt b/src/android/app/src/main/jni/CMakeLists.txt index 3cf36b7d1..041781577 100644 --- a/src/android/app/src/main/jni/CMakeLists.txt +++ b/src/android/app/src/main/jni/CMakeLists.txt | |||
| @@ -1,3 +1,6 @@ | |||
| 1 | # SPDX-FileCopyrightText: 2023 yuzu Emulator Project | ||
| 2 | # SPDX-License-Identifier: GPL-3.0-or-later | ||
| 3 | |||
| 1 | add_library(yuzu-android SHARED | 4 | add_library(yuzu-android SHARED |
| 2 | android_common/android_common.cpp | 5 | android_common/android_common.cpp |
| 3 | android_common/android_common.h | 6 | android_common/android_common.h |
diff --git a/src/android/app/src/main/jni/applets/software_keyboard.cpp b/src/android/app/src/main/jni/applets/software_keyboard.cpp index c6fffbbab..74e040478 100644 --- a/src/android/app/src/main/jni/applets/software_keyboard.cpp +++ b/src/android/app/src/main/jni/applets/software_keyboard.cpp | |||
| @@ -263,9 +263,9 @@ void InitJNI(JNIEnv* env) { | |||
| 263 | s_software_keyboard_class, "executeNormal", | 263 | s_software_keyboard_class, "executeNormal", |
| 264 | "(Lorg/yuzu/yuzu_emu/applets/keyboard/SoftwareKeyboard$KeyboardConfig;)Lorg/yuzu/yuzu_emu/" | 264 | "(Lorg/yuzu/yuzu_emu/applets/keyboard/SoftwareKeyboard$KeyboardConfig;)Lorg/yuzu/yuzu_emu/" |
| 265 | "applets/keyboard/SoftwareKeyboard$KeyboardData;"); | 265 | "applets/keyboard/SoftwareKeyboard$KeyboardData;"); |
| 266 | s_swkbd_execute_inline = | 266 | s_swkbd_execute_inline = env->GetStaticMethodID( |
| 267 | env->GetStaticMethodID(s_software_keyboard_class, "executeInline", | 267 | s_software_keyboard_class, "executeInline", |
| 268 | "(Lorg/yuzu/yuzu_emu/applets/keyboard/SoftwareKeyboard$KeyboardConfig;)V"); | 268 | "(Lorg/yuzu/yuzu_emu/applets/keyboard/SoftwareKeyboard$KeyboardConfig;)V"); |
| 269 | } | 269 | } |
| 270 | 270 | ||
| 271 | void CleanupJNI(JNIEnv* env) { | 271 | void CleanupJNI(JNIEnv* env) { |
diff --git a/src/android/app/src/main/jni/config.cpp b/src/android/app/src/main/jni/config.cpp index 6b4c08145..2d622a048 100644 --- a/src/android/app/src/main/jni/config.cpp +++ b/src/android/app/src/main/jni/config.cpp | |||
| @@ -232,7 +232,8 @@ void Config::ReadValues() { | |||
| 232 | Settings::values.accelerate_astc = config->GetBoolean("Renderer", "accelerate_astc", false); | 232 | Settings::values.accelerate_astc = config->GetBoolean("Renderer", "accelerate_astc", false); |
| 233 | 233 | ||
| 234 | // Enable asynchronous presentation by default on Android | 234 | // Enable asynchronous presentation by default on Android |
| 235 | Settings::values.async_presentation = config->GetBoolean("Renderer", "async_presentation", true); | 235 | Settings::values.async_presentation = |
| 236 | config->GetBoolean("Renderer", "async_presentation", true); | ||
| 236 | 237 | ||
| 237 | // Enable force_max_clock by default on Android | 238 | // Enable force_max_clock by default on Android |
| 238 | Settings::values.renderer_force_max_clock = | 239 | Settings::values.renderer_force_max_clock = |
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 926bb30e8..a890c6604 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 | |||
| @@ -1,3 +1,6 @@ | |||
| 1 | // SPDX-FileCopyrightText: 2023 yuzu Emulator Project | ||
| 2 | // SPDX-License-Identifier: GPL-3.0-or-later | ||
| 3 | |||
| 1 | #include <android/native_window_jni.h> | 4 | #include <android/native_window_jni.h> |
| 2 | 5 | ||
| 3 | #include "common/logging/log.h" | 6 | #include "common/logging/log.h" |
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 36d46eb51..b38087f73 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 | |||
| @@ -1,3 +1,6 @@ | |||
| 1 | // SPDX-FileCopyrightText: 2023 yuzu Emulator Project | ||
| 2 | // SPDX-License-Identifier: GPL-3.0-or-later | ||
| 3 | |||
| 1 | #pragma once | 4 | #pragma once |
| 2 | 5 | ||
| 3 | #include <memory> | 6 | #include <memory> |
diff --git a/src/android/app/src/main/jni/id_cache.cpp b/src/android/app/src/main/jni/id_cache.cpp index 7edadb94a..9cbbf23a3 100644 --- a/src/android/app/src/main/jni/id_cache.cpp +++ b/src/android/app/src/main/jni/id_cache.cpp | |||
| @@ -107,7 +107,7 @@ void JNI_OnUnload(JavaVM* vm, void* reserved) { | |||
| 107 | env->DeleteGlobalRef(s_disk_cache_progress_class); | 107 | env->DeleteGlobalRef(s_disk_cache_progress_class); |
| 108 | env->DeleteGlobalRef(s_load_callback_stage_class); | 108 | env->DeleteGlobalRef(s_load_callback_stage_class); |
| 109 | 109 | ||
| 110 | // UnInitialze applets | 110 | // UnInitialize applets |
| 111 | SoftwareKeyboard::CleanupJNI(env); | 111 | SoftwareKeyboard::CleanupJNI(env); |
| 112 | } | 112 | } |
| 113 | 113 | ||
diff --git a/src/android/app/src/main/jni/id_cache.h b/src/android/app/src/main/jni/id_cache.h index 9337cd254..be535fe1e 100644 --- a/src/android/app/src/main/jni/id_cache.h +++ b/src/android/app/src/main/jni/id_cache.h | |||
| @@ -1,3 +1,6 @@ | |||
| 1 | // SPDX-FileCopyrightText: 2023 yuzu Emulator Project | ||
| 2 | // SPDX-License-Identifier: GPL-3.0-or-later | ||
| 3 | |||
| 1 | #pragma once | 4 | #pragma once |
| 2 | 5 | ||
| 3 | #include <jni.h> | 6 | #include <jni.h> |
diff --git a/src/android/app/src/main/jni/native.cpp b/src/android/app/src/main/jni/native.cpp index a7321af2a..bbe6abdb0 100644 --- a/src/android/app/src/main/jni/native.cpp +++ b/src/android/app/src/main/jni/native.cpp | |||
| @@ -37,8 +37,8 @@ | |||
| 37 | #include "core/frontend/applets/profile_select.h" | 37 | #include "core/frontend/applets/profile_select.h" |
| 38 | #include "core/frontend/applets/software_keyboard.h" | 38 | #include "core/frontend/applets/software_keyboard.h" |
| 39 | #include "core/frontend/applets/web_browser.h" | 39 | #include "core/frontend/applets/web_browser.h" |
| 40 | #include "core/hid/hid_core.h" | ||
| 41 | #include "core/hid/emulated_controller.h" | 40 | #include "core/hid/emulated_controller.h" |
| 41 | #include "core/hid/hid_core.h" | ||
| 42 | #include "core/hid/hid_types.h" | 42 | #include "core/hid/hid_types.h" |
| 43 | #include "core/hle/service/acc/profile_manager.h" | 43 | #include "core/hle/service/acc/profile_manager.h" |
| 44 | #include "core/hle/service/am/applet_ae.h" | 44 | #include "core/hle/service/am/applet_ae.h" |
| @@ -276,7 +276,7 @@ public: | |||
| 276 | m_rom_metadata_cache.clear(); | 276 | m_rom_metadata_cache.clear(); |
| 277 | } | 277 | } |
| 278 | 278 | ||
| 279 | bool IsHandheldOnly(){ | 279 | bool IsHandheldOnly() { |
| 280 | const auto npad_style_set = m_system.HIDCore().GetSupportedStyleTag(); | 280 | const auto npad_style_set = m_system.HIDCore().GetSupportedStyleTag(); |
| 281 | 281 | ||
| 282 | if (npad_style_set.fullkey == 1) { | 282 | if (npad_style_set.fullkey == 1) { |
| @@ -290,42 +290,43 @@ public: | |||
| 290 | return !Settings::values.use_docked_mode.GetValue(); | 290 | return !Settings::values.use_docked_mode.GetValue(); |
| 291 | } | 291 | } |
| 292 | 292 | ||
| 293 | void SetDeviceType(int index, int type){ | 293 | void SetDeviceType(int index, int type) { |
| 294 | auto controller = m_system.HIDCore().GetEmulatedControllerByIndex(index); | 294 | auto controller = m_system.HIDCore().GetEmulatedControllerByIndex(index); |
| 295 | controller->SetNpadStyleIndex(static_cast<Core::HID::NpadStyleIndex>(type)); | 295 | controller->SetNpadStyleIndex(static_cast<Core::HID::NpadStyleIndex>(type)); |
| 296 | } | 296 | } |
| 297 | 297 | ||
| 298 | void OnGamepadConnectEvent(int index){ | 298 | void OnGamepadConnectEvent(int index) { |
| 299 | auto controller = m_system.HIDCore().GetEmulatedControllerByIndex(index); | 299 | auto controller = m_system.HIDCore().GetEmulatedControllerByIndex(index); |
| 300 | 300 | ||
| 301 | // Ensure that player1 is configured correctly and handheld disconnected | 301 | // Ensure that player1 is configured correctly and handheld disconnected |
| 302 | if(controller->GetNpadIdType() == Core::HID::NpadIdType::Player1){ | 302 | if (controller->GetNpadIdType() == Core::HID::NpadIdType::Player1) { |
| 303 | auto handheld = m_system.HIDCore().GetEmulatedController(Core::HID::NpadIdType::Handheld); | 303 | auto handheld = |
| 304 | 304 | m_system.HIDCore().GetEmulatedController(Core::HID::NpadIdType::Handheld); | |
| 305 | if(controller->GetNpadStyleIndex() == Core::HID::NpadStyleIndex::Handheld) { | 305 | |
| 306 | handheld->SetNpadStyleIndex(Core::HID::NpadStyleIndex::ProController); | 306 | if (controller->GetNpadStyleIndex() == Core::HID::NpadStyleIndex::Handheld) { |
| 307 | controller->SetNpadStyleIndex(Core::HID::NpadStyleIndex::ProController); | 307 | handheld->SetNpadStyleIndex(Core::HID::NpadStyleIndex::ProController); |
| 308 | handheld->Disconnect(); | 308 | controller->SetNpadStyleIndex(Core::HID::NpadStyleIndex::ProController); |
| 309 | } | 309 | handheld->Disconnect(); |
| 310 | } | ||
| 310 | } | 311 | } |
| 311 | 312 | ||
| 312 | // Ensure that handheld is configured correctly and player 1 disconnected | 313 | // Ensure that handheld is configured correctly and player 1 disconnected |
| 313 | if(controller->GetNpadIdType() == Core::HID::NpadIdType::Handheld){ | 314 | if (controller->GetNpadIdType() == Core::HID::NpadIdType::Handheld) { |
| 314 | auto player1 = m_system.HIDCore().GetEmulatedController(Core::HID::NpadIdType::Player1); | 315 | auto player1 = m_system.HIDCore().GetEmulatedController(Core::HID::NpadIdType::Player1); |
| 315 | 316 | ||
| 316 | if(controller->GetNpadStyleIndex() != Core::HID::NpadStyleIndex::Handheld) { | 317 | if (controller->GetNpadStyleIndex() != Core::HID::NpadStyleIndex::Handheld) { |
| 317 | player1->SetNpadStyleIndex(Core::HID::NpadStyleIndex::Handheld); | 318 | player1->SetNpadStyleIndex(Core::HID::NpadStyleIndex::Handheld); |
| 318 | controller->SetNpadStyleIndex(Core::HID::NpadStyleIndex::Handheld); | 319 | controller->SetNpadStyleIndex(Core::HID::NpadStyleIndex::Handheld); |
| 319 | player1->Disconnect(); | 320 | player1->Disconnect(); |
| 320 | } | 321 | } |
| 321 | } | 322 | } |
| 322 | 323 | ||
| 323 | if(!controller->IsConnected()){ | 324 | if (!controller->IsConnected()) { |
| 324 | controller->Connect(); | 325 | controller->Connect(); |
| 325 | } | 326 | } |
| 326 | } | 327 | } |
| 327 | 328 | ||
| 328 | void OnGamepadDisconnectEvent(int index){ | 329 | void OnGamepadDisconnectEvent(int index) { |
| 329 | auto controller = m_system.HIDCore().GetEmulatedControllerByIndex(index); | 330 | auto controller = m_system.HIDCore().GetEmulatedControllerByIndex(index); |
| 330 | controller->Disconnect(); | 331 | controller->Disconnect(); |
| 331 | } | 332 | } |
| @@ -497,14 +498,13 @@ jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_isRunning([[maybe_unused]] JNIEnv | |||
| 497 | } | 498 | } |
| 498 | 499 | ||
| 499 | jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_isHandheldOnly([[maybe_unused]] JNIEnv* env, | 500 | jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_isHandheldOnly([[maybe_unused]] JNIEnv* env, |
| 500 | [[maybe_unused]] jclass clazz) { | 501 | [[maybe_unused]] jclass clazz) { |
| 501 | return EmulationSession::GetInstance().IsHandheldOnly(); | 502 | return EmulationSession::GetInstance().IsHandheldOnly(); |
| 502 | } | 503 | } |
| 503 | 504 | ||
| 504 | jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_setDeviceType([[maybe_unused]] JNIEnv* env, | 505 | jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_setDeviceType([[maybe_unused]] JNIEnv* env, |
| 505 | [[maybe_unused]] jclass clazz, | 506 | [[maybe_unused]] jclass clazz, |
| 506 | jint j_device, | 507 | jint j_device, jint j_type) { |
| 507 | jint j_type) { | ||
| 508 | if (EmulationSession::GetInstance().IsRunning()) { | 508 | if (EmulationSession::GetInstance().IsRunning()) { |
| 509 | EmulationSession::GetInstance().SetDeviceType(j_device, j_type); | 509 | EmulationSession::GetInstance().SetDeviceType(j_device, j_type); |
| 510 | } | 510 | } |
| @@ -512,17 +512,16 @@ jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_setDeviceType([[maybe_unused]] JN | |||
| 512 | } | 512 | } |
| 513 | 513 | ||
| 514 | jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_onGamePadConnectEvent([[maybe_unused]] JNIEnv* env, | 514 | jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_onGamePadConnectEvent([[maybe_unused]] JNIEnv* env, |
| 515 | [[maybe_unused]] jclass clazz, | 515 | [[maybe_unused]] jclass clazz, |
| 516 | jint j_device) { | 516 | jint j_device) { |
| 517 | if (EmulationSession::GetInstance().IsRunning()) { | 517 | if (EmulationSession::GetInstance().IsRunning()) { |
| 518 | EmulationSession::GetInstance().OnGamepadConnectEvent(j_device); | 518 | EmulationSession::GetInstance().OnGamepadConnectEvent(j_device); |
| 519 | } | 519 | } |
| 520 | return static_cast<jboolean>(true); | 520 | return static_cast<jboolean>(true); |
| 521 | } | 521 | } |
| 522 | 522 | ||
| 523 | jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_onGamePadDisconnectEvent([[maybe_unused]] JNIEnv* env, | 523 | jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_onGamePadDisconnectEvent( |
| 524 | [[maybe_unused]] jclass clazz, | 524 | [[maybe_unused]] JNIEnv* env, [[maybe_unused]] jclass clazz, jint j_device) { |
| 525 | jint j_device) { | ||
| 526 | if (EmulationSession::GetInstance().IsRunning()) { | 525 | if (EmulationSession::GetInstance().IsRunning()) { |
| 527 | EmulationSession::GetInstance().OnGamepadDisconnectEvent(j_device); | 526 | EmulationSession::GetInstance().OnGamepadDisconnectEvent(j_device); |
| 528 | } | 527 | } |
| @@ -562,10 +561,11 @@ jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_onGamePadMotionEvent( | |||
| 562 | return static_cast<jboolean>(true); | 561 | return static_cast<jboolean>(true); |
| 563 | } | 562 | } |
| 564 | 563 | ||
| 565 | jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_onReadNfcTag( | 564 | jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_onReadNfcTag([[maybe_unused]] JNIEnv* env, |
| 566 | [[maybe_unused]] JNIEnv* env, [[maybe_unused]] jclass clazz, jbyteArray j_data) { | 565 | [[maybe_unused]] jclass clazz, |
| 566 | jbyteArray j_data) { | ||
| 567 | jboolean isCopy{false}; | 567 | jboolean isCopy{false}; |
| 568 | std::span<u8> data(reinterpret_cast<u8 *>(env->GetByteArrayElements(j_data, &isCopy)), | 568 | std::span<u8> data(reinterpret_cast<u8*>(env->GetByteArrayElements(j_data, &isCopy)), |
| 569 | static_cast<size_t>(env->GetArrayLength(j_data))); | 569 | static_cast<size_t>(env->GetArrayLength(j_data))); |
| 570 | 570 | ||
| 571 | if (EmulationSession::GetInstance().IsRunning()) { | 571 | if (EmulationSession::GetInstance().IsRunning()) { |
| @@ -574,8 +574,8 @@ jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_onReadNfcTag( | |||
| 574 | return static_cast<jboolean>(true); | 574 | return static_cast<jboolean>(true); |
| 575 | } | 575 | } |
| 576 | 576 | ||
| 577 | jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_onRemoveNfcTag( | 577 | jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_onRemoveNfcTag([[maybe_unused]] JNIEnv* env, |
| 578 | [[maybe_unused]] JNIEnv* env, [[maybe_unused]] jclass clazz) { | 578 | [[maybe_unused]] jclass clazz) { |
| 579 | if (EmulationSession::GetInstance().IsRunning()) { | 579 | if (EmulationSession::GetInstance().IsRunning()) { |
| 580 | EmulationSession::GetInstance().Window().OnRemoveNfcTag(); | 580 | EmulationSession::GetInstance().Window().OnRemoveNfcTag(); |
| 581 | } | 581 | } |
diff --git a/src/android/app/src/main/jni/native.h b/src/android/app/src/main/jni/native.h index d1e382a33..24dcbbcb8 100644 --- a/src/android/app/src/main/jni/native.h +++ b/src/android/app/src/main/jni/native.h | |||
| @@ -25,17 +25,19 @@ JNIEXPORT void JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_ResetRomMetadata(JN | |||
| 25 | JNIEXPORT jboolean JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_IsRunning(JNIEnv* env, | 25 | JNIEXPORT jboolean JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_IsRunning(JNIEnv* env, |
| 26 | jclass clazz); | 26 | jclass clazz); |
| 27 | 27 | ||
| 28 | JNIEXPORT jboolean JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_isHandheldOnly( | 28 | JNIEXPORT jboolean JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_isHandheldOnly(JNIEnv* env, |
| 29 | JNIEnv* env, jclass clazz); | 29 | jclass clazz); |
| 30 | 30 | ||
| 31 | JNIEXPORT jboolean JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_setDeviceType( | 31 | JNIEXPORT jboolean JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_setDeviceType(JNIEnv* env, |
| 32 | JNIEnv* env, jclass clazz, jstring j_device, jstring j_type); | 32 | jclass clazz, |
| 33 | jstring j_device, | ||
| 34 | jstring j_type); | ||
| 33 | 35 | ||
| 34 | JNIEXPORT jboolean JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_onGamePadConnectEvent( | 36 | JNIEXPORT jboolean JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_onGamePadConnectEvent( |
| 35 | JNIEnv* env, jclass clazz, jstring j_device); | 37 | JNIEnv* env, jclass clazz, jstring j_device); |
| 36 | 38 | ||
| 37 | JNIEXPORT jboolean JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_onGamePadDisconnectEvent( | 39 | JNIEXPORT jboolean JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_onGamePadDisconnectEvent( |
| 38 | JNIEnv* env, jclass clazz, jstring j_device); | 40 | JNIEnv* env, jclass clazz, jstring j_device); |
| 39 | 41 | ||
| 40 | JNIEXPORT jboolean JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_onGamePadEvent( | 42 | JNIEXPORT jboolean JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_onGamePadEvent( |
| 41 | JNIEnv* env, jclass clazz, jstring j_device, jint j_button, jint action); | 43 | JNIEnv* env, jclass clazz, jstring j_device, jint j_button, jint action); |
| @@ -44,13 +46,14 @@ JNIEXPORT jboolean JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_onGamePadMoveEv | |||
| 44 | JNIEnv* env, jclass clazz, jstring j_device, jint axis, jfloat x, jfloat y); | 46 | JNIEnv* env, jclass clazz, jstring j_device, jint axis, jfloat x, jfloat y); |
| 45 | 47 | ||
| 46 | JNIEXPORT jboolean JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_onGamePadAxisEvent( | 48 | JNIEXPORT jboolean JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_onGamePadAxisEvent( |
| 47 | JNIEnv* env, jclass clazz, jstring j_device, jint axis_id, jfloat axis_val); | 49 | JNIEnv* env, jclass clazz, jstring j_device, jint axis_id, jfloat axis_val); |
| 48 | 50 | ||
| 49 | JNIEXPORT jboolean JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_onReadNfcTag( | 51 | JNIEXPORT jboolean JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_onReadNfcTag(JNIEnv* env, |
| 50 | JNIEnv* env, jclass clazz, jbyteArray j_data); | 52 | jclass clazz, |
| 53 | jbyteArray j_data); | ||
| 51 | 54 | ||
| 52 | JNIEXPORT jboolean JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_onRemoveNfcTag( | 55 | JNIEXPORT jboolean JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_onRemoveNfcTag(JNIEnv* env, |
| 53 | JNIEnv* env, jclass clazz); | 56 | jclass clazz); |
| 54 | 57 | ||
| 55 | JNIEXPORT jboolean JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_onTouchEvent(JNIEnv* env, | 58 | JNIEXPORT jboolean JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_onTouchEvent(JNIEnv* env, |
| 56 | jclass clazz, | 59 | jclass clazz, |
diff --git a/src/android/app/src/main/res/values/strings.xml b/src/android/app/src/main/res/values/strings.xml index dd1137b69..cffa3ff0b 100644 --- a/src/android/app/src/main/res/values/strings.xml +++ b/src/android/app/src/main/res/values/strings.xml | |||
| @@ -78,7 +78,7 @@ | |||
| 78 | <string name="open_user_folder_description">Manage yuzu\'s internal files</string> | 78 | <string name="open_user_folder_description">Manage yuzu\'s internal files</string> |
| 79 | <string name="theme_and_color_description">Modify the look of the app</string> | 79 | <string name="theme_and_color_description">Modify the look of the app</string> |
| 80 | <string name="no_file_manager">No file manager found</string> | 80 | <string name="no_file_manager">No file manager found</string> |
| 81 | <string name="notification_no_directory_link">Couldn\'t open yuzu directory</string> | 81 | <string name="notification_no_directory_link">Could not open yuzu directory</string> |
| 82 | <string name="notification_no_directory_link_description">Please locate the user folder with the file manager\'s side panel manually.</string> | 82 | <string name="notification_no_directory_link_description">Please locate the user folder with the file manager\'s side panel manually.</string> |
| 83 | 83 | ||
| 84 | <!-- About screen strings --> | 84 | <!-- About screen strings --> |
| @@ -249,7 +249,7 @@ | |||
| 249 | <string name="language_latin_american_spanish">Latin American Spanish (Español latinoamericano)</string> | 249 | <string name="language_latin_american_spanish">Latin American Spanish (Español latinoamericano)</string> |
| 250 | <string name="language_simplified_chinese">Simplified Chinese (简体中文)</string> | 250 | <string name="language_simplified_chinese">Simplified Chinese (简体中文)</string> |
| 251 | <string name="language_traditional_chinese">Traditional Chinese (正體中文)</string> | 251 | <string name="language_traditional_chinese">Traditional Chinese (正體中文)</string> |
| 252 | <string name="language_brazilian_portuguese">Brazilian Portuguese (Portugues do Brasil)</string> | 252 | <string name="language_brazilian_portuguese">Brazilian Portuguese (Português do Brasil)</string> |
| 253 | 253 | ||
| 254 | <!-- Renderer APIs --> | 254 | <!-- Renderer APIs --> |
| 255 | <string name="renderer_vulkan">Vulkan</string> | 255 | <string name="renderer_vulkan">Vulkan</string> |
diff --git a/src/android/build.gradle.kts b/src/android/build.gradle.kts index 1ed9aed9a..e19e8ce58 100644 --- a/src/android/build.gradle.kts +++ b/src/android/build.gradle.kts | |||
| @@ -1,3 +1,6 @@ | |||
| 1 | // SPDX-FileCopyrightText: 2023 yuzu Emulator Project | ||
| 2 | // SPDX-License-Identifier: GPL-3.0-or-later | ||
| 3 | |||
| 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. | 4 | // Top-level build file where you can add configuration options common to all sub-projects/modules. |
| 2 | plugins { | 5 | plugins { |
| 3 | id("com.android.application") version "8.0.2" apply false | 6 | id("com.android.application") version "8.0.2" apply false |
diff --git a/src/android/gradle.properties b/src/android/gradle.properties index bf63cfce7..653a35ce8 100644 --- a/src/android/gradle.properties +++ b/src/android/gradle.properties | |||
| @@ -1,3 +1,6 @@ | |||
| 1 | # SPDX-FileCopyrightText: 2023 yuzu Emulator Project | ||
| 2 | # SPDX-License-Identifier: GPL-3.0-or-later | ||
| 3 | |||
| 1 | # Project-wide Gradle settings. | 4 | # Project-wide Gradle settings. |
| 2 | # IDE (e.g. Android Studio) users: | 5 | # IDE (e.g. Android Studio) users: |
| 3 | # Gradle settings configured through the IDE *will override* | 6 | # Gradle settings configured through the IDE *will override* |
diff --git a/src/android/gradlew b/src/android/gradlew index cccdd3d51..afa127966 100755 --- a/src/android/gradlew +++ b/src/android/gradlew | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | #!/usr/bin/env sh | 1 | #!/usr/bin/env sh |
| 2 | 2 | ||
| 3 | # SPDX-FileCopyrightText: 2023 yuzu Emulator Project | ||
| 4 | # SPDX-License-Identifier: GPL-3.0-or-later | ||
| 5 | |||
| 3 | ############################################################################## | 6 | ############################################################################## |
| 4 | ## | 7 | ## |
| 5 | ## Gradle start up script for UN*X | 8 | ## Gradle start up script for UN*X |
diff --git a/src/android/gradlew.bat b/src/android/gradlew.bat index f9553162f..be152d108 100644 --- a/src/android/gradlew.bat +++ b/src/android/gradlew.bat | |||
| @@ -1,3 +1,6 @@ | |||
| 1 | @rem SPDX-FileCopyrightText: 2023 yuzu Emulator Project | ||
| 2 | @rem SPDX-License-Identifier: GPL-3.0-or-later | ||
| 3 | |||
| 1 | @if "%DEBUG%" == "" @echo off | 4 | @if "%DEBUG%" == "" @echo off |
| 2 | @rem ########################################################################## | 5 | @rem ########################################################################## |
| 3 | @rem | 6 | @rem |
diff --git a/src/android/settings.gradle.kts b/src/android/settings.gradle.kts index 1fb82df41..af910b906 100644 --- a/src/android/settings.gradle.kts +++ b/src/android/settings.gradle.kts | |||
| @@ -1,3 +1,6 @@ | |||
| 1 | // SPDX-FileCopyrightText: 2023 yuzu Emulator Project | ||
| 2 | // SPDX-License-Identifier: GPL-3.0-or-later | ||
| 3 | |||
| 1 | pluginManagement { | 4 | pluginManagement { |
| 2 | repositories { | 5 | repositories { |
| 3 | gradlePluginPortal() | 6 | gradlePluginPortal() |
diff --git a/src/input_common/drivers/virtual_amiibo.cpp b/src/input_common/drivers/virtual_amiibo.cpp index 9505179c6..c08f21e2c 100644 --- a/src/input_common/drivers/virtual_amiibo.cpp +++ b/src/input_common/drivers/virtual_amiibo.cpp | |||
| @@ -107,19 +107,19 @@ VirtualAmiibo::Info VirtualAmiibo::LoadAmiibo(std::span<u8> data) { | |||
| 107 | } | 107 | } |
| 108 | 108 | ||
| 109 | switch (data.size_bytes()) { | 109 | switch (data.size_bytes()) { |
| 110 | case AmiiboSize: | 110 | case AmiiboSize: |
| 111 | case AmiiboSizeWithoutPassword: | 111 | case AmiiboSizeWithoutPassword: |
| 112 | nfc_data.resize(AmiiboSize); | 112 | nfc_data.resize(AmiiboSize); |
| 113 | break; | 113 | break; |
| 114 | case MifareSize: | 114 | case MifareSize: |
| 115 | nfc_data.resize(MifareSize); | 115 | nfc_data.resize(MifareSize); |
| 116 | break; | 116 | break; |
| 117 | default: | 117 | default: |
| 118 | return Info::NotAnAmiibo; | 118 | return Info::NotAnAmiibo; |
| 119 | } | 119 | } |
| 120 | 120 | ||
| 121 | state = State::AmiiboIsOpen; | 121 | state = State::AmiiboIsOpen; |
| 122 | memcpy(nfc_data.data(),data.data(),data.size_bytes()); | 122 | memcpy(nfc_data.data(), data.data(), data.size_bytes()); |
| 123 | SetNfc(identifier, {Common::Input::NfcState::NewAmiibo, nfc_data}); | 123 | SetNfc(identifier, {Common::Input::NfcState::NewAmiibo, nfc_data}); |
| 124 | return Info::Success; | 124 | return Info::Success; |
| 125 | } | 125 | } |