Browse Source

16 bit debug knot set for quick development toggles (kotlin and qt)

pull/3076/head^2
Allison Cunha 3 months ago
parent
commit
a2dd667653
  1. 3
      src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/IntSetting.kt
  2. 10
      src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SettingsItem.kt
  3. 7
      src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsDialogFragment.kt
  4. 3
      src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsFragmentPresenter.kt
  5. 5
      src/android/app/src/main/res/values/strings.xml
  6. 4
      src/common/settings.cpp
  7. 12
      src/common/settings.h
  8. 2
      src/yuzu/configuration/configure_debug.cpp
  9. 6
      src/yuzu/configuration/configure_debug.h
  10. 25
      src/yuzu/configuration/configure_debug.ui

3
src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/IntSetting.kt

@ -61,7 +61,8 @@ enum class IntSetting(override val key: String) : AbstractIntSetting {
LOGIN_SHARE_APPLET("login_share_applet_mode"),
WIFI_WEB_AUTH_APPLET("wifi_web_auth_applet_mode"),
MY_PAGE_APPLET("my_page_applet_mode"),
INPUT_OVERLAY_AUTO_HIDE("input_overlay_auto_hide")
INPUT_OVERLAY_AUTO_HIDE("input_overlay_auto_hide"),
DEBUG_KNOBS("debug_knobs")
;
override fun getInt(needsGlobal: Boolean): Int = NativeConfig.getInt(key, needsGlobal)

10
src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SettingsItem.kt

@ -788,6 +788,16 @@ abstract class SettingsItem(
descriptionId = R.string.use_auto_stub_description
)
)
put(
SpinBoxSetting(
IntSetting.DEBUG_KNOBS,
titleId = R.string.debug_knobs,
descriptionId = R.string.debug_knobs_description,
valueHint = R.string.debug_knobs_hint,
min = 0,
max = 65535
)
)
val fastmem = object : AbstractBooleanSetting {
override fun getBoolean(needsGlobal: Boolean): Boolean =

7
src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsDialogFragment.kt

@ -186,6 +186,12 @@ class SettingsDialogFragment : DialogFragment(), DialogInterface.OnClickListener
updateButtonState(isValid)
}
/*
* xbzk: these two events, along with attachRepeat feature,
* were causing spinbox buttons to respond twice per press
* cutting these out to retain accelerated press functionality
* TODO: clean this out later if no issues arise
*
spinboxBinding.buttonDecrement.setOnClickListener {
val current = spinboxBinding.editValue.text.toString().toIntOrNull() ?: currentValue
val newValue = current - 1
@ -199,6 +205,7 @@ class SettingsDialogFragment : DialogFragment(), DialogInterface.OnClickListener
spinboxBinding.editValue.setText(newValue.toString())
updateValidity(newValue)
}
*/
fun attachRepeat(button: View, delta: Int) {
val handler = Handler(Looper.getMainLooper())

3
src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsFragmentPresenter.kt

@ -1167,9 +1167,10 @@ class SettingsFragmentPresenter(
add(IntSetting.CPU_ACCURACY.key)
add(BooleanSetting.USE_AUTO_STUB.key)
add(SettingsItem.FASTMEM_COMBINED)
add(HeaderSetting(R.string.log))
add(BooleanSetting.DEBUG_FLUSH_BY_LINE.key)
add(HeaderSetting(R.string.general))
add(IntSetting.DEBUG_KNOBS.key)
}
}
}

5
src/android/app/src/main/res/values/strings.xml

@ -135,6 +135,9 @@
<string name="memory_layout_description">(EXPERIMENTAL) Change the emulated memory layout. This setting will not increase performance, but may help with games utilizing high resolutions via mods. Do not use on phones with 8GB of RAM or less. Only works on the Dynarmic (JIT) backend.</string>
<string name="dma_accuracy">DMA Accuracy</string>
<string name="dma_accuracy_description">Controls the DMA precision accuracy. Safe precision can fix issues in some games, but it can also impact performance in some cases. If unsure, leave this on Default.</string>
<string name="debug_knobs">Debug knobs</string>
<string name="debug_knobs_description">For development use only.</string>
<string name="debug_knobs_hint">0 to 65535</string>
<!-- Shader Backend -->
<string name="shader_backend">Shader Backend</string>
@ -534,6 +537,8 @@
<string name="flush_by_line">Flush debug logs by line</string>
<string name="flush_by_line_description">Flushes debugging logs on each line written, making debugging easier in cases of crashing or freezing.</string>
<string name="general">General</string>
<!-- Audio settings strings -->
<string name="audio_output_engine">Output engine</string>
<string name="audio_volume">Volume</string>

4
src/common/settings.cpp

@ -141,6 +141,10 @@ void LogSettings() {
log_path("DataStorage_SDMCDir", Common::FS::GetEdenPath(Common::FS::EdenPath::SDMCDir));
}
bool getDebugKnobAt(u8 i) {
return (values.debug_knobs.GetValue() & (1 << (i & 0xF))) != 0;
}
void UpdateGPUAccuracy() {
values.current_gpu_accuracy = values.gpu_accuracy.GetValue();
}

12
src/common/settings.h

@ -739,6 +739,16 @@ struct Values {
Setting<bool> perform_vulkan_check{linkage, true, "perform_vulkan_check", Category::Debugging};
Setting<bool> disable_web_applet{linkage, true, "disable_web_applet", Category::Debugging};
SwitchableSetting<u16, true> debug_knobs{linkage,
0,
0,
65535,
"debug_knobs",
Category::Debugging,
Specialization::Countable,
true,
true};
// Miscellaneous
Setting<std::string> log_filter{linkage, "*:Info", "log_filter", Category::Miscellaneous};
Setting<bool> log_flush_line{linkage, false, "flush_line", Category::Miscellaneous, Specialization::Default, true, true};
@ -767,6 +777,8 @@ struct Values {
extern Values values;
bool getDebugKnobAt(u8 i);
void UpdateGPUAccuracy();
bool IsGPULevelExtreme();
bool IsGPULevelHigh();

2
src/yuzu/configuration/configure_debug.cpp

@ -75,6 +75,7 @@ void ConfigureDebug::SetConfiguration() {
ui->disable_loop_safety_checks->setChecked(Settings::values.disable_shader_loop_safety_checks.GetValue());
ui->extended_logging->setChecked(Settings::values.extended_logging.GetValue());
ui->perform_vulkan_check->setChecked(Settings::values.perform_vulkan_check.GetValue());
ui->debug_knobs_spinbox->setValue(Settings::values.debug_knobs.GetValue());
#ifdef YUZU_USE_QT_WEB_ENGINE
ui->disable_web_applet->setChecked(Settings::values.disable_web_applet.GetValue());
#else
@ -111,6 +112,7 @@ void ConfigureDebug::ApplyConfiguration() {
Settings::values.extended_logging = ui->extended_logging->isChecked();
Settings::values.perform_vulkan_check = ui->perform_vulkan_check->isChecked();
Settings::values.disable_web_applet = ui->disable_web_applet->isChecked();
Settings::values.debug_knobs = ui->debug_knobs_spinbox->value();
Debugger::ToggleConsole();
Common::Log::Filter filter;
filter.ParseFilterString(Settings::values.log_filter.GetValue());

6
src/yuzu/configuration/configure_debug.h

@ -1,11 +1,13 @@
// SPDX-FileCopyrightText: 2016 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
#pragma once
#include <memory>
#include <QScrollArea>
class QSpinBox;
namespace Core {
class System;
}

25
src/yuzu/configuration/configure_debug.ui

@ -467,6 +467,31 @@
<string>Debugging</string>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<item row="8" column="0">
<widget class="QSpinBox" name="debug_knobs_spinbox">
<property name="minimum">
<number>0</number>
</property>
<property name="maximum">
<number>65535</number>
</property>
<property name="toolTip">
<string>Bitmask for quick development toggles</string>
</property>
<property name="statusTip">
<string>Set debug knobs (bitmask)</string>
</property>
<property name="whatsThis">
<string>16-bit debug knob set for quick development toggles</string>
</property>
<property name="suffix">
<string> (bitmask)</string>
</property>
<property name="prefix">
<string>Debug Knobs: </string>
</property>
</widget>
</item>
<item row="7" column="0">
<spacer name="verticalSpacer_3">
<property name="orientation">

Loading…
Cancel
Save