summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/audio_core/codec.cpp2
-rw-r--r--src/audio_core/hle/dsp.cpp3
-rw-r--r--src/audio_core/hle/dsp.h72
-rw-r--r--src/audio_core/hle/filter.cpp2
-rw-r--r--src/audio_core/hle/mixers.cpp5
-rw-r--r--src/audio_core/hle/pipe.cpp10
-rw-r--r--src/audio_core/hle/pipe.h14
-rw-r--r--src/audio_core/hle/source.cpp44
-rw-r--r--src/audio_core/interpolate.cpp20
-rw-r--r--src/audio_core/interpolate.h4
-rw-r--r--src/audio_core/null_sink.h3
-rw-r--r--src/audio_core/sink.h4
-rw-r--r--src/audio_core/sink_details.h3
-rw-r--r--src/citra/citra.cpp10
-rw-r--r--src/citra/emu_window/emu_window_sdl2.cpp1
-rw-r--r--src/citra/emu_window/emu_window_sdl2.h4
-rw-r--r--src/citra_qt/bootmanager.cpp11
-rw-r--r--src/citra_qt/bootmanager.h4
-rw-r--r--src/citra_qt/configure_audio.cpp3
-rw-r--r--src/citra_qt/configure_debug.cpp3
-rw-r--r--src/citra_qt/configure_dialog.cpp8
-rw-r--r--src/citra_qt/configure_general.cpp4
-rw-r--r--src/citra_qt/configure_graphics.cpp4
-rw-r--r--src/citra_qt/configure_input.cpp49
-rw-r--r--src/citra_qt/configure_system.cpp15
-rw-r--r--src/citra_qt/debugger/callstack.cpp3
-rw-r--r--src/citra_qt/debugger/disassembler.cpp6
-rw-r--r--src/citra_qt/debugger/graphics_breakpoints.cpp6
-rw-r--r--src/citra_qt/debugger/graphics_cmdlists.cpp3
-rw-r--r--src/citra_qt/debugger/graphics_surface.cpp11
-rw-r--r--src/citra_qt/debugger/graphics_vertex_shader.cpp3
-rw-r--r--src/citra_qt/debugger/ramview.cpp3
-rw-r--r--src/citra_qt/debugger/registers.cpp3
-rw-r--r--src/citra_qt/game_list_p.h18
-rw-r--r--src/citra_qt/hotkeys.cpp3
-rw-r--r--src/citra_qt/main.h4
-rw-r--r--src/common/bit_set.h18
-rw-r--r--src/common/chunk_file.h9
-rw-r--r--src/common/code_block.h3
-rw-r--r--src/common/common_funcs.h3
-rw-r--r--src/common/emu_window.h7
-rw-r--r--src/common/file_util.cpp3
-rw-r--r--src/common/math_util.h6
-rw-r--r--src/common/profiler.cpp3
-rw-r--r--src/common/scope_exit.h3
-rw-r--r--src/common/swap.h3
-rw-r--r--src/common/synchronized_wrapper.h3
-rw-r--r--src/common/thread.h6
-rw-r--r--src/common/vector_math.h18
-rw-r--r--src/common/x64/emitter.cpp2
-rw-r--r--src/common/x64/emitter.h6
-rw-r--r--src/core/arm/arm_interface.h3
-rw-r--r--src/core/arm/dyncom/arm_dyncom.cpp3
-rw-r--r--src/core/arm/dyncom/arm_dyncom_trans.cpp3
-rw-r--r--src/core/arm/skyeye_common/armstate.h6
-rw-r--r--src/core/arm/skyeye_common/vfp/vfpdouble.cpp2
-rw-r--r--src/core/arm/skyeye_common/vfp/vfpsingle.cpp14
-rw-r--r--src/core/core.cpp3
-rw-r--r--src/core/core_timing.cpp6
-rw-r--r--src/core/file_sys/archive_backend.h36
-rw-r--r--src/core/file_sys/archive_savedata.cpp7
-rw-r--r--src/core/file_sys/archive_savedatacheck.cpp3
-rw-r--r--src/core/file_sys/archive_systemsavedata.cpp3
-rw-r--r--src/core/file_sys/directory_backend.h6
-rw-r--r--src/core/file_sys/disk_archive.h3
-rw-r--r--src/core/file_sys/file_backend.h6
-rw-r--r--src/core/file_sys/ivfc_archive.h9
-rw-r--r--src/core/hle/applets/applet.h6
-rw-r--r--src/core/hle/applets/erreula.cpp3
-rw-r--r--src/core/hle/applets/erreula.h3
-rw-r--r--src/core/hle/applets/mii_selector.cpp3
-rw-r--r--src/core/hle/applets/mii_selector.h3
-rw-r--r--src/core/hle/applets/swkbd.h3
-rw-r--r--src/core/hle/kernel/address_arbiter.cpp6
-rw-r--r--src/core/hle/kernel/client_port.cpp6
-rw-r--r--src/core/hle/kernel/event.cpp6
-rw-r--r--src/core/hle/kernel/kernel.h3
-rw-r--r--src/core/hle/kernel/mutex.cpp6
-rw-r--r--src/core/hle/kernel/process.cpp12
-rw-r--r--src/core/hle/kernel/resource_limit.cpp9
-rw-r--r--src/core/hle/kernel/resource_limit.h4
-rw-r--r--src/core/hle/kernel/semaphore.cpp6
-rw-r--r--src/core/hle/kernel/server_port.cpp11
-rw-r--r--src/core/hle/kernel/server_port.h4
-rw-r--r--src/core/hle/kernel/session.cpp6
-rw-r--r--src/core/hle/kernel/shared_memory.cpp6
-rw-r--r--src/core/hle/kernel/thread.cpp6
-rw-r--r--src/core/hle/kernel/timer.cpp9
-rw-r--r--src/core/hle/result.h3
-rw-r--r--src/core/hle/service/am/am.cpp3
-rw-r--r--src/core/hle/service/am/am_app.cpp2
-rw-r--r--src/core/hle/service/am/am_net.cpp2
-rw-r--r--src/core/hle/service/am/am_sys.cpp46
-rw-r--r--src/core/hle/service/am/am_u.cpp72
-rw-r--r--src/core/hle/service/apt/apt.cpp6
-rw-r--r--src/core/hle/service/apt/apt.h14
-rw-r--r--src/core/hle/service/apt/apt_a.cpp5
-rw-r--r--src/core/hle/service/apt/apt_s.cpp5
-rw-r--r--src/core/hle/service/apt/apt_u.cpp5
-rw-r--r--src/core/hle/service/boss/boss.cpp3
-rw-r--r--src/core/hle/service/cam/cam.h54
-rw-r--r--src/core/hle/service/cam/cam_u.cpp2
-rw-r--r--src/core/hle/service/cecd/cecd_u.cpp2
-rw-r--r--src/core/hle/service/cfg/cfg.cpp13
-rw-r--r--src/core/hle/service/cfg/cfg.h15
-rw-r--r--src/core/hle/service/cfg/cfg_i.cpp2
-rw-r--r--src/core/hle/service/cfg/cfg_s.cpp2
-rw-r--r--src/core/hle/service/cfg/cfg_u.cpp2
-rw-r--r--src/core/hle/service/dlp/dlp.cpp3
-rw-r--r--src/core/hle/service/err_f.cpp4
-rw-r--r--src/core/hle/service/frd/frd.cpp3
-rw-r--r--src/core/hle/service/frd/frd_u.cpp2
-rw-r--r--src/core/hle/service/fs/archive.cpp12
-rw-r--r--src/core/hle/service/fs/fs_user.cpp3
-rw-r--r--src/core/hle/service/gsp_gpu.cpp7
-rw-r--r--src/core/hle/service/gsp_lcd.cpp14
-rw-r--r--src/core/hle/service/hid/hid.cpp9
-rw-r--r--src/core/hle/service/hid/hid_spvr.cpp2
-rw-r--r--src/core/hle/service/hid/hid_user.cpp2
-rw-r--r--src/core/hle/service/ir/ir_rst.cpp2
-rw-r--r--src/core/hle/service/ir/ir_u.cpp29
-rw-r--r--src/core/hle/service/ir/ir_user.cpp2
-rw-r--r--src/core/hle/service/ldr_ro/cro_helper.cpp47
-rw-r--r--src/core/hle/service/ldr_ro/cro_helper.h9
-rw-r--r--src/core/hle/service/ldr_ro/ldr_ro.cpp14
-rw-r--r--src/core/hle/service/ndm/ndm.cpp13
-rw-r--r--src/core/hle/service/ndm/ndm.h9
-rw-r--r--src/core/hle/service/ndm/ndm_u.cpp2
-rw-r--r--src/core/hle/service/news/news.cpp3
-rw-r--r--src/core/hle/service/news/news_s.cpp2
-rw-r--r--src/core/hle/service/nim/nim.cpp3
-rw-r--r--src/core/hle/service/nim/nim_u.cpp2
-rw-r--r--src/core/hle/service/ptm/ptm.cpp3
-rw-r--r--src/core/hle/service/ptm/ptm_sysm.cpp2
-rw-r--r--src/core/hle/service/ptm/ptm_u.cpp2
-rw-r--r--src/core/hle/service/soc_u.cpp154
-rw-r--r--src/core/hle/service/ssl_c.cpp3
-rw-r--r--src/core/hle/service/y2r_u.cpp4
-rw-r--r--src/core/hw/hw.cpp3
-rw-r--r--src/core/hw/y2r.cpp32
-rw-r--r--src/core/loader/3dsx.h3
-rw-r--r--src/core/loader/elf.h3
-rw-r--r--src/core/loader/loader.h6
-rw-r--r--src/core/loader/ncch.h3
-rw-r--r--src/core/tracer/citrace.h7
-rw-r--r--src/core/tracer/recorder.cpp3
-rw-r--r--src/video_core/clipper.cpp3
-rw-r--r--src/video_core/command_processor.cpp3
-rw-r--r--src/video_core/debug_utils/debug_utils.cpp37
-rw-r--r--src/video_core/debug_utils/debug_utils.h6
-rw-r--r--src/video_core/gpu_debugger.h3
-rw-r--r--src/video_core/pica.h25
-rw-r--r--src/video_core/primitive_assembly.cpp3
-rw-r--r--src/video_core/rasterizer.cpp42
-rw-r--r--src/video_core/rasterizer_interface.h3
-rw-r--r--src/video_core/renderer_base.h3
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.cpp10
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.h9
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer_cache.cpp4
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer_cache.h4
-rw-r--r--src/video_core/renderer_opengl/gl_shader_gen.cpp4
-rw-r--r--src/video_core/renderer_opengl/pica_to_gl.h16
-rw-r--r--src/video_core/renderer_opengl/renderer_opengl.cpp32
-rw-r--r--src/video_core/renderer_opengl/renderer_opengl.h7
-rw-r--r--src/video_core/shader/shader.cpp4
-rw-r--r--src/video_core/shader/shader.h3
-rw-r--r--src/video_core/shader/shader_interpreter.cpp5
-rw-r--r--src/video_core/shader/shader_jit_x64.cpp3
-rw-r--r--src/video_core/swrasterizer.h15
169 files changed, 808 insertions, 812 deletions
diff --git a/src/audio_core/codec.cpp b/src/audio_core/codec.cpp
index c7efae753..4edfe9be0 100644
--- a/src/audio_core/codec.cpp
+++ b/src/audio_core/codec.cpp
@@ -23,7 +23,7 @@ StereoBuffer16 DecodeADPCM(const u8* const data, const size_t sample_count,
23 23
24 constexpr size_t FRAME_LEN = 8; 24 constexpr size_t FRAME_LEN = 8;
25 constexpr size_t SAMPLES_PER_FRAME = 14; 25 constexpr size_t SAMPLES_PER_FRAME = 14;
26 constexpr std::array<int, 16> SIGNED_NIBBLES{ 26 constexpr std::array<int, 16> SIGNED_NIBBLES = {
27 {0, 1, 2, 3, 4, 5, 6, 7, -8, -7, -6, -5, -4, -3, -2, -1}}; 27 {0, 1, 2, 3, 4, 5, 6, 7, -8, -7, -6, -5, -4, -3, -2, -1}};
28 28
29 const size_t ret_size = 29 const size_t ret_size =
diff --git a/src/audio_core/hle/dsp.cpp b/src/audio_core/hle/dsp.cpp
index 5c8afa111..aaa3a280f 100644
--- a/src/audio_core/hle/dsp.cpp
+++ b/src/audio_core/hle/dsp.cpp
@@ -49,7 +49,8 @@ static SharedMemory& WriteRegion() {
49static std::array<Source, num_sources> sources = { 49static std::array<Source, num_sources> sources = {
50 Source(0), Source(1), Source(2), Source(3), Source(4), Source(5), Source(6), Source(7), 50 Source(0), Source(1), Source(2), Source(3), Source(4), Source(5), Source(6), Source(7),
51 Source(8), Source(9), Source(10), Source(11), Source(12), Source(13), Source(14), Source(15), 51 Source(8), Source(9), Source(10), Source(11), Source(12), Source(13), Source(14), Source(15),
52 Source(16), Source(17), Source(18), Source(19), Source(20), Source(21), Source(22), Source(23)}; 52 Source(16), Source(17), Source(18), Source(19), Source(20), Source(21), Source(22), Source(23),
53};
53static Mixers mixers; 54static Mixers mixers;
54 55
55static StereoFrame16 GenerateCurrentFrame() { 56static StereoFrame16 GenerateCurrentFrame() {
diff --git a/src/audio_core/hle/dsp.h b/src/audio_core/hle/dsp.h
index 5b216eb87..f4c4b01e2 100644
--- a/src/audio_core/hle/dsp.h
+++ b/src/audio_core/hle/dsp.h
@@ -23,16 +23,15 @@ class Sink;
23namespace DSP { 23namespace DSP {
24namespace HLE { 24namespace HLE {
25 25
26// The application-accessible region of DSP memory consists of two parts. 26// The application-accessible region of DSP memory consists of two parts. Both are marked as IO and
27// Both are marked as IO and have Read/Write permissions. 27// have Read/Write permissions.
28// 28//
29// First Region: 0x1FF50000 (Size: 0x8000) 29// First Region: 0x1FF50000 (Size: 0x8000)
30// Second Region: 0x1FF70000 (Size: 0x8000) 30// Second Region: 0x1FF70000 (Size: 0x8000)
31// 31//
32// The DSP reads from each region alternately based on the frame counter for each region much like a 32// The DSP reads from each region alternately based on the frame counter for each region much like a
33// double-buffer. The frame counter is located as the very last u16 of each region and is 33// double-buffer. The frame counter is located as the very last u16 of each region and is
34// incremented 34// incremented each audio tick.
35// each audio tick.
36 35
37constexpr VAddr region0_base = 0x1FF50000; 36constexpr VAddr region0_base = 0x1FF50000;
38constexpr VAddr region1_base = 0x1FF70000; 37constexpr VAddr region1_base = 0x1FF70000;
@@ -92,14 +91,12 @@ static_assert(std::is_trivially_copyable<u32_dsp>::value, "u32_dsp isn't trivial
92// See also: DSP::HLE::PipeRead. 91// See also: DSP::HLE::PipeRead.
93// 92//
94// Note that the above addresses do vary slightly between audio firmwares observed; the addresses 93// Note that the above addresses do vary slightly between audio firmwares observed; the addresses
95// are 94// are not fixed in stone. The addresses above are only an examplar; they're what this
96// not fixed in stone. The addresses above are only an examplar; they're what this implementation 95// implementation does and provides to applications.
97// does and provides to applications.
98// 96//
99// Application requests the DSP service to convert DSP addresses into ARM11 virtual addresses using 97// Application requests the DSP service to convert DSP addresses into ARM11 virtual addresses using
100// the 98// the ConvertProcessAddressFromDspDram service call. Applications seem to derive the addresses for
101// ConvertProcessAddressFromDspDram service call. Applications seem to derive the addresses for the 99// the second region via:
102// second region via:
103// second_region_dsp_addr = first_region_dsp_addr | 0x10000 100// second_region_dsp_addr = first_region_dsp_addr | 0x10000
104// 101//
105// Applications maintain most of its own audio state, the memory region is used mainly for 102// Applications maintain most of its own audio state, the memory region is used mainly for
@@ -107,7 +104,7 @@ static_assert(std::is_trivially_copyable<u32_dsp>::value, "u32_dsp isn't trivial
107// 104//
108// In the documentation below, filter and effect transfer functions are specified in the z domain. 105// In the documentation below, filter and effect transfer functions are specified in the z domain.
109// (If you are more familiar with the Laplace transform, z = exp(sT). The z domain is the digital 106// (If you are more familiar with the Laplace transform, z = exp(sT). The z domain is the digital
110// frequency domain, just like how the s domain is the analog frequency domain.) 107// frequency domain, just like how the s domain is the analog frequency domain.)
111 108
112#define INSERT_PADDING_DSPWORDS(num_words) INSERT_PADDING_BYTES(2 * (num_words)) 109#define INSERT_PADDING_DSPWORDS(num_words) INSERT_PADDING_BYTES(2 * (num_words))
113 110
@@ -137,8 +134,8 @@ struct SourceConfiguration {
137 BitField<0, 1, u32_le> format_dirty; 134 BitField<0, 1, u32_le> format_dirty;
138 BitField<1, 1, u32_le> mono_or_stereo_dirty; 135 BitField<1, 1, u32_le> mono_or_stereo_dirty;
139 BitField<2, 1, u32_le> adpcm_coefficients_dirty; 136 BitField<2, 1, u32_le> adpcm_coefficients_dirty;
140 BitField<3, 1, u32_le> 137 /// Tends to be set when a looped buffer is queued.
141 partial_embedded_buffer_dirty; ///< Tends to be set when a looped buffer is queued. 138 BitField<3, 1, u32_le> partial_embedded_buffer_dirty;
142 BitField<4, 1, u32_le> partial_reset_flag; 139 BitField<4, 1, u32_le> partial_reset_flag;
143 140
144 BitField<16, 1, u32_le> enable_dirty; 141 BitField<16, 1, u32_le> enable_dirty;
@@ -146,8 +143,8 @@ struct SourceConfiguration {
146 BitField<18, 1, u32_le> rate_multiplier_dirty; 143 BitField<18, 1, u32_le> rate_multiplier_dirty;
147 BitField<19, 1, u32_le> buffer_queue_dirty; 144 BitField<19, 1, u32_le> buffer_queue_dirty;
148 BitField<20, 1, u32_le> loop_related_dirty; 145 BitField<20, 1, u32_le> loop_related_dirty;
149 BitField<21, 1, u32_le> 146 /// Tends to also be set when embedded buffer is updated.
150 play_position_dirty; ///< Tends to also be set when embedded buffer is updated. 147 BitField<21, 1, u32_le> play_position_dirty;
151 BitField<22, 1, u32_le> filters_enabled_dirty; 148 BitField<22, 1, u32_le> filters_enabled_dirty;
152 BitField<23, 1, u32_le> simple_filter_dirty; 149 BitField<23, 1, u32_le> simple_filter_dirty;
153 BitField<24, 1, u32_le> biquad_filter_dirty; 150 BitField<24, 1, u32_le> biquad_filter_dirty;
@@ -162,9 +159,9 @@ struct SourceConfiguration {
162 // Gain control 159 // Gain control
163 160
164 /** 161 /**
165 * Gain is between 0.0-1.0. This determines how much will this source appear on 162 * Gain is between 0.0-1.0. This determines how much will this source appear on each of the
166 * each of the 12 channels that feed into the intermediate mixers. 163 * 12 channels that feed into the intermediate mixers. Each of the three intermediate mixers
167 * Each of the three intermediate mixers is fed two left and two right channels. 164 * is fed two left and two right channels.
168 */ 165 */
169 float_le gain[3][4]; 166 float_le gain[3][4];
170 167
@@ -173,7 +170,11 @@ struct SourceConfiguration {
173 /// Multiplier for sample rate. Resampling occurs with the selected interpolation method. 170 /// Multiplier for sample rate. Resampling occurs with the selected interpolation method.
174 float_le rate_multiplier; 171 float_le rate_multiplier;
175 172
176 enum class InterpolationMode : u8 { Polyphase = 0, Linear = 1, None = 2 }; 173 enum class InterpolationMode : u8 {
174 Polyphase = 0,
175 Linear = 1,
176 None = 2,
177 };
177 178
178 InterpolationMode interpolation_mode; 179 InterpolationMode interpolation_mode;
179 INSERT_PADDING_BYTES(1); ///< Interpolation related 180 INSERT_PADDING_BYTES(1); ///< Interpolation related
@@ -197,8 +198,7 @@ struct SourceConfiguration {
197 * The transfer function of this filter is: 198 * The transfer function of this filter is:
198 * H(z) = (b0 + b1 z^-1 + b2 z^-2) / (1 - a1 z^-1 - a2 z^-2) 199 * H(z) = (b0 + b1 z^-1 + b2 z^-2) / (1 - a1 z^-1 - a2 z^-2)
199 * Nintendo chose to negate the feedbackward coefficients. This differs from standard 200 * Nintendo chose to negate the feedbackward coefficients. This differs from standard
200 * notation 201 * notation as in: https://ccrma.stanford.edu/~jos/filters/Direct_Form_I.html
201 * as in: https://ccrma.stanford.edu/~jos/filters/Direct_Form_I.html
202 * Values are signed fixed point with 14 fractional bits. 202 * Values are signed fixed point with 14 fractional bits.
203 */ 203 */
204 struct BiquadFilter { 204 struct BiquadFilter {
@@ -246,8 +246,8 @@ struct SourceConfiguration {
246 u8 is_looping; 246 u8 is_looping;
247 247
248 /// This value is shown in SourceStatus::previous_buffer_id when this buffer has 248 /// This value is shown in SourceStatus::previous_buffer_id when this buffer has
249 /// finished. 249 /// finished. This allows the emulated application to tell what buffer is currently
250 /// This allows the emulated application to tell what buffer is currently playing 250 /// playing.
251 u16_le buffer_id; 251 u16_le buffer_id;
252 252
253 INSERT_PADDING_DSPWORDS(1); 253 INSERT_PADDING_DSPWORDS(1);
@@ -275,9 +275,16 @@ struct SourceConfiguration {
275 /// Note a sample takes up different number of bytes in different buffer formats. 275 /// Note a sample takes up different number of bytes in different buffer formats.
276 u32_dsp length; 276 u32_dsp length;
277 277
278 enum class MonoOrStereo : u16_le { Mono = 1, Stereo = 2 }; 278 enum class MonoOrStereo : u16_le {
279 Mono = 1,
280 Stereo = 2,
281 };
279 282
280 enum class Format : u16_le { PCM8 = 0, PCM16 = 1, ADPCM = 2 }; 283 enum class Format : u16_le {
284 PCM8 = 0,
285 PCM16 = 1,
286 ADPCM = 2,
287 };
281 288
282 union { 289 union {
283 u16_le flags1_raw; 290 u16_le flags1_raw;
@@ -349,12 +356,16 @@ struct DspConfiguration {
349 }; 356 };
350 357
351 /// The DSP has three intermediate audio mixers. This controls the volume level (0.0-1.0) for 358 /// The DSP has three intermediate audio mixers. This controls the volume level (0.0-1.0) for
352 /// each at the final mixer 359 /// each at the final mixer.
353 float_le volume[3]; 360 float_le volume[3];
354 361
355 INSERT_PADDING_DSPWORDS(3); 362 INSERT_PADDING_DSPWORDS(3);
356 363
357 enum class OutputFormat : u16_le { Mono = 0, Stereo = 1, Surround = 2 }; 364 enum class OutputFormat : u16_le {
365 Mono = 0,
366 Stereo = 1,
367 Surround = 2,
368 };
358 369
359 OutputFormat output_format; 370 OutputFormat output_format;
360 371
@@ -386,9 +397,10 @@ struct DspConfiguration {
386 u16_le enable; 397 u16_le enable;
387 INSERT_PADDING_DSPWORDS(1); 398 INSERT_PADDING_DSPWORDS(1);
388 u16_le outputs; 399 u16_le outputs;
389 u32_dsp work_buffer_address; ///< The application allocates a block of memory for the DSP to 400 /// The application allocates a block of memory for the DSP to use as a work buffer.
390 /// use as a work buffer. 401 u32_dsp work_buffer_address;
391 u16_le frame_count; ///< Frames to delay by 402 /// Frames to delay by
403 u16_le frame_count;
392 404
393 // Coefficients 405 // Coefficients
394 s16_le g; ///< Fixed point with 7 fractional bits 406 s16_le g; ///< Fixed point with 7 fractional bits
diff --git a/src/audio_core/hle/filter.cpp b/src/audio_core/hle/filter.cpp
index ab8814e59..da2a4684e 100644
--- a/src/audio_core/hle/filter.cpp
+++ b/src/audio_core/hle/filter.cpp
@@ -61,6 +61,7 @@ void SourceFilters::SimpleFilter::Reset() {
61 61
62void SourceFilters::SimpleFilter::Configure( 62void SourceFilters::SimpleFilter::Configure(
63 SourceConfiguration::Configuration::SimpleFilter config) { 63 SourceConfiguration::Configuration::SimpleFilter config) {
64
64 a1 = config.a1; 65 a1 = config.a1;
65 b0 = config.b0; 66 b0 = config.b0;
66} 67}
@@ -91,6 +92,7 @@ void SourceFilters::BiquadFilter::Reset() {
91 92
92void SourceFilters::BiquadFilter::Configure( 93void SourceFilters::BiquadFilter::Configure(
93 SourceConfiguration::Configuration::BiquadFilter config) { 94 SourceConfiguration::Configuration::BiquadFilter config) {
95
94 a1 = config.a1; 96 a1 = config.a1;
95 a2 = config.a2; 97 a2 = config.a2;
96 b0 = config.b0; 98 b0 = config.b0;
diff --git a/src/audio_core/hle/mixers.cpp b/src/audio_core/hle/mixers.cpp
index a661a7b27..126f328bc 100644
--- a/src/audio_core/hle/mixers.cpp
+++ b/src/audio_core/hle/mixers.cpp
@@ -77,9 +77,8 @@ void Mixers::ParseConfig(DspConfiguration& config) {
77 77
78 if (config.headphones_connected_dirty) { 78 if (config.headphones_connected_dirty) {
79 config.headphones_connected_dirty.Assign(0); 79 config.headphones_connected_dirty.Assign(0);
80 // Do nothing. 80 // Do nothing. (Note: Whether headphones are connected does affect coefficients used for
81 // (Note: Whether headphones are connected does affect coefficients used for surround 81 // surround sound.)
82 // sound.)
83 LOG_TRACE(Audio_DSP, "mixers headphones_connected=%hu", config.headphones_connected); 82 LOG_TRACE(Audio_DSP, "mixers headphones_connected=%hu", config.headphones_connected);
84 } 83 }
85 84
diff --git a/src/audio_core/hle/pipe.cpp b/src/audio_core/hle/pipe.cpp
index fe67d2503..f2b6d6552 100644
--- a/src/audio_core/hle/pipe.cpp
+++ b/src/audio_core/hle/pipe.cpp
@@ -97,7 +97,8 @@ static void AudioPipeWriteStructAddresses() {
97 0x8000 + offsetof(SharedMemory, unknown11) / 2, 97 0x8000 + offsetof(SharedMemory, unknown11) / 2,
98 0x8000 + offsetof(SharedMemory, unknown12) / 2, 98 0x8000 + offsetof(SharedMemory, unknown12) / 2,
99 0x8000 + offsetof(SharedMemory, unknown13) / 2, 99 0x8000 + offsetof(SharedMemory, unknown13) / 2,
100 0x8000 + offsetof(SharedMemory, unknown14) / 2}; 100 0x8000 + offsetof(SharedMemory, unknown14) / 2,
101 };
101 102
102 // Begin with a u16 denoting the number of structs. 103 // Begin with a u16 denoting the number of structs.
103 WriteU16(DspPipe::Audio, static_cast<u16>(struct_addresses.size())); 104 WriteU16(DspPipe::Audio, static_cast<u16>(struct_addresses.size()));
@@ -118,7 +119,12 @@ void PipeWrite(DspPipe pipe_number, const std::vector<u8>& buffer) {
118 return; 119 return;
119 } 120 }
120 121
121 enum class StateChange { Initalize = 0, Shutdown = 1, Wakeup = 2, Sleep = 3 }; 122 enum class StateChange {
123 Initalize = 0,
124 Shutdown = 1,
125 Wakeup = 2,
126 Sleep = 3,
127 };
122 128
123 // The difference between Initialize and Wakeup is that Input state is maintained 129 // The difference between Initialize and Wakeup is that Input state is maintained
124 // when sleeping but isn't when turning it off and on again. (TODO: Implement this.) 130 // when sleeping but isn't when turning it off and on again. (TODO: Implement this.)
diff --git a/src/audio_core/hle/pipe.h b/src/audio_core/hle/pipe.h
index 73b857a90..6d7fd92ab 100644
--- a/src/audio_core/hle/pipe.h
+++ b/src/audio_core/hle/pipe.h
@@ -15,7 +15,12 @@ namespace HLE {
15/// Reset the pipes by setting pipe positions back to the beginning. 15/// Reset the pipes by setting pipe positions back to the beginning.
16void ResetPipes(); 16void ResetPipes();
17 17
18enum class DspPipe { Debug = 0, Dma = 1, Audio = 2, Binary = 3 }; 18enum class DspPipe {
19 Debug = 0,
20 Dma = 1,
21 Audio = 2,
22 Binary = 3,
23};
19constexpr size_t NUM_DSP_PIPE = 8; 24constexpr size_t NUM_DSP_PIPE = 8;
20 25
21/** 26/**
@@ -46,7 +51,12 @@ size_t GetPipeReadableSize(DspPipe pipe_number);
46 */ 51 */
47void PipeWrite(DspPipe pipe_number, const std::vector<u8>& buffer); 52void PipeWrite(DspPipe pipe_number, const std::vector<u8>& buffer);
48 53
49enum class DspState { Off, On, Sleeping }; 54enum class DspState {
55 Off,
56 On,
57 Sleeping,
58};
59
50/// Get the state of the DSP 60/// Get the state of the DSP
51DspState GetDspState(); 61DspState GetDspState();
52 62
diff --git a/src/audio_core/hle/source.cpp b/src/audio_core/hle/source.cpp
index fad0ce2ad..249acc449 100644
--- a/src/audio_core/hle/source.cpp
+++ b/src/audio_core/hle/source.cpp
@@ -163,16 +163,18 @@ void Source::ParseConfig(SourceConfiguration::Configuration& config,
163 163
164 if (config.embedded_buffer_dirty) { 164 if (config.embedded_buffer_dirty) {
165 config.embedded_buffer_dirty.Assign(0); 165 config.embedded_buffer_dirty.Assign(0);
166 state.input_queue.emplace(Buffer{config.physical_address, 166 state.input_queue.emplace(Buffer{
167 config.length, 167 config.physical_address,
168 static_cast<u8>(config.adpcm_ps), 168 config.length,
169 {config.adpcm_yn[0], config.adpcm_yn[1]}, 169 static_cast<u8>(config.adpcm_ps),
170 config.adpcm_dirty.ToBool(), 170 {config.adpcm_yn[0], config.adpcm_yn[1]},
171 config.is_looping.ToBool(), 171 config.adpcm_dirty.ToBool(),
172 config.buffer_id, 172 config.is_looping.ToBool(),
173 state.mono_or_stereo, 173 config.buffer_id,
174 state.format, 174 state.mono_or_stereo,
175 false}); 175 state.format,
176 false,
177 });
176 LOG_TRACE(Audio_DSP, "enqueuing embedded addr=0x%08x len=%u id=%hu", 178 LOG_TRACE(Audio_DSP, "enqueuing embedded addr=0x%08x len=%u id=%hu",
177 config.physical_address, config.length, config.buffer_id); 179 config.physical_address, config.length, config.buffer_id);
178 } 180 }
@@ -182,16 +184,18 @@ void Source::ParseConfig(SourceConfiguration::Configuration& config,
182 for (size_t i = 0; i < 4; i++) { 184 for (size_t i = 0; i < 4; i++) {
183 if (config.buffers_dirty & (1 << i)) { 185 if (config.buffers_dirty & (1 << i)) {
184 const auto& b = config.buffers[i]; 186 const auto& b = config.buffers[i];
185 state.input_queue.emplace(Buffer{b.physical_address, 187 state.input_queue.emplace(Buffer{
186 b.length, 188 b.physical_address,
187 static_cast<u8>(b.adpcm_ps), 189 b.length,
188 {b.adpcm_yn[0], b.adpcm_yn[1]}, 190 static_cast<u8>(b.adpcm_ps),
189 b.adpcm_dirty != 0, 191 {b.adpcm_yn[0], b.adpcm_yn[1]},
190 b.is_looping != 0, 192 b.adpcm_dirty != 0,
191 b.buffer_id, 193 b.is_looping != 0,
192 state.mono_or_stereo, 194 b.buffer_id,
193 state.format, 195 state.mono_or_stereo,
194 true}); 196 state.format,
197 true,
198 });
195 LOG_TRACE(Audio_DSP, "enqueuing queued %zu addr=0x%08x len=%u id=%hu", i, 199 LOG_TRACE(Audio_DSP, "enqueuing queued %zu addr=0x%08x len=%u id=%hu", i,
196 b.physical_address, b.length, b.buffer_id); 200 b.physical_address, b.length, b.buffer_id);
197 } 201 }
diff --git a/src/audio_core/interpolate.cpp b/src/audio_core/interpolate.cpp
index 7751c545d..cb1c58a67 100644
--- a/src/audio_core/interpolate.cpp
+++ b/src/audio_core/interpolate.cpp
@@ -71,15 +71,17 @@ StereoBuffer16 None(State& state, const StereoBuffer16& input, float rate_multip
71 71
72StereoBuffer16 Linear(State& state, const StereoBuffer16& input, float rate_multiplier) { 72StereoBuffer16 Linear(State& state, const StereoBuffer16& input, float rate_multiplier) {
73 // Note on accuracy: Some values that this produces are +/- 1 from the actual firmware. 73 // Note on accuracy: Some values that this produces are +/- 1 from the actual firmware.
74 return StepOverSamples(state, input, rate_multiplier, [](u64 fraction, const auto& x0, 74 return StepOverSamples(state, input, rate_multiplier,
75 const auto& x1, const auto& x2) { 75 [](u64 fraction, const auto& x0, const auto& x1, const auto& x2) {
76 // This is a saturated subtraction. (Verified by black-box fuzzing.) 76 // This is a saturated subtraction. (Verified by black-box fuzzing.)
77 s64 delta0 = MathUtil::Clamp<s64>(x1[0] - x0[0], -32768, 32767); 77 s64 delta0 = MathUtil::Clamp<s64>(x1[0] - x0[0], -32768, 32767);
78 s64 delta1 = MathUtil::Clamp<s64>(x1[1] - x0[1], -32768, 32767); 78 s64 delta1 = MathUtil::Clamp<s64>(x1[1] - x0[1], -32768, 32767);
79 79
80 return std::array<s16, 2>{static_cast<s16>(x0[0] + fraction * delta0 / scale_factor), 80 return std::array<s16, 2>{
81 static_cast<s16>(x0[1] + fraction * delta1 / scale_factor)}; 81 static_cast<s16>(x0[0] + fraction * delta0 / scale_factor),
82 }); 82 static_cast<s16>(x0[1] + fraction * delta1 / scale_factor),
83 };
84 });
83} 85}
84 86
85} // namespace AudioInterp 87} // namespace AudioInterp
diff --git a/src/audio_core/interpolate.h b/src/audio_core/interpolate.h
index 99e5b9657..2d2e60311 100644
--- a/src/audio_core/interpolate.h
+++ b/src/audio_core/interpolate.h
@@ -25,7 +25,7 @@ struct State {
25 * @param input Input buffer. 25 * @param input Input buffer.
26 * @param rate_multiplier Stretch factor. Must be a positive non-zero value. 26 * @param rate_multiplier Stretch factor. Must be a positive non-zero value.
27 * rate_multiplier > 1.0 performs decimation and rate_multipler < 1.0 27 * rate_multiplier > 1.0 performs decimation and rate_multipler < 1.0
28 * performs upsampling. 28 * performs upsampling.
29 * @return The resampled audio buffer. 29 * @return The resampled audio buffer.
30 */ 30 */
31StereoBuffer16 None(State& state, const StereoBuffer16& input, float rate_multiplier); 31StereoBuffer16 None(State& state, const StereoBuffer16& input, float rate_multiplier);
@@ -35,7 +35,7 @@ StereoBuffer16 None(State& state, const StereoBuffer16& input, float rate_multip
35 * @param input Input buffer. 35 * @param input Input buffer.
36 * @param rate_multiplier Stretch factor. Must be a positive non-zero value. 36 * @param rate_multiplier Stretch factor. Must be a positive non-zero value.
37 * rate_multiplier > 1.0 performs decimation and rate_multipler < 1.0 37 * rate_multiplier > 1.0 performs decimation and rate_multipler < 1.0
38 * performs upsampling. 38 * performs upsampling.
39 * @return The resampled audio buffer. 39 * @return The resampled audio buffer.
40 */ 40 */
41StereoBuffer16 Linear(State& state, const StereoBuffer16& input, float rate_multiplier); 41StereoBuffer16 Linear(State& state, const StereoBuffer16& input, float rate_multiplier);
diff --git a/src/audio_core/null_sink.h b/src/audio_core/null_sink.h
index b82cd3b9a..9931c4778 100644
--- a/src/audio_core/null_sink.h
+++ b/src/audio_core/null_sink.h
@@ -19,8 +19,7 @@ public:
19 return native_sample_rate; 19 return native_sample_rate;
20 } 20 }
21 21
22 void EnqueueSamples(const s16*, size_t) override { 22 void EnqueueSamples(const s16*, size_t) override {}
23 }
24 23
25 size_t SamplesInQueue() const override { 24 size_t SamplesInQueue() const override {
26 return 0; 25 return 0;
diff --git a/src/audio_core/sink.h b/src/audio_core/sink.h
index c938e87d2..f5ce55a6b 100644
--- a/src/audio_core/sink.h
+++ b/src/audio_core/sink.h
@@ -12,8 +12,8 @@ namespace AudioCore {
12 12
13/** 13/**
14 * This class is an interface for an audio sink. An audio sink accepts samples in stereo signed 14 * This class is an interface for an audio sink. An audio sink accepts samples in stereo signed
15 * PCM16 format to be output. 15 * PCM16 format to be output. Sinks *do not* handle resampling and expect the correct sample rate.
16 * Sinks *do not* handle resampling and expect the correct sample rate. They are dumb outputs. 16 * They are dumb outputs.
17 */ 17 */
18class Sink { 18class Sink {
19public: 19public:
diff --git a/src/audio_core/sink_details.h b/src/audio_core/sink_details.h
index 34110c97a..4b30cf835 100644
--- a/src/audio_core/sink_details.h
+++ b/src/audio_core/sink_details.h
@@ -14,8 +14,7 @@ class Sink;
14 14
15struct SinkDetails { 15struct SinkDetails {
16 SinkDetails(const char* id_, std::function<std::unique_ptr<Sink>()> factory_) 16 SinkDetails(const char* id_, std::function<std::unique_ptr<Sink>()> factory_)
17 : id(id_), factory(factory_) { 17 : id(id_), factory(factory_) {}
18 }
19 18
20 /// Name for this sink. 19 /// Name for this sink.
21 const char* id; 20 const char* id;
diff --git a/src/citra/citra.cpp b/src/citra/citra.cpp
index 7b387e258..1b8f8cffe 100644
--- a/src/citra/citra.cpp
+++ b/src/citra/citra.cpp
@@ -69,10 +69,12 @@ int main(int argc, char** argv) {
69#endif 69#endif
70 std::string boot_filename; 70 std::string boot_filename;
71 71
72 static struct option long_options[] = {{"gdbport", required_argument, 0, 'g'}, 72 static struct option long_options[] = {
73 {"help", no_argument, 0, 'h'}, 73 {"gdbport", required_argument, 0, 'g'},
74 {"version", no_argument, 0, 'v'}, 74 {"help", no_argument, 0, 'h'},
75 {0, 0, 0, 0}}; 75 {"version", no_argument, 0, 'v'},
76 {0, 0, 0, 0},
77 };
76 78
77 while (optind < argc) { 79 while (optind < argc) {
78 char arg = getopt_long(argc, argv, "g:hv", long_options, &option_index); 80 char arg = getopt_long(argc, argv, "g:hv", long_options, &option_index);
diff --git a/src/citra/emu_window/emu_window_sdl2.cpp b/src/citra/emu_window/emu_window_sdl2.cpp
index 12f3e2c71..42f2a7553 100644
--- a/src/citra/emu_window/emu_window_sdl2.cpp
+++ b/src/citra/emu_window/emu_window_sdl2.cpp
@@ -181,5 +181,6 @@ void EmuWindow_SDL2::ReloadSetKeymaps() {
181 181
182void EmuWindow_SDL2::OnMinimalClientAreaChangeRequest( 182void EmuWindow_SDL2::OnMinimalClientAreaChangeRequest(
183 const std::pair<unsigned, unsigned>& minimal_size) { 183 const std::pair<unsigned, unsigned>& minimal_size) {
184
184 SDL_SetWindowMinimumSize(render_window, minimal_size.first, minimal_size.second); 185 SDL_SetWindowMinimumSize(render_window, minimal_size.first, minimal_size.second);
185} 186}
diff --git a/src/citra/emu_window/emu_window_sdl2.h b/src/citra/emu_window/emu_window_sdl2.h
index 693dfb14b..d4d86821d 100644
--- a/src/citra/emu_window/emu_window_sdl2.h
+++ b/src/citra/emu_window/emu_window_sdl2.h
@@ -47,8 +47,8 @@ private:
47 void OnResize(); 47 void OnResize();
48 48
49 /// Called when a configuration change affects the minimal size of the window 49 /// Called when a configuration change affects the minimal size of the window
50 void 50 void OnMinimalClientAreaChangeRequest(
51 OnMinimalClientAreaChangeRequest(const std::pair<unsigned, unsigned>& minimal_size) override; 51 const std::pair<unsigned, unsigned>& minimal_size) override;
52 52
53 /// Is the window still open? 53 /// Is the window still open?
54 bool is_open = true; 54 bool is_open = true;
diff --git a/src/citra_qt/bootmanager.cpp b/src/citra_qt/bootmanager.cpp
index 01cc6b9ca..53d035b32 100644
--- a/src/citra_qt/bootmanager.cpp
+++ b/src/citra_qt/bootmanager.cpp
@@ -28,8 +28,7 @@
28#define COPYRIGHT "Copyright (C) 2013-2014 Citra Team" 28#define COPYRIGHT "Copyright (C) 2013-2014 Citra Team"
29 29
30EmuThread::EmuThread(GRenderWindow* render_window) 30EmuThread::EmuThread(GRenderWindow* render_window)
31 : exec_step(false), running(false), stop_run(false), render_window(render_window) { 31 : exec_step(false), running(false), stop_run(false), render_window(render_window) {}
32}
33 32
34void EmuThread::run() { 33void EmuThread::run() {
35 render_window->MakeCurrent(); 34 render_window->MakeCurrent();
@@ -84,8 +83,7 @@ void EmuThread::run() {
84class GGLWidgetInternal : public QGLWidget { 83class GGLWidgetInternal : public QGLWidget {
85public: 84public:
86 GGLWidgetInternal(QGLFormat fmt, GRenderWindow* parent) 85 GGLWidgetInternal(QGLFormat fmt, GRenderWindow* parent)
87 : QGLWidget(fmt, parent), parent(parent) { 86 : QGLWidget(fmt, parent), parent(parent) {}
88 }
89 87
90 void paintEvent(QPaintEvent* ev) override { 88 void paintEvent(QPaintEvent* ev) override {
91 if (do_painting) { 89 if (do_painting) {
@@ -153,8 +151,7 @@ void GRenderWindow::DoneCurrent() {
153 child->doneCurrent(); 151 child->doneCurrent();
154} 152}
155 153
156void GRenderWindow::PollEvents() { 154void GRenderWindow::PollEvents() {}
157}
158 155
159// On Qt 5.0+, this correctly gets the size of the framebuffer (pixels). 156// On Qt 5.0+, this correctly gets the size of the framebuffer (pixels).
160// 157//
@@ -306,8 +303,8 @@ void GRenderWindow::OnEmulationStopping() {
306void GRenderWindow::showEvent(QShowEvent* event) { 303void GRenderWindow::showEvent(QShowEvent* event) {
307 QWidget::showEvent(event); 304 QWidget::showEvent(event);
308 305
309// windowHandle() is not initialized until the Window is shown, so we connect it here.
310#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) 306#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
307 // windowHandle() is not initialized until the Window is shown, so we connect it here.
311 connect(this->windowHandle(), SIGNAL(screenChanged(QScreen*)), this, 308 connect(this->windowHandle(), SIGNAL(screenChanged(QScreen*)), this,
312 SLOT(OnFramebufferSizeChanged()), Qt::UniqueConnection); 309 SLOT(OnFramebufferSizeChanged()), Qt::UniqueConnection);
313#endif 310#endif
diff --git a/src/citra_qt/bootmanager.h b/src/citra_qt/bootmanager.h
index e0e4341df..59241684d 100644
--- a/src/citra_qt/bootmanager.h
+++ b/src/citra_qt/bootmanager.h
@@ -144,8 +144,8 @@ signals:
144 void Closed(); 144 void Closed();
145 145
146private: 146private:
147 void 147 void OnMinimalClientAreaChangeRequest(
148 OnMinimalClientAreaChangeRequest(const std::pair<unsigned, unsigned>& minimal_size) override; 148 const std::pair<unsigned, unsigned>& minimal_size) override;
149 149
150 GGLWidgetInternal* child; 150 GGLWidgetInternal* child;
151 151
diff --git a/src/citra_qt/configure_audio.cpp b/src/citra_qt/configure_audio.cpp
index 29900536c..944047d05 100644
--- a/src/citra_qt/configure_audio.cpp
+++ b/src/citra_qt/configure_audio.cpp
@@ -22,8 +22,7 @@ ConfigureAudio::ConfigureAudio(QWidget* parent)
22 this->setConfiguration(); 22 this->setConfiguration();
23} 23}
24 24
25ConfigureAudio::~ConfigureAudio() { 25ConfigureAudio::~ConfigureAudio() {}
26}
27 26
28void ConfigureAudio::setConfiguration() { 27void ConfigureAudio::setConfiguration() {
29 int new_sink_index = 0; 28 int new_sink_index = 0;
diff --git a/src/citra_qt/configure_debug.cpp b/src/citra_qt/configure_debug.cpp
index b6b44723c..dde8d670e 100644
--- a/src/citra_qt/configure_debug.cpp
+++ b/src/citra_qt/configure_debug.cpp
@@ -12,8 +12,7 @@ ConfigureDebug::ConfigureDebug(QWidget* parent) : QWidget(parent), ui(new Ui::Co
12 this->setConfiguration(); 12 this->setConfiguration();
13} 13}
14 14
15ConfigureDebug::~ConfigureDebug() { 15ConfigureDebug::~ConfigureDebug() {}
16}
17 16
18void ConfigureDebug::setConfiguration() { 17void ConfigureDebug::setConfiguration() {
19 ui->toggle_gdbstub->setChecked(Settings::values.use_gdbstub); 18 ui->toggle_gdbstub->setChecked(Settings::values.use_gdbstub);
diff --git a/src/citra_qt/configure_dialog.cpp b/src/citra_qt/configure_dialog.cpp
index 837934c81..c33c95540 100644
--- a/src/citra_qt/configure_dialog.cpp
+++ b/src/citra_qt/configure_dialog.cpp
@@ -2,8 +2,8 @@
2// Licensed under GPLv2 or any later version 2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include "citra_qt/config.h"
6#include "citra_qt/configure_dialog.h" 5#include "citra_qt/configure_dialog.h"
6#include "citra_qt/config.h"
7#include "ui_configure.h" 7#include "ui_configure.h"
8 8
9#include "core/settings.h" 9#include "core/settings.h"
@@ -13,11 +13,9 @@ ConfigureDialog::ConfigureDialog(QWidget* parent) : QDialog(parent), ui(new Ui::
13 this->setConfiguration(); 13 this->setConfiguration();
14} 14}
15 15
16ConfigureDialog::~ConfigureDialog() { 16ConfigureDialog::~ConfigureDialog() {}
17}
18 17
19void ConfigureDialog::setConfiguration() { 18void ConfigureDialog::setConfiguration() {}
20}
21 19
22void ConfigureDialog::applyConfiguration() { 20void ConfigureDialog::applyConfiguration() {
23 ui->generalTab->applyConfiguration(); 21 ui->generalTab->applyConfiguration();
diff --git a/src/citra_qt/configure_general.cpp b/src/citra_qt/configure_general.cpp
index 7bfba6dd0..3e6f76bfe 100644
--- a/src/citra_qt/configure_general.cpp
+++ b/src/citra_qt/configure_general.cpp
@@ -11,14 +11,14 @@
11 11
12ConfigureGeneral::ConfigureGeneral(QWidget* parent) 12ConfigureGeneral::ConfigureGeneral(QWidget* parent)
13 : QWidget(parent), ui(new Ui::ConfigureGeneral) { 13 : QWidget(parent), ui(new Ui::ConfigureGeneral) {
14
14 ui->setupUi(this); 15 ui->setupUi(this);
15 this->setConfiguration(); 16 this->setConfiguration();
16 17
17 ui->toggle_cpu_jit->setEnabled(!System::IsPoweredOn()); 18 ui->toggle_cpu_jit->setEnabled(!System::IsPoweredOn());
18} 19}
19 20
20ConfigureGeneral::~ConfigureGeneral() { 21ConfigureGeneral::~ConfigureGeneral() {}
21}
22 22
23void ConfigureGeneral::setConfiguration() { 23void ConfigureGeneral::setConfiguration() {
24 ui->toggle_deepscan->setChecked(UISettings::values.gamedir_deepscan); 24 ui->toggle_deepscan->setChecked(UISettings::values.gamedir_deepscan);
diff --git a/src/citra_qt/configure_graphics.cpp b/src/citra_qt/configure_graphics.cpp
index adc9cb5ef..bde6727cc 100644
--- a/src/citra_qt/configure_graphics.cpp
+++ b/src/citra_qt/configure_graphics.cpp
@@ -10,14 +10,14 @@
10 10
11ConfigureGraphics::ConfigureGraphics(QWidget* parent) 11ConfigureGraphics::ConfigureGraphics(QWidget* parent)
12 : QWidget(parent), ui(new Ui::ConfigureGraphics) { 12 : QWidget(parent), ui(new Ui::ConfigureGraphics) {
13
13 ui->setupUi(this); 14 ui->setupUi(this);
14 this->setConfiguration(); 15 this->setConfiguration();
15 16
16 ui->toggle_vsync->setEnabled(!System::IsPoweredOn()); 17 ui->toggle_vsync->setEnabled(!System::IsPoweredOn());
17} 18}
18 19
19ConfigureGraphics::~ConfigureGraphics() { 20ConfigureGraphics::~ConfigureGraphics() {}
20}
21 21
22void ConfigureGraphics::setConfiguration() { 22void ConfigureGraphics::setConfiguration() {
23 ui->toggle_hw_renderer->setChecked(Settings::values.use_hw_renderer); 23 ui->toggle_hw_renderer->setChecked(Settings::values.use_hw_renderer);
diff --git a/src/citra_qt/configure_input.cpp b/src/citra_qt/configure_input.cpp
index af473f841..7900134ca 100644
--- a/src/citra_qt/configure_input.cpp
+++ b/src/citra_qt/configure_input.cpp
@@ -10,34 +10,35 @@
10 10
11ConfigureInput::ConfigureInput(QWidget* parent) 11ConfigureInput::ConfigureInput(QWidget* parent)
12 : QWidget(parent), ui(std::make_unique<Ui::ConfigureInput>()) { 12 : QWidget(parent), ui(std::make_unique<Ui::ConfigureInput>()) {
13
13 ui->setupUi(this); 14 ui->setupUi(this);
14 15
15 // Initialize mapping of input enum to UI button. 16 // Initialize mapping of input enum to UI button.
16 input_mapping = { 17 input_mapping = {
17 {std::make_pair(Settings::NativeInput::Values::A, ui->buttonA)}, 18 {Settings::NativeInput::Values::A, ui->buttonA},
18 {std::make_pair(Settings::NativeInput::Values::B, ui->buttonB)}, 19 {Settings::NativeInput::Values::B, ui->buttonB},
19 {std::make_pair(Settings::NativeInput::Values::X, ui->buttonX)}, 20 {Settings::NativeInput::Values::X, ui->buttonX},
20 {std::make_pair(Settings::NativeInput::Values::Y, ui->buttonY)}, 21 {Settings::NativeInput::Values::Y, ui->buttonY},
21 {std::make_pair(Settings::NativeInput::Values::L, ui->buttonL)}, 22 {Settings::NativeInput::Values::L, ui->buttonL},
22 {std::make_pair(Settings::NativeInput::Values::R, ui->buttonR)}, 23 {Settings::NativeInput::Values::R, ui->buttonR},
23 {std::make_pair(Settings::NativeInput::Values::ZL, ui->buttonZL)}, 24 {Settings::NativeInput::Values::ZL, ui->buttonZL},
24 {std::make_pair(Settings::NativeInput::Values::ZR, ui->buttonZR)}, 25 {Settings::NativeInput::Values::ZR, ui->buttonZR},
25 {std::make_pair(Settings::NativeInput::Values::START, ui->buttonStart)}, 26 {Settings::NativeInput::Values::START, ui->buttonStart},
26 {std::make_pair(Settings::NativeInput::Values::SELECT, ui->buttonSelect)}, 27 {Settings::NativeInput::Values::SELECT, ui->buttonSelect},
27 {std::make_pair(Settings::NativeInput::Values::HOME, ui->buttonHome)}, 28 {Settings::NativeInput::Values::HOME, ui->buttonHome},
28 {std::make_pair(Settings::NativeInput::Values::DUP, ui->buttonDpadUp)}, 29 {Settings::NativeInput::Values::DUP, ui->buttonDpadUp},
29 {std::make_pair(Settings::NativeInput::Values::DDOWN, ui->buttonDpadDown)}, 30 {Settings::NativeInput::Values::DDOWN, ui->buttonDpadDown},
30 {std::make_pair(Settings::NativeInput::Values::DLEFT, ui->buttonDpadLeft)}, 31 {Settings::NativeInput::Values::DLEFT, ui->buttonDpadLeft},
31 {std::make_pair(Settings::NativeInput::Values::DRIGHT, ui->buttonDpadRight)}, 32 {Settings::NativeInput::Values::DRIGHT, ui->buttonDpadRight},
32 {std::make_pair(Settings::NativeInput::Values::CUP, ui->buttonCStickUp)}, 33 {Settings::NativeInput::Values::CUP, ui->buttonCStickUp},
33 {std::make_pair(Settings::NativeInput::Values::CDOWN, ui->buttonCStickDown)}, 34 {Settings::NativeInput::Values::CDOWN, ui->buttonCStickDown},
34 {std::make_pair(Settings::NativeInput::Values::CLEFT, ui->buttonCStickLeft)}, 35 {Settings::NativeInput::Values::CLEFT, ui->buttonCStickLeft},
35 {std::make_pair(Settings::NativeInput::Values::CRIGHT, ui->buttonCStickRight)}, 36 {Settings::NativeInput::Values::CRIGHT, ui->buttonCStickRight},
36 {std::make_pair(Settings::NativeInput::Values::CIRCLE_UP, ui->buttonCircleUp)}, 37 {Settings::NativeInput::Values::CIRCLE_UP, ui->buttonCircleUp},
37 {std::make_pair(Settings::NativeInput::Values::CIRCLE_DOWN, ui->buttonCircleDown)}, 38 {Settings::NativeInput::Values::CIRCLE_DOWN, ui->buttonCircleDown},
38 {std::make_pair(Settings::NativeInput::Values::CIRCLE_LEFT, ui->buttonCircleLeft)}, 39 {Settings::NativeInput::Values::CIRCLE_LEFT, ui->buttonCircleLeft},
39 {std::make_pair(Settings::NativeInput::Values::CIRCLE_RIGHT, ui->buttonCircleRight)}, 40 {Settings::NativeInput::Values::CIRCLE_RIGHT, ui->buttonCircleRight},
40 {std::make_pair(Settings::NativeInput::Values::CIRCLE_MODIFIER, ui->buttonCircleMod)}, 41 {Settings::NativeInput::Values::CIRCLE_MODIFIER, ui->buttonCircleMod},
41 }; 42 };
42 43
43 // Attach handle click method to each button click. 44 // Attach handle click method to each button click.
diff --git a/src/citra_qt/configure_system.cpp b/src/citra_qt/configure_system.cpp
index d89b342df..732e15dda 100644
--- a/src/citra_qt/configure_system.cpp
+++ b/src/citra_qt/configure_system.cpp
@@ -10,7 +10,9 @@
10#include "core/hle/service/fs/archive.h" 10#include "core/hle/service/fs/archive.h"
11#include "core/system.h" 11#include "core/system.h"
12 12
13static const std::array<int, 12> days_in_month = {{31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}}; 13static const std::array<int, 12> days_in_month = {{
14 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31,
15}};
14 16
15ConfigureSystem::ConfigureSystem(QWidget* parent) : QWidget(parent), ui(new Ui::ConfigureSystem) { 17ConfigureSystem::ConfigureSystem(QWidget* parent) : QWidget(parent), ui(new Ui::ConfigureSystem) {
16 ui->setupUi(this); 18 ui->setupUi(this);
@@ -20,8 +22,7 @@ ConfigureSystem::ConfigureSystem(QWidget* parent) : QWidget(parent), ui(new Ui::
20 this->setConfiguration(); 22 this->setConfiguration();
21} 23}
22 24
23ConfigureSystem::~ConfigureSystem() { 25ConfigureSystem::~ConfigureSystem() {}
24}
25 26
26void ConfigureSystem::setConfiguration() { 27void ConfigureSystem::setConfiguration() {
27 enabled = !System::IsPoweredOn(); 28 enabled = !System::IsPoweredOn();
@@ -51,8 +52,8 @@ void ConfigureSystem::setConfiguration() {
51void ConfigureSystem::ReadSystemSettings() { 52void ConfigureSystem::ReadSystemSettings() {
52 // set username 53 // set username
53 username = Service::CFG::GetUsername(); 54 username = Service::CFG::GetUsername();
54 // ui->edit_username->setText(QString::fromStdU16String(username)); // TODO(wwylele): Use this 55 // TODO(wwylele): Use this when we move to Qt 5.5
55 // when we move to Qt 5.5 56 // ui->edit_username->setText(QString::fromStdU16String(username));
56 ui->edit_username->setText( 57 ui->edit_username->setText(
57 QString::fromUtf16(reinterpret_cast<const ushort*>(username.data()))); 58 QString::fromUtf16(reinterpret_cast<const ushort*>(username.data())));
58 59
@@ -80,8 +81,8 @@ void ConfigureSystem::applyConfiguration() {
80 bool modified = false; 81 bool modified = false;
81 82
82 // apply username 83 // apply username
83 // std::u16string new_username = ui->edit_username->text().toStdU16String(); // TODO(wwylele): 84 // TODO(wwylele): Use this when we move to Qt 5.5
84 // Use this when we move to Qt 5.5 85 // std::u16string new_username = ui->edit_username->text().toStdU16String();
85 std::u16string new_username( 86 std::u16string new_username(
86 reinterpret_cast<const char16_t*>(ui->edit_username->text().utf16())); 87 reinterpret_cast<const char16_t*>(ui->edit_username->text().utf16()));
87 if (new_username != username) { 88 if (new_username != username) {
diff --git a/src/citra_qt/debugger/callstack.cpp b/src/citra_qt/debugger/callstack.cpp
index a87046acb..db266b506 100644
--- a/src/citra_qt/debugger/callstack.cpp
+++ b/src/citra_qt/debugger/callstack.cpp
@@ -78,8 +78,7 @@ void CallstackWidget::OnDebugModeEntered() {
78 } 78 }
79} 79}
80 80
81void CallstackWidget::OnDebugModeLeft() { 81void CallstackWidget::OnDebugModeLeft() {}
82}
83 82
84void CallstackWidget::Clear() { 83void CallstackWidget::Clear() {
85 for (int row = 0; row < callstack_model->rowCount(); row++) { 84 for (int row = 0; row < callstack_model->rowCount(); row++) {
diff --git a/src/citra_qt/debugger/disassembler.cpp b/src/citra_qt/debugger/disassembler.cpp
index b523fe9a7..803e8b172 100644
--- a/src/citra_qt/debugger/disassembler.cpp
+++ b/src/citra_qt/debugger/disassembler.cpp
@@ -19,8 +19,7 @@
19 19
20DisassemblerModel::DisassemblerModel(QObject* parent) 20DisassemblerModel::DisassemblerModel(QObject* parent)
21 : QAbstractListModel(parent), base_address(0), code_size(0), program_counter(0), 21 : QAbstractListModel(parent), base_address(0), code_size(0), program_counter(0),
22 selection(QModelIndex()) { 22 selection(QModelIndex()) {}
23}
24 23
25int DisassemblerModel::columnCount(const QModelIndex& parent) const { 24int DisassemblerModel::columnCount(const QModelIndex& parent) const {
26 return 3; 25 return 3;
@@ -241,8 +240,7 @@ void DisassemblerWidget::OnDebugModeEntered() {
241 model_index, QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows); 240 model_index, QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows);
242} 241}
243 242
244void DisassemblerWidget::OnDebugModeLeft() { 243void DisassemblerWidget::OnDebugModeLeft() {}
245}
246 244
247int DisassemblerWidget::SelectedRow() { 245int DisassemblerWidget::SelectedRow() {
248 QModelIndex index = disasm_ui.treeView->selectionModel()->currentIndex(); 246 QModelIndex index = disasm_ui.treeView->selectionModel()->currentIndex();
diff --git a/src/citra_qt/debugger/graphics_breakpoints.cpp b/src/citra_qt/debugger/graphics_breakpoints.cpp
index 953840e7f..b31eba533 100644
--- a/src/citra_qt/debugger/graphics_breakpoints.cpp
+++ b/src/citra_qt/debugger/graphics_breakpoints.cpp
@@ -16,8 +16,7 @@
16BreakPointModel::BreakPointModel(std::shared_ptr<Pica::DebugContext> debug_context, QObject* parent) 16BreakPointModel::BreakPointModel(std::shared_ptr<Pica::DebugContext> debug_context, QObject* parent)
17 : QAbstractListModel(parent), context_weak(debug_context), 17 : QAbstractListModel(parent), context_weak(debug_context),
18 at_breakpoint(debug_context->at_breakpoint), 18 at_breakpoint(debug_context->at_breakpoint),
19 active_breakpoint(debug_context->active_breakpoint) { 19 active_breakpoint(debug_context->active_breakpoint) {}
20}
21 20
22int BreakPointModel::columnCount(const QModelIndex& parent) const { 21int BreakPointModel::columnCount(const QModelIndex& parent) const {
23 return 1; 22 return 1;
@@ -42,7 +41,8 @@ QVariant BreakPointModel::data(const QModelIndex& index, int role) const {
42 {Pica::DebugContext::Event::IncomingDisplayTransfer, 41 {Pica::DebugContext::Event::IncomingDisplayTransfer,
43 tr("Incoming display transfer")}, 42 tr("Incoming display transfer")},
44 {Pica::DebugContext::Event::GSPCommandProcessed, tr("GSP command processed")}, 43 {Pica::DebugContext::Event::GSPCommandProcessed, tr("GSP command processed")},
45 {Pica::DebugContext::Event::BufferSwapped, tr("Buffers swapped")}}; 44 {Pica::DebugContext::Event::BufferSwapped, tr("Buffers swapped")},
45 };
46 46
47 DEBUG_ASSERT(map.size() == static_cast<size_t>(Pica::DebugContext::Event::NumEvents)); 47 DEBUG_ASSERT(map.size() == static_cast<size_t>(Pica::DebugContext::Event::NumEvents));
48 return (map.find(event) != map.end()) ? map.at(event) : QString(); 48 return (map.find(event) != map.end()) ? map.at(event) : QString();
diff --git a/src/citra_qt/debugger/graphics_cmdlists.cpp b/src/citra_qt/debugger/graphics_cmdlists.cpp
index daf1cf1de..b088ad29d 100644
--- a/src/citra_qt/debugger/graphics_cmdlists.cpp
+++ b/src/citra_qt/debugger/graphics_cmdlists.cpp
@@ -51,8 +51,7 @@ public:
51 } 51 }
52}; 52};
53 53
54GPUCommandListModel::GPUCommandListModel(QObject* parent) : QAbstractListModel(parent) { 54GPUCommandListModel::GPUCommandListModel(QObject* parent) : QAbstractListModel(parent) {}
55}
56 55
57int GPUCommandListModel::rowCount(const QModelIndex& parent) const { 56int GPUCommandListModel::rowCount(const QModelIndex& parent) const {
58 return static_cast<int>(pica_trace.writes.size()); 57 return static_cast<int>(pica_trace.writes.size());
diff --git a/src/citra_qt/debugger/graphics_surface.cpp b/src/citra_qt/debugger/graphics_surface.cpp
index 839fca124..bb998acc4 100644
--- a/src/citra_qt/debugger/graphics_surface.cpp
+++ b/src/citra_qt/debugger/graphics_surface.cpp
@@ -25,10 +25,8 @@
25#include "video_core/utils.h" 25#include "video_core/utils.h"
26 26
27SurfacePicture::SurfacePicture(QWidget* parent, GraphicsSurfaceWidget* surface_widget_) 27SurfacePicture::SurfacePicture(QWidget* parent, GraphicsSurfaceWidget* surface_widget_)
28 : QLabel(parent), surface_widget(surface_widget_) { 28 : QLabel(parent), surface_widget(surface_widget_) {}
29} 29SurfacePicture::~SurfacePicture() {}
30SurfacePicture::~SurfacePicture() {
31}
32 30
33void SurfacePicture::mousePressEvent(QMouseEvent* event) { 31void SurfacePicture::mousePressEvent(QMouseEvent* event) {
34 // Only do something while the left mouse button is held down 32 // Only do something while the left mouse button is held down
@@ -707,9 +705,8 @@ unsigned int GraphicsSurfaceWidget::NibblesPerPixel(GraphicsSurfaceWidget::Forma
707 case Format::D16: 705 case Format::D16:
708 return 2 * 2; 706 return 2 * 2;
709 default: 707 default:
710 UNREACHABLE_MSG("GraphicsSurfaceWidget::BytesPerPixel: this " 708 UNREACHABLE_MSG("GraphicsSurfaceWidget::BytesPerPixel: this should not be reached as this "
711 "should not be reached as this function should " 709 "function should be given a format which is in "
712 "be given a format which is in "
713 "GraphicsSurfaceWidget::Format. Instead got %i", 710 "GraphicsSurfaceWidget::Format. Instead got %i",
714 static_cast<int>(format)); 711 static_cast<int>(format));
715 return 0; 712 return 0;
diff --git a/src/citra_qt/debugger/graphics_vertex_shader.cpp b/src/citra_qt/debugger/graphics_vertex_shader.cpp
index c49327f9c..0f02bc3da 100644
--- a/src/citra_qt/debugger/graphics_vertex_shader.cpp
+++ b/src/citra_qt/debugger/graphics_vertex_shader.cpp
@@ -29,8 +29,7 @@ using nihstro::SourceRegister;
29using nihstro::SwizzlePattern; 29using nihstro::SwizzlePattern;
30 30
31GraphicsVertexShaderModel::GraphicsVertexShaderModel(GraphicsVertexShaderWidget* parent) 31GraphicsVertexShaderModel::GraphicsVertexShaderModel(GraphicsVertexShaderWidget* parent)
32 : QAbstractTableModel(parent), par(parent) { 32 : QAbstractTableModel(parent), par(parent) {}
33}
34 33
35int GraphicsVertexShaderModel::columnCount(const QModelIndex& parent) const { 34int GraphicsVertexShaderModel::columnCount(const QModelIndex& parent) const {
36 return 3; 35 return 3;
diff --git a/src/citra_qt/debugger/ramview.cpp b/src/citra_qt/debugger/ramview.cpp
index 63f2850e1..10a09dda8 100644
--- a/src/citra_qt/debugger/ramview.cpp
+++ b/src/citra_qt/debugger/ramview.cpp
@@ -4,8 +4,7 @@
4 4
5#include "citra_qt/debugger/ramview.h" 5#include "citra_qt/debugger/ramview.h"
6 6
7GRamView::GRamView(QWidget* parent) : QHexEdit(parent) { 7GRamView::GRamView(QWidget* parent) : QHexEdit(parent) {}
8}
9 8
10void GRamView::OnCPUStepped() { 9void GRamView::OnCPUStepped() {
11 // TODO: QHexEdit doesn't show vertical scroll bars for > 10MB data streams... 10 // TODO: QHexEdit doesn't show vertical scroll bars for > 10MB data streams...
diff --git a/src/citra_qt/debugger/registers.cpp b/src/citra_qt/debugger/registers.cpp
index 82da0022f..87c8c3418 100644
--- a/src/citra_qt/debugger/registers.cpp
+++ b/src/citra_qt/debugger/registers.cpp
@@ -75,8 +75,7 @@ void RegistersWidget::OnDebugModeEntered() {
75 UpdateVFPSystemRegisterValues(); 75 UpdateVFPSystemRegisterValues();
76} 76}
77 77
78void RegistersWidget::OnDebugModeLeft() { 78void RegistersWidget::OnDebugModeLeft() {}
79}
80 79
81void RegistersWidget::OnEmulationStarting(EmuThread* emu_thread) { 80void RegistersWidget::OnEmulationStarting(EmuThread* emu_thread) {
82 setEnabled(true); 81 setEnabled(true);
diff --git a/src/citra_qt/game_list_p.h b/src/citra_qt/game_list_p.h
index bcb3fccbd..c8a9ee5db 100644
--- a/src/citra_qt/game_list_p.h
+++ b/src/citra_qt/game_list_p.h
@@ -59,12 +59,9 @@ static QString GetQStringShortTitleFromSMDH(const Loader::SMDH& smdh,
59class GameListItem : public QStandardItem { 59class GameListItem : public QStandardItem {
60 60
61public: 61public:
62 GameListItem() : QStandardItem() { 62 GameListItem() : QStandardItem() {}
63 } 63 GameListItem(const QString& string) : QStandardItem(string) {}
64 GameListItem(const QString& string) : QStandardItem(string) { 64 virtual ~GameListItem() override {}
65 }
66 virtual ~GameListItem() override {
67 }
68}; 65};
69 66
70/** 67/**
@@ -79,8 +76,7 @@ public:
79 static const int FullPathRole = Qt::UserRole + 1; 76 static const int FullPathRole = Qt::UserRole + 1;
80 static const int TitleRole = Qt::UserRole + 2; 77 static const int TitleRole = Qt::UserRole + 2;
81 78
82 GameListItemPath() : GameListItem() { 79 GameListItemPath() : GameListItem() {}
83 }
84 GameListItemPath(const QString& game_path, const std::vector<u8>& smdh_data) : GameListItem() { 80 GameListItemPath(const QString& game_path, const std::vector<u8>& smdh_data) : GameListItem() {
85 setData(game_path, FullPathRole); 81 setData(game_path, FullPathRole);
86 82
@@ -124,8 +120,7 @@ class GameListItemSize : public GameListItem {
124public: 120public:
125 static const int SizeRole = Qt::UserRole + 1; 121 static const int SizeRole = Qt::UserRole + 1;
126 122
127 GameListItemSize() : GameListItem() { 123 GameListItemSize() : GameListItem() {}
128 }
129 GameListItemSize(const qulonglong size_bytes) : GameListItem() { 124 GameListItemSize(const qulonglong size_bytes) : GameListItem() {
130 setData(size_bytes, SizeRole); 125 setData(size_bytes, SizeRole);
131 } 126 }
@@ -161,8 +156,7 @@ class GameListWorker : public QObject, public QRunnable {
161 156
162public: 157public:
163 GameListWorker(QString dir_path, bool deep_scan) 158 GameListWorker(QString dir_path, bool deep_scan)
164 : QObject(), QRunnable(), dir_path(dir_path), deep_scan(deep_scan) { 159 : QObject(), QRunnable(), dir_path(dir_path), deep_scan(deep_scan) {}
165 }
166 160
167public slots: 161public slots:
168 /// Starts the processing of directory tree information. 162 /// Starts the processing of directory tree information.
diff --git a/src/citra_qt/hotkeys.cpp b/src/citra_qt/hotkeys.cpp
index 6301259d8..3e38223ee 100644
--- a/src/citra_qt/hotkeys.cpp
+++ b/src/citra_qt/hotkeys.cpp
@@ -12,8 +12,7 @@
12#include "citra_qt/ui_settings.h" 12#include "citra_qt/ui_settings.h"
13 13
14struct Hotkey { 14struct Hotkey {
15 Hotkey() : shortcut(nullptr), context(Qt::WindowShortcut) { 15 Hotkey() : shortcut(nullptr), context(Qt::WindowShortcut) {}
16 }
17 16
18 QKeySequence keyseq; 17 QKeySequence keyseq;
19 QShortcut* shortcut; 18 QShortcut* shortcut;
diff --git a/src/citra_qt/main.h b/src/citra_qt/main.h
index 717c68382..10157310e 100644
--- a/src/citra_qt/main.h
+++ b/src/citra_qt/main.h
@@ -26,8 +26,8 @@ class GPUCommandListWidget;
26class GMainWindow : public QMainWindow { 26class GMainWindow : public QMainWindow {
27 Q_OBJECT 27 Q_OBJECT
28 28
29 static const int max_recent_files_item = 29 /// Max number of recently loaded items to keep track of
30 10; ///< Max number of recently loaded items to keep track 30 static const int max_recent_files_item = 10;
31 31
32 // TODO: Make use of this! 32 // TODO: Make use of this!
33 enum { 33 enum {
diff --git a/src/common/bit_set.h b/src/common/bit_set.h
index b83cbbb36..c48b3b769 100644
--- a/src/common/bit_set.h
+++ b/src/common/bit_set.h
@@ -102,10 +102,8 @@ public:
102 // A reference to a particular bit, returned from operator[]. 102 // A reference to a particular bit, returned from operator[].
103 class Ref { 103 class Ref {
104 public: 104 public:
105 Ref(Ref&& other) : m_bs(other.m_bs), m_mask(other.m_mask) { 105 Ref(Ref&& other) : m_bs(other.m_bs), m_mask(other.m_mask) {}
106 } 106 Ref(BitSet* bs, IntTy mask) : m_bs(bs), m_mask(mask) {}
107 Ref(BitSet* bs, IntTy mask) : m_bs(bs), m_mask(mask) {
108 }
109 operator bool() const { 107 operator bool() const {
110 return (m_bs->m_val & m_mask) != 0; 108 return (m_bs->m_val & m_mask) != 0;
111 } 109 }
@@ -122,10 +120,8 @@ public:
122 // A STL-like iterator is required to be able to use range-based for loops. 120 // A STL-like iterator is required to be able to use range-based for loops.
123 class Iterator { 121 class Iterator {
124 public: 122 public:
125 Iterator(const Iterator& other) : m_val(other.m_val), m_bit(other.m_bit) { 123 Iterator(const Iterator& other) : m_val(other.m_val), m_bit(other.m_bit) {}
126 } 124 Iterator(IntTy val, int bit) : m_val(val), m_bit(bit) {}
127 Iterator(IntTy val, int bit) : m_val(val), m_bit(bit) {
128 }
129 Iterator& operator=(Iterator other) { 125 Iterator& operator=(Iterator other) {
130 new (this) Iterator(other); 126 new (this) Iterator(other);
131 return *this; 127 return *this;
@@ -160,10 +156,8 @@ public:
160 int m_bit; 156 int m_bit;
161 }; 157 };
162 158
163 BitSet() : m_val(0) { 159 BitSet() : m_val(0) {}
164 } 160 explicit BitSet(IntTy val) : m_val(val) {}
165 explicit BitSet(IntTy val) : m_val(val) {
166 }
167 BitSet(std::initializer_list<int> init) { 161 BitSet(std::initializer_list<int> init) {
168 m_val = 0; 162 m_val = 0;
169 for (int bit : init) 163 for (int bit : init)
diff --git a/src/common/chunk_file.h b/src/common/chunk_file.h
index 3b36c0a9e..2bf3c774b 100644
--- a/src/common/chunk_file.h
+++ b/src/common/chunk_file.h
@@ -50,8 +50,7 @@ class PointerWrap;
50class PointerWrapSection { 50class PointerWrapSection {
51public: 51public:
52 PointerWrapSection(PointerWrap& p, int ver, const char* title) 52 PointerWrapSection(PointerWrap& p, int ver, const char* title)
53 : p_(p), ver_(ver), title_(title) { 53 : p_(p), ver_(ver), title_(title) {}
54 }
55 ~PointerWrapSection(); 54 ~PointerWrapSection();
56 55
57 bool operator==(const int& v) const { 56 bool operator==(const int& v) const {
@@ -134,11 +133,9 @@ public:
134 Error error; 133 Error error;
135 134
136public: 135public:
137 PointerWrap(u8** ptr_, Mode mode_) : ptr(ptr_), mode(mode_), error(ERROR_NONE) { 136 PointerWrap(u8** ptr_, Mode mode_) : ptr(ptr_), mode(mode_), error(ERROR_NONE) {}
138 }
139 PointerWrap(unsigned char** ptr_, int mode_) 137 PointerWrap(unsigned char** ptr_, int mode_)
140 : ptr((u8**)ptr_), mode((Mode)mode_), error(ERROR_NONE) { 138 : ptr((u8**)ptr_), mode((Mode)mode_), error(ERROR_NONE) {}
141 }
142 139
143 PointerWrapSection Section(const char* title, int ver) { 140 PointerWrapSection Section(const char* title, int ver) {
144 return Section(title, ver, ver); 141 return Section(title, ver, ver);
diff --git a/src/common/code_block.h b/src/common/code_block.h
index 58696737e..099088925 100644
--- a/src/common/code_block.h
+++ b/src/common/code_block.h
@@ -27,8 +27,7 @@ protected:
27 size_t region_size; 27 size_t region_size;
28 28
29public: 29public:
30 CodeBlock() : region(nullptr), region_size(0) { 30 CodeBlock() : region(nullptr), region_size(0) {}
31 }
32 virtual ~CodeBlock() { 31 virtual ~CodeBlock() {
33 if (region) 32 if (region)
34 FreeCodeSpace(); 33 FreeCodeSpace();
diff --git a/src/common/common_funcs.h b/src/common/common_funcs.h
index ad5bdbc08..7032c2117 100644
--- a/src/common/common_funcs.h
+++ b/src/common/common_funcs.h
@@ -86,8 +86,7 @@ inline u64 _rotr64(u64 x, unsigned int shift) {
86extern "C" { 86extern "C" {
87__declspec(dllimport) void __stdcall DebugBreak(void); 87__declspec(dllimport) void __stdcall DebugBreak(void);
88} 88}
89#define Crash() \ 89#define Crash() DebugBreak()
90 { DebugBreak(); }
91 90
92// cstdlib provides these on MSVC 91// cstdlib provides these on MSVC
93#define rotr _rotr 92#define rotr _rotr
diff --git a/src/common/emu_window.h b/src/common/emu_window.h
index de8badd4f..20131300d 100644
--- a/src/common/emu_window.h
+++ b/src/common/emu_window.h
@@ -229,8 +229,7 @@ protected:
229 circle_pad_y = 0; 229 circle_pad_y = 0;
230 touch_pressed = false; 230 touch_pressed = false;
231 } 231 }
232 virtual ~EmuWindow() { 232 virtual ~EmuWindow() {}
233 }
234 233
235 /** 234 /**
236 * Processes any pending configuration changes from the last SetConfig call. 235 * Processes any pending configuration changes from the last SetConfig call.
@@ -272,8 +271,8 @@ private:
272 * For the request to be honored, EmuWindow implementations will usually reimplement this 271 * For the request to be honored, EmuWindow implementations will usually reimplement this
273 * function. 272 * function.
274 */ 273 */
275 virtual void 274 virtual void OnMinimalClientAreaChangeRequest(
276 OnMinimalClientAreaChangeRequest(const std::pair<unsigned, unsigned>& minimal_size) { 275 const std::pair<unsigned, unsigned>& minimal_size) {
277 // By default, ignore this request and do nothing. 276 // By default, ignore this request and do nothing.
278 } 277 }
279 278
diff --git a/src/common/file_util.cpp b/src/common/file_util.cpp
index c8723a4b3..96afe2ca0 100644
--- a/src/common/file_util.cpp
+++ b/src/common/file_util.cpp
@@ -828,8 +828,7 @@ void SplitFilename83(const std::string& filename, std::array<char, 9>& short_nam
828 } 828 }
829} 829}
830 830
831IOFile::IOFile() { 831IOFile::IOFile() {}
832}
833 832
834IOFile::IOFile(const std::string& filename, const char openmode[]) { 833IOFile::IOFile(const std::string& filename, const char openmode[]) {
835 Open(filename, openmode); 834 Open(filename, openmode);
diff --git a/src/common/math_util.h b/src/common/math_util.h
index 696bd43ea..41d89666c 100644
--- a/src/common/math_util.h
+++ b/src/common/math_util.h
@@ -27,12 +27,10 @@ struct Rectangle {
27 T right; 27 T right;
28 T bottom; 28 T bottom;
29 29
30 Rectangle() { 30 Rectangle() {}
31 }
32 31
33 Rectangle(T left, T top, T right, T bottom) 32 Rectangle(T left, T top, T right, T bottom)
34 : left(left), top(top), right(right), bottom(bottom) { 33 : left(left), top(top), right(right), bottom(bottom) {}
35 }
36 34
37 T GetWidth() const { 35 T GetWidth() const {
38 return std::abs(static_cast<typename std::make_signed<T>::type>(right - left)); 36 return std::abs(static_cast<typename std::make_signed<T>::type>(right - left));
diff --git a/src/common/profiler.cpp b/src/common/profiler.cpp
index 992ec25b2..231a0afc1 100644
--- a/src/common/profiler.cpp
+++ b/src/common/profiler.cpp
@@ -14,8 +14,7 @@ namespace Common {
14namespace Profiling { 14namespace Profiling {
15 15
16ProfilingManager::ProfilingManager() 16ProfilingManager::ProfilingManager()
17 : last_frame_end(Clock::now()), this_frame_start(Clock::now()) { 17 : last_frame_end(Clock::now()), this_frame_start(Clock::now()) {}
18}
19 18
20void ProfilingManager::BeginFrame() { 19void ProfilingManager::BeginFrame() {
21 this_frame_start = Clock::now(); 20 this_frame_start = Clock::now();
diff --git a/src/common/scope_exit.h b/src/common/scope_exit.h
index 73b2a262e..072ab285d 100644
--- a/src/common/scope_exit.h
+++ b/src/common/scope_exit.h
@@ -10,8 +10,7 @@
10namespace detail { 10namespace detail {
11template <typename Func> 11template <typename Func>
12struct ScopeExitHelper { 12struct ScopeExitHelper {
13 explicit ScopeExitHelper(Func&& func) : func(std::move(func)) { 13 explicit ScopeExitHelper(Func&& func) : func(std::move(func)) {}
14 }
15 ~ScopeExitHelper() { 14 ~ScopeExitHelper() {
16 func(); 15 func();
17 } 16 }
diff --git a/src/common/swap.h b/src/common/swap.h
index 1794144fb..72c50d789 100644
--- a/src/common/swap.h
+++ b/src/common/swap.h
@@ -168,8 +168,7 @@ public:
168 return swap(value); 168 return swap(value);
169 } 169 }
170 swap_struct_t() = default; 170 swap_struct_t() = default;
171 swap_struct_t(const T& v) : value(swap(v)) { 171 swap_struct_t(const T& v) : value(swap(v)) {}
172 }
173 172
174 template <typename S> 173 template <typename S>
175 swapped_t& operator=(const S& source) { 174 swapped_t& operator=(const S& source) {
diff --git a/src/common/synchronized_wrapper.h b/src/common/synchronized_wrapper.h
index 8dc4ddeac..04b4f2e51 100644
--- a/src/common/synchronized_wrapper.h
+++ b/src/common/synchronized_wrapper.h
@@ -19,8 +19,7 @@ template <typename T>
19class SynchronizedWrapper { 19class SynchronizedWrapper {
20public: 20public:
21 template <typename... Args> 21 template <typename... Args>
22 SynchronizedWrapper(Args&&... args) : data(std::forward<Args>(args)...) { 22 SynchronizedWrapper(Args&&... args) : data(std::forward<Args>(args)...) {}
23 }
24 23
25private: 24private:
26 template <typename U> 25 template <typename U>
diff --git a/src/common/thread.h b/src/common/thread.h
index b189dc764..499c151c2 100644
--- a/src/common/thread.h
+++ b/src/common/thread.h
@@ -39,8 +39,7 @@ void SetCurrentThreadAffinity(u32 mask);
39 39
40class Event { 40class Event {
41public: 41public:
42 Event() : is_set(false) { 42 Event() : is_set(false) {}
43 }
44 43
45 void Set() { 44 void Set() {
46 std::lock_guard<std::mutex> lk(mutex); 45 std::lock_guard<std::mutex> lk(mutex);
@@ -71,8 +70,7 @@ private:
71 70
72class Barrier { 71class Barrier {
73public: 72public:
74 explicit Barrier(size_t count_) : count(count_), waiting(0), generation(0) { 73 explicit Barrier(size_t count_) : count(count_), waiting(0), generation(0) {}
75 }
76 74
77 /// Blocks until all "count" threads have called Sync() 75 /// Blocks until all "count" threads have called Sync()
78 void Sync() { 76 void Sync() {
diff --git a/src/common/vector_math.h b/src/common/vector_math.h
index b2d630829..2d56f168c 100644
--- a/src/common/vector_math.h
+++ b/src/common/vector_math.h
@@ -60,10 +60,8 @@ public:
60 } 60 }
61 61
62 Vec2() = default; 62 Vec2() = default;
63 Vec2(const T a[2]) : x(a[0]), y(a[1]) { 63 Vec2(const T a[2]) : x(a[0]), y(a[1]) {}
64 } 64 Vec2(const T& _x, const T& _y) : x(_x), y(_y) {}
65 Vec2(const T& _x, const T& _y) : x(_x), y(_y) {
66 }
67 65
68 template <typename T2> 66 template <typename T2>
69 Vec2<T2> Cast() const { 67 Vec2<T2> Cast() const {
@@ -201,10 +199,8 @@ public:
201 } 199 }
202 200
203 Vec3() = default; 201 Vec3() = default;
204 Vec3(const T a[3]) : x(a[0]), y(a[1]), z(a[2]) { 202 Vec3(const T a[3]) : x(a[0]), y(a[1]), z(a[2]) {}
205 } 203 Vec3(const T& _x, const T& _y, const T& _z) : x(_x), y(_y), z(_z) {}
206 Vec3(const T& _x, const T& _y, const T& _z) : x(_x), y(_y), z(_z) {
207 }
208 204
209 template <typename T2> 205 template <typename T2>
210 Vec3<T2> Cast() const { 206 Vec3<T2> Cast() const {
@@ -409,10 +405,8 @@ public:
409 } 405 }
410 406
411 Vec4() = default; 407 Vec4() = default;
412 Vec4(const T a[4]) : x(a[0]), y(a[1]), z(a[2]), w(a[3]) { 408 Vec4(const T a[4]) : x(a[0]), y(a[1]), z(a[2]), w(a[3]) {}
413 } 409 Vec4(const T& _x, const T& _y, const T& _z, const T& _w) : x(_x), y(_y), z(_z), w(_w) {}
414 Vec4(const T& _x, const T& _y, const T& _z, const T& _w) : x(_x), y(_y), z(_z), w(_w) {
415 }
416 410
417 template <typename T2> 411 template <typename T2>
418 Vec4<T2> Cast() const { 412 Vec4<T2> Cast() const {
diff --git a/src/common/x64/emitter.cpp b/src/common/x64/emitter.cpp
index 1a9fd6a6b..7cf350b4a 100644
--- a/src/common/x64/emitter.cpp
+++ b/src/common/x64/emitter.cpp
@@ -222,7 +222,7 @@ void OpArg::WriteVex(XEmitter* emit, X64Reg regOp1, X64Reg regOp2, int L, int pp
222void OpArg::WriteRest(XEmitter* emit, int extraBytes, X64Reg _operandReg, 222void OpArg::WriteRest(XEmitter* emit, int extraBytes, X64Reg _operandReg,
223 bool warn_64bit_offset) const { 223 bool warn_64bit_offset) const {
224 if (_operandReg == INVALID_REG) 224 if (_operandReg == INVALID_REG)
225 _operandReg = (X64Reg) this->operandReg; 225 _operandReg = (X64Reg)this->operandReg;
226 int mod = 0; 226 int mod = 0;
227 int ireg = indexReg; 227 int ireg = indexReg;
228 bool SIB = false; 228 bool SIB = false;
diff --git a/src/common/x64/emitter.h b/src/common/x64/emitter.h
index 467f7812f..6c9dc3d6b 100644
--- a/src/common/x64/emitter.h
+++ b/src/common/x64/emitter.h
@@ -233,8 +233,7 @@ struct OpArg {
233 constexpr OpArg() = default; // dummy op arg, used for storage 233 constexpr OpArg() = default; // dummy op arg, used for storage
234 constexpr OpArg(u64 offset_, int scale_, X64Reg rmReg = RAX, X64Reg scaledReg = RAX) 234 constexpr OpArg(u64 offset_, int scale_, X64Reg rmReg = RAX, X64Reg scaledReg = RAX)
235 : scale(static_cast<u8>(scale_)), offsetOrBaseReg(static_cast<u16>(rmReg)), 235 : scale(static_cast<u8>(scale_)), offsetOrBaseReg(static_cast<u16>(rmReg)),
236 indexReg(static_cast<u16>(scaledReg)), offset(offset_) { 236 indexReg(static_cast<u16>(scaledReg)), offset(offset_) {}
237 }
238 237
239 constexpr bool operator==(const OpArg& b) const { 238 constexpr bool operator==(const OpArg& b) const {
240 return operandReg == b.operandReg && scale == b.scale && 239 return operandReg == b.operandReg && scale == b.scale &&
@@ -454,8 +453,7 @@ public:
454 code = code_ptr; 453 code = code_ptr;
455 flags_locked = false; 454 flags_locked = false;
456 } 455 }
457 virtual ~XEmitter() { 456 virtual ~XEmitter() {}
458 }
459 457
460 void WriteModRM(int mod, int rm, int reg); 458 void WriteModRM(int mod, int rm, int reg);
461 void WriteSIB(int scale, int index, int base); 459 void WriteSIB(int scale, int index, int base);
diff --git a/src/core/arm/arm_interface.h b/src/core/arm/arm_interface.h
index 919da6737..e466b21b2 100644
--- a/src/core/arm/arm_interface.h
+++ b/src/core/arm/arm_interface.h
@@ -15,8 +15,7 @@ struct ThreadContext;
15/// Generic ARM11 CPU interface 15/// Generic ARM11 CPU interface
16class ARM_Interface : NonCopyable { 16class ARM_Interface : NonCopyable {
17public: 17public:
18 virtual ~ARM_Interface() { 18 virtual ~ARM_Interface() {}
19 }
20 19
21 /** 20 /**
22 * Runs the CPU for the given number of instructions 21 * Runs the CPU for the given number of instructions
diff --git a/src/core/arm/dyncom/arm_dyncom.cpp b/src/core/arm/dyncom/arm_dyncom.cpp
index d84917529..912560402 100644
--- a/src/core/arm/dyncom/arm_dyncom.cpp
+++ b/src/core/arm/dyncom/arm_dyncom.cpp
@@ -21,8 +21,7 @@ ARM_DynCom::ARM_DynCom(PrivilegeMode initial_mode) {
21 state = std::make_unique<ARMul_State>(initial_mode); 21 state = std::make_unique<ARMul_State>(initial_mode);
22} 22}
23 23
24ARM_DynCom::~ARM_DynCom() { 24ARM_DynCom::~ARM_DynCom() {}
25}
26 25
27void ARM_DynCom::ClearInstructionCache() { 26void ARM_DynCom::ClearInstructionCache() {
28 state->instruction_cache.clear(); 27 state->instruction_cache.clear();
diff --git a/src/core/arm/dyncom/arm_dyncom_trans.cpp b/src/core/arm/dyncom/arm_dyncom_trans.cpp
index e056d890c..526cf28f3 100644
--- a/src/core/arm/dyncom/arm_dyncom_trans.cpp
+++ b/src/core/arm/dyncom/arm_dyncom_trans.cpp
@@ -1883,6 +1883,7 @@ const transop_fp_t arm_instruction_trans[] = {
1883 // All the thumb instructions should be placed the end of table 1883 // All the thumb instructions should be placed the end of table
1884 INTERPRETER_TRANSLATE(b_2_thumb), INTERPRETER_TRANSLATE(b_cond_thumb), 1884 INTERPRETER_TRANSLATE(b_2_thumb), INTERPRETER_TRANSLATE(b_cond_thumb),
1885 INTERPRETER_TRANSLATE(bl_1_thumb), INTERPRETER_TRANSLATE(bl_2_thumb), 1885 INTERPRETER_TRANSLATE(bl_1_thumb), INTERPRETER_TRANSLATE(bl_2_thumb),
1886 INTERPRETER_TRANSLATE(blx_1_thumb)}; 1886 INTERPRETER_TRANSLATE(blx_1_thumb),
1887};
1887 1888
1888const size_t arm_instruction_trans_len = sizeof(arm_instruction_trans) / sizeof(transop_fp_t); 1889const size_t arm_instruction_trans_len = sizeof(arm_instruction_trans) / sizeof(transop_fp_t);
diff --git a/src/core/arm/skyeye_common/armstate.h b/src/core/arm/skyeye_common/armstate.h
index 66567c285..f31fb207c 100644
--- a/src/core/arm/skyeye_common/armstate.h
+++ b/src/core/arm/skyeye_common/armstate.h
@@ -237,10 +237,8 @@ private:
237 void ResetMPCoreCP15Registers(); 237 void ResetMPCoreCP15Registers();
238 238
239 // Defines a reservation granule of 2 words, which protects the first 2 words starting at the 239 // Defines a reservation granule of 2 words, which protects the first 2 words starting at the
240 // tag. 240 // tag. This is the smallest granule allowed by the v7 spec, and is coincidentally just large
241 // This is the smallest granule allowed by the v7 spec, and is coincidentally just large enough 241 // enough to support LDR/STREXD.
242 // to
243 // support LDR/STREXD.
244 static const u32 RESERVATION_GRANULE_MASK = 0xFFFFFFF8; 242 static const u32 RESERVATION_GRANULE_MASK = 0xFFFFFFF8;
245 243
246 u32 exclusive_tag; // The address for which the local monitor is in exclusive access mode 244 u32 exclusive_tag; // The address for which the local monitor is in exclusive access mode
diff --git a/src/core/arm/skyeye_common/vfp/vfpdouble.cpp b/src/core/arm/skyeye_common/vfp/vfpdouble.cpp
index 4d89743e7..2886f351f 100644
--- a/src/core/arm/skyeye_common/vfp/vfpdouble.cpp
+++ b/src/core/arm/skyeye_common/vfp/vfpdouble.cpp
@@ -51,10 +51,10 @@
51 * =========================================================================== 51 * ===========================================================================
52 */ 52 */
53 53
54#include "core/arm/skyeye_common/vfp/vfp.h"
55#include <algorithm> 54#include <algorithm>
56#include "common/logging/log.h" 55#include "common/logging/log.h"
57#include "core/arm/skyeye_common/vfp/asm_vfp.h" 56#include "core/arm/skyeye_common/vfp/asm_vfp.h"
57#include "core/arm/skyeye_common/vfp/vfp.h"
58#include "core/arm/skyeye_common/vfp/vfp_helper.h" 58#include "core/arm/skyeye_common/vfp/vfp_helper.h"
59 59
60static struct vfp_double vfp_double_default_qnan = { 60static struct vfp_double vfp_double_default_qnan = {
diff --git a/src/core/arm/skyeye_common/vfp/vfpsingle.cpp b/src/core/arm/skyeye_common/vfp/vfpsingle.cpp
index 3c21efe62..bf157e2c3 100644
--- a/src/core/arm/skyeye_common/vfp/vfpsingle.cpp
+++ b/src/core/arm/skyeye_common/vfp/vfpsingle.cpp
@@ -280,13 +280,15 @@ static u32 vfp_single_fneg(ARMul_State* state, int sd, int unused, s32 m, u32 fp
280 return 0; 280 return 0;
281} 281}
282 282
283static const u16 sqrt_oddadjust[] = {0x0004, 0x0022, 0x005d, 0x00b1, 0x011d, 0x019f, 283static const u16 sqrt_oddadjust[] = {
284 0x0236, 0x02e0, 0x039c, 0x0468, 0x0545, 0x0631, 284 0x0004, 0x0022, 0x005d, 0x00b1, 0x011d, 0x019f, 0x0236, 0x02e0,
285 0x072b, 0x0832, 0x0946, 0x0a67}; 285 0x039c, 0x0468, 0x0545, 0x0631, 0x072b, 0x0832, 0x0946, 0x0a67,
286};
286 287
287static const u16 sqrt_evenadjust[] = {0x0a2d, 0x08af, 0x075a, 0x0629, 0x051a, 0x0429, 288static const u16 sqrt_evenadjust[] = {
288 0x0356, 0x029e, 0x0200, 0x0179, 0x0109, 0x00af, 289 0x0a2d, 0x08af, 0x075a, 0x0629, 0x051a, 0x0429, 0x0356, 0x029e,
289 0x0068, 0x0034, 0x0012, 0x0002}; 290 0x0200, 0x0179, 0x0109, 0x00af, 0x0068, 0x0034, 0x0012, 0x0002,
291};
290 292
291u32 vfp_estimate_sqrt_significand(u32 exponent, u32 significand) { 293u32 vfp_estimate_sqrt_significand(u32 exponent, u32 significand) {
292 int index; 294 int index;
diff --git a/src/core/core.cpp b/src/core/core.cpp
index 4f9eca416..71a13dd33 100644
--- a/src/core/core.cpp
+++ b/src/core/core.cpp
@@ -28,8 +28,7 @@ void RunLoop(int tight_loop) {
28 GDBStub::HandlePacket(); 28 GDBStub::HandlePacket();
29 29
30 // If the loop is halted and we want to step, use a tiny (1) number of instructions to 30 // If the loop is halted and we want to step, use a tiny (1) number of instructions to
31 // execute. 31 // execute. Otherwise, get out of the loop function.
32 // Otherwise get out of the loop function.
33 if (GDBStub::GetCpuHaltFlag()) { 32 if (GDBStub::GetCpuHaltFlag()) {
34 if (GDBStub::GetCpuStepFlag()) { 33 if (GDBStub::GetCpuStepFlag()) {
35 GDBStub::SetCpuStepFlag(false); 34 GDBStub::SetCpuStepFlag(false);
diff --git a/src/core/core_timing.cpp b/src/core/core_timing.cpp
index b7b988cf1..fb88ecaf2 100644
--- a/src/core/core_timing.cpp
+++ b/src/core/core_timing.cpp
@@ -23,11 +23,9 @@ int g_clock_rate_arm11 = 268123480;
23 23
24namespace CoreTiming { 24namespace CoreTiming {
25struct EventType { 25struct EventType {
26 EventType() { 26 EventType() {}
27 }
28 27
29 EventType(TimedCallback cb, const char* n) : callback(cb), name(n) { 28 EventType(TimedCallback cb, const char* n) : callback(cb), name(n) {}
30 }
31 29
32 TimedCallback callback; 30 TimedCallback callback;
33 const char* name; 31 const char* name;
diff --git a/src/core/file_sys/archive_backend.h b/src/core/file_sys/archive_backend.h
index 79fde9710..7f64fe4e2 100644
--- a/src/core/file_sys/archive_backend.h
+++ b/src/core/file_sys/archive_backend.h
@@ -21,7 +21,13 @@ class FileBackend;
21class DirectoryBackend; 21class DirectoryBackend;
22 22
23// Path string type 23// Path string type
24enum LowPathType : u32 { Invalid = 0, Empty = 1, Binary = 2, Char = 3, Wchar = 4 }; 24enum LowPathType : u32 {
25 Invalid = 0,
26 Empty = 1,
27 Binary = 2,
28 Char = 3,
29 Wchar = 4,
30};
25 31
26union Mode { 32union Mode {
27 u32 hex; 33 u32 hex;
@@ -32,12 +38,9 @@ union Mode {
32 38
33class Path { 39class Path {
34public: 40public:
35 Path() : type(Invalid) { 41 Path() : type(Invalid) {}
36 } 42 Path(const char* path) : type(Char), string(path) {}
37 Path(const char* path) : type(Char), string(path) { 43 Path(std::vector<u8> binary_data) : type(Binary), binary(std::move(binary_data)) {}
38 }
39 Path(std::vector<u8> binary_data) : type(Binary), binary(std::move(binary_data)) {
40 }
41 Path(LowPathType type, u32 size, u32 pointer); 44 Path(LowPathType type, u32 size, u32 pointer);
42 45
43 LowPathType GetType() const { 46 LowPathType GetType() const {
@@ -61,22 +64,18 @@ private:
61 std::u16string u16str; 64 std::u16string u16str;
62}; 65};
63 66
67/// Parameters of the archive, as specified in the Create or Format call.
64struct ArchiveFormatInfo { 68struct ArchiveFormatInfo {
65 u32_le total_size; ///< The pre-defined size of the archive, as specified in the Create or 69 u32_le total_size; ///< The pre-defined size of the archive.
66 /// Format call 70 u32_le number_directories; ///< The pre-defined number of directories in the archive.
67 u32_le number_directories; ///< The pre-defined number of directories in the archive, as 71 u32_le number_files; ///< The pre-defined number of files in the archive.
68 /// specified in the Create or Format call 72 u8 duplicate_data; ///< Whether the archive should duplicate the data.
69 u32_le number_files; ///< The pre-defined number of files in the archive, as specified in the
70 /// Create or Format call
71 u8 duplicate_data; ///< Whether the archive should duplicate the data, as specified in the
72 /// Create or Format call
73}; 73};
74static_assert(std::is_pod<ArchiveFormatInfo>::value, "ArchiveFormatInfo is not POD"); 74static_assert(std::is_pod<ArchiveFormatInfo>::value, "ArchiveFormatInfo is not POD");
75 75
76class ArchiveBackend : NonCopyable { 76class ArchiveBackend : NonCopyable {
77public: 77public:
78 virtual ~ArchiveBackend() { 78 virtual ~ArchiveBackend() {}
79 }
80 79
81 /** 80 /**
82 * Get a descriptive name for the archive (e.g. "RomFS", "SaveData", etc.) 81 * Get a descriptive name for the archive (e.g. "RomFS", "SaveData", etc.)
@@ -153,8 +152,7 @@ public:
153 152
154class ArchiveFactory : NonCopyable { 153class ArchiveFactory : NonCopyable {
155public: 154public:
156 virtual ~ArchiveFactory() { 155 virtual ~ArchiveFactory() {}
157 }
158 156
159 /** 157 /**
160 * Get a descriptive name for the archive (e.g. "RomFS", "SaveData", etc.) 158 * Get a descriptive name for the archive (e.g. "RomFS", "SaveData", etc.)
diff --git a/src/core/file_sys/archive_savedata.cpp b/src/core/file_sys/archive_savedata.cpp
index 9a264091f..860f2fca8 100644
--- a/src/core/file_sys/archive_savedata.cpp
+++ b/src/core/file_sys/archive_savedata.cpp
@@ -48,11 +48,10 @@ ResultVal<std::unique_ptr<ArchiveBackend>> ArchiveFactory_SaveData::Open(const P
48 std::string concrete_mount_point = 48 std::string concrete_mount_point =
49 GetSaveDataPath(mount_point, Kernel::g_current_process->codeset->program_id); 49 GetSaveDataPath(mount_point, Kernel::g_current_process->codeset->program_id);
50 if (!FileUtil::Exists(concrete_mount_point)) { 50 if (!FileUtil::Exists(concrete_mount_point)) {
51 // When a SaveData archive is created for the first time, it is not yet formatted 51 // When a SaveData archive is created for the first time, it is not yet formatted and the
52 // and the save file/directory structure expected by the game has not yet been initialized. 52 // save file/directory structure expected by the game has not yet been initialized.
53 // Returning the NotFormatted error code will signal the game to provision the SaveData 53 // Returning the NotFormatted error code will signal the game to provision the SaveData
54 // archive 54 // archive with the files and folders that it expects.
55 // with the files and folders that it expects.
56 return ResultCode(ErrorDescription::FS_NotFormatted, ErrorModule::FS, 55 return ResultCode(ErrorDescription::FS_NotFormatted, ErrorModule::FS,
57 ErrorSummary::InvalidState, ErrorLevel::Status); 56 ErrorSummary::InvalidState, ErrorLevel::Status);
58 } 57 }
diff --git a/src/core/file_sys/archive_savedatacheck.cpp b/src/core/file_sys/archive_savedatacheck.cpp
index fd9b84302..50fe004fe 100644
--- a/src/core/file_sys/archive_savedatacheck.cpp
+++ b/src/core/file_sys/archive_savedatacheck.cpp
@@ -30,8 +30,7 @@ static std::string GetSaveDataCheckPath(const std::string& mount_point, u32 high
30} 30}
31 31
32ArchiveFactory_SaveDataCheck::ArchiveFactory_SaveDataCheck(const std::string& nand_directory) 32ArchiveFactory_SaveDataCheck::ArchiveFactory_SaveDataCheck(const std::string& nand_directory)
33 : mount_point(GetSaveDataCheckContainerPath(nand_directory)) { 33 : mount_point(GetSaveDataCheckContainerPath(nand_directory)) {}
34}
35 34
36ResultVal<std::unique_ptr<ArchiveBackend>> ArchiveFactory_SaveDataCheck::Open(const Path& path) { 35ResultVal<std::unique_ptr<ArchiveBackend>> ArchiveFactory_SaveDataCheck::Open(const Path& path) {
37 auto vec = path.AsBinary(); 36 auto vec = path.AsBinary();
diff --git a/src/core/file_sys/archive_systemsavedata.cpp b/src/core/file_sys/archive_systemsavedata.cpp
index 1fb858247..0261ab547 100644
--- a/src/core/file_sys/archive_systemsavedata.cpp
+++ b/src/core/file_sys/archive_systemsavedata.cpp
@@ -49,8 +49,7 @@ Path ConstructSystemSaveDataBinaryPath(u32 high, u32 low) {
49} 49}
50 50
51ArchiveFactory_SystemSaveData::ArchiveFactory_SystemSaveData(const std::string& nand_path) 51ArchiveFactory_SystemSaveData::ArchiveFactory_SystemSaveData(const std::string& nand_path)
52 : base_path(GetSystemSaveDataContainerPath(nand_path)) { 52 : base_path(GetSystemSaveDataContainerPath(nand_path)) {}
53}
54 53
55ResultVal<std::unique_ptr<ArchiveBackend>> ArchiveFactory_SystemSaveData::Open(const Path& path) { 54ResultVal<std::unique_ptr<ArchiveBackend>> ArchiveFactory_SystemSaveData::Open(const Path& path) {
56 std::string fullpath = GetSystemSaveDataPath(base_path, path); 55 std::string fullpath = GetSystemSaveDataPath(base_path, path);
diff --git a/src/core/file_sys/directory_backend.h b/src/core/file_sys/directory_backend.h
index c402ee60b..9706e909b 100644
--- a/src/core/file_sys/directory_backend.h
+++ b/src/core/file_sys/directory_backend.h
@@ -38,10 +38,8 @@ static_assert(offsetof(Entry, file_size) == 0x220, "Wrong offset for file_size i
38 38
39class DirectoryBackend : NonCopyable { 39class DirectoryBackend : NonCopyable {
40public: 40public:
41 DirectoryBackend() { 41 DirectoryBackend() {}
42 } 42 virtual ~DirectoryBackend() {}
43 virtual ~DirectoryBackend() {
44 }
45 43
46 /** 44 /**
47 * Open the directory 45 * Open the directory
diff --git a/src/core/file_sys/disk_archive.h b/src/core/file_sys/disk_archive.h
index 3f620128f..64e36f5ea 100644
--- a/src/core/file_sys/disk_archive.h
+++ b/src/core/file_sys/disk_archive.h
@@ -29,8 +29,7 @@ namespace FileSys {
29 */ 29 */
30class DiskArchive : public ArchiveBackend { 30class DiskArchive : public ArchiveBackend {
31public: 31public:
32 DiskArchive(const std::string& mount_point_) : mount_point(mount_point_) { 32 DiskArchive(const std::string& mount_point_) : mount_point(mount_point_) {}
33 }
34 33
35 virtual std::string GetName() const override { 34 virtual std::string GetName() const override {
36 return "DiskArchive: " + mount_point; 35 return "DiskArchive: " + mount_point;
diff --git a/src/core/file_sys/file_backend.h b/src/core/file_sys/file_backend.h
index 9eae697c2..3496facd4 100644
--- a/src/core/file_sys/file_backend.h
+++ b/src/core/file_sys/file_backend.h
@@ -16,10 +16,8 @@ namespace FileSys {
16 16
17class FileBackend : NonCopyable { 17class FileBackend : NonCopyable {
18public: 18public:
19 FileBackend() { 19 FileBackend() {}
20 } 20 virtual ~FileBackend() {}
21 virtual ~FileBackend() {
22 }
23 21
24 /** 22 /**
25 * Open the file 23 * Open the file
diff --git a/src/core/file_sys/ivfc_archive.h b/src/core/file_sys/ivfc_archive.h
index dab1958f6..0d15550da 100644
--- a/src/core/file_sys/ivfc_archive.h
+++ b/src/core/file_sys/ivfc_archive.h
@@ -30,8 +30,7 @@ namespace FileSys {
30class IVFCArchive : public ArchiveBackend { 30class IVFCArchive : public ArchiveBackend {
31public: 31public:
32 IVFCArchive(std::shared_ptr<FileUtil::IOFile> file, u64 offset, u64 size) 32 IVFCArchive(std::shared_ptr<FileUtil::IOFile> file, u64 offset, u64 size)
33 : romfs_file(file), data_offset(offset), data_size(size) { 33 : romfs_file(file), data_offset(offset), data_size(size) {}
34 }
35 34
36 std::string GetName() const override; 35 std::string GetName() const override;
37 36
@@ -55,8 +54,7 @@ protected:
55class IVFCFile : public FileBackend { 54class IVFCFile : public FileBackend {
56public: 55public:
57 IVFCFile(std::shared_ptr<FileUtil::IOFile> file, u64 offset, u64 size) 56 IVFCFile(std::shared_ptr<FileUtil::IOFile> file, u64 offset, u64 size)
58 : romfs_file(file), data_offset(offset), data_size(size) { 57 : romfs_file(file), data_offset(offset), data_size(size) {}
59 }
60 58
61 ResultCode Open() override { 59 ResultCode Open() override {
62 return RESULT_SUCCESS; 60 return RESULT_SUCCESS;
@@ -68,8 +66,7 @@ public:
68 bool Close() const override { 66 bool Close() const override {
69 return false; 67 return false;
70 } 68 }
71 void Flush() const override { 69 void Flush() const override {}
72 }
73 70
74private: 71private:
75 std::shared_ptr<FileUtil::IOFile> romfs_file; 72 std::shared_ptr<FileUtil::IOFile> romfs_file;
diff --git a/src/core/hle/applets/applet.h b/src/core/hle/applets/applet.h
index 350a58594..1850ad261 100644
--- a/src/core/hle/applets/applet.h
+++ b/src/core/hle/applets/applet.h
@@ -14,10 +14,8 @@ namespace Applets {
14 14
15class Applet { 15class Applet {
16public: 16public:
17 virtual ~Applet() { 17 virtual ~Applet() {}
18 } 18 Applet(Service::APT::AppletId id) : id(id) {}
19 Applet(Service::APT::AppletId id) : id(id) {
20 }
21 19
22 /** 20 /**
23 * Creates an instance of the Applet subclass identified by the parameter. 21 * Creates an instance of the Applet subclass identified by the parameter.
diff --git a/src/core/hle/applets/erreula.cpp b/src/core/hle/applets/erreula.cpp
index 144d6a152..457cbb1bd 100644
--- a/src/core/hle/applets/erreula.cpp
+++ b/src/core/hle/applets/erreula.cpp
@@ -67,8 +67,7 @@ ResultCode ErrEula::StartImpl(const Service::APT::AppletStartupParameter& parame
67 return RESULT_SUCCESS; 67 return RESULT_SUCCESS;
68} 68}
69 69
70void ErrEula::Update() { 70void ErrEula::Update() {}
71}
72 71
73} // namespace Applets 72} // namespace Applets
74} // namespace HLE 73} // namespace HLE
diff --git a/src/core/hle/applets/erreula.h b/src/core/hle/applets/erreula.h
index dd1d1aee4..a7ec7ec01 100644
--- a/src/core/hle/applets/erreula.h
+++ b/src/core/hle/applets/erreula.h
@@ -12,8 +12,7 @@ namespace Applets {
12 12
13class ErrEula final : public Applet { 13class ErrEula final : public Applet {
14public: 14public:
15 explicit ErrEula(Service::APT::AppletId id) : Applet(id) { 15 explicit ErrEula(Service::APT::AppletId id) : Applet(id) {}
16 }
17 16
18 ResultCode ReceiveParameter(const Service::APT::MessageParameter& parameter) override; 17 ResultCode ReceiveParameter(const Service::APT::MessageParameter& parameter) override;
19 ResultCode StartImpl(const Service::APT::AppletStartupParameter& parameter) override; 18 ResultCode StartImpl(const Service::APT::AppletStartupParameter& parameter) override;
diff --git a/src/core/hle/applets/mii_selector.cpp b/src/core/hle/applets/mii_selector.cpp
index 19e603eda..79264d349 100644
--- a/src/core/hle/applets/mii_selector.cpp
+++ b/src/core/hle/applets/mii_selector.cpp
@@ -85,7 +85,6 @@ ResultCode MiiSelector::StartImpl(const Service::APT::AppletStartupParameter& pa
85 return RESULT_SUCCESS; 85 return RESULT_SUCCESS;
86} 86}
87 87
88void MiiSelector::Update() { 88void MiiSelector::Update() {}
89}
90} 89}
91} // namespace 90} // namespace
diff --git a/src/core/hle/applets/mii_selector.h b/src/core/hle/applets/mii_selector.h
index dba4abc8d..26966a271 100644
--- a/src/core/hle/applets/mii_selector.h
+++ b/src/core/hle/applets/mii_selector.h
@@ -66,8 +66,7 @@ ASSERT_REG_POSITION(unk_6C, 0x6C);
66 66
67class MiiSelector final : public Applet { 67class MiiSelector final : public Applet {
68public: 68public:
69 MiiSelector(Service::APT::AppletId id) : Applet(id), started(false) { 69 MiiSelector(Service::APT::AppletId id) : Applet(id), started(false) {}
70 }
71 70
72 ResultCode ReceiveParameter(const Service::APT::MessageParameter& parameter) override; 71 ResultCode ReceiveParameter(const Service::APT::MessageParameter& parameter) override;
73 ResultCode StartImpl(const Service::APT::AppletStartupParameter& parameter) override; 72 ResultCode StartImpl(const Service::APT::AppletStartupParameter& parameter) override;
diff --git a/src/core/hle/applets/swkbd.h b/src/core/hle/applets/swkbd.h
index f50673912..4e2f9de62 100644
--- a/src/core/hle/applets/swkbd.h
+++ b/src/core/hle/applets/swkbd.h
@@ -53,8 +53,7 @@ static_assert(sizeof(SoftwareKeyboardConfig) == 0x400, "Software Keyboard Config
53 53
54class SoftwareKeyboard final : public Applet { 54class SoftwareKeyboard final : public Applet {
55public: 55public:
56 SoftwareKeyboard(Service::APT::AppletId id) : Applet(id), started(false) { 56 SoftwareKeyboard(Service::APT::AppletId id) : Applet(id), started(false) {}
57 }
58 57
59 ResultCode ReceiveParameter(const Service::APT::MessageParameter& parameter) override; 58 ResultCode ReceiveParameter(const Service::APT::MessageParameter& parameter) override;
60 ResultCode StartImpl(const Service::APT::AppletStartupParameter& parameter) override; 59 ResultCode StartImpl(const Service::APT::AppletStartupParameter& parameter) override;
diff --git a/src/core/hle/kernel/address_arbiter.cpp b/src/core/hle/kernel/address_arbiter.cpp
index 2ff652f13..3506c2d48 100644
--- a/src/core/hle/kernel/address_arbiter.cpp
+++ b/src/core/hle/kernel/address_arbiter.cpp
@@ -16,10 +16,8 @@
16 16
17namespace Kernel { 17namespace Kernel {
18 18
19AddressArbiter::AddressArbiter() { 19AddressArbiter::AddressArbiter() {}
20} 20AddressArbiter::~AddressArbiter() {}
21AddressArbiter::~AddressArbiter() {
22}
23 21
24SharedPtr<AddressArbiter> AddressArbiter::Create(std::string name) { 22SharedPtr<AddressArbiter> AddressArbiter::Create(std::string name) {
25 SharedPtr<AddressArbiter> address_arbiter(new AddressArbiter); 23 SharedPtr<AddressArbiter> address_arbiter(new AddressArbiter);
diff --git a/src/core/hle/kernel/client_port.cpp b/src/core/hle/kernel/client_port.cpp
index 5df769c6a..444ce8d45 100644
--- a/src/core/hle/kernel/client_port.cpp
+++ b/src/core/hle/kernel/client_port.cpp
@@ -10,9 +10,7 @@
10 10
11namespace Kernel { 11namespace Kernel {
12 12
13ClientPort::ClientPort() { 13ClientPort::ClientPort() {}
14} 14ClientPort::~ClientPort() {}
15ClientPort::~ClientPort() {
16}
17 15
18} // namespace 16} // namespace
diff --git a/src/core/hle/kernel/event.cpp b/src/core/hle/kernel/event.cpp
index 63375818d..f056eb7c3 100644
--- a/src/core/hle/kernel/event.cpp
+++ b/src/core/hle/kernel/event.cpp
@@ -14,10 +14,8 @@
14 14
15namespace Kernel { 15namespace Kernel {
16 16
17Event::Event() { 17Event::Event() {}
18} 18Event::~Event() {}
19Event::~Event() {
20}
21 19
22SharedPtr<Event> Event::Create(ResetType reset_type, std::string name) { 20SharedPtr<Event> Event::Create(ResetType reset_type, std::string name) {
23 SharedPtr<Event> evt(new Event); 21 SharedPtr<Event> evt(new Event);
diff --git a/src/core/hle/kernel/kernel.h b/src/core/hle/kernel/kernel.h
index cc39652d5..c683fcb80 100644
--- a/src/core/hle/kernel/kernel.h
+++ b/src/core/hle/kernel/kernel.h
@@ -58,8 +58,7 @@ enum {
58 58
59class Object : NonCopyable { 59class Object : NonCopyable {
60public: 60public:
61 virtual ~Object() { 61 virtual ~Object() {}
62 }
63 62
64 /// Returns a unique identifier for the object. For debugging purposes only. 63 /// Returns a unique identifier for the object. For debugging purposes only.
65 unsigned int GetObjectId() const { 64 unsigned int GetObjectId() const {
diff --git a/src/core/hle/kernel/mutex.cpp b/src/core/hle/kernel/mutex.cpp
index f92810804..edb97d324 100644
--- a/src/core/hle/kernel/mutex.cpp
+++ b/src/core/hle/kernel/mutex.cpp
@@ -33,10 +33,8 @@ void ReleaseThreadMutexes(Thread* thread) {
33 thread->held_mutexes.clear(); 33 thread->held_mutexes.clear();
34} 34}
35 35
36Mutex::Mutex() { 36Mutex::Mutex() {}
37} 37Mutex::~Mutex() {}
38Mutex::~Mutex() {
39}
40 38
41SharedPtr<Mutex> Mutex::Create(bool initial_locked, std::string name) { 39SharedPtr<Mutex> Mutex::Create(bool initial_locked, std::string name) {
42 SharedPtr<Mutex> mutex(new Mutex); 40 SharedPtr<Mutex> mutex(new Mutex);
diff --git a/src/core/hle/kernel/process.cpp b/src/core/hle/kernel/process.cpp
index cc37e574c..b764f750f 100644
--- a/src/core/hle/kernel/process.cpp
+++ b/src/core/hle/kernel/process.cpp
@@ -26,10 +26,8 @@ SharedPtr<CodeSet> CodeSet::Create(std::string name, u64 program_id) {
26 return codeset; 26 return codeset;
27} 27}
28 28
29CodeSet::CodeSet() { 29CodeSet::CodeSet() {}
30} 30CodeSet::~CodeSet() {}
31CodeSet::~CodeSet() {
32}
33 31
34u32 Process::next_process_id; 32u32 Process::next_process_id;
35 33
@@ -282,10 +280,8 @@ ResultCode Process::LinearFree(VAddr target, u32 size) {
282 return RESULT_SUCCESS; 280 return RESULT_SUCCESS;
283} 281}
284 282
285Kernel::Process::Process() { 283Kernel::Process::Process() {}
286} 284Kernel::Process::~Process() {}
287Kernel::Process::~Process() {
288}
289 285
290SharedPtr<Process> g_current_process; 286SharedPtr<Process> g_current_process;
291} 287}
diff --git a/src/core/hle/kernel/resource_limit.cpp b/src/core/hle/kernel/resource_limit.cpp
index 7bd1c1e08..bb0baed6f 100644
--- a/src/core/hle/kernel/resource_limit.cpp
+++ b/src/core/hle/kernel/resource_limit.cpp
@@ -12,10 +12,8 @@ namespace Kernel {
12 12
13static SharedPtr<ResourceLimit> resource_limits[4]; 13static SharedPtr<ResourceLimit> resource_limits[4];
14 14
15ResourceLimit::ResourceLimit() { 15ResourceLimit::ResourceLimit() {}
16} 16ResourceLimit::~ResourceLimit() {}
17ResourceLimit::~ResourceLimit() {
18}
19 17
20SharedPtr<ResourceLimit> ResourceLimit::Create(std::string name) { 18SharedPtr<ResourceLimit> ResourceLimit::Create(std::string name) {
21 SharedPtr<ResourceLimit> resource_limit(new ResourceLimit); 19 SharedPtr<ResourceLimit> resource_limit(new ResourceLimit);
@@ -150,7 +148,6 @@ void ResourceLimitsInit() {
150 resource_limits[static_cast<u8>(ResourceLimitCategory::OTHER)] = resource_limit; 148 resource_limits[static_cast<u8>(ResourceLimitCategory::OTHER)] = resource_limit;
151} 149}
152 150
153void ResourceLimitsShutdown() { 151void ResourceLimitsShutdown() {}
154}
155 152
156} // namespace 153} // namespace
diff --git a/src/core/hle/kernel/resource_limit.h b/src/core/hle/kernel/resource_limit.h
index c08e744e6..5d8b31a2d 100644
--- a/src/core/hle/kernel/resource_limit.h
+++ b/src/core/hle/kernel/resource_limit.h
@@ -92,8 +92,8 @@ public:
92 s32 max_cpu_time = 0; 92 s32 max_cpu_time = 0;
93 93
94 // TODO(Subv): Increment these in their respective Kernel::T::Create functions, keeping in mind 94 // TODO(Subv): Increment these in their respective Kernel::T::Create functions, keeping in mind
95 // that 95 // that APPLICATION resource limits should not be affected by the objects created by service
96 // APPLICATION resource limits should not be affected by the objects created by service modules. 96 // modules.
97 // Currently we have no way of distinguishing if a Create was called by the running application, 97 // Currently we have no way of distinguishing if a Create was called by the running application,
98 // or by a service module. Approach this once we have separated the service modules into their 98 // or by a service module. Approach this once we have separated the service modules into their
99 // own processes 99 // own processes
diff --git a/src/core/hle/kernel/semaphore.cpp b/src/core/hle/kernel/semaphore.cpp
index 71e41079b..16ac22f1d 100644
--- a/src/core/hle/kernel/semaphore.cpp
+++ b/src/core/hle/kernel/semaphore.cpp
@@ -10,10 +10,8 @@
10 10
11namespace Kernel { 11namespace Kernel {
12 12
13Semaphore::Semaphore() { 13Semaphore::Semaphore() {}
14} 14Semaphore::~Semaphore() {}
15Semaphore::~Semaphore() {
16}
17 15
18ResultVal<SharedPtr<Semaphore>> Semaphore::Create(s32 initial_count, s32 max_count, 16ResultVal<SharedPtr<Semaphore>> Semaphore::Create(s32 initial_count, s32 max_count,
19 std::string name) { 17 std::string name) {
diff --git a/src/core/hle/kernel/server_port.cpp b/src/core/hle/kernel/server_port.cpp
index 7c690fa7f..57e93cad4 100644
--- a/src/core/hle/kernel/server_port.cpp
+++ b/src/core/hle/kernel/server_port.cpp
@@ -13,10 +13,8 @@
13 13
14namespace Kernel { 14namespace Kernel {
15 15
16ServerPort::ServerPort() { 16ServerPort::ServerPort() {}
17} 17ServerPort::~ServerPort() {}
18ServerPort::~ServerPort() {
19}
20 18
21bool ServerPort::ShouldWait() { 19bool ServerPort::ShouldWait() {
22 // If there are no pending sessions, we wait until a new one is added. 20 // If there are no pending sessions, we wait until a new one is added.
@@ -27,8 +25,9 @@ void ServerPort::Acquire() {
27 ASSERT_MSG(!ShouldWait(), "object unavailable!"); 25 ASSERT_MSG(!ShouldWait(), "object unavailable!");
28} 26}
29 27
30std::tuple<SharedPtr<ServerPort>, SharedPtr<ClientPort>> 28std::tuple<SharedPtr<ServerPort>, SharedPtr<ClientPort>> ServerPort::CreatePortPair(
31ServerPort::CreatePortPair(u32 max_sessions, std::string name) { 29 u32 max_sessions, std::string name) {
30
32 SharedPtr<ServerPort> server_port(new ServerPort); 31 SharedPtr<ServerPort> server_port(new ServerPort);
33 SharedPtr<ClientPort> client_port(new ClientPort); 32 SharedPtr<ClientPort> client_port(new ClientPort);
34 33
diff --git a/src/core/hle/kernel/server_port.h b/src/core/hle/kernel/server_port.h
index e43d48674..c3f2ae177 100644
--- a/src/core/hle/kernel/server_port.h
+++ b/src/core/hle/kernel/server_port.h
@@ -23,8 +23,8 @@ public:
23 * @param name Optional name of the ports 23 * @param name Optional name of the ports
24 * @return The created port tuple 24 * @return The created port tuple
25 */ 25 */
26 static std::tuple<SharedPtr<ServerPort>, SharedPtr<ClientPort>> 26 static std::tuple<SharedPtr<ServerPort>, SharedPtr<ClientPort>> CreatePortPair(
27 CreatePortPair(u32 max_sessions, std::string name = "UnknownPort"); 27 u32 max_sessions, std::string name = "UnknownPort");
28 28
29 std::string GetTypeName() const override { 29 std::string GetTypeName() const override {
30 return "ServerPort"; 30 return "ServerPort";
diff --git a/src/core/hle/kernel/session.cpp b/src/core/hle/kernel/session.cpp
index 61457845a..8a2a7e3fd 100644
--- a/src/core/hle/kernel/session.cpp
+++ b/src/core/hle/kernel/session.cpp
@@ -7,8 +7,6 @@
7 7
8namespace Kernel { 8namespace Kernel {
9 9
10Session::Session() { 10Session::Session() {}
11} 11Session::~Session() {}
12Session::~Session() {
13}
14} 12}
diff --git a/src/core/hle/kernel/shared_memory.cpp b/src/core/hle/kernel/shared_memory.cpp
index 74f40930c..bf511a338 100644
--- a/src/core/hle/kernel/shared_memory.cpp
+++ b/src/core/hle/kernel/shared_memory.cpp
@@ -12,10 +12,8 @@
12 12
13namespace Kernel { 13namespace Kernel {
14 14
15SharedMemory::SharedMemory() { 15SharedMemory::SharedMemory() {}
16} 16SharedMemory::~SharedMemory() {}
17SharedMemory::~SharedMemory() {
18}
19 17
20SharedPtr<SharedMemory> SharedMemory::Create(SharedPtr<Process> owner_process, u32 size, 18SharedPtr<SharedMemory> SharedMemory::Create(SharedPtr<Process> owner_process, u32 size,
21 MemoryPermission permissions, 19 MemoryPermission permissions,
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp
index 59272715f..0df03c9d5 100644
--- a/src/core/hle/kernel/thread.cpp
+++ b/src/core/hle/kernel/thread.cpp
@@ -61,10 +61,8 @@ inline static u32 const NewThreadId() {
61 return next_thread_id++; 61 return next_thread_id++;
62} 62}
63 63
64Thread::Thread() { 64Thread::Thread() {}
65} 65Thread::~Thread() {}
66Thread::~Thread() {
67}
68 66
69Thread* GetCurrentThread() { 67Thread* GetCurrentThread() {
70 return current_thread; 68 return current_thread;
diff --git a/src/core/hle/kernel/timer.cpp b/src/core/hle/kernel/timer.cpp
index 255cb1aca..427a81923 100644
--- a/src/core/hle/kernel/timer.cpp
+++ b/src/core/hle/kernel/timer.cpp
@@ -20,10 +20,8 @@ static int timer_callback_event_type;
20// us to simply use a pool index or similar. 20// us to simply use a pool index or similar.
21static Kernel::HandleTable timer_callback_handle_table; 21static Kernel::HandleTable timer_callback_handle_table;
22 22
23Timer::Timer() { 23Timer::Timer() {}
24} 24Timer::~Timer() {}
25Timer::~Timer() {
26}
27 25
28SharedPtr<Timer> Timer::Create(ResetType reset_type, std::string name) { 26SharedPtr<Timer> Timer::Create(ResetType reset_type, std::string name) {
29 SharedPtr<Timer> timer(new Timer); 27 SharedPtr<Timer> timer(new Timer);
@@ -103,7 +101,6 @@ void TimersInit() {
103 timer_callback_event_type = CoreTiming::RegisterEvent("TimerCallback", TimerCallback); 101 timer_callback_event_type = CoreTiming::RegisterEvent("TimerCallback", TimerCallback);
104} 102}
105 103
106void TimersShutdown() { 104void TimersShutdown() {}
107}
108 105
109} // namespace 106} // namespace
diff --git a/src/core/hle/result.h b/src/core/hle/result.h
index 6e3dd9cd2..492c1ffa6 100644
--- a/src/core/hle/result.h
+++ b/src/core/hle/result.h
@@ -213,8 +213,7 @@ union ResultCode {
213 // error 213 // error
214 BitField<31, 1, u32> is_error; 214 BitField<31, 1, u32> is_error;
215 215
216 explicit ResultCode(u32 raw) : raw(raw) { 216 explicit ResultCode(u32 raw) : raw(raw) {}
217 }
218 ResultCode(ErrorDescription description_, ErrorModule module_, ErrorSummary summary_, 217 ResultCode(ErrorDescription description_, ErrorModule module_, ErrorSummary summary_,
219 ErrorLevel level_) 218 ErrorLevel level_)
220 : raw(0) { 219 : raw(0) {
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp
index b653523a4..528bb1848 100644
--- a/src/core/hle/service/am/am.cpp
+++ b/src/core/hle/service/am/am.cpp
@@ -186,8 +186,7 @@ void Init() {
186 AddService(new AM_U_Interface); 186 AddService(new AM_U_Interface);
187} 187}
188 188
189void Shutdown() { 189void Shutdown() {}
190}
191 190
192} // namespace AM 191} // namespace AM
193 192
diff --git a/src/core/hle/service/am/am_app.cpp b/src/core/hle/service/am/am_app.cpp
index bfc1ca6bd..827e60335 100644
--- a/src/core/hle/service/am/am_app.cpp
+++ b/src/core/hle/service/am/am_app.cpp
@@ -2,8 +2,8 @@
2// Licensed under GPLv2 or any later version 2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include "core/hle/service/am/am.h"
6#include "core/hle/service/am/am_app.h" 5#include "core/hle/service/am/am_app.h"
6#include "core/hle/service/am/am.h"
7 7
8namespace Service { 8namespace Service {
9namespace AM { 9namespace AM {
diff --git a/src/core/hle/service/am/am_net.cpp b/src/core/hle/service/am/am_net.cpp
index 3a597a34c..d9d9d78c8 100644
--- a/src/core/hle/service/am/am_net.cpp
+++ b/src/core/hle/service/am/am_net.cpp
@@ -2,8 +2,8 @@
2// Licensed under GPLv2 or any later version 2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include "core/hle/service/am/am.h"
6#include "core/hle/service/am/am_net.h" 5#include "core/hle/service/am/am_net.h"
6#include "core/hle/service/am/am.h"
7 7
8namespace Service { 8namespace Service {
9namespace AM { 9namespace AM {
diff --git a/src/core/hle/service/am/am_sys.cpp b/src/core/hle/service/am/am_sys.cpp
index 8bb58cab7..6f441f9e7 100644
--- a/src/core/hle/service/am/am_sys.cpp
+++ b/src/core/hle/service/am/am_sys.cpp
@@ -2,33 +2,35 @@
2// Licensed under GPLv2 or any later version 2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include "core/hle/service/am/am.h"
6#include "core/hle/service/am/am_sys.h" 5#include "core/hle/service/am/am_sys.h"
6#include "core/hle/service/am/am.h"
7 7
8namespace Service { 8namespace Service {
9namespace AM { 9namespace AM {
10 10
11const Interface::FunctionInfo FunctionTable[] = {{0x00010040, GetTitleCount, "GetTitleCount"}, 11const Interface::FunctionInfo FunctionTable[] = {
12 {0x00020082, GetTitleList, "GetTitleList"}, 12 {0x00010040, GetTitleCount, "GetTitleCount"},
13 {0x00030084, GetTitleInfo, "GetTitleInfo"}, 13 {0x00020082, GetTitleList, "GetTitleList"},
14 {0x000400C0, nullptr, "DeleteApplicationTitle"}, 14 {0x00030084, GetTitleInfo, "GetTitleInfo"},
15 {0x000500C0, nullptr, "GetTitleProductCode"}, 15 {0x000400C0, nullptr, "DeleteApplicationTitle"},
16 {0x000600C0, nullptr, "GetTitleExtDataId"}, 16 {0x000500C0, nullptr, "GetTitleProductCode"},
17 {0x00070080, DeleteTicket, "DeleteTicket"}, 17 {0x000600C0, nullptr, "GetTitleExtDataId"},
18 {0x00080000, GetTicketCount, "GetTicketCount"}, 18 {0x00070080, DeleteTicket, "DeleteTicket"},
19 {0x00090082, GetTicketList, "GetTicketList"}, 19 {0x00080000, GetTicketCount, "GetTicketCount"},
20 {0x000A0000, nullptr, "GetDeviceID"}, 20 {0x00090082, GetTicketList, "GetTicketList"},
21 {0x000D0084, nullptr, "GetPendingTitleInfo"}, 21 {0x000A0000, nullptr, "GetDeviceID"},
22 {0x000E00C0, nullptr, "DeletePendingTitle"}, 22 {0x000D0084, nullptr, "GetPendingTitleInfo"},
23 {0x00140040, nullptr, "FinalizePendingTitles"}, 23 {0x000E00C0, nullptr, "DeletePendingTitle"},
24 {0x00150040, nullptr, "DeleteAllPendingTitles"}, 24 {0x00140040, nullptr, "FinalizePendingTitles"},
25 {0x00180080, nullptr, "InitializeTitleDatabase"}, 25 {0x00150040, nullptr, "DeleteAllPendingTitles"},
26 {0x00190040, nullptr, "ReloadDBS"}, 26 {0x00180080, nullptr, "InitializeTitleDatabase"},
27 {0x001A00C0, nullptr, "GetDSiWareExportSize"}, 27 {0x00190040, nullptr, "ReloadDBS"},
28 {0x001B0144, nullptr, "ExportDSiWare"}, 28 {0x001A00C0, nullptr, "GetDSiWareExportSize"},
29 {0x001C0084, nullptr, "ImportDSiWare"}, 29 {0x001B0144, nullptr, "ExportDSiWare"},
30 {0x00230080, nullptr, "GetPendingTitleCount"}, 30 {0x001C0084, nullptr, "ImportDSiWare"},
31 {0x002400C2, nullptr, "GetPendingTitleList"}}; 31 {0x00230080, nullptr, "GetPendingTitleCount"},
32 {0x002400C2, nullptr, "GetPendingTitleList"},
33};
32 34
33AM_SYS_Interface::AM_SYS_Interface() { 35AM_SYS_Interface::AM_SYS_Interface() {
34 Register(FunctionTable); 36 Register(FunctionTable);
diff --git a/src/core/hle/service/am/am_u.cpp b/src/core/hle/service/am/am_u.cpp
index 32d47741f..c40e56205 100644
--- a/src/core/hle/service/am/am_u.cpp
+++ b/src/core/hle/service/am/am_u.cpp
@@ -2,46 +2,48 @@
2// Licensed under GPLv2 or any later version 2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include "core/hle/service/am/am.h"
6#include "core/hle/service/am/am_u.h" 5#include "core/hle/service/am/am_u.h"
6#include "core/hle/service/am/am.h"
7 7
8namespace Service { 8namespace Service {
9namespace AM { 9namespace AM {
10 10
11const Interface::FunctionInfo FunctionTable[] = {{0x00010040, GetTitleCount, "GetTitleCount"}, 11const Interface::FunctionInfo FunctionTable[] = {
12 {0x00020082, GetTitleList, "GetTitleList"}, 12 {0x00010040, GetTitleCount, "GetTitleCount"},
13 {0x00030084, GetTitleInfo, "GetTitleInfo"}, 13 {0x00020082, GetTitleList, "GetTitleList"},
14 {0x000400C0, nullptr, "DeleteApplicationTitle"}, 14 {0x00030084, GetTitleInfo, "GetTitleInfo"},
15 {0x000500C0, nullptr, "GetTitleProductCode"}, 15 {0x000400C0, nullptr, "DeleteApplicationTitle"},
16 {0x000600C0, nullptr, "GetTitleExtDataId"}, 16 {0x000500C0, nullptr, "GetTitleProductCode"},
17 {0x00070080, DeleteTicket, "DeleteTicket"}, 17 {0x000600C0, nullptr, "GetTitleExtDataId"},
18 {0x00080000, GetTicketCount, "GetTicketCount"}, 18 {0x00070080, DeleteTicket, "DeleteTicket"},
19 {0x00090082, GetTicketList, "GetTicketList"}, 19 {0x00080000, GetTicketCount, "GetTicketCount"},
20 {0x000A0000, nullptr, "GetDeviceID"}, 20 {0x00090082, GetTicketList, "GetTicketList"},
21 {0x000D0084, nullptr, "GetPendingTitleInfo"}, 21 {0x000A0000, nullptr, "GetDeviceID"},
22 {0x000E00C0, nullptr, "DeletePendingTitle"}, 22 {0x000D0084, nullptr, "GetPendingTitleInfo"},
23 {0x00140040, nullptr, "FinalizePendingTitles"}, 23 {0x000E00C0, nullptr, "DeletePendingTitle"},
24 {0x00150040, nullptr, "DeleteAllPendingTitles"}, 24 {0x00140040, nullptr, "FinalizePendingTitles"},
25 {0x00180080, nullptr, "InitializeTitleDatabase"}, 25 {0x00150040, nullptr, "DeleteAllPendingTitles"},
26 {0x00190040, nullptr, "ReloadDBS"}, 26 {0x00180080, nullptr, "InitializeTitleDatabase"},
27 {0x001A00C0, nullptr, "GetDSiWareExportSize"}, 27 {0x00190040, nullptr, "ReloadDBS"},
28 {0x001B0144, nullptr, "ExportDSiWare"}, 28 {0x001A00C0, nullptr, "GetDSiWareExportSize"},
29 {0x001C0084, nullptr, "ImportDSiWare"}, 29 {0x001B0144, nullptr, "ExportDSiWare"},
30 {0x00230080, nullptr, "TitleIDListGetTotal2"}, 30 {0x001C0084, nullptr, "ImportDSiWare"},
31 {0x002400C2, nullptr, "GetTitleIDList2"}, 31 {0x00230080, nullptr, "TitleIDListGetTotal2"},
32 {0x04010080, nullptr, "InstallFIRM"}, 32 {0x002400C2, nullptr, "GetTitleIDList2"},
33 {0x04020040, nullptr, "StartInstallCIADB0"}, 33 {0x04010080, nullptr, "InstallFIRM"},
34 {0x04030000, nullptr, "StartInstallCIADB1"}, 34 {0x04020040, nullptr, "StartInstallCIADB0"},
35 {0x04040002, nullptr, "AbortCIAInstall"}, 35 {0x04030000, nullptr, "StartInstallCIADB1"},
36 {0x04050002, nullptr, "CloseCIAFinalizeInstall"}, 36 {0x04040002, nullptr, "AbortCIAInstall"},
37 {0x04060002, nullptr, "CloseCIA"}, 37 {0x04050002, nullptr, "CloseCIAFinalizeInstall"},
38 {0x040700C2, nullptr, "FinalizeTitlesInstall"}, 38 {0x04060002, nullptr, "CloseCIA"},
39 {0x04080042, nullptr, "GetCiaFileInfo"}, 39 {0x040700C2, nullptr, "FinalizeTitlesInstall"},
40 {0x040E00C2, nullptr, "InstallTitlesFinish"}, 40 {0x04080042, nullptr, "GetCiaFileInfo"},
41 {0x040F0000, nullptr, "InstallNATIVEFIRM"}, 41 {0x040E00C2, nullptr, "InstallTitlesFinish"},
42 {0x041000C0, nullptr, "DeleteTitle"}, 42 {0x040F0000, nullptr, "InstallNATIVEFIRM"},
43 {0x04120000, nullptr, "Initialize"}, 43 {0x041000C0, nullptr, "DeleteTitle"},
44 {0x041700C0, nullptr, "MigrateAGBtoSAV"}}; 44 {0x04120000, nullptr, "Initialize"},
45 {0x041700C0, nullptr, "MigrateAGBtoSAV"},
46};
45 47
46AM_U_Interface::AM_U_Interface() { 48AM_U_Interface::AM_U_Interface() {
47 Register(FunctionTable); 49 Register(FunctionTable);
diff --git a/src/core/hle/service/apt/apt.cpp b/src/core/hle/service/apt/apt.cpp
index c798e8752..dfc1e9c08 100644
--- a/src/core/hle/service/apt/apt.cpp
+++ b/src/core/hle/service/apt/apt.cpp
@@ -90,10 +90,8 @@ void GetSharedFont(Service::Interface* self) {
90 cmd_buff[0] = IPC::MakeHeader(0x44, 2, 2); 90 cmd_buff[0] = IPC::MakeHeader(0x44, 2, 2);
91 cmd_buff[1] = RESULT_SUCCESS.raw; // No error 91 cmd_buff[1] = RESULT_SUCCESS.raw; // No error
92 // Since the SharedMemory interface doesn't provide the address at which the memory was 92 // Since the SharedMemory interface doesn't provide the address at which the memory was
93 // allocated, 93 // allocated, the real APT service calculates this address by scanning the entire address space
94 // the real APT service calculates this address by scanning the entire address space (using 94 // (using svcQueryMemory) and searches for an allocation of the same size as the Shared Font.
95 // svcQueryMemory)
96 // and searches for an allocation of the same size as the Shared Font.
97 cmd_buff[2] = target_address; 95 cmd_buff[2] = target_address;
98 cmd_buff[3] = IPC::CopyHandleDesc(); 96 cmd_buff[3] = IPC::CopyHandleDesc();
99 cmd_buff[4] = Kernel::g_handle_table.Create(shared_font_mem).MoveFrom(); 97 cmd_buff[4] = Kernel::g_handle_table.Create(shared_font_mem).MoveFrom();
diff --git a/src/core/hle/service/apt/apt.h b/src/core/hle/service/apt/apt.h
index fe8b8a7b8..7597b0d3e 100644
--- a/src/core/hle/service/apt/apt.h
+++ b/src/core/hle/service/apt/apt.h
@@ -183,12 +183,10 @@ void GetAppletInfo(Service::Interface* self);
183 183
184/** 184/**
185 * APT::IsRegistered service function. This returns whether the specified AppID is registered with 185 * APT::IsRegistered service function. This returns whether the specified AppID is registered with
186 * NS yet. 186 * NS yet. An AppID is "registered" once the process associated with the AppID uses APT:Enable. Home
187 * An AppID is "registered" once the process associated with the AppID uses APT:Enable. Home Menu 187 * Menu uses this command to determine when the launched process is running and to determine when to
188 * uses this 188 * stop using GSP, etc., while displaying the "Nintendo 3DS" loading screen.
189 * command to determine when the launched process is running and to determine when to stop using GSP 189 *
190 * etc,
191 * while displaying the "Nintendo 3DS" loading screen.
192 * Inputs: 190 * Inputs:
193 * 1 : AppID 191 * 1 : AppID
194 * Outputs: 192 * Outputs:
@@ -264,10 +262,10 @@ void GlanceParameter(Service::Interface* self);
264 * (same flag cleared by APT:ReceiveParameter). 262 * (same flag cleared by APT:ReceiveParameter).
265 * Inputs: 263 * Inputs:
266 * 1 : Flag, when non-zero NS will compare the word after this one with a field in the NS 264 * 1 : Flag, when non-zero NS will compare the word after this one with a field in the NS
267 * state. 265 * state.
268 * 2 : Unknown, this is the same as the first unknown field returned by APT:ReceiveParameter. 266 * 2 : Unknown, this is the same as the first unknown field returned by APT:ReceiveParameter.
269 * 3 : Flag, when non-zero NS will compare the word after this one with a field in the NS 267 * 3 : Flag, when non-zero NS will compare the word after this one with a field in the NS
270 * state. 268 * state.
271 * 4 : AppID 269 * 4 : AppID
272 * Outputs: 270 * Outputs:
273 * 0 : Return header 271 * 0 : Return header
diff --git a/src/core/hle/service/apt/apt_a.cpp b/src/core/hle/service/apt/apt_a.cpp
index 7d47d7675..09198d52b 100644
--- a/src/core/hle/service/apt/apt_a.cpp
+++ b/src/core/hle/service/apt/apt_a.cpp
@@ -2,8 +2,8 @@
2// Licensed under GPLv2 or any later version 2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include "core/hle/service/apt/apt.h"
6#include "core/hle/service/apt/apt_a.h" 5#include "core/hle/service/apt/apt_a.h"
6#include "core/hle/service/apt/apt.h"
7 7
8namespace Service { 8namespace Service {
9namespace APT { 9namespace APT {
@@ -36,7 +36,8 @@ const Interface::FunctionInfo FunctionTable[] = {
36 {0x00550040, SetScreenCapPostPermission, "SetScreenCapPostPermission"}, 36 {0x00550040, SetScreenCapPostPermission, "SetScreenCapPostPermission"},
37 {0x00560000, GetScreenCapPostPermission, "GetScreenCapPostPermission"}, 37 {0x00560000, GetScreenCapPostPermission, "GetScreenCapPostPermission"},
38 {0x01010000, CheckNew3DSApp, "CheckNew3DSApp"}, 38 {0x01010000, CheckNew3DSApp, "CheckNew3DSApp"},
39 {0x01020000, CheckNew3DS, "CheckNew3DS"}}; 39 {0x01020000, CheckNew3DS, "CheckNew3DS"},
40};
40 41
41APT_A_Interface::APT_A_Interface() { 42APT_A_Interface::APT_A_Interface() {
42 Register(FunctionTable); 43 Register(FunctionTable);
diff --git a/src/core/hle/service/apt/apt_s.cpp b/src/core/hle/service/apt/apt_s.cpp
index 76e71669c..f5afb78e8 100644
--- a/src/core/hle/service/apt/apt_s.cpp
+++ b/src/core/hle/service/apt/apt_s.cpp
@@ -2,8 +2,8 @@
2// Licensed under GPLv2 or any later version 2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include "core/hle/service/apt/apt.h"
6#include "core/hle/service/apt/apt_s.h" 5#include "core/hle/service/apt/apt_s.h"
6#include "core/hle/service/apt/apt.h"
7 7
8namespace Service { 8namespace Service {
9namespace APT { 9namespace APT {
@@ -96,7 +96,8 @@ const Interface::FunctionInfo FunctionTable[] = {
96 {0x00560000, GetScreenCapPostPermission, "GetScreenCapPostPermission"}, 96 {0x00560000, GetScreenCapPostPermission, "GetScreenCapPostPermission"},
97 {0x00580002, nullptr, "GetProgramID"}, 97 {0x00580002, nullptr, "GetProgramID"},
98 {0x01010000, CheckNew3DSApp, "CheckNew3DSApp"}, 98 {0x01010000, CheckNew3DSApp, "CheckNew3DSApp"},
99 {0x01020000, CheckNew3DS, "CheckNew3DS"}}; 99 {0x01020000, CheckNew3DS, "CheckNew3DS"},
100};
100 101
101APT_S_Interface::APT_S_Interface() { 102APT_S_Interface::APT_S_Interface() {
102 Register(FunctionTable); 103 Register(FunctionTable);
diff --git a/src/core/hle/service/apt/apt_u.cpp b/src/core/hle/service/apt/apt_u.cpp
index 9c6223dd7..184534b01 100644
--- a/src/core/hle/service/apt/apt_u.cpp
+++ b/src/core/hle/service/apt/apt_u.cpp
@@ -2,8 +2,8 @@
2// Licensed under GPLv2 or any later version 2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include "core/hle/service/apt/apt.h"
6#include "core/hle/service/apt/apt_u.h" 5#include "core/hle/service/apt/apt_u.h"
6#include "core/hle/service/apt/apt.h"
7 7
8namespace Service { 8namespace Service {
9namespace APT { 9namespace APT {
@@ -96,7 +96,8 @@ const Interface::FunctionInfo FunctionTable[] = {
96 {0x00560000, GetScreenCapPostPermission, "GetScreenCapPostPermission"}, 96 {0x00560000, GetScreenCapPostPermission, "GetScreenCapPostPermission"},
97 {0x00580002, nullptr, "GetProgramID"}, 97 {0x00580002, nullptr, "GetProgramID"},
98 {0x01010000, CheckNew3DSApp, "CheckNew3DSApp"}, 98 {0x01010000, CheckNew3DSApp, "CheckNew3DSApp"},
99 {0x01020000, CheckNew3DS, "CheckNew3DS"}}; 99 {0x01020000, CheckNew3DS, "CheckNew3DS"},
100};
100 101
101APT_U_Interface::APT_U_Interface() { 102APT_U_Interface::APT_U_Interface() {
102 Register(FunctionTable); 103 Register(FunctionTable);
diff --git a/src/core/hle/service/boss/boss.cpp b/src/core/hle/service/boss/boss.cpp
index 867b31fbf..757a8c2c7 100644
--- a/src/core/hle/service/boss/boss.cpp
+++ b/src/core/hle/service/boss/boss.cpp
@@ -17,8 +17,7 @@ void Init() {
17 AddService(new BOSS_U_Interface); 17 AddService(new BOSS_U_Interface);
18} 18}
19 19
20void Shutdown() { 20void Shutdown() {}
21}
22 21
23} // namespace BOSS 22} // namespace BOSS
24 23
diff --git a/src/core/hle/service/cam/cam.h b/src/core/hle/service/cam/cam.h
index a87183493..ec9b835f1 100644
--- a/src/core/hle/service/cam/cam.h
+++ b/src/core/hle/service/cam/cam.h
@@ -24,14 +24,31 @@ enum class CameraSelect : u8 {
24 In1Out1 = Out1 | In1, 24 In1Out1 = Out1 | In1,
25 Out1Out2 = Out1 | Out2, 25 Out1Out2 = Out1 | Out2,
26 In1Out2 = In1 | Out2, 26 In1Out2 = In1 | Out2,
27 All = Out1 | In1 | Out2 27 All = Out1 | In1 | Out2,
28}; 28};
29 29
30enum class Effect : u8 { None = 0, Mono = 1, Sepia = 2, Negative = 3, Negafilm = 4, Sepia01 = 5 }; 30enum class Effect : u8 {
31 None = 0,
32 Mono = 1,
33 Sepia = 2,
34 Negative = 3,
35 Negafilm = 4,
36 Sepia01 = 5,
37};
31 38
32enum class Context : u8 { None = 0, A = 1, B = 2, Both = A | B }; 39enum class Context : u8 {
40 None = 0,
41 A = 1,
42 B = 2,
43 Both = A | B,
44};
33 45
34enum class Flip : u8 { None = 0, Horizontal = 1, Vertical = 2, Reverse = 3 }; 46enum class Flip : u8 {
47 None = 0,
48 Horizontal = 1,
49 Vertical = 2,
50 Reverse = 3,
51};
35 52
36enum class Size : u8 { 53enum class Size : u8 {
37 VGA = 0, 54 VGA = 0,
@@ -42,7 +59,7 @@ enum class Size : u8 {
42 DS_LCD = 5, 59 DS_LCD = 5,
43 DS_LCDx4 = 6, 60 DS_LCDx4 = 6,
44 CTR_TOP_LCD = 7, 61 CTR_TOP_LCD = 7,
45 CTR_BOTTOM_LCD = QVGA 62 CTR_BOTTOM_LCD = QVGA,
46}; 63};
47 64
48enum class FrameRate : u8 { 65enum class FrameRate : u8 {
@@ -58,10 +75,14 @@ enum class FrameRate : u8 {
58 Rate_30_To_5 = 9, 75 Rate_30_To_5 = 9,
59 Rate_15_To_10 = 10, 76 Rate_15_To_10 = 10,
60 Rate_20_To_10 = 11, 77 Rate_20_To_10 = 11,
61 Rate_30_To_10 = 12 78 Rate_30_To_10 = 12,
62}; 79};
63 80
64enum class ShutterSoundType : u8 { Normal = 0, Movie = 1, MovieEnd = 2 }; 81enum class ShutterSoundType : u8 {
82 Normal = 0,
83 Movie = 1,
84 MovieEnd = 2,
85};
65 86
66enum class WhiteBalance : u8 { 87enum class WhiteBalance : u8 {
67 BalanceAuto = 0, 88 BalanceAuto = 0,
@@ -77,10 +98,16 @@ enum class WhiteBalance : u8 {
77 BalanceDaylight = Balance5200K, 98 BalanceDaylight = Balance5200K,
78 BalanceCloudy = Balance6000K, 99 BalanceCloudy = Balance6000K,
79 BalanceHorizon = Balance6000K, 100 BalanceHorizon = Balance6000K,
80 BalanceShade = Balance7000K 101 BalanceShade = Balance7000K,
81}; 102};
82 103
83enum class PhotoMode : u8 { Normal = 0, Portrait = 1, Landscape = 2, Nightview = 3, Letter0 = 4 }; 104enum class PhotoMode : u8 {
105 Normal = 0,
106 Portrait = 1,
107 Landscape = 2,
108 Nightview = 3,
109 Letter0 = 4,
110};
84 111
85enum class LensCorrection : u8 { 112enum class LensCorrection : u8 {
86 Off = 0, 113 Off = 0,
@@ -88,7 +115,7 @@ enum class LensCorrection : u8 {
88 On90 = 2, 115 On90 = 2,
89 Dark = Off, 116 Dark = Off,
90 Normal = On70, 117 Normal = On70,
91 Bright = On90 118 Bright = On90,
92}; 119};
93 120
94enum class Contrast : u8 { 121enum class Contrast : u8 {
@@ -105,10 +132,13 @@ enum class Contrast : u8 {
105 Pattern11 = 11, 132 Pattern11 = 11,
106 Low = Pattern05, 133 Low = Pattern05,
107 Normal = Pattern06, 134 Normal = Pattern06,
108 High = Pattern07 135 High = Pattern07,
109}; 136};
110 137
111enum class OutputFormat : u8 { YUV422 = 0, RGB565 = 1 }; 138enum class OutputFormat : u8 {
139 YUV422 = 0,
140 RGB565 = 1,
141};
112 142
113/// Stereo camera calibration data. 143/// Stereo camera calibration data.
114struct StereoCameraCalibrationData { 144struct StereoCameraCalibrationData {
diff --git a/src/core/hle/service/cam/cam_u.cpp b/src/core/hle/service/cam/cam_u.cpp
index af2123e5b..125aa7d1f 100644
--- a/src/core/hle/service/cam/cam_u.cpp
+++ b/src/core/hle/service/cam/cam_u.cpp
@@ -2,8 +2,8 @@
2// Licensed under GPLv2 or any later version 2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include "core/hle/service/cam/cam.h"
6#include "core/hle/service/cam/cam_u.h" 5#include "core/hle/service/cam/cam_u.h"
6#include "core/hle/service/cam/cam.h"
7 7
8namespace Service { 8namespace Service {
9namespace CAM { 9namespace CAM {
diff --git a/src/core/hle/service/cecd/cecd_u.cpp b/src/core/hle/service/cecd/cecd_u.cpp
index 4b747de7b..f220bba12 100644
--- a/src/core/hle/service/cecd/cecd_u.cpp
+++ b/src/core/hle/service/cecd/cecd_u.cpp
@@ -2,8 +2,8 @@
2// Licensed under GPLv2 or any later version 2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include "core/hle/service/cecd/cecd.h"
6#include "core/hle/service/cecd/cecd_u.h" 5#include "core/hle/service/cecd/cecd_u.h"
6#include "core/hle/service/cecd/cecd.h"
7 7
8namespace Service { 8namespace Service {
9namespace CECD { 9namespace CECD {
diff --git a/src/core/hle/service/cfg/cfg.cpp b/src/core/hle/service/cfg/cfg.cpp
index fe97a69d1..aff033bde 100644
--- a/src/core/hle/service/cfg/cfg.cpp
+++ b/src/core/hle/service/cfg/cfg.cpp
@@ -101,8 +101,9 @@ static const ConsoleCountryInfo COUNTRY_INFO = {{0, 0, 0}, UNITED_STATES_COUNTRY
101 * Thanks Normmatt for providing this information 101 * Thanks Normmatt for providing this information
102 */ 102 */
103static const std::array<float, 8> STEREO_CAMERA_SETTINGS = { 103static const std::array<float, 8> STEREO_CAMERA_SETTINGS = {
104 {62.0f, 289.0f, 76.80000305175781f, 46.08000183105469f, 10.0f, 5.0f, 55.58000183105469f, 104 62.0f, 289.0f, 76.80000305175781f, 46.08000183105469f,
105 21.56999969482422f}}; 105 10.0f, 5.0f, 55.58000183105469f, 21.56999969482422f,
106};
106static_assert(sizeof(STEREO_CAMERA_SETTINGS) == 0x20, 107static_assert(sizeof(STEREO_CAMERA_SETTINGS) == 0x20,
107 "STEREO_CAMERA_SETTINGS must be exactly 0x20 bytes"); 108 "STEREO_CAMERA_SETTINGS must be exactly 0x20 bytes");
108 109
@@ -110,8 +111,9 @@ static const u32 CONFIG_SAVEFILE_SIZE = 0x8000;
110static std::array<u8, CONFIG_SAVEFILE_SIZE> cfg_config_file_buffer; 111static std::array<u8, CONFIG_SAVEFILE_SIZE> cfg_config_file_buffer;
111 112
112static Service::FS::ArchiveHandle cfg_system_save_data_archive; 113static Service::FS::ArchiveHandle cfg_system_save_data_archive;
113static const std::vector<u8> cfg_system_savedata_id = {0x00, 0x00, 0x00, 0x00, 114static const std::vector<u8> cfg_system_savedata_id = {
114 0x17, 0x00, 0x01, 0x00}; 115 0x00, 0x00, 0x00, 0x00, 0x17, 0x00, 0x01, 0x00,
116};
115 117
116void GetCountryCodeString(Service::Interface* self) { 118void GetCountryCodeString(Service::Interface* self) {
117 u32* cmd_buff = Kernel::GetCommandBuffer(); 119 u32* cmd_buff = Kernel::GetCommandBuffer();
@@ -528,8 +530,7 @@ void Init() {
528 LoadConfigNANDSaveFile(); 530 LoadConfigNANDSaveFile();
529} 531}
530 532
531void Shutdown() { 533void Shutdown() {}
532}
533 534
534void SetUsername(const std::u16string& name) { 535void SetUsername(const std::u16string& name) {
535 ASSERT(name.size() <= 10); 536 ASSERT(name.size() <= 10);
diff --git a/src/core/hle/service/cfg/cfg.h b/src/core/hle/service/cfg/cfg.h
index 8cb231d72..c7c2ab41d 100644
--- a/src/core/hle/service/cfg/cfg.h
+++ b/src/core/hle/service/cfg/cfg.h
@@ -79,7 +79,7 @@ static const std::array<u16, 187> country_codes = {{
79 C("CN"), 0, 0, 0, 0, 0, 0, 0, // 160-167 79 C("CN"), 0, 0, 0, 0, 0, 0, 0, // 160-167
80 C("AE"), C("IN"), C("EG"), C("OM"), C("QA"), C("KW"), C("SA"), C("SY"), // 168-175 80 C("AE"), C("IN"), C("EG"), C("OM"), C("QA"), C("KW"), C("SA"), C("SY"), // 168-175
81 C("BH"), C("JO"), 0, 0, 0, 0, 0, 0, // 176-183 81 C("BH"), C("JO"), 0, 0, 0, 0, 0, 0, // 176-183
82 C("SM"), C("VA"), C("BM") // 184-186 82 C("SM"), C("VA"), C("BM"), // 184-186
83}}; 83}};
84 84
85/** 85/**
@@ -218,8 +218,9 @@ void FormatConfig(Service::Interface* self);
218 218
219/** 219/**
220 * Reads a block with the specified id and flag from the Config savegame buffer 220 * Reads a block with the specified id and flag from the Config savegame buffer
221 * and writes the output to output. 221 * and writes the output to output. The input size must match exactly the size of the requested
222 * The input size must match exactly the size of the requested block 222 * block.
223 *
223 * @param block_id The id of the block we want to read 224 * @param block_id The id of the block we want to read
224 * @param size The size of the block we want to read 225 * @param size The size of the block we want to read
225 * @param flag The requested block must have this flag set 226 * @param flag The requested block must have this flag set
@@ -230,8 +231,8 @@ ResultCode GetConfigInfoBlock(u32 block_id, u32 size, u32 flag, void* output);
230 231
231/** 232/**
232 * Reads data from input and writes to a block with the specified id and flag 233 * Reads data from input and writes to a block with the specified id and flag
233 * in the Config savegame buffer. 234 * in the Config savegame buffer. The input size must match exactly the size of the target block.
234 * The input size must match exactly the size of the target block 235 *
235 * @param block_id The id of the block we want to write 236 * @param block_id The id of the block we want to write
236 * @param size The size of the block we want to write 237 * @param size The size of the block we want to write
237 * @param flag The target block must have this flag set 238 * @param flag The target block must have this flag set
@@ -242,8 +243,8 @@ ResultCode SetConfigInfoBlock(u32 block_id, u32 size, u32 flag, const void* inpu
242 243
243/** 244/**
244 * Creates a block with the specified id and writes the input data to the cfg savegame buffer in 245 * Creates a block with the specified id and writes the input data to the cfg savegame buffer in
245 * memory. 246 * memory. The config savegame file in the filesystem is not updated.
246 * The config savegame file in the filesystem is not updated. 247 *
247 * @param block_id The id of the block we want to create 248 * @param block_id The id of the block we want to create
248 * @param size The size of the block we want to create 249 * @param size The size of the block we want to create
249 * @param flags The flags of the new block 250 * @param flags The flags of the new block
diff --git a/src/core/hle/service/cfg/cfg_i.cpp b/src/core/hle/service/cfg/cfg_i.cpp
index 2ff52c8b8..ed0217e53 100644
--- a/src/core/hle/service/cfg/cfg_i.cpp
+++ b/src/core/hle/service/cfg/cfg_i.cpp
@@ -2,8 +2,8 @@
2// Licensed under GPLv2 or any later version 2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include "core/hle/service/cfg/cfg.h"
6#include "core/hle/service/cfg/cfg_i.h" 5#include "core/hle/service/cfg/cfg_i.h"
6#include "core/hle/service/cfg/cfg.h"
7 7
8namespace Service { 8namespace Service {
9namespace CFG { 9namespace CFG {
diff --git a/src/core/hle/service/cfg/cfg_s.cpp b/src/core/hle/service/cfg/cfg_s.cpp
index eed26dec7..51e7b9752 100644
--- a/src/core/hle/service/cfg/cfg_s.cpp
+++ b/src/core/hle/service/cfg/cfg_s.cpp
@@ -2,8 +2,8 @@
2// Licensed under GPLv2 or any later version 2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include "core/hle/service/cfg/cfg.h"
6#include "core/hle/service/cfg/cfg_s.h" 5#include "core/hle/service/cfg/cfg_s.h"
6#include "core/hle/service/cfg/cfg.h"
7 7
8namespace Service { 8namespace Service {
9namespace CFG { 9namespace CFG {
diff --git a/src/core/hle/service/cfg/cfg_u.cpp b/src/core/hle/service/cfg/cfg_u.cpp
index f28217134..3f812291b 100644
--- a/src/core/hle/service/cfg/cfg_u.cpp
+++ b/src/core/hle/service/cfg/cfg_u.cpp
@@ -2,8 +2,8 @@
2// Licensed under GPLv2 or any later version 2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include "core/hle/service/cfg/cfg.h"
6#include "core/hle/service/cfg/cfg_u.h" 5#include "core/hle/service/cfg/cfg_u.h"
6#include "core/hle/service/cfg/cfg.h"
7 7
8namespace Service { 8namespace Service {
9namespace CFG { 9namespace CFG {
diff --git a/src/core/hle/service/dlp/dlp.cpp b/src/core/hle/service/dlp/dlp.cpp
index fd124e819..8f4b67a5d 100644
--- a/src/core/hle/service/dlp/dlp.cpp
+++ b/src/core/hle/service/dlp/dlp.cpp
@@ -17,8 +17,7 @@ void Init() {
17 AddService(new DLP_SRVR_Interface); 17 AddService(new DLP_SRVR_Interface);
18} 18}
19 19
20void Shutdown() { 20void Shutdown() {}
21}
22 21
23} // namespace DLP 22} // namespace DLP
24} // namespace Service 23} // namespace Service
diff --git a/src/core/hle/service/err_f.cpp b/src/core/hle/service/err_f.cpp
index 2cd8269de..a23f5896d 100644
--- a/src/core/hle/service/err_f.cpp
+++ b/src/core/hle/service/err_f.cpp
@@ -173,7 +173,9 @@ static void ThrowFatalError(Service::Interface* self) {
173 cmd_buff[1] = 0; // No error 173 cmd_buff[1] = 0; // No error
174} 174}
175 175
176const Interface::FunctionInfo FunctionTable[] = {{0x00010800, ThrowFatalError, "ThrowFatalError"}}; 176const Interface::FunctionInfo FunctionTable[] = {
177 {0x00010800, ThrowFatalError, "ThrowFatalError"},
178};
177 179
178//////////////////////////////////////////////////////////////////////////////////////////////////// 180////////////////////////////////////////////////////////////////////////////////////////////////////
179// Interface class 181// Interface class
diff --git a/src/core/hle/service/frd/frd.cpp b/src/core/hle/service/frd/frd.cpp
index 1e9fe178f..050665b48 100644
--- a/src/core/hle/service/frd/frd.cpp
+++ b/src/core/hle/service/frd/frd.cpp
@@ -108,8 +108,7 @@ void Init() {
108 AddService(new FRD_U_Interface); 108 AddService(new FRD_U_Interface);
109} 109}
110 110
111void Shutdown() { 111void Shutdown() {}
112}
113 112
114} // namespace FRD 113} // namespace FRD
115 114
diff --git a/src/core/hle/service/frd/frd_u.cpp b/src/core/hle/service/frd/frd_u.cpp
index bd1c9c16b..92b53f2ef 100644
--- a/src/core/hle/service/frd/frd_u.cpp
+++ b/src/core/hle/service/frd/frd_u.cpp
@@ -2,8 +2,8 @@
2// Licensed under GPLv2 or any later version 2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include "core/hle/service/frd/frd.h"
6#include "core/hle/service/frd/frd_u.h" 5#include "core/hle/service/frd/frd_u.h"
6#include "core/hle/service/frd/frd.h"
7 7
8namespace Service { 8namespace Service {
9namespace FRD { 9namespace FRD {
diff --git a/src/core/hle/service/fs/archive.cpp b/src/core/hle/service/fs/archive.cpp
index 1b851eade..77fe5ab6c 100644
--- a/src/core/hle/service/fs/archive.cpp
+++ b/src/core/hle/service/fs/archive.cpp
@@ -90,11 +90,9 @@ enum class DirectoryCommand : u32 {
90}; 90};
91 91
92File::File(std::unique_ptr<FileSys::FileBackend>&& backend, const FileSys::Path& path) 92File::File(std::unique_ptr<FileSys::FileBackend>&& backend, const FileSys::Path& path)
93 : path(path), priority(0), backend(std::move(backend)) { 93 : path(path), priority(0), backend(std::move(backend)) {}
94}
95 94
96File::~File() { 95File::~File() {}
97}
98 96
99ResultVal<bool> File::SyncRequest() { 97ResultVal<bool> File::SyncRequest() {
100 u32* cmd_buff = Kernel::GetCommandBuffer(); 98 u32* cmd_buff = Kernel::GetCommandBuffer();
@@ -205,11 +203,9 @@ ResultVal<bool> File::SyncRequest() {
205 203
206Directory::Directory(std::unique_ptr<FileSys::DirectoryBackend>&& backend, 204Directory::Directory(std::unique_ptr<FileSys::DirectoryBackend>&& backend,
207 const FileSys::Path& path) 205 const FileSys::Path& path)
208 : path(path), backend(std::move(backend)) { 206 : path(path), backend(std::move(backend)) {}
209}
210 207
211Directory::~Directory() { 208Directory::~Directory() {}
212}
213 209
214ResultVal<bool> Directory::SyncRequest() { 210ResultVal<bool> Directory::SyncRequest() {
215 u32* cmd_buff = Kernel::GetCommandBuffer(); 211 u32* cmd_buff = Kernel::GetCommandBuffer();
diff --git a/src/core/hle/service/fs/fs_user.cpp b/src/core/hle/service/fs/fs_user.cpp
index a0adad634..605832214 100644
--- a/src/core/hle/service/fs/fs_user.cpp
+++ b/src/core/hle/service/fs/fs_user.cpp
@@ -968,7 +968,8 @@ const Interface::FunctionInfo FunctionTable[] = {
968 {0x086700C4, nullptr, "ControlSecureSave"}, 968 {0x086700C4, nullptr, "ControlSecureSave"},
969 {0x08680000, nullptr, "GetMediaType"}, 969 {0x08680000, nullptr, "GetMediaType"},
970 {0x08690000, nullptr, "GetNandEraseCount"}, 970 {0x08690000, nullptr, "GetNandEraseCount"},
971 {0x086A0082, nullptr, "ReadNandReport"}}; 971 {0x086A0082, nullptr, "ReadNandReport"},
972};
972 973
973//////////////////////////////////////////////////////////////////////////////////////////////////// 974////////////////////////////////////////////////////////////////////////////////////////////////////
974// Interface class 975// Interface class
diff --git a/src/core/hle/service/gsp_gpu.cpp b/src/core/hle/service/gsp_gpu.cpp
index b273aac47..2dff1e16c 100644
--- a/src/core/hle/service/gsp_gpu.cpp
+++ b/src/core/hle/service/gsp_gpu.cpp
@@ -29,10 +29,9 @@ const static u32 REGS_BEGIN = 0x1EB00000;
29 29
30namespace GSP_GPU { 30namespace GSP_GPU {
31 31
32const ResultCode 32const ResultCode ERR_GSP_REGS_OUTOFRANGE_OR_MISALIGNED(
33 ERR_GSP_REGS_OUTOFRANGE_OR_MISALIGNED(ErrorDescription::OutofRangeOrMisalignedAddress, 33 ErrorDescription::OutofRangeOrMisalignedAddress, ErrorModule::GX, ErrorSummary::InvalidArgument,
34 ErrorModule::GX, ErrorSummary::InvalidArgument, 34 ErrorLevel::Usage); // 0xE0E02A01
35 ErrorLevel::Usage); // 0xE0E02A01
36const ResultCode ERR_GSP_REGS_MISALIGNED(ErrorDescription::MisalignedSize, ErrorModule::GX, 35const ResultCode ERR_GSP_REGS_MISALIGNED(ErrorDescription::MisalignedSize, ErrorModule::GX,
37 ErrorSummary::InvalidArgument, 36 ErrorSummary::InvalidArgument,
38 ErrorLevel::Usage); // 0xE0E02BF2 37 ErrorLevel::Usage); // 0xE0E02BF2
diff --git a/src/core/hle/service/gsp_lcd.cpp b/src/core/hle/service/gsp_lcd.cpp
index 3922cd197..b916dd759 100644
--- a/src/core/hle/service/gsp_lcd.cpp
+++ b/src/core/hle/service/gsp_lcd.cpp
@@ -9,11 +9,15 @@
9 9
10namespace GSP_LCD { 10namespace GSP_LCD {
11 11
12const Interface::FunctionInfo FunctionTable[] = {{0x000F0000, nullptr, "PowerOnAllBacklights"}, 12const Interface::FunctionInfo FunctionTable[] = {
13 {0x00100000, nullptr, "PowerOffAllBacklights"}, 13 // clang-format off
14 {0x00110040, nullptr, "PowerOnBacklight"}, 14 {0x000F0000, nullptr, "PowerOnAllBacklights"},
15 {0x00120040, nullptr, "PowerOffBacklight"}, 15 {0x00100000, nullptr, "PowerOffAllBacklights"},
16 {0x00130040, nullptr, "SetLedForceOff"}}; 16 {0x00110040, nullptr, "PowerOnBacklight"},
17 {0x00120040, nullptr, "PowerOffBacklight"},
18 {0x00130040, nullptr, "SetLedForceOff"},
19 // clang-format on
20};
17 21
18//////////////////////////////////////////////////////////////////////////////////////////////////// 22////////////////////////////////////////////////////////////////////////////////////////////////////
19// Interface class 23// Interface class
diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp
index d915a3105..5a2edd3c0 100644
--- a/src/core/hle/service/hid/hid.cpp
+++ b/src/core/hle/service/hid/hid.cpp
@@ -40,11 +40,10 @@ static int enable_accelerometer_count = 0; // positive means enabled
40static int enable_gyroscope_count = 0; // positive means enabled 40static int enable_gyroscope_count = 0; // positive means enabled
41 41
42static PadState GetCirclePadDirectionState(s16 circle_pad_x, s16 circle_pad_y) { 42static PadState GetCirclePadDirectionState(s16 circle_pad_x, s16 circle_pad_y) {
43 constexpr float TAN30 = 0.577350269, 43 // 30 degree and 60 degree are angular thresholds for directions
44 TAN60 = 44 constexpr float TAN30 = 0.577350269, TAN60 = 1 / TAN30;
45 1 / TAN30; // 30 degree and 60 degree are angular thresholds for directions 45 // a circle pad radius greater than 40 will trigger circle pad direction
46 constexpr int CIRCLE_PAD_THRESHOLD_SQUARE = 46 constexpr int CIRCLE_PAD_THRESHOLD_SQUARE = 40 * 40;
47 40 * 40; // a circle pad radius greater than 40 will trigger circle pad direction
48 PadState state; 47 PadState state;
49 state.hex = 0; 48 state.hex = 0;
50 49
diff --git a/src/core/hle/service/hid/hid_spvr.cpp b/src/core/hle/service/hid/hid_spvr.cpp
index 09007e304..00a0902c8 100644
--- a/src/core/hle/service/hid/hid_spvr.cpp
+++ b/src/core/hle/service/hid/hid_spvr.cpp
@@ -2,8 +2,8 @@
2// Licensed under GPLv2 or any later version 2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include "core/hle/service/hid/hid.h"
6#include "core/hle/service/hid/hid_spvr.h" 5#include "core/hle/service/hid/hid_spvr.h"
6#include "core/hle/service/hid/hid.h"
7 7
8namespace Service { 8namespace Service {
9namespace HID { 9namespace HID {
diff --git a/src/core/hle/service/hid/hid_user.cpp b/src/core/hle/service/hid/hid_user.cpp
index 42591543c..433e175bb 100644
--- a/src/core/hle/service/hid/hid_user.cpp
+++ b/src/core/hle/service/hid/hid_user.cpp
@@ -2,8 +2,8 @@
2// Licensed under GPLv2 or any later version 2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include "core/hle/service/hid/hid.h"
6#include "core/hle/service/hid/hid_user.h" 5#include "core/hle/service/hid/hid_user.h"
6#include "core/hle/service/hid/hid.h"
7 7
8namespace Service { 8namespace Service {
9namespace HID { 9namespace HID {
diff --git a/src/core/hle/service/ir/ir_rst.cpp b/src/core/hle/service/ir/ir_rst.cpp
index 1f10ebd3d..5e7a011ff 100644
--- a/src/core/hle/service/ir/ir_rst.cpp
+++ b/src/core/hle/service/ir/ir_rst.cpp
@@ -2,8 +2,8 @@
2// Licensed under GPLv2 or any later version 2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include "core/hle/service/ir/ir.h"
6#include "core/hle/service/ir/ir_rst.h" 5#include "core/hle/service/ir/ir_rst.h"
6#include "core/hle/service/ir/ir.h"
7 7
8namespace Service { 8namespace Service {
9namespace IR { 9namespace IR {
diff --git a/src/core/hle/service/ir/ir_u.cpp b/src/core/hle/service/ir/ir_u.cpp
index be4049da9..429615f31 100644
--- a/src/core/hle/service/ir/ir_u.cpp
+++ b/src/core/hle/service/ir/ir_u.cpp
@@ -8,15 +8,26 @@ namespace Service {
8namespace IR { 8namespace IR {
9 9
10const Interface::FunctionInfo FunctionTable[] = { 10const Interface::FunctionInfo FunctionTable[] = {
11 {0x00010000, nullptr, "Initialize"}, {0x00020000, nullptr, "Shutdown"}, 11 // clang-format off
12 {0x00030042, nullptr, "StartSendTransfer"}, {0x00040000, nullptr, "WaitSendTransfer"}, 12 {0x00010000, nullptr, "Initialize"},
13 {0x000500C2, nullptr, "StartRecvTransfer"}, {0x00060000, nullptr, "WaitRecvTransfer"}, 13 {0x00020000, nullptr, "Shutdown"},
14 {0x00070080, nullptr, "GetRecvTransferCount"}, {0x00080000, nullptr, "GetSendState"}, 14 {0x00030042, nullptr, "StartSendTransfer"},
15 {0x00090040, nullptr, "SetBitRate"}, {0x000A0000, nullptr, "GetBitRate"}, 15 {0x00040000, nullptr, "WaitSendTransfer"},
16 {0x000B0040, nullptr, "SetIRLEDState"}, {0x000C0000, nullptr, "GetIRLEDRecvState"}, 16 {0x000500C2, nullptr, "StartRecvTransfer"},
17 {0x000D0000, nullptr, "GetSendFinishedEvent"}, {0x000E0000, nullptr, "GetRecvFinishedEvent"}, 17 {0x00060000, nullptr, "WaitRecvTransfer"},
18 {0x000F0000, nullptr, "GetTransferState"}, {0x00100000, nullptr, "GetErrorStatus"}, 18 {0x00070080, nullptr, "GetRecvTransferCount"},
19 {0x00110040, nullptr, "SetSleepModeActive"}, {0x00120040, nullptr, "SetSleepModeState"}, 19 {0x00080000, nullptr, "GetSendState"},
20 {0x00090040, nullptr, "SetBitRate"},
21 {0x000A0000, nullptr, "GetBitRate"},
22 {0x000B0040, nullptr, "SetIRLEDState"},
23 {0x000C0000, nullptr, "GetIRLEDRecvState"},
24 {0x000D0000, nullptr, "GetSendFinishedEvent"},
25 {0x000E0000, nullptr, "GetRecvFinishedEvent"},
26 {0x000F0000, nullptr, "GetTransferState"},
27 {0x00100000, nullptr, "GetErrorStatus"},
28 {0x00110040, nullptr, "SetSleepModeActive"},
29 {0x00120040, nullptr, "SetSleepModeState"},
30 // clang-format off
20}; 31};
21 32
22IR_U_Interface::IR_U_Interface() { 33IR_U_Interface::IR_U_Interface() {
diff --git a/src/core/hle/service/ir/ir_user.cpp b/src/core/hle/service/ir/ir_user.cpp
index 6cff1d544..cca71a0dd 100644
--- a/src/core/hle/service/ir/ir_user.cpp
+++ b/src/core/hle/service/ir/ir_user.cpp
@@ -2,8 +2,8 @@
2// Licensed under GPLv2 or any later version 2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include "core/hle/service/ir/ir.h"
6#include "core/hle/service/ir/ir_user.h" 5#include "core/hle/service/ir/ir_user.h"
6#include "core/hle/service/ir/ir.h"
7 7
8namespace Service { 8namespace Service {
9namespace IR { 9namespace IR {
diff --git a/src/core/hle/service/ldr_ro/cro_helper.cpp b/src/core/hle/service/ldr_ro/cro_helper.cpp
index 5757a4e64..b5da9a960 100644
--- a/src/core/hle/service/ldr_ro/cro_helper.cpp
+++ b/src/core/hle/service/ldr_ro/cro_helper.cpp
@@ -22,21 +22,23 @@ static ResultCode CROFormatError(u32 description) {
22 ErrorSummary::WrongArgument, ErrorLevel::Permanent); 22 ErrorSummary::WrongArgument, ErrorLevel::Permanent);
23} 23}
24 24
25const std::array<int, 17> CROHelper::ENTRY_SIZE{ 25const std::array<int, 17> CROHelper::ENTRY_SIZE{{
26 {1, // code 26 1, // code
27 1, // data 27 1, // data
28 1, // module name 28 1, // module name
29 sizeof(SegmentEntry), sizeof(ExportNamedSymbolEntry), sizeof(ExportIndexedSymbolEntry), 29 sizeof(SegmentEntry), sizeof(ExportNamedSymbolEntry), sizeof(ExportIndexedSymbolEntry),
30 1, // export strings 30 1, // export strings
31 sizeof(ExportTreeEntry), sizeof(ImportModuleEntry), sizeof(ExternalRelocationEntry), 31 sizeof(ExportTreeEntry), sizeof(ImportModuleEntry), sizeof(ExternalRelocationEntry),
32 sizeof(ImportNamedSymbolEntry), sizeof(ImportIndexedSymbolEntry), 32 sizeof(ImportNamedSymbolEntry), sizeof(ImportIndexedSymbolEntry),
33 sizeof(ImportAnonymousSymbolEntry), 33 sizeof(ImportAnonymousSymbolEntry),
34 1, // import strings 34 1, // import strings
35 sizeof(StaticAnonymousSymbolEntry), sizeof(InternalRelocationEntry), 35 sizeof(StaticAnonymousSymbolEntry), sizeof(InternalRelocationEntry),
36 sizeof(StaticRelocationEntry)}}; 36 sizeof(StaticRelocationEntry),
37 37}};
38const std::array<CROHelper::HeaderField, 4> CROHelper::FIX_BARRIERS{ 38
39 {Fix0Barrier, Fix1Barrier, Fix2Barrier, Fix3Barrier}}; 39const std::array<CROHelper::HeaderField, 4> CROHelper::FIX_BARRIERS{{
40 Fix0Barrier, Fix1Barrier, Fix2Barrier, Fix3Barrier,
41}};
40 42
41VAddr CROHelper::SegmentTagToAddress(SegmentTag segment_tag) const { 43VAddr CROHelper::SegmentTagToAddress(SegmentTag segment_tag) const {
42 u32 segment_num = GetField(SegmentNum); 44 u32 segment_num = GetField(SegmentNum);
@@ -204,13 +206,14 @@ ResultCode CROHelper::RebaseHeader(u32 cro_size) {
204 return error; 206 return error;
205 207
206 // verifies that all offsets are in the correct order 208 // verifies that all offsets are in the correct order
207 constexpr std::array<HeaderField, 18> OFFSET_ORDER = { 209 constexpr std::array<HeaderField, 18> OFFSET_ORDER = {{
208 {CodeOffset, ModuleNameOffset, SegmentTableOffset, ExportNamedSymbolTableOffset, 210 CodeOffset, ModuleNameOffset, SegmentTableOffset, ExportNamedSymbolTableOffset,
209 ExportTreeTableOffset, ExportIndexedSymbolTableOffset, ExportStringsOffset, 211 ExportTreeTableOffset, ExportIndexedSymbolTableOffset, ExportStringsOffset,
210 ImportModuleTableOffset, ExternalRelocationTableOffset, ImportNamedSymbolTableOffset, 212 ImportModuleTableOffset, ExternalRelocationTableOffset, ImportNamedSymbolTableOffset,
211 ImportIndexedSymbolTableOffset, ImportAnonymousSymbolTableOffset, ImportStringsOffset, 213 ImportIndexedSymbolTableOffset, ImportAnonymousSymbolTableOffset, ImportStringsOffset,
212 StaticAnonymousSymbolTableOffset, InternalRelocationTableOffset, 214 StaticAnonymousSymbolTableOffset, InternalRelocationTableOffset,
213 StaticRelocationTableOffset, DataOffset, FileSize}}; 215 StaticRelocationTableOffset, DataOffset, FileSize,
216 }};
214 217
215 u32 prev_offset = GetField(OFFSET_ORDER[0]); 218 u32 prev_offset = GetField(OFFSET_ORDER[0]);
216 u32 cur_offset; 219 u32 cur_offset;
diff --git a/src/core/hle/service/ldr_ro/cro_helper.h b/src/core/hle/service/ldr_ro/cro_helper.h
index e4457d4be..e1b8221bd 100644
--- a/src/core/hle/service/ldr_ro/cro_helper.h
+++ b/src/core/hle/service/ldr_ro/cro_helper.h
@@ -40,8 +40,7 @@ static constexpr u32 CRO_HASH_SIZE = 0x80;
40/// Represents a loaded module (CRO) with interfaces manipulating it. 40/// Represents a loaded module (CRO) with interfaces manipulating it.
41class CROHelper final { 41class CROHelper final {
42public: 42public:
43 explicit CROHelper(VAddr cro_address) : module_address(cro_address) { 43 explicit CROHelper(VAddr cro_address) : module_address(cro_address) {}
44 }
45 44
46 std::string ModuleName() const { 45 std::string ModuleName() const {
47 return Memory::ReadCString(GetField(ModuleNameOffset), GetField(ModuleNameSize)); 46 return Memory::ReadCString(GetField(ModuleNameOffset), GetField(ModuleNameSize));
@@ -152,8 +151,7 @@ private:
152 151
153 /** 152 /**
154 * Each item in this enum represents a u32 field in the header begin from address+0x80, 153 * Each item in this enum represents a u32 field in the header begin from address+0x80,
155 * successively. 154 * successively. We don't directly use a struct here, to avoid GetPointer, reinterpret_cast, or
156 * We don't directly use a struct here, to avoid GetPointer, reinterpret_cast, or
157 * Read/WriteBlock repeatedly. 155 * Read/WriteBlock repeatedly.
158 */ 156 */
159 enum HeaderField { 157 enum HeaderField {
@@ -234,8 +232,7 @@ private:
234 BitField<4, 28, u32_le> offset_into_segment; 232 BitField<4, 28, u32_le> offset_into_segment;
235 233
236 SegmentTag() = default; 234 SegmentTag() = default;
237 explicit SegmentTag(u32 raw_) : raw(raw_) { 235 explicit SegmentTag(u32 raw_) : raw(raw_) {}
238 }
239 }; 236 };
240 237
241 /// Information of a segment in this module. 238 /// Information of a segment in this module.
diff --git a/src/core/hle/service/ldr_ro/ldr_ro.cpp b/src/core/hle/service/ldr_ro/ldr_ro.cpp
index ae5d3921f..a8fc2c015 100644
--- a/src/core/hle/service/ldr_ro/ldr_ro.cpp
+++ b/src/core/hle/service/ldr_ro/ldr_ro.cpp
@@ -750,11 +750,17 @@ static void Shutdown(Service::Interface* self) {
750} 750}
751 751
752const Interface::FunctionInfo FunctionTable[] = { 752const Interface::FunctionInfo FunctionTable[] = {
753 {0x000100C2, Initialize, "Initialize"}, {0x00020082, LoadCRR, "LoadCRR"}, 753 // clang-format off
754 {0x00030042, UnloadCRR, "UnloadCRR"}, {0x000402C2, LoadCRO<false>, "LoadCRO"}, 754 {0x000100C2, Initialize, "Initialize"},
755 {0x000500C2, UnloadCRO, "UnloadCRO"}, {0x00060042, LinkCRO, "LinkCRO"}, 755 {0x00020082, LoadCRR, "LoadCRR"},
756 {0x00070042, UnlinkCRO, "UnlinkCRO"}, {0x00080042, Shutdown, "Shutdown"}, 756 {0x00030042, UnloadCRR, "UnloadCRR"},
757 {0x000402C2, LoadCRO<false>, "LoadCRO"},
758 {0x000500C2, UnloadCRO, "UnloadCRO"},
759 {0x00060042, LinkCRO, "LinkCRO"},
760 {0x00070042, UnlinkCRO, "UnlinkCRO"},
761 {0x00080042, Shutdown, "Shutdown"},
757 {0x000902C2, LoadCRO<true>, "LoadCRO_New"}, 762 {0x000902C2, LoadCRO<true>, "LoadCRO_New"},
763 // clang-format on
758}; 764};
759 765
760//////////////////////////////////////////////////////////////////////////////////////////////////// 766////////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/core/hle/service/ndm/ndm.cpp b/src/core/hle/service/ndm/ndm.cpp
index 9f1536aef..fcfa4b336 100644
--- a/src/core/hle/service/ndm/ndm.cpp
+++ b/src/core/hle/service/ndm/ndm.cpp
@@ -11,12 +11,16 @@
11namespace Service { 11namespace Service {
12namespace NDM { 12namespace NDM {
13 13
14enum : u32 { DEFAULT_RETRY_INTERVAL = 10, DEFAULT_SCAN_INTERVAL = 30 }; 14enum : u32 {
15 DEFAULT_RETRY_INTERVAL = 10,
16 DEFAULT_SCAN_INTERVAL = 30,
17};
15 18
16static DaemonMask daemon_bit_mask = DaemonMask::Default; 19static DaemonMask daemon_bit_mask = DaemonMask::Default;
17static DaemonMask default_daemon_bit_mask = DaemonMask::Default; 20static DaemonMask default_daemon_bit_mask = DaemonMask::Default;
18static std::array<DaemonStatus, 4> daemon_status = {DaemonStatus::Idle, DaemonStatus::Idle, 21static std::array<DaemonStatus, 4> daemon_status = {
19 DaemonStatus::Idle, DaemonStatus::Idle}; 22 DaemonStatus::Idle, DaemonStatus::Idle, DaemonStatus::Idle, DaemonStatus::Idle,
23};
20static ExclusiveState exclusive_state = ExclusiveState::None; 24static ExclusiveState exclusive_state = ExclusiveState::None;
21static u32 scan_interval = DEFAULT_SCAN_INTERVAL; 25static u32 scan_interval = DEFAULT_SCAN_INTERVAL;
22static u32 retry_interval = DEFAULT_RETRY_INTERVAL; 26static u32 retry_interval = DEFAULT_RETRY_INTERVAL;
@@ -227,8 +231,7 @@ void Init() {
227 AddService(new NDM_U_Interface); 231 AddService(new NDM_U_Interface);
228} 232}
229 233
230void Shutdown() { 234void Shutdown() {}
231}
232 235
233} // namespace NDM 236} // namespace NDM
234} // namespace Service 237} // namespace Service
diff --git a/src/core/hle/service/ndm/ndm.h b/src/core/hle/service/ndm/ndm.h
index fb574541d..979e7fcf1 100644
--- a/src/core/hle/service/ndm/ndm.h
+++ b/src/core/hle/service/ndm/ndm.h
@@ -12,7 +12,12 @@ class Interface;
12 12
13namespace NDM { 13namespace NDM {
14 14
15enum class Daemon : u32 { Cec = 0, Boss = 1, Nim = 2, Friend = 3 }; 15enum class Daemon : u32 {
16 Cec = 0,
17 Boss = 1,
18 Nim = 2,
19 Friend = 3,
20};
16 21
17enum class DaemonMask : u32 { 22enum class DaemonMask : u32 {
18 None = 0, 23 None = 0,
@@ -21,7 +26,7 @@ enum class DaemonMask : u32 {
21 Nim = (1 << static_cast<u32>(Daemon::Nim)), 26 Nim = (1 << static_cast<u32>(Daemon::Nim)),
22 Friend = (1 << static_cast<u32>(Daemon::Friend)), 27 Friend = (1 << static_cast<u32>(Daemon::Friend)),
23 Default = Cec | Friend, 28 Default = Cec | Friend,
24 All = Cec | Boss | Nim | Friend 29 All = Cec | Boss | Nim | Friend,
25}; 30};
26 31
27enum class DaemonStatus : u32 { Busy = 0, Idle = 1, Suspending = 2, Suspended = 3 }; 32enum class DaemonStatus : u32 { Busy = 0, Idle = 1, Suspending = 2, Suspended = 3 };
diff --git a/src/core/hle/service/ndm/ndm_u.cpp b/src/core/hle/service/ndm/ndm_u.cpp
index f5c7a341a..4fc93850d 100644
--- a/src/core/hle/service/ndm/ndm_u.cpp
+++ b/src/core/hle/service/ndm/ndm_u.cpp
@@ -2,8 +2,8 @@
2// Licensed under GPLv2 or any later version 2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include "core/hle/service/ndm/ndm.h"
6#include "core/hle/service/ndm/ndm_u.h" 5#include "core/hle/service/ndm/ndm_u.h"
6#include "core/hle/service/ndm/ndm.h"
7 7
8namespace Service { 8namespace Service {
9namespace NDM { 9namespace NDM {
diff --git a/src/core/hle/service/news/news.cpp b/src/core/hle/service/news/news.cpp
index 983e0777c..e09ea5681 100644
--- a/src/core/hle/service/news/news.cpp
+++ b/src/core/hle/service/news/news.cpp
@@ -19,8 +19,7 @@ void Init() {
19 AddService(new NEWS_U_Interface); 19 AddService(new NEWS_U_Interface);
20} 20}
21 21
22void Shutdown() { 22void Shutdown() {}
23}
24 23
25} // namespace NEWS 24} // namespace NEWS
26 25
diff --git a/src/core/hle/service/news/news_s.cpp b/src/core/hle/service/news/news_s.cpp
index dda3d0f6a..0e4b650f3 100644
--- a/src/core/hle/service/news/news_s.cpp
+++ b/src/core/hle/service/news/news_s.cpp
@@ -2,8 +2,8 @@
2// Licensed under GPLv2 or any later version 2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include "core/hle/service/news/news.h"
6#include "core/hle/service/news/news_s.h" 5#include "core/hle/service/news/news_s.h"
6#include "core/hle/service/news/news.h"
7 7
8namespace Service { 8namespace Service {
9namespace NEWS { 9namespace NEWS {
diff --git a/src/core/hle/service/nim/nim.cpp b/src/core/hle/service/nim/nim.cpp
index f3c01d6e6..a7b76ed67 100644
--- a/src/core/hle/service/nim/nim.cpp
+++ b/src/core/hle/service/nim/nim.cpp
@@ -31,8 +31,7 @@ void Init() {
31 AddService(new NIM_U_Interface); 31 AddService(new NIM_U_Interface);
32} 32}
33 33
34void Shutdown() { 34void Shutdown() {}
35}
36 35
37} // namespace NIM 36} // namespace NIM
38 37
diff --git a/src/core/hle/service/nim/nim_u.cpp b/src/core/hle/service/nim/nim_u.cpp
index 7e07d02e8..a4fd9781f 100644
--- a/src/core/hle/service/nim/nim_u.cpp
+++ b/src/core/hle/service/nim/nim_u.cpp
@@ -2,8 +2,8 @@
2// Licensed under GPLv2 or any later version 2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include "core/hle/service/nim/nim.h"
6#include "core/hle/service/nim/nim_u.h" 5#include "core/hle/service/nim/nim_u.h"
6#include "core/hle/service/nim/nim.h"
7 7
8namespace Service { 8namespace Service {
9namespace NIM { 9namespace NIM {
diff --git a/src/core/hle/service/ptm/ptm.cpp b/src/core/hle/service/ptm/ptm.cpp
index 80fa09f5f..29b9071c8 100644
--- a/src/core/hle/service/ptm/ptm.cpp
+++ b/src/core/hle/service/ptm/ptm.cpp
@@ -144,8 +144,7 @@ void Init() {
144 } 144 }
145} 145}
146 146
147void Shutdown() { 147void Shutdown() {}
148}
149 148
150} // namespace PTM 149} // namespace PTM
151} // namespace Service 150} // namespace Service
diff --git a/src/core/hle/service/ptm/ptm_sysm.cpp b/src/core/hle/service/ptm/ptm_sysm.cpp
index 693158dbf..590660f60 100644
--- a/src/core/hle/service/ptm/ptm_sysm.cpp
+++ b/src/core/hle/service/ptm/ptm_sysm.cpp
@@ -2,8 +2,8 @@
2// Licensed under GPLv2 or any later version 2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include "core/hle/service/ptm/ptm.h"
6#include "core/hle/service/ptm/ptm_sysm.h" 5#include "core/hle/service/ptm/ptm_sysm.h"
6#include "core/hle/service/ptm/ptm.h"
7 7
8namespace Service { 8namespace Service {
9namespace PTM { 9namespace PTM {
diff --git a/src/core/hle/service/ptm/ptm_u.cpp b/src/core/hle/service/ptm/ptm_u.cpp
index 65e868393..155e10df1 100644
--- a/src/core/hle/service/ptm/ptm_u.cpp
+++ b/src/core/hle/service/ptm/ptm_u.cpp
@@ -2,8 +2,8 @@
2// Licensed under GPLv2 or any later version 2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include "core/hle/service/ptm/ptm.h"
6#include "core/hle/service/ptm/ptm_u.h" 5#include "core/hle/service/ptm/ptm_u.h"
6#include "core/hle/service/ptm/ptm.h"
7 7
8namespace Service { 8namespace Service {
9namespace PTM { 9namespace PTM {
diff --git a/src/core/hle/service/soc_u.cpp b/src/core/hle/service/soc_u.cpp
index 695b286c0..302ab55b7 100644
--- a/src/core/hle/service/soc_u.cpp
+++ b/src/core/hle/service/soc_u.cpp
@@ -63,82 +63,84 @@ static const s32 SOCKET_ERROR_VALUE = -1;
63namespace SOC_U { 63namespace SOC_U {
64 64
65/// Holds the translation from system network errors to 3DS network errors 65/// Holds the translation from system network errors to 3DS network errors
66static const std::unordered_map<int, int> error_map = {{{E2BIG, 1}, 66static const std::unordered_map<int, int> error_map = {{
67 {ERRNO(EACCES), 2}, 67 {E2BIG, 1},
68 {ERRNO(EADDRINUSE), 3}, 68 {ERRNO(EACCES), 2},
69 {ERRNO(EADDRNOTAVAIL), 4}, 69 {ERRNO(EADDRINUSE), 3},
70 {ERRNO(EAFNOSUPPORT), 5}, 70 {ERRNO(EADDRNOTAVAIL), 4},
71 {ERRNO(EAGAIN), 6}, 71 {ERRNO(EAFNOSUPPORT), 5},
72 {ERRNO(EALREADY), 7}, 72 {ERRNO(EAGAIN), 6},
73 {ERRNO(EBADF), 8}, 73 {ERRNO(EALREADY), 7},
74 {EBADMSG, 9}, 74 {ERRNO(EBADF), 8},
75 {EBUSY, 10}, 75 {EBADMSG, 9},
76 {ECANCELED, 11}, 76 {EBUSY, 10},
77 {ECHILD, 12}, 77 {ECANCELED, 11},
78 {ERRNO(ECONNABORTED), 13}, 78 {ECHILD, 12},
79 {ERRNO(ECONNREFUSED), 14}, 79 {ERRNO(ECONNABORTED), 13},
80 {ERRNO(ECONNRESET), 15}, 80 {ERRNO(ECONNREFUSED), 14},
81 {EDEADLK, 16}, 81 {ERRNO(ECONNRESET), 15},
82 {ERRNO(EDESTADDRREQ), 17}, 82 {EDEADLK, 16},
83 {EDOM, 18}, 83 {ERRNO(EDESTADDRREQ), 17},
84 {ERRNO(EDQUOT), 19}, 84 {EDOM, 18},
85 {EEXIST, 20}, 85 {ERRNO(EDQUOT), 19},
86 {ERRNO(EFAULT), 21}, 86 {EEXIST, 20},
87 {EFBIG, 22}, 87 {ERRNO(EFAULT), 21},
88 {ERRNO(EHOSTUNREACH), 23}, 88 {EFBIG, 22},
89 {EIDRM, 24}, 89 {ERRNO(EHOSTUNREACH), 23},
90 {EILSEQ, 25}, 90 {EIDRM, 24},
91 {ERRNO(EINPROGRESS), 26}, 91 {EILSEQ, 25},
92 {ERRNO(EINTR), 27}, 92 {ERRNO(EINPROGRESS), 26},
93 {ERRNO(EINVAL), 28}, 93 {ERRNO(EINTR), 27},
94 {EIO, 29}, 94 {ERRNO(EINVAL), 28},
95 {ERRNO(EISCONN), 30}, 95 {EIO, 29},
96 {EISDIR, 31}, 96 {ERRNO(EISCONN), 30},
97 {ERRNO(ELOOP), 32}, 97 {EISDIR, 31},
98 {ERRNO(EMFILE), 33}, 98 {ERRNO(ELOOP), 32},
99 {EMLINK, 34}, 99 {ERRNO(EMFILE), 33},
100 {ERRNO(EMSGSIZE), 35}, 100 {EMLINK, 34},
101 {ERRNO(EMULTIHOP), 36}, 101 {ERRNO(EMSGSIZE), 35},
102 {ERRNO(ENAMETOOLONG), 37}, 102 {ERRNO(EMULTIHOP), 36},
103 {ERRNO(ENETDOWN), 38}, 103 {ERRNO(ENAMETOOLONG), 37},
104 {ERRNO(ENETRESET), 39}, 104 {ERRNO(ENETDOWN), 38},
105 {ERRNO(ENETUNREACH), 40}, 105 {ERRNO(ENETRESET), 39},
106 {ENFILE, 41}, 106 {ERRNO(ENETUNREACH), 40},
107 {ERRNO(ENOBUFS), 42}, 107 {ENFILE, 41},
108 {ENODATA, 43}, 108 {ERRNO(ENOBUFS), 42},
109 {ENODEV, 44}, 109 {ENODATA, 43},
110 {ENOENT, 45}, 110 {ENODEV, 44},
111 {ENOEXEC, 46}, 111 {ENOENT, 45},
112 {ENOLCK, 47}, 112 {ENOEXEC, 46},
113 {ENOLINK, 48}, 113 {ENOLCK, 47},
114 {ENOMEM, 49}, 114 {ENOLINK, 48},
115 {ENOMSG, 50}, 115 {ENOMEM, 49},
116 {ERRNO(ENOPROTOOPT), 51}, 116 {ENOMSG, 50},
117 {ENOSPC, 52}, 117 {ERRNO(ENOPROTOOPT), 51},
118 {ENOSR, 53}, 118 {ENOSPC, 52},
119 {ENOSTR, 54}, 119 {ENOSR, 53},
120 {ENOSYS, 55}, 120 {ENOSTR, 54},
121 {ERRNO(ENOTCONN), 56}, 121 {ENOSYS, 55},
122 {ENOTDIR, 57}, 122 {ERRNO(ENOTCONN), 56},
123 {ERRNO(ENOTEMPTY), 58}, 123 {ENOTDIR, 57},
124 {ERRNO(ENOTSOCK), 59}, 124 {ERRNO(ENOTEMPTY), 58},
125 {ENOTSUP, 60}, 125 {ERRNO(ENOTSOCK), 59},
126 {ENOTTY, 61}, 126 {ENOTSUP, 60},
127 {ENXIO, 62}, 127 {ENOTTY, 61},
128 {ERRNO(EOPNOTSUPP), 63}, 128 {ENXIO, 62},
129 {EOVERFLOW, 64}, 129 {ERRNO(EOPNOTSUPP), 63},
130 {EPERM, 65}, 130 {EOVERFLOW, 64},
131 {EPIPE, 66}, 131 {EPERM, 65},
132 {EPROTO, 67}, 132 {EPIPE, 66},
133 {ERRNO(EPROTONOSUPPORT), 68}, 133 {EPROTO, 67},
134 {ERRNO(EPROTOTYPE), 69}, 134 {ERRNO(EPROTONOSUPPORT), 68},
135 {ERANGE, 70}, 135 {ERRNO(EPROTOTYPE), 69},
136 {EROFS, 71}, 136 {ERANGE, 70},
137 {ESPIPE, 72}, 137 {EROFS, 71},
138 {ESRCH, 73}, 138 {ESPIPE, 72},
139 {ERRNO(ESTALE), 74}, 139 {ESRCH, 73},
140 {ETIME, 75}, 140 {ERRNO(ESTALE), 74},
141 {ERRNO(ETIMEDOUT), 76}}}; 141 {ETIME, 75},
142 {ERRNO(ETIMEDOUT), 76},
143}};
142 144
143/// Converts a network error from platform-specific to 3ds-specific 145/// Converts a network error from platform-specific to 3ds-specific
144static int TranslateError(int error) { 146static int TranslateError(int error) {
diff --git a/src/core/hle/service/ssl_c.cpp b/src/core/hle/service/ssl_c.cpp
index 47c4a8cb0..78ab922ca 100644
--- a/src/core/hle/service/ssl_c.cpp
+++ b/src/core/hle/service/ssl_c.cpp
@@ -79,7 +79,8 @@ const Interface::FunctionInfo FunctionTable[] = {
79 {0x00190080, nullptr, "ContextSetClientCert"}, 79 {0x00190080, nullptr, "ContextSetClientCert"},
80 {0x001B0080, nullptr, "ContextClearOpt"}, 80 {0x001B0080, nullptr, "ContextClearOpt"},
81 {0x001E0040, nullptr, "DestroyContext"}, 81 {0x001E0040, nullptr, "DestroyContext"},
82 {0x001F0082, nullptr, "ContextInitSharedmem"}}; 82 {0x001F0082, nullptr, "ContextInitSharedmem"},
83};
83 84
84//////////////////////////////////////////////////////////////////////////////////////////////////// 85////////////////////////////////////////////////////////////////////////////////////////////////////
85// Interface class 86// Interface class
diff --git a/src/core/hle/service/y2r_u.cpp b/src/core/hle/service/y2r_u.cpp
index 278548e0e..d3c6d073e 100644
--- a/src/core/hle/service/y2r_u.cpp
+++ b/src/core/hle/service/y2r_u.cpp
@@ -73,8 +73,8 @@ ResultCode ConversionConfiguration::SetInputLines(u16 lines) {
73 return RESULT_SUCCESS; 73 return RESULT_SUCCESS;
74} 74}
75 75
76ResultCode 76ResultCode ConversionConfiguration::SetStandardCoefficient(
77ConversionConfiguration::SetStandardCoefficient(StandardCoefficient standard_coefficient) { 77 StandardCoefficient standard_coefficient) {
78 size_t index = static_cast<size_t>(standard_coefficient); 78 size_t index = static_cast<size_t>(standard_coefficient);
79 if (index >= ARRAY_SIZE(standard_coefficients)) { 79 if (index >= ARRAY_SIZE(standard_coefficients)) {
80 return ResultCode(ErrorDescription::InvalidEnumValue, ErrorModule::CAM, 80 return ResultCode(ErrorDescription::InvalidEnumValue, ErrorModule::CAM,
diff --git a/src/core/hw/hw.cpp b/src/core/hw/hw.cpp
index db224c9aa..71f44cbc4 100644
--- a/src/core/hw/hw.cpp
+++ b/src/core/hw/hw.cpp
@@ -82,8 +82,7 @@ template void Write<u16>(u32 addr, const u16 data);
82template void Write<u8>(u32 addr, const u8 data); 82template void Write<u8>(u32 addr, const u8 data);
83 83
84/// Update hardware 84/// Update hardware
85void Update() { 85void Update() {}
86}
87 86
88/// Initialize hardware 87/// Initialize hardware
89void Init() { 88void Init() {
diff --git a/src/core/hw/y2r.cpp b/src/core/hw/y2r.cpp
index 5a68d7e65..838b14163 100644
--- a/src/core/hw/y2r.cpp
+++ b/src/core/hw/y2r.cpp
@@ -61,7 +61,7 @@ static void ConvertYUVToRGB(InputFormat input_format, const u8* input_Y, const u
61 s32 cY = c[0] * Y; 61 s32 cY = c[0] * Y;
62 62
63 s32 r = cY + c[1] * V; 63 s32 r = cY + c[1] * V;
64 s32 g = cY - c[3] * U - c[2] * V; 64 s32 g = cY - c[2] * V - c[3] * U;
65 s32 b = cY + c[4] * U; 65 s32 b = cY + c[4] * U;
66 66
67 const s32 rounding_offset = 0x18; 67 const s32 rounding_offset = 0x18;
@@ -144,16 +144,30 @@ static void SendData(const u32* input, ConversionBuffer& buf, int amount_of_data
144 } 144 }
145} 145}
146 146
147static const u8 linear_lut[64] = { 147static const u8 linear_lut[TILE_SIZE] = {
148 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 148 // clang-format off
149 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 149 0, 1, 2, 3, 4, 5, 6, 7,
150 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 150 8, 9, 10, 11, 12, 13, 14, 15,
151 16, 17, 18, 19, 20, 21, 22, 23,
152 24, 25, 26, 27, 28, 29, 30, 31,
153 32, 33, 34, 35, 36, 37, 38, 39,
154 40, 41, 42, 43, 44, 45, 46, 47,
155 48, 49, 50, 51, 52, 53, 54, 55,
156 56, 57, 58, 59, 60, 61, 62, 63,
157 // clang-format on
151}; 158};
152 159
153static const u8 morton_lut[64] = { 160static const u8 morton_lut[TILE_SIZE] = {
154 0, 1, 4, 5, 16, 17, 20, 21, 2, 3, 6, 7, 18, 19, 22, 23, 8, 9, 12, 13, 24, 25, 161 // clang-format off
155 28, 29, 10, 11, 14, 15, 26, 27, 30, 31, 32, 33, 36, 37, 48, 49, 52, 53, 34, 35, 38, 39, 162 0, 1, 4, 5, 16, 17, 20, 21,
156 50, 51, 54, 55, 40, 41, 44, 45, 56, 57, 60, 61, 42, 43, 46, 47, 58, 59, 62, 63, 163 2, 3, 6, 7, 18, 19, 22, 23,
164 8, 9, 12, 13, 24, 25, 28, 29,
165 10, 11, 14, 15, 26, 27, 30, 31,
166 32, 33, 36, 37, 48, 49, 52, 53,
167 34, 35, 38, 39, 50, 51, 54, 55,
168 40, 41, 44, 45, 56, 57, 60, 61,
169 42, 43, 46, 47, 58, 59, 62, 63,
170 // clang-format on
157}; 171};
158 172
159static void RotateTile0(const ImageTile& input, ImageTile& output, int height, 173static void RotateTile0(const ImageTile& input, ImageTile& output, int height,
diff --git a/src/core/loader/3dsx.h b/src/core/loader/3dsx.h
index 09a788a1c..8d15ba555 100644
--- a/src/core/loader/3dsx.h
+++ b/src/core/loader/3dsx.h
@@ -19,8 +19,7 @@ class AppLoader_THREEDSX final : public AppLoader {
19public: 19public:
20 AppLoader_THREEDSX(FileUtil::IOFile&& file, const std::string& filename, 20 AppLoader_THREEDSX(FileUtil::IOFile&& file, const std::string& filename,
21 const std::string& filepath) 21 const std::string& filepath)
22 : AppLoader(std::move(file)), filename(std::move(filename)), filepath(filepath) { 22 : AppLoader(std::move(file)), filename(std::move(filename)), filepath(filepath) {}
23 }
24 23
25 /** 24 /**
26 * Returns the type of the file 25 * Returns the type of the file
diff --git a/src/core/loader/elf.h b/src/core/loader/elf.h
index 0b1456c64..04a9b482d 100644
--- a/src/core/loader/elf.h
+++ b/src/core/loader/elf.h
@@ -18,8 +18,7 @@ namespace Loader {
18class AppLoader_ELF final : public AppLoader { 18class AppLoader_ELF final : public AppLoader {
19public: 19public:
20 AppLoader_ELF(FileUtil::IOFile&& file, std::string filename) 20 AppLoader_ELF(FileUtil::IOFile&& file, std::string filename)
21 : AppLoader(std::move(file)), filename(std::move(filename)) { 21 : AppLoader(std::move(file)), filename(std::move(filename)) {}
22 }
23 22
24 /** 23 /**
25 * Returns the type of the file 24 * Returns the type of the file
diff --git a/src/core/loader/loader.h b/src/core/loader/loader.h
index 5f48d2ffe..fdfee835c 100644
--- a/src/core/loader/loader.h
+++ b/src/core/loader/loader.h
@@ -81,10 +81,8 @@ constexpr u32 MakeMagic(char a, char b, char c, char d) {
81/// Interface for loading an application 81/// Interface for loading an application
82class AppLoader : NonCopyable { 82class AppLoader : NonCopyable {
83public: 83public:
84 AppLoader(FileUtil::IOFile&& file) : file(std::move(file)) { 84 AppLoader(FileUtil::IOFile&& file) : file(std::move(file)) {}
85 } 85 virtual ~AppLoader() {}
86 virtual ~AppLoader() {
87 }
88 86
89 /** 87 /**
90 * Returns the type of this file 88 * Returns the type of this file
diff --git a/src/core/loader/ncch.h b/src/core/loader/ncch.h
index 0cd70f70c..f53f8100e 100644
--- a/src/core/loader/ncch.h
+++ b/src/core/loader/ncch.h
@@ -164,8 +164,7 @@ namespace Loader {
164class AppLoader_NCCH final : public AppLoader { 164class AppLoader_NCCH final : public AppLoader {
165public: 165public:
166 AppLoader_NCCH(FileUtil::IOFile&& file, const std::string& filepath) 166 AppLoader_NCCH(FileUtil::IOFile&& file, const std::string& filepath)
167 : AppLoader(std::move(file)), filepath(filepath) { 167 : AppLoader(std::move(file)), filepath(filepath) {}
168 }
169 168
170 /** 169 /**
171 * Returns the type of the file 170 * Returns the type of the file
diff --git a/src/core/tracer/citrace.h b/src/core/tracer/citrace.h
index ac26e872b..215f86359 100644
--- a/src/core/tracer/citrace.h
+++ b/src/core/tracer/citrace.h
@@ -76,7 +76,12 @@ struct CTMemoryLoad {
76struct CTRegisterWrite { 76struct CTRegisterWrite {
77 u32 physical_address; 77 u32 physical_address;
78 78
79 enum : u32 { SIZE_8 = 0xD1, SIZE_16 = 0xD2, SIZE_32 = 0xD3, SIZE_64 = 0xD4 } size; 79 enum : u32 {
80 SIZE_8 = 0xD1,
81 SIZE_16 = 0xD2,
82 SIZE_32 = 0xD3,
83 SIZE_64 = 0xD4,
84 } size;
80 85
81 // TODO: Make it clearer which bits of this member are used for sizes other than 32 bits 86 // TODO: Make it clearer which bits of this member are used for sizes other than 32 bits
82 u64 value; 87 u64 value;
diff --git a/src/core/tracer/recorder.cpp b/src/core/tracer/recorder.cpp
index 8fd0018c4..11a289b2c 100644
--- a/src/core/tracer/recorder.cpp
+++ b/src/core/tracer/recorder.cpp
@@ -12,8 +12,7 @@
12 12
13namespace CiTrace { 13namespace CiTrace {
14 14
15Recorder::Recorder(const InitialState& initial_state) : initial_state(initial_state) { 15Recorder::Recorder(const InitialState& initial_state) : initial_state(initial_state) {}
16}
17 16
18void Recorder::Finish(const std::string& filename) { 17void Recorder::Finish(const std::string& filename) {
19 // Setup CiTrace header 18 // Setup CiTrace header
diff --git a/src/video_core/clipper.cpp b/src/video_core/clipper.cpp
index 747285866..82178d249 100644
--- a/src/video_core/clipper.cpp
+++ b/src/video_core/clipper.cpp
@@ -30,8 +30,7 @@ public:
30 ClippingEdge(Math::Vec4<float24> coeffs, Math::Vec4<float24> bias = Math::Vec4<float24>( 30 ClippingEdge(Math::Vec4<float24> coeffs, Math::Vec4<float24> bias = Math::Vec4<float24>(
31 float24::FromFloat32(0), float24::FromFloat32(0), 31 float24::FromFloat32(0), float24::FromFloat32(0),
32 float24::FromFloat32(0), float24::FromFloat32(0))) 32 float24::FromFloat32(0), float24::FromFloat32(0)))
33 : coeffs(coeffs), bias(bias) { 33 : coeffs(coeffs), bias(bias) {}
34 }
35 34
36 bool IsInside(const OutputVertex& vertex) const { 35 bool IsInside(const OutputVertex& vertex) const {
37 return Math::Dot(vertex.pos + bias, coeffs) <= float24::FromFloat32(0); 36 return Math::Dot(vertex.pos + bias, coeffs) <= float24::FromFloat32(0);
diff --git a/src/video_core/command_processor.cpp b/src/video_core/command_processor.cpp
index 415b5f74c..04a4ee3a2 100644
--- a/src/video_core/command_processor.cpp
+++ b/src/video_core/command_processor.cpp
@@ -44,7 +44,8 @@ static u32 default_attr_write_buffer[3];
44// Expand a 4-bit mask to 4-byte mask, e.g. 0b0101 -> 0x00FF00FF 44// Expand a 4-bit mask to 4-byte mask, e.g. 0b0101 -> 0x00FF00FF
45static const u32 expand_bits_to_bytes[] = { 45static const u32 expand_bits_to_bytes[] = {
46 0x00000000, 0x000000ff, 0x0000ff00, 0x0000ffff, 0x00ff0000, 0x00ff00ff, 0x00ffff00, 0x00ffffff, 46 0x00000000, 0x000000ff, 0x0000ff00, 0x0000ffff, 0x00ff0000, 0x00ff00ff, 0x00ffff00, 0x00ffffff,
47 0xff000000, 0xff0000ff, 0xff00ff00, 0xff00ffff, 0xffff0000, 0xffff00ff, 0xffffff00, 0xffffffff}; 47 0xff000000, 0xff0000ff, 0xff00ff00, 0xff00ffff, 0xffff0000, 0xffff00ff, 0xffffff00, 0xffffffff,
48};
48 49
49MICROPROFILE_DEFINE(GPU_Drawing, "GPU", "Drawing", MP_RGB(50, 50, 240)); 50MICROPROFILE_DEFINE(GPU_Drawing, "GPU", "Drawing", MP_RGB(50, 50, 240));
50 51
diff --git a/src/video_core/debug_utils/debug_utils.cpp b/src/video_core/debug_utils/debug_utils.cpp
index 1cb868ead..194e5833c 100644
--- a/src/video_core/debug_utils/debug_utils.cpp
+++ b/src/video_core/debug_utils/debug_utils.cpp
@@ -155,7 +155,8 @@ void DumpShader(const std::string& filename, const Regs::ShaderConfig& config,
155 {OutputAttributes::TEXCOORD2_V, {OutputRegisterInfo::TEXCOORD2, 2}}, 155 {OutputAttributes::TEXCOORD2_V, {OutputRegisterInfo::TEXCOORD2, 2}},
156 {OutputAttributes::VIEW_X, {OutputRegisterInfo::VIEW, 1}}, 156 {OutputAttributes::VIEW_X, {OutputRegisterInfo::VIEW, 1}},
157 {OutputAttributes::VIEW_Y, {OutputRegisterInfo::VIEW, 2}}, 157 {OutputAttributes::VIEW_Y, {OutputRegisterInfo::VIEW, 2}},
158 {OutputAttributes::VIEW_Z, {OutputRegisterInfo::VIEW, 4}}}; 158 {OutputAttributes::VIEW_Z, {OutputRegisterInfo::VIEW, 4}},
159 };
159 160
160 for (const auto& semantic : std::vector<OutputAttributes::Semantic>{ 161 for (const auto& semantic : std::vector<OutputAttributes::Semantic>{
161 output_attributes[i].map_x, output_attributes[i].map_y, output_attributes[i].map_z, 162 output_attributes[i].map_x, output_attributes[i].map_y, output_attributes[i].map_z,
@@ -529,14 +530,16 @@ const Math::Vec4<u8> LookupTexture(const u8* source, int x, int y, const Texture
529 unsigned table_index = 530 unsigned table_index =
530 static_cast<int>((x < 2) ? table_index_1.Value() : table_index_2.Value()); 531 static_cast<int>((x < 2) ? table_index_1.Value() : table_index_2.Value());
531 532
532 static const std::array<std::array<u8, 2>, 8> etc1_modifier_table = {{{{2, 8}}, 533 static const std::array<std::array<u8, 2>, 8> etc1_modifier_table = {{
533 {{5, 17}}, 534 {{2, 8}},
534 {{9, 29}}, 535 {{5, 17}},
535 {{13, 42}}, 536 {{9, 29}},
536 {{18, 60}}, 537 {{13, 42}},
537 {{24, 80}}, 538 {{18, 60}},
538 {{33, 106}}, 539 {{24, 80}},
539 {{47, 183}}}}; 540 {{33, 106}},
541 {{47, 183}},
542 }};
540 543
541 int modifier = etc1_modifier_table.at(table_index).at(GetTableSubIndex(texel)); 544 int modifier = etc1_modifier_table.at(table_index).at(GetTableSubIndex(texel));
542 if (GetNegationFlag(texel)) 545 if (GetNegationFlag(texel))
@@ -713,9 +716,9 @@ static std::string GetTevStageConfigSourceString(const Pica::Regs::TevStageConfi
713 return src_it->second; 716 return src_it->second;
714} 717}
715 718
716static std::string 719static std::string GetTevStageConfigColorSourceString(
717GetTevStageConfigColorSourceString(const Pica::Regs::TevStageConfig::Source& source, 720 const Pica::Regs::TevStageConfig::Source& source,
718 const Pica::Regs::TevStageConfig::ColorModifier modifier) { 721 const Pica::Regs::TevStageConfig::ColorModifier modifier) {
719 using ColorModifier = Pica::Regs::TevStageConfig::ColorModifier; 722 using ColorModifier = Pica::Regs::TevStageConfig::ColorModifier;
720 static const std::map<ColorModifier, std::string> color_modifier_map = { 723 static const std::map<ColorModifier, std::string> color_modifier_map = {
721 {ColorModifier::SourceColor, "%source.rgb"}, 724 {ColorModifier::SourceColor, "%source.rgb"},
@@ -739,9 +742,9 @@ GetTevStageConfigColorSourceString(const Pica::Regs::TevStageConfig::Source& sou
739 return ReplacePattern(modifier_str, "%source", src_str); 742 return ReplacePattern(modifier_str, "%source", src_str);
740} 743}
741 744
742static std::string 745static std::string GetTevStageConfigAlphaSourceString(
743GetTevStageConfigAlphaSourceString(const Pica::Regs::TevStageConfig::Source& source, 746 const Pica::Regs::TevStageConfig::Source& source,
744 const Pica::Regs::TevStageConfig::AlphaModifier modifier) { 747 const Pica::Regs::TevStageConfig::AlphaModifier modifier) {
745 using AlphaModifier = Pica::Regs::TevStageConfig::AlphaModifier; 748 using AlphaModifier = Pica::Regs::TevStageConfig::AlphaModifier;
746 static const std::map<AlphaModifier, std::string> alpha_modifier_map = { 749 static const std::map<AlphaModifier, std::string> alpha_modifier_map = {
747 {AlphaModifier::SourceAlpha, "%source.a"}, 750 {AlphaModifier::SourceAlpha, "%source.a"},
@@ -763,8 +766,8 @@ GetTevStageConfigAlphaSourceString(const Pica::Regs::TevStageConfig::Source& sou
763 return ReplacePattern(modifier_str, "%source", src_str); 766 return ReplacePattern(modifier_str, "%source", src_str);
764} 767}
765 768
766static std::string 769static std::string GetTevStageConfigOperationString(
767GetTevStageConfigOperationString(const Pica::Regs::TevStageConfig::Operation& operation) { 770 const Pica::Regs::TevStageConfig::Operation& operation) {
768 using Operation = Pica::Regs::TevStageConfig::Operation; 771 using Operation = Pica::Regs::TevStageConfig::Operation;
769 static const std::map<Operation, std::string> combiner_map = { 772 static const std::map<Operation, std::string> combiner_map = {
770 {Operation::Replace, "%source1"}, 773 {Operation::Replace, "%source1"},
diff --git a/src/video_core/debug_utils/debug_utils.h b/src/video_core/debug_utils/debug_utils.h
index 1a58f40ff..fe3ed247d 100644
--- a/src/video_core/debug_utils/debug_utils.h
+++ b/src/video_core/debug_utils/debug_utils.h
@@ -87,15 +87,13 @@ public:
87 * @param data Optional data pointer (if unused, this is a nullptr) 87 * @param data Optional data pointer (if unused, this is a nullptr)
88 * @note This function will perform nothing unless it is overridden in the child class. 88 * @note This function will perform nothing unless it is overridden in the child class.
89 */ 89 */
90 virtual void OnPicaBreakPointHit(Event, void*) { 90 virtual void OnPicaBreakPointHit(Event, void*) {}
91 }
92 91
93 /** 92 /**
94 * Action to perform when emulation is resumed from a breakpoint. 93 * Action to perform when emulation is resumed from a breakpoint.
95 * @note This function will perform nothing unless it is overridden in the child class. 94 * @note This function will perform nothing unless it is overridden in the child class.
96 */ 95 */
97 virtual void OnPicaResume() { 96 virtual void OnPicaResume() {}
98 }
99 97
100 protected: 98 protected:
101 /** 99 /**
diff --git a/src/video_core/gpu_debugger.h b/src/video_core/gpu_debugger.h
index e3ba80d8f..aea391619 100644
--- a/src/video_core/gpu_debugger.h
+++ b/src/video_core/gpu_debugger.h
@@ -15,8 +15,7 @@ public:
15 // Base class for all objects which need to be notified about GPU events 15 // Base class for all objects which need to be notified about GPU events
16 class DebuggerObserver { 16 class DebuggerObserver {
17 public: 17 public:
18 DebuggerObserver() : observed(nullptr) { 18 DebuggerObserver() : observed(nullptr) {}
19 }
20 19
21 virtual ~DebuggerObserver() { 20 virtual ~DebuggerObserver() {
22 if (observed) 21 if (observed)
diff --git a/src/video_core/pica.h b/src/video_core/pica.h
index 1d1a686e0..b2db609ec 100644
--- a/src/video_core/pica.h
+++ b/src/video_core/pica.h
@@ -176,7 +176,10 @@ struct Regs {
176 MirroredRepeat = 3, 176 MirroredRepeat = 3,
177 }; 177 };
178 178
179 enum TextureFilter : u32 { Nearest = 0, Linear = 1 }; 179 enum TextureFilter : u32 {
180 Nearest = 0,
181 Linear = 1,
182 };
180 183
181 union { 184 union {
182 u32 raw; 185 u32 raw;
@@ -300,9 +303,11 @@ struct Regs {
300 const TextureFormat format; 303 const TextureFormat format;
301 }; 304 };
302 const std::array<FullTextureConfig, 3> GetTextures() const { 305 const std::array<FullTextureConfig, 3> GetTextures() const {
303 return {{{texture0_enable.ToBool(), texture0, texture0_format}, 306 return {{
304 {texture1_enable.ToBool(), texture1, texture1_format}, 307 {texture0_enable.ToBool(), texture0, texture0_format},
305 {texture2_enable.ToBool(), texture2, texture2_format}}}; 308 {texture1_enable.ToBool(), texture1, texture1_format},
309 {texture2_enable.ToBool(), texture2, texture2_format},
310 }};
306 } 311 }
307 312
308 // 0xc0-0xff: Texture Combiner (akin to glTexEnv) 313 // 0xc0-0xff: Texture Combiner (akin to glTexEnv)
@@ -523,7 +528,7 @@ struct Regs {
523 Decrement = 4, 528 Decrement = 4,
524 Invert = 5, 529 Invert = 5,
525 IncrementWrap = 6, 530 IncrementWrap = 6,
526 DecrementWrap = 7 531 DecrementWrap = 7,
527 }; 532 };
528 533
529 struct { 534 struct {
@@ -1173,7 +1178,10 @@ struct Regs {
1173 1178
1174 INSERT_PADDING_WORDS(0x07); 1179 INSERT_PADDING_WORDS(0x07);
1175 1180
1176 enum class GPUMode : u32 { Drawing = 0, Configuring = 1 }; 1181 enum class GPUMode : u32 {
1182 Drawing = 0,
1183 Configuring = 1,
1184 };
1177 1185
1178 GPUMode gpu_mode; 1186 GPUMode gpu_mode;
1179 1187
@@ -1249,7 +1257,10 @@ struct Regs {
1249 INSERT_PADDING_WORDS(0x2); 1257 INSERT_PADDING_WORDS(0x2);
1250 1258
1251 struct { 1259 struct {
1252 enum Format : u32 { FLOAT24 = 0, FLOAT32 = 1 }; 1260 enum Format : u32 {
1261 FLOAT24 = 0,
1262 FLOAT32 = 1,
1263 };
1253 1264
1254 bool IsFloat32() const { 1265 bool IsFloat32() const {
1255 return format == FLOAT32; 1266 return format == FLOAT32;
diff --git a/src/video_core/primitive_assembly.cpp b/src/video_core/primitive_assembly.cpp
index 343edb191..901cca26b 100644
--- a/src/video_core/primitive_assembly.cpp
+++ b/src/video_core/primitive_assembly.cpp
@@ -12,8 +12,7 @@ namespace Pica {
12 12
13template <typename VertexType> 13template <typename VertexType>
14PrimitiveAssembler<VertexType>::PrimitiveAssembler(Regs::TriangleTopology topology) 14PrimitiveAssembler<VertexType>::PrimitiveAssembler(Regs::TriangleTopology topology)
15 : topology(topology), buffer_index(0) { 15 : topology(topology), buffer_index(0) {}
16}
17 16
18template <typename VertexType> 17template <typename VertexType>
19void PrimitiveAssembler<VertexType>::SubmitVertex(VertexType& vtx, 18void PrimitiveAssembler<VertexType>::SubmitVertex(VertexType& vtx,
diff --git a/src/video_core/rasterizer.cpp b/src/video_core/rasterizer.cpp
index dbdc37ce6..f815d6cf0 100644
--- a/src/video_core/rasterizer.cpp
+++ b/src/video_core/rasterizer.cpp
@@ -268,10 +268,8 @@ static u8 PerformStencilAction(Regs::StencilAction action, u8 old_stencil, u8 re
268 268
269// NOTE: Assuming that rasterizer coordinates are 12.4 fixed-point values 269// NOTE: Assuming that rasterizer coordinates are 12.4 fixed-point values
270struct Fix12P4 { 270struct Fix12P4 {
271 Fix12P4() { 271 Fix12P4() {}
272 } 272 Fix12P4(u16 val) : val(val) {}
273 Fix12P4(u16 val) : val(val) {
274 }
275 273
276 static u16 FracMask() { 274 static u16 FracMask() {
277 return 0xF; 275 return 0xF;
@@ -491,7 +489,8 @@ static void ProcessTriangleInternal(const Shader::OutputVertex& v0, const Shader
491 255), 489 255),
492 (u8)( 490 (u8)(
493 GetInterpolatedAttribute(v0.color.a(), v1.color.a(), v2.color.a()).ToFloat32() * 491 GetInterpolatedAttribute(v0.color.a(), v1.color.a(), v2.color.a()).ToFloat32() *
494 255)}; 492 255),
493 };
495 494
496 Math::Vec2<float24> uv[3]; 495 Math::Vec2<float24> uv[3];
497 uv[0].u() = GetInterpolatedAttribute(v0.tc0.u(), v1.tc0.u(), v2.tc0.u()); 496 uv[0].u() = GetInterpolatedAttribute(v0.tc0.u(), v1.tc0.u(), v2.tc0.u());
@@ -604,7 +603,8 @@ static void ProcessTriangleInternal(const Shader::OutputVertex& v0, const Shader
604 Math::Vec4<u8> combiner_buffer = {0, 0, 0, 0}; 603 Math::Vec4<u8> combiner_buffer = {0, 0, 0, 0};
605 Math::Vec4<u8> next_combiner_buffer = { 604 Math::Vec4<u8> next_combiner_buffer = {
606 regs.tev_combiner_buffer_color.r, regs.tev_combiner_buffer_color.g, 605 regs.tev_combiner_buffer_color.r, regs.tev_combiner_buffer_color.g,
607 regs.tev_combiner_buffer_color.b, regs.tev_combiner_buffer_color.a}; 606 regs.tev_combiner_buffer_color.b, regs.tev_combiner_buffer_color.a,
607 };
608 608
609 for (unsigned tev_stage_index = 0; tev_stage_index < tev_stages.size(); 609 for (unsigned tev_stage_index = 0; tev_stage_index < tev_stages.size();
610 ++tev_stage_index) { 610 ++tev_stage_index) {
@@ -841,18 +841,16 @@ static void ProcessTriangleInternal(const Shader::OutputVertex& v0, const Shader
841 Math::Vec3<u8> color_result[3] = { 841 Math::Vec3<u8> color_result[3] = {
842 GetColorModifier(tev_stage.color_modifier1, GetSource(tev_stage.color_source1)), 842 GetColorModifier(tev_stage.color_modifier1, GetSource(tev_stage.color_source1)),
843 GetColorModifier(tev_stage.color_modifier2, GetSource(tev_stage.color_source2)), 843 GetColorModifier(tev_stage.color_modifier2, GetSource(tev_stage.color_source2)),
844 GetColorModifier(tev_stage.color_modifier3, 844 GetColorModifier(tev_stage.color_modifier3, GetSource(tev_stage.color_source3)),
845 GetSource(tev_stage.color_source3))}; 845 };
846 auto color_output = ColorCombine(tev_stage.color_op, color_result); 846 auto color_output = ColorCombine(tev_stage.color_op, color_result);
847 847
848 // alpha combiner 848 // alpha combiner
849 std::array<u8, 3> alpha_result = { 849 std::array<u8, 3> alpha_result = {{
850 {GetAlphaModifier(tev_stage.alpha_modifier1, 850 GetAlphaModifier(tev_stage.alpha_modifier1, GetSource(tev_stage.alpha_source1)),
851 GetSource(tev_stage.alpha_source1)), 851 GetAlphaModifier(tev_stage.alpha_modifier2, GetSource(tev_stage.alpha_source2)),
852 GetAlphaModifier(tev_stage.alpha_modifier2, 852 GetAlphaModifier(tev_stage.alpha_modifier3, GetSource(tev_stage.alpha_source3)),
853 GetSource(tev_stage.alpha_source2)), 853 }};
854 GetAlphaModifier(tev_stage.alpha_modifier3,
855 GetSource(tev_stage.alpha_source3))}};
856 auto alpha_output = AlphaCombine(tev_stage.alpha_op, alpha_result); 854 auto alpha_output = AlphaCombine(tev_stage.alpha_op, alpha_result);
857 855
858 combiner_output[0] = 856 combiner_output[0] =
@@ -1083,7 +1081,8 @@ static void ProcessTriangleInternal(const Shader::OutputVertex& v0, const Shader
1083 static_cast<u8>(output_merger.blend_const.r), 1081 static_cast<u8>(output_merger.blend_const.r),
1084 static_cast<u8>(output_merger.blend_const.g), 1082 static_cast<u8>(output_merger.blend_const.g),
1085 static_cast<u8>(output_merger.blend_const.b), 1083 static_cast<u8>(output_merger.blend_const.b),
1086 static_cast<u8>(output_merger.blend_const.a)}; 1084 static_cast<u8>(output_merger.blend_const.a),
1085 };
1087 1086
1088 switch (factor) { 1087 switch (factor) {
1089 case Regs::BlendFactor::Zero: 1088 case Regs::BlendFactor::Zero:
@@ -1267,11 +1266,12 @@ static void ProcessTriangleInternal(const Shader::OutputVertex& v0, const Shader
1267 LogicOp(combiner_output.a(), dest.a(), output_merger.logic_op)); 1266 LogicOp(combiner_output.a(), dest.a(), output_merger.logic_op));
1268 } 1267 }
1269 1268
1270 const Math::Vec4<u8> result = {output_merger.red_enable ? blend_output.r() : dest.r(), 1269 const Math::Vec4<u8> result = {
1271 output_merger.green_enable ? blend_output.g() : dest.g(), 1270 output_merger.red_enable ? blend_output.r() : dest.r(),
1272 output_merger.blue_enable ? blend_output.b() : dest.b(), 1271 output_merger.green_enable ? blend_output.g() : dest.g(),
1273 output_merger.alpha_enable ? blend_output.a() 1272 output_merger.blue_enable ? blend_output.b() : dest.b(),
1274 : dest.a()}; 1273 output_merger.alpha_enable ? blend_output.a() : dest.a(),
1274 };
1275 1275
1276 if (regs.framebuffer.allow_color_write != 0) 1276 if (regs.framebuffer.allow_color_write != 0)
1277 DrawPixel(x >> 4, y >> 4, result); 1277 DrawPixel(x >> 4, y >> 4, result);
diff --git a/src/video_core/rasterizer_interface.h b/src/video_core/rasterizer_interface.h
index ce834bd30..c7bd29f12 100644
--- a/src/video_core/rasterizer_interface.h
+++ b/src/video_core/rasterizer_interface.h
@@ -20,8 +20,7 @@ namespace VideoCore {
20 20
21class RasterizerInterface { 21class RasterizerInterface {
22public: 22public:
23 virtual ~RasterizerInterface() { 23 virtual ~RasterizerInterface() {}
24 }
25 24
26 /// Queues the primitive formed by the given vertices for rendering 25 /// Queues the primitive formed by the given vertices for rendering
27 virtual void AddTriangle(const Pica::Shader::OutputVertex& v0, 26 virtual void AddTriangle(const Pica::Shader::OutputVertex& v0,
diff --git a/src/video_core/renderer_base.h b/src/video_core/renderer_base.h
index 22e2f9815..daacdb167 100644
--- a/src/video_core/renderer_base.h
+++ b/src/video_core/renderer_base.h
@@ -17,8 +17,7 @@ public:
17 /// Used to reference a framebuffer 17 /// Used to reference a framebuffer
18 enum kFramebuffer { kFramebuffer_VirtualXFB = 0, kFramebuffer_EFB, kFramebuffer_Texture }; 18 enum kFramebuffer { kFramebuffer_VirtualXFB = 0, kFramebuffer_EFB, kFramebuffer_Texture };
19 19
20 virtual ~RendererBase() { 20 virtual ~RendererBase() {}
21 }
22 21
23 /// Swap buffers (render frame) 22 /// Swap buffers (render frame)
24 virtual void SwapBuffers() = 0; 23 virtual void SwapBuffers() = 0;
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp
index 5021f48bc..37977464d 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp
@@ -136,8 +136,7 @@ RasterizerOpenGL::RasterizerOpenGL() : shader_dirty(true) {
136 SyncDepthWriteMask(); 136 SyncDepthWriteMask();
137} 137}
138 138
139RasterizerOpenGL::~RasterizerOpenGL() { 139RasterizerOpenGL::~RasterizerOpenGL() {}
140}
141 140
142/** 141/**
143 * This is a helper function to resolve an issue with opposite quaternions being interpolated by 142 * This is a helper function to resolve an issue with opposite quaternions being interpolated by
@@ -1156,9 +1155,10 @@ void RasterizerOpenGL::SyncBlendColor() {
1156 1155
1157void RasterizerOpenGL::SyncFogColor() { 1156void RasterizerOpenGL::SyncFogColor() {
1158 const auto& regs = Pica::g_state.regs; 1157 const auto& regs = Pica::g_state.regs;
1159 uniform_block_data.data.fog_color = {regs.fog_color.r.Value() / 255.0f, 1158 uniform_block_data.data.fog_color = {
1160 regs.fog_color.g.Value() / 255.0f, 1159 regs.fog_color.r.Value() / 255.0f, regs.fog_color.g.Value() / 255.0f,
1161 regs.fog_color.b.Value() / 255.0f}; 1160 regs.fog_color.b.Value() / 255.0f,
1161 };
1162 uniform_block_data.dirty = true; 1162 uniform_block_data.dirty = true;
1163} 1163}
1164 1164
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.h b/src/video_core/renderer_opengl/gl_rasterizer.h
index 70e9e64ef..60d70539c 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.h
+++ b/src/video_core/renderer_opengl/gl_rasterizer.h
@@ -41,12 +41,9 @@ struct ScreenInfo;
41 * two separate shaders sharing the same key. 41 * two separate shaders sharing the same key.
42 * 42 *
43 * We use a union because "implicitly-defined copy/move constructor for a union X copies the object 43 * We use a union because "implicitly-defined copy/move constructor for a union X copies the object
44 * representation of X." 44 * representation of X." and "implicitly-defined copy assignment operator for a union X copies the
45 * and "implicitly-defined copy assignment operator for a union X copies the object representation 45 * object representation (3.9) of X." = Bytewise copy instead of memberwise copy. This is important
46 * (3.9) of X." 46 * because the padding bytes are included in the hash and comparison between objects.
47 * = Bytewise copy instead of memberwise copy.
48 * This is important because the padding bytes are included in the hash and comparison between
49 * objects.
50 */ 47 */
51union PicaShaderConfig { 48union PicaShaderConfig {
52 49
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp
index 8f1477bcd..ec3300ca6 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp
@@ -522,8 +522,8 @@ CachedSurface* RasterizerCacheOpenGL::GetSurfaceRect(const CachedSurface& params
522 return GetSurface(params, match_res_scale, load_if_create); 522 return GetSurface(params, match_res_scale, load_if_create);
523} 523}
524 524
525CachedSurface* 525CachedSurface* RasterizerCacheOpenGL::GetTextureSurface(
526RasterizerCacheOpenGL::GetTextureSurface(const Pica::Regs::FullTextureConfig& config) { 526 const Pica::Regs::FullTextureConfig& config) {
527 Pica::DebugUtils::TextureInfo info = 527 Pica::DebugUtils::TextureInfo info =
528 Pica::DebugUtils::TextureInfo::FromPicaRegister(config.config, config.format); 528 Pica::DebugUtils::TextureInfo::FromPicaRegister(config.config, config.format);
529 529
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.h b/src/video_core/renderer_opengl/gl_rasterizer_cache.h
index db5b649da..b2272bda8 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer_cache.h
+++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.h
@@ -212,8 +212,8 @@ public:
212 212
213 /// Gets the color and depth surfaces and rect (resolution scaled) based on the framebuffer 213 /// Gets the color and depth surfaces and rect (resolution scaled) based on the framebuffer
214 /// configuration 214 /// configuration
215 std::tuple<CachedSurface*, CachedSurface*, MathUtil::Rectangle<int>> 215 std::tuple<CachedSurface*, CachedSurface*, MathUtil::Rectangle<int>> GetFramebufferSurfaces(
216 GetFramebufferSurfaces(const Pica::Regs::FramebufferConfig& config); 216 const Pica::Regs::FramebufferConfig& config);
217 217
218 /// Attempt to get a surface that exactly matches the fill region and format 218 /// Attempt to get a surface that exactly matches the fill region and format
219 CachedSurface* TryGetFillSurface(const GPU::Regs::MemoryFillConfig& config); 219 CachedSurface* TryGetFillSurface(const GPU::Regs::MemoryFillConfig& config);
diff --git a/src/video_core/renderer_opengl/gl_shader_gen.cpp b/src/video_core/renderer_opengl/gl_shader_gen.cpp
index f86cffee5..9392c67b8 100644
--- a/src/video_core/renderer_opengl/gl_shader_gen.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_gen.cpp
@@ -293,9 +293,7 @@ static void AppendAlphaTestCondition(std::string& out, Regs::CompareFunc func) {
293 case CompareFunc::LessThanOrEqual: 293 case CompareFunc::LessThanOrEqual:
294 case CompareFunc::GreaterThan: 294 case CompareFunc::GreaterThan:
295 case CompareFunc::GreaterThanOrEqual: { 295 case CompareFunc::GreaterThanOrEqual: {
296 static const char* op[] = { 296 static const char* op[] = {"!=", "==", ">=", ">", "<=", "<"};
297 "!=", "==", ">=", ">", "<=", "<",
298 };
299 unsigned index = (unsigned)func - (unsigned)CompareFunc::Equal; 297 unsigned index = (unsigned)func - (unsigned)CompareFunc::Equal;
300 out += "int(last_tex_env_out.a * 255.0f) " + std::string(op[index]) + " alphatest_ref"; 298 out += "int(last_tex_env_out.a * 255.0f) " + std::string(op[index]) + " alphatest_ref";
301 break; 299 break;
diff --git a/src/video_core/renderer_opengl/pica_to_gl.h b/src/video_core/renderer_opengl/pica_to_gl.h
index a604e94d4..415358b6c 100644
--- a/src/video_core/renderer_opengl/pica_to_gl.h
+++ b/src/video_core/renderer_opengl/pica_to_gl.h
@@ -26,7 +26,7 @@ namespace PicaToGL {
26inline GLenum TextureFilterMode(Pica::Regs::TextureConfig::TextureFilter mode) { 26inline GLenum TextureFilterMode(Pica::Regs::TextureConfig::TextureFilter mode) {
27 static const GLenum filter_mode_table[] = { 27 static const GLenum filter_mode_table[] = {
28 GL_NEAREST, // TextureFilter::Nearest 28 GL_NEAREST, // TextureFilter::Nearest
29 GL_LINEAR // TextureFilter::Linear 29 GL_LINEAR, // TextureFilter::Linear
30 }; 30 };
31 31
32 // Range check table for input 32 // Range check table for input
@@ -55,7 +55,7 @@ inline GLenum WrapMode(Pica::Regs::TextureConfig::WrapMode mode) {
55 GL_CLAMP_TO_EDGE, // WrapMode::ClampToEdge 55 GL_CLAMP_TO_EDGE, // WrapMode::ClampToEdge
56 GL_CLAMP_TO_BORDER, // WrapMode::ClampToBorder 56 GL_CLAMP_TO_BORDER, // WrapMode::ClampToBorder
57 GL_REPEAT, // WrapMode::Repeat 57 GL_REPEAT, // WrapMode::Repeat
58 GL_MIRRORED_REPEAT // WrapMode::MirroredRepeat 58 GL_MIRRORED_REPEAT, // WrapMode::MirroredRepeat
59 }; 59 };
60 60
61 // Range check table for input 61 // Range check table for input
@@ -192,7 +192,7 @@ inline GLenum StencilOp(Pica::Regs::StencilAction action) {
192 GL_DECR, // StencilAction::Decrement 192 GL_DECR, // StencilAction::Decrement
193 GL_INVERT, // StencilAction::Invert 193 GL_INVERT, // StencilAction::Invert
194 GL_INCR_WRAP, // StencilAction::IncrementWrap 194 GL_INCR_WRAP, // StencilAction::IncrementWrap
195 GL_DECR_WRAP // StencilAction::DecrementWrap 195 GL_DECR_WRAP, // StencilAction::DecrementWrap
196 }; 196 };
197 197
198 // Range check table for input 198 // Range check table for input
@@ -207,12 +207,16 @@ inline GLenum StencilOp(Pica::Regs::StencilAction action) {
207} 207}
208 208
209inline GLvec4 ColorRGBA8(const u32 color) { 209inline GLvec4 ColorRGBA8(const u32 color) {
210 return {{(color >> 0 & 0xFF) / 255.0f, (color >> 8 & 0xFF) / 255.0f, 210 return {{
211 (color >> 16 & 0xFF) / 255.0f, (color >> 24 & 0xFF) / 255.0f}}; 211 (color >> 0 & 0xFF) / 255.0f, (color >> 8 & 0xFF) / 255.0f, (color >> 16 & 0xFF) / 255.0f,
212 (color >> 24 & 0xFF) / 255.0f,
213 }};
212} 214}
213 215
214inline std::array<GLfloat, 3> LightColor(const Pica::Regs::LightColor& color) { 216inline std::array<GLfloat, 3> LightColor(const Pica::Regs::LightColor& color) {
215 return {{color.r / 255.0f, color.g / 255.0f, color.b / 255.0f}}; 217 return {{
218 color.r / 255.0f, color.g / 255.0f, color.b / 255.0f,
219 }};
216} 220}
217 221
218} // namespace 222} // namespace
diff --git a/src/video_core/renderer_opengl/renderer_opengl.cpp b/src/video_core/renderer_opengl/renderer_opengl.cpp
index 3cabda8f9..a1d08e04d 100644
--- a/src/video_core/renderer_opengl/renderer_opengl.cpp
+++ b/src/video_core/renderer_opengl/renderer_opengl.cpp
@@ -87,15 +87,13 @@ struct ScreenRectVertex {
87 * by a 3x2 matrix. 87 * by a 3x2 matrix.
88 */ 88 */
89static std::array<GLfloat, 3 * 2> MakeOrthographicMatrix(const float width, const float height) { 89static std::array<GLfloat, 3 * 2> MakeOrthographicMatrix(const float width, const float height) {
90 std::array<GLfloat, 3 * 2> matrix; 90 std::array<GLfloat, 3 * 2> matrix; // Laid out in column-major order
91 91
92 matrix[0] = 2.f / width; 92 // clang-format off
93 matrix[2] = 0.f; 93 matrix[0] = 2.f / width; matrix[2] = 0.f; matrix[4] = -1.f;
94 matrix[4] = -1.f; 94 matrix[1] = 0.f; matrix[3] = -2.f / height; matrix[5] = 1.f;
95 matrix[1] = 0.f;
96 matrix[3] = -2.f / height;
97 matrix[5] = 1.f;
98 // Last matrix row is implicitly assumed to be [0, 0, 1]. 95 // Last matrix row is implicitly assumed to be [0, 0, 1].
96 // clang-format on
99 97
100 return matrix; 98 return matrix;
101} 99}
@@ -107,8 +105,7 @@ RendererOpenGL::RendererOpenGL() {
107} 105}
108 106
109/// RendererOpenGL destructor 107/// RendererOpenGL destructor
110RendererOpenGL::~RendererOpenGL() { 108RendererOpenGL::~RendererOpenGL() {}
111}
112 109
113/// Swap buffers (render frame) 110/// Swap buffers (render frame)
114void RendererOpenGL::SwapBuffers() { 111void RendererOpenGL::SwapBuffers() {
@@ -215,8 +212,7 @@ void RendererOpenGL::LoadFBToScreenInfo(const GPU::Regs::FramebufferConfig& fram
215 212
216 // Update existing texture 213 // Update existing texture
217 // TODO: Test what happens on hardware when you change the framebuffer dimensions so that 214 // TODO: Test what happens on hardware when you change the framebuffer dimensions so that
218 // they 215 // they differ from the LCD resolution.
219 // differ from the LCD resolution.
220 // TODO: Applications could theoretically crash Citra here by specifying too large 216 // TODO: Applications could theoretically crash Citra here by specifying too large
221 // framebuffer sizes. We should make sure that this cannot happen. 217 // framebuffer sizes. We should make sure that this cannot happen.
222 glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, framebuffer.width, framebuffer.height, 218 glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, framebuffer.width, framebuffer.height,
@@ -231,10 +227,8 @@ void RendererOpenGL::LoadFBToScreenInfo(const GPU::Regs::FramebufferConfig& fram
231} 227}
232 228
233/** 229/**
234 * Fills active OpenGL texture with the given RGB color. 230 * Fills active OpenGL texture with the given RGB color. Since the color is solid, the texture can
235 * Since the color is solid, the texture can be 1x1 but will stretch across whatever it's rendered 231 * be 1x1 but will stretch across whatever it's rendered on.
236 * on.
237 * This has the added benefit of being *really fast*.
238 */ 232 */
239void RendererOpenGL::LoadColorToActiveGLTexture(u8 color_r, u8 color_g, u8 color_b, 233void RendererOpenGL::LoadColorToActiveGLTexture(u8 color_r, u8 color_g, u8 color_b,
240 const TextureInfo& texture) { 234 const TextureInfo& texture) {
@@ -424,8 +418,7 @@ void RendererOpenGL::DrawScreens() {
424} 418}
425 419
426/// Updates the framerate 420/// Updates the framerate
427void RendererOpenGL::UpdateFramerate() { 421void RendererOpenGL::UpdateFramerate() {}
428}
429 422
430/** 423/**
431 * Set the emulator window to use for renderer 424 * Set the emulator window to use for renderer
@@ -513,5 +506,4 @@ bool RendererOpenGL::Init() {
513} 506}
514 507
515/// Shutdown the renderer 508/// Shutdown the renderer
516void RendererOpenGL::ShutDown() { 509void RendererOpenGL::ShutDown() {}
517}
diff --git a/src/video_core/renderer_opengl/renderer_opengl.h b/src/video_core/renderer_opengl/renderer_opengl.h
index faeb519ec..762b790c1 100644
--- a/src/video_core/renderer_opengl/renderer_opengl.h
+++ b/src/video_core/renderer_opengl/renderer_opengl.h
@@ -81,11 +81,14 @@ private:
81 OGLVertexArray vertex_array; 81 OGLVertexArray vertex_array;
82 OGLBuffer vertex_buffer; 82 OGLBuffer vertex_buffer;
83 OGLShader shader; 83 OGLShader shader;
84 std::array<ScreenInfo, 2> 84
85 screen_infos; ///< Display information for top and bottom screens respectively 85 /// Display information for top and bottom screens respectively
86 std::array<ScreenInfo, 2> screen_infos;
87
86 // Shader uniform location indices 88 // Shader uniform location indices
87 GLuint uniform_modelview_matrix; 89 GLuint uniform_modelview_matrix;
88 GLuint uniform_color_texture; 90 GLuint uniform_color_texture;
91
89 // Shader attribute input indices 92 // Shader attribute input indices
90 GLuint attrib_position; 93 GLuint attrib_position;
91 GLuint attrib_tex_coord; 94 GLuint attrib_tex_coord;
diff --git a/src/video_core/shader/shader.cpp b/src/video_core/shader/shader.cpp
index 852c5a9a0..c38bdcc3c 100644
--- a/src/video_core/shader/shader.cpp
+++ b/src/video_core/shader/shader.cpp
@@ -96,8 +96,8 @@ void ShaderSetup::Setup() {
96#ifdef ARCHITECTURE_x86_64 96#ifdef ARCHITECTURE_x86_64
97 if (VideoCore::g_shader_jit_enabled) { 97 if (VideoCore::g_shader_jit_enabled) {
98 u64 cache_key = 98 u64 cache_key =
99 (Common::ComputeHash64(&g_state.vs.program_code, sizeof(g_state.vs.program_code)) ^ 99 Common::ComputeHash64(&g_state.vs.program_code, sizeof(g_state.vs.program_code)) ^
100 Common::ComputeHash64(&g_state.vs.swizzle_data, sizeof(g_state.vs.swizzle_data))); 100 Common::ComputeHash64(&g_state.vs.swizzle_data, sizeof(g_state.vs.swizzle_data));
101 101
102 auto iter = shader_map.find(cache_key); 102 auto iter = shader_map.find(cache_key);
103 if (iter != shader_map.end()) { 103 if (iter != shader_map.end()) {
diff --git a/src/video_core/shader/shader.h b/src/video_core/shader/shader.h
index 830d933a8..79c716b6e 100644
--- a/src/video_core/shader/shader.h
+++ b/src/video_core/shader/shader.h
@@ -358,8 +358,7 @@ struct ShaderSetup {
358 358
359 /** 359 /**
360 * Performs any shader unit setup that only needs to happen once per shader (as opposed to once 360 * Performs any shader unit setup that only needs to happen once per shader (as opposed to once
361 * per 361 * per vertex, which would happen within the `Run` function).
362 * vertex, which would happen within the `Run` function).
363 */ 362 */
364 void Setup(); 363 void Setup();
365 364
diff --git a/src/video_core/shader/shader_interpreter.cpp b/src/video_core/shader/shader_interpreter.cpp
index 681ff9728..41df8a2fd 100644
--- a/src/video_core/shader/shader_interpreter.cpp
+++ b/src/video_core/shader/shader_interpreter.cpp
@@ -80,9 +80,8 @@ void RunInterpreter(const ShaderSetup& setup, UnitState<Debug>& state, unsigned
80 auto call = [&program_counter, &call_stack](UnitState<Debug>& state, u32 offset, 80 auto call = [&program_counter, &call_stack](UnitState<Debug>& state, u32 offset,
81 u32 num_instructions, u32 return_offset, 81 u32 num_instructions, u32 return_offset,
82 u8 repeat_count, u8 loop_increment) { 82 u8 repeat_count, u8 loop_increment) {
83 program_counter = 83 // -1 to make sure when incrementing the PC we end up at the correct offset
84 offset - 84 program_counter = offset - 1;
85 1; // -1 to make sure when incrementing the PC we end up at the correct offset
86 ASSERT(call_stack.size() < call_stack.capacity()); 85 ASSERT(call_stack.size() < call_stack.capacity());
87 call_stack.push_back( 86 call_stack.push_back(
88 {offset + num_instructions, return_offset, repeat_count, loop_increment, offset}); 87 {offset + num_instructions, return_offset, repeat_count, loop_increment, offset});
diff --git a/src/video_core/shader/shader_jit_x64.cpp b/src/video_core/shader/shader_jit_x64.cpp
index 04e04ba1a..d1b2ce8d5 100644
--- a/src/video_core/shader/shader_jit_x64.cpp
+++ b/src/video_core/shader/shader_jit_x64.cpp
@@ -590,8 +590,7 @@ void JitShader::Compile_RSQ(Instruction instr) {
590 Compile_DestEnable(instr, SRC1); 590 Compile_DestEnable(instr, SRC1);
591} 591}
592 592
593void JitShader::Compile_NOP(Instruction instr) { 593void JitShader::Compile_NOP(Instruction instr) {}
594}
595 594
596void JitShader::Compile_END(Instruction instr) { 595void JitShader::Compile_END(Instruction instr) {
597 ABI_PopRegistersAndAdjustStack(ABI_ALL_CALLEE_SAVED, 8); 596 ABI_PopRegistersAndAdjustStack(ABI_ALL_CALLEE_SAVED, 8);
diff --git a/src/video_core/swrasterizer.h b/src/video_core/swrasterizer.h
index bca9780e5..12dc56bef 100644
--- a/src/video_core/swrasterizer.h
+++ b/src/video_core/swrasterizer.h
@@ -19,15 +19,10 @@ namespace VideoCore {
19class SWRasterizer : public RasterizerInterface { 19class SWRasterizer : public RasterizerInterface {
20 void AddTriangle(const Pica::Shader::OutputVertex& v0, const Pica::Shader::OutputVertex& v1, 20 void AddTriangle(const Pica::Shader::OutputVertex& v0, const Pica::Shader::OutputVertex& v1,
21 const Pica::Shader::OutputVertex& v2) override; 21 const Pica::Shader::OutputVertex& v2) override;
22 void DrawTriangles() override { 22 void DrawTriangles() override {}
23 } 23 void NotifyPicaRegisterChanged(u32 id) override {}
24 void NotifyPicaRegisterChanged(u32 id) override { 24 void FlushAll() override {}
25 } 25 void FlushRegion(PAddr addr, u32 size) override {}
26 void FlushAll() override { 26 void FlushAndInvalidateRegion(PAddr addr, u32 size) override {}
27 }
28 void FlushRegion(PAddr addr, u32 size) override {
29 }
30 void FlushAndInvalidateRegion(PAddr addr, u32 size) override {
31 }
32}; 27};
33} 28}