2014-09-12 19:06:13 -05:00
|
|
|
// Copyright 2014 Citra Emulator Project
|
2014-12-16 23:38:14 -06:00
|
|
|
// Licensed under GPLv2 or any later version
|
2014-09-12 19:06:13 -05:00
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2015-06-19 22:34:45 -05:00
|
|
|
#include <array>
|
2019-01-18 15:32:16 -06:00
|
|
|
#include <atomic>
|
2016-09-17 19:38:01 -05:00
|
|
|
#include <string>
|
2018-08-09 14:10:11 -05:00
|
|
|
#include <unordered_map>
|
2018-12-28 18:24:56 -06:00
|
|
|
#include <vector>
|
2016-04-30 10:34:51 -05:00
|
|
|
#include "common/common_types.h"
|
2016-12-21 12:05:56 -06:00
|
|
|
#include "core/hle/service/cam/cam.h"
|
2014-12-06 16:00:08 -06:00
|
|
|
|
2014-09-12 19:06:13 -05:00
|
|
|
namespace Settings {
|
|
|
|
|
2018-08-26 12:47:45 -05:00
|
|
|
enum class InitClock {
|
|
|
|
SystemTime = 0,
|
|
|
|
FixedTime = 1,
|
|
|
|
};
|
|
|
|
|
2016-05-03 01:07:17 -05:00
|
|
|
enum class LayoutOption {
|
|
|
|
Default,
|
|
|
|
SingleScreen,
|
|
|
|
LargeScreen,
|
2017-08-25 16:53:07 -05:00
|
|
|
SideScreen,
|
2016-05-03 01:07:17 -05:00
|
|
|
};
|
|
|
|
|
2019-03-06 12:16:43 -06:00
|
|
|
enum class MicInputType {
|
|
|
|
None,
|
|
|
|
Real,
|
|
|
|
Static,
|
|
|
|
};
|
|
|
|
|
2017-01-20 14:46:39 -06:00
|
|
|
namespace NativeButton {
|
|
|
|
enum Values {
|
|
|
|
A,
|
|
|
|
B,
|
|
|
|
X,
|
|
|
|
Y,
|
|
|
|
Up,
|
|
|
|
Down,
|
|
|
|
Left,
|
|
|
|
Right,
|
|
|
|
L,
|
|
|
|
R,
|
|
|
|
Start,
|
|
|
|
Select,
|
2018-12-28 13:33:54 -06:00
|
|
|
Debug,
|
2018-12-28 17:13:37 -06:00
|
|
|
Gpio14,
|
2017-01-20 14:46:39 -06:00
|
|
|
|
|
|
|
ZL,
|
|
|
|
ZR,
|
|
|
|
|
|
|
|
Home,
|
|
|
|
|
|
|
|
NumButtons,
|
|
|
|
};
|
|
|
|
|
|
|
|
constexpr int BUTTON_HID_BEGIN = A;
|
|
|
|
constexpr int BUTTON_IR_BEGIN = ZL;
|
|
|
|
constexpr int BUTTON_NS_BEGIN = Home;
|
|
|
|
|
|
|
|
constexpr int BUTTON_HID_END = BUTTON_IR_BEGIN;
|
|
|
|
constexpr int BUTTON_IR_END = BUTTON_NS_BEGIN;
|
|
|
|
constexpr int BUTTON_NS_END = NumButtons;
|
|
|
|
|
|
|
|
constexpr int NUM_BUTTONS_HID = BUTTON_HID_END - BUTTON_HID_BEGIN;
|
|
|
|
constexpr int NUM_BUTTONS_IR = BUTTON_IR_END - BUTTON_IR_BEGIN;
|
|
|
|
constexpr int NUM_BUTTONS_NS = BUTTON_NS_END - BUTTON_NS_BEGIN;
|
|
|
|
|
|
|
|
static const std::array<const char*, NumButtons> mapping = {{
|
2018-03-09 11:54:43 -06:00
|
|
|
"button_a",
|
|
|
|
"button_b",
|
|
|
|
"button_x",
|
|
|
|
"button_y",
|
|
|
|
"button_up",
|
|
|
|
"button_down",
|
|
|
|
"button_left",
|
|
|
|
"button_right",
|
|
|
|
"button_l",
|
|
|
|
"button_r",
|
|
|
|
"button_start",
|
|
|
|
"button_select",
|
2018-12-28 13:33:54 -06:00
|
|
|
"button_debug",
|
2018-12-28 17:13:37 -06:00
|
|
|
"button_gpio14",
|
2018-03-09 11:54:43 -06:00
|
|
|
"button_zl",
|
|
|
|
"button_zr",
|
|
|
|
"button_home",
|
2017-01-20 14:46:39 -06:00
|
|
|
}};
|
|
|
|
} // namespace NativeButton
|
|
|
|
|
2017-01-20 15:58:03 -06:00
|
|
|
namespace NativeAnalog {
|
|
|
|
enum Values {
|
|
|
|
CirclePad,
|
|
|
|
CStick,
|
|
|
|
|
|
|
|
NumAnalogs,
|
|
|
|
};
|
|
|
|
|
|
|
|
static const std::array<const char*, NumAnalogs> mapping = {{
|
2018-03-09 11:54:43 -06:00
|
|
|
"circle_pad",
|
|
|
|
"c_stick",
|
2017-01-20 15:58:03 -06:00
|
|
|
}};
|
2017-08-25 16:53:07 -05:00
|
|
|
} // namespace NativeAnalog
|
2017-01-20 15:58:03 -06:00
|
|
|
|
2018-12-28 18:24:56 -06:00
|
|
|
struct InputProfile {
|
|
|
|
std::string name;
|
2017-01-20 14:46:39 -06:00
|
|
|
std::array<std::string, NativeButton::NumButtons> buttons;
|
2017-01-20 15:58:03 -06:00
|
|
|
std::array<std::string, NativeAnalog::NumAnalogs> analogs;
|
2017-08-06 14:54:19 -05:00
|
|
|
std::string motion_device;
|
2017-08-08 13:34:17 -05:00
|
|
|
std::string touch_device;
|
2018-01-18 09:43:17 -06:00
|
|
|
std::string udp_input_address;
|
|
|
|
u16 udp_input_port;
|
2018-08-10 01:15:26 -05:00
|
|
|
u8 udp_pad_index;
|
2018-12-28 18:24:56 -06:00
|
|
|
};
|
|
|
|
|
2014-09-12 19:06:13 -05:00
|
|
|
struct Values {
|
2016-04-20 05:12:05 -05:00
|
|
|
// CheckNew3DS
|
2016-05-24 16:22:44 -05:00
|
|
|
bool is_new_3ds;
|
2016-04-20 05:12:05 -05:00
|
|
|
|
2018-12-28 22:31:55 -06:00
|
|
|
// Controls
|
|
|
|
InputProfile current_input_profile; ///< The current input profile
|
|
|
|
int current_input_profile_index; ///< The current input profile index
|
2018-12-28 20:00:09 -06:00
|
|
|
std::vector<InputProfile> input_profiles; ///< The list of input profiles
|
2017-01-20 14:46:39 -06:00
|
|
|
|
2014-10-25 14:54:44 -05:00
|
|
|
// Core
|
2016-09-01 22:18:01 -05:00
|
|
|
bool use_cpu_jit;
|
2014-10-25 14:54:44 -05:00
|
|
|
|
|
|
|
// Data Storage
|
2014-10-09 21:43:40 -05:00
|
|
|
bool use_virtual_sd;
|
2014-10-27 16:18:28 -05:00
|
|
|
|
2018-08-26 12:47:45 -05:00
|
|
|
// System
|
2015-01-31 17:11:51 -06:00
|
|
|
int region_value;
|
2018-08-26 12:47:45 -05:00
|
|
|
InitClock init_clock;
|
|
|
|
u64 init_time;
|
2015-01-31 17:11:51 -06:00
|
|
|
|
2015-04-03 17:35:51 -05:00
|
|
|
// Renderer
|
2019-01-30 14:11:39 -06:00
|
|
|
bool use_gles;
|
2015-05-03 14:34:48 -05:00
|
|
|
bool use_hw_renderer;
|
2018-05-13 02:44:47 -05:00
|
|
|
bool use_hw_shader;
|
|
|
|
bool shaders_accurate_gs;
|
|
|
|
bool shaders_accurate_mul;
|
2015-07-22 22:25:30 -05:00
|
|
|
bool use_shader_jit;
|
2017-11-13 23:30:11 -06:00
|
|
|
u16 resolution_factor;
|
2018-11-29 10:07:18 -06:00
|
|
|
bool vsync_enabled;
|
2018-01-25 23:24:40 -06:00
|
|
|
bool use_frame_limit;
|
|
|
|
u16 frame_limit;
|
2015-05-03 14:34:48 -05:00
|
|
|
|
2016-05-03 01:07:17 -05:00
|
|
|
LayoutOption layout_option;
|
|
|
|
bool swap_screen;
|
2017-02-01 02:22:47 -06:00
|
|
|
bool custom_layout;
|
|
|
|
u16 custom_top_left;
|
|
|
|
u16 custom_top_top;
|
|
|
|
u16 custom_top_right;
|
|
|
|
u16 custom_top_bottom;
|
|
|
|
u16 custom_bottom_left;
|
|
|
|
u16 custom_bottom_top;
|
|
|
|
u16 custom_bottom_right;
|
|
|
|
u16 custom_bottom_bottom;
|
2016-05-03 01:07:17 -05:00
|
|
|
|
2015-04-03 17:35:51 -05:00
|
|
|
float bg_red;
|
|
|
|
float bg_green;
|
|
|
|
float bg_blue;
|
|
|
|
|
2018-04-06 08:21:01 -05:00
|
|
|
bool toggle_3d;
|
2019-01-18 15:32:16 -06:00
|
|
|
std::atomic<u8> factor_3d;
|
2018-04-06 08:21:01 -05:00
|
|
|
|
2016-04-27 07:53:23 -05:00
|
|
|
// Audio
|
2018-12-06 10:13:13 -06:00
|
|
|
bool enable_dsp_lle;
|
2018-12-19 18:45:22 -06:00
|
|
|
bool enable_dsp_lle_multithread;
|
2016-04-27 07:53:23 -05:00
|
|
|
std::string sink_id;
|
2016-08-31 10:59:37 -05:00
|
|
|
bool enable_audio_stretching;
|
2017-01-25 21:33:26 -06:00
|
|
|
std::string audio_device_id;
|
2018-06-30 07:26:38 -05:00
|
|
|
float volume;
|
2019-03-06 12:16:43 -06:00
|
|
|
MicInputType mic_input_type;
|
2019-02-27 16:13:51 -06:00
|
|
|
std::string mic_input_device;
|
2016-04-27 07:53:23 -05:00
|
|
|
|
2016-12-21 12:05:56 -06:00
|
|
|
// Camera
|
|
|
|
std::array<std::string, Service::CAM::NumCameras> camera_name;
|
|
|
|
std::array<std::string, Service::CAM::NumCameras> camera_config;
|
2018-05-19 20:07:37 -05:00
|
|
|
std::array<int, Service::CAM::NumCameras> camera_flip;
|
2016-12-21 12:05:56 -06:00
|
|
|
|
2015-09-02 07:56:38 -05:00
|
|
|
// Debugging
|
|
|
|
bool use_gdbstub;
|
|
|
|
u16 gdbstub_port;
|
2018-02-19 18:51:27 -06:00
|
|
|
std::string log_filter;
|
2018-08-09 14:10:11 -05:00
|
|
|
std::unordered_map<std::string, bool> lle_modules;
|
2017-06-27 21:46:52 -05:00
|
|
|
|
|
|
|
// WebService
|
2017-08-22 21:37:03 -05:00
|
|
|
bool enable_telemetry;
|
2018-09-12 12:07:06 -05:00
|
|
|
std::string web_api_url;
|
2017-08-22 21:37:03 -05:00
|
|
|
std::string citra_username;
|
|
|
|
std::string citra_token;
|
2014-09-12 19:06:13 -05:00
|
|
|
} extern values;
|
|
|
|
|
2016-11-30 03:32:09 -06:00
|
|
|
// a special value for Values::region_value indicating that citra will automatically select a region
|
|
|
|
// value to fit the region lockout info of the game
|
|
|
|
static constexpr int REGION_VALUE_AUTO_SELECT = -1;
|
|
|
|
|
2016-04-11 07:38:42 -05:00
|
|
|
void Apply();
|
2018-07-17 18:39:41 -05:00
|
|
|
void LogSettings();
|
2018-12-28 18:24:56 -06:00
|
|
|
|
2018-12-28 22:33:40 -06:00
|
|
|
// Input profiles
|
2018-12-28 18:24:56 -06:00
|
|
|
void LoadProfile(int index);
|
|
|
|
void SaveProfile(int index);
|
|
|
|
void CreateProfile(std::string name);
|
|
|
|
void DeleteProfile(int index);
|
|
|
|
void RenameCurrentProfile(std::string new_name);
|
2017-08-25 16:53:07 -05:00
|
|
|
} // namespace Settings
|