mirror of
https://github.com/azahar-emu/azahar.git
synced 2025-04-28 13:47:59 +03:00
Merge 4bf1626af1
into 72eb16f933
This commit is contained in:
commit
c1bd3b8fe6
13 changed files with 151 additions and 15 deletions
|
@ -59,6 +59,8 @@ enum class IntSetting(
|
|||
HW_SHADER("use_hw_shader", Settings.SECTION_RENDERER, 1),
|
||||
VSYNC("use_vsync_new", Settings.SECTION_RENDERER, 1),
|
||||
DEBUG_RENDERER("renderer_debug", Settings.SECTION_DEBUG, 0),
|
||||
USE_RPC_SERVER("use_rpc_server", Settings.SECTION_DEBUG, 1),
|
||||
RPC_SERVER_PORT("rpc_server_port", Settings.SECTION_DEBUG, 45987),
|
||||
TEXTURE_FILTER("texture_filter", Settings.SECTION_RENDERER, 0),
|
||||
TEXTURE_SAMPLING("texture_sampling", Settings.SECTION_RENDERER, 0),
|
||||
USE_FRAME_LIMIT("use_frame_limit", Settings.SECTION_RENDERER, 1),
|
||||
|
@ -92,6 +94,8 @@ enum class IntSetting(
|
|||
GRAPHICS_API,
|
||||
VSYNC,
|
||||
DEBUG_RENDERER,
|
||||
USE_RPC_SERVER,
|
||||
RPC_SERVER_PORT,
|
||||
CPU_JIT,
|
||||
ASYNC_CUSTOM_LOADING,
|
||||
AUDIO_INPUT_TYPE,
|
||||
|
|
|
@ -1404,6 +1404,27 @@ class SettingsFragmentPresenter(private val fragmentView: SettingsFragmentView)
|
|||
settingsActivity.setToolbarTitle(settingsActivity.getString(R.string.preferences_debug))
|
||||
sl.apply {
|
||||
add(HeaderSetting(R.string.debug_warning))
|
||||
add(
|
||||
SwitchSetting(
|
||||
IntSetting.USE_RPC_SERVER,
|
||||
R.string.use_rpc_server,
|
||||
R.string.use_rpc_server_description,
|
||||
IntSetting.USE_RPC_SERVER.key,
|
||||
IntSetting.USE_RPC_SERVER.defaultValue
|
||||
)
|
||||
)
|
||||
add(
|
||||
SliderSetting(
|
||||
IntSetting.RPC_SERVER_PORT,
|
||||
R.string.rpc_server_port,
|
||||
R.string.rpc_server_port_description,
|
||||
1024,
|
||||
65535,
|
||||
"",
|
||||
IntSetting.RPC_SERVER_PORT.key,
|
||||
IntSetting.RPC_SERVER_PORT.defaultValue.toFloat()
|
||||
)
|
||||
)
|
||||
add(
|
||||
SliderSetting(
|
||||
IntSetting.CPU_CLOCK_SPEED,
|
||||
|
|
|
@ -2,10 +2,6 @@
|
|||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <iomanip>
|
||||
#include <memory>
|
||||
#include <sstream>
|
||||
#include <unordered_map>
|
||||
#include <INIReader.h>
|
||||
#include "common/file_util.h"
|
||||
#include "common/logging/backend.h"
|
||||
|
@ -15,6 +11,7 @@
|
|||
#include "core/core.h"
|
||||
#include "core/hle/service/cfg/cfg.h"
|
||||
#include "core/hle/service/service.h"
|
||||
#include "core/rpc/udp_server.h"
|
||||
#include "input_common/main.h"
|
||||
#include "input_common/udp/client.h"
|
||||
#include "jni/camera/ndk_camera.h"
|
||||
|
@ -286,9 +283,14 @@ void Config::ReadValues() {
|
|||
// Debugging
|
||||
Settings::values.record_frame_times =
|
||||
sdl2_config->GetBoolean("Debugging", "record_frame_times", false);
|
||||
Settings::values.use_rpc_server = sdl2_config->GetBoolean("Debugging", "use_rpc_server", true);
|
||||
Settings::values.use_rpc_server =
|
||||
sdl2_config->GetInteger("Debugging", "rpc_server_port", Core::RPC::DEFAULT_PORT);
|
||||
ReadSetting("Debugging", Settings::values.renderer_debug);
|
||||
ReadSetting("Debugging", Settings::values.use_gdbstub);
|
||||
ReadSetting("Debugging", Settings::values.gdbstub_port);
|
||||
ReadSetting("Debugging", Settings::values.use_rpc_server);
|
||||
ReadSetting("Debugging", Settings::values.rpc_server_port);
|
||||
ReadSetting("Debugging", Settings::values.instant_debug_log);
|
||||
|
||||
for (const auto& service_module : Service::service_module_map) {
|
||||
|
|
|
@ -422,6 +422,10 @@ renderer_debug =
|
|||
use_gdbstub=false
|
||||
gdbstub_port=24689
|
||||
|
||||
# Port for the scripting RPC server.
|
||||
use_rpc_server =
|
||||
rpc_server_port =
|
||||
|
||||
# Flush log output on every message
|
||||
# Immediately commits the debug log to file. Use this if Azahar crashes and the log output is being cut.
|
||||
instant_debug_log =
|
||||
|
|
|
@ -341,6 +341,10 @@
|
|||
<string name="setting_disabled_description">This setting is currently disabled due to another setting not being the appropriate value.</string>
|
||||
<string name="setting_not_editable_description">This option can\'t be changed while a game is running.</string>
|
||||
<string name="auto_select">Auto-Select</string>
|
||||
<string name="use_rpc_server">Enable RPC Server</string>
|
||||
<string name="use_rpc_server_description">Enables the RPC server for scripting. Safe to disable if scripting is not in use.</string>
|
||||
<string name="rpc_server_port">RPC Server Port</string>
|
||||
<string name="rpc_server_port_description">Port number for the scripting RPC server. Do not choose a custom port number lower than 49152 unless you know what you are doing.</string>
|
||||
|
||||
<!-- Add Directory Screen-->
|
||||
<string name="select_game_folder">Select Game Folder</string>
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
#include <QKeySequence>
|
||||
#include <QSettings>
|
||||
#include "citra_qt/configuration/config.h"
|
||||
|
@ -497,6 +495,10 @@ void QtConfig::ReadDebuggingValues() {
|
|||
qt_config->value(QStringLiteral("record_frame_times"), false).toBool();
|
||||
ReadBasicSetting(Settings::values.use_gdbstub);
|
||||
ReadBasicSetting(Settings::values.gdbstub_port);
|
||||
#ifdef ENABLE_SCRIPTING
|
||||
ReadBasicSetting(Settings::values.use_rpc_server);
|
||||
ReadBasicSetting(Settings::values.rpc_server_port);
|
||||
#endif
|
||||
ReadBasicSetting(Settings::values.renderer_debug);
|
||||
ReadBasicSetting(Settings::values.dump_command_buffers);
|
||||
ReadBasicSetting(Settings::values.instant_debug_log);
|
||||
|
@ -1058,6 +1060,10 @@ void QtConfig::SaveDebuggingValues() {
|
|||
qt_config->setValue(QStringLiteral("record_frame_times"), Settings::values.record_frame_times);
|
||||
WriteBasicSetting(Settings::values.use_gdbstub);
|
||||
WriteBasicSetting(Settings::values.gdbstub_port);
|
||||
#ifdef ENABLE_SCRIPTING
|
||||
WriteBasicSetting(Settings::values.use_rpc_server);
|
||||
WriteBasicSetting(Settings::values.rpc_server_port);
|
||||
#endif
|
||||
WriteBasicSetting(Settings::values.renderer_debug);
|
||||
WriteBasicSetting(Settings::values.instant_debug_log);
|
||||
|
||||
|
|
|
@ -94,6 +94,13 @@ void ConfigureDebug::SetConfiguration() {
|
|||
ui->toggle_gdbstub->setChecked(Settings::values.use_gdbstub.GetValue());
|
||||
ui->gdbport_spinbox->setEnabled(Settings::values.use_gdbstub.GetValue());
|
||||
ui->gdbport_spinbox->setValue(Settings::values.gdbstub_port.GetValue());
|
||||
#ifdef ENABLE_SCRIPTING
|
||||
ui->toggle_rpc_server->setChecked(Settings::values.use_rpc_server.GetValue());
|
||||
ui->rpc_server_port_spinbox->setEnabled(Settings::values.use_rpc_server.GetValue());
|
||||
ui->rpc_server_port_spinbox->setValue(Settings::values.rpc_server_port.GetValue());
|
||||
#else
|
||||
ui->groupBox_scripting->hide();
|
||||
#endif
|
||||
ui->toggle_console->setEnabled(!is_powered_on);
|
||||
ui->toggle_console->setChecked(UISettings::values.show_console.GetValue());
|
||||
ui->log_filter_edit->setText(QString::fromStdString(Settings::values.log_filter.GetValue()));
|
||||
|
@ -129,6 +136,10 @@ void ConfigureDebug::SetConfiguration() {
|
|||
void ConfigureDebug::ApplyConfiguration() {
|
||||
Settings::values.use_gdbstub = ui->toggle_gdbstub->isChecked();
|
||||
Settings::values.gdbstub_port = static_cast<u16>(ui->gdbport_spinbox->value());
|
||||
#ifdef ENABLE_SCRIPTING
|
||||
Settings::values.use_rpc_server = ui->toggle_rpc_server->isChecked();
|
||||
Settings::values.rpc_server_port = static_cast<u16>(ui->rpc_server_port_spinbox->value());
|
||||
#endif
|
||||
UISettings::values.show_console = ui->toggle_console->isChecked();
|
||||
Settings::values.log_filter = ui->log_filter_edit->text().toStdString();
|
||||
Settings::values.log_regex_filter = ui->log_regex_filter_edit->text().toStdString();
|
||||
|
|
|
@ -54,7 +54,61 @@
|
|||
<item>
|
||||
<widget class="QSpinBox" name="gdbport_spinbox">
|
||||
<property name="maximum">
|
||||
<number>65536</number>
|
||||
<number>65535</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_scripting_1">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_scripting">
|
||||
<property name="title">
|
||||
<string>Scripting</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_scripting_2">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_scripting">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="toggle_rpc_server">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Enables the RPC server for scripting. Safe to disable if scripting is not in use.</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Enable RPC Server</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_scripting">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_scripting">
|
||||
<property name="text">
|
||||
<string>Port:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="rpc_server_port_spinbox">
|
||||
<property name="maximum">
|
||||
<number>65535</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -300,6 +354,8 @@
|
|||
<tabstops>
|
||||
<tabstop>toggle_gdbstub</tabstop>
|
||||
<tabstop>gdbport_spinbox</tabstop>
|
||||
<tabstop>toggle_rpc_server</tabstop>
|
||||
<tabstop>rpc_server_port_spinbox</tabstop>
|
||||
<tabstop>log_filter_edit</tabstop>
|
||||
<tabstop>toggle_console</tabstop>
|
||||
<tabstop>open_log_button</tabstop>
|
||||
|
@ -322,5 +378,21 @@
|
|||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>toggle_rpc_server</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>rpc_server_port_spinbox</receiver>
|
||||
<slot>setEnabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>84</x>
|
||||
<y>157</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>342</x>
|
||||
<y>158</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
|
|
|
@ -153,6 +153,8 @@ void LogSettings() {
|
|||
log_setting("Debugging_DelayStartForLLEModules", values.delay_start_for_lle_modules.GetValue());
|
||||
log_setting("Debugging_UseGdbstub", values.use_gdbstub.GetValue());
|
||||
log_setting("Debugging_GdbstubPort", values.gdbstub_port.GetValue());
|
||||
log_setting("Debugging_UseRpcServer", values.use_rpc_server.GetValue());
|
||||
log_setting("Debugging_RpcServerPort", values.rpc_server_port.GetValue());
|
||||
log_setting("Debugging_InstantDebugLog", values.instant_debug_log.GetValue());
|
||||
}
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
#include "audio_core/sink_details.h"
|
||||
#include "common/common_types.h"
|
||||
#include "core/hle/service/cam/cam_params.h"
|
||||
#include "core/rpc/udp_server.h"
|
||||
|
||||
namespace Settings {
|
||||
|
||||
|
@ -585,6 +586,8 @@ struct Values {
|
|||
Setting<bool> delay_start_for_lle_modules{true, "delay_start_for_lle_modules"};
|
||||
Setting<bool> use_gdbstub{false, "use_gdbstub"};
|
||||
Setting<u16> gdbstub_port{24689, "gdbstub_port"};
|
||||
Setting<bool> use_rpc_server{true, "use_rpc_server"};
|
||||
Setting<u16> rpc_server_port{Core::RPC::DEFAULT_PORT, "rpc_server_port"};
|
||||
Setting<bool> instant_debug_log{false, "instant_debug_log"};
|
||||
|
||||
// Miscellaneous
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <stdexcept>
|
||||
#include <utility>
|
||||
#include <boost/serialization/array.hpp>
|
||||
#include "audio_core/dsp_interface.h"
|
||||
#include "audio_core/hle/hle.h"
|
||||
|
@ -503,7 +501,9 @@ System::ResultStatus System::Init(Frontend::EmuWindow& emu_window,
|
|||
dsp_core->EnableStretching(Settings::values.enable_audio_stretching.GetValue());
|
||||
|
||||
#ifdef ENABLE_SCRIPTING
|
||||
rpc_server = std::make_unique<RPC::Server>(*this);
|
||||
if (Settings::values.use_rpc_server.GetValue()) {
|
||||
rpc_server = std::make_unique<RPC::Server>(*this);
|
||||
}
|
||||
#endif
|
||||
|
||||
service_manager = std::make_unique<Service::SM::ServiceManager>(*this);
|
||||
|
@ -641,7 +641,9 @@ void System::Shutdown(bool is_deserializing) {
|
|||
}
|
||||
custom_tex_manager.reset();
|
||||
#ifdef ENABLE_SCRIPTING
|
||||
rpc_server.reset();
|
||||
if (Settings::values.use_rpc_server.GetValue()) {
|
||||
rpc_server.reset();
|
||||
}
|
||||
#endif
|
||||
archive_manager.reset();
|
||||
service_manager.reset();
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
// Copyright 2019 Citra Emulator Project
|
||||
// Copyright Citra Emulator Project / Azahar Emulator Project
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <thread>
|
||||
#include <boost/asio.hpp>
|
||||
#include "common/common_types.h"
|
||||
#include "common/logging/log.h"
|
||||
#include "common/settings.h"
|
||||
#include "core/rpc/packet.h"
|
||||
#include "core/rpc/udp_server.h"
|
||||
|
||||
|
@ -16,7 +16,9 @@ public:
|
|||
explicit Impl(std::function<void(std::unique_ptr<Packet>)> new_request_callback)
|
||||
// Use a random high port
|
||||
// TODO: Make configurable or increment port number on failure
|
||||
: socket(io_context, boost::asio::ip::udp::endpoint(boost::asio::ip::udp::v4(), 45987)),
|
||||
: socket(io_context,
|
||||
boost::asio::ip::udp::endpoint(boost::asio::ip::udp::v4(),
|
||||
Settings::values.rpc_server_port.GetValue())),
|
||||
new_request_callback(std::move(new_request_callback)) {
|
||||
|
||||
StartReceive();
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2019 Citra Emulator Project
|
||||
// Copyright Citra Emulator Project / Azahar Emulator Project
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
|
@ -6,9 +6,12 @@
|
|||
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
#include "common/common_types.h"
|
||||
|
||||
namespace Core::RPC {
|
||||
|
||||
constexpr u16 DEFAULT_PORT{45987};
|
||||
|
||||
class Packet;
|
||||
|
||||
class UDPServer {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue