From 07632da5b995b9253569ad14068324c8c997103a Mon Sep 17 00:00:00 2001 From: pineappleEA Date: Fri, 26 Jan 2024 07:10:49 +0100 Subject: [PATCH] early-access version 4090 --- CMakeModules/FindSimpleIni.cmake | 22 +- README.md | 2 +- .../yuzu_emu/activities/EmulationActivity.kt | 8 + .../yuzu/yuzu_emu/fragments/AboutFragment.kt | 2 +- .../yuzu_emu/fragments/EmulationFragment.kt | 29 +- .../yuzu/yuzu_emu/model/EmulationViewModel.kt | 8 + .../main/res/layout-w600dp/fragment_about.xml | 5 +- .../res/layout-w600dp/fragment_game_info.xml | 155 +++ .../fragment_game_properties.xml | 1 + .../main/res/layout/card_driver_option.xml | 1 + .../app/src/main/res/layout/card_folder.xml | 6 +- .../src/main/res/layout/fragment_about.xml | 5 +- .../src/main/res/layout/fragment_addons.xml | 4 + .../res/layout/fragment_applet_launcher.xml | 4 +- .../res/layout/fragment_driver_manager.xml | 2 + .../main/res/layout/fragment_early_access.xml | 5 +- .../main/res/layout/fragment_emulation.xml | 8 +- .../src/main/res/layout/fragment_folders.xml | 3 + .../main/res/layout/fragment_game_info.xml | 3 + .../res/layout/fragment_game_properties.xml | 5 +- .../src/main/res/layout/fragment_games.xml | 1 + .../res/layout/fragment_home_settings.xml | 3 +- .../main/res/layout/fragment_installables.xml | 4 +- .../src/main/res/layout/fragment_licenses.xml | 4 +- .../src/main/res/layout/fragment_settings.xml | 2 + .../src/main/res/layout/list_item_addon.xml | 2 +- .../res/layout/list_item_settings_header.xml | 1 + src/core/device_memory_manager.h | 2 - src/core/guest_memory.h | 62 +- src/core/hle/service/cmif_serialization.h | 71 +- src/core/hle/service/cmif_types.h | 112 +- src/core/hle/service/jit/jit.cpp | 14 +- src/core/hle/service/nvdrv/core/container.h | 3 + .../service/nvdrv/devices/nvhost_nvdec.cpp | 15 +- .../nvdrv/devices/nvhost_nvdec_common.cpp | 27 +- .../nvdrv/devices/nvhost_nvdec_common.h | 1 - .../hle/service/nvdrv/devices/nvhost_vic.cpp | 15 +- src/core/hle/service/ro/ro.cpp | 3 +- src/core/memory.h | 2 - src/video_core/CMakeLists.txt | 6 +- src/video_core/cdma_pusher.cpp | 196 +-- src/video_core/cdma_pusher.h | 87 +- src/video_core/gpu.cpp | 33 + src/video_core/gpu.h | 6 + src/video_core/gpu_thread.cpp | 1 - src/video_core/host1x/codecs/h264.cpp | 142 +- src/video_core/host1x/codecs/h264.h | 292 ++-- src/video_core/host1x/codecs/vp8.cpp | 72 +- src/video_core/host1x/codecs/vp8.h | 43 +- src/video_core/host1x/codecs/vp9.cpp | 151 +- src/video_core/host1x/codecs/vp9.h | 45 +- src/video_core/host1x/codecs/vp9_types.h | 27 +- src/video_core/host1x/control.cpp | 1 - src/video_core/host1x/control.h | 10 +- src/video_core/host1x/ffmpeg/ffmpeg.cpp | 236 ++-- src/video_core/host1x/ffmpeg/ffmpeg.h | 61 +- src/video_core/host1x/host1x.cpp | 27 +- src/video_core/host1x/host1x.h | 42 +- src/video_core/host1x/nvdec.cpp | 61 +- src/video_core/host1x/nvdec.h | 36 +- src/video_core/host1x/nvdec_common.h | 84 +- src/video_core/host1x/syncpoint_manager.cpp | 6 +- src/video_core/host1x/vic.cpp | 1238 +++-------------- src/video_core/host1x/vic.h | 652 +-------- src/video_core/memory_manager.h | 2 - 65 files changed, 1327 insertions(+), 2852 deletions(-) create mode 100755 src/android/app/src/main/res/layout-w600dp/fragment_game_info.xml diff --git a/CMakeModules/FindSimpleIni.cmake b/CMakeModules/FindSimpleIni.cmake index ce75d7690..13426b25b 100755 --- a/CMakeModules/FindSimpleIni.cmake +++ b/CMakeModules/FindSimpleIni.cmake @@ -2,18 +2,20 @@ # # SPDX-License-Identifier: GPL-3.0-or-later -find_path(SimpleIni_INCLUDE_DIR SimpleIni.h) - include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(SimpleIni - REQUIRED_VARS SimpleIni_INCLUDE_DIR -) -if (SimpleIni_FOUND AND NOT TARGET SimpleIni::SimpleIni) - add_library(SimpleIni::SimpleIni INTERFACE IMPORTED) - set_target_properties(SimpleIni::SimpleIni PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES "${SimpleIni_INCLUDE_DIR}" +find_package(SimpleIni QUIET CONFIG) +if (SimpleIni_CONSIDERED_CONFIGS) + find_package_handle_standard_args(SimpleIni CONFIG_MODE) +else() + find_package(PkgConfig QUIET) + pkg_search_module(SIMPLEINI QUIET IMPORTED_TARGET simpleini) + find_package_handle_standard_args(SimpleIni + REQUIRED_VARS SIMPLEINI_INCLUDEDIR + VERSION_VAR SIMPLEINI_VERSION ) endif() -mark_as_advanced(SimpleIni_INCLUDE_DIR) +if (SimpleIni_FOUND AND NOT TARGET SimpleIni::SimpleIni) + add_library(SimpleIni::SimpleIni ALIAS PkgConfig::SIMPLEINI) +endif() diff --git a/README.md b/README.md index 1d2912a14..dfb20827c 100755 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ yuzu emulator early access ============= -This is the source code for early-access 4089. +This is the source code for early-access 4090. ## Legal Notice 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 9b08f008d..26cddecf4 100755 --- 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 @@ -193,6 +193,10 @@ class EmulationActivity : AppCompatActivity(), SensorEventListener { return super.dispatchKeyEvent(event) } + if (emulationViewModel.drawerOpen.value) { + return super.dispatchKeyEvent(event) + } + return InputHandler.dispatchKeyEvent(event) } @@ -203,6 +207,10 @@ class EmulationActivity : AppCompatActivity(), SensorEventListener { return super.dispatchGenericMotionEvent(event) } + if (emulationViewModel.drawerOpen.value) { + return super.dispatchGenericMotionEvent(event) + } + // Don't attempt to do anything if we are disconnecting a device. if (event.actionMasked == MotionEvent.ACTION_CANCEL) { return true diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/AboutFragment.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/AboutFragment.kt index 5b5f800c1..5ab38ffda 100755 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/AboutFragment.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/AboutFragment.kt @@ -77,7 +77,7 @@ class AboutFragment : Fragment() { } binding.textVersionName.text = BuildConfig.VERSION_NAME - binding.textVersionName.setOnClickListener { + binding.buttonVersionName.setOnClickListener { val clipBoard = requireContext().getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager val clip = ClipData.newPlainText(getString(R.string.build), BuildConfig.GIT_HASH) 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 d17e087fe..22da1d0e5 100755 --- 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 @@ -38,6 +38,7 @@ import androidx.window.layout.WindowLayoutInfo import com.google.android.material.dialog.MaterialAlertDialogBuilder import com.google.android.material.slider.Slider import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.flow.collect import kotlinx.coroutines.flow.collectLatest import kotlinx.coroutines.launch import org.yuzu.yuzu_emu.HomeNavigationDirections @@ -184,10 +185,13 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback { override fun onDrawerOpened(drawerView: View) { binding.drawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_UNLOCKED) + binding.inGameMenu.requestFocus() + emulationViewModel.setDrawerOpen(true) } override fun onDrawerClosed(drawerView: View) { binding.drawerLayout.setDrawerLockMode(IntSetting.LOCK_DRAWER.getInt()) + emulationViewModel.setDrawerOpen(false) } override fun onDrawerStateChanged(newState: Int) { @@ -239,6 +243,7 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback { requireContext().theme ) } + binding.inGameMenu.requestFocus() true } @@ -247,6 +252,7 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback { null, Settings.MenuTag.SECTION_ROOT ) + binding.inGameMenu.requestFocus() binding.root.findNavController().navigate(action) true } @@ -256,6 +262,7 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback { args.game, Settings.MenuTag.SECTION_ROOT ) + binding.inGameMenu.requestFocus() binding.root.findNavController().navigate(action) true } @@ -287,6 +294,7 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback { ) } } + binding.inGameMenu.requestFocus() NativeConfig.saveGlobalConfig() true } @@ -295,7 +303,7 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback { emulationState.stop() emulationViewModel.setIsEmulationStopping(true) binding.drawerLayout.close() - binding.drawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED) + binding.inGameMenu.requestFocus() true } @@ -312,12 +320,7 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback { if (!NativeLibrary.isRunning()) { return } - - if (binding.drawerLayout.isOpen) { - binding.drawerLayout.close() - } else { - binding.drawerLayout.open() - } + emulationViewModel.setDrawerOpen(!binding.drawerLayout.isOpen) } } ) @@ -408,6 +411,18 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback { } } } + launch { + repeatOnLifecycle(Lifecycle.State.CREATED) { + emulationViewModel.drawerOpen.collect { + if (it) { + binding.drawerLayout.open() + binding.inGameMenu.requestFocus() + } else { + binding.drawerLayout.close() + } + } + } + } } } diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/model/EmulationViewModel.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/model/EmulationViewModel.kt index f34870c2d..b66f47fe7 100755 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/model/EmulationViewModel.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/model/EmulationViewModel.kt @@ -6,6 +6,7 @@ package org.yuzu.yuzu_emu.model import androidx.lifecycle.ViewModel import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.StateFlow +import kotlinx.coroutines.flow.asStateFlow class EmulationViewModel : ViewModel() { val emulationStarted: StateFlow get() = _emulationStarted @@ -23,6 +24,9 @@ class EmulationViewModel : ViewModel() { val shaderMessage: StateFlow get() = _shaderMessage private val _shaderMessage = MutableStateFlow("") + private val _drawerOpen = MutableStateFlow(false) + val drawerOpen = _drawerOpen.asStateFlow() + fun setEmulationStarted(started: Boolean) { _emulationStarted.value = started } @@ -49,6 +53,10 @@ class EmulationViewModel : ViewModel() { setTotalShaders(max) } + fun setDrawerOpen(value: Boolean) { + _drawerOpen.value = value + } + fun clear() { setEmulationStarted(false) setIsEmulationStopping(false) diff --git a/src/android/app/src/main/res/layout-w600dp/fragment_about.xml b/src/android/app/src/main/res/layout-w600dp/fragment_about.xml index 655e49219..a5eba6474 100755 --- a/src/android/app/src/main/res/layout-w600dp/fragment_about.xml +++ b/src/android/app/src/main/res/layout-w600dp/fragment_about.xml @@ -11,12 +11,14 @@ android:id="@+id/appbar_about" android:layout_width="match_parent" android:layout_height="wrap_content" - android:fitsSystemWindows="true"> + android:fitsSystemWindows="true" + android:touchscreenBlocksFocus="false"> @@ -28,6 +30,7 @@ android:layout_height="match_parent" android:fadeScrollbars="false" android:scrollbars="vertical" + android:defaultFocusHighlightEnabled="false" app:layout_behavior="@string/appbar_scrolling_view_behavior"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/android/app/src/main/res/layout-w600dp/fragment_game_properties.xml b/src/android/app/src/main/res/layout-w600dp/fragment_game_properties.xml index 551f255c0..7cdef569f 100755 --- a/src/android/app/src/main/res/layout-w600dp/fragment_game_properties.xml +++ b/src/android/app/src/main/res/layout-w600dp/fragment_game_properties.xml @@ -14,6 +14,7 @@ android:clipToPadding="false" android:fadeScrollbars="false" android:scrollbars="vertical" + android:defaultFocusHighlightEnabled="false" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toEndOf="@+id/icon_layout" app:layout_constraintTop_toTopOf="parent"> diff --git a/src/android/app/src/main/res/layout/card_driver_option.xml b/src/android/app/src/main/res/layout/card_driver_option.xml index 1dd9a6d7d..bda524f0f 100755 --- a/src/android/app/src/main/res/layout/card_driver_option.xml +++ b/src/android/app/src/main/res/layout/card_driver_option.xml @@ -23,6 +23,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical" + android:focusable="false" android:clickable="false" android:checked="false" /> diff --git a/src/android/app/src/main/res/layout/card_folder.xml b/src/android/app/src/main/res/layout/card_folder.xml index 4e0c04b6b..ed4a7ca8f 100755 --- a/src/android/app/src/main/res/layout/card_folder.xml +++ b/src/android/app/src/main/res/layout/card_folder.xml @@ -6,16 +6,14 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginHorizontal="16dp" - android:layout_marginVertical="12dp" - android:focusable="true"> + android:layout_marginVertical="12dp"> + android:layout_gravity="center_vertical"> + android:fitsSystemWindows="true" + android:touchscreenBlocksFocus="false"> @@ -28,6 +30,7 @@ android:layout_height="match_parent" android:scrollbars="vertical" android:fadeScrollbars="false" + android:defaultFocusHighlightEnabled="false" app:layout_behavior="@string/appbar_scrolling_view_behavior"> @@ -19,6 +20,7 @@ android:id="@+id/toolbar_addons" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" + android:touchscreenBlocksFocus="false" app:navigationIcon="@drawable/ic_back" /> @@ -28,6 +30,8 @@ android:layout_width="match_parent" android:layout_height="0dp" android:clipToPadding="false" + android:defaultFocusHighlightEnabled="false" + android:nextFocusDown="@id/button_install" app:layout_behavior="@string/appbar_scrolling_view_behavior" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" diff --git a/src/android/app/src/main/res/layout/fragment_applet_launcher.xml b/src/android/app/src/main/res/layout/fragment_applet_launcher.xml index fe8fae40f..95e6d6a6b 100755 --- a/src/android/app/src/main/res/layout/fragment_applet_launcher.xml +++ b/src/android/app/src/main/res/layout/fragment_applet_launcher.xml @@ -10,12 +10,14 @@ android:id="@+id/appbar_applets" android:layout_width="match_parent" android:layout_height="wrap_content" - android:fitsSystemWindows="true"> + android:fitsSystemWindows="true" + android:touchscreenBlocksFocus="false"> diff --git a/src/android/app/src/main/res/layout/fragment_driver_manager.xml b/src/android/app/src/main/res/layout/fragment_driver_manager.xml index 6cea2d164..56d8e6bb8 100755 --- a/src/android/app/src/main/res/layout/fragment_driver_manager.xml +++ b/src/android/app/src/main/res/layout/fragment_driver_manager.xml @@ -15,12 +15,14 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:fitsSystemWindows="true" + android:touchscreenBlocksFocus="false" app:liftOnScrollTargetViewId="@id/list_drivers"> diff --git a/src/android/app/src/main/res/layout/fragment_early_access.xml b/src/android/app/src/main/res/layout/fragment_early_access.xml index 644b4dd45..12e233afc 100755 --- a/src/android/app/src/main/res/layout/fragment_early_access.xml +++ b/src/android/app/src/main/res/layout/fragment_early_access.xml @@ -11,12 +11,14 @@ android:id="@+id/appbar_ea" android:layout_width="match_parent" android:layout_height="wrap_content" - android:fitsSystemWindows="true"> + android:fitsSystemWindows="true" + android:touchscreenBlocksFocus="false"> @@ -30,6 +32,7 @@ android:paddingBottom="20dp" android:scrollbars="vertical" android:fadeScrollbars="false" + android:defaultFocusHighlightEnabled="false" app:layout_behavior="@string/appbar_scrolling_view_behavior"> @@ -24,7 +25,8 @@ android:layout_height="match_parent" android:layout_gravity="center" android:focusable="false" - android:focusableInTouchMode="false" /> + android:focusableInTouchMode="false" + android:defaultFocusHighlightEnabled="false" />