diff options
9 files changed, 148 insertions, 255 deletions
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/NativeLibrary.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/NativeLibrary.kt index f860cdd4b..9c32e044c 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/NativeLibrary.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/NativeLibrary.kt | |||
| @@ -286,7 +286,7 @@ object NativeLibrary { | |||
| 286 | /** | 286 | /** |
| 287 | * Unpauses emulation from a paused state. | 287 | * Unpauses emulation from a paused state. |
| 288 | */ | 288 | */ |
| 289 | external fun unPauseEmulation() | 289 | external fun unpauseEmulation() |
| 290 | 290 | ||
| 291 | /** | 291 | /** |
| 292 | * Pauses emulation. | 292 | * Pauses emulation. |
| @@ -314,6 +314,21 @@ object NativeLibrary { | |||
| 314 | external fun isPaused(): Boolean | 314 | external fun isPaused(): Boolean |
| 315 | 315 | ||
| 316 | /** | 316 | /** |
| 317 | * Mutes emulation sound | ||
| 318 | */ | ||
| 319 | external fun muteAudio(): Boolean | ||
| 320 | |||
| 321 | /** | ||
| 322 | * Unmutes emulation sound | ||
| 323 | */ | ||
| 324 | external fun unmuteAudio(): Boolean | ||
| 325 | |||
| 326 | /** | ||
| 327 | * Returns true if emulation audio is muted. | ||
| 328 | */ | ||
| 329 | external fun isMuted(): Boolean | ||
| 330 | |||
| 331 | /** | ||
| 317 | * Returns the performance stats for the current game | 332 | * Returns the performance stats for the current game |
| 318 | */ | 333 | */ |
| 319 | external fun getPerfStats(): DoubleArray | 334 | external fun getPerfStats(): DoubleArray |
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/activities/EmulationActivity.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/activities/EmulationActivity.kt index b1771b424..ae665ed2e 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/activities/EmulationActivity.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/activities/EmulationActivity.kt | |||
| @@ -65,6 +65,8 @@ class EmulationActivity : AppCompatActivity(), SensorEventListener { | |||
| 65 | 65 | ||
| 66 | private val actionPause = "ACTION_EMULATOR_PAUSE" | 66 | private val actionPause = "ACTION_EMULATOR_PAUSE" |
| 67 | private val actionPlay = "ACTION_EMULATOR_PLAY" | 67 | private val actionPlay = "ACTION_EMULATOR_PLAY" |
| 68 | private val actionMute = "ACTION_EMULATOR_MUTE" | ||
| 69 | private val actionUnmute = "ACTION_EMULATOR_UNMUTE" | ||
| 68 | 70 | ||
| 69 | private val settingsViewModel: SettingsViewModel by viewModels() | 71 | private val settingsViewModel: SettingsViewModel by viewModels() |
| 70 | 72 | ||
| @@ -320,6 +322,41 @@ class EmulationActivity : AppCompatActivity(), SensorEventListener { | |||
| 320 | pictureInPictureActions.add(pauseRemoteAction) | 322 | pictureInPictureActions.add(pauseRemoteAction) |
| 321 | } | 323 | } |
| 322 | 324 | ||
| 325 | if (NativeLibrary.isMuted()) { | ||
| 326 | val unmuteIcon = Icon.createWithResource( | ||
| 327 | this@EmulationActivity, | ||
| 328 | R.drawable.ic_pip_unmute | ||
| 329 | ) | ||
| 330 | val unmutePendingIntent = PendingIntent.getBroadcast( | ||
| 331 | this@EmulationActivity, | ||
| 332 | R.drawable.ic_pip_unmute, | ||
| 333 | Intent(actionUnmute), | ||
| 334 | pendingFlags | ||
| 335 | ) | ||
| 336 | val unmuteRemoteAction = RemoteAction( | ||
| 337 | unmuteIcon, | ||
| 338 | getString(R.string.unmute), | ||
| 339 | getString(R.string.unmute), | ||
| 340 | unmutePendingIntent | ||
| 341 | ) | ||
| 342 | pictureInPictureActions.add(unmuteRemoteAction) | ||
| 343 | } else { | ||
| 344 | val muteIcon = Icon.createWithResource(this@EmulationActivity, R.drawable.ic_pip_mute) | ||
| 345 | val mutePendingIntent = PendingIntent.getBroadcast( | ||
| 346 | this@EmulationActivity, | ||
| 347 | R.drawable.ic_pip_mute, | ||
| 348 | Intent(actionMute), | ||
| 349 | pendingFlags | ||
| 350 | ) | ||
| 351 | val muteRemoteAction = RemoteAction( | ||
| 352 | muteIcon, | ||
| 353 | getString(R.string.mute), | ||
| 354 | getString(R.string.mute), | ||
| 355 | mutePendingIntent | ||
| 356 | ) | ||
| 357 | pictureInPictureActions.add(muteRemoteAction) | ||
| 358 | } | ||
| 359 | |||
| 323 | return this.apply { setActions(pictureInPictureActions) } | 360 | return this.apply { setActions(pictureInPictureActions) } |
| 324 | } | 361 | } |
| 325 | 362 | ||
| @@ -337,10 +374,15 @@ class EmulationActivity : AppCompatActivity(), SensorEventListener { | |||
| 337 | private var pictureInPictureReceiver = object : BroadcastReceiver() { | 374 | private var pictureInPictureReceiver = object : BroadcastReceiver() { |
| 338 | override fun onReceive(context: Context?, intent: Intent) { | 375 | override fun onReceive(context: Context?, intent: Intent) { |
| 339 | if (intent.action == actionPlay) { | 376 | if (intent.action == actionPlay) { |
| 340 | if (NativeLibrary.isPaused()) NativeLibrary.unPauseEmulation() | 377 | if (NativeLibrary.isPaused()) NativeLibrary.unpauseEmulation() |
| 341 | } else if (intent.action == actionPause) { | 378 | } else if (intent.action == actionPause) { |
| 342 | if (!NativeLibrary.isPaused()) NativeLibrary.pauseEmulation() | 379 | if (!NativeLibrary.isPaused()) NativeLibrary.pauseEmulation() |
| 343 | } | 380 | } |
| 381 | if (intent.action == actionUnmute) { | ||
| 382 | if (NativeLibrary.isMuted()) NativeLibrary.unmuteAudio() | ||
| 383 | } else if (intent.action == actionMute) { | ||
| 384 | if (!NativeLibrary.isMuted()) NativeLibrary.muteAudio() | ||
| 385 | } | ||
| 344 | buildPictureInPictureParams() | 386 | buildPictureInPictureParams() |
| 345 | } | 387 | } |
| 346 | } | 388 | } |
| @@ -354,6 +396,8 @@ class EmulationActivity : AppCompatActivity(), SensorEventListener { | |||
| 354 | IntentFilter().apply { | 396 | IntentFilter().apply { |
| 355 | addAction(actionPause) | 397 | addAction(actionPause) |
| 356 | addAction(actionPlay) | 398 | addAction(actionPlay) |
| 399 | addAction(actionMute) | ||
| 400 | addAction(actionUnmute) | ||
| 357 | }.also { | 401 | }.also { |
| 358 | registerReceiver(pictureInPictureReceiver, it) | 402 | registerReceiver(pictureInPictureReceiver, it) |
| 359 | } | 403 | } |
| @@ -362,6 +406,8 @@ class EmulationActivity : AppCompatActivity(), SensorEventListener { | |||
| 362 | unregisterReceiver(pictureInPictureReceiver) | 406 | unregisterReceiver(pictureInPictureReceiver) |
| 363 | } catch (ignored: Exception) { | 407 | } catch (ignored: Exception) { |
| 364 | } | 408 | } |
| 409 | // Always resume audio, since there is no UI button | ||
| 410 | if (NativeLibrary.isMuted()) NativeLibrary.unmuteAudio() | ||
| 365 | } | 411 | } |
| 366 | } | 412 | } |
| 367 | 413 | ||
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/EmulationFragment.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/EmulationFragment.kt index 4643418c1..09976db62 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/EmulationFragment.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/EmulationFragment.kt | |||
| @@ -714,7 +714,7 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback { | |||
| 714 | State.PAUSED -> { | 714 | State.PAUSED -> { |
| 715 | Log.debug("[EmulationFragment] Resuming emulation.") | 715 | Log.debug("[EmulationFragment] Resuming emulation.") |
| 716 | NativeLibrary.surfaceChanged(surface) | 716 | NativeLibrary.surfaceChanged(surface) |
| 717 | NativeLibrary.unPauseEmulation() | 717 | NativeLibrary.unpauseEmulation() |
| 718 | } | 718 | } |
| 719 | 719 | ||
| 720 | else -> Log.debug("[EmulationFragment] Bug, run called while already running.") | 720 | else -> Log.debug("[EmulationFragment] Bug, run called while already running.") |
diff --git a/src/android/app/src/main/jni/CMakeLists.txt b/src/android/app/src/main/jni/CMakeLists.txt index 041781577..e2ed08e9f 100644 --- a/src/android/app/src/main/jni/CMakeLists.txt +++ b/src/android/app/src/main/jni/CMakeLists.txt | |||
| @@ -14,7 +14,6 @@ add_library(yuzu-android SHARED | |||
| 14 | id_cache.cpp | 14 | id_cache.cpp |
| 15 | id_cache.h | 15 | id_cache.h |
| 16 | native.cpp | 16 | native.cpp |
| 17 | native.h | ||
| 18 | ) | 17 | ) |
| 19 | 18 | ||
| 20 | set_property(TARGET yuzu-android PROPERTY IMPORTED_LOCATION ${FFmpeg_LIBRARY_DIR}) | 19 | set_property(TARGET yuzu-android PROPERTY IMPORTED_LOCATION ${FFmpeg_LIBRARY_DIR}) |
diff --git a/src/android/app/src/main/jni/native.cpp b/src/android/app/src/main/jni/native.cpp index f4fed0886..d576aac50 100644 --- a/src/android/app/src/main/jni/native.cpp +++ b/src/android/app/src/main/jni/native.cpp | |||
| @@ -14,6 +14,7 @@ | |||
| 14 | #include <android/api-level.h> | 14 | #include <android/api-level.h> |
| 15 | #include <android/native_window_jni.h> | 15 | #include <android/native_window_jni.h> |
| 16 | #include <core/loader/nro.h> | 16 | #include <core/loader/nro.h> |
| 17 | #include <jni.h> | ||
| 17 | 18 | ||
| 18 | #include "common/detached_tasks.h" | 19 | #include "common/detached_tasks.h" |
| 19 | #include "common/dynamic_library.h" | 20 | #include "common/dynamic_library.h" |
| @@ -527,35 +528,32 @@ static Core::SystemResultStatus RunEmulation(const std::string& filepath) { | |||
| 527 | 528 | ||
| 528 | extern "C" { | 529 | extern "C" { |
| 529 | 530 | ||
| 530 | void Java_org_yuzu_yuzu_1emu_NativeLibrary_surfaceChanged(JNIEnv* env, | 531 | void Java_org_yuzu_yuzu_1emu_NativeLibrary_surfaceChanged(JNIEnv* env, jclass clazz, jobject surf) { |
| 531 | [[maybe_unused]] jclass clazz, | ||
| 532 | jobject surf) { | ||
| 533 | EmulationSession::GetInstance().SetNativeWindow(ANativeWindow_fromSurface(env, surf)); | 532 | EmulationSession::GetInstance().SetNativeWindow(ANativeWindow_fromSurface(env, surf)); |
| 534 | EmulationSession::GetInstance().SurfaceChanged(); | 533 | EmulationSession::GetInstance().SurfaceChanged(); |
| 535 | } | 534 | } |
| 536 | 535 | ||
| 537 | void Java_org_yuzu_yuzu_1emu_NativeLibrary_surfaceDestroyed(JNIEnv* env, | 536 | void Java_org_yuzu_yuzu_1emu_NativeLibrary_surfaceDestroyed(JNIEnv* env, jclass clazz) { |
| 538 | [[maybe_unused]] jclass clazz) { | ||
| 539 | ANativeWindow_release(EmulationSession::GetInstance().NativeWindow()); | 537 | ANativeWindow_release(EmulationSession::GetInstance().NativeWindow()); |
| 540 | EmulationSession::GetInstance().SetNativeWindow(nullptr); | 538 | EmulationSession::GetInstance().SetNativeWindow(nullptr); |
| 541 | EmulationSession::GetInstance().SurfaceChanged(); | 539 | EmulationSession::GetInstance().SurfaceChanged(); |
| 542 | } | 540 | } |
| 543 | 541 | ||
| 544 | void Java_org_yuzu_yuzu_1emu_NativeLibrary_setAppDirectory(JNIEnv* env, | 542 | void Java_org_yuzu_yuzu_1emu_NativeLibrary_setAppDirectory(JNIEnv* env, jclass clazz, |
| 545 | [[maybe_unused]] jclass clazz, | ||
| 546 | jstring j_directory) { | 543 | jstring j_directory) { |
| 547 | Common::FS::SetAppDirectory(GetJString(env, j_directory)); | 544 | Common::FS::SetAppDirectory(GetJString(env, j_directory)); |
| 548 | } | 545 | } |
| 549 | 546 | ||
| 550 | int Java_org_yuzu_yuzu_1emu_NativeLibrary_installFileToNand(JNIEnv* env, | 547 | int Java_org_yuzu_yuzu_1emu_NativeLibrary_installFileToNand(JNIEnv* env, jclass clazz, |
| 551 | [[maybe_unused]] jclass clazz, | ||
| 552 | jstring j_file) { | 548 | jstring j_file) { |
| 553 | return EmulationSession::GetInstance().InstallFileToNand(GetJString(env, j_file)); | 549 | return EmulationSession::GetInstance().InstallFileToNand(GetJString(env, j_file)); |
| 554 | } | 550 | } |
| 555 | 551 | ||
| 556 | void JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_initializeGpuDriver( | 552 | void JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_initializeGpuDriver(JNIEnv* env, jclass clazz, |
| 557 | JNIEnv* env, [[maybe_unused]] jclass clazz, jstring hook_lib_dir, jstring custom_driver_dir, | 553 | jstring hook_lib_dir, |
| 558 | jstring custom_driver_name, jstring file_redirect_dir) { | 554 | jstring custom_driver_dir, |
| 555 | jstring custom_driver_name, | ||
| 556 | jstring file_redirect_dir) { | ||
| 559 | EmulationSession::GetInstance().InitializeGpuDriver( | 557 | EmulationSession::GetInstance().InitializeGpuDriver( |
| 560 | GetJString(env, hook_lib_dir), GetJString(env, custom_driver_dir), | 558 | GetJString(env, hook_lib_dir), GetJString(env, custom_driver_dir), |
| 561 | GetJString(env, custom_driver_name), GetJString(env, file_redirect_dir)); | 559 | GetJString(env, custom_driver_name), GetJString(env, file_redirect_dir)); |
| @@ -572,7 +570,7 @@ void JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_initializeGpuDriver( | |||
| 572 | } | 570 | } |
| 573 | 571 | ||
| 574 | jboolean JNICALL Java_org_yuzu_yuzu_1emu_utils_GpuDriverHelper_supportsCustomDriverLoading( | 572 | jboolean JNICALL Java_org_yuzu_yuzu_1emu_utils_GpuDriverHelper_supportsCustomDriverLoading( |
| 575 | [[maybe_unused]] JNIEnv* env, [[maybe_unused]] jobject instance) { | 573 | JNIEnv* env, [[maybe_unused]] jobject instance) { |
| 576 | #ifdef ARCHITECTURE_arm64 | 574 | #ifdef ARCHITECTURE_arm64 |
| 577 | // If the KGSL device exists custom drivers can be loaded using adrenotools | 575 | // If the KGSL device exists custom drivers can be loaded using adrenotools |
| 578 | return SupportsCustomDriver(); | 576 | return SupportsCustomDriver(); |
| @@ -581,49 +579,52 @@ jboolean JNICALL Java_org_yuzu_yuzu_1emu_utils_GpuDriverHelper_supportsCustomDri | |||
| 581 | #endif | 579 | #endif |
| 582 | } | 580 | } |
| 583 | 581 | ||
| 584 | jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_reloadKeys(JNIEnv* env, | 582 | jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_reloadKeys(JNIEnv* env, jclass clazz) { |
| 585 | [[maybe_unused]] jclass clazz) { | ||
| 586 | Core::Crypto::KeyManager::Instance().ReloadKeys(); | 583 | Core::Crypto::KeyManager::Instance().ReloadKeys(); |
| 587 | return static_cast<jboolean>(Core::Crypto::KeyManager::Instance().AreKeysLoaded()); | 584 | return static_cast<jboolean>(Core::Crypto::KeyManager::Instance().AreKeysLoaded()); |
| 588 | } | 585 | } |
| 589 | 586 | ||
| 590 | void Java_org_yuzu_yuzu_1emu_NativeLibrary_unPauseEmulation([[maybe_unused]] JNIEnv* env, | 587 | void Java_org_yuzu_yuzu_1emu_NativeLibrary_unpauseEmulation(JNIEnv* env, jclass clazz) { |
| 591 | [[maybe_unused]] jclass clazz) { | ||
| 592 | EmulationSession::GetInstance().UnPauseEmulation(); | 588 | EmulationSession::GetInstance().UnPauseEmulation(); |
| 593 | } | 589 | } |
| 594 | 590 | ||
| 595 | void Java_org_yuzu_yuzu_1emu_NativeLibrary_pauseEmulation([[maybe_unused]] JNIEnv* env, | 591 | void Java_org_yuzu_yuzu_1emu_NativeLibrary_pauseEmulation(JNIEnv* env, jclass clazz) { |
| 596 | [[maybe_unused]] jclass clazz) { | ||
| 597 | EmulationSession::GetInstance().PauseEmulation(); | 592 | EmulationSession::GetInstance().PauseEmulation(); |
| 598 | } | 593 | } |
| 599 | 594 | ||
| 600 | void Java_org_yuzu_yuzu_1emu_NativeLibrary_stopEmulation([[maybe_unused]] JNIEnv* env, | 595 | void Java_org_yuzu_yuzu_1emu_NativeLibrary_stopEmulation(JNIEnv* env, jclass clazz) { |
| 601 | [[maybe_unused]] jclass clazz) { | ||
| 602 | EmulationSession::GetInstance().HaltEmulation(); | 596 | EmulationSession::GetInstance().HaltEmulation(); |
| 603 | } | 597 | } |
| 604 | 598 | ||
| 605 | void Java_org_yuzu_yuzu_1emu_NativeLibrary_resetRomMetadata([[maybe_unused]] JNIEnv* env, | 599 | void Java_org_yuzu_yuzu_1emu_NativeLibrary_resetRomMetadata(JNIEnv* env, jclass clazz) { |
| 606 | [[maybe_unused]] jclass clazz) { | ||
| 607 | EmulationSession::GetInstance().ResetRomMetadata(); | 600 | EmulationSession::GetInstance().ResetRomMetadata(); |
| 608 | } | 601 | } |
| 609 | 602 | ||
| 610 | jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_isRunning([[maybe_unused]] JNIEnv* env, | 603 | jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_isRunning(JNIEnv* env, jclass clazz) { |
| 611 | [[maybe_unused]] jclass clazz) { | ||
| 612 | return static_cast<jboolean>(EmulationSession::GetInstance().IsRunning()); | 604 | return static_cast<jboolean>(EmulationSession::GetInstance().IsRunning()); |
| 613 | } | 605 | } |
| 614 | 606 | ||
| 615 | jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_isPaused([[maybe_unused]] JNIEnv* env, | 607 | jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_isPaused(JNIEnv* env, jclass clazz) { |
| 616 | [[maybe_unused]] jclass clazz) { | ||
| 617 | return static_cast<jboolean>(EmulationSession::GetInstance().IsPaused()); | 608 | return static_cast<jboolean>(EmulationSession::GetInstance().IsPaused()); |
| 618 | } | 609 | } |
| 619 | 610 | ||
| 620 | jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_isHandheldOnly([[maybe_unused]] JNIEnv* env, | 611 | void Java_org_yuzu_yuzu_1emu_NativeLibrary_muteAduio(JNIEnv* env, jclass clazz) { |
| 621 | [[maybe_unused]] jclass clazz) { | 612 | Settings::values.audio_muted = true; |
| 613 | } | ||
| 614 | |||
| 615 | void Java_org_yuzu_yuzu_1emu_NativeLibrary_unmuteAudio(JNIEnv* env, jclass clazz) { | ||
| 616 | Settings::values.audio_muted = false; | ||
| 617 | } | ||
| 618 | |||
| 619 | jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_isMuted(JNIEnv* env, jclass clazz) { | ||
| 620 | return static_cast<jboolean>(Settings::values.audio_muted.GetValue()); | ||
| 621 | } | ||
| 622 | |||
| 623 | jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_isHandheldOnly(JNIEnv* env, jclass clazz) { | ||
| 622 | return EmulationSession::GetInstance().IsHandheldOnly(); | 624 | return EmulationSession::GetInstance().IsHandheldOnly(); |
| 623 | } | 625 | } |
| 624 | 626 | ||
| 625 | jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_setDeviceType([[maybe_unused]] JNIEnv* env, | 627 | jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_setDeviceType(JNIEnv* env, jclass clazz, |
| 626 | [[maybe_unused]] jclass clazz, | ||
| 627 | jint j_device, jint j_type) { | 628 | jint j_device, jint j_type) { |
| 628 | if (EmulationSession::GetInstance().IsRunning()) { | 629 | if (EmulationSession::GetInstance().IsRunning()) { |
| 629 | EmulationSession::GetInstance().SetDeviceType(j_device, j_type); | 630 | EmulationSession::GetInstance().SetDeviceType(j_device, j_type); |
| @@ -631,8 +632,7 @@ jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_setDeviceType([[maybe_unused]] JN | |||
| 631 | return static_cast<jboolean>(true); | 632 | return static_cast<jboolean>(true); |
| 632 | } | 633 | } |
| 633 | 634 | ||
| 634 | jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_onGamePadConnectEvent([[maybe_unused]] JNIEnv* env, | 635 | jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_onGamePadConnectEvent(JNIEnv* env, jclass clazz, |
| 635 | [[maybe_unused]] jclass clazz, | ||
| 636 | jint j_device) { | 636 | jint j_device) { |
| 637 | if (EmulationSession::GetInstance().IsRunning()) { | 637 | if (EmulationSession::GetInstance().IsRunning()) { |
| 638 | EmulationSession::GetInstance().OnGamepadConnectEvent(j_device); | 638 | EmulationSession::GetInstance().OnGamepadConnectEvent(j_device); |
| @@ -640,15 +640,14 @@ jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_onGamePadConnectEvent([[maybe_unu | |||
| 640 | return static_cast<jboolean>(true); | 640 | return static_cast<jboolean>(true); |
| 641 | } | 641 | } |
| 642 | 642 | ||
| 643 | jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_onGamePadDisconnectEvent( | 643 | jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_onGamePadDisconnectEvent(JNIEnv* env, jclass clazz, |
| 644 | [[maybe_unused]] JNIEnv* env, [[maybe_unused]] jclass clazz, jint j_device) { | 644 | jint j_device) { |
| 645 | if (EmulationSession::GetInstance().IsRunning()) { | 645 | if (EmulationSession::GetInstance().IsRunning()) { |
| 646 | EmulationSession::GetInstance().OnGamepadDisconnectEvent(j_device); | 646 | EmulationSession::GetInstance().OnGamepadDisconnectEvent(j_device); |
| 647 | } | 647 | } |
| 648 | return static_cast<jboolean>(true); | 648 | return static_cast<jboolean>(true); |
| 649 | } | 649 | } |
| 650 | jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_onGamePadButtonEvent([[maybe_unused]] JNIEnv* env, | 650 | jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_onGamePadButtonEvent(JNIEnv* env, jclass clazz, |
| 651 | [[maybe_unused]] jclass clazz, | ||
| 652 | [[maybe_unused]] jint j_device, | 651 | [[maybe_unused]] jint j_device, |
| 653 | jint j_button, jint action) { | 652 | jint j_button, jint action) { |
| 654 | if (EmulationSession::GetInstance().IsRunning()) { | 653 | if (EmulationSession::GetInstance().IsRunning()) { |
| @@ -660,8 +659,7 @@ jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_onGamePadButtonEvent([[maybe_unus | |||
| 660 | return static_cast<jboolean>(true); | 659 | return static_cast<jboolean>(true); |
| 661 | } | 660 | } |
| 662 | 661 | ||
| 663 | jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_onGamePadJoystickEvent([[maybe_unused]] JNIEnv* env, | 662 | jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_onGamePadJoystickEvent(JNIEnv* env, jclass clazz, |
| 664 | [[maybe_unused]] jclass clazz, | ||
| 665 | jint j_device, jint stick_id, | 663 | jint j_device, jint stick_id, |
| 666 | jfloat x, jfloat y) { | 664 | jfloat x, jfloat y) { |
| 667 | if (EmulationSession::GetInstance().IsRunning()) { | 665 | if (EmulationSession::GetInstance().IsRunning()) { |
| @@ -671,9 +669,8 @@ jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_onGamePadJoystickEvent([[maybe_un | |||
| 671 | } | 669 | } |
| 672 | 670 | ||
| 673 | jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_onGamePadMotionEvent( | 671 | jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_onGamePadMotionEvent( |
| 674 | [[maybe_unused]] JNIEnv* env, [[maybe_unused]] jclass clazz, jint j_device, | 672 | JNIEnv* env, jclass clazz, jint j_device, jlong delta_timestamp, jfloat gyro_x, jfloat gyro_y, |
| 675 | jlong delta_timestamp, jfloat gyro_x, jfloat gyro_y, jfloat gyro_z, jfloat accel_x, | 673 | jfloat gyro_z, jfloat accel_x, jfloat accel_y, jfloat accel_z) { |
| 676 | jfloat accel_y, jfloat accel_z) { | ||
| 677 | if (EmulationSession::GetInstance().IsRunning()) { | 674 | if (EmulationSession::GetInstance().IsRunning()) { |
| 678 | EmulationSession::GetInstance().Window().OnGamepadMotionEvent( | 675 | EmulationSession::GetInstance().Window().OnGamepadMotionEvent( |
| 679 | j_device, delta_timestamp, gyro_x, gyro_y, gyro_z, accel_x, accel_y, accel_z); | 676 | j_device, delta_timestamp, gyro_x, gyro_y, gyro_z, accel_x, accel_y, accel_z); |
| @@ -681,8 +678,7 @@ jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_onGamePadMotionEvent( | |||
| 681 | return static_cast<jboolean>(true); | 678 | return static_cast<jboolean>(true); |
| 682 | } | 679 | } |
| 683 | 680 | ||
| 684 | jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_onReadNfcTag([[maybe_unused]] JNIEnv* env, | 681 | jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_onReadNfcTag(JNIEnv* env, jclass clazz, |
| 685 | [[maybe_unused]] jclass clazz, | ||
| 686 | jbyteArray j_data) { | 682 | jbyteArray j_data) { |
| 687 | jboolean isCopy{false}; | 683 | jboolean isCopy{false}; |
| 688 | std::span<u8> data(reinterpret_cast<u8*>(env->GetByteArrayElements(j_data, &isCopy)), | 684 | std::span<u8> data(reinterpret_cast<u8*>(env->GetByteArrayElements(j_data, &isCopy)), |
| @@ -694,39 +690,34 @@ jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_onReadNfcTag([[maybe_unused]] JNI | |||
| 694 | return static_cast<jboolean>(true); | 690 | return static_cast<jboolean>(true); |
| 695 | } | 691 | } |
| 696 | 692 | ||
| 697 | jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_onRemoveNfcTag([[maybe_unused]] JNIEnv* env, | 693 | jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_onRemoveNfcTag(JNIEnv* env, jclass clazz) { |
| 698 | [[maybe_unused]] jclass clazz) { | ||
| 699 | if (EmulationSession::GetInstance().IsRunning()) { | 694 | if (EmulationSession::GetInstance().IsRunning()) { |
| 700 | EmulationSession::GetInstance().Window().OnRemoveNfcTag(); | 695 | EmulationSession::GetInstance().Window().OnRemoveNfcTag(); |
| 701 | } | 696 | } |
| 702 | return static_cast<jboolean>(true); | 697 | return static_cast<jboolean>(true); |
| 703 | } | 698 | } |
| 704 | 699 | ||
| 705 | void Java_org_yuzu_yuzu_1emu_NativeLibrary_onTouchPressed([[maybe_unused]] JNIEnv* env, | 700 | void Java_org_yuzu_yuzu_1emu_NativeLibrary_onTouchPressed(JNIEnv* env, jclass clazz, jint id, |
| 706 | [[maybe_unused]] jclass clazz, jint id, | ||
| 707 | jfloat x, jfloat y) { | 701 | jfloat x, jfloat y) { |
| 708 | if (EmulationSession::GetInstance().IsRunning()) { | 702 | if (EmulationSession::GetInstance().IsRunning()) { |
| 709 | EmulationSession::GetInstance().Window().OnTouchPressed(id, x, y); | 703 | EmulationSession::GetInstance().Window().OnTouchPressed(id, x, y); |
| 710 | } | 704 | } |
| 711 | } | 705 | } |
| 712 | 706 | ||
| 713 | void Java_org_yuzu_yuzu_1emu_NativeLibrary_onTouchMoved([[maybe_unused]] JNIEnv* env, | 707 | void Java_org_yuzu_yuzu_1emu_NativeLibrary_onTouchMoved(JNIEnv* env, jclass clazz, jint id, |
| 714 | [[maybe_unused]] jclass clazz, jint id, | ||
| 715 | jfloat x, jfloat y) { | 708 | jfloat x, jfloat y) { |
| 716 | if (EmulationSession::GetInstance().IsRunning()) { | 709 | if (EmulationSession::GetInstance().IsRunning()) { |
| 717 | EmulationSession::GetInstance().Window().OnTouchMoved(id, x, y); | 710 | EmulationSession::GetInstance().Window().OnTouchMoved(id, x, y); |
| 718 | } | 711 | } |
| 719 | } | 712 | } |
| 720 | 713 | ||
| 721 | void Java_org_yuzu_yuzu_1emu_NativeLibrary_onTouchReleased([[maybe_unused]] JNIEnv* env, | 714 | void Java_org_yuzu_yuzu_1emu_NativeLibrary_onTouchReleased(JNIEnv* env, jclass clazz, jint id) { |
| 722 | [[maybe_unused]] jclass clazz, jint id) { | ||
| 723 | if (EmulationSession::GetInstance().IsRunning()) { | 715 | if (EmulationSession::GetInstance().IsRunning()) { |
| 724 | EmulationSession::GetInstance().Window().OnTouchReleased(id); | 716 | EmulationSession::GetInstance().Window().OnTouchReleased(id); |
| 725 | } | 717 | } |
| 726 | } | 718 | } |
| 727 | 719 | ||
| 728 | jbyteArray Java_org_yuzu_yuzu_1emu_NativeLibrary_getIcon([[maybe_unused]] JNIEnv* env, | 720 | jbyteArray Java_org_yuzu_yuzu_1emu_NativeLibrary_getIcon(JNIEnv* env, jclass clazz, |
| 729 | [[maybe_unused]] jclass clazz, | ||
| 730 | [[maybe_unused]] jstring j_filename) { | 721 | [[maybe_unused]] jstring j_filename) { |
| 731 | auto icon_data = EmulationSession::GetInstance().GetRomIcon(GetJString(env, j_filename)); | 722 | auto icon_data = EmulationSession::GetInstance().GetRomIcon(GetJString(env, j_filename)); |
| 732 | jbyteArray icon = env->NewByteArray(static_cast<jsize>(icon_data.size())); | 723 | jbyteArray icon = env->NewByteArray(static_cast<jsize>(icon_data.size())); |
| @@ -735,67 +726,58 @@ jbyteArray Java_org_yuzu_yuzu_1emu_NativeLibrary_getIcon([[maybe_unused]] JNIEnv | |||
| 735 | return icon; | 726 | return icon; |
| 736 | } | 727 | } |
| 737 | 728 | ||
| 738 | jstring Java_org_yuzu_yuzu_1emu_NativeLibrary_getTitle([[maybe_unused]] JNIEnv* env, | 729 | jstring Java_org_yuzu_yuzu_1emu_NativeLibrary_getTitle(JNIEnv* env, jclass clazz, |
| 739 | [[maybe_unused]] jclass clazz, | ||
| 740 | [[maybe_unused]] jstring j_filename) { | 730 | [[maybe_unused]] jstring j_filename) { |
| 741 | auto title = EmulationSession::GetInstance().GetRomTitle(GetJString(env, j_filename)); | 731 | auto title = EmulationSession::GetInstance().GetRomTitle(GetJString(env, j_filename)); |
| 742 | return env->NewStringUTF(title.c_str()); | 732 | return env->NewStringUTF(title.c_str()); |
| 743 | } | 733 | } |
| 744 | 734 | ||
| 745 | jstring Java_org_yuzu_yuzu_1emu_NativeLibrary_getDescription([[maybe_unused]] JNIEnv* env, | 735 | jstring Java_org_yuzu_yuzu_1emu_NativeLibrary_getDescription(JNIEnv* env, jclass clazz, |
| 746 | [[maybe_unused]] jclass clazz, | ||
| 747 | jstring j_filename) { | 736 | jstring j_filename) { |
| 748 | return j_filename; | 737 | return j_filename; |
| 749 | } | 738 | } |
| 750 | 739 | ||
| 751 | jstring Java_org_yuzu_yuzu_1emu_NativeLibrary_getGameId([[maybe_unused]] JNIEnv* env, | 740 | jstring Java_org_yuzu_yuzu_1emu_NativeLibrary_getGameId(JNIEnv* env, jclass clazz, |
| 752 | [[maybe_unused]] jclass clazz, | ||
| 753 | jstring j_filename) { | 741 | jstring j_filename) { |
| 754 | return j_filename; | 742 | return j_filename; |
| 755 | } | 743 | } |
| 756 | 744 | ||
| 757 | jstring Java_org_yuzu_yuzu_1emu_NativeLibrary_getRegions([[maybe_unused]] JNIEnv* env, | 745 | jstring Java_org_yuzu_yuzu_1emu_NativeLibrary_getRegions(JNIEnv* env, jclass clazz, |
| 758 | [[maybe_unused]] jclass clazz, | ||
| 759 | [[maybe_unused]] jstring j_filename) { | 746 | [[maybe_unused]] jstring j_filename) { |
| 760 | return env->NewStringUTF(""); | 747 | return env->NewStringUTF(""); |
| 761 | } | 748 | } |
| 762 | 749 | ||
| 763 | jstring Java_org_yuzu_yuzu_1emu_NativeLibrary_getCompany([[maybe_unused]] JNIEnv* env, | 750 | jstring Java_org_yuzu_yuzu_1emu_NativeLibrary_getCompany(JNIEnv* env, jclass clazz, |
| 764 | [[maybe_unused]] jclass clazz, | ||
| 765 | [[maybe_unused]] jstring j_filename) { | 751 | [[maybe_unused]] jstring j_filename) { |
| 766 | return env->NewStringUTF(""); | 752 | return env->NewStringUTF(""); |
| 767 | } | 753 | } |
| 768 | 754 | ||
| 769 | jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_isHomebrew([[maybe_unused]] JNIEnv* env, | 755 | jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_isHomebrew(JNIEnv* env, jclass clazz, |
| 770 | [[maybe_unused]] jclass clazz, | ||
| 771 | [[maybe_unused]] jstring j_filename) { | 756 | [[maybe_unused]] jstring j_filename) { |
| 772 | return EmulationSession::GetInstance().GetIsHomebrew(GetJString(env, j_filename)); | 757 | return EmulationSession::GetInstance().GetIsHomebrew(GetJString(env, j_filename)); |
| 773 | } | 758 | } |
| 774 | 759 | ||
| 775 | void Java_org_yuzu_yuzu_1emu_NativeLibrary_initializeEmulation | 760 | void Java_org_yuzu_yuzu_1emu_NativeLibrary_initializeEmulation |
| 776 | [[maybe_unused]] (JNIEnv* env, [[maybe_unused]] jclass clazz) { | 761 | [[maybe_unused]] (JNIEnv* env, jclass clazz) { |
| 777 | // Create the default config.ini. | 762 | // Create the default config.ini. |
| 778 | Config{}; | 763 | Config{}; |
| 779 | // Initialize the emulated system. | 764 | // Initialize the emulated system. |
| 780 | EmulationSession::GetInstance().System().Initialize(); | 765 | EmulationSession::GetInstance().System().Initialize(); |
| 781 | } | 766 | } |
| 782 | 767 | ||
| 783 | jint Java_org_yuzu_yuzu_1emu_NativeLibrary_defaultCPUCore([[maybe_unused]] JNIEnv* env, | 768 | jint Java_org_yuzu_yuzu_1emu_NativeLibrary_defaultCPUCore(JNIEnv* env, jclass clazz) { |
| 784 | [[maybe_unused]] jclass clazz) { | ||
| 785 | return {}; | 769 | return {}; |
| 786 | } | 770 | } |
| 787 | 771 | ||
| 788 | void Java_org_yuzu_yuzu_1emu_NativeLibrary_run__Ljava_lang_String_2Ljava_lang_String_2Z( | 772 | void Java_org_yuzu_yuzu_1emu_NativeLibrary_run__Ljava_lang_String_2Ljava_lang_String_2Z( |
| 789 | [[maybe_unused]] JNIEnv* env, [[maybe_unused]] jclass clazz, [[maybe_unused]] jstring j_file, | 773 | JNIEnv* env, jclass clazz, [[maybe_unused]] jstring j_file, |
| 790 | [[maybe_unused]] jstring j_savestate, [[maybe_unused]] jboolean j_delete_savestate) {} | 774 | [[maybe_unused]] jstring j_savestate, [[maybe_unused]] jboolean j_delete_savestate) {} |
| 791 | 775 | ||
| 792 | void Java_org_yuzu_yuzu_1emu_NativeLibrary_reloadSettings([[maybe_unused]] JNIEnv* env, | 776 | void Java_org_yuzu_yuzu_1emu_NativeLibrary_reloadSettings(JNIEnv* env, jclass clazz) { |
| 793 | [[maybe_unused]] jclass clazz) { | ||
| 794 | Config{}; | 777 | Config{}; |
| 795 | } | 778 | } |
| 796 | 779 | ||
| 797 | jstring Java_org_yuzu_yuzu_1emu_NativeLibrary_getUserSetting([[maybe_unused]] JNIEnv* env, | 780 | jstring Java_org_yuzu_yuzu_1emu_NativeLibrary_getUserSetting(JNIEnv* env, jclass clazz, |
| 798 | [[maybe_unused]] jclass clazz, | ||
| 799 | jstring j_game_id, jstring j_section, | 781 | jstring j_game_id, jstring j_section, |
| 800 | jstring j_key) { | 782 | jstring j_key) { |
| 801 | std::string_view game_id = env->GetStringUTFChars(j_game_id, 0); | 783 | std::string_view game_id = env->GetStringUTFChars(j_game_id, 0); |
| @@ -809,8 +791,7 @@ jstring Java_org_yuzu_yuzu_1emu_NativeLibrary_getUserSetting([[maybe_unused]] JN | |||
| 809 | return env->NewStringUTF(""); | 791 | return env->NewStringUTF(""); |
| 810 | } | 792 | } |
| 811 | 793 | ||
| 812 | void Java_org_yuzu_yuzu_1emu_NativeLibrary_setUserSetting([[maybe_unused]] JNIEnv* env, | 794 | void Java_org_yuzu_yuzu_1emu_NativeLibrary_setUserSetting(JNIEnv* env, jclass clazz, |
| 813 | [[maybe_unused]] jclass clazz, | ||
| 814 | jstring j_game_id, jstring j_section, | 795 | jstring j_game_id, jstring j_section, |
| 815 | jstring j_key, jstring j_value) { | 796 | jstring j_key, jstring j_value) { |
| 816 | std::string_view game_id = env->GetStringUTFChars(j_game_id, 0); | 797 | std::string_view game_id = env->GetStringUTFChars(j_game_id, 0); |
| @@ -824,16 +805,14 @@ void Java_org_yuzu_yuzu_1emu_NativeLibrary_setUserSetting([[maybe_unused]] JNIEn | |||
| 824 | env->ReleaseStringUTFChars(j_value, value.data()); | 805 | env->ReleaseStringUTFChars(j_value, value.data()); |
| 825 | } | 806 | } |
| 826 | 807 | ||
| 827 | void Java_org_yuzu_yuzu_1emu_NativeLibrary_initGameIni([[maybe_unused]] JNIEnv* env, | 808 | void Java_org_yuzu_yuzu_1emu_NativeLibrary_initGameIni(JNIEnv* env, jclass clazz, |
| 828 | [[maybe_unused]] jclass clazz, | ||
| 829 | jstring j_game_id) { | 809 | jstring j_game_id) { |
| 830 | std::string_view game_id = env->GetStringUTFChars(j_game_id, 0); | 810 | std::string_view game_id = env->GetStringUTFChars(j_game_id, 0); |
| 831 | 811 | ||
| 832 | env->ReleaseStringUTFChars(j_game_id, game_id.data()); | 812 | env->ReleaseStringUTFChars(j_game_id, game_id.data()); |
| 833 | } | 813 | } |
| 834 | 814 | ||
| 835 | jdoubleArray Java_org_yuzu_yuzu_1emu_NativeLibrary_getPerfStats([[maybe_unused]] JNIEnv* env, | 815 | jdoubleArray Java_org_yuzu_yuzu_1emu_NativeLibrary_getPerfStats(JNIEnv* env, jclass clazz) { |
| 836 | [[maybe_unused]] jclass clazz) { | ||
| 837 | jdoubleArray j_stats = env->NewDoubleArray(4); | 816 | jdoubleArray j_stats = env->NewDoubleArray(4); |
| 838 | 817 | ||
| 839 | if (EmulationSession::GetInstance().IsRunning()) { | 818 | if (EmulationSession::GetInstance().IsRunning()) { |
| @@ -849,11 +828,11 @@ jdoubleArray Java_org_yuzu_yuzu_1emu_NativeLibrary_getPerfStats([[maybe_unused]] | |||
| 849 | return j_stats; | 828 | return j_stats; |
| 850 | } | 829 | } |
| 851 | 830 | ||
| 852 | void Java_org_yuzu_yuzu_1emu_utils_DirectoryInitialization_setSysDirectory( | 831 | void Java_org_yuzu_yuzu_1emu_utils_DirectoryInitialization_setSysDirectory(JNIEnv* env, |
| 853 | [[maybe_unused]] JNIEnv* env, [[maybe_unused]] jclass clazz, jstring j_path) {} | 832 | jclass clazz, |
| 833 | jstring j_path) {} | ||
| 854 | 834 | ||
| 855 | void Java_org_yuzu_yuzu_1emu_NativeLibrary_run__Ljava_lang_String_2([[maybe_unused]] JNIEnv* env, | 835 | void Java_org_yuzu_yuzu_1emu_NativeLibrary_run__Ljava_lang_String_2(JNIEnv* env, jclass clazz, |
| 856 | [[maybe_unused]] jclass clazz, | ||
| 857 | jstring j_path) { | 836 | jstring j_path) { |
| 858 | const std::string path = GetJString(env, j_path); | 837 | const std::string path = GetJString(env, j_path); |
| 859 | 838 | ||
| @@ -864,8 +843,7 @@ void Java_org_yuzu_yuzu_1emu_NativeLibrary_run__Ljava_lang_String_2([[maybe_unus | |||
| 864 | } | 843 | } |
| 865 | } | 844 | } |
| 866 | 845 | ||
| 867 | void Java_org_yuzu_yuzu_1emu_NativeLibrary_logDeviceInfo([[maybe_unused]] JNIEnv* env, | 846 | void Java_org_yuzu_yuzu_1emu_NativeLibrary_logDeviceInfo(JNIEnv* env, jclass clazz) { |
| 868 | [[maybe_unused]] jclass clazz) { | ||
| 869 | LOG_INFO(Frontend, "yuzu Version: {}-{}", Common::g_scm_branch, Common::g_scm_desc); | 847 | LOG_INFO(Frontend, "yuzu Version: {}-{}", Common::g_scm_branch, Common::g_scm_desc); |
| 870 | LOG_INFO(Frontend, "Host OS: Android API level {}", android_get_device_api_level()); | 848 | LOG_INFO(Frontend, "Host OS: Android API level {}", android_get_device_api_level()); |
| 871 | } | 849 | } |
diff --git a/src/android/app/src/main/jni/native.h b/src/android/app/src/main/jni/native.h deleted file mode 100644 index 24dcbbcb8..000000000 --- a/src/android/app/src/main/jni/native.h +++ /dev/null | |||
| @@ -1,165 +0,0 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project | ||
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | ||
| 3 | |||
| 4 | #pragma once | ||
| 5 | |||
| 6 | #include <jni.h> | ||
| 7 | |||
| 8 | // Function calls from the Java side | ||
| 9 | #ifdef __cplusplus | ||
| 10 | extern "C" { | ||
| 11 | #endif | ||
| 12 | |||
| 13 | JNIEXPORT void JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_UnPauseEmulation(JNIEnv* env, | ||
| 14 | jclass clazz); | ||
| 15 | |||
| 16 | JNIEXPORT void JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_PauseEmulation(JNIEnv* env, | ||
| 17 | jclass clazz); | ||
| 18 | |||
| 19 | JNIEXPORT void JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_StopEmulation(JNIEnv* env, | ||
| 20 | jclass clazz); | ||
| 21 | |||
| 22 | JNIEXPORT void JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_ResetRomMetadata(JNIEnv* env, | ||
| 23 | jclass clazz); | ||
| 24 | |||
| 25 | JNIEXPORT jboolean JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_IsRunning(JNIEnv* env, | ||
| 26 | jclass clazz); | ||
| 27 | |||
| 28 | JNIEXPORT jboolean JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_isHandheldOnly(JNIEnv* env, | ||
| 29 | jclass clazz); | ||
| 30 | |||
| 31 | JNIEXPORT jboolean JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_setDeviceType(JNIEnv* env, | ||
| 32 | jclass clazz, | ||
| 33 | jstring j_device, | ||
| 34 | jstring j_type); | ||
| 35 | |||
| 36 | JNIEXPORT jboolean JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_onGamePadConnectEvent( | ||
| 37 | JNIEnv* env, jclass clazz, jstring j_device); | ||
| 38 | |||
| 39 | JNIEXPORT jboolean JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_onGamePadDisconnectEvent( | ||
| 40 | JNIEnv* env, jclass clazz, jstring j_device); | ||
| 41 | |||
| 42 | JNIEXPORT jboolean JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_onGamePadEvent( | ||
| 43 | JNIEnv* env, jclass clazz, jstring j_device, jint j_button, jint action); | ||
| 44 | |||
| 45 | JNIEXPORT jboolean JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_onGamePadMoveEvent( | ||
| 46 | JNIEnv* env, jclass clazz, jstring j_device, jint axis, jfloat x, jfloat y); | ||
| 47 | |||
| 48 | JNIEXPORT jboolean JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_onGamePadAxisEvent( | ||
| 49 | JNIEnv* env, jclass clazz, jstring j_device, jint axis_id, jfloat axis_val); | ||
| 50 | |||
| 51 | JNIEXPORT jboolean JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_onReadNfcTag(JNIEnv* env, | ||
| 52 | jclass clazz, | ||
| 53 | jbyteArray j_data); | ||
| 54 | |||
| 55 | JNIEXPORT jboolean JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_onRemoveNfcTag(JNIEnv* env, | ||
| 56 | jclass clazz); | ||
| 57 | |||
| 58 | JNIEXPORT jboolean JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_onTouchEvent(JNIEnv* env, | ||
| 59 | jclass clazz, | ||
| 60 | jfloat x, jfloat y, | ||
| 61 | jboolean pressed); | ||
| 62 | |||
| 63 | JNIEXPORT void JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_onTouchMoved(JNIEnv* env, jclass clazz, | ||
| 64 | jfloat x, jfloat y); | ||
| 65 | |||
| 66 | JNIEXPORT jbyteArray JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_GetIcon(JNIEnv* env, | ||
| 67 | jclass clazz, | ||
| 68 | jstring j_file); | ||
| 69 | |||
| 70 | JNIEXPORT jstring JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_GetTitle(JNIEnv* env, jclass clazz, | ||
| 71 | jstring j_filename); | ||
| 72 | |||
| 73 | JNIEXPORT jstring JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_GetDescription(JNIEnv* env, | ||
| 74 | jclass clazz, | ||
| 75 | jstring j_filename); | ||
| 76 | |||
| 77 | JNIEXPORT jstring JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_GetGameId(JNIEnv* env, jclass clazz, | ||
| 78 | jstring j_filename); | ||
| 79 | |||
| 80 | JNIEXPORT jstring JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_GetRegions(JNIEnv* env, | ||
| 81 | jclass clazz, | ||
| 82 | jstring j_filename); | ||
| 83 | |||
| 84 | JNIEXPORT jstring JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_GetCompany(JNIEnv* env, | ||
| 85 | jclass clazz, | ||
| 86 | jstring j_filename); | ||
| 87 | |||
| 88 | JNIEXPORT jstring JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_GetGitRevision(JNIEnv* env, | ||
| 89 | jclass clazz); | ||
| 90 | |||
| 91 | JNIEXPORT void JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_SetAppDirectory(JNIEnv* env, | ||
| 92 | jclass clazz, | ||
| 93 | jstring j_directory); | ||
| 94 | |||
| 95 | JNIEXPORT void JNICALL | ||
| 96 | Java_org_yuzu_yuzu_1emu_NativeLibrary_Java_org_yuzu_yuzu_1emu_NativeLibrary_InitializeGpuDriver( | ||
| 97 | JNIEnv* env, jclass clazz, jstring hook_lib_dir, jstring custom_driver_dir, | ||
| 98 | jstring custom_driver_name, jstring file_redirect_dir); | ||
| 99 | |||
| 100 | JNIEXPORT jboolean JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_ReloadKeys(JNIEnv* env, | ||
| 101 | jclass clazz); | ||
| 102 | |||
| 103 | JNIEXPORT void JNICALL Java_org_yuzu_yuzu_1emu_utils_DirectoryInitialization_SetSysDirectory( | ||
| 104 | JNIEnv* env, jclass clazz, jstring path_); | ||
| 105 | |||
| 106 | JNIEXPORT void JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_SetSysDirectory(JNIEnv* env, | ||
| 107 | jclass clazz, | ||
| 108 | jstring path); | ||
| 109 | |||
| 110 | JNIEXPORT void JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_InitializeEmulation(JNIEnv* env, | ||
| 111 | jclass clazz); | ||
| 112 | |||
| 113 | JNIEXPORT jint JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_DefaultCPUCore(JNIEnv* env, | ||
| 114 | jclass clazz); | ||
| 115 | JNIEXPORT void JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_SetProfiling(JNIEnv* env, jclass clazz, | ||
| 116 | jboolean enable); | ||
| 117 | |||
| 118 | JNIEXPORT void JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_WriteProfileResults(JNIEnv* env, | ||
| 119 | jclass clazz); | ||
| 120 | |||
| 121 | JNIEXPORT void JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_NotifyOrientationChange( | ||
| 122 | JNIEnv* env, jclass clazz, jint layout_option, jint rotation); | ||
| 123 | |||
| 124 | JNIEXPORT void JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_Run__Ljava_lang_String_2( | ||
| 125 | JNIEnv* env, jclass clazz, jstring j_path); | ||
| 126 | |||
| 127 | JNIEXPORT void JNICALL | ||
| 128 | Java_org_yuzu_yuzu_1emu_NativeLibrary_Run__Ljava_lang_String_2Ljava_lang_String_2Z( | ||
| 129 | JNIEnv* env, jclass clazz, jstring j_file, jstring j_savestate, jboolean j_delete_savestate); | ||
| 130 | |||
| 131 | JNIEXPORT void JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_SurfaceChanged(JNIEnv* env, | ||
| 132 | jclass clazz, | ||
| 133 | jobject surf); | ||
| 134 | |||
| 135 | JNIEXPORT void JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_SurfaceDestroyed(JNIEnv* env, | ||
| 136 | jclass clazz); | ||
| 137 | |||
| 138 | JNIEXPORT void JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_InitGameIni(JNIEnv* env, jclass clazz, | ||
| 139 | jstring j_game_id); | ||
| 140 | |||
| 141 | JNIEXPORT void JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_ReloadSettings(JNIEnv* env, | ||
| 142 | jclass clazz); | ||
| 143 | |||
| 144 | JNIEXPORT void JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_SetUserSetting( | ||
| 145 | JNIEnv* env, jclass clazz, jstring j_game_id, jstring j_section, jstring j_key, | ||
| 146 | jstring j_value); | ||
| 147 | |||
| 148 | JNIEXPORT jstring JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_GetUserSetting( | ||
| 149 | JNIEnv* env, jclass clazz, jstring game_id, jstring section, jstring key); | ||
| 150 | |||
| 151 | JNIEXPORT jdoubleArray JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_GetPerfStats(JNIEnv* env, | ||
| 152 | jclass clazz); | ||
| 153 | |||
| 154 | JNIEXPORT void JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_LogDeviceInfo(JNIEnv* env, | ||
| 155 | jclass clazz); | ||
| 156 | |||
| 157 | JNIEXPORT void JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_SubmitInlineKeyboardText( | ||
| 158 | JNIEnv* env, jclass clazz, jstring j_text); | ||
| 159 | |||
| 160 | JNIEXPORT void JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_SubmitInlineKeyboardInput( | ||
| 161 | JNIEnv* env, jclass clazz, jint j_key_code); | ||
| 162 | |||
| 163 | #ifdef __cplusplus | ||
| 164 | } | ||
| 165 | #endif | ||
diff --git a/src/android/app/src/main/res/drawable/ic_pip_mute.xml b/src/android/app/src/main/res/drawable/ic_pip_mute.xml new file mode 100644 index 000000000..a271c5fe8 --- /dev/null +++ b/src/android/app/src/main/res/drawable/ic_pip_mute.xml | |||
| @@ -0,0 +1,9 @@ | |||
| 1 | <vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
| 2 | android:width="24dp" | ||
| 3 | android:height="24dp" | ||
| 4 | android:viewportHeight="24" | ||
| 5 | android:viewportWidth="24"> | ||
| 6 | <path | ||
| 7 | android:fillColor="@android:color/white" | ||
| 8 | android:pathData="M7,9v6h4l5,5V4l-5,5H7z" /> | ||
| 9 | </vector> | ||
diff --git a/src/android/app/src/main/res/drawable/ic_pip_unmute.xml b/src/android/app/src/main/res/drawable/ic_pip_unmute.xml new file mode 100644 index 000000000..f7ed0862e --- /dev/null +++ b/src/android/app/src/main/res/drawable/ic_pip_unmute.xml | |||
| @@ -0,0 +1,9 @@ | |||
| 1 | <vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
| 2 | android:width="24dp" | ||
| 3 | android:height="24dp" | ||
| 4 | android:viewportHeight="24" | ||
| 5 | android:viewportWidth="24"> | ||
| 6 | <path | ||
| 7 | android:fillColor="@android:color/white" | ||
| 8 | android:pathData="M3,9v6h4l5,5L12,4L7,9L3,9zM16.5,12c0,-1.77 -1.02,-3.29 -2.5,-4.03v8.05c1.48,-0.73 2.5,-2.25 2.5,-4.02zM14,3.23v2.06c2.89,0.86 5,3.54 5,6.71s-2.11,5.85 -5,6.71v2.06c4.01,-0.91 7,-4.49 7,-8.77s-2.99,-7.86 -7,-8.77z" /> | ||
| 9 | </vector> | ||
diff --git a/src/android/app/src/main/res/values/strings.xml b/src/android/app/src/main/res/values/strings.xml index 21805d274..af7450619 100644 --- a/src/android/app/src/main/res/values/strings.xml +++ b/src/android/app/src/main/res/values/strings.xml | |||
| @@ -399,6 +399,8 @@ | |||
| 399 | <string name="picture_in_picture_description">Minimize window when placed in the background</string> | 399 | <string name="picture_in_picture_description">Minimize window when placed in the background</string> |
| 400 | <string name="pause">Pause</string> | 400 | <string name="pause">Pause</string> |
| 401 | <string name="play">Play</string> | 401 | <string name="play">Play</string> |
| 402 | <string name="mute">Mute</string> | ||
| 403 | <string name="unmute">Unmute</string> | ||
| 402 | 404 | ||
| 403 | <!-- Licenses screen strings --> | 405 | <!-- Licenses screen strings --> |
| 404 | <string name="licenses">Licenses</string> | 406 | <string name="licenses">Licenses</string> |