Compare commits
30 Commits
android-12
...
android-12
Author | SHA1 | Date | |
---|---|---|---|
8ff48c3261 | |||
dfbc22c291 | |||
a5a3167eba | |||
a423e0f9e0 | |||
511c1f0c8b | |||
8369fcd71a | |||
626916e9a4 | |||
507f360a81 | |||
5323d9f6b3 | |||
770d4b0b72 | |||
e5fed31009 | |||
f07484bc64 | |||
78b9956a04 | |||
90aa937593 | |||
940618a64d | |||
409fa5dda2 | |||
211b67668d | |||
f0cd02b9bd | |||
34101d8c5e | |||
bf8d7bc0da | |||
036d2686af | |||
a80e0e7da5 | |||
9631dedea9 | |||
75de0cadcf | |||
4b321c003c | |||
0a83047368 | |||
9bb8ac7cb6 | |||
a294beb116 | |||
6a7123826a | |||
ca75c58f43 |
5
.git-blame-ignore-revs
Normal file
5
.git-blame-ignore-revs
Normal file
@ -0,0 +1,5 @@
|
||||
# SPDX-FileCopyrightText: 2023 yuzu Emulator Project
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# CRLF -> LF
|
||||
90aa937593e53a5d5e070fb623b228578b0b225f
|
@ -252,7 +252,7 @@ object NativeLibrary {
|
||||
|
||||
external fun reloadKeys(): Boolean
|
||||
|
||||
external fun initializeSystem()
|
||||
external fun initializeSystem(reload: Boolean)
|
||||
|
||||
external fun defaultCPUCore(): Int
|
||||
|
||||
|
@ -11,6 +11,7 @@ import java.io.File
|
||||
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
|
||||
|
||||
fun Context.getPublicFilesDir(): File = getExternalFilesDir(null) ?: filesDir
|
||||
|
||||
@ -49,6 +50,7 @@ class YuzuApplication : Application() {
|
||||
DirectoryInitialization.start()
|
||||
GpuDriverHelper.initializeDriverParameters()
|
||||
NativeLibrary.logDeviceInfo()
|
||||
Log.logDeviceInfo()
|
||||
|
||||
createNotificationChannels()
|
||||
}
|
||||
|
@ -107,7 +107,7 @@ class EmulationActivity : AppCompatActivity(), SensorEventListener {
|
||||
|
||||
val preferences = PreferenceManager.getDefaultSharedPreferences(YuzuApplication.appContext)
|
||||
if (!preferences.getBoolean(Settings.PREF_MEMORY_WARNING_SHOWN, false)) {
|
||||
if (MemoryUtil.isLessThan(MemoryUtil.REQUIRED_MEMORY, MemoryUtil.Gb)) {
|
||||
if (MemoryUtil.isLessThan(MemoryUtil.REQUIRED_MEMORY, MemoryUtil.totalMemory)) {
|
||||
Toast.makeText(
|
||||
this,
|
||||
getString(
|
||||
|
@ -403,7 +403,7 @@ class MainActivity : AppCompatActivity(), ThemeProvider {
|
||||
} else {
|
||||
firmwarePath.deleteRecursively()
|
||||
cacheFirmwareDir.copyRecursively(firmwarePath, true)
|
||||
NativeLibrary.initializeSystem()
|
||||
NativeLibrary.initializeSystem(true)
|
||||
getString(R.string.save_file_imported_success)
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
@ -649,7 +649,7 @@ class MainActivity : AppCompatActivity(), ThemeProvider {
|
||||
}
|
||||
|
||||
// Reinitialize relevant data
|
||||
NativeLibrary.initializeSystem()
|
||||
NativeLibrary.initializeSystem(true)
|
||||
gamesViewModel.reloadGames(false)
|
||||
|
||||
return@newInstance getString(R.string.user_data_import_success)
|
||||
|
@ -15,7 +15,7 @@ object DirectoryInitialization {
|
||||
fun start() {
|
||||
if (!areDirectoriesReady) {
|
||||
initializeInternalStorage()
|
||||
NativeLibrary.initializeSystem()
|
||||
NativeLibrary.initializeSystem(false)
|
||||
areDirectoriesReady = true
|
||||
}
|
||||
}
|
||||
|
@ -3,6 +3,8 @@
|
||||
|
||||
package org.yuzu.yuzu_emu.utils
|
||||
|
||||
import android.os.Build
|
||||
|
||||
object Log {
|
||||
// Tracks whether we should share the old log or the current log
|
||||
var gameLaunched = false
|
||||
@ -16,4 +18,14 @@ object Log {
|
||||
external fun error(message: String)
|
||||
|
||||
external fun critical(message: String)
|
||||
|
||||
fun logDeviceInfo() {
|
||||
info("Device Manufacturer - ${Build.MANUFACTURER}")
|
||||
info("Device Model - ${Build.MODEL}")
|
||||
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.R) {
|
||||
info("SoC Manufacturer - ${Build.SOC_MANUFACTURER}")
|
||||
info("SoC Model - ${Build.SOC_MODEL}")
|
||||
}
|
||||
info("Total System Memory - ${MemoryUtil.getDeviceRAM()}")
|
||||
}
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ object MemoryUtil {
|
||||
const val Pb = Tb * 1024
|
||||
const val Eb = Pb * 1024
|
||||
|
||||
private fun bytesToSizeUnit(size: Float): String =
|
||||
private fun bytesToSizeUnit(size: Float, roundUp: Boolean = false): String =
|
||||
when {
|
||||
size < Kb -> {
|
||||
context.getString(
|
||||
@ -39,63 +39,59 @@ object MemoryUtil {
|
||||
size < Mb -> {
|
||||
context.getString(
|
||||
R.string.memory_formatted,
|
||||
(size / Kb).hundredths,
|
||||
if (roundUp) ceil(size / Kb) else (size / Kb).hundredths,
|
||||
context.getString(R.string.memory_kilobyte)
|
||||
)
|
||||
}
|
||||
size < Gb -> {
|
||||
context.getString(
|
||||
R.string.memory_formatted,
|
||||
(size / Mb).hundredths,
|
||||
if (roundUp) ceil(size / Mb) else (size / Mb).hundredths,
|
||||
context.getString(R.string.memory_megabyte)
|
||||
)
|
||||
}
|
||||
size < Tb -> {
|
||||
context.getString(
|
||||
R.string.memory_formatted,
|
||||
(size / Gb).hundredths,
|
||||
if (roundUp) ceil(size / Gb) else (size / Gb).hundredths,
|
||||
context.getString(R.string.memory_gigabyte)
|
||||
)
|
||||
}
|
||||
size < Pb -> {
|
||||
context.getString(
|
||||
R.string.memory_formatted,
|
||||
(size / Tb).hundredths,
|
||||
if (roundUp) ceil(size / Tb) else (size / Tb).hundredths,
|
||||
context.getString(R.string.memory_terabyte)
|
||||
)
|
||||
}
|
||||
size < Eb -> {
|
||||
context.getString(
|
||||
R.string.memory_formatted,
|
||||
(size / Pb).hundredths,
|
||||
if (roundUp) ceil(size / Pb) else (size / Pb).hundredths,
|
||||
context.getString(R.string.memory_petabyte)
|
||||
)
|
||||
}
|
||||
else -> {
|
||||
context.getString(
|
||||
R.string.memory_formatted,
|
||||
(size / Eb).hundredths,
|
||||
if (roundUp) ceil(size / Eb) else (size / Eb).hundredths,
|
||||
context.getString(R.string.memory_exabyte)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
// Devices are unlikely to have 0.5GB increments of memory so we'll just round up to account for
|
||||
// the potential error created by memInfo.totalMem
|
||||
private val totalMemory: Float
|
||||
val totalMemory: Float
|
||||
get() {
|
||||
val memInfo = ActivityManager.MemoryInfo()
|
||||
with(context.getSystemService(Context.ACTIVITY_SERVICE) as ActivityManager) {
|
||||
getMemoryInfo(memInfo)
|
||||
}
|
||||
|
||||
return ceil(
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
|
||||
memInfo.advertisedMem.toFloat()
|
||||
} else {
|
||||
memInfo.totalMem.toFloat()
|
||||
}
|
||||
)
|
||||
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
|
||||
memInfo.advertisedMem.toFloat()
|
||||
} else {
|
||||
memInfo.totalMem.toFloat()
|
||||
}
|
||||
}
|
||||
|
||||
fun isLessThan(minimum: Int, size: Float): Boolean =
|
||||
@ -109,5 +105,7 @@ object MemoryUtil {
|
||||
else -> totalMemory < Kb && totalMemory < minimum
|
||||
}
|
||||
|
||||
fun getDeviceRAM(): String = bytesToSizeUnit(totalMemory)
|
||||
// Devices are unlikely to have 0.5GB increments of memory so we'll just round up to account for
|
||||
// the potential error created by memInfo.totalMem
|
||||
fun getDeviceRAM(): String = bytesToSizeUnit(totalMemory, true)
|
||||
}
|
||||
|
@ -247,11 +247,13 @@ void EmulationSession::ConfigureFilesystemProvider(const std::string& filepath)
|
||||
}
|
||||
}
|
||||
|
||||
void EmulationSession::InitializeSystem() {
|
||||
// Initialize logging system
|
||||
Common::Log::Initialize();
|
||||
Common::Log::SetColorConsoleBackendEnabled(true);
|
||||
Common::Log::Start();
|
||||
void EmulationSession::InitializeSystem(bool reload) {
|
||||
if (!reload) {
|
||||
// Initialize logging system
|
||||
Common::Log::Initialize();
|
||||
Common::Log::SetColorConsoleBackendEnabled(true);
|
||||
Common::Log::Start();
|
||||
}
|
||||
|
||||
// Initialize filesystem.
|
||||
m_system.SetFilesystem(m_vfs);
|
||||
@ -667,12 +669,15 @@ void Java_org_yuzu_yuzu_1emu_NativeLibrary_onTouchReleased(JNIEnv* env, jclass c
|
||||
}
|
||||
}
|
||||
|
||||
void Java_org_yuzu_yuzu_1emu_NativeLibrary_initializeSystem(JNIEnv* env, jclass clazz) {
|
||||
void Java_org_yuzu_yuzu_1emu_NativeLibrary_initializeSystem(JNIEnv* env, jclass clazz,
|
||||
jboolean reload) {
|
||||
// Create the default config.ini.
|
||||
Config{};
|
||||
// Initialize the emulated system.
|
||||
EmulationSession::GetInstance().System().Initialize();
|
||||
EmulationSession::GetInstance().InitializeSystem();
|
||||
if (!reload) {
|
||||
EmulationSession::GetInstance().System().Initialize();
|
||||
}
|
||||
EmulationSession::GetInstance().InitializeSystem(reload);
|
||||
}
|
||||
|
||||
jint Java_org_yuzu_yuzu_1emu_NativeLibrary_defaultCPUCore(JNIEnv* env, jclass clazz) {
|
||||
|
@ -43,7 +43,7 @@ public:
|
||||
|
||||
const Core::PerfStatsResults& PerfStats() const;
|
||||
void ConfigureFilesystemProvider(const std::string& filepath);
|
||||
void InitializeSystem();
|
||||
void InitializeSystem(bool reload);
|
||||
Core::SystemResultStatus InitializeEmulation(const std::string& filepath);
|
||||
|
||||
bool IsHandheldOnly();
|
||||
|
@ -30,9 +30,9 @@ bool IsValidMultiStreamChannelCount(u32 channel_count) {
|
||||
return channel_count <= OpusStreamCountMax;
|
||||
}
|
||||
|
||||
bool IsValidMultiStreamStreamCounts(s32 total_stream_count, s32 sterero_stream_count) {
|
||||
bool IsValidMultiStreamStreamCounts(s32 total_stream_count, s32 stereo_stream_count) {
|
||||
return IsValidMultiStreamChannelCount(total_stream_count) && total_stream_count > 0 &&
|
||||
sterero_stream_count > 0 && sterero_stream_count <= total_stream_count;
|
||||
stereo_stream_count >= 0 && stereo_stream_count <= total_stream_count;
|
||||
}
|
||||
} // namespace
|
||||
|
||||
|
@ -24,7 +24,7 @@ bool IsValidSampleRate(u32 sample_rate) {
|
||||
}
|
||||
|
||||
bool IsValidStreamCount(u32 channel_count, u32 total_stream_count, u32 stereo_stream_count) {
|
||||
return total_stream_count > 0 && stereo_stream_count > 0 &&
|
||||
return total_stream_count > 0 && static_cast<s32>(stereo_stream_count) >= 0 &&
|
||||
stereo_stream_count <= total_stream_count &&
|
||||
total_stream_count + stereo_stream_count <= channel_count;
|
||||
}
|
||||
|
@ -1,6 +1,9 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#ifdef ANDROID
|
||||
#include <sys/system_properties.h>
|
||||
#endif
|
||||
#include "common/arm64/native_clock.h"
|
||||
|
||||
namespace Common::Arm64 {
|
||||
@ -65,7 +68,23 @@ bool NativeClock::IsNative() const {
|
||||
|
||||
u64 NativeClock::GetHostCNTFRQ() {
|
||||
u64 cntfrq_el0 = 0;
|
||||
asm("mrs %[cntfrq_el0], cntfrq_el0" : [cntfrq_el0] "=r"(cntfrq_el0));
|
||||
std::string_view board{""};
|
||||
#ifdef ANDROID
|
||||
char buffer[PROP_VALUE_MAX];
|
||||
int len{__system_property_get("ro.product.board", buffer)};
|
||||
board = std::string_view(buffer, static_cast<size_t>(len));
|
||||
#endif
|
||||
if (board == "s5e9925") { // Exynos 2200
|
||||
cntfrq_el0 = 25600000;
|
||||
} else if (board == "exynos2100") { // Exynos 2100
|
||||
cntfrq_el0 = 26000000;
|
||||
} else if (board == "exynos9810") { // Exynos 9810
|
||||
cntfrq_el0 = 26000000;
|
||||
} else if (board == "s5e8825") { // Exynos 1280
|
||||
cntfrq_el0 = 26000000;
|
||||
} else {
|
||||
asm("mrs %[cntfrq_el0], cntfrq_el0" : [cntfrq_el0] "=r"(cntfrq_el0));
|
||||
}
|
||||
return cntfrq_el0;
|
||||
}
|
||||
|
||||
|
@ -96,18 +96,7 @@ void EmulatedController::ReloadFromSettings() {
|
||||
}
|
||||
|
||||
controller.color_values = {};
|
||||
controller.colors_state.fullkey = {
|
||||
.body = GetNpadColor(player.body_color_left),
|
||||
.button = GetNpadColor(player.button_color_left),
|
||||
};
|
||||
controller.colors_state.left = {
|
||||
.body = GetNpadColor(player.body_color_left),
|
||||
.button = GetNpadColor(player.button_color_left),
|
||||
};
|
||||
controller.colors_state.right = {
|
||||
.body = GetNpadColor(player.body_color_right),
|
||||
.button = GetNpadColor(player.button_color_right),
|
||||
};
|
||||
ReloadColorsFromSettings();
|
||||
|
||||
ring_params[0] = Common::ParamPackage(Settings::values.ringcon_analogs);
|
||||
|
||||
@ -128,6 +117,30 @@ void EmulatedController::ReloadFromSettings() {
|
||||
ReloadInput();
|
||||
}
|
||||
|
||||
void EmulatedController::ReloadColorsFromSettings() {
|
||||
const auto player_index = NpadIdTypeToIndex(npad_id_type);
|
||||
const auto& player = Settings::values.players.GetValue()[player_index];
|
||||
|
||||
// Avoid updating colors if overridden by physical controller
|
||||
if (controller.color_values[LeftIndex].body != 0 &&
|
||||
controller.color_values[RightIndex].body != 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
controller.colors_state.fullkey = {
|
||||
.body = GetNpadColor(player.body_color_left),
|
||||
.button = GetNpadColor(player.button_color_left),
|
||||
};
|
||||
controller.colors_state.left = {
|
||||
.body = GetNpadColor(player.body_color_left),
|
||||
.button = GetNpadColor(player.button_color_left),
|
||||
};
|
||||
controller.colors_state.right = {
|
||||
.body = GetNpadColor(player.body_color_right),
|
||||
.button = GetNpadColor(player.button_color_right),
|
||||
};
|
||||
}
|
||||
|
||||
void EmulatedController::LoadDevices() {
|
||||
// TODO(german77): Use more buttons to detect the correct device
|
||||
const auto left_joycon = button_params[Settings::NativeButton::DRight];
|
||||
|
@ -253,6 +253,9 @@ public:
|
||||
/// Overrides current mapped devices with the stored configuration and reloads all input devices
|
||||
void ReloadFromSettings();
|
||||
|
||||
/// Updates current colors with the ones stored in the configuration
|
||||
void ReloadColorsFromSettings();
|
||||
|
||||
/// Saves the current mapped configuration
|
||||
void SaveCurrentConfig();
|
||||
|
||||
|
@ -3,11 +3,13 @@
|
||||
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
|
||||
#include "common/common_types.h"
|
||||
#include "common/fs/file.h"
|
||||
#include "common/fs/path_util.h"
|
||||
#include "common/logging/log.h"
|
||||
#include "common/polyfill_ranges.h"
|
||||
#include "common/stb.h"
|
||||
#include "common/string_util.h"
|
||||
#include "common/swap.h"
|
||||
#include "core/constants.h"
|
||||
@ -38,9 +40,36 @@ static std::filesystem::path GetImagePath(const Common::UUID& uuid) {
|
||||
fmt::format("system/save/8000000000000010/su/avators/{}.jpg", uuid.FormattedString());
|
||||
}
|
||||
|
||||
static constexpr u32 SanitizeJPEGSize(std::size_t size) {
|
||||
static void JPGToMemory(void* context, void* data, int len) {
|
||||
std::vector<u8>* jpg_image = static_cast<std::vector<u8>*>(context);
|
||||
unsigned char* jpg = static_cast<unsigned char*>(data);
|
||||
jpg_image->insert(jpg_image->end(), jpg, jpg + len);
|
||||
}
|
||||
|
||||
static void SanitizeJPEGImageSize(std::vector<u8>& image) {
|
||||
constexpr std::size_t max_jpeg_image_size = 0x20000;
|
||||
return static_cast<u32>(std::min(size, max_jpeg_image_size));
|
||||
constexpr int profile_dimensions = 256;
|
||||
int original_width, original_height, color_channels;
|
||||
|
||||
const auto plain_image =
|
||||
stbi_load_from_memory(image.data(), static_cast<int>(image.size()), &original_width,
|
||||
&original_height, &color_channels, STBI_rgb);
|
||||
|
||||
// Resize image to match 256*256
|
||||
if (original_width != profile_dimensions || original_height != profile_dimensions) {
|
||||
// Use vector instead of array to avoid overflowing the stack
|
||||
std::vector<u8> out_image(profile_dimensions * profile_dimensions * STBI_rgb);
|
||||
stbir_resize_uint8_srgb(plain_image, original_width, original_height, 0, out_image.data(),
|
||||
profile_dimensions, profile_dimensions, 0, STBI_rgb, 0,
|
||||
STBIR_FILTER_BOX);
|
||||
image.clear();
|
||||
if (!stbi_write_jpg_to_func(JPGToMemory, &image, profile_dimensions, profile_dimensions,
|
||||
STBI_rgb, out_image.data(), 0)) {
|
||||
LOG_ERROR(Service_ACC, "Failed to resize the user provided image.");
|
||||
}
|
||||
}
|
||||
|
||||
image.resize(std::min(image.size(), max_jpeg_image_size));
|
||||
}
|
||||
|
||||
class IManagerForSystemService final : public ServiceFramework<IManagerForSystemService> {
|
||||
@ -339,19 +368,20 @@ protected:
|
||||
LOG_WARNING(Service_ACC,
|
||||
"Failed to load user provided image! Falling back to built-in backup...");
|
||||
ctx.WriteBuffer(Core::Constants::ACCOUNT_BACKUP_JPEG);
|
||||
rb.Push(SanitizeJPEGSize(Core::Constants::ACCOUNT_BACKUP_JPEG.size()));
|
||||
rb.Push(static_cast<u32>(Core::Constants::ACCOUNT_BACKUP_JPEG.size()));
|
||||
return;
|
||||
}
|
||||
|
||||
const u32 size = SanitizeJPEGSize(image.GetSize());
|
||||
std::vector<u8> buffer(size);
|
||||
std::vector<u8> buffer(image.GetSize());
|
||||
|
||||
if (image.Read(buffer) != buffer.size()) {
|
||||
LOG_ERROR(Service_ACC, "Failed to read all the bytes in the user provided image.");
|
||||
}
|
||||
|
||||
SanitizeJPEGImageSize(buffer);
|
||||
|
||||
ctx.WriteBuffer(buffer);
|
||||
rb.Push<u32>(size);
|
||||
rb.Push(static_cast<u32>(buffer.size()));
|
||||
}
|
||||
|
||||
void GetImageSize(HLERequestContext& ctx) {
|
||||
@ -365,10 +395,18 @@ protected:
|
||||
if (!image.IsOpen()) {
|
||||
LOG_WARNING(Service_ACC,
|
||||
"Failed to load user provided image! Falling back to built-in backup...");
|
||||
rb.Push(SanitizeJPEGSize(Core::Constants::ACCOUNT_BACKUP_JPEG.size()));
|
||||
} else {
|
||||
rb.Push(SanitizeJPEGSize(image.GetSize()));
|
||||
rb.Push(static_cast<u32>(Core::Constants::ACCOUNT_BACKUP_JPEG.size()));
|
||||
return;
|
||||
}
|
||||
|
||||
std::vector<u8> buffer(image.GetSize());
|
||||
|
||||
if (image.Read(buffer) != buffer.size()) {
|
||||
LOG_ERROR(Service_ACC, "Failed to read all the bytes in the user provided image.");
|
||||
}
|
||||
|
||||
SanitizeJPEGImageSize(buffer);
|
||||
rb.Push(static_cast<u32>(buffer.size()));
|
||||
}
|
||||
|
||||
void Store(HLERequestContext& ctx) {
|
||||
|
@ -69,6 +69,30 @@ enum class AppletId : u32 {
|
||||
MyPage = 0x1A,
|
||||
};
|
||||
|
||||
enum class AppletProgramId : u64 {
|
||||
QLaunch = 0x0100000000001000ull,
|
||||
Auth = 0x0100000000001001ull,
|
||||
Cabinet = 0x0100000000001002ull,
|
||||
Controller = 0x0100000000001003ull,
|
||||
DataErase = 0x0100000000001004ull,
|
||||
Error = 0x0100000000001005ull,
|
||||
NetConnect = 0x0100000000001006ull,
|
||||
ProfileSelect = 0x0100000000001007ull,
|
||||
SoftwareKeyboard = 0x0100000000001008ull,
|
||||
MiiEdit = 0x0100000000001009ull,
|
||||
Web = 0x010000000000100Aull,
|
||||
Shop = 0x010000000000100Bull,
|
||||
OverlayDisplay = 0x010000000000100Cull,
|
||||
PhotoViewer = 0x010000000000100Dull,
|
||||
Settings = 0x010000000000100Eull,
|
||||
OfflineWeb = 0x010000000000100Full,
|
||||
LoginShare = 0x0100000000001010ull,
|
||||
WebAuth = 0x0100000000001011ull,
|
||||
Starter = 0x0100000000001012ull,
|
||||
MyPage = 0x0100000000001013ull,
|
||||
MaxProgramId = 0x0100000000001FFFull,
|
||||
};
|
||||
|
||||
enum class LibraryAppletMode : u32 {
|
||||
AllForeground = 0,
|
||||
Background = 1,
|
||||
|
@ -1353,7 +1353,7 @@ void Hid::IsUnintendedHomeButtonInputProtectionEnabled(HLERequestContext& ctx) {
|
||||
void Hid::EnableUnintendedHomeButtonInputProtection(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
struct Parameters {
|
||||
bool unintended_home_button_input_protection;
|
||||
bool is_enabled;
|
||||
INSERT_PADDING_BYTES_NOINIT(3);
|
||||
Core::HID::NpadIdType npad_id;
|
||||
u64 applet_resource_user_id;
|
||||
@ -1364,13 +1364,11 @@ void Hid::EnableUnintendedHomeButtonInputProtection(HLERequestContext& ctx) {
|
||||
|
||||
auto& controller = GetAppletResource()->GetController<Controller_NPad>(HidController::NPad);
|
||||
const auto result = controller.SetUnintendedHomeButtonInputProtectionEnabled(
|
||||
parameters.unintended_home_button_input_protection, parameters.npad_id);
|
||||
parameters.is_enabled, parameters.npad_id);
|
||||
|
||||
LOG_WARNING(Service_HID,
|
||||
"(STUBBED) called, unintended_home_button_input_protection={}, npad_id={},"
|
||||
"applet_resource_user_id={}",
|
||||
parameters.unintended_home_button_input_protection, parameters.npad_id,
|
||||
parameters.applet_resource_user_id);
|
||||
LOG_DEBUG(Service_HID,
|
||||
"(STUBBED) called, is_enabled={}, npad_id={}, applet_resource_user_id={}",
|
||||
parameters.is_enabled, parameters.npad_id, parameters.applet_resource_user_id);
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(result);
|
||||
|
@ -39,6 +39,18 @@ bool IsConnectionBased(Type type) {
|
||||
}
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T GetValue(std::span<const u8> buffer) {
|
||||
T t{};
|
||||
std::memcpy(&t, buffer.data(), std::min(sizeof(T), buffer.size()));
|
||||
return t;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void PutValue(std::span<u8> buffer, const T& t) {
|
||||
std::memcpy(buffer.data(), &t, std::min(sizeof(T), buffer.size()));
|
||||
}
|
||||
|
||||
} // Anonymous namespace
|
||||
|
||||
void BSD::PollWork::Execute(BSD* bsd) {
|
||||
@ -316,22 +328,12 @@ void BSD::SetSockOpt(HLERequestContext& ctx) {
|
||||
const s32 fd = rp.Pop<s32>();
|
||||
const u32 level = rp.Pop<u32>();
|
||||
const OptName optname = static_cast<OptName>(rp.Pop<u32>());
|
||||
|
||||
const auto buffer = ctx.ReadBuffer();
|
||||
const u8* optval = buffer.empty() ? nullptr : buffer.data();
|
||||
size_t optlen = buffer.size();
|
||||
|
||||
std::array<u64, 2> values;
|
||||
if ((optname == OptName::SNDTIMEO || optname == OptName::RCVTIMEO) && buffer.size() == 8) {
|
||||
std::memcpy(values.data(), buffer.data(), sizeof(values));
|
||||
optlen = sizeof(values);
|
||||
optval = reinterpret_cast<const u8*>(values.data());
|
||||
}
|
||||
const auto optval = ctx.ReadBuffer();
|
||||
|
||||
LOG_DEBUG(Service, "called. fd={} level={} optname=0x{:x} optlen={}", fd, level,
|
||||
static_cast<u32>(optname), optlen);
|
||||
static_cast<u32>(optname), optval.size());
|
||||
|
||||
BuildErrnoResponse(ctx, SetSockOptImpl(fd, level, optname, optlen, optval));
|
||||
BuildErrnoResponse(ctx, SetSockOptImpl(fd, level, optname, optval));
|
||||
}
|
||||
|
||||
void BSD::Shutdown(HLERequestContext& ctx) {
|
||||
@ -521,18 +523,19 @@ std::pair<s32, Errno> BSD::SocketImpl(Domain domain, Type type, Protocol protoco
|
||||
|
||||
std::pair<s32, Errno> BSD::PollImpl(std::vector<u8>& write_buffer, std::span<const u8> read_buffer,
|
||||
s32 nfds, s32 timeout) {
|
||||
if (nfds <= 0) {
|
||||
// When no entries are provided, -1 is returned with errno zero
|
||||
return {-1, Errno::SUCCESS};
|
||||
}
|
||||
if (read_buffer.size() < nfds * sizeof(PollFD)) {
|
||||
return {-1, Errno::INVAL};
|
||||
}
|
||||
if (write_buffer.size() < nfds * sizeof(PollFD)) {
|
||||
return {-1, Errno::INVAL};
|
||||
}
|
||||
|
||||
if (nfds == 0) {
|
||||
// When no entries are provided, -1 is returned with errno zero
|
||||
return {-1, Errno::SUCCESS};
|
||||
}
|
||||
|
||||
const size_t length = std::min(read_buffer.size(), write_buffer.size());
|
||||
std::vector<PollFD> fds(nfds);
|
||||
std::memcpy(fds.data(), read_buffer.data(), length);
|
||||
std::memcpy(fds.data(), read_buffer.data(), nfds * sizeof(PollFD));
|
||||
|
||||
if (timeout >= 0) {
|
||||
const s64 seconds = timeout / 1000;
|
||||
@ -580,7 +583,7 @@ std::pair<s32, Errno> BSD::PollImpl(std::vector<u8>& write_buffer, std::span<con
|
||||
for (size_t i = 0; i < num; ++i) {
|
||||
fds[i].revents = Translate(host_pollfds[i].revents);
|
||||
}
|
||||
std::memcpy(write_buffer.data(), fds.data(), length);
|
||||
std::memcpy(write_buffer.data(), fds.data(), nfds * sizeof(PollFD));
|
||||
|
||||
return Translate(result);
|
||||
}
|
||||
@ -608,8 +611,7 @@ std::pair<s32, Errno> BSD::AcceptImpl(s32 fd, std::vector<u8>& write_buffer) {
|
||||
new_descriptor.is_connection_based = descriptor.is_connection_based;
|
||||
|
||||
const SockAddrIn guest_addr_in = Translate(result.sockaddr_in);
|
||||
const size_t length = std::min(sizeof(guest_addr_in), write_buffer.size());
|
||||
std::memcpy(write_buffer.data(), &guest_addr_in, length);
|
||||
PutValue(write_buffer, guest_addr_in);
|
||||
|
||||
return {new_fd, Errno::SUCCESS};
|
||||
}
|
||||
@ -619,8 +621,7 @@ Errno BSD::BindImpl(s32 fd, std::span<const u8> addr) {
|
||||
return Errno::BADF;
|
||||
}
|
||||
ASSERT(addr.size() == sizeof(SockAddrIn));
|
||||
SockAddrIn addr_in;
|
||||
std::memcpy(&addr_in, addr.data(), sizeof(addr_in));
|
||||
auto addr_in = GetValue<SockAddrIn>(addr);
|
||||
|
||||
return Translate(file_descriptors[fd]->socket->Bind(Translate(addr_in)));
|
||||
}
|
||||
@ -631,8 +632,7 @@ Errno BSD::ConnectImpl(s32 fd, std::span<const u8> addr) {
|
||||
}
|
||||
|
||||
UNIMPLEMENTED_IF(addr.size() != sizeof(SockAddrIn));
|
||||
SockAddrIn addr_in;
|
||||
std::memcpy(&addr_in, addr.data(), sizeof(addr_in));
|
||||
auto addr_in = GetValue<SockAddrIn>(addr);
|
||||
|
||||
return Translate(file_descriptors[fd]->socket->Connect(Translate(addr_in)));
|
||||
}
|
||||
@ -650,7 +650,7 @@ Errno BSD::GetPeerNameImpl(s32 fd, std::vector<u8>& write_buffer) {
|
||||
|
||||
ASSERT(write_buffer.size() >= sizeof(guest_addrin));
|
||||
write_buffer.resize(sizeof(guest_addrin));
|
||||
std::memcpy(write_buffer.data(), &guest_addrin, sizeof(guest_addrin));
|
||||
PutValue(write_buffer, guest_addrin);
|
||||
return Translate(bsd_errno);
|
||||
}
|
||||
|
||||
@ -667,7 +667,7 @@ Errno BSD::GetSockNameImpl(s32 fd, std::vector<u8>& write_buffer) {
|
||||
|
||||
ASSERT(write_buffer.size() >= sizeof(guest_addrin));
|
||||
write_buffer.resize(sizeof(guest_addrin));
|
||||
std::memcpy(write_buffer.data(), &guest_addrin, sizeof(guest_addrin));
|
||||
PutValue(write_buffer, guest_addrin);
|
||||
return Translate(bsd_errno);
|
||||
}
|
||||
|
||||
@ -725,7 +725,7 @@ Errno BSD::GetSockOptImpl(s32 fd, u32 level, OptName optname, std::vector<u8>& o
|
||||
optval.size() == sizeof(Errno), { return Errno::INVAL; },
|
||||
"Incorrect getsockopt option size");
|
||||
optval.resize(sizeof(Errno));
|
||||
memcpy(optval.data(), &translated_pending_err, sizeof(Errno));
|
||||
PutValue(optval, translated_pending_err);
|
||||
}
|
||||
return Translate(getsockopt_err);
|
||||
}
|
||||
@ -735,7 +735,7 @@ Errno BSD::GetSockOptImpl(s32 fd, u32 level, OptName optname, std::vector<u8>& o
|
||||
}
|
||||
}
|
||||
|
||||
Errno BSD::SetSockOptImpl(s32 fd, u32 level, OptName optname, size_t optlen, const void* optval) {
|
||||
Errno BSD::SetSockOptImpl(s32 fd, u32 level, OptName optname, std::span<const u8> optval) {
|
||||
if (!IsFileDescriptorValid(fd)) {
|
||||
return Errno::BADF;
|
||||
}
|
||||
@ -748,17 +748,15 @@ Errno BSD::SetSockOptImpl(s32 fd, u32 level, OptName optname, size_t optlen, con
|
||||
Network::SocketBase* const socket = file_descriptors[fd]->socket.get();
|
||||
|
||||
if (optname == OptName::LINGER) {
|
||||
ASSERT(optlen == sizeof(Linger));
|
||||
Linger linger;
|
||||
std::memcpy(&linger, optval, sizeof(linger));
|
||||
ASSERT(optval.size() == sizeof(Linger));
|
||||
auto linger = GetValue<Linger>(optval);
|
||||
ASSERT(linger.onoff == 0 || linger.onoff == 1);
|
||||
|
||||
return Translate(socket->SetLinger(linger.onoff != 0, linger.linger));
|
||||
}
|
||||
|
||||
ASSERT(optlen == sizeof(u32));
|
||||
u32 value;
|
||||
std::memcpy(&value, optval, sizeof(value));
|
||||
ASSERT(optval.size() == sizeof(u32));
|
||||
auto value = GetValue<u32>(optval);
|
||||
|
||||
switch (optname) {
|
||||
case OptName::REUSEADDR:
|
||||
@ -862,7 +860,7 @@ std::pair<s32, Errno> BSD::RecvFromImpl(s32 fd, u32 flags, std::vector<u8>& mess
|
||||
} else {
|
||||
ASSERT(addr.size() == sizeof(SockAddrIn));
|
||||
const SockAddrIn result = Translate(addr_in);
|
||||
std::memcpy(addr.data(), &result, sizeof(result));
|
||||
PutValue(addr, result);
|
||||
}
|
||||
}
|
||||
|
||||
@ -886,8 +884,7 @@ std::pair<s32, Errno> BSD::SendToImpl(s32 fd, u32 flags, std::span<const u8> mes
|
||||
Network::SockAddrIn* p_addr_in = nullptr;
|
||||
if (!addr.empty()) {
|
||||
ASSERT(addr.size() == sizeof(SockAddrIn));
|
||||
SockAddrIn guest_addr_in;
|
||||
std::memcpy(&guest_addr_in, addr.data(), sizeof(guest_addr_in));
|
||||
auto guest_addr_in = GetValue<SockAddrIn>(addr);
|
||||
addr_in = Translate(guest_addr_in);
|
||||
p_addr_in = &addr_in;
|
||||
}
|
||||
|
@ -163,7 +163,7 @@ private:
|
||||
Errno ListenImpl(s32 fd, s32 backlog);
|
||||
std::pair<s32, Errno> FcntlImpl(s32 fd, FcntlCmd cmd, s32 arg);
|
||||
Errno GetSockOptImpl(s32 fd, u32 level, OptName optname, std::vector<u8>& optval);
|
||||
Errno SetSockOptImpl(s32 fd, u32 level, OptName optname, size_t optlen, const void* optval);
|
||||
Errno SetSockOptImpl(s32 fd, u32 level, OptName optname, std::span<const u8> optval);
|
||||
Errno ShutdownImpl(s32 fd, s32 how);
|
||||
std::pair<s32, Errno> RecvImpl(s32 fd, u32 flags, std::vector<u8>& message);
|
||||
std::pair<s32, Errno> RecvFromImpl(s32 fd, u32 flags, std::vector<u8>& message,
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
#include "common/alignment.h"
|
||||
#include "core/memory.h"
|
||||
#include "video_core/control/channel_state.h"
|
||||
#include "video_core/host1x/host1x.h"
|
||||
#include "video_core/memory_manager.h"
|
||||
#include "video_core/renderer_null/null_rasterizer.h"
|
||||
@ -99,8 +100,14 @@ bool RasterizerNull::AccelerateDisplay(const Tegra::FramebufferConfig& config,
|
||||
}
|
||||
void RasterizerNull::LoadDiskResources(u64 title_id, std::stop_token stop_loading,
|
||||
const VideoCore::DiskResourceLoadCallback& callback) {}
|
||||
void RasterizerNull::InitializeChannel(Tegra::Control::ChannelState& channel) {}
|
||||
void RasterizerNull::BindChannel(Tegra::Control::ChannelState& channel) {}
|
||||
void RasterizerNull::ReleaseChannel(s32 channel_id) {}
|
||||
void RasterizerNull::InitializeChannel(Tegra::Control::ChannelState& channel) {
|
||||
CreateChannel(channel);
|
||||
}
|
||||
void RasterizerNull::BindChannel(Tegra::Control::ChannelState& channel) {
|
||||
BindToChannel(channel.bind_id);
|
||||
}
|
||||
void RasterizerNull::ReleaseChannel(s32 channel_id) {
|
||||
EraseChannel(channel_id);
|
||||
}
|
||||
|
||||
} // namespace Null
|
||||
|
@ -82,7 +82,7 @@ VkViewport GetViewportState(const Device& device, const Maxwell& regs, size_t in
|
||||
}
|
||||
|
||||
if (y_negate) {
|
||||
y += height;
|
||||
y += conv(static_cast<f32>(regs.surface_clip.height));
|
||||
height = -height;
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// SPDX-FileCopyrightText: 2014 Citra Emulator Project
|
||||
// SPDX-FileCopyrightText: 2014 Citra Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Text : Copyright 2022 yuzu Emulator Project
|
||||
// Text : Copyright 2022 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
@ -152,7 +152,7 @@ void ConfigureInput::Initialize(InputCommon::InputSubsystem* input_subsystem,
|
||||
connect(player_controllers[0], &ConfigureInputPlayer::HandheldStateChanged,
|
||||
[this](bool is_handheld) { UpdateDockedState(is_handheld); });
|
||||
|
||||
advanced = new ConfigureInputAdvanced(this);
|
||||
advanced = new ConfigureInputAdvanced(hid_core, this);
|
||||
ui->tabAdvanced->setLayout(new QHBoxLayout(ui->tabAdvanced));
|
||||
ui->tabAdvanced->layout()->addWidget(advanced);
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// SPDX-FileCopyrightText: 2016 Citra Emulator Project
|
||||
// SPDX-FileCopyrightText: 2016 Citra Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
@ -4,11 +4,13 @@
|
||||
#include <QColorDialog>
|
||||
#include "common/settings.h"
|
||||
#include "core/core.h"
|
||||
#include "core/hid/emulated_controller.h"
|
||||
#include "core/hid/hid_core.h"
|
||||
#include "ui_configure_input_advanced.h"
|
||||
#include "yuzu/configuration/configure_input_advanced.h"
|
||||
|
||||
ConfigureInputAdvanced::ConfigureInputAdvanced(QWidget* parent)
|
||||
: QWidget(parent), ui(std::make_unique<Ui::ConfigureInputAdvanced>()) {
|
||||
ConfigureInputAdvanced::ConfigureInputAdvanced(Core::HID::HIDCore& hid_core_, QWidget* parent)
|
||||
: QWidget(parent), ui(std::make_unique<Ui::ConfigureInputAdvanced>()), hid_core{hid_core_} {
|
||||
ui->setupUi(this);
|
||||
|
||||
controllers_color_buttons = {{
|
||||
@ -123,6 +125,8 @@ void ConfigureInputAdvanced::ApplyConfiguration() {
|
||||
player.button_color_left = colors[1];
|
||||
player.body_color_right = colors[2];
|
||||
player.button_color_right = colors[3];
|
||||
|
||||
hid_core.GetEmulatedControllerByIndex(player_idx)->ReloadColorsFromSettings();
|
||||
}
|
||||
|
||||
Settings::values.debug_pad_enabled = ui->debug_enabled->isChecked();
|
||||
|
@ -14,11 +14,15 @@ namespace Ui {
|
||||
class ConfigureInputAdvanced;
|
||||
}
|
||||
|
||||
namespace Core::HID {
|
||||
class HIDCore;
|
||||
} // namespace Core::HID
|
||||
|
||||
class ConfigureInputAdvanced : public QWidget {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ConfigureInputAdvanced(QWidget* parent = nullptr);
|
||||
explicit ConfigureInputAdvanced(Core::HID::HIDCore& hid_core_, QWidget* parent = nullptr);
|
||||
~ConfigureInputAdvanced() override;
|
||||
|
||||
void ApplyConfiguration();
|
||||
@ -44,4 +48,6 @@ private:
|
||||
|
||||
std::array<std::array<QColor, 4>, 8> controllers_colors;
|
||||
std::array<std::array<QPushButton*, 4>, 8> controllers_color_buttons;
|
||||
|
||||
Core::HID::HIDCore& hid_core;
|
||||
};
|
||||
|
@ -1,4 +1,4 @@
|
||||
// SPDX-FileCopyrightText: 2016 Citra Emulator Project
|
||||
// SPDX-FileCopyrightText: 2016 Citra Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
@ -1,4 +1,4 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project
|
||||
// SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
@ -306,10 +306,10 @@ void ConfigureProfileManager::SetUserImage() {
|
||||
return;
|
||||
}
|
||||
|
||||
// Some games crash when the profile image is too big. Resize any image bigger than 256x256
|
||||
// Profile image must be 256x256
|
||||
QImage image(image_path);
|
||||
if (image.width() > 256 || image.height() > 256) {
|
||||
image = image.scaled(256, 256, Qt::KeepAspectRatio);
|
||||
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"));
|
||||
|
@ -1,4 +1,4 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project
|
||||
// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
@ -1,4 +1,4 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
|
||||
// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
@ -1,4 +1,4 @@
|
||||
// SPDX-FileCopyrightText: 2016 Citra Emulator Project
|
||||
// SPDX-FileCopyrightText: 2016 Citra Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
@ -156,7 +156,6 @@ std::unique_ptr<TranslationMap> InitializeTranslations(QWidget* parent) {
|
||||
// Ui General
|
||||
INSERT(UISettings, select_user_on_boot, "Prompt for user on game boot", "");
|
||||
INSERT(UISettings, pause_when_in_background, "Pause emulation when in background", "");
|
||||
INSERT(UISettings, confirm_before_closing, "Confirm exit while emulation is running", "");
|
||||
INSERT(UISettings, confirm_before_stopping, "Confirm before stopping emulation", "");
|
||||
INSERT(UISettings, hide_mouse, "Hide mouse on inactivity", "");
|
||||
INSERT(UISettings, controller_applet_disabled, "Disable controller applet", "");
|
||||
|
@ -1908,7 +1908,10 @@ void GMainWindow::ConfigureFilesystemProvider(const std::string& filepath) {
|
||||
void GMainWindow::BootGame(const QString& filename, u64 program_id, std::size_t program_index,
|
||||
StartGameType type, AmLaunchType launch_type) {
|
||||
LOG_INFO(Frontend, "yuzu starting...");
|
||||
StoreRecentFile(filename); // Put the filename on top of the list
|
||||
|
||||
if (program_id > static_cast<u64>(Service::AM::Applets::AppletProgramId::MaxProgramId)) {
|
||||
StoreRecentFile(filename); // Put the filename on top of the list
|
||||
}
|
||||
|
||||
// Save configurations
|
||||
UpdateUISettings();
|
||||
@ -2174,6 +2177,7 @@ void GMainWindow::ShutdownGame() {
|
||||
return;
|
||||
}
|
||||
|
||||
play_time_manager->Stop();
|
||||
OnShutdownBegin();
|
||||
OnEmulationStopTimeExpired();
|
||||
OnEmulationStopped();
|
||||
@ -3484,7 +3488,7 @@ void GMainWindow::OnExecuteProgram(std::size_t program_index) {
|
||||
}
|
||||
|
||||
void GMainWindow::OnExit() {
|
||||
OnStopGame();
|
||||
ShutdownGame();
|
||||
}
|
||||
|
||||
void GMainWindow::OnSaveConfig() {
|
||||
@ -4272,7 +4276,7 @@ void GMainWindow::OnToggleStatusBar() {
|
||||
}
|
||||
|
||||
void GMainWindow::OnAlbum() {
|
||||
constexpr u64 AlbumId = 0x010000000000100Dull;
|
||||
constexpr u64 AlbumId = static_cast<u64>(Service::AM::Applets::AppletProgramId::PhotoViewer);
|
||||
auto bis_system = system->GetFileSystemController().GetSystemNANDContents();
|
||||
if (!bis_system) {
|
||||
QMessageBox::warning(this, tr("No firmware available"),
|
||||
@ -4295,7 +4299,7 @@ void GMainWindow::OnAlbum() {
|
||||
}
|
||||
|
||||
void GMainWindow::OnCabinet(Service::NFP::CabinetMode mode) {
|
||||
constexpr u64 CabinetId = 0x0100000000001002ull;
|
||||
constexpr u64 CabinetId = static_cast<u64>(Service::AM::Applets::AppletProgramId::Cabinet);
|
||||
auto bis_system = system->GetFileSystemController().GetSystemNANDContents();
|
||||
if (!bis_system) {
|
||||
QMessageBox::warning(this, tr("No firmware available"),
|
||||
@ -4319,7 +4323,7 @@ void GMainWindow::OnCabinet(Service::NFP::CabinetMode mode) {
|
||||
}
|
||||
|
||||
void GMainWindow::OnMiiEdit() {
|
||||
constexpr u64 MiiEditId = 0x0100000000001009ull;
|
||||
constexpr u64 MiiEditId = static_cast<u64>(Service::AM::Applets::AppletProgramId::MiiEdit);
|
||||
auto bis_system = system->GetFileSystemController().GetSystemNANDContents();
|
||||
if (!bis_system) {
|
||||
QMessageBox::warning(this, tr("No firmware available"),
|
||||
@ -4847,7 +4851,12 @@ bool GMainWindow::SelectRomFSDumpTarget(const FileSys::ContentProvider& installe
|
||||
}
|
||||
|
||||
bool GMainWindow::ConfirmClose() {
|
||||
if (emu_thread == nullptr || !UISettings::values.confirm_before_closing) {
|
||||
if (emu_thread == nullptr ||
|
||||
UISettings::values.confirm_before_stopping.GetValue() == ConfirmStop::Ask_Never) {
|
||||
return true;
|
||||
}
|
||||
if (!system->GetExitLocked() &&
|
||||
UISettings::values.confirm_before_stopping.GetValue() == ConfirmStop::Ask_Based_On_Game) {
|
||||
return true;
|
||||
}
|
||||
const auto text = tr("Are you sure you want to close yuzu?");
|
||||
@ -4952,7 +4961,7 @@ bool GMainWindow::ConfirmChangeGame() {
|
||||
}
|
||||
|
||||
bool GMainWindow::ConfirmForceLockedExit() {
|
||||
if (emu_thread == nullptr || !UISettings::values.confirm_before_closing) {
|
||||
if (emu_thread == nullptr) {
|
||||
return true;
|
||||
}
|
||||
const auto text = tr("The currently running application has requested yuzu to not exit.\n\n"
|
||||
|
@ -93,10 +93,6 @@ struct Values {
|
||||
Setting<bool> show_filter_bar{linkage, true, "showFilterBar", Category::Ui};
|
||||
Setting<bool> show_status_bar{linkage, true, "showStatusBar", Category::Ui};
|
||||
|
||||
Setting<bool> confirm_before_closing{
|
||||
linkage, true, "confirmClose", Category::UiGeneral, Settings::Specialization::Default,
|
||||
true, true};
|
||||
|
||||
SwitchableSetting<ConfirmStop> confirm_before_stopping{linkage,
|
||||
ConfirmStop::Ask_Always,
|
||||
"confirmStop",
|
||||
|
Reference in New Issue
Block a user