Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various savestate bugfixes #656

Merged
merged 5 commits into from
Mar 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2023 Citra Emulator Project
// Copyright Citra Emulator Project / Azahar Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.

Expand All @@ -15,7 +15,9 @@ enum class BooleanSetting(
ALLOW_PLUGIN_LOADER("allow_plugin_loader", Settings.SECTION_SYSTEM, true),
SWAP_SCREEN("swap_screen", Settings.SECTION_LAYOUT, false),
INSTANT_DEBUG_LOG("instant_debug_log", Settings.SECTION_DEBUG, false),
CUSTOM_LAYOUT("custom_layout",Settings.SECTION_LAYOUT,false);
CUSTOM_LAYOUT("custom_layout",Settings.SECTION_LAYOUT,false),
DELAY_START_LLE_MODULES("delay_start_for_lle_modules", Settings.SECTION_DEBUG, true),
DETERMINISTIC_ASYNC_OPERATIONS("deterministic_async_operations", Settings.SECTION_DEBUG, false);

override var boolean: Boolean = defaultValue

Expand All @@ -36,7 +38,9 @@ enum class BooleanSetting(
private val NOT_RUNTIME_EDITABLE = listOf(
PLUGIN_LOADER,
ALLOW_PLUGIN_LOADER,
ASYNC_SHADERS
ASYNC_SHADERS,
DELAY_START_LLE_MODULES,
DETERMINISTIC_ASYNC_OPERATIONS,
)

fun from(key: String): BooleanSetting? =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@ class SettingsFragmentPresenter(private val fragmentView: SettingsFragmentView)
SwitchSetting(
IntSetting.USE_ARTIC_BASE_CONTROLLER,
R.string.use_artic_base_controller,
R.string.use_artic_base_controller_desc,
R.string.use_artic_base_controller_description,
IntSetting.USE_ARTIC_BASE_CONTROLLER.key,
IntSetting.USE_ARTIC_BASE_CONTROLLER.defaultValue
)
Expand Down Expand Up @@ -1355,11 +1355,30 @@ class SettingsFragmentPresenter(private val fragmentView: SettingsFragmentView)
SwitchSetting(
BooleanSetting.INSTANT_DEBUG_LOG,
R.string.instant_debug_log,
R.string.instant_debug_log_desc,
R.string.instant_debug_log_description,
BooleanSetting.INSTANT_DEBUG_LOG.key,
BooleanSetting.INSTANT_DEBUG_LOG.defaultValue
)
)
add(
SwitchSetting(
BooleanSetting.DELAY_START_LLE_MODULES,
R.string.delay_start_lle_modules,
R.string.delay_start_lle_modules_description,
BooleanSetting.DELAY_START_LLE_MODULES.key,
BooleanSetting.DELAY_START_LLE_MODULES.defaultValue
)
)
add(
SwitchSetting(
BooleanSetting.DETERMINISTIC_ASYNC_OPERATIONS,
R.string.deterministic_async_operations,
R.string.deterministic_async_operations_description,
BooleanSetting.DETERMINISTIC_ASYNC_OPERATIONS.key,
BooleanSetting.DETERMINISTIC_ASYNC_OPERATIONS.defaultValue
)
)

}
}

Expand Down
11 changes: 10 additions & 1 deletion src/android/app/src/main/jni/default_ini.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2014 Citra Emulator Project
// Copyright Citra Emulator Project / Azahar Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.

Expand Down Expand Up @@ -413,6 +413,15 @@ gdbstub_port=24689
# Immediately commits the debug log to file. Use this if Azahar crashes and the log output is being cut.
instant_debug_log =

# Delay the start of apps when LLE modules are enabled
# 0: Off, 1 (default): On
delay_start_for_lle_modules =

# Force deterministic async operations
# Only needed for debugging, makes performance worse if enabled
# 0: Off (default), 1: On
deterministic_async_operations =

# To LLE a service module add "LLE\<module name>=true"

[WebService]
Expand Down
2 changes: 1 addition & 1 deletion src/android/app/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ Se esperan fallos gráficos temporales cuando ésta esté activado.</string>
<string name="delay_render_thread_description">Retrasa el hilo de dibujado del juego cuando envía datos a la GPU. Ayuda con problemas de rendimiento en los (muy pocos) juegos de fps dinámicos.</string>
<string name="miscellaneous">Misceláneo</string>
<string name="use_artic_base_controller">Usar Artic Controller cuando se está conectado a Artic Base Server</string>
<string name="use_artic_base_controller_desc">Usa los controles proporcionados por Artic Base Server cuando esté conectado a él en lugar del dispositivo de entrada configurado.</string>
<string name="use_artic_base_controller_description">Usa los controles proporcionados por Artic Base Server cuando esté conectado a él en lugar del dispositivo de entrada configurado.</string>
<string name="disable_right_eye_render">Desactivar dibujado de ojo derecho</string>
<string name="disable_right_eye_render_desc">Mejora considerablemente el rendimiento en algunos juegos, pero puede producir parpadeos en otros.</string>

Expand Down
2 changes: 1 addition & 1 deletion src/android/app/src/main/res/values-pl/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -724,6 +724,6 @@
<string name="artic_base_enter_address">Wprowadź adres serwera Artic Base</string>
<string name="miscellaneous">Różne</string>
<string name="use_artic_base_controller">Użyj kontrolera Artic po podłączeniu do serwera Artic Base</string>
<string name="use_artic_base_controller_desc">W przypadku połączenia z serwerem Artic Base zamiast skonfigurowanego urządzenia wejściowego należy używać elementów sterujących udostępnianych przez ten serwer.</string>
<string name="use_artic_base_controller_description">W przypadku połączenia z serwerem Artic Base zamiast skonfigurowanego urządzenia wejściowego należy używać elementów sterujących udostępnianych przez ten serwer.</string>

</resources>
8 changes: 6 additions & 2 deletions src/android/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -776,10 +776,14 @@
<string name="quickload_not_found">No Quicksave available.</string>
<string name="miscellaneous">Miscellaneous</string>
<string name="use_artic_base_controller">Use Artic Controller when connected to Artic Base Server</string>
<string name="use_artic_base_controller_desc">Use the controls provided by Artic Base Server when connected to it instead of the configured input device.</string>
<string name="use_artic_base_controller_description">Use the controls provided by Artic Base Server when connected to it instead of the configured input device.</string>
<string name="instant_debug_log">Flush log output on every message</string>
<string name="instant_debug_log_desc">Immediately commits the debug log to file. Use this if Azahar crashes and the log output is being cut.</string>
<string name="instant_debug_log_description">Immediately commits the debug log to file. Use this if Azahar crashes and the log output is being cut.</string>
<string name="disable_right_eye_render">Disable Right Eye Render</string>
<string name="disable_right_eye_render_description">Greatly improves performance in some applications, but can cause flickering in others.</string>
<string name="delay_start_lle_modules">Delay start with LLE modules</string>
<string name="delay_start_lle_modules_description">Delays the start of the app when LLE modules are enabled.</string>
<string name="deterministic_async_operations">Deterministic Async Operations</string>
<string name="deterministic_async_operations_description">Makes async operations deterministic for debugging. Enabling this may cause freezes.</string>

</resources>
4 changes: 4 additions & 0 deletions src/citra_qt/configuration/configure_debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ void ConfigureDebug::SetConfiguration() {
ui->toggle_cpu_jit->setChecked(Settings::values.use_cpu_jit.GetValue());
ui->delay_start_for_lle_modules->setChecked(
Settings::values.delay_start_for_lle_modules.GetValue());
ui->deterministic_async_operations->setChecked(
Settings::values.deterministic_async_operations.GetValue());
ui->toggle_renderer_debug->setChecked(Settings::values.renderer_debug.GetValue());
ui->toggle_dump_command_buffers->setChecked(Settings::values.dump_command_buffers.GetValue());

Expand Down Expand Up @@ -137,6 +139,8 @@ void ConfigureDebug::ApplyConfiguration() {
Common::Log::SetRegexFilter(Settings::values.log_regex_filter.GetValue());
Settings::values.use_cpu_jit = ui->toggle_cpu_jit->isChecked();
Settings::values.delay_start_for_lle_modules = ui->delay_start_for_lle_modules->isChecked();
Settings::values.deterministic_async_operations =
ui->deterministic_async_operations->isChecked();
Settings::values.renderer_debug = ui->toggle_renderer_debug->isChecked();
Settings::values.dump_command_buffers = ui->toggle_dump_command_buffers->isChecked();
Settings::values.instant_debug_log = ui->instant_debug_log->isChecked();
Expand Down
64 changes: 37 additions & 27 deletions src/citra_qt/configuration/configure_debug.ui
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,16 @@
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_cpu_clock_info">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;Underclocking can increase performance but may cause the application to freeze.&lt;br/&gt;Overclocking may reduce lag in applications but also might cause freezes&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QCheckBox" name="toggle_cpu_jit">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Enables the use of the ARM JIT compiler for emulating the 3DS CPUs. Don't disable unless for debugging purposes&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
Expand All @@ -226,14 +236,14 @@
</property>
</widget>
</item>
<item row="3" column="0">
<item row="4" column="0">
<widget class="QCheckBox" name="toggle_renderer_debug">
<property name="text">
<string>Enable debug renderer</string>
</property>
</widget>
</item>
<item row="4" column="0">
<item row="5" column="0">
<widget class="QCheckBox" name="toggle_dump_command_buffers">
<property name="text">
<string>Dump command buffers</string>
Expand All @@ -243,33 +253,33 @@
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_5">
<property name="title">
<string>Miscellaneus</string>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<item row="1" column="0">
<widget class="QCheckBox" name="delay_start_for_lle_modules">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Introduces a delay to the first ever launched app thread if LLE modules are enabled, to allow them to initialize.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Delay app start for LLE module initialization</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QLabel" name="label_cpu_clock_info">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;CPU Clock Speed Information&lt;br/&gt;Underclocking can increase performance but may cause the application to freeze.&lt;br/&gt;Overclocking may reduce lag in applications but also might cause freezes&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
<widget class="QGroupBox" name="groupBox_5">
<property name="title">
<string>Miscellaneous</string>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<item row="1" column="0">
<widget class="QCheckBox" name="delay_start_for_lle_modules">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Introduces a delay to the first ever launched app thread if LLE modules are enabled, to allow them to initialize.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Delay app start for LLE module initialization</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="deterministic_async_operations">
<property name="text">
<string>Force deterministic async operations</string>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Forces all async operations to run on the main thread, making them deterministic. Do not enable if you don't know what you are doing.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
Expand Down
4 changes: 3 additions & 1 deletion src/citra_sdl/config.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2014 Citra Emulator Project
// Copyright Citra Emulator Project / Azahar Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.

Expand Down Expand Up @@ -328,6 +328,8 @@ void SdlConfig::ReadValues() {
// Miscellaneous
ReadSetting("Miscellaneous", Settings::values.log_filter);
ReadSetting("Miscellaneous", Settings::values.log_regex_filter);
ReadSetting("Miscellaneous", Settings::values.delay_start_for_lle_modules);
ReadSetting("Miscellaneous", Settings::values.deterministic_async_operations);

// Apply the log_filter setting as the logger has already been initialized
// and doesn't pick up the filter on its own.
Expand Down
7 changes: 6 additions & 1 deletion src/common/archives.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020 Citra Emulator Project
// Copyright Citra Emulator Project / Azahar Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.

Expand All @@ -19,3 +19,8 @@ using oarchive = boost::archive::binary_oarchive;
BOOST_CLASS_EXPORT_IMPLEMENT(A) \
BOOST_SERIALIZATION_REGISTER_ARCHIVE(iarchive) \
BOOST_SERIALIZATION_REGISTER_ARCHIVE(oarchive)

#define DEBUG_SERIALIZATION_POINT \
do { \
LOG_DEBUG(Savestate, ""); \
} while (0)
3 changes: 2 additions & 1 deletion src/common/logging/filter.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2014 Citra Emulator Project
// Copyright Citra Emulator Project / Azahar Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.

Expand Down Expand Up @@ -74,6 +74,7 @@ bool ParseFilterRule(Filter& instance, Iterator begin, Iterator end) {
SUB(Core, Timing) \
SUB(Core, Cheats) \
CLS(Config) \
CLS(Savestate) \
CLS(Debug) \
SUB(Debug, Emulated) \
SUB(Debug, GPU) \
Expand Down
3 changes: 2 additions & 1 deletion src/common/logging/types.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2023 Citra Emulator Project
// Copyright Citra Emulator Project / Azahar Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.

Expand Down Expand Up @@ -39,6 +39,7 @@ enum class Class : u8 {
Core_Timing, ///< CoreTiming functions
Core_Cheats, ///< Cheat functions
Config, ///< Emulator configuration
Savestate, ///< Savestates
Debug, ///< Debugging tools
Debug_Emulated, ///< Debug messages from the emulated programs
Debug_GPU, ///< GPU debugging tools
Expand Down
1 change: 1 addition & 0 deletions src/common/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,7 @@ struct Values {
SwitchableSetting<s32, true> cpu_clock_percentage{100, 5, 400, "cpu_clock_percentage"};
SwitchableSetting<bool> is_new_3ds{true, "is_new_3ds"};
SwitchableSetting<bool> lle_applets{false, "lle_applets"};
SwitchableSetting<bool> deterministic_async_operations{false, "deterministic_async_operations"};

// Data Storage
Setting<bool> use_virtual_sd{true, "use_virtual_sd"};
Expand Down
Loading