Compare commits

...

22 Commits

Author SHA1 Message Date
Maufeat
fd1bd5af77 make profile select lle by default 2025-06-25 19:02:05 +02:00
Maufeat
999f082987 fix license header 2025-06-21 21:38:43 +02:00
Maufeat
15cfde2cfb add: profile deletion and missing stubs 2025-06-21 21:34:11 +02:00
Maufeat
58485e3337 add: lle profile edit 2025-06-21 21:00:50 +02:00
Maufeat
b6a93a9771 fix spacing and import placement 2025-06-21 18:28:36 +02:00
Maufeat
d8c6ced814 fix compilation errors 2025-06-21 18:22:21 +02:00
lui
0d76321d39 profile_manager: Implement firmware avatar selector
Adds an option to set a user's profile image from the avatars in the firmware. Background color can be changed with a color picker. Also modifies profile image saving to account for this, and as a result images are now saved as JPEG with 100% quality. Any PNG, JPEG, or BMP can now also be used in the image file picker instead of just JPEG.

Using ryujinx's implementation and other parts of the yuzu codebase for reference.

Credit: Torzu, lui

Reviewed-on: http://vub63vv26q6v27xzv2dtcd25xumubshogm67yrpaz2rculqxs7jlfqad.onion/torzu-emu/torzu/pulls/56
Co-authored-by: lui <lui@vub63vv26q6v27xzv2dtcd25xumubshogm67yrpaz2rculqxs7jlfqad.onion>
Co-committed-by: lui <lui@vub63vv26q6v27xzv2dtcd25xumubshogm67yrpaz2rculqxs7jlfqad.onion>
2025-06-21 00:18:02 +01:00
Maufeat
8c33b0bb5d Add Device Power State (Windows, Linux, Mac and Android) (#197)
Uses native power state methods to display battery percentage and charging state correctly. Mainly for qlaunch.
Tested on Windows, Linux. Mac and Android

Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/197
Co-authored-by: Maufeat <sahyno1996@gmail.com>
Co-committed-by: Maufeat <sahyno1996@gmail.com>
2025-06-18 08:34:54 +00:00
crueter
6bf5ae700a Fix macOS build (#198)
Signed-off-by: Aleksandr Popovich <alekpopo@pm.me>
Co-authored-by: Aleksandr Popovich <alekpopo@pm.me>
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/198
2025-06-18 08:00:09 +00:00
crueter
704d4e4428 [android, desktop] Firebomb pre-alpha banner (#195)
Signed-off-by: crueter <swurl@swurl.xyz>
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/195
Co-authored-by: crueter <swurl@swurl.xyz>
Co-committed-by: crueter <swurl@swurl.xyz>
2025-06-17 01:59:05 +00:00
Aleksandr Popovich
6aeba9de66 [vk] Add some dynamic handling in the pipeline (#142)
Co-authored-by: crueter <swurl@swurl.xyz>
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/142
Co-authored-by: Aleksandr Popovich <alekpopo@pm.me>
Co-committed-by: Aleksandr Popovich <alekpopo@pm.me>
2025-06-16 22:36:30 +00:00
crueter
eae819f0d6 Migrate BuildConfig
Signed-off-by: crueter <swurl@swurl.xyz>
2025-06-16 14:39:12 -04:00
crueter
a4123200c0 fix packaging (#192)
Signed-off-by: crueter <swurl@swurl.xyz>
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/192
Co-authored-by: crueter <swurl@swurl.xyz>
Co-committed-by: crueter <swurl@swurl.xyz>
2025-06-16 03:27:06 +00:00
crueter
5591ce30c9 Revert "[gradle] fix warnings & update deps (#189)"
This reverts commit af923c92eb.
2025-06-15 21:46:24 -04:00
crueter
af923c92eb [gradle] fix warnings & update deps (#189)
Signed-off-by: crueter <swurl@swurl.xyz>
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/189
Co-authored-by: crueter <swurl@swurl.xyz>
Co-committed-by: crueter <swurl@swurl.xyz>
2025-06-15 22:30:12 +00:00
crueter
cf00554d23 windows JIT fix (#191)
Signed-off-by: crueter <swurl@swurl.xyz>
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/191
Co-authored-by: crueter <swurl@swurl.xyz>
Co-committed-by: crueter <swurl@swurl.xyz>
2025-06-15 19:25:40 +00:00
Pavel Barabanov
cee222f0e6 fixing crashes when installing updates 2025-06-15 15:29:52 +03:00
crueter
b2d16cb3dd [ci] Fix license-header workflow
Signed-off-by: crueter <swurl@swurl.xyz>
2025-06-15 05:02:32 -04:00
crueter
ef2d0a9076 [ci] tmp: debug license-header
Signed-off-by: crueter <swurl@swurl.xyz>
2025-06-15 04:58:00 -04:00
xbzk
f3e00b633e multiplayer lobby search dialog send button clipping fix (#188)
fix for send button.

Co-authored-by: Allison Cunha <allisonbzk@gmail.com>
Co-authored-by: crueter <swurl@swurl.xyz>
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/188
Reviewed-by: crueter <crueter@noreply.localhost>
Co-authored-by: xbzk <xbzk@noreply.localhost>
Co-committed-by: xbzk <xbzk@noreply.localhost>
2025-06-15 08:53:41 +00:00
MaranBr
cc7f2808ed Update FFmpeg to 7.1.1, libvpx to 1.13.1 and libx264 to c24e06c on Android (#187)
This updates FFmpeg to 7.1.1, libvpx to 1.13.1 and libx264 to c24e06c on Android.

Co-authored-by: MaranBr <maranbr@outlook.com>
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/187
Reviewed-by: crueter <crueter@noreply.localhost>
Co-authored-by: MaranBr <maranbr@noreply.localhost>
Co-committed-by: MaranBr <maranbr@noreply.localhost>
2025-06-14 17:42:22 +00:00
xbzk
6b46aca0b7 top margin fixed for non zero cutout screens (#185)
intended to fix top margin for screens with non zero cutout insets

Co-authored-by: Allison Cunha <allisonbzk@gmail.com>
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/185
Co-authored-by: xbzk <xbzk@noreply.localhost>
Co-committed-by: xbzk <xbzk@noreply.localhost>
2025-06-12 20:41:13 +00:00
52 changed files with 1032 additions and 319 deletions

View File

@@ -7,9 +7,16 @@ license_header = <<~EOF
EOF
print 'Getting branch changes...'
puts "\n"
branch_name = `git rev-parse --abbrev-ref HEAD`.chomp
print branch_name
puts "\n"
branch_commits = `git log #{branch_name} --not master --pretty=format:"%h"`.split("\n")
print branch_commits
puts "\n"
branch_commit_range = "#{branch_commits[-1]}^..#{branch_commits[0]}"
print branch_commit_range
puts "\n"
branch_changed_files = `git diff-tree --no-commit-id --name-only #{branch_commit_range} -r`.split("\n")
puts 'done'

View File

@@ -34,9 +34,6 @@ fi
if [ "$TARGET" = "appimage" ]; then
export EXTRA_CMAKE_FLAGS=(-DCMAKE_INSTALL_PREFIX=/usr -DYUZU_ROOM=ON -DYUZU_ROOM_STANDALONE=OFF -DYUZU_CMD=OFF)
# Bundle required QT wayland libraries
export EXTRA_QT_PLUGINS="waylandcompositor"
export EXTRA_PLATFORM_PLUGINS="libqwayland-egl.so;libqwayland-generic.so"
else
# For the linux-fresh verification target, verify compilation without PCH as well.
export EXTRA_CMAKE_FLAGS=(-DYUZU_USE_PRECOMPILED_HEADERS=OFF)

View File

@@ -11,8 +11,8 @@ export ARCH="$BASE_ARCH"
export BUILDDIR="$2"
LIB4BN="https://raw.githubusercontent.com/VHSgunzo/sharun/refs/heads/main/lib4bin"
URUNTIME="https://github.com/VHSgunzo/uruntime/releases/latest/download/uruntime-appimage-dwarfs-$ARCH"
SHARUN="https://github.com/VHSgunzo/sharun/releases/latest/download/sharun-${BASE_ARCH}-aio"
URUNTIME="https://github.com/VHSgunzo/uruntime/releases/latest/download/uruntime-appimage-dwarfs-${BASE_ARCH}"
if [ "$ARCH" = 'x86_64' ]; then
if [ "$1" = 'v3' ]; then
@@ -48,22 +48,24 @@ fi
UPINFO='gh-releases-zsync|eden-emulator|Releases|latest|*.AppImage.zsync'
LIBDIR="/usr/lib"
# some distros are weird and use a subdir
if [ ! -f "/usr/lib/libGL.so" ]
# Workaround for Gentoo
if [ ! -d "$LIBDIR/qt6" ]
then
LIBDIR="/usr/lib64"
fi
# Workaround for Debian
if [ ! -d "$LIBDIR/qt6" ]
then
LIBDIR="/usr/lib/${BASE_ARCH}-linux-gnu"
fi
# Bundle all libs
# temp workaround for arch being silly
mkdir -p share/X11
cp -r /usr/share/X11/xkb share/X11
wget --retry-connrefused --tries=30 "$LIB4BN" -O ./lib4bin
chmod +x ./lib4bin
xvfb-run -a -- ./lib4bin -p -v -e -s -k \
wget --retry-connrefused --tries=30 "$SHARUN" -O ./sharun-aio
chmod +x ./sharun-aio
xvfb-run -a ./sharun-aio l -p -v -e -s -k \
../$BUILDDIR/bin/eden* \
$LIBDIR/lib*GL*.so* \
$LIBDIR/libSDL2*.so* \
@@ -88,14 +90,18 @@ xvfb-run -a -- ./lib4bin -p -v -e -s -k \
$LIBDIR/spa-0.2/*/* \
$LIBDIR/alsa-lib/*
rm -f ./sharun-aio
# Prepare sharun
if [ "$ARCH" = 'aarch64' ]; then
# allow the host vulkan to be used for aarch64 given the sed situation
# allow the host vulkan to be used for aarch64 given the sad situation
echo 'SHARUN_ALLOW_SYS_VKICD=1' > ./.env
fi
wget https://github.com/VHSgunzo/sharun/releases/download/v0.6.3/sharun-x86_64 -O sharun
chmod a+x sharun
# Workaround for Gentoo
if [ -d "shared/libproxy" ]; then
cp shared/libproxy/* lib/
fi
ln -f ./sharun ./AppRun
./sharun -g
@@ -121,9 +127,4 @@ echo "Generating AppImage..."
echo "Generating zsync file..."
zsyncmake *.AppImage -u *.AppImage
echo "All Done!"
# Cleanup
rm -rf AppDir
rm uruntime
echo "All Done!"

View File

@@ -1,7 +1,7 @@
name: eden-license
on:
pull_request_target:
pull_request:
branches: [ master ]
jobs:
@@ -13,9 +13,8 @@ jobs:
fetch-depth: 0
- name: Fetch
run: git fetch origin
run: git fetch origin master:master
# TODO: fix the script
- name: Make script executable
run: chmod +x ./.ci/license-header.rb

View File

@@ -163,13 +163,24 @@ alignas(64) static constinit std::array<HostLoc, ABI_AllCallerSaveSize() - 1> AB
};
void ABI_PushCallerSaveRegistersAndAdjustStackExcept(BlockOfCode& code, const HostLoc exception) {
#ifdef _MSC_VER
std::vector<HostLoc> regs;
std::remove_copy(ABI_ALL_CALLER_SAVE.begin(), ABI_ALL_CALLER_SAVE.end(), std::back_inserter(regs), exception);
ABI_PushRegistersAndAdjustStack(code, 0, regs);
#else
ASSUME(size_t(exception) < 32);
ABI_PushRegistersAndAdjustStack(code, 0, ABI_CALLER_SAVED_EXCEPT_TABLE[size_t(exception)]);
#endif
}
void ABI_PopCallerSaveRegistersAndAdjustStackExcept(BlockOfCode& code, const HostLoc exception) {
#ifdef _MSC_VER
std::vector<HostLoc> regs;
std::remove_copy(ABI_ALL_CALLER_SAVE.begin(), ABI_ALL_CALLER_SAVE.end(), std::back_inserter(regs), exception);
ABI_PopRegistersAndAdjustStack(code, 0, regs);
#else
ASSUME(size_t(exception) < 32);
ABI_PopRegistersAndAdjustStack(code, 0, ABI_CALLER_SAVED_EXCEPT_TABLE[size_t(exception)]);
#endif
}
} // namespace Dynarmic::Backend::X64

View File

@@ -225,7 +225,7 @@ if (NOT WIN32 AND NOT ANDROID)
elseif(ANDROID)
# Use yuzu FFmpeg binaries
if (ARCHITECTURE_arm64)
set(FFmpeg_EXT_NAME "ffmpeg-android-v5.1.LTS-aarch64")
set(FFmpeg_EXT_NAME "ffmpeg-android-7.1.1-aarch64")
elseif (ARCHITECTURE_x86_64)
set(FFmpeg_EXT_NAME "ffmpeg-android-v5.1.LTS-x86_64")
else()

View File

@@ -1,9 +1,9 @@
// SPDX-FileCopyrightText: Copyright yuzu/Citra Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright yuzu/Citra Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
import android.annotation.SuppressLint
import kotlin.collections.setOf
import org.jlleitschuh.gradle.ktlint.reporter.ReporterType
@@ -35,6 +35,7 @@ android {
buildFeatures {
viewBinding = true
buildConfig = true
}
compileOptions {
@@ -62,11 +63,7 @@ android {
targetSdk = 35
versionName = getGitVersion()
versionCode = if (System.getenv("AUTO_VERSIONED") == "true") {
autoVersion
} else {
1
}
versionCode = autoVersion
ndk {
@SuppressLint("ChromeOsAbiSupport")
@@ -121,7 +118,6 @@ android {
isDefault = true
resValue("string", "app_name_suffixed", "eden Debug Release")
signingConfig = signingConfigs.getByName("default")
isMinifyEnabled = true
isDebuggable = true
proguardFiles(
getDefaultProguardFile("proguard-android.txt"),

View File

@@ -1,9 +1,9 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: 2023 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
// SPDX-FileCopyrightText: 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
package org.yuzu.yuzu_emu
@@ -489,4 +489,9 @@ object NativeLibrary {
* Checks if all necessary keys are present for decryption
*/
external fun areKeysPresent(): Boolean
/**
* Updates the device power state to global variables
*/
external fun updatePowerState(percentage: Int, isCharging: Boolean, hasBattery: Boolean)
}

View File

@@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: 2023 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
@@ -13,6 +16,7 @@ import org.yuzu.yuzu_emu.utils.DirectoryInitialization
import org.yuzu.yuzu_emu.utils.DocumentsTree
import org.yuzu.yuzu_emu.utils.GpuDriverHelper
import org.yuzu.yuzu_emu.utils.Log
import org.yuzu.yuzu_emu.utils.PowerStateUpdater
fun Context.getPublicFilesDir(): File = getExternalFilesDir(null) ?: filesDir
@@ -40,6 +44,7 @@ class YuzuApplication : Application() {
GpuDriverHelper.initializeDriverParameters()
NativeInput.reloadInputDevices()
NativeLibrary.logDeviceInfo()
PowerStateUpdater.start()
Log.logDeviceInfo()
createNotificationChannels()

View File

@@ -1,9 +1,9 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: 2023 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
// SPDX-FileCopyrightText: 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
package org.yuzu.yuzu_emu.activities
@@ -58,6 +58,7 @@ import org.yuzu.yuzu_emu.utils.NativeConfig
import org.yuzu.yuzu_emu.utils.NfcReader
import org.yuzu.yuzu_emu.utils.ParamPackage
import org.yuzu.yuzu_emu.utils.ThemeHelper
import org.yuzu.yuzu_emu.utils.PowerStateUtils
import java.text.NumberFormat
import kotlin.math.roundToInt

View File

@@ -1,7 +1,6 @@
// SPDX-FileCopyrightText: 2025 Eden Emulator Project
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
package org.yuzu.yuzu_emu.features.settings.model
import org.yuzu.yuzu_emu.R
@@ -36,7 +35,6 @@ object Settings {
const val PREF_FIRST_APP_LAUNCH = "FirstApplicationLaunch"
const val PREF_SHOULD_SHOW_DRIVER_WARNING = "ShouldShowDriverWarning"
const val PREF_SHOULD_SHOW_PRE_ALPHA_WARNING = "ShouldShowPreAlphaWarning"
const val PREF_SHOULD_SHOW_PRE_ALPHA_BANNER = "ShouldShowPreAlphaBanner"
const val PREF_SHOULD_SHOW_EDENS_VEIL_DIALOG = "ShouldShowEdensVeilDialog"
const val PREF_MEMORY_WARNING_SHOWN = "MemoryWarningShown"
const val SECTION_STATS_OVERLAY = "Stats Overlay"

View File

@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2025 Eden Emulator Project
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
package org.yuzu.yuzu_emu.ui
@@ -162,12 +162,6 @@ class GamesFragment : Fragment() {
}
setInsets()
val shouldDisplayPreAlphaBanner =
PreferenceManager.getDefaultSharedPreferences(requireContext())
.getBoolean(Settings.PREF_SHOULD_SHOW_PRE_ALPHA_BANNER, true)
if (shouldDisplayPreAlphaBanner) {
addPreAlphaBanner()
}
}
val applyGridGamesBinding = {
@@ -238,86 +232,6 @@ class GamesFragment : Fragment() {
navController.navigate(R.id.action_gamesFragment_to_homeSettingsFragment)
}
private fun addPreAlphaBanner() {
val preAlphaBanner = TextView(requireContext()).apply {
id = "pre_alpha_banner".hashCode()
layoutParams = ConstraintLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT
).apply {
marginStart = resources.getDimensionPixelSize(R.dimen.spacing_med)
marginEnd = resources.getDimensionPixelSize(R.dimen.spacing_med)
topMargin = resources.getDimensionPixelSize(R.dimen.spacing_large)
topToBottom = R.id.frame_search
}
setPadding(
resources.getDimensionPixelSize(R.dimen.spacing_med),
resources.getDimensionPixelSize(R.dimen.spacing_large),
resources.getDimensionPixelSize(R.dimen.spacing_med),
resources.getDimensionPixelSize(R.dimen.spacing_med)
)
setBackgroundColor(
MaterialColors.getColor(
this,
com.google.android.material.R.attr.colorPrimary
)
)
text = getString(R.string.pre_alpha_warning)
setTextAppearance(
com.google.android.material.R.style.TextAppearance_Material3_HeadlineSmall
)
setTextColor(
MaterialColors.getColor(
this,
com.google.android.material.R.attr.colorOnError
)
)
gravity = Gravity.CENTER
}
val closeButton = ImageButton(requireContext()).apply {
id = "pre_alpha_close_button".hashCode()
layoutParams = ConstraintLayout.LayoutParams(
resources.getDimensionPixelSize(R.dimen.spacing_large),
resources.getDimensionPixelSize(R.dimen.spacing_large)
).apply {
startToStart = "pre_alpha_banner".hashCode()
topToTop = "pre_alpha_banner".hashCode()
bottomToBottom = "pre_alpha_banner".hashCode()
marginStart = resources.getDimensionPixelSize(R.dimen.spacing_large) * 2
topMargin = resources.getDimensionPixelSize(R.dimen.spacing_small)
}
setImageResource(android.R.drawable.ic_menu_close_clear_cancel)
setColorFilter(
MaterialColors.getColor(
this,
com.google.android.material.R.attr.colorOnError
)
)
setBackgroundColor(Color.Transparent.toArgb())
setOnClickListener {
PreferenceManager.getDefaultSharedPreferences(requireContext())
.edit() {
putBoolean(Settings.PREF_SHOULD_SHOW_PRE_ALPHA_BANNER, false)
}
binding.root.removeView(preAlphaBanner)
binding.root.removeView(this)
binding.swipeRefresh.updateLayoutParams<ConstraintLayout.LayoutParams> {
topToBottom = R.id.frame_search
}
}
}
binding.root.addView(preAlphaBanner)
binding.root.addView(closeButton)
binding.swipeRefresh.updateLayoutParams<ConstraintLayout.LayoutParams> {
topToBottom = preAlphaBanner.id
}
}
private fun showViewMenu(anchor: View) {
val popup = PopupMenu(requireContext(), anchor)
popup.menuInflater.inflate(R.menu.menu_game_views, popup.menu)
@@ -444,32 +358,24 @@ class GamesFragment : Fragment() {
private fun setInsets() =
ViewCompat.setOnApplyWindowInsetsListener(
binding.root
) { view: View, windowInsets: WindowInsetsCompat ->
) { _: View, windowInsets: WindowInsetsCompat ->
val barInsets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars())
val cutoutInsets = windowInsets.getInsets(WindowInsetsCompat.Type.displayCutout())
val spacingNavigation = resources.getDimensionPixelSize(R.dimen.spacing_navigation)
resources.getDimensionPixelSize(R.dimen.spacing_navigation_rail)
val isLandscape =
resources.configuration.orientation == Configuration.ORIENTATION_LANDSCAPE
binding.swipeRefresh.setProgressViewEndTarget(
false,
barInsets.top + resources.getDimensionPixelSize(R.dimen.spacing_refresh_end)
)
val leftInsets = barInsets.left + cutoutInsets.left
val rightInsets = barInsets.right + cutoutInsets.right
val topInsets = barInsets.top + cutoutInsets.top
val bottomInsets = barInsets.bottom + cutoutInsets.bottom
val leftInset = barInsets.left + cutoutInsets.left
val rightInset = barInsets.right + cutoutInsets.right
val topInset = maxOf(barInsets.top, cutoutInsets.top)
val mlpSwipe = binding.swipeRefresh.layoutParams as ViewGroup.MarginLayoutParams
if (view.getLayoutDirection() == View.LAYOUT_DIRECTION_LTR) {
mlpSwipe.leftMargin = leftInsets
mlpSwipe.rightMargin = rightInsets
} else {
mlpSwipe.leftMargin = leftInsets
mlpSwipe.rightMargin = rightInsets
}
mlpSwipe.leftMargin = leftInset
mlpSwipe.rightMargin = rightInset
binding.swipeRefresh.layoutParams = mlpSwipe
val mlpHeader = binding.header.layoutParams as ViewGroup.MarginLayoutParams
@@ -477,29 +383,27 @@ class GamesFragment : Fragment() {
// Store original margins only once
if (originalHeaderTopMargin == null) {
originalHeaderTopMargin = mlpHeader.topMargin
originalHeaderBottomMargin = mlpHeader.bottomMargin
originalHeaderRightMargin = mlpHeader.rightMargin
originalHeaderLeftMargin = mlpHeader.leftMargin
}
// Always set margin as original + insets
mlpHeader.leftMargin = (originalHeaderLeftMargin ?: 0) + leftInsets
mlpHeader.rightMargin = (originalHeaderRightMargin ?: 0) + rightInsets
mlpHeader.topMargin = (originalHeaderTopMargin ?: 0) + if (!isLandscape) topInsets else 0
mlpHeader.bottomMargin = (originalHeaderBottomMargin ?: 0) + if (!isLandscape) bottomInsets else 0
mlpHeader.leftMargin = (originalHeaderLeftMargin ?: 0) + leftInset
mlpHeader.rightMargin = (originalHeaderRightMargin ?: 0) + rightInset
mlpHeader.topMargin = (originalHeaderTopMargin ?: 0) + topInset + resources.getDimensionPixelSize(R.dimen.spacing_med)
binding.header.layoutParams = mlpHeader
binding.noticeText.updatePadding(bottom = spacingNavigation)
binding.header.updatePadding(top = cutoutInsets.top + resources.getDimensionPixelSize(R.dimen.spacing_large) + if (isLandscape) barInsets.top else 0)
binding.gridGames.updatePadding(
top = resources.getDimensionPixelSize(R.dimen.spacing_med)
)
val mlpFab = binding.addDirectory.layoutParams as ViewGroup.MarginLayoutParams
val fabPadding = resources.getDimensionPixelSize(R.dimen.spacing_large)
mlpFab.leftMargin = leftInsets + fabPadding
mlpFab.leftMargin = leftInset + fabPadding
mlpFab.bottomMargin = barInsets.bottom + fabPadding
mlpFab.rightMargin = rightInsets + fabPadding
mlpFab.rightMargin = rightInset + fabPadding
binding.addDirectory.layoutParams = mlpFab
windowInsets

View File

@@ -0,0 +1,46 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
package org.yuzu.yuzu_emu.utils
import android.os.Handler
import android.os.Looper
import org.yuzu.yuzu_emu.NativeLibrary
import org.yuzu.yuzu_emu.YuzuApplication
object PowerStateUpdater {
private lateinit var handler: Handler
private lateinit var runnable: Runnable
private const val UPDATE_INTERVAL_MS = 1000L
private var isStarted = false
fun start() {
if (isStarted) {
return
}
val context = YuzuApplication.appContext
handler = Handler(Looper.getMainLooper())
runnable = Runnable {
val info = PowerStateUtils.getBatteryInfo(context)
NativeLibrary.updatePowerState(info[0], info[1] == 1, info[2] == 1)
handler.postDelayed(runnable, UPDATE_INTERVAL_MS)
}
handler.post(runnable)
isStarted = true
}
fun stop() {
if (!isStarted) {
return
}
if (::handler.isInitialized) {
handler.removeCallbacks(runnable)
}
isStarted = false
}
}

View File

@@ -0,0 +1,45 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
package org.yuzu.yuzu_emu.utils
import android.content.Context
import android.content.Intent
import android.content.IntentFilter
import android.os.BatteryManager
import android.os.Build
object PowerStateUtils {
@JvmStatic
fun getBatteryInfo(context: Context?): IntArray {
if (context == null) {
return intArrayOf(0, 0, 0) // Percentage, IsCharging, HasBattery
}
val results = intArrayOf(100, 0, 1)
val iFilter = IntentFilter(Intent.ACTION_BATTERY_CHANGED)
val batteryStatusIntent: Intent? = context.registerReceiver(null, iFilter)
if (batteryStatusIntent != null) {
val present = batteryStatusIntent.getBooleanExtra(BatteryManager.EXTRA_PRESENT, true)
if (!present) {
results[2] = 0; results[0] = 0; results[1] = 0; return results
}
results[2] = 1
val level = batteryStatusIntent.getIntExtra(BatteryManager.EXTRA_LEVEL, -1)
val scale = batteryStatusIntent.getIntExtra(BatteryManager.EXTRA_SCALE, -1)
if (level != -1 && scale != -1 && scale != 0) {
results[0] = (level.toFloat() / scale.toFloat() * 100.0f).toInt()
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
val bm = context.getSystemService(Context.BATTERY_SERVICE) as BatteryManager?
results[0] = bm?.getIntProperty(BatteryManager.BATTERY_PROPERTY_CAPACITY) ?: 100
}
val status = batteryStatusIntent.getIntExtra(BatteryManager.EXTRA_STATUS, -1)
results[1] = if (status == BatteryManager.BATTERY_STATUS_CHARGING || status == BatteryManager.BATTERY_STATUS_FULL) 1 else 0
}
return results
}
}

View File

@@ -1,9 +1,9 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
// SPDX-FileCopyrightText: 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
#include <codecvt>
#include <locale>
@@ -79,6 +79,11 @@ static EmulationSession s_instance;
std::unique_ptr<AndroidMultiplayer> multiplayer{nullptr};
std::shared_ptr<Core::AnnounceMultiplayerSession> announce_multiplayer_session;
//Power Status default values
std::atomic<int> g_battery_percentage = {100};
std::atomic<bool> g_is_charging = {false};
std::atomic<bool> g_has_battery = {true};
EmulationSession::EmulationSession() {
m_vfs = std::make_shared<FileSys::RealVfsFilesystem>();
}
@@ -1014,4 +1019,16 @@ JNIEXPORT void JNICALL Java_org_yuzu_yuzu_1emu_network_NetPlayManager_netPlayUnb
JNIEnv* env, [[maybe_unused]] jobject obj, jstring username) {
multiplayer->NetPlayUnbanUser(Common::Android::GetJString(env, username));
}
JNIEXPORT void JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_updatePowerState(
JNIEnv* env,
jobject,
jint percentage,
jboolean isCharging,
jboolean hasBattery) {
g_battery_percentage.store(percentage, std::memory_order_relaxed);
g_is_charging.store(isCharging, std::memory_order_relaxed);
g_has_battery.store(hasBattery, std::memory_order_relaxed);
}
} // extern "C"

View File

@@ -70,9 +70,10 @@
<com.google.android.material.card.MaterialCardView
android:id="@+id/search_background"
style="?attr/materialCardViewFilledStyle"
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginTop="12dp"
app:cardCornerRadius="24dp">
@@ -81,7 +82,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="16dp"
android:layout_marginEnd="48dp"
android:layout_marginEnd="16dp"
android:orientation="horizontal">
<ImageView
@@ -109,22 +110,27 @@
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_gravity="center_vertical|end"
android:layout_marginEnd="16dp"
android:layout_marginEnd="48dp"
android:background="?attr/selectableItemBackground"
android:src="@drawable/ic_clear"
android:visibility="invisible"
app:tint="?attr/colorOnSurfaceVariant"
tools:visibility="visible" />
<ImageView
android:id="@+id/btn_submit"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_gravity="center_vertical|end"
android:layout_marginEnd="16dp"
android:background="?attr/selectableItemBackground"
android:src="@drawable/ic_send"
android:contentDescription="@string/submit"
app:tint="?attr/colorOnSurfaceVariant"
tools:visibility="visible" />
</com.google.android.material.card.MaterialCardView>
<com.google.android.material.button.MaterialButton
android:id="@+id/btn_submit"
style="@style/Widget.Material3.Button.ElevatedButton"
android:layout_width="110dp"
android:layout_height="48dp"
android:layout_marginTop="12dp"
android:text="@string/submit" />
</LinearLayout>

View File

@@ -1,3 +1,6 @@
# SPDX-FileCopyrightText: Copyright 2025 yuzu Emulator Project
# SPDX-License-Identifier: GPL-3.0-or-later
# SPDX-FileCopyrightText: 2023 yuzu Emulator Project
# SPDX-License-Identifier: GPL-3.0-or-later
@@ -14,7 +17,5 @@ android.useAndroidX=true
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official
kotlin.parallel.tasks.in.project=true
android.defaults.buildfeatures.buildconfig=true
# Android Gradle plugin 8.0.2
android.suppressUnsupportedCompileSdk=34

View File

@@ -42,6 +42,8 @@ add_library(common STATIC
demangle.h
detached_tasks.cpp
detached_tasks.h
device_power_state.cpp
device_power_state.h
div_ceil.h
dynamic_library.cpp
dynamic_library.h

View File

@@ -0,0 +1,102 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
#include "device_power_state.h"
#if defined(_WIN32)
#include <windows.h>
#elif defined(__ANDROID__)
#include <atomic>
extern std::atomic<int> g_battery_percentage;
extern std::atomic<bool> g_is_charging;
extern std::atomic<bool> g_has_battery;
#elif defined(__APPLE__)
#include <TargetConditionals.h>
#if TARGET_OS_MAC
#include <IOKit/ps/IOPSKeys.h>
#include <IOKit/ps/IOPowerSources.h>
#endif
#elif defined(__linux__)
#include <fstream>
#include <string>
#include <dirent.h>
#endif
namespace Common {
PowerStatus GetPowerStatus()
{
PowerStatus info;
#if defined(_WIN32)
SYSTEM_POWER_STATUS status;
if (GetSystemPowerStatus(&status)) {
if (status.BatteryFlag == 128) {
info.has_battery = false;
} else {
info.percentage = status.BatteryLifePercent;
info.charging = (status.BatteryFlag & 8) != 0;
}
} else {
info.has_battery = false;
}
#elif defined(__ANDROID__)
info.percentage = g_battery_percentage.load(std::memory_order_relaxed);
info.charging = g_is_charging.load(std::memory_order_relaxed);
info.has_battery = g_has_battery.load(std::memory_order_relaxed);
#elif defined(__APPLE__) && TARGET_OS_MAC
CFTypeRef info_ref = IOPSCopyPowerSourcesInfo();
CFArrayRef sources = IOPSCopyPowerSourcesList(info_ref);
if (CFArrayGetCount(sources) > 0) {
CFDictionaryRef battery =
IOPSGetPowerSourceDescription(info_ref, CFArrayGetValueAtIndex(sources, 0));
CFNumberRef curNum =
(CFNumberRef)CFDictionaryGetValue(battery, CFSTR(kIOPSCurrentCapacityKey));
CFNumberRef maxNum =
(CFNumberRef)CFDictionaryGetValue(battery, CFSTR(kIOPSMaxCapacityKey));
int cur = 0, max = 0;
CFNumberGetValue(curNum, kCFNumberIntType, &cur);
CFNumberGetValue(maxNum, kCFNumberIntType, &max);
if (max > 0)
info.percentage = (cur * 100) / max;
CFBooleanRef isCharging =
(CFBooleanRef)CFDictionaryGetValue(battery, CFSTR(kIOPSIsChargingKey));
info.charging = CFBooleanGetValue(isCharging);
} else {
info.has_battery = false;
}
CFRelease(sources);
CFRelease(info_ref);
#elif defined(__linux__)
const char* battery_path = "/sys/class/power_supply/BAT0/";
std::ifstream capFile(std::string(battery_path) + "capacity");
if (capFile) {
capFile >> info.percentage;
}
else {
info.has_battery = false;
}
std::ifstream statFile(std::string(battery_path) + "status");
if (statFile) {
std::string status;
std::getline(statFile, status);
info.charging = (status == "Charging");
}
#else
info.has_battery = false;
#endif
return info;
}
}

View File

@@ -0,0 +1,14 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
#pragma once
namespace Common {
struct PowerStatus {
int percentage = -1;
bool charging = false;
bool has_battery = true;
};
PowerStatus GetPowerStatus();
} // namespace Common

View File

@@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
@@ -147,7 +150,7 @@ struct Values {
Setting<AppletMode> net_connect_applet_mode{linkage, AppletMode::HLE, "net_connect_applet_mode",
Category::LibraryApplet};
Setting<AppletMode> player_select_applet_mode{
linkage, AppletMode::HLE, "player_select_applet_mode", Category::LibraryApplet};
linkage, AppletMode::LLE, "player_select_applet_mode", Category::LibraryApplet};
Setting<AppletMode> swkbd_applet_mode{linkage, AppletMode::LLE, "swkbd_applet_mode",
Category::LibraryApplet};
Setting<AppletMode> mii_edit_applet_mode{linkage, AppletMode::LLE, "mii_edit_applet_mode",
@@ -668,10 +671,6 @@ struct Values {
Setting<bool> censor_username{linkage, true, "censor_username", Category::Miscellaneous};
Setting<bool> use_dev_keys{linkage, false, "use_dev_keys", Category::Miscellaneous};
Setting<bool> first_launch{linkage, true, "first_launch", Category::Miscellaneous};
Setting<bool> hide_pre_alpha_warning{linkage,
false,
"hide_pre_alpha_warning",
Category::Miscellaneous};
// Network
Setting<std::string> network_interface{linkage, std::string(), "network_interface",

View File

@@ -26,6 +26,7 @@ enum class TitleType : u8 {
Update = 0x81,
AOC = 0x82,
DeltaTitle = 0x83,
DataPatch = 0x84,
};
enum class ContentRecordType : u8 {

View File

@@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
@@ -646,6 +649,7 @@ public:
{2, &IManagerForApplication::EnsureIdTokenCacheAsync, "EnsureIdTokenCacheAsync"},
{3, &IManagerForApplication::LoadIdTokenCache, "LoadIdTokenCache"},
{130, &IManagerForApplication::GetNintendoAccountUserResourceCacheForApplication, "GetNintendoAccountUserResourceCacheForApplication"},
{136, &IManagerForApplication::GetNintendoAccountUserResourceCacheForApplication, "GetNintendoAccountUserResourceCache"}, // 19.0.0+
{150, nullptr, "CreateAuthorizationRequest"},
{160, &IManagerForApplication::StoreOpenContext, "StoreOpenContext"},
{170, nullptr, "LoadNetworkServiceLicenseKindAsync"},
@@ -986,6 +990,34 @@ void Module::Interface::CompleteUserRegistration(HLERequestContext& ctx) {
rb.Push(ResultSuccess);
}
void Module::Interface::DeleteUser(HLERequestContext& ctx) {
IPC::RequestParser rp{ctx};
Common::UUID user_id = rp.PopRaw<Common::UUID>();
LOG_INFO(Service_ACC, "called, uuid={}", user_id.FormattedString());
if (!profile_manager->RemoveUser(user_id)) {
LOG_ERROR(Service_ACC, "Failed to delete user with uuid={}", user_id.RawString());
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(1U);
return;
}
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(ResultSuccess);
}
void Module::Interface::SetUserPosition(HLERequestContext& ctx) {
IPC::RequestParser rp{ctx};
u64 position = rp.Pop<u64>();
Common::UUID user_id = rp.PopRaw<Common::UUID>();
LOG_DEBUG(Service_ACC, "called, position={} user_id={}", position, user_id.FormattedString());
profile_manager->SetUserPosition(position, user_id);
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(ResultSuccess);
}
void Module::Interface::GetProfileEditor(HLERequestContext& ctx) {
IPC::RequestParser rp{ctx};
Common::UUID user_id = rp.PopRaw<Common::UUID>();

View File

@@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
@@ -36,6 +39,8 @@ public:
void InitializeApplicationInfoV2(HLERequestContext& ctx);
void BeginUserRegistration(HLERequestContext& ctx);
void CompleteUserRegistration(HLERequestContext& ctx);
void DeleteUser(HLERequestContext& ctx);
void SetUserPosition(HLERequestContext& ctx);
void GetProfileEditor(HLERequestContext& ctx);
void ListQualifiedUsers(HLERequestContext& ctx);
void ListOpenContextStoredUsers(HLERequestContext& ctx);

View File

@@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
@@ -44,8 +47,8 @@ ACC_SU::ACC_SU(std::shared_ptr<Module> module_, std::shared_ptr<ProfileManager>
{200, &ACC_SU::BeginUserRegistration, "BeginUserRegistration"},
{201, &ACC_SU::CompleteUserRegistration, "CompleteUserRegistration"},
{202, nullptr, "CancelUserRegistration"},
{203, nullptr, "DeleteUser"},
{204, nullptr, "SetUserPosition"},
{203, &ACC_SU::DeleteUser, "DeleteUser"},
{204, &ACC_SU::SetUserPosition, "SetUserPosition"},
{205, &ACC_SU::GetProfileEditor, "GetProfileEditor"},
{206, nullptr, "CompleteUserRegistrationForcibly"},
{210, nullptr, "CreateFloatingRegistrationRequest"},

View File

@@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
@@ -344,6 +347,7 @@ bool ProfileManager::RemoveUser(UUID uuid) {
[](const ProfileInfo& profile) { return profile.user_uuid.IsValid(); });
is_save_needed = true;
WriteUserSaveFile();
return true;
}
@@ -360,6 +364,7 @@ bool ProfileManager::SetProfileBase(UUID uuid, const ProfileBase& profile_new) {
profile.creation_time = profile_new.timestamp;
is_save_needed = true;
WriteUserSaveFile();
return true;
}
@@ -370,9 +375,12 @@ bool ProfileManager::SetProfileBaseAndData(Common::UUID uuid, const ProfileBase&
if (index.has_value() && SetProfileBase(uuid, profile_new)) {
profiles[*index].data = data_new;
is_save_needed = true;
WriteUserSaveFile();
return true;
} else {
LOG_ERROR(Service_ACC, "Failed to set profile base and data for user with UUID: {}",
uuid.RawString());
}
return false;
}
@@ -437,6 +445,14 @@ void ProfileManager::WriteUserSaveFile() {
const auto save_path(FS::GetEdenPath(FS::EdenPath::NANDDir) / ACC_SAVE_AVATORS_BASE_PATH /
"profiles.dat");
if (FS::IsFile(save_path) && !FS::RemoveFile(save_path)) {
LOG_WARNING(Service_ACC, "Could not remove existing profiles.dat");
return;
} else {
LOG_INFO(Service_ACC, "Writing profiles.dat to {}",
Common::FS::PathToUTF8String(save_path));
}
if (!FS::CreateParentDirs(save_path)) {
LOG_WARNING(Service_ACC, "Failed to create full path of profiles.dat. Create the directory "
"nand/system/save/8000000000000010/su/avators to mitigate this "
@@ -455,4 +471,30 @@ void ProfileManager::WriteUserSaveFile() {
is_save_needed = false;
}
void ProfileManager::SetUserPosition(u64 position, Common::UUID uuid) {
auto idxOpt = GetUserIndex(uuid);
if (!idxOpt)
return;
size_t oldIdx = *idxOpt;
if (position >= user_count || position == oldIdx)
return;
ProfileInfo moving = profiles[oldIdx];
if (position < oldIdx) {
for (size_t i = oldIdx; i > position; --i)
profiles[i] = profiles[i - 1];
} else {
for (size_t i = oldIdx; i < position; ++i)
profiles[i] = profiles[i + 1];
}
profiles[position] = std::move(moving);
is_save_needed = true;
WriteUserSaveFile();
}
}; // namespace Service::Account

View File

@@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
@@ -89,6 +92,7 @@ public:
Common::UUID GetLastOpenedUser() const;
UserIDArray GetStoredOpenedUsers() const;
void StoreOpenedUsers();
void SetUserPosition(u64 position, Common::UUID uuid);
bool CanSystemRegisterUser() const;

View File

@@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
@@ -17,7 +20,7 @@ IDisplayController::IDisplayController(Core::System& system_, std::shared_ptr<Ap
{2, nullptr, "GetLastApplicationCaptureImage"},
{3, nullptr, "GetCallerAppletCaptureImage"},
{4, nullptr, "UpdateCallerAppletCaptureImage"},
{5, nullptr, "GetLastForegroundCaptureImageEx"},
{5, D<&IDisplayController::GetLastForegroundCaptureImageEx>, "GetLastForegroundCaptureImageEx"},
{6, nullptr, "GetLastApplicationCaptureImageEx"},
{7, D<&IDisplayController::GetCallerAppletCaptureImageEx>, "GetCallerAppletCaptureImageEx"},
{8, D<&IDisplayController::TakeScreenShotOfOwnLayer>, "TakeScreenShotOfOwnLayer"},
@@ -48,6 +51,13 @@ IDisplayController::IDisplayController(Core::System& system_, std::shared_ptr<Ap
IDisplayController::~IDisplayController() = default;
Result IDisplayController::GetLastForegroundCaptureImageEx(
Out<bool> out_was_written, OutBuffer<BufferAttr_HipcMapAlias> out_image_data) {
LOG_WARNING(Service_AM, "(STUBBED) called");
*out_was_written = true;
R_SUCCEED();
}
Result IDisplayController::GetCallerAppletCaptureImageEx(
Out<bool> out_was_written, OutBuffer<BufferAttr_HipcMapAlias> out_image_data) {
LOG_WARNING(Service_AM, "(STUBBED) called");

View File

@@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
@@ -16,6 +19,8 @@ public:
~IDisplayController() override;
private:
Result GetLastForegroundCaptureImageEx(Out<bool> out_was_written,
OutBuffer<BufferAttr_HipcMapAlias> out_image_data);
Result GetCallerAppletCaptureImageEx(Out<bool> out_was_written,
OutBuffer<BufferAttr_HipcMapAlias> out_image_data);
Result TakeScreenShotOfOwnLayer(bool unknown0, s32 fbshare_layer_index);

View File

@@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
@@ -107,7 +110,7 @@ IApplicationManagerInterface::IApplicationManagerInterface(Core::System& system_
{210, nullptr, "DeleteUserSystemSaveData"},
{211, nullptr, "DeleteSaveData"},
{220, nullptr, "UnregisterNetworkServiceAccount"},
{221, nullptr, "UnregisterNetworkServiceAccountWithUserSaveDataDeletion"},
{221, D<&IApplicationManagerInterface::UnregisterNetworkServiceAccountWithUserSaveDataDeletion>, "UnregisterNetworkServiceAccountWithUserSaveDataDeletion"},
{300, nullptr, "GetApplicationShellEvent"},
{301, nullptr, "PopApplicationShellEventInfo"},
{302, nullptr, "LaunchLibraryApplet"},
@@ -312,6 +315,10 @@ IApplicationManagerInterface::IApplicationManagerInterface(Core::System& system_
IApplicationManagerInterface::~IApplicationManagerInterface() = default;
Result IApplicationManagerInterface::UnregisterNetworkServiceAccountWithUserSaveDataDeletion(Common::UUID user_id) {
LOG_DEBUG(Service_NS, "called, user_id={}", user_id.FormattedString());
R_SUCCEED();
}
Result IApplicationManagerInterface::GetApplicationControlData(
OutBuffer<BufferAttr_HipcMapAlias> out_buffer, Out<u32> out_actual_size,
ApplicationControlSource application_control_source, u64 application_id) {

View File

@@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
@@ -16,6 +19,7 @@ public:
explicit IApplicationManagerInterface(Core::System& system_);
~IApplicationManagerInterface() override;
Result UnregisterNetworkServiceAccountWithUserSaveDataDeletion(Common::UUID user_id);
Result GetApplicationControlData(OutBuffer<BufferAttr_HipcMapAlias> out_buffer,
Out<u32> out_actual_size,
ApplicationControlSource application_control_source,

View File

@@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
@@ -34,6 +37,7 @@ IDynamicRightsInterface::IDynamicRightsInterface(Core::System& system_)
{23, nullptr, "GetLimitedApplicationLicenseUpgradableEvent"},
{24, nullptr, "NotifyLimitedApplicationLicenseUpgradableEventForDebug"},
{25, nullptr, "RequestProceedDynamicRightsState"},
{26, D<&IDynamicRightsInterface::HasAccountRestrictedRightsInRunningApplications>, "HasAccountRestrictedRightsInRunningApplications"}
};
// clang-format on
@@ -59,4 +63,10 @@ Result IDynamicRightsInterface::VerifyActivatedRightsOwners(u64 rights_handle) {
R_SUCCEED();
}
Result IDynamicRightsInterface::HasAccountRestrictedRightsInRunningApplications(Out<u8> out_bool) {
LOG_WARNING(Service_NS, "(STUBBED) called");
*out_bool = 0;
R_SUCCEED();
}
} // namespace Service::NS

View File

@@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
@@ -17,6 +20,7 @@ private:
Result NotifyApplicationRightsCheckStart();
Result GetRunningApplicationStatus(Out<u32> out_status, u64 rights_handle);
Result VerifyActivatedRightsOwners(u64 rights_handle);
Result HasAccountRestrictedRightsInRunningApplications(Out<u8> out_bool);
};
} // namespace Service::NS

View File

@@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
@@ -21,7 +24,7 @@ IParentalControlService::IParentalControlService(Core::System& system_, Capabili
{1002, D<&IParentalControlService::ConfirmLaunchApplicationPermission>, "ConfirmLaunchApplicationPermission"},
{1003, D<&IParentalControlService::ConfirmResumeApplicationPermission>, "ConfirmResumeApplicationPermission"},
{1004, D<&IParentalControlService::ConfirmSnsPostPermission>, "ConfirmSnsPostPermission"},
{1005, nullptr, "ConfirmSystemSettingsPermission"},
{1005, D<&IParentalControlService::ConfirmSystemSettingsPermission>, "ConfirmSystemSettingsPermission"},
{1006, D<&IParentalControlService::IsRestrictionTemporaryUnlocked>, "IsRestrictionTemporaryUnlocked"},
{1007, nullptr, "RevertRestrictionTemporaryUnlocked"},
{1008, nullptr, "EnterRestrictedSystemSettings"},
@@ -240,6 +243,11 @@ Result IParentalControlService::ConfirmSnsPostPermission() {
R_THROW(PCTL::ResultNoFreeCommunication);
}
Result IParentalControlService::ConfirmSystemSettingsPermission() {
LOG_WARNING(Service_PCTL, "(STUBBED) called");
R_SUCCEED();
}
Result IParentalControlService::IsRestrictionTemporaryUnlocked(
Out<bool> out_is_temporary_unlocked) {
*out_is_temporary_unlocked = false;

View File

@@ -1,5 +1,8 @@
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator
// Project// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
@@ -28,6 +31,7 @@ private:
Result ConfirmResumeApplicationPermission(InBuffer<BufferAttr_HipcPointer> restriction_bitset,
u64 nacp_flag, u64 application_id);
Result ConfirmSnsPostPermission();
Result ConfirmSystemSettingsPermission();
Result IsRestrictionTemporaryUnlocked(Out<bool> out_is_temporary_unlocked);
Result IsRestrictedSystemSettingsEntered(Out<bool> out_is_restricted_system_settings_entered);
Result ConfirmStereoVisionPermission();

View File

@@ -1,8 +1,12 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include <memory>
#include "common/device_power_state.h"
#include "common/logging/log.h"
#include "core/core.h"
#include "core/hle/kernel/k_event.h"
@@ -148,17 +152,31 @@ PSM::~PSM() = default;
void PSM::GetBatteryChargePercentage(HLERequestContext& ctx) {
LOG_DEBUG(Service_PTM, "called");
u32 percentage = 100;
Common::PowerStatus power_status = Common::GetPowerStatus();
if (power_status.has_battery && power_status.percentage >= 0) {
percentage = static_cast<u32>(power_status.percentage);
}
IPC::ResponseBuilder rb{ctx, 3};
rb.Push(ResultSuccess);
rb.Push<u32>(battery_charge_percentage);
rb.Push<u32>(percentage);
}
void PSM::GetChargerType(HLERequestContext& ctx) {
LOG_DEBUG(Service_PTM, "called");
ChargerType charger = ChargerType::Unplugged;
Common::PowerStatus power_status = Common::GetPowerStatus();
if (power_status.has_battery && power_status.charging) {
charger = ChargerType::RegularCharger;
}
IPC::ResponseBuilder rb{ctx, 3};
rb.Push(ResultSuccess);
rb.PushEnum(charger_type);
rb.PushEnum(charger);
}
void PSM::OpenSession(HLERequestContext& ctx) {

View File

@@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
@@ -23,9 +26,6 @@ private:
void GetBatteryChargePercentage(HLERequestContext& ctx);
void GetChargerType(HLERequestContext& ctx);
void OpenSession(HLERequestContext& ctx);
u32 battery_charge_percentage{100};
ChargerType charger_type{ChargerType::RegularCharger};
};
} // namespace Service::PTM

View File

@@ -7,7 +7,6 @@
#include <catch2/catch_test_macros.hpp>
#include "common/alignment.h"
#include "common/common_types.h"
#include "video_core/buffer_cache/memory_tracker_base.h"

View File

@@ -34,7 +34,7 @@ constexpr std::array PreferredGpuDecoders = {
AV_HWDEVICE_TYPE_VAAPI,
AV_HWDEVICE_TYPE_VDPAU,
#endif
AV_HWDEVICE_TYPE_VULKAN,
AV_HWDEVICE_TYPE_VULKAN
};
AVPixelFormat GetGpuFormat(AVCodecContext* codec_context, const AVPixelFormat* pix_fmts) {
@@ -99,8 +99,7 @@ bool Decoder::SupportsDecodingOnDevice(AVPixelFormat* out_pix_fmt, AVHWDeviceTyp
for (int i = 0;; i++) {
const AVCodecHWConfig* config = avcodec_get_hw_config(m_codec, i);
if (!config) {
LOG_DEBUG(HW_GPU, "{} decoder does not support device type {}", m_codec->name,
av_hwdevice_get_type_name(type));
LOG_DEBUG(HW_GPU, "{} decoder does not support device type {}", m_codec->name, av_hwdevice_get_type_name(type));
break;
}
if (config->methods & AV_CODEC_HW_CONFIG_METHOD_HW_DEVICE_CTX && config->device_type == type) {
@@ -131,8 +130,7 @@ HardwareContext::~HardwareContext() {
av_buffer_unref(&m_gpu_decoder);
}
bool HardwareContext::InitializeForDecoder(DecoderContext& decoder_context,
const Decoder& decoder) {
bool HardwareContext::InitializeForDecoder(DecoderContext& decoder_context, const Decoder& decoder) {
const auto supported_types = GetSupportedDeviceTypes();
for (const auto type : PreferredGpuDecoders) {
AVPixelFormat hw_pix_fmt;
@@ -152,17 +150,14 @@ bool HardwareContext::InitializeForDecoder(DecoderContext& decoder_context,
}
}
LOG_INFO(HW_GPU, "Hardware decoding is disabled due to implementation issues, using CPU.");
return false;
}
bool HardwareContext::InitializeWithType(AVHWDeviceType type) {
av_buffer_unref(&m_gpu_decoder);
if (const int ret = av_hwdevice_ctx_create(&m_gpu_decoder, type, nullptr, nullptr, 0);
ret < 0) {
LOG_DEBUG(HW_GPU, "av_hwdevice_ctx_create({}) failed: {}", av_hwdevice_get_type_name(type),
AVError(ret));
if (const int ret = av_hwdevice_ctx_create(&m_gpu_decoder, type, nullptr, nullptr, 0); ret < 0) {
LOG_DEBUG(HW_GPU, "av_hwdevice_ctx_create({}) failed: {}", av_hwdevice_get_type_name(type), AVError(ret));
return false;
}
@@ -189,6 +184,7 @@ bool HardwareContext::InitializeWithType(AVHWDeviceType type) {
DecoderContext::DecoderContext(const Decoder& decoder) : m_decoder{decoder} {
m_codec_context = avcodec_alloc_context3(m_decoder.GetCodec());
av_opt_set(m_codec_context->priv_data, "preset", "veryfast", 0);
av_opt_set(m_codec_context->priv_data, "tune", "zerolatency", 0);
m_codec_context->thread_count = 0;
m_codec_context->thread_type &= ~FF_THREAD_FRAME;
@@ -199,8 +195,7 @@ DecoderContext::~DecoderContext() {
avcodec_free_context(&m_codec_context);
}
void DecoderContext::InitializeHardwareDecoder(const HardwareContext& context,
AVPixelFormat hw_pix_fmt) {
void DecoderContext::InitializeHardwareDecoder(const HardwareContext& context, AVPixelFormat hw_pix_fmt) {
m_codec_context->hw_device_ctx = av_buffer_ref(context.GetBufferRef());
m_codec_context->get_format = GetGpuFormat;
m_codec_context->pix_fmt = hw_pix_fmt;
@@ -223,21 +218,15 @@ bool DecoderContext::SendPacket(const Packet& packet) {
m_temp_frame = std::make_shared<Frame>();
m_got_frame = 0;
// Android can randomly crash when calling decode directly, so skip.
// TODO update ffmpeg and hope that fixes it.
#ifndef ANDROID
if (!m_codec_context->hw_device_ctx && m_codec_context->codec_id == AV_CODEC_ID_H264) {
m_decode_order = true;
auto* codec{ffcodec(m_decoder.GetCodec())};
if (const int ret = codec->cb.decode(m_codec_context, m_temp_frame->GetFrame(),
&m_got_frame, packet.GetPacket());
ret < 0) {
if (const int ret = codec->cb.decode(m_codec_context, m_temp_frame->GetFrame(), &m_got_frame, packet.GetPacket()); ret < 0) {
LOG_DEBUG(Service_NVDRV, "avcodec_send_packet error {}", AVError(ret));
return false;
}
return true;
}
#endif
if (const int ret = avcodec_send_packet(m_codec_context, packet.GetPacket()); ret < 0) {
LOG_ERROR(HW_GPU, "avcodec_send_packet error: {}", AVError(ret));
@@ -248,9 +237,6 @@ bool DecoderContext::SendPacket(const Packet& packet) {
}
std::shared_ptr<Frame> DecoderContext::ReceiveFrame() {
// Android can randomly crash when calling decode directly, so skip.
// TODO update ffmpeg and hope that fixes it.
#ifndef ANDROID
if (!m_codec_context->hw_device_ctx && m_codec_context->codec_id == AV_CODEC_ID_H264) {
m_decode_order = true;
auto* codec{ffcodec(m_decoder.GetCodec())};
@@ -269,10 +255,7 @@ std::shared_ptr<Frame> DecoderContext::ReceiveFrame() {
LOG_ERROR(Service_NVDRV, "Failed to receive a frame! error {}", ret);
return {};
}
} else
#endif
{
} else {
const auto ReceiveImpl = [&](AVFrame* frame) {
if (const int ret = avcodec_receive_frame(m_codec_context, frame); ret < 0) {
LOG_ERROR(HW_GPU, "avcodec_receive_frame error: {}", AVError(ret));
@@ -292,9 +275,7 @@ std::shared_ptr<Frame> DecoderContext::ReceiveFrame() {
}
m_temp_frame->SetFormat(PreferredGpuFormat);
if (const int ret = av_hwframe_transfer_data(m_temp_frame->GetFrame(),
intermediate_frame.GetFrame(), 0);
ret < 0) {
if (const int ret = av_hwframe_transfer_data(m_temp_frame->GetFrame(), intermediate_frame.GetFrame(), 0); ret < 0) {
LOG_ERROR(HW_GPU, "av_hwframe_transfer_data error: {}", AVError(ret));
return {};
}

View File

@@ -21,9 +21,7 @@ extern "C" {
#include <libavcodec/avcodec.h>
#include <libavutil/opt.h>
#ifndef ANDROID
#include <libavcodec/codec_internal.h>
#endif
#if defined(__GNUC__) || defined(__clang__)
#pragma GCC diagnostic pop

View File

@@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
@@ -928,6 +931,7 @@ bool AccelerateDMA::BufferToImage(const Tegra::DMA::ImageCopy& copy_info,
void RasterizerVulkan::UpdateDynamicStates() {
auto& regs = maxwell3d->regs;
UpdateViewportsState(regs);
UpdateScissorsState(regs);
UpdateDepthBias(regs);
@@ -935,7 +939,24 @@ void RasterizerVulkan::UpdateDynamicStates() {
UpdateDepthBounds(regs);
UpdateStencilFaces(regs);
UpdateLineWidth(regs);
if (device.IsExtExtendedDynamicStateSupported()) {
const u8 dynamic_state = Settings::values.dyna_state.GetValue();
auto features = DynamicFeatures{
.has_extended_dynamic_state = device.IsExtExtendedDynamicStateSupported()
&& dynamic_state > 0,
.has_extended_dynamic_state_2 = device.IsExtExtendedDynamicState2Supported()
&& dynamic_state > 1,
.has_extended_dynamic_state_2_extra = device.IsExtExtendedDynamicState2ExtrasSupported()
&& dynamic_state > 1,
.has_extended_dynamic_state_3_blend = device.IsExtExtendedDynamicState3BlendingSupported()
&& dynamic_state > 2,
.has_extended_dynamic_state_3_enables = device.IsExtExtendedDynamicState3EnablesSupported()
&& dynamic_state > 2,
.has_dynamic_vertex_input = device.IsExtVertexInputDynamicStateSupported(),
};
if (features.has_extended_dynamic_state) {
UpdateCullMode(regs);
UpdateDepthCompareOp(regs);
UpdateFrontFace(regs);
@@ -946,45 +967,54 @@ void RasterizerVulkan::UpdateDynamicStates() {
UpdateDepthTestEnable(regs);
UpdateDepthWriteEnable(regs);
UpdateStencilTestEnable(regs);
if (device.IsExtExtendedDynamicState2Supported()) {
if (features.has_extended_dynamic_state_2) {
UpdatePrimitiveRestartEnable(regs);
UpdateRasterizerDiscardEnable(regs);
UpdateDepthBiasEnable(regs);
}
if (device.IsExtExtendedDynamicState3EnablesSupported()) {
if (features.has_extended_dynamic_state_3_enables) {
using namespace Tegra::Engines;
if (device.GetDriverID() == VkDriverIdKHR::VK_DRIVER_ID_AMD_OPEN_SOURCE
|| device.GetDriverID() == VkDriverIdKHR::VK_DRIVER_ID_AMD_PROPRIETARY) {
struct In {
struct In
{
const Maxwell3D::Regs::VertexAttribute::Type d;
In(Maxwell3D::Regs::VertexAttribute::Type n) : d(n) {}
bool operator()(Maxwell3D::Regs::VertexAttribute n) const {
In(Maxwell3D::Regs::VertexAttribute::Type n)
: d(n)
{}
bool operator()(Maxwell3D::Regs::VertexAttribute n) const
{
return n.type == d;
}
};
auto has_float = std::any_of(
regs.vertex_attrib_format.begin(), regs.vertex_attrib_format.end(),
In(Maxwell3D::Regs::VertexAttribute::Type::Float));
auto has_float = std::any_of(regs.vertex_attrib_format.begin(),
regs.vertex_attrib_format.end(),
In(Maxwell3D::Regs::VertexAttribute::Type::Float));
if (regs.logic_op.enable)
regs.logic_op.enable = static_cast<u32>(!has_float);
UpdateLogicOpEnable(regs);
} else
} else {
UpdateLogicOpEnable(regs);
}
UpdateDepthClampEnable(regs);
}
}
if (device.IsExtExtendedDynamicState2ExtrasSupported()) {
if (features.has_extended_dynamic_state_2_extra) {
UpdateLogicOp(regs);
}
if (device.IsExtExtendedDynamicState3Supported()) {
if (features.has_extended_dynamic_state_3_enables) {
UpdateBlending(regs);
UpdateLineStippleEnable(regs);
UpdateConservativeRasterizationMode(regs);
}
}
if (device.IsExtVertexInputDynamicStateSupported()) {
if (features.has_dynamic_vertex_input) {
UpdateVertexInput(regs);
}
}
@@ -1104,25 +1134,39 @@ void RasterizerVulkan::UpdateDepthBias(Tegra::Engines::Maxwell3D::Regs& regs) {
regs.zeta.format == Tegra::DepthFormat::S8Z24_UNORM ||
regs.zeta.format == Tegra::DepthFormat::V8Z24_UNORM;
size_t length = sizeof(NEEDS_D24) / sizeof(u64);
bool needs_convert = false;
for (size_t i = 0; i < length; ++i) {
if (NEEDS_D24[i] == program_id) {
needs_convert = true;
break;
if (is_d24 && !device.SupportsD24DepthBuffer()) {
static constexpr const size_t length = sizeof(NEEDS_D24) / sizeof(NEEDS_D24[0]);
static constexpr const u64 *start = NEEDS_D24;
static constexpr const u64 *end = NEEDS_D24 + length;
const u64 *it = std::find(start, end, program_id);
if (it != end) {
// the base formulas can be obtained from here:
// https://docs.microsoft.com/en-us/windows/win32/direct3d11/d3d10-graphics-programming-guide-output-merger-stage-depth-bias
const double rescale_factor = static_cast<double>(1ULL << (32 - 24))
/ (static_cast<double>(0x1.ep+127));
units = static_cast<float>(static_cast<double>(units) * rescale_factor);
}
}
if (is_d24 && !device.SupportsD24DepthBuffer() && needs_convert) {
// the base formulas can be obtained from here:
// https://docs.microsoft.com/en-us/windows/win32/direct3d11/d3d10-graphics-programming-guide-output-merger-stage-depth-bias
const double rescale_factor = static_cast<double>(1ULL << (32 - 24))
/ (static_cast<double>(0x1.ep+127));
units = static_cast<float>(static_cast<double>(units) * rescale_factor);
} scheduler.Record([constant = units, clamp = regs.depth_bias_clamp,
factor = regs.slope_scale_depth_bias](vk::CommandBuffer cmdbuf) {
cmdbuf.SetDepthBias(constant, clamp, factor);
});
scheduler.Record(
[constant = units, clamp = regs.depth_bias_clamp, factor = regs.slope_scale_depth_bias, this](
vk::CommandBuffer cmdbuf) {
if (device.IsExtDepthBiasControlSupported()) {
static VkDepthBiasRepresentationInfoEXT bias_info{
.sType = VK_STRUCTURE_TYPE_DEPTH_BIAS_REPRESENTATION_INFO_EXT,
.pNext = nullptr,
.depthBiasRepresentation = VK_DEPTH_BIAS_REPRESENTATION_LEAST_REPRESENTABLE_VALUE_FORCE_UNORM_EXT,
.depthBiasExact = VK_FALSE,
};
cmdbuf.SetDepthBias(constant, clamp, factor, &bias_info);
} else {
cmdbuf.SetDepthBias(constant, clamp, factor);
}
});
}
void RasterizerVulkan::UpdateBlendConstants(Tegra::Engines::Maxwell3D::Regs& regs) {
@@ -1304,6 +1348,45 @@ void RasterizerVulkan::UpdateRasterizerDiscardEnable(Tegra::Engines::Maxwell3D::
});
}
void RasterizerVulkan::UpdateConservativeRasterizationMode(Tegra::Engines::Maxwell3D::Regs& regs)
{
if (!state_tracker.TouchConservativeRasterizationMode()) {
return;
}
scheduler.Record([enable = regs.conservative_raster_enable](vk::CommandBuffer cmdbuf) {
cmdbuf.SetConservativeRasterizationModeEXT(
enable ? VK_CONSERVATIVE_RASTERIZATION_MODE_UNDERESTIMATE_EXT
: VK_CONSERVATIVE_RASTERIZATION_MODE_DISABLED_EXT);
});
}
void RasterizerVulkan::UpdateLineStippleEnable(Tegra::Engines::Maxwell3D::Regs& regs)
{
if (!state_tracker.TouchLineStippleEnable()) {
return;
}
scheduler.Record([enable = regs.line_stipple_enable](vk::CommandBuffer cmdbuf) {
cmdbuf.SetLineStippleEnableEXT(enable);
});
}
void RasterizerVulkan::UpdateLineRasterizationMode(Tegra::Engines::Maxwell3D::Regs& regs)
{
// if (!state_tracker.TouchLi()) {
// return;
// }
// TODO: The maxwell emulator does not capture line rasters
// scheduler.Record([enable = regs.line](vk::CommandBuffer cmdbuf) {
// cmdbuf.SetConservativeRasterizationModeEXT(
// enable ? VK_CONSERVATIVE_RASTERIZATION_MODE_UNDERESTIMATE_EXT
// : VK_CONSERVATIVE_RASTERIZATION_MODE_DISABLED_EXT);
// });
}
void RasterizerVulkan::UpdateDepthBiasEnable(Tegra::Engines::Maxwell3D::Regs& regs) {
if (!state_tracker.TouchDepthBiasEnable()) {
return;

View File

@@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
@@ -139,7 +142,7 @@ public:
u32 pixel_stride);
private:
static constexpr u64 NEEDS_D24[] = {
static constexpr const u64 NEEDS_D24[] = {
0x01006A800016E000ULL, // SSBU
0x0100E95004038000ULL, // XC2
0x0100A6301214E000ULL, // FE:Engage
@@ -175,6 +178,9 @@ private:
void UpdateDepthCompareOp(Tegra::Engines::Maxwell3D::Regs& regs);
void UpdatePrimitiveRestartEnable(Tegra::Engines::Maxwell3D::Regs& regs);
void UpdateRasterizerDiscardEnable(Tegra::Engines::Maxwell3D::Regs& regs);
void UpdateConservativeRasterizationMode(Tegra::Engines::Maxwell3D::Regs& regs);
void UpdateLineStippleEnable(Tegra::Engines::Maxwell3D::Regs& regs);
void UpdateLineRasterizationMode(Tegra::Engines::Maxwell3D::Regs& regs);
void UpdateDepthBiasEnable(Tegra::Engines::Maxwell3D::Regs& regs);
void UpdateLogicOpEnable(Tegra::Engines::Maxwell3D::Regs& regs);
void UpdateDepthClampEnable(Tegra::Engines::Maxwell3D::Regs& regs);

View File

@@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
@@ -50,6 +53,8 @@ Flags MakeInvalidationFlags() {
StateEnable,
PrimitiveRestartEnable,
RasterizerDiscardEnable,
ConservativeRasterizationMode,
LineStippleEnable,
DepthBiasEnable,
LogicOpEnable,
DepthClampEnable,
@@ -137,6 +142,8 @@ void SetupDirtyStateEnable(Tables& tables) {
setup(OFF(stencil_enable), StencilTestEnable);
setup(OFF(primitive_restart.enabled), PrimitiveRestartEnable);
setup(OFF(rasterize_enable), RasterizerDiscardEnable);
setup(OFF(conservative_raster_enable), ConservativeRasterizationMode);
setup(OFF(line_stipple_enable), LineStippleEnable);
setup(OFF(polygon_offset_point_enable), DepthBiasEnable);
setup(OFF(polygon_offset_line_enable), DepthBiasEnable);
setup(OFF(polygon_offset_fill_enable), DepthBiasEnable);

View File

@@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
@@ -50,6 +53,8 @@ enum : u8 {
StencilTestEnable,
PrimitiveRestartEnable,
RasterizerDiscardEnable,
ConservativeRasterizationMode,
LineStippleEnable,
DepthBiasEnable,
StateEnable,
LogicOp,
@@ -200,10 +205,15 @@ public:
return Exchange(Dirty::RasterizerDiscardEnable, false);
}
bool TouchDepthBiasEnable() {
return Exchange(Dirty::DepthBiasEnable, false);
bool TouchConservativeRasterizationMode()
{
return Exchange(Dirty::ConservativeRasterizationMode, false);
}
bool TouchLineStippleEnable() { return Exchange(Dirty::ConservativeRasterizationMode, false); }
bool TouchDepthBiasEnable() { return Exchange(Dirty::DepthBiasEnable, false); }
bool TouchLogicOpEnable() {
return Exchange(Dirty::LogicOpEnable, false);
}

View File

@@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
@@ -141,6 +144,9 @@ void Load(VkDevice device, DeviceDispatch& dld) noexcept {
X(vkCmdSetDepthWriteEnableEXT);
X(vkCmdSetPrimitiveRestartEnableEXT);
X(vkCmdSetRasterizerDiscardEnableEXT);
X(vkCmdSetConservativeRasterizationModeEXT);
X(vkCmdSetLineRasterizationModeEXT);
X(vkCmdSetLineStippleEnableEXT);
X(vkCmdSetDepthBiasEnableEXT);
X(vkCmdSetLogicOpEnableEXT);
X(vkCmdSetDepthClampEnableEXT);

View File

@@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
@@ -234,6 +237,9 @@ struct DeviceDispatch : InstanceDispatch {
PFN_vkCmdSetDepthWriteEnableEXT vkCmdSetDepthWriteEnableEXT{};
PFN_vkCmdSetPrimitiveRestartEnableEXT vkCmdSetPrimitiveRestartEnableEXT{};
PFN_vkCmdSetRasterizerDiscardEnableEXT vkCmdSetRasterizerDiscardEnableEXT{};
PFN_vkCmdSetConservativeRasterizationModeEXT vkCmdSetConservativeRasterizationModeEXT{};
PFN_vkCmdSetLineRasterizationModeEXT vkCmdSetLineRasterizationModeEXT{};
PFN_vkCmdSetLineStippleEnableEXT vkCmdSetLineStippleEnableEXT{};
PFN_vkCmdSetDepthBiasEnableEXT vkCmdSetDepthBiasEnableEXT{};
PFN_vkCmdSetLogicOpEnableEXT vkCmdSetLogicOpEnableEXT{};
PFN_vkCmdSetDepthClampEnableEXT vkCmdSetDepthClampEnableEXT{};
@@ -1431,6 +1437,21 @@ public:
dld->vkCmdSetRasterizerDiscardEnableEXT(handle, enable ? VK_TRUE : VK_FALSE);
}
void SetConservativeRasterizationModeEXT(VkConservativeRasterizationModeEXT mode) const noexcept
{
dld->vkCmdSetConservativeRasterizationModeEXT(handle, mode);
}
void SetLineRasterizationModeEXT(VkLineRasterizationModeEXT mode) const noexcept
{
dld->vkCmdSetLineRasterizationModeEXT(handle, mode);
}
void SetLineStippleEnableEXT(bool enable) const noexcept
{
dld->vkCmdSetLineStippleEnableEXT(handle, enable ? VK_TRUE : VK_FALSE);
}
void SetDepthBiasEnableEXT(bool enable) const noexcept {
dld->vkCmdSetDepthBiasEnableEXT(handle, enable ? VK_TRUE : VK_FALSE);
}

View File

@@ -1,25 +1,39 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: 2016 Citra Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include <algorithm>
#include <functional>
#include <iostream>
#include <QColorDialog>
#include <QDialog>
#include <QDialogButtonBox>
#include <QFileDialog>
#include <QGraphicsItem>
#include <QHeaderView>
#include <QListWidget>
#include <QMessageBox>
#include <QStandardItemModel>
#include <QTreeView>
#include "common/assert.h"
#include "common/fs/path_util.h"
#include "common/settings.h"
#include "common/string_util.h"
#include "common/swap.h"
#include "core/core.h"
#include "core/file_sys/content_archive.h"
#include "core/file_sys/nca_metadata.h"
#include "core/file_sys/registered_cache.h"
#include "core/file_sys/romfs.h"
#include "core/file_sys/vfs/vfs.h"
#include "core/hle/service/acc/profile_manager.h"
#include "core/hle/service/filesystem/filesystem.h"
#include "ui_configure_profile_manager.h"
#include "yuzu/configuration/configure_profile_manager.h"
#include "yuzu/util/limitable_input_dialog.h"
#include "yuzu/configuration/configure_profile_manager.h"
namespace {
// Same backup JPEG used by acc IProfile::GetImage if no jpeg found
@@ -113,8 +127,12 @@ ConfigureProfileManager::ConfigureProfileManager(Core::System& system_, QWidget*
connect(ui->pm_rename, &QPushButton::clicked, this, &ConfigureProfileManager::RenameUser);
connect(ui->pm_remove, &QPushButton::clicked, this,
&ConfigureProfileManager::ConfirmDeleteUser);
connect(ui->pm_set_image, &QPushButton::clicked, this, &ConfigureProfileManager::SetUserImage);
connect(ui->pm_set_image, &QPushButton::clicked, this,
&ConfigureProfileManager::SelectImageFile);
connect(ui->pm_select_avatar, &QPushButton::clicked, this,
&ConfigureProfileManager::SelectFirmwareAvatar);
avatar_dialog = new ConfigureProfileManagerAvatarDialog(this);
confirm_dialog = new ConfigureProfileManagerDeleteDialog(this);
scene = new QGraphicsScene;
@@ -194,6 +212,7 @@ void ConfigureProfileManager::SelectUser(const QModelIndex& index) {
ui->pm_remove->setEnabled(profile_manager.GetUserCount() >= 2);
ui->pm_rename->setEnabled(true);
ui->pm_set_image->setEnabled(true);
ui->pm_select_avatar->setEnabled(true);
}
void ConfigureProfileManager::AddUser() {
@@ -267,18 +286,11 @@ void ConfigureProfileManager::DeleteUser(const Common::UUID& uuid) {
ui->pm_rename->setEnabled(false);
}
void ConfigureProfileManager::SetUserImage() {
void ConfigureProfileManager::SetUserImage(const QImage& image) {
const auto index = tree_view->currentIndex().row();
const auto uuid = profile_manager.GetUser(index);
ASSERT(uuid);
const auto file = QFileDialog::getOpenFileName(this, tr("Select User Image"), QString(),
tr("JPEG Images (*.jpg *.jpeg)"));
if (file.isEmpty()) {
return;
}
const auto image_path = GetImagePath(*uuid);
if (QFile::exists(image_path) && !QFile::remove(image_path)) {
QMessageBox::warning(
@@ -304,29 +316,230 @@ void ConfigureProfileManager::SetUserImage() {
return;
}
if (!QFile::copy(file, image_path)) {
QMessageBox::warning(this, tr("Error copying user image"),
tr("Unable to copy image from %1 to %2").arg(file, image_path));
if (!image.save(image_path, "JPEG", 100)) {
QMessageBox::warning(this, tr("Error saving user image"),
tr("Unable to save image to file"));
return;
}
// Profile image must be 256x256
QImage image(image_path);
if (image.width() != 256 || image.height() != 256) {
image = image.scaled(256, 256, Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation);
if (!image.save(image_path)) {
QMessageBox::warning(this, tr("Error resizing user image"),
tr("Unable to resize image"));
return;
}
}
const auto username = GetAccountUsername(profile_manager, *uuid);
item_model->setItem(index, 0,
new QStandardItem{GetIcon(*uuid), FormatUserEntryText(username, *uuid)});
UpdateCurrentUser();
}
void ConfigureProfileManager::SelectImageFile() {
const auto file = QFileDialog::getOpenFileName(this, tr("Select User Image"), QString(),
tr("Image Formats (*.jpg *.jpeg *.png *.bmp)"));
if (file.isEmpty()) {
return;
}
// Profile image must be 256x256
QImage image(file);
if (image.width() != 256 || image.height() != 256) {
image = image.scaled(256, 256, Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation);
}
SetUserImage(image);
}
void ConfigureProfileManager::SelectFirmwareAvatar() {
if (!avatar_dialog->AreImagesLoaded()) {
if (!LoadAvatarData()) {
return;
}
}
if (avatar_dialog->exec() == QDialog::Accepted) {
SetUserImage(avatar_dialog->GetSelectedAvatar().toImage());
}
}
bool ConfigureProfileManager::LoadAvatarData() {
constexpr u64 AvatarImageDataId = 0x010000000000080AULL;
// Attempt to load avatar data archive from installed firmware
auto* bis_system = system.GetFileSystemController().GetSystemNANDContents();
if (!bis_system) {
QMessageBox::warning(this, tr("No firmware available"),
tr("Please install the firmware to use firmware avatars."));
return false;
}
const auto nca = bis_system->GetEntry(AvatarImageDataId, FileSys::ContentRecordType::Data);
if (!nca) {
QMessageBox::warning(this, tr("Error loading archive"),
tr("Archive is not available. Please install/reinstall firmware."));
return false;
}
const auto romfs = nca->GetRomFS();
if (!romfs) {
QMessageBox::warning(this, tr("Error loading archive"),
tr("Archive does not contain romfs. It is probably corrupt."));
return false;
}
const auto extracted = FileSys::ExtractRomFS(romfs);
if (!extracted) {
QMessageBox::warning(this, tr("Error extracting archive"),
tr("Archive could not be extracted. It is probably corrupt."));
return false;
}
const auto chara_dir = extracted->GetSubdirectory("chara");
if (!chara_dir) {
QMessageBox::warning(this, tr("Error finding image directory"),
tr("Failed to find image directory in the archive."));
return false;
}
QVector<QPixmap> images;
for (const auto& item : chara_dir->GetFiles()) {
if (item->GetExtension() != "szs") {
continue;
}
auto image_data = DecompressYaz0(item);
if (image_data.empty()) {
continue;
}
QImage image(reinterpret_cast<const uchar*>(image_data.data()), 256, 256,
QImage::Format_RGBA8888);
images.append(QPixmap::fromImage(image));
}
if (images.isEmpty()) {
QMessageBox::warning(this, tr("No images found"),
tr("No avatar images were found in the archive."));
return false;
}
// Load the image data into the dialog
avatar_dialog->LoadImages(images);
return true;
}
ConfigureProfileManagerAvatarDialog::ConfigureProfileManagerAvatarDialog(QWidget* parent)
: QDialog{parent}, avatar_list{new QListWidget(this)}, bg_color_button{new QPushButton(this)} {
auto* main_layout = new QVBoxLayout(this);
auto* button_layout = new QHBoxLayout(this);
auto* select_button = new QPushButton(tr("Select"), this);
auto* cancel_button = new QPushButton(tr("Cancel"), this);
auto* bg_color_label = new QLabel(tr("Background Color"), this);
SetBackgroundColor(Qt::white);
avatar_list->setViewMode(QListView::IconMode);
avatar_list->setIconSize(QSize(64, 64));
avatar_list->setSpacing(4);
avatar_list->setResizeMode(QListView::Adjust);
avatar_list->setSelectionMode(QAbstractItemView::SingleSelection);
avatar_list->setEditTriggers(QAbstractItemView::NoEditTriggers);
avatar_list->setDragDropMode(QAbstractItemView::NoDragDrop);
avatar_list->setDragEnabled(false);
avatar_list->setDropIndicatorShown(false);
avatar_list->setAcceptDrops(false);
button_layout->addWidget(bg_color_button);
button_layout->addWidget(bg_color_label);
button_layout->addStretch();
button_layout->addWidget(select_button);
button_layout->addWidget(cancel_button);
this->setLayout(main_layout);
this->setWindowTitle(tr("Select Firmware Avatar"));
main_layout->addWidget(avatar_list);
main_layout->addLayout(button_layout);
connect(bg_color_button, &QPushButton::clicked, this, [this]() {
const auto new_color = QColorDialog::getColor(avatar_bg_color);
if (new_color.isValid()) {
SetBackgroundColor(new_color);
RefreshAvatars();
}
});
connect(select_button, &QPushButton::clicked, this, [this]() { accept(); });
connect(cancel_button, &QPushButton::clicked, this, [this]() { reject(); });
}
ConfigureProfileManagerAvatarDialog::~ConfigureProfileManagerAvatarDialog() = default;
void ConfigureProfileManagerAvatarDialog::SetBackgroundColor(const QColor& color) {
avatar_bg_color = color;
bg_color_button->setStyleSheet(
QStringLiteral("background-color: %1; min-width: 60px;").arg(avatar_bg_color.name()));
}
QPixmap ConfigureProfileManagerAvatarDialog::CreateAvatar(const QPixmap& avatar) {
QPixmap output(avatar.size());
output.fill(avatar_bg_color);
// Scale the image and fill it black to become our shadow
QPixmap shadow_pixmap = avatar.transformed(QTransform::fromScale(1.04, 1.04));
QPainter shadow_painter(&shadow_pixmap);
shadow_painter.setCompositionMode(QPainter::CompositionMode_SourceIn);
shadow_painter.fillRect(shadow_pixmap.rect(), Qt::black);
shadow_painter.end();
QPainter painter(&output);
painter.setOpacity(0.10);
painter.drawPixmap(0, 0, shadow_pixmap);
painter.setOpacity(1.0);
painter.drawPixmap(0, 0, avatar);
painter.end();
return output;
}
void ConfigureProfileManagerAvatarDialog::RefreshAvatars() {
if (avatar_list->count() != avatar_image_store.size()) {
return;
}
for (int i = 0; i < avatar_image_store.size(); ++i) {
const auto icon =
QIcon(CreateAvatar(avatar_image_store[i])
.scaled(64, 64, Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
avatar_list->item(i)->setIcon(icon);
}
}
void ConfigureProfileManagerAvatarDialog::LoadImages(const QVector<QPixmap>& avatar_images) {
avatar_image_store = avatar_images;
avatar_list->clear();
for (int i = 0; i < avatar_image_store.size(); ++i) {
avatar_list->addItem(new QListWidgetItem);
}
RefreshAvatars();
// Determine window size now that avatars are loaded into the grid
// There is probably a better way to handle this that I'm unaware of
const auto* style = avatar_list->style();
const int icon_size = avatar_list->iconSize().width();
const int icon_spacing = avatar_list->spacing() * 2;
const int icon_margin = style->pixelMetric(QStyle::PM_FocusFrameHMargin);
const int icon_full_size = icon_size + icon_spacing + icon_margin;
const int horizontal_margin = style->pixelMetric(QStyle::PM_LayoutLeftMargin) +
style->pixelMetric(QStyle::PM_LayoutRightMargin) +
style->pixelMetric(QStyle::PM_ScrollBarExtent);
const int vertical_margin = style->pixelMetric(QStyle::PM_LayoutTopMargin) +
style->pixelMetric(QStyle::PM_LayoutBottomMargin);
// Set default list size so that it is 6 icons wide and 4.5 tall
const int columns = 6;
const double rows = 4.5;
const int total_width = icon_full_size * columns + horizontal_margin;
const int total_height = icon_full_size * rows + vertical_margin;
avatar_list->setMinimumSize(total_width, total_height);
}
bool ConfigureProfileManagerAvatarDialog::AreImagesLoaded() const {
return !avatar_image_store.isEmpty();
}
QPixmap ConfigureProfileManagerAvatarDialog::GetSelectedAvatar() {
return CreateAvatar(avatar_image_store[avatar_list->currentRow()]);
}
ConfigureProfileManagerDeleteDialog::ConfigureProfileManagerDeleteDialog(QWidget* parent)
: QDialog{parent} {
auto dialog_vbox_layout = new QVBoxLayout(this);
@@ -370,3 +583,75 @@ void ConfigureProfileManagerDeleteDialog::SetInfo(const QString& username, const
accept_callback();
});
}
std::vector<uint8_t> ConfigureProfileManager::DecompressYaz0(const FileSys::VirtualFile& file) {
if (!file) {
throw std::invalid_argument("Null file pointer passed to DecompressYaz0");
}
uint32_t magic{};
file->ReadObject(&magic, 0);
if (magic != Common::MakeMagic('Y', 'a', 'z', '0')) {
return std::vector<uint8_t>();
}
uint32_t decoded_length{};
file->ReadObject(&decoded_length, 4);
decoded_length = Common::swap32(decoded_length);
std::size_t input_size = file->GetSize() - 16;
std::vector<uint8_t> input(input_size);
file->ReadBytes(input.data(), input_size, 16);
uint32_t input_offset{};
uint32_t output_offset{};
std::vector<uint8_t> output(decoded_length);
uint16_t mask{};
uint8_t header{};
while (output_offset < decoded_length) {
if ((mask >>= 1) == 0) {
header = input[input_offset++];
mask = 0x80;
}
if ((header & mask) != 0) {
if (output_offset == output.size()) {
break;
}
output[output_offset++] = input[input_offset++];
} else {
uint8_t byte1 = input[input_offset++];
uint8_t byte2 = input[input_offset++];
uint32_t dist = ((byte1 & 0xF) << 8) | byte2;
uint32_t position = output_offset - (dist + 1);
uint32_t length = byte1 >> 4;
if (length == 0) {
length = static_cast<uint32_t>(input[input_offset++]) + 0x12;
} else {
length += 2;
}
uint32_t gap = output_offset - position;
uint32_t non_overlapping_length = length;
if (non_overlapping_length > gap) {
non_overlapping_length = gap;
}
std::memcpy(&output[output_offset], &output[position], non_overlapping_length);
output_offset += non_overlapping_length;
position += non_overlapping_length;
length -= non_overlapping_length;
while (length-- > 0) {
output[output_offset++] = output[position++];
}
}
}
return output;
}

View File

@@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: 2016 Citra Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
@@ -25,6 +28,7 @@ class QStandardItem;
class QStandardItemModel;
class QTreeView;
class QVBoxLayout;
class QListWidget;
namespace Service::Account {
class ProfileManager;
@@ -34,6 +38,26 @@ namespace Ui {
class ConfigureProfileManager;
}
class ConfigureProfileManagerAvatarDialog : public QDialog {
public:
explicit ConfigureProfileManagerAvatarDialog(QWidget* parent);
~ConfigureProfileManagerAvatarDialog();
void LoadImages(const QVector<QPixmap>& avatar_images);
bool AreImagesLoaded() const;
QPixmap GetSelectedAvatar();
private:
void SetBackgroundColor(const QColor& color);
QPixmap CreateAvatar(const QPixmap& avatar);
void RefreshAvatars();
QVector<QPixmap> avatar_image_store;
QListWidget* avatar_list;
QColor avatar_bg_color;
QPushButton* bg_color_button;
};
class ConfigureProfileManagerDeleteDialog : public QDialog {
public:
explicit ConfigureProfileManagerDeleteDialog(QWidget* parent);
@@ -71,13 +95,18 @@ private:
void RenameUser();
void ConfirmDeleteUser();
void DeleteUser(const Common::UUID& uuid);
void SetUserImage();
void SetUserImage(const QImage& image);
void SelectImageFile();
void SelectFirmwareAvatar();
bool LoadAvatarData();
std::vector<uint8_t> DecompressYaz0(const FileSys::VirtualFile& file);
QVBoxLayout* layout;
QTreeView* tree_view;
QStandardItemModel* item_model;
QGraphicsScene* scene;
ConfigureProfileManagerAvatarDialog* avatar_dialog;
ConfigureProfileManagerDeleteDialog* confirm_dialog;
std::vector<QList<QStandardItem*>> list_items;

View File

@@ -117,6 +117,16 @@
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pm_select_avatar">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Select Avatar</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
@@ -176,6 +186,6 @@
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
<resources />
<connections />
</ui>

View File

@@ -371,40 +371,6 @@ GameList::GameList(FileSys::VirtualFilesystem vfs_, FileSys::ManualContentProvid
layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing(0);
warning_layout = new QHBoxLayout;
pre_alpha_warning = new QLabel;
pre_alpha_warning->setText(
tr("IMPORTANT: Eden is PRE-ALPHA SOFTWARE. "
"Bugs and unfinished features are expected to be present at this stage."));
pre_alpha_warning->setWordWrap(true);
pre_alpha_warning->setOpenExternalLinks(true);
pre_alpha_warning->setStyleSheet(
QString::fromStdString("color: black; font-weight: bold;"));
warning_dont_show_again = new QPushButton(this);
warning_dont_show_again->setStyleSheet(
QString::fromStdString("color: #DFDFDF; background-color: #383838;"));
warning_dont_show_again->setText(tr("Don't Show Again"));
connect(warning_dont_show_again, &QPushButton::clicked, this, [=, this] {
Settings::values.hide_pre_alpha_warning.SetValue(true);
layout->removeWidget(warning_widget);
warning_widget->hide();
});
warning_layout->addWidget(pre_alpha_warning, 1);
warning_layout->addWidget(warning_dont_show_again);
warning_layout->setContentsMargins(3, 3, 3, 3);
warning_widget = new QWidget;
warning_widget->setStyleSheet(QString::fromStdString("background-color: khaki;"));
warning_widget->setLayout(warning_layout);
if (!Settings::values.hide_pre_alpha_warning.GetValue()) {
layout->addWidget(warning_widget);
} else {
warning_widget->hide();
}
layout->addWidget(tree_view);
layout->addWidget(search_field);
setLayout(layout);

View File

@@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: 2015 Citra Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
@@ -176,11 +179,6 @@ private:
ControllerNavigation* controller_navigation = nullptr;
CompatibilityList compatibility_list;
QHBoxLayout* warning_layout = nullptr;
QWidget* warning_widget = nullptr;
QPushButton* warning_dont_show_again = nullptr;
QLabel* pre_alpha_warning = nullptr;
friend class GameListSearchField;
const PlayTime::PlayTimeManager& play_time_manager;

View File

@@ -2407,6 +2407,7 @@ void GMainWindow::OnGameListOpenFolder(u64 program_id, GameListOpenTarget target
ASSERT_MSG(has_user_save != has_device_save, "Game uses both user and device savedata?");
// TODO(alekpop): It returns the wrong user
switch (target) {
case GameListOpenTarget::SaveData: {
open_target = tr("Save Data");