mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-01-27 21:35:19 +00:00
Ported more options in new ini-manager. Use later.
This commit is contained in:
parent
1673ba217c
commit
89f14ec5ac
@ -105,6 +105,13 @@ public:
|
||||
return *this;
|
||||
}
|
||||
|
||||
template<typename T2>
|
||||
entry& operator = (const T2& new_value)
|
||||
{
|
||||
value(static_cast<T>(new_value));
|
||||
return *this;
|
||||
}
|
||||
|
||||
explicit operator const T&() const
|
||||
{
|
||||
return m_value;
|
||||
|
@ -1,6 +1,7 @@
|
||||
#include "stdafx.h"
|
||||
#include "rpcs3/Ini.h"
|
||||
#include "AudioManager.h"
|
||||
#include "Emu/state.h"
|
||||
#include "AL/OpenALThread.h"
|
||||
#include "Null/NullAudioThread.h"
|
||||
#include "XAudio2/XAudio2Thread.h"
|
||||
@ -20,13 +21,13 @@ void AudioManager::Init()
|
||||
|
||||
m_audio_info.Init();
|
||||
|
||||
switch (Ini.AudioOutMode.GetValue())
|
||||
switch (rpcs3::state.config.audio.out.value())
|
||||
{
|
||||
default:
|
||||
case 0: m_audio_out = new NullAudioThread(); break;
|
||||
case 1: m_audio_out = new OpenALThread(); break;
|
||||
case audio_output_type::Null: m_audio_out = new NullAudioThread(); break;
|
||||
case audio_output_type::OpenAL: m_audio_out = new OpenALThread(); break;
|
||||
#if defined (_WIN32)
|
||||
case 2: m_audio_out = new XAudio2Thread(); break;
|
||||
case audio_output_type::XAudio2: m_audio_out = new XAudio2Thread(); break;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
@ -3,6 +3,7 @@
|
||||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/SysCalls/Modules/cellVideoOut.h"
|
||||
#include "Emu/state.h"
|
||||
|
||||
#include "GSManager.h"
|
||||
#include "Null/NullGSRender.h"
|
||||
@ -32,13 +33,13 @@ void GSManager::Init()
|
||||
|
||||
m_info.Init();
|
||||
|
||||
switch (Ini.GSRenderMode.GetValue())
|
||||
switch (rpcs3::state.config.rsx.renderer.value())
|
||||
{
|
||||
default:
|
||||
case 0: m_render = new NullGSRender(); break;
|
||||
case 1: m_render = new GLGSRender(); break;
|
||||
case rsx_renderer_type::Null : m_render = new NullGSRender(); break;
|
||||
case rsx_renderer_type::OpenGL: m_render = new GLGSRender(); break;
|
||||
#ifdef _WIN32
|
||||
case 2: m_render = new D3D12GSRender(); break;
|
||||
case rsx_renderer_type::DX12: m_render = new D3D12GSRender(); break;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
#include "rpcs3/Ini.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/state.h"
|
||||
#include "LogBase.h"
|
||||
|
||||
bool LogBase::CheckLogging() const
|
||||
|
@ -89,7 +89,7 @@ void Emulator::SetTitle(const std::string& title)
|
||||
void Emulator::CreateConfig(const std::string& name)
|
||||
{
|
||||
const std::string& path = "data/" + name;
|
||||
const std::string& ini_file = path + "/" + name + ".ini";
|
||||
const std::string& ini_file = path + "/settings.ini";
|
||||
|
||||
if (!fs::is_dir("data"))
|
||||
fs::create_dir("data");
|
||||
@ -265,7 +265,7 @@ void Emulator::Load()
|
||||
{
|
||||
name = name.substr(0, 4) + "-" + name.substr(4, 5);
|
||||
CreateConfig(name);
|
||||
rpcs3::config_t custom_config { "data/" + name + "/" + name + ".ini" };
|
||||
rpcs3::config_t custom_config { "data/" + name + "/settings.ini" };
|
||||
custom_config.load();
|
||||
rpcs3::state.config = custom_config;
|
||||
}
|
||||
@ -476,7 +476,6 @@ void Emulator::Stop()
|
||||
|
||||
RSXIOMem.Clear();
|
||||
vm::close();
|
||||
rpcs3::state.config = rpcs3::config; // fallback to default .ini
|
||||
|
||||
SendDbgCommand(DID_STOPPED_EMU);
|
||||
}
|
||||
|
@ -287,7 +287,7 @@ void GameViewer::ConfigureGame(wxCommandEvent& WXUNUSED(event))
|
||||
if (i < 0) return;
|
||||
|
||||
Emu.CreateConfig(m_game_data[i].serial);
|
||||
rpcs3::config_t custom_config { "data/" + m_game_data[i].serial + "/" + m_game_data[i].serial + ".ini" };
|
||||
rpcs3::config_t custom_config { "data/" + m_game_data[i].serial + "/settings.ini" };
|
||||
custom_config.load();
|
||||
LOG_NOTICE(LOADER, "Configure: '%s'", custom_config.path().c_str());
|
||||
SettingsDialog(this, &custom_config);
|
||||
|
@ -355,15 +355,15 @@ SettingsDialog::SettingsDialog(wxWindow *parent, rpcs3::config_t* cfg)
|
||||
txt_dbg_range_max->SetValue(std::to_string(Ini.LLVMMaxId.GetValue()));
|
||||
txt_llvm_threshold->SetValue(std::to_string(Ini.LLVMThreshold.GetValue()));
|
||||
rbox_spu_decoder->SetSelection((int)cfg->core.spu_decoder.value());
|
||||
cbox_gs_render->SetSelection(Ini.GSRenderMode.GetValue());
|
||||
cbox_gs_render->SetSelection((int)cfg->rsx.renderer.value());
|
||||
cbox_gs_d3d_adaptater->SetSelection(Ini.GSD3DAdaptater.GetValue());
|
||||
cbox_gs_resolution->SetSelection(ResolutionIdToNum(Ini.GSResolution.GetValue()) - 1);
|
||||
cbox_gs_aspect->SetSelection(Ini.GSAspectRatio.GetValue() - 1);
|
||||
cbox_gs_frame_limit->SetSelection(Ini.GSFrameLimit.GetValue());
|
||||
cbox_pad_handler->SetSelection(Ini.PadHandlerMode.GetValue());
|
||||
cbox_keyboard_handler->SetSelection(Ini.KeyboardHandlerMode.GetValue());
|
||||
cbox_mouse_handler->SetSelection(Ini.MouseHandlerMode.GetValue());
|
||||
cbox_audio_out->SetSelection(Ini.AudioOutMode.GetValue());
|
||||
cbox_pad_handler->SetSelection((int)cfg->io.pad_handler_mode.value());
|
||||
cbox_keyboard_handler->SetSelection((int)cfg->io.keyboard_handler_mode.value());
|
||||
cbox_mouse_handler->SetSelection((int)cfg->io.mouse_handler_mode.value());
|
||||
cbox_audio_out->SetSelection((int)cfg->audio.out.value());
|
||||
cbox_camera->SetSelection(Ini.Camera.GetValue());
|
||||
cbox_camera_type->SetSelection(Ini.CameraType.GetValue());
|
||||
cbox_hle_loglvl->SetSelection(Ini.HLELogLvl.GetValue());
|
||||
@ -371,6 +371,57 @@ SettingsDialog::SettingsDialog(wxWindow *parent, rpcs3::config_t* cfg)
|
||||
cbox_net_interface->SetSelection(Ini.NETInterface.GetValue());
|
||||
cbox_sys_lang->SetSelection(Ini.SysLanguage.GetValue());
|
||||
|
||||
// TODO: use later
|
||||
/*chbox_core_llvm_exclud->SetValue(cfg->core.llvm.exclusion_range.value());
|
||||
chbox_gs_log_prog->SetValue(rpcs3::config.rsx.log_programs.value());
|
||||
chbox_gs_dump_depth->SetValue(cfg->rsx.opengl.write_depth_buffer.value());
|
||||
chbox_gs_dump_color->SetValue(cfg->rsx.opengl.write_color_buffers.value());
|
||||
chbox_gs_read_color->SetValue(cfg->rsx.opengl.read_color_buffers.value());
|
||||
chbox_gs_read_depth->SetValue(cfg->rsx.opengl.read_depth_buffer.value());
|
||||
chbox_gs_vsync->SetValue(rpcs3::config.rsx.vsync.value());
|
||||
chbox_gs_debug_output->SetValue(cfg->rsx.d3d12.debug_output.value());
|
||||
chbox_gs_3dmonitor->SetValue(rpcs3::config.rsx._3dtv.value());
|
||||
chbox_gs_overlay->SetValue(cfg->rsx.d3d12.overlay.value());
|
||||
chbox_audio_dump->SetValue(rpcs3::config.audio.dump_to_file.value());
|
||||
chbox_audio_conv->SetValue(rpcs3::config.audio.convert_to_u16.value());
|
||||
chbox_hle_logging->SetValue(rpcs3::config.misc.log.hle_logging.value());
|
||||
chbox_rsx_logging->SetValue(rpcs3::config.misc.log.rsx_logging.value());
|
||||
chbox_hle_savetty->SetValue(rpcs3::config.misc.log.save_tty.value());
|
||||
chbox_hle_exitonstop->SetValue(rpcs3::config.misc.exit_on_stop.value());
|
||||
chbox_hle_always_start->SetValue(rpcs3::config.misc.always_start.value());
|
||||
chbox_hle_use_default_ini->SetValue(rpcs3::config.misc.use_default_ini.value());
|
||||
chbox_core_hook_stfunc->SetValue(cfg->core.hook_st_func.value());
|
||||
chbox_core_load_liblv2->SetValue(cfg->core.load_liblv2.value());
|
||||
|
||||
//Auto Pause related
|
||||
chbox_dbg_ap_systemcall->SetValue(rpcs3::config.misc.debug.auto_pause_syscall.value());
|
||||
chbox_dbg_ap_functioncall->SetValue(rpcs3::config.misc.debug.auto_pause_func_call.value());
|
||||
|
||||
//Custom EmulationDir
|
||||
chbox_emulationdir_enable->SetValue(rpcs3::config.system.emulation_dir_path_enable.value());
|
||||
txt_emulationdir_path->SetValue(rpcs3::config.system.emulation_dir_path.value());
|
||||
|
||||
rbox_ppu_decoder->SetSelection((int)cfg->core.ppu_decoder.value());
|
||||
txt_dbg_range_min->SetValue(cfg->core.llvm.min_id.string_value());
|
||||
txt_dbg_range_max->SetValue(cfg->core.llvm.max_id.string_value());
|
||||
txt_llvm_threshold->SetValue(cfg->core.llvm.threshold.string_value());
|
||||
rbox_spu_decoder->SetSelection((int)cfg->core.spu_decoder.value());
|
||||
cbox_gs_render->SetSelection((int)cfg->rsx.renderer.value());
|
||||
cbox_gs_d3d_adaptater->SetSelection(cfg->rsx.d3d12.adaptater.value());
|
||||
cbox_gs_resolution->SetSelection(ResolutionIdToNum((int)cfg->rsx.resolution.value() - 1));
|
||||
cbox_gs_aspect->SetSelection((int)cfg->rsx.aspect_ratio.value());
|
||||
cbox_gs_frame_limit->SetSelection((int)cfg->rsx.frame_limit.value());
|
||||
cbox_pad_handler->SetSelection((int)cfg->io.pad_handler_mode.value());
|
||||
cbox_keyboard_handler->SetSelection((int)cfg->io.keyboard_handler_mode.value());
|
||||
cbox_mouse_handler->SetSelection((int)cfg->io.mouse_handler_mode.value());
|
||||
cbox_audio_out->SetSelection((int)cfg->audio.out.value());
|
||||
cbox_camera->SetSelection((int)cfg->io.camera.value());
|
||||
cbox_camera_type->SetSelection((int)cfg->io.camera_type.value());
|
||||
cbox_hle_loglvl->SetSelection((int)rpcs3::config.misc.log.level.value());
|
||||
cbox_net_status->SetSelection((int)rpcs3::config.misc.net.status.value());
|
||||
cbox_net_interface->SetSelection((int)rpcs3::config.misc.net._interface.value());
|
||||
cbox_sys_lang->SetSelection((int)rpcs3::config.system.language.value());*/
|
||||
|
||||
// Core
|
||||
s_round_llvm->Add(chbox_core_llvm_exclud, wxSizerFlags().Border(wxALL, 5).Expand());
|
||||
s_round_llvm_range->Add(txt_dbg_range_min, wxSizerFlags().Border(wxALL, 5).Expand());
|
||||
@ -489,20 +540,20 @@ SettingsDialog::SettingsDialog(wxWindow *parent, rpcs3::config_t* cfg)
|
||||
|
||||
if (ShowModal() == wxID_OK)
|
||||
{
|
||||
cfg->core.ppu_decoder = (ppu_decoder_type)rbox_ppu_decoder->GetSelection();
|
||||
long llvmthreshold;
|
||||
long minllvmid, maxllvmid;
|
||||
txt_dbg_range_min->GetValue().ToLong(&minllvmid);
|
||||
txt_dbg_range_max->GetValue().ToLong(&maxllvmid);
|
||||
txt_llvm_threshold->GetValue().ToLong(&llvmthreshold);
|
||||
|
||||
Ini.LLVMExclusionRange.SetValue(chbox_core_llvm_exclud->GetValue());
|
||||
Ini.LLVMMinId.SetValue((u32)minllvmid);
|
||||
Ini.LLVMMaxId.SetValue((u32)maxllvmid);
|
||||
long llvmthreshold;
|
||||
txt_llvm_threshold->GetValue().ToLong(&llvmthreshold);
|
||||
Ini.LLVMThreshold.SetValue((u32)llvmthreshold);
|
||||
cfg->core.spu_decoder = (spu_decoder_type)rbox_spu_decoder->GetSelection();
|
||||
Ini.HookStFunc.SetValue(chbox_core_hook_stfunc->GetValue());
|
||||
Ini.LoadLibLv2.SetValue(chbox_core_load_liblv2->GetValue());
|
||||
Ini.GSRenderMode.SetValue(cbox_gs_render->GetSelection());
|
||||
cfg->rsx.renderer = cbox_gs_render->GetSelection();
|
||||
Ini.GSD3DAdaptater.SetValue(cbox_gs_d3d_adaptater->GetSelection());
|
||||
Ini.GSResolution.SetValue(ResolutionNumToId(cbox_gs_resolution->GetSelection() + 1));
|
||||
Ini.GSAspectRatio.SetValue(cbox_gs_aspect->GetSelection() + 1);
|
||||
@ -516,10 +567,10 @@ SettingsDialog::SettingsDialog(wxWindow *parent, rpcs3::config_t* cfg)
|
||||
Ini.GSDebugOutputEnable.SetValue(chbox_gs_debug_output->GetValue());
|
||||
Ini.GS3DTV.SetValue(chbox_gs_3dmonitor->GetValue());
|
||||
Ini.GSOverlay.SetValue(chbox_gs_overlay->GetValue());
|
||||
Ini.PadHandlerMode.SetValue(cbox_pad_handler->GetSelection());
|
||||
Ini.KeyboardHandlerMode.SetValue(cbox_keyboard_handler->GetSelection());
|
||||
Ini.MouseHandlerMode.SetValue(cbox_mouse_handler->GetSelection());
|
||||
Ini.AudioOutMode.SetValue(cbox_audio_out->GetSelection());
|
||||
cfg->io.pad_handler_mode = cbox_pad_handler->GetSelection();
|
||||
cfg->io.keyboard_handler_mode = cbox_keyboard_handler->GetSelection();
|
||||
cfg->io.mouse_handler_mode = cbox_mouse_handler->GetSelection();
|
||||
cfg->audio.out = cbox_audio_out->GetSelection();
|
||||
Ini.AudioDumpToFile.SetValue(chbox_audio_dump->GetValue());
|
||||
Ini.AudioConvertToU16.SetValue(chbox_audio_conv->GetValue());
|
||||
Ini.Camera.SetValue(cbox_camera->GetSelection());
|
||||
@ -542,6 +593,61 @@ SettingsDialog::SettingsDialog(wxWindow *parent, rpcs3::config_t* cfg)
|
||||
//Custom EmulationDir
|
||||
Ini.SysEmulationDirPathEnable.SetValue(chbox_emulationdir_enable->GetValue());
|
||||
Ini.SysEmulationDirPath.SetValue(txt_emulationdir_path->GetValue().ToStdString());
|
||||
|
||||
|
||||
// TODO: use later
|
||||
// individual settings
|
||||
/*cfg->core.ppu_decoder = rbox_ppu_decoder->GetSelection();
|
||||
cfg->core.llvm.exclusion_range = chbox_core_llvm_exclud->GetValue();
|
||||
cfg->core.llvm.min_id = minllvmid;
|
||||
cfg->core.llvm.max_id = maxllvmid;
|
||||
cfg->core.llvm.threshold = llvmthreshold;
|
||||
cfg->core.spu_decoder = rbox_spu_decoder->GetSelection();
|
||||
cfg->core.hook_st_func = chbox_core_hook_stfunc->GetValue();
|
||||
cfg->core.load_liblv2 = chbox_core_load_liblv2->GetValue();
|
||||
|
||||
cfg->rsx.renderer = cbox_gs_render->GetSelection();
|
||||
cfg->rsx.d3d12.adaptater = cbox_gs_d3d_adaptater->GetSelection();
|
||||
cfg->rsx.resolution = ResolutionNumToId(cbox_gs_resolution->GetSelection() + 1);
|
||||
cfg->rsx.aspect_ratio = cbox_gs_aspect->GetSelection() + 1;
|
||||
cfg->rsx.frame_limit = cbox_gs_frame_limit->GetSelection();
|
||||
cfg->rsx.opengl.write_depth_buffer = chbox_gs_dump_depth->GetValue();
|
||||
cfg->rsx.opengl.write_color_buffers = chbox_gs_dump_color->GetValue();
|
||||
cfg->rsx.opengl.read_color_buffers = chbox_gs_read_color->GetValue();
|
||||
cfg->rsx.opengl.read_depth_buffer = chbox_gs_read_depth->GetValue();
|
||||
cfg->rsx.d3d12.debug_output = chbox_gs_debug_output->GetValue();
|
||||
cfg->rsx.d3d12.overlay = chbox_gs_overlay->GetValue();
|
||||
|
||||
cfg->audio.out = cbox_audio_out->GetSelection();
|
||||
|
||||
cfg->io.pad_handler_mode = cbox_pad_handler->GetSelection();
|
||||
cfg->io.keyboard_handler_mode = cbox_keyboard_handler->GetSelection();
|
||||
cfg->io.mouse_handler_mode = cbox_mouse_handler->GetSelection();
|
||||
cfg->io.camera = cbox_camera->GetSelection();
|
||||
cfg->io.camera_type = cbox_camera_type->GetSelection();
|
||||
|
||||
|
||||
// global settings
|
||||
rpcs3::config.rsx.log_programs = chbox_gs_log_prog->GetValue();
|
||||
rpcs3::config.rsx.vsync = chbox_gs_vsync->GetValue();
|
||||
rpcs3::config.rsx._3dtv = chbox_gs_3dmonitor->GetValue();
|
||||
rpcs3::config.audio.dump_to_file = chbox_audio_dump->GetValue();
|
||||
rpcs3::config.audio.convert_to_u16 = chbox_audio_conv->GetValue();
|
||||
rpcs3::config.misc.log.level = cbox_hle_loglvl->GetSelection();
|
||||
rpcs3::config.misc.log.hle_logging = chbox_hle_logging->GetValue();
|
||||
rpcs3::config.misc.log.rsx_logging = chbox_rsx_logging->GetValue();
|
||||
rpcs3::config.misc.log.save_tty = chbox_hle_savetty->GetValue();
|
||||
rpcs3::config.misc.net.status = cbox_net_status->GetSelection();
|
||||
rpcs3::config.misc.net._interface = cbox_net_interface->GetSelection();
|
||||
rpcs3::config.misc.debug.auto_pause_syscall = chbox_dbg_ap_systemcall->GetValue();
|
||||
rpcs3::config.misc.debug.auto_pause_func_call = chbox_dbg_ap_functioncall->GetValue();
|
||||
rpcs3::config.misc.always_start = chbox_hle_always_start->GetValue();
|
||||
rpcs3::config.misc.exit_on_stop = chbox_hle_exitonstop->GetValue();
|
||||
rpcs3::config.misc.use_default_ini = chbox_hle_use_default_ini->GetValue();
|
||||
rpcs3::config.system.language = cbox_sys_lang->GetSelection();
|
||||
rpcs3::config.system.emulation_dir_path_enable = chbox_emulationdir_enable->GetValue();
|
||||
rpcs3::config.system.emulation_dir_path = txt_emulationdir_path->GetValue().ToStdString();*/
|
||||
//rpcs3::config.save();
|
||||
|
||||
cfg->save();
|
||||
Ini.Save();
|
||||
|
507
rpcs3/config.h
507
rpcs3/config.h
@ -53,6 +53,34 @@ enum class rsx_renderer_type
|
||||
DX12
|
||||
};
|
||||
|
||||
enum class rsx_aspect_ratio
|
||||
{
|
||||
_16x9 = 1,
|
||||
_4x3
|
||||
};
|
||||
|
||||
enum class rsx_frame_limit
|
||||
{
|
||||
Off,
|
||||
_50,
|
||||
_59_94,
|
||||
_30,
|
||||
_60,
|
||||
Auto
|
||||
};
|
||||
|
||||
enum class rsx_resolution
|
||||
{
|
||||
_1920x1080,
|
||||
_1280x720,
|
||||
_720x480,
|
||||
_720x576,
|
||||
_1600x1080,
|
||||
_1440x1080,
|
||||
_1280x1080,
|
||||
_960x1080
|
||||
};
|
||||
|
||||
namespace convert
|
||||
{
|
||||
template<>
|
||||
@ -88,6 +116,136 @@ namespace convert
|
||||
return rsx_renderer_type::Null;
|
||||
}
|
||||
};
|
||||
|
||||
template<>
|
||||
struct to_impl_t<std::string, rsx_aspect_ratio>
|
||||
{
|
||||
static std::string func(rsx_aspect_ratio value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case rsx_aspect_ratio::_16x9: return "16x9";
|
||||
case rsx_aspect_ratio::_4x3: return "4x3";
|
||||
}
|
||||
|
||||
return "Unknown";
|
||||
}
|
||||
};
|
||||
|
||||
template<>
|
||||
struct to_impl_t<rsx_aspect_ratio, std::string>
|
||||
{
|
||||
static rsx_aspect_ratio func(const std::string &value)
|
||||
{
|
||||
if (value == "16x9")
|
||||
return rsx_aspect_ratio::_16x9;
|
||||
|
||||
if (value == "4x3")
|
||||
return rsx_aspect_ratio::_4x3;
|
||||
|
||||
return rsx_aspect_ratio::_16x9;
|
||||
}
|
||||
};
|
||||
|
||||
template<>
|
||||
struct to_impl_t<std::string, rsx_frame_limit>
|
||||
{
|
||||
static std::string func(rsx_frame_limit value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case rsx_frame_limit::Off: return "Off";
|
||||
case rsx_frame_limit::_50: return "50";
|
||||
case rsx_frame_limit::_59_94: return "59.94";
|
||||
case rsx_frame_limit::_30: return "30";
|
||||
case rsx_frame_limit::_60: return "60";
|
||||
case rsx_frame_limit::Auto: return "Auto";
|
||||
}
|
||||
|
||||
return "Unknown";
|
||||
}
|
||||
};
|
||||
|
||||
template<>
|
||||
struct to_impl_t<rsx_frame_limit, std::string>
|
||||
{
|
||||
static rsx_frame_limit func(const std::string &value)
|
||||
{
|
||||
if (value == "Off")
|
||||
return rsx_frame_limit::Off;
|
||||
|
||||
if (value == "50")
|
||||
return rsx_frame_limit::_50;
|
||||
|
||||
if (value == "59.94")
|
||||
return rsx_frame_limit::_59_94;
|
||||
|
||||
if (value == "30")
|
||||
return rsx_frame_limit::_30;
|
||||
|
||||
if (value == "60")
|
||||
return rsx_frame_limit::_60;
|
||||
|
||||
if (value == "Auto")
|
||||
return rsx_frame_limit::Auto;
|
||||
|
||||
return rsx_frame_limit::Off;
|
||||
}
|
||||
};
|
||||
|
||||
template<>
|
||||
struct to_impl_t<std::string, rsx_resolution>
|
||||
{
|
||||
static std::string func(rsx_resolution value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case rsx_resolution::_1920x1080: return "1920x1080";
|
||||
case rsx_resolution::_1280x720: return "1280x720";
|
||||
case rsx_resolution::_720x480: return "720x480";
|
||||
case rsx_resolution::_720x576: return "720x576";
|
||||
case rsx_resolution::_1600x1080: return "1600x1080";
|
||||
case rsx_resolution::_1440x1080: return "1440x1080";
|
||||
case rsx_resolution::_1280x1080: return "1280x1080";
|
||||
case rsx_resolution::_960x1080: return "960x1080";
|
||||
}
|
||||
|
||||
return "Unknown";
|
||||
}
|
||||
};
|
||||
|
||||
template<>
|
||||
struct to_impl_t<rsx_resolution, std::string>
|
||||
{
|
||||
static rsx_resolution func(const std::string &value)
|
||||
{
|
||||
if (value == "1920x1080")
|
||||
return rsx_resolution::_1920x1080;
|
||||
|
||||
if (value == "1280x720")
|
||||
return rsx_resolution::_1280x720;
|
||||
|
||||
if (value == "720x480")
|
||||
return rsx_resolution::_720x480;
|
||||
|
||||
if (value == "720x576")
|
||||
return rsx_resolution::_720x576;
|
||||
|
||||
if (value == "1600x1080")
|
||||
return rsx_resolution::_1600x1080;
|
||||
|
||||
if (value == "1440x1080")
|
||||
return rsx_resolution::_1440x1080;
|
||||
|
||||
if (value == "1280x1080")
|
||||
return rsx_resolution::_1280x1080;
|
||||
|
||||
if (value == "960x1080")
|
||||
return rsx_resolution::_960x1080;
|
||||
|
||||
return rsx_resolution::_720x480;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
enum class ppu_decoder_type
|
||||
@ -134,7 +292,6 @@ namespace convert
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
enum class spu_decoder_type
|
||||
{
|
||||
interpreter_precise,
|
||||
@ -179,6 +336,233 @@ namespace convert
|
||||
};
|
||||
}
|
||||
|
||||
enum class io_camera_state
|
||||
{
|
||||
null,
|
||||
connected
|
||||
};
|
||||
|
||||
enum class io_camera_type
|
||||
{
|
||||
unknown,
|
||||
eye_toy,
|
||||
play_station_eye,
|
||||
usb_video_class_1_1
|
||||
};
|
||||
|
||||
enum class io_handler_mode
|
||||
{
|
||||
null,
|
||||
windows,
|
||||
xinput
|
||||
};
|
||||
|
||||
namespace convert
|
||||
{
|
||||
template<>
|
||||
struct to_impl_t<std::string, io_camera_state>
|
||||
{
|
||||
static std::string func(io_camera_state value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case io_camera_state::null: return "null";
|
||||
case io_camera_state::connected: return "connected";
|
||||
}
|
||||
|
||||
return "Unknown";
|
||||
}
|
||||
};
|
||||
|
||||
template<>
|
||||
struct to_impl_t<io_camera_state, std::string>
|
||||
{
|
||||
static io_camera_state func(const std::string &value)
|
||||
{
|
||||
if (value == "null")
|
||||
return io_camera_state::null;
|
||||
|
||||
if (value == "connected")
|
||||
return io_camera_state::connected;
|
||||
|
||||
return io_camera_state::null;
|
||||
}
|
||||
};
|
||||
|
||||
template<>
|
||||
struct to_impl_t<std::string, enum class io_camera_type>
|
||||
{
|
||||
static std::string func(io_camera_type value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case io_camera_type::unknown: return "Unknown";
|
||||
case io_camera_type::eye_toy: return "EyeToy";
|
||||
case io_camera_type::play_station_eye: return "PlayStationEye";
|
||||
case io_camera_type::usb_video_class_1_1: return "UsbVideoClass1.1";
|
||||
}
|
||||
return "Unknown";
|
||||
}
|
||||
};
|
||||
|
||||
template<>
|
||||
struct to_impl_t<io_camera_type, std::string>
|
||||
{
|
||||
static io_camera_type func(const std::string &value)
|
||||
{
|
||||
if (value == "Unknown")
|
||||
return io_camera_type::unknown;
|
||||
|
||||
if (value == "EyeToy")
|
||||
return io_camera_type::eye_toy;
|
||||
|
||||
if (value == "PlayStationEye")
|
||||
return io_camera_type::play_station_eye;
|
||||
|
||||
if (value == "UsbVideoClass1.1")
|
||||
return io_camera_type::usb_video_class_1_1;
|
||||
|
||||
return io_camera_type::unknown;
|
||||
}
|
||||
};
|
||||
|
||||
template<>
|
||||
struct to_impl_t<std::string, enum class io_handler_mode>
|
||||
{
|
||||
static std::string func(io_handler_mode value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case io_handler_mode::null: return "null";
|
||||
case io_handler_mode::windows: return "windows";
|
||||
case io_handler_mode::xinput: return "xinput";
|
||||
}
|
||||
return "Unknown";
|
||||
}
|
||||
};
|
||||
|
||||
template<>
|
||||
struct to_impl_t<io_handler_mode, std::string>
|
||||
{
|
||||
static io_handler_mode func(const std::string &value)
|
||||
{
|
||||
if (value == "null")
|
||||
return io_handler_mode::null;
|
||||
|
||||
if (value == "windows")
|
||||
return io_handler_mode::windows;
|
||||
|
||||
if (value == "xinput")
|
||||
return io_handler_mode::xinput;
|
||||
|
||||
return io_handler_mode::null;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
enum class misc_log_level
|
||||
{
|
||||
all,
|
||||
warnings,
|
||||
success,
|
||||
errors,
|
||||
nothing
|
||||
};
|
||||
|
||||
enum class misc_net_status
|
||||
{
|
||||
ip_obtained,
|
||||
obtaining_ip,
|
||||
connecting,
|
||||
disconnected
|
||||
};
|
||||
|
||||
namespace convert
|
||||
{
|
||||
template<>
|
||||
struct to_impl_t<std::string, misc_log_level>
|
||||
{
|
||||
static std::string func(misc_log_level value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case misc_log_level::all: return "All";
|
||||
case misc_log_level::warnings: return "Warnings";
|
||||
case misc_log_level::success: return "Success";
|
||||
case misc_log_level::errors: return "Errors";
|
||||
case misc_log_level::nothing: return "Nothing";
|
||||
}
|
||||
|
||||
return "Unknown";
|
||||
}
|
||||
};
|
||||
|
||||
template<>
|
||||
struct to_impl_t<misc_log_level, std::string>
|
||||
{
|
||||
static misc_log_level func(const std::string &value)
|
||||
{
|
||||
if (value == "All")
|
||||
return misc_log_level::all;
|
||||
|
||||
if (value == "Warnings")
|
||||
return misc_log_level::warnings;
|
||||
|
||||
if (value == "Success")
|
||||
return misc_log_level::success;
|
||||
|
||||
if (value == "Errors")
|
||||
return misc_log_level::errors;
|
||||
|
||||
if (value == "Nothing")
|
||||
return misc_log_level::nothing;
|
||||
|
||||
return misc_log_level::errors;
|
||||
}
|
||||
};
|
||||
|
||||
template<>
|
||||
struct to_impl_t<std::string, misc_net_status>
|
||||
{
|
||||
static std::string func(misc_net_status value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case misc_net_status::ip_obtained: return "IPObtained";
|
||||
case misc_net_status::obtaining_ip: return "ObtainingIP";
|
||||
case misc_net_status::connecting: return "Connecting";
|
||||
case misc_net_status::disconnected: return "Disconnected";
|
||||
}
|
||||
|
||||
return "Unknown";
|
||||
}
|
||||
};
|
||||
|
||||
template<>
|
||||
struct to_impl_t<misc_net_status, std::string>
|
||||
{
|
||||
static misc_net_status func(const std::string &value)
|
||||
{
|
||||
if (value == "IPObtained")
|
||||
return misc_net_status::ip_obtained;
|
||||
|
||||
if (value == "ObtainingIP")
|
||||
return misc_net_status::obtaining_ip;
|
||||
|
||||
if (value == "Connecting")
|
||||
return misc_net_status::connecting;
|
||||
|
||||
if (value == "Disconnected")
|
||||
return misc_net_status::disconnected;
|
||||
|
||||
return misc_net_status::connecting;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
namespace rpcs3
|
||||
{
|
||||
class config_t : public config_context_t
|
||||
@ -190,9 +574,21 @@ namespace rpcs3
|
||||
{
|
||||
core_group(config_context_t *cfg) : group{ cfg, "core" } {}
|
||||
|
||||
entry<ppu_decoder_type> ppu_decoder{ this, "PPU Decoder", ppu_decoder_type::interpreter };
|
||||
entry<spu_decoder_type> spu_decoder{ this, "SPU Decoder", spu_decoder_type::interpreter_precise };
|
||||
entry<bool> load_liblv2{ this, "Load liblv2.sprx", false };
|
||||
struct llvm_group : protected group
|
||||
{
|
||||
llvm_group(group *grp) : group{ grp, "llvm" } {}
|
||||
|
||||
entry<bool> exclusion_range { this, "Compiled blocks exclusion", false };
|
||||
entry<u32> min_id { this, "Excluded block range min", 200 };
|
||||
entry<u32> max_id { this, "Excluded block range max", 250 };
|
||||
entry<u32> threshold { this, "Compilation threshold", 1000 };
|
||||
} llvm{ this };
|
||||
|
||||
entry<ppu_decoder_type> ppu_decoder { this, "PPU Decoder", ppu_decoder_type::interpreter };
|
||||
entry<spu_decoder_type> spu_decoder { this, "SPU Decoder", spu_decoder_type::interpreter_precise };
|
||||
entry<bool> hook_st_func { this, "Hook static functions", false };
|
||||
entry<bool> load_liblv2 { this, "Load liblv2.sprx", false };
|
||||
|
||||
} core{ this };
|
||||
|
||||
struct rsx_group : protected group
|
||||
@ -201,37 +597,126 @@ namespace rpcs3
|
||||
{
|
||||
opengl_group(group *grp) : group{ grp, "opengl" } {}
|
||||
|
||||
entry<bool> write_color_buffers{ this, "Write Color Buffers", true };
|
||||
entry<bool> write_depth_buffer{ this, "Write Depth Buffer", true };
|
||||
entry<bool> read_color_buffers{ this, "Read Color Buffers", true };
|
||||
entry<bool> read_depth_buffer{ this, "Read Depth Buffer", true };
|
||||
entry<bool> write_color_buffers { this, "Write Color Buffers", true };
|
||||
entry<bool> write_depth_buffer { this, "Write Depth Buffer", true };
|
||||
entry<bool> read_color_buffers { this, "Read Color Buffers", true };
|
||||
entry<bool> read_depth_buffer { this, "Read Depth Buffer", true };
|
||||
} opengl{ this };
|
||||
|
||||
struct d3d12_group : protected group
|
||||
{
|
||||
d3d12_group(group *grp) : group{ grp, "d3d12" } {}
|
||||
|
||||
entry<u32> adaptater { this, "D3D Adaptater", 1 };
|
||||
entry<bool> debug_output { this, "Debug Output", true };
|
||||
entry<bool> overlay { this, "Debug overlay", true };
|
||||
} d3d12{ this };
|
||||
|
||||
rsx_group(config_context_t *cfg) : group{ cfg, "rsx" } {}
|
||||
|
||||
entry<rsx_renderer_type> renderer{ this, "Renderer", rsx_renderer_type::OpenGL };
|
||||
entry<rsx_renderer_type> renderer { this, "Renderer", rsx_renderer_type::OpenGL };
|
||||
entry<rsx_resolution> resolution { this, "Resolution", rsx_resolution::_720x480 };
|
||||
entry<rsx_aspect_ratio> aspect_ratio{ this, "Aspect ratio", rsx_aspect_ratio::_16x9 };
|
||||
entry<rsx_frame_limit> frame_limit { this, "Frame limit", rsx_frame_limit::Off };
|
||||
entry<bool> log_programs { this, "Log shader programs", false };
|
||||
entry<bool> vsync { this, "VSync", false };
|
||||
entry<bool> _3dtv { this, "3D Monitor", false };
|
||||
|
||||
} rsx{ this };
|
||||
|
||||
struct audio_group : protected group
|
||||
{
|
||||
audio_group(config_context_t *cfg) : group{ cfg, "audio" } {}
|
||||
|
||||
entry<audio_output_type> test{ this, "Audio Out", audio_output_type::OpenAL };
|
||||
entry<audio_output_type> out{ this, "Audio Out", audio_output_type::OpenAL };
|
||||
entry<bool> dump_to_file { this, "Dump to file", false };
|
||||
entry<bool> convert_to_u16 { this, "Convert to 16 bit", false };
|
||||
} audio{ this };
|
||||
|
||||
struct io_group : protected group
|
||||
{
|
||||
io_group(config_context_t *cfg) : group{ cfg, "io" } {}
|
||||
|
||||
entry<io_camera_state> camera { this, "Camera", io_camera_state::connected };
|
||||
entry<io_camera_type> camera_type { this, "Camera type", io_camera_type::play_station_eye };
|
||||
entry<io_handler_mode> pad_handler_mode { this, "Pad Handler", io_handler_mode::windows };
|
||||
entry<io_handler_mode> keyboard_handler_mode{ this, "Keyboard Handler", io_handler_mode::null };
|
||||
entry<io_handler_mode> mouse_handler_mode { this, "Mouse Handler", io_handler_mode::null };
|
||||
|
||||
struct pad_group : protected group
|
||||
{
|
||||
pad_group(group *grp) : group{ grp, "pad" } {}
|
||||
|
||||
entry<int> left_stick_left { this, "Left Analog Stick Left", 314 };
|
||||
entry<int> left_stick_down { this, "Left Analog Stick Down", 317 };
|
||||
entry<int> left_stick_right { this, "Left Analog Stick Right", 316 };
|
||||
entry<int> left_stick_up { this, "Left Analog Stick Up", 315 };
|
||||
entry<int> right_stick_left { this, "Right Analog Stick Left", 313 };
|
||||
entry<int> right_stick_down { this, "Right Analog Stick Down", 367 };
|
||||
entry<int> right_stick_right{ this, "Right Analog Stick Right", 312 };
|
||||
entry<int> right_stick_up { this, "Right Analog Stick Up", 366 };
|
||||
entry<int> start { this, "Start", 13 };
|
||||
entry<int> select { this, "Select", 32 };
|
||||
entry<int> square { this, "Square", static_cast<int>('J') };
|
||||
entry<int> cross { this, "Cross", static_cast<int>('K') };
|
||||
entry<int> circle { this, "Circle", static_cast<int>('L') };
|
||||
entry<int> triangle { this, "Triangle", static_cast<int>('I') };
|
||||
entry<int> left { this, "Left", static_cast<int>('A') };
|
||||
entry<int> down { this, "Down", static_cast<int>('S') };
|
||||
entry<int> right { this, "Right", static_cast<int>('D') };
|
||||
entry<int> up { this, "Up", static_cast<int>('W') };
|
||||
entry<int> r1 { this, "R1", static_cast<int>('3') };
|
||||
entry<int> r2 { this, "R2", static_cast<int>('E') };
|
||||
entry<int> r3 { this, "R3", static_cast<int>('C') };
|
||||
entry<int> l1 { this, "L1", static_cast<int>('1') };
|
||||
entry<int> l2 { this, "L2", static_cast<int>('Q') };
|
||||
entry<int> l3 { this, "L3", static_cast<int>('Z') };
|
||||
} pad{ this };
|
||||
|
||||
} io{ this };
|
||||
|
||||
struct misc_group : protected group
|
||||
{
|
||||
misc_group(config_context_t *cfg) : group{ cfg, "misc" } {}
|
||||
|
||||
struct log_group : protected group
|
||||
{
|
||||
log_group(group *grp) : group{ grp, "log" } {}
|
||||
|
||||
entry<misc_log_level> level { this, "Log Level", misc_log_level::errors };
|
||||
entry<bool> hle_logging { this, "Log everything", false };
|
||||
entry<bool> rsx_logging { this, "RSX Logging", false };
|
||||
entry<bool> save_tty { this, "Save TTY output to file", false };
|
||||
} log{ this };
|
||||
|
||||
struct net_group : protected group
|
||||
{
|
||||
net_group(group *grp) : group{ grp, "net" } {}
|
||||
|
||||
entry<misc_net_status> status{ this, "Connection status", misc_net_status::connecting };
|
||||
entry<u32> _interface { this, "Network adapter", 0 };
|
||||
} net{ this };
|
||||
|
||||
struct debug_group : protected group
|
||||
{
|
||||
debug_group(group *grp) : group{ grp, "debug" } {}
|
||||
|
||||
entry<bool> auto_pause_syscall { this, "Auto Pause at System Call", false };
|
||||
entry<bool> auto_pause_func_call { this, "Auto Pause at Function Call", false };
|
||||
} debug{ this };
|
||||
|
||||
entry<bool> exit_on_stop { this, "Exit RPCS3 when process finishes", false };
|
||||
entry<bool> always_start { this, "Always start after boot", true };
|
||||
entry<bool> use_default_ini { this, "Use default configuration", false };
|
||||
} misc{ this };
|
||||
|
||||
struct system_group : protected group
|
||||
{
|
||||
system_group(config_context_t *cfg) : group{ cfg, "system" } {}
|
||||
|
||||
entry<u32> language { this, "Language", 1 };
|
||||
entry<std::string> emulation_dir_path{ this, "Emulation dir path", "" };
|
||||
entry<bool> emulation_dir_path_enable{ this, "Use path below as EmulationDir", false };
|
||||
} system{ this };
|
||||
|
||||
config_t() = default;
|
||||
@ -250,4 +735,4 @@ namespace rpcs3
|
||||
};
|
||||
|
||||
extern config_t config;
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
#include "stdafx_gui.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/state.h"
|
||||
#include "rpcs3.h"
|
||||
#include "Ini.h"
|
||||
#include "Utilities/Log.h"
|
||||
@ -83,34 +84,34 @@ bool Rpcs3App::OnInit()
|
||||
|
||||
callbacks.get_kb_handler = []() -> std::unique_ptr<KeyboardHandlerBase>
|
||||
{
|
||||
switch (auto mode = Ini.KeyboardHandlerMode.GetValue())
|
||||
switch (auto mode = rpcs3::config.io.pad_handler_mode.value())
|
||||
{
|
||||
case 0: return std::make_unique<NullKeyboardHandler>();
|
||||
case 1: return std::make_unique<WindowsKeyboardHandler>();
|
||||
default: throw EXCEPTION("Invalid Keyboard Handler Mode %d", +mode);
|
||||
case io_handler_mode::null: return std::make_unique<NullKeyboardHandler>();
|
||||
case io_handler_mode::windows: return std::make_unique<WindowsKeyboardHandler>();
|
||||
default: throw EXCEPTION("Invalid Keyboard Handler Mode %d", +(u32)mode);
|
||||
}
|
||||
};
|
||||
|
||||
callbacks.get_mouse_handler = []() -> std::unique_ptr<MouseHandlerBase>
|
||||
{
|
||||
switch (auto mode = Ini.MouseHandlerMode.GetValue())
|
||||
switch (auto mode = rpcs3::config.io.mouse_handler_mode.value())
|
||||
{
|
||||
case 0: return std::make_unique<NullMouseHandler>();
|
||||
case 1: return std::make_unique<WindowsMouseHandler>();
|
||||
default: throw EXCEPTION("Invalid Mouse Handler Mode %d", +mode);
|
||||
case io_handler_mode::null: return std::make_unique<NullMouseHandler>();
|
||||
case io_handler_mode::windows: return std::make_unique<WindowsMouseHandler>();
|
||||
default: throw EXCEPTION("Invalid Mouse Handler Mode %d", +(u32)mode);
|
||||
}
|
||||
};
|
||||
|
||||
callbacks.get_pad_handler = []() -> std::unique_ptr<PadHandlerBase>
|
||||
{
|
||||
switch (auto mode = Ini.PadHandlerMode.GetValue())
|
||||
switch (auto mode = rpcs3::config.io.pad_handler_mode.value())
|
||||
{
|
||||
case 0: return std::make_unique<NullPadHandler>();
|
||||
case 1: return std::make_unique<WindowsPadHandler>();
|
||||
case io_handler_mode::null: return std::make_unique<NullPadHandler>();
|
||||
case io_handler_mode::windows: return std::make_unique<WindowsPadHandler>();
|
||||
#if defined(_WIN32)
|
||||
case 2: return std::make_unique<XInputPadHandler>();
|
||||
case io_handler_mode::xinput: return std::make_unique<XInputPadHandler>();
|
||||
#endif
|
||||
default: throw EXCEPTION("Invalid Pad Handler Mode %d", +mode);
|
||||
default: throw EXCEPTION("Invalid Pad Handler Mode %d", +(u32)mode);
|
||||
}
|
||||
};
|
||||
|
||||
@ -173,8 +174,8 @@ void Rpcs3App::OnArguments(const wxCmdLineParser& parser)
|
||||
|
||||
if (parser.FoundSwitch("t"))
|
||||
{
|
||||
HLEExitOnStop = Ini.HLEExitOnStop.GetValue();
|
||||
Ini.HLEExitOnStop.SetValue(true);
|
||||
HLEExitOnStop = rpcs3::config.misc.exit_on_stop.value();
|
||||
rpcs3::config.misc.exit_on_stop = true;
|
||||
if (parser.GetParamCount() != 1)
|
||||
{
|
||||
wxLogDebug(wxT("A (S)ELF file needs to be given in test mode, exiting."));
|
||||
@ -194,7 +195,7 @@ void Rpcs3App::Exit()
|
||||
{
|
||||
if (parser.FoundSwitch("t"))
|
||||
{
|
||||
Ini.HLEExitOnStop.SetValue(HLEExitOnStop);
|
||||
rpcs3::config.misc.exit_on_stop = HLEExitOnStop;
|
||||
}
|
||||
|
||||
Emu.Stop();
|
||||
|
Loading…
x
Reference in New Issue
Block a user