summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
m---------externals/boost0
-rw-r--r--src/citra/emu_window/emu_window_glfw.cpp10
-rw-r--r--src/citra_qt/config/controller_config.cpp2
-rw-r--r--src/citra_qt/debugger/graphics_breakpoints.cpp2
-rw-r--r--src/citra_qt/debugger/ramview.cpp2
-rw-r--r--src/citra_qt/util/spinbox.cpp5
-rw-r--r--src/common/CMakeLists.txt2
-rw-r--r--src/common/assert.h36
-rw-r--r--src/common/break_points.cpp1
-rw-r--r--src/common/chunk_file.h9
-rw-r--r--src/common/common.h3
-rw-r--r--src/common/common_funcs.h35
-rw-r--r--src/common/common_types.h6
-rw-r--r--src/common/concurrent_ring_buffer.h5
-rw-r--r--src/common/log.h56
-rw-r--r--src/common/logging/backend.cpp4
-rw-r--r--src/common/msg_handler.h14
-rw-r--r--src/common/scope_exit.h1
-rw-r--r--src/common/symbols.cpp2
-rw-r--r--src/common/utf8.cpp2
-rw-r--r--src/common/utf8.h2
-rw-r--r--src/core/arm/disassembler/arm_disasm.cpp2
-rw-r--r--src/core/arm/dyncom/arm_dyncom_run.cpp1
-rw-r--r--src/core/core_timing.cpp2
-rw-r--r--src/core/hle/config_mem.cpp2
-rw-r--r--src/core/hle/hle.cpp2
-rw-r--r--src/core/hle/kernel/event.cpp2
-rw-r--r--src/core/hle/kernel/kernel.cpp4
-rw-r--r--src/core/hle/kernel/mutex.cpp2
-rw-r--r--src/core/hle/kernel/semaphore.cpp2
-rw-r--r--src/core/hle/kernel/session.h2
-rw-r--r--src/core/hle/kernel/thread.cpp14
-rw-r--r--src/core/hle/kernel/timer.cpp2
-rw-r--r--src/core/hle/result.h2
-rw-r--r--src/core/hle/service/ac_u.cpp2
-rw-r--r--src/core/hle/service/act_u.cpp1
-rw-r--r--src/core/hle/service/am_app.cpp1
-rw-r--r--src/core/hle/service/am_net.cpp1
-rw-r--r--src/core/hle/service/am_sys.cpp1
-rw-r--r--src/core/hle/service/apt_a.cpp1
-rw-r--r--src/core/hle/service/apt_u.cpp2
-rw-r--r--src/core/hle/service/boss_p.cpp1
-rw-r--r--src/core/hle/service/boss_u.cpp1
-rw-r--r--src/core/hle/service/cam_u.cpp1
-rw-r--r--src/core/hle/service/cecd_s.cpp1
-rw-r--r--src/core/hle/service/cecd_u.cpp1
-rw-r--r--src/core/hle/service/cfg/cfg.cpp3
-rw-r--r--src/core/hle/service/cfg/cfg_i.cpp1
-rw-r--r--src/core/hle/service/cfg/cfg_s.cpp1
-rw-r--r--src/core/hle/service/cfg/cfg_u.cpp3
-rw-r--r--src/core/hle/service/csnd_snd.cpp1
-rw-r--r--src/core/hle/service/dsp_dsp.cpp1
-rw-r--r--src/core/hle/service/err_f.cpp1
-rw-r--r--src/core/hle/service/frd_a.cpp1
-rw-r--r--src/core/hle/service/frd_u.cpp1
-rw-r--r--src/core/hle/service/fs/archive.cpp2
-rw-r--r--src/core/hle/service/gsp_gpu.cpp6
-rw-r--r--src/core/hle/service/gsp_lcd.cpp2
-rw-r--r--src/core/hle/service/hid/hid_spvr.cpp1
-rw-r--r--src/core/hle/service/hid/hid_user.cpp2
-rw-r--r--src/core/hle/service/http_c.cpp1
-rw-r--r--src/core/hle/service/ir_rst.cpp1
-rw-r--r--src/core/hle/service/ir_u.cpp1
-rw-r--r--src/core/hle/service/ldr_ro.cpp1
-rw-r--r--src/core/hle/service/mic_u.cpp1
-rw-r--r--src/core/hle/service/news_s.cpp1
-rw-r--r--src/core/hle/service/news_u.cpp1
-rw-r--r--src/core/hle/service/nim_aoc.cpp1
-rw-r--r--src/core/hle/service/nwm_uds.cpp1
-rw-r--r--src/core/hle/service/pm_app.cpp1
-rw-r--r--src/core/hle/service/ptm_play.cpp1
-rw-r--r--src/core/hle/service/ptm_sysm.cpp1
-rw-r--r--src/core/hle/service/ptm_u.cpp3
-rw-r--r--src/core/hle/service/soc_u.cpp5
-rw-r--r--src/core/hle/service/ssl_c.cpp1
-rw-r--r--src/core/hle/service/y2r_u.cpp1
-rw-r--r--src/core/hle/shared_page.cpp1
-rw-r--r--src/core/hle/svc.cpp2
-rw-r--r--src/core/hw/hw.cpp2
-rw-r--r--src/core/mem_map_funcs.cpp4
-rw-r--r--src/video_core/debug_utils/debug_utils.cpp6
-rw-r--r--src/video_core/gpu_debugger.h2
-rw-r--r--src/video_core/primitive_assembly.cpp1
-rw-r--r--src/video_core/rasterizer.cpp10
-rw-r--r--src/video_core/renderer_opengl/gl_shader_util.cpp2
-rw-r--r--src/video_core/renderer_opengl/renderer_opengl.cpp6
-rw-r--r--src/video_core/vertex_shader.cpp13
-rw-r--r--src/video_core/video_core.cpp1
88 files changed, 134 insertions, 216 deletions
diff --git a/externals/boost b/externals/boost
Subproject 728a4d7d1c8b28355544ae829df9c4b5f28373c Subproject a1afc91d3aaa3da06bdbc13c78613e146665340
diff --git a/src/citra/emu_window/emu_window_glfw.cpp b/src/citra/emu_window/emu_window_glfw.cpp
index 9d1adc2fa..8a3ee64a8 100644
--- a/src/citra/emu_window/emu_window_glfw.cpp
+++ b/src/citra/emu_window/emu_window_glfw.cpp
@@ -36,15 +36,15 @@ const bool EmuWindow_GLFW::IsOpen() {
36} 36}
37 37
38void EmuWindow_GLFW::OnFramebufferResizeEvent(GLFWwindow* win, int width, int height) { 38void EmuWindow_GLFW::OnFramebufferResizeEvent(GLFWwindow* win, int width, int height) {
39 _dbg_assert_(Frontend, width > 0); 39 ASSERT(width > 0);
40 _dbg_assert_(Frontend, height > 0); 40 ASSERT(height > 0);
41 41
42 GetEmuWindow(win)->NotifyFramebufferSizeChanged(std::pair<unsigned,unsigned>(width, height)); 42 GetEmuWindow(win)->NotifyFramebufferSizeChanged(std::pair<unsigned,unsigned>(width, height));
43} 43}
44 44
45void EmuWindow_GLFW::OnClientAreaResizeEvent(GLFWwindow* win, int width, int height) { 45void EmuWindow_GLFW::OnClientAreaResizeEvent(GLFWwindow* win, int width, int height) {
46 _dbg_assert_(Frontend, width > 0); 46 ASSERT(width > 0);
47 _dbg_assert_(Frontend, height > 0); 47 ASSERT(height > 0);
48 48
49 // NOTE: GLFW provides no proper way to set a minimal window size. 49 // NOTE: GLFW provides no proper way to set a minimal window size.
50 // Hence, we just ignore the corresponding EmuWindow hint. 50 // Hence, we just ignore the corresponding EmuWindow hint.
@@ -149,7 +149,7 @@ void EmuWindow_GLFW::OnMinimalClientAreaChangeRequest(const std::pair<unsigned,u
149 std::pair<int,int> current_size; 149 std::pair<int,int> current_size;
150 glfwGetWindowSize(m_render_window, &current_size.first, &current_size.second); 150 glfwGetWindowSize(m_render_window, &current_size.first, &current_size.second);
151 151
152 _dbg_assert_(Frontend, (int)minimal_size.first > 0 && (int)minimal_size.second > 0); 152 DEBUG_ASSERT((int)minimal_size.first > 0 && (int)minimal_size.second > 0);
153 int new_width = std::max(current_size.first, (int)minimal_size.first); 153 int new_width = std::max(current_size.first, (int)minimal_size.first);
154 int new_height = std::max(current_size.second, (int)minimal_size.second); 154 int new_height = std::max(current_size.second, (int)minimal_size.second);
155 155
diff --git a/src/citra_qt/config/controller_config.cpp b/src/citra_qt/config/controller_config.cpp
index 892995bb2..512879f1b 100644
--- a/src/citra_qt/config/controller_config.cpp
+++ b/src/citra_qt/config/controller_config.cpp
@@ -92,4 +92,4 @@ void GControllerConfigDialog::EnableChanges()
92 } 92 }
93} 93}
94 94
95*/ \ No newline at end of file 95*/
diff --git a/src/citra_qt/debugger/graphics_breakpoints.cpp b/src/citra_qt/debugger/graphics_breakpoints.cpp
index 262e2e770..92348be34 100644
--- a/src/citra_qt/debugger/graphics_breakpoints.cpp
+++ b/src/citra_qt/debugger/graphics_breakpoints.cpp
@@ -47,7 +47,7 @@ QVariant BreakPointModel::data(const QModelIndex& index, int role) const
47 { Pica::DebugContext::Event::VertexLoaded, tr("Vertex loaded") } 47 { Pica::DebugContext::Event::VertexLoaded, tr("Vertex loaded") }
48 }; 48 };
49 49
50 _dbg_assert_(Debug_GPU, map.size() == static_cast<size_t>(Pica::DebugContext::Event::NumEvents)); 50 DEBUG_ASSERT(map.size() == static_cast<size_t>(Pica::DebugContext::Event::NumEvents));
51 51
52 return (map.find(event) != map.end()) ? map.at(event) : QString(); 52 return (map.find(event) != map.end()) ? map.at(event) : QString();
53 } 53 }
diff --git a/src/citra_qt/debugger/ramview.cpp b/src/citra_qt/debugger/ramview.cpp
index 2b199bad1..88570f2cd 100644
--- a/src/citra_qt/debugger/ramview.cpp
+++ b/src/citra_qt/debugger/ramview.cpp
@@ -14,4 +14,4 @@ void GRamView::OnCPUStepped()
14{ 14{
15 // TODO: QHexEdit doesn't show vertical scroll bars for > 10MB data streams... 15 // TODO: QHexEdit doesn't show vertical scroll bars for > 10MB data streams...
16 //setData(QByteArray((const char*)Mem_RAM,sizeof(Mem_RAM)/8)); 16 //setData(QByteArray((const char*)Mem_RAM,sizeof(Mem_RAM)/8));
17} \ No newline at end of file 17}
diff --git a/src/citra_qt/util/spinbox.cpp b/src/citra_qt/util/spinbox.cpp
index 1e3767c18..2e2076a27 100644
--- a/src/citra_qt/util/spinbox.cpp
+++ b/src/citra_qt/util/spinbox.cpp
@@ -32,8 +32,7 @@
32#include <QLineEdit> 32#include <QLineEdit>
33#include <QRegExpValidator> 33#include <QRegExpValidator>
34 34
35#include "common/log.h" 35#include "common/assert.h"
36
37#include "spinbox.h" 36#include "spinbox.h"
38 37
39CSpinBox::CSpinBox(QWidget* parent) : QAbstractSpinBox(parent), min_value(-100), max_value(100), value(0), base(10), num_digits(0) 38CSpinBox::CSpinBox(QWidget* parent) : QAbstractSpinBox(parent), min_value(-100), max_value(100), value(0), base(10), num_digits(0)
@@ -244,7 +243,7 @@ QValidator::State CSpinBox::validate(QString& input, int& pos) const
244 if (strpos >= input.length() - HasSign() - suffix.length()) 243 if (strpos >= input.length() - HasSign() - suffix.length())
245 return QValidator::Intermediate; 244 return QValidator::Intermediate;
246 245
247 _dbg_assert_(Frontend, base <= 10 || base == 16); 246 DEBUG_ASSERT(base <= 10 || base == 16);
248 QString regexp; 247 QString regexp;
249 248
250 // Demand sign character for negative ranges 249 // Demand sign character for negative ranges
diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt
index 3c3419bbc..8c87deaa4 100644
--- a/src/common/CMakeLists.txt
+++ b/src/common/CMakeLists.txt
@@ -26,6 +26,7 @@ set(SRCS
26 ) 26 )
27 27
28set(HEADERS 28set(HEADERS
29 assert.h
29 bit_field.h 30 bit_field.h
30 break_points.h 31 break_points.h
31 chunk_file.h 32 chunk_file.h
@@ -44,7 +45,6 @@ set(HEADERS
44 hash.h 45 hash.h
45 key_map.h 46 key_map.h
46 linear_disk_cache.h 47 linear_disk_cache.h
47 log.h
48 logging/text_formatter.h 48 logging/text_formatter.h
49 logging/filter.h 49 logging/filter.h
50 logging/log.h 50 logging/log.h
diff --git a/src/common/assert.h b/src/common/assert.h
new file mode 100644
index 000000000..3b2232a7e
--- /dev/null
+++ b/src/common/assert.h
@@ -0,0 +1,36 @@
1// Copyright 2013 Dolphin Emulator Project / 2014 Citra Emulator Project
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#pragma once
6
7#include "common/common_funcs.h"
8
9// TODO (yuriks) allow synchronous logging so we don't need printf
10#define ASSERT(_a_) \
11 do if (!(_a_)) {\
12 fprintf(stderr, "Assertion Failed!\n\n Line: %d\n File: %s\n Time: %s\n", \
13 __LINE__, __FILE__, __TIME__); \
14 Crash(); \
15 } while (0)
16
17#define ASSERT_MSG(_a_, ...) \
18 do if (!(_a_)) {\
19 fprintf(stderr, "Assertion Failed!\n\n Line: %d\n File: %s\n Time: %s\n", \
20 __LINE__, __FILE__, __TIME__); \
21 fprintf(stderr, __VA_ARGS__); \
22 fprintf(stderr, "\n"); \
23 Crash(); \
24 } while (0)
25
26#define UNREACHABLE() ASSERT_MSG(false, "Unreachable code!")
27
28#ifdef _DEBUG
29#define DEBUG_ASSERT(_a_) ASSERT(_a_)
30#define DEBUG_ASSERT_MSG(_a_, ...) ASSERT_MSG(_a_, __VA_ARGS__)
31#else // not debug
32#define DEBUG_ASSERT(_a_)
33#define DEBUG_ASSERT_MSG(_a_, _desc_, ...)
34#endif
35
36#define UNIMPLEMENTED() DEBUG_ASSERT_MSG(false, "Unimplemented code!")
diff --git a/src/common/break_points.cpp b/src/common/break_points.cpp
index 6696935fa..2655d3ce9 100644
--- a/src/common/break_points.cpp
+++ b/src/common/break_points.cpp
@@ -5,6 +5,7 @@
5#include "common/common.h" 5#include "common/common.h"
6#include "common/debug_interface.h" 6#include "common/debug_interface.h"
7#include "common/break_points.h" 7#include "common/break_points.h"
8#include "common/logging/log.h"
8 9
9#include <sstream> 10#include <sstream>
10#include <algorithm> 11#include <algorithm>
diff --git a/src/common/chunk_file.h b/src/common/chunk_file.h
index 39a14dc81..dc27da088 100644
--- a/src/common/chunk_file.h
+++ b/src/common/chunk_file.h
@@ -180,7 +180,7 @@ public:
180 case MODE_MEASURE: break; // MODE_MEASURE - don't need to do anything 180 case MODE_MEASURE: break; // MODE_MEASURE - don't need to do anything
181 case MODE_VERIFY: 181 case MODE_VERIFY:
182 for (int i = 0; i < size; i++) { 182 for (int i = 0; i < size; i++) {
183 _dbg_assert_msg_(Common, ((u8*)data)[i] == (*ptr)[i], 183 DEBUG_ASSERT_MSG(((u8*)data)[i] == (*ptr)[i],
184 "Savestate verification failure: %d (0x%X) (at %p) != %d (0x%X) (at %p).\n", 184 "Savestate verification failure: %d (0x%X) (at %p) != %d (0x%X) (at %p).\n",
185 ((u8*)data)[i], ((u8*)data)[i], &((u8*)data)[i], 185 ((u8*)data)[i], ((u8*)data)[i], &((u8*)data)[i],
186 (*ptr)[i], (*ptr)[i], &(*ptr)[i]); 186 (*ptr)[i], (*ptr)[i], &(*ptr)[i]);
@@ -200,7 +200,7 @@ public:
200 case MODE_MEASURE: break; // MODE_MEASURE - don't need to do anything 200 case MODE_MEASURE: break; // MODE_MEASURE - don't need to do anything
201 case MODE_VERIFY: 201 case MODE_VERIFY:
202 for (int i = 0; i < size; i++) { 202 for (int i = 0; i < size; i++) {
203 _dbg_assert_msg_(Common, ((u8*)data)[i] == (*ptr)[i], 203 DEBUG_ASSERT_MSG(((u8*)data)[i] == (*ptr)[i],
204 "Savestate verification failure: %d (0x%X) (at %p) != %d (0x%X) (at %p).\n", 204 "Savestate verification failure: %d (0x%X) (at %p) != %d (0x%X) (at %p).\n",
205 ((u8*)data)[i], ((u8*)data)[i], &((u8*)data)[i], 205 ((u8*)data)[i], ((u8*)data)[i], &((u8*)data)[i],
206 (*ptr)[i], (*ptr)[i], &(*ptr)[i]); 206 (*ptr)[i], (*ptr)[i], &(*ptr)[i]);
@@ -505,8 +505,7 @@ public:
505 case MODE_WRITE: memcpy(*ptr, x.c_str(), stringLen); break; 505 case MODE_WRITE: memcpy(*ptr, x.c_str(), stringLen); break;
506 case MODE_MEASURE: break; 506 case MODE_MEASURE: break;
507 case MODE_VERIFY: 507 case MODE_VERIFY:
508 _dbg_assert_msg_(Common, 508 DEBUG_ASSERT_MSG((x == (char*)*ptr),
509 !strcmp(x.c_str(), (char*)*ptr),
510 "Savestate verification failure: \"%s\" != \"%s\" (at %p).\n", 509 "Savestate verification failure: \"%s\" != \"%s\" (at %p).\n",
511 x.c_str(), (char*)*ptr, ptr); 510 x.c_str(), (char*)*ptr, ptr);
512 break; 511 break;
@@ -524,7 +523,7 @@ public:
524 case MODE_WRITE: memcpy(*ptr, x.c_str(), stringLen); break; 523 case MODE_WRITE: memcpy(*ptr, x.c_str(), stringLen); break;
525 case MODE_MEASURE: break; 524 case MODE_MEASURE: break;
526 case MODE_VERIFY: 525 case MODE_VERIFY:
527 _dbg_assert_msg_(Common, x == (wchar_t*)*ptr, 526 DEBUG_ASSERT_MSG((x == (wchar_t*)*ptr),
528 "Savestate verification failure: \"%ls\" != \"%ls\" (at %p).\n", 527 "Savestate verification failure: \"%ls\" != \"%ls\" (at %p).\n",
529 x.c_str(), (wchar_t*)*ptr, ptr); 528 x.c_str(), (wchar_t*)*ptr, ptr);
530 break; 529 break;
diff --git a/src/common/common.h b/src/common/common.h
index 3246c7797..ad2de6f2e 100644
--- a/src/common/common.h
+++ b/src/common/common.h
@@ -25,7 +25,8 @@ private:
25 NonCopyable& operator=(NonCopyable& other); 25 NonCopyable& operator=(NonCopyable& other);
26}; 26};
27 27
28#include "common/log.h" 28#include "common/assert.h"
29#include "common/logging/log.h"
29#include "common/common_types.h" 30#include "common/common_types.h"
30#include "common/msg_handler.h" 31#include "common/msg_handler.h"
31#include "common/common_funcs.h" 32#include "common/common_funcs.h"
diff --git a/src/common/common_funcs.h b/src/common/common_funcs.h
index 229eb74c9..44d8ae11f 100644
--- a/src/common/common_funcs.h
+++ b/src/common/common_funcs.h
@@ -44,15 +44,14 @@ template<> struct CompileTimeAssert<true> {};
44#include <sys/endian.h> 44#include <sys/endian.h>
45#endif 45#endif
46 46
47// go to debugger mode 47#if defined(__x86_64__) || defined(_M_X64)
48 #ifdef GEKKO 48#define Crash() __asm__ __volatile__("int $3")
49 #define Crash() 49#elif defined(_M_ARM)
50 #elif defined _M_GENERIC 50#define Crash() __asm__ __volatile__("trap")
51 #define Crash() { exit(1); } 51#else
52 #else 52#define Crash() exit(1)
53 #define Crash() {asm ("int $3");} 53#endif
54 #endif 54
55 #define ARRAYSIZE(A) (sizeof(A)/sizeof((A)[0]))
56// GCC 4.8 defines all the rotate functions now 55// GCC 4.8 defines all the rotate functions now
57// Small issue with GCC's lrotl/lrotr intrinsics is they are still 32bit while we require 64bit 56// Small issue with GCC's lrotl/lrotr intrinsics is they are still 32bit while we require 64bit
58#ifndef _rotl 57#ifndef _rotl
@@ -97,10 +96,10 @@ inline u64 _rotr64(u64 x, unsigned int shift){
97 #define LC_GLOBAL_LOCALE ((locale_t)-1) 96 #define LC_GLOBAL_LOCALE ((locale_t)-1)
98 #define LC_ALL_MASK LC_ALL 97 #define LC_ALL_MASK LC_ALL
99 #define LC_COLLATE_MASK LC_COLLATE 98 #define LC_COLLATE_MASK LC_COLLATE
100 #define LC_CTYPE_MASK LC_CTYPE 99 #define LC_CTYPE_MASK LC_CTYPE
101 #define LC_MONETARY_MASK LC_MONETARY 100 #define LC_MONETARY_MASK LC_MONETARY
102 #define LC_NUMERIC_MASK LC_NUMERIC 101 #define LC_NUMERIC_MASK LC_NUMERIC
103 #define LC_TIME_MASK LC_TIME 102 #define LC_TIME_MASK LC_TIME
104 103
105 inline locale_t uselocale(locale_t new_locale) 104 inline locale_t uselocale(locale_t new_locale)
106 { 105 {
@@ -136,14 +135,10 @@ inline u64 _rotr64(u64 x, unsigned int shift){
136 #define fstat64 _fstat64 135 #define fstat64 _fstat64
137 #define fileno _fileno 136 #define fileno _fileno
138 137
139 #if _M_IX86 138 extern "C" {
140 #define Crash() {__asm int 3} 139 __declspec(dllimport) void __stdcall DebugBreak(void);
141 #else 140 }
142extern "C" { 141 #define Crash() {DebugBreak();}
143 __declspec(dllimport) void __stdcall DebugBreak(void);
144}
145 #define Crash() {DebugBreak();}
146 #endif // M_IX86
147#endif // _MSC_VER ndef 142#endif // _MSC_VER ndef
148 143
149// Dolphin's min and max functions 144// Dolphin's min and max functions
diff --git a/src/common/common_types.h b/src/common/common_types.h
index 94e1406b1..1b453e7f5 100644
--- a/src/common/common_types.h
+++ b/src/common/common_types.h
@@ -28,6 +28,12 @@
28#include <cstdint> 28#include <cstdint>
29#include <cstdlib> 29#include <cstdlib>
30 30
31#ifdef _MSC_VER
32#ifndef __func__
33#define __func__ __FUNCTION__
34#endif
35#endif
36
31typedef std::uint8_t u8; ///< 8-bit unsigned byte 37typedef std::uint8_t u8; ///< 8-bit unsigned byte
32typedef std::uint16_t u16; ///< 16-bit unsigned short 38typedef std::uint16_t u16; ///< 16-bit unsigned short
33typedef std::uint32_t u32; ///< 32-bit unsigned word 39typedef std::uint32_t u32; ///< 32-bit unsigned word
diff --git a/src/common/concurrent_ring_buffer.h b/src/common/concurrent_ring_buffer.h
index 311bb01f4..fc18e6c86 100644
--- a/src/common/concurrent_ring_buffer.h
+++ b/src/common/concurrent_ring_buffer.h
@@ -11,7 +11,6 @@
11#include <thread> 11#include <thread>
12 12
13#include "common/common.h" // for NonCopyable 13#include "common/common.h" // for NonCopyable
14#include "common/log.h" // for _dbg_assert_
15 14
16namespace Common { 15namespace Common {
17 16
@@ -93,7 +92,7 @@ public:
93 return QUEUE_CLOSED; 92 return QUEUE_CLOSED;
94 } 93 }
95 } 94 }
96 _dbg_assert_(Common, CanRead()); 95 DEBUG_ASSERT(CanRead());
97 return PopInternal(dest, dest_len); 96 return PopInternal(dest, dest_len);
98 } 97 }
99 98
@@ -119,7 +118,7 @@ private:
119 size_t PopInternal(T* dest, size_t dest_len) { 118 size_t PopInternal(T* dest, size_t dest_len) {
120 size_t output_count = 0; 119 size_t output_count = 0;
121 while (output_count < dest_len && CanRead()) { 120 while (output_count < dest_len && CanRead()) {
122 _dbg_assert_(Common, CanRead()); 121 DEBUG_ASSERT(CanRead());
123 122
124 T* item = &Data()[reader_index]; 123 T* item = &Data()[reader_index];
125 T out_val = std::move(*item); 124 T out_val = std::move(*item);
diff --git a/src/common/log.h b/src/common/log.h
deleted file mode 100644
index b397cf14d..000000000
--- a/src/common/log.h
+++ /dev/null
@@ -1,56 +0,0 @@
1// Copyright 2013 Dolphin Emulator Project / 2014 Citra Emulator Project
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#pragma once
6
7#include "common/common_funcs.h"
8#include "common/msg_handler.h"
9#include "common/logging/log.h"
10
11#ifdef _MSC_VER
12#ifndef __func__
13#define __func__ __FUNCTION__
14#endif
15#endif
16
17#ifdef _DEBUG
18#define _dbg_assert_(_t_, _a_) \
19 if (!(_a_)) {\
20 LOG_CRITICAL(_t_, "Error...\n\n Line: %d\n File: %s\n Time: %s\n\nIgnore and continue?", \
21 __LINE__, __FILE__, __TIME__); \
22 if (!PanicYesNo("*** Assertion (see log)***\n")) {Crash();} \
23 }
24#define _dbg_assert_msg_(_t_, _a_, ...)\
25 if (!(_a_)) {\
26 LOG_CRITICAL(_t_, __VA_ARGS__); \
27 if (!PanicYesNo(__VA_ARGS__)) {Crash();} \
28 }
29#define _dbg_update_() Host_UpdateLogDisplay();
30
31#else // not debug
32#define _dbg_update_() ;
33
34#ifndef _dbg_assert_
35#define _dbg_assert_(_t_, _a_) {}
36#define _dbg_assert_msg_(_t_, _a_, _desc_, ...) {}
37#endif // dbg_assert
38#endif
39
40#define _assert_(_a_) _dbg_assert_(MASTER_LOG, _a_)
41
42#ifndef GEKKO
43#ifdef _MSC_VER
44#define _assert_msg_(_t_, _a_, _fmt_, ...) \
45 if (!(_a_)) {\
46 if (!PanicYesNo(_fmt_, __VA_ARGS__)) {Crash();} \
47 }
48#else // not msvc
49#define _assert_msg_(_t_, _a_, _fmt_, ...) \
50 if (!(_a_)) {\
51 if (!PanicYesNo(_fmt_, ##__VA_ARGS__)) {Crash();} \
52 }
53#endif // _WIN32
54#else // GEKKO
55#define _assert_msg_(_t_, _a_, _fmt_, ...)
56#endif \ No newline at end of file
diff --git a/src/common/logging/backend.cpp b/src/common/logging/backend.cpp
index 83ebb42d9..459b44135 100644
--- a/src/common/logging/backend.cpp
+++ b/src/common/logging/backend.cpp
@@ -4,7 +4,7 @@
4 4
5#include <algorithm> 5#include <algorithm>
6 6
7#include "common/log.h" // For _dbg_assert_ 7#include "common/assert.h"
8 8
9#include "common/logging/backend.h" 9#include "common/logging/backend.h"
10#include "common/logging/log.h" 10#include "common/logging/log.h"
@@ -67,7 +67,7 @@ Logger::Logger() {
67#undef SUB 67#undef SUB
68 68
69 // Ensures that ALL_LOG_CLASSES isn't missing any entries. 69 // Ensures that ALL_LOG_CLASSES isn't missing any entries.
70 _dbg_assert_(Log, all_classes.size() == (size_t)Class::Count); 70 DEBUG_ASSERT(all_classes.size() == (size_t)Class::Count);
71} 71}
72 72
73// GetClassName is a macro defined by Windows.h, grrr... 73// GetClassName is a macro defined by Windows.h, grrr...
diff --git a/src/common/msg_handler.h b/src/common/msg_handler.h
index 5a483ddb4..421f93e23 100644
--- a/src/common/msg_handler.h
+++ b/src/common/msg_handler.h
@@ -29,7 +29,6 @@ extern bool MsgAlert(bool yes_no, int Style, const char* format, ...)
29 ; 29 ;
30void SetEnableAlert(bool enable); 30void SetEnableAlert(bool enable);
31 31
32#ifndef GEKKO
33#ifdef _MSC_VER 32#ifdef _MSC_VER
34 #define SuccessAlert(format, ...) MsgAlert(false, INFORMATION, format, __VA_ARGS__) 33 #define SuccessAlert(format, ...) MsgAlert(false, INFORMATION, format, __VA_ARGS__)
35 #define PanicAlert(format, ...) MsgAlert(false, WARNING, format, __VA_ARGS__) 34 #define PanicAlert(format, ...) MsgAlert(false, WARNING, format, __VA_ARGS__)
@@ -55,16 +54,3 @@ void SetEnableAlert(bool enable);
55 #define AskYesNoT(format, ...) MsgAlert(true, QUESTION, format, ##__VA_ARGS__) 54 #define AskYesNoT(format, ...) MsgAlert(true, QUESTION, format, ##__VA_ARGS__)
56 #define CriticalAlertT(format, ...) MsgAlert(false, CRITICAL, format, ##__VA_ARGS__) 55 #define CriticalAlertT(format, ...) MsgAlert(false, CRITICAL, format, ##__VA_ARGS__)
57#endif 56#endif
58#else
59// GEKKO
60 #define SuccessAlert(format, ...) ;
61 #define PanicAlert(format, ...) ;
62 #define PanicYesNo(format, ...) ;
63 #define AskYesNo(format, ...) ;
64 #define CriticalAlert(format, ...) ;
65 #define SuccessAlertT(format, ...) ;
66 #define PanicAlertT(format, ...) ;
67 #define PanicYesNoT(format, ...) ;
68 #define AskYesNoT(format, ...) ;
69 #define CriticalAlertT(format, ...) ;
70#endif
diff --git a/src/common/scope_exit.h b/src/common/scope_exit.h
index 77dcbaa22..08f09a8c8 100644
--- a/src/common/scope_exit.h
+++ b/src/common/scope_exit.h
@@ -5,6 +5,7 @@
5#pragma once 5#pragma once
6 6
7#include "common/common_funcs.h" 7#include "common/common_funcs.h"
8#include <utility>
8 9
9namespace detail { 10namespace detail {
10 template <typename Func> 11 template <typename Func>
diff --git a/src/common/symbols.cpp b/src/common/symbols.cpp
index 9e4dccfb3..f23e51c9d 100644
--- a/src/common/symbols.cpp
+++ b/src/common/symbols.cpp
@@ -54,4 +54,4 @@ namespace Symbols
54 { 54 {
55 g_symbols.clear(); 55 g_symbols.clear();
56 } 56 }
57} \ No newline at end of file 57}
diff --git a/src/common/utf8.cpp b/src/common/utf8.cpp
index 66a2f6339..56609634c 100644
--- a/src/common/utf8.cpp
+++ b/src/common/utf8.cpp
@@ -456,4 +456,4 @@ std::wstring ConvertUTF8ToWString(const std::string &source) {
456 return str; 456 return str;
457} 457}
458 458
459#endif \ No newline at end of file 459#endif
diff --git a/src/common/utf8.h b/src/common/utf8.h
index 6479ec5ad..a6e84913b 100644
--- a/src/common/utf8.h
+++ b/src/common/utf8.h
@@ -64,4 +64,4 @@ std::string ConvertWStringToUTF8(const wchar_t *wstr);
64void ConvertUTF8ToWString(wchar_t *dest, size_t destSize, const std::string &source); 64void ConvertUTF8ToWString(wchar_t *dest, size_t destSize, const std::string &source);
65std::wstring ConvertUTF8ToWString(const std::string &source); 65std::wstring ConvertUTF8ToWString(const std::string &source);
66 66
67#endif \ No newline at end of file 67#endif
diff --git a/src/core/arm/disassembler/arm_disasm.cpp b/src/core/arm/disassembler/arm_disasm.cpp
index 45c720e16..f7c7451e9 100644
--- a/src/core/arm/disassembler/arm_disasm.cpp
+++ b/src/core/arm/disassembler/arm_disasm.cpp
@@ -963,4 +963,4 @@ Opcode ARM_Disasm::DecodeALU(uint32_t insn) {
963 } 963 }
964 // Unreachable 964 // Unreachable
965 return OP_INVALID; 965 return OP_INVALID;
966} \ No newline at end of file 966}
diff --git a/src/core/arm/dyncom/arm_dyncom_run.cpp b/src/core/arm/dyncom/arm_dyncom_run.cpp
index d457d0ac5..15677da27 100644
--- a/src/core/arm/dyncom/arm_dyncom_run.cpp
+++ b/src/core/arm/dyncom/arm_dyncom_run.cpp
@@ -4,6 +4,7 @@
4 4
5#include <assert.h> 5#include <assert.h>
6 6
7#include "common/logging/log.h"
7#include "core/arm/skyeye_common/armdefs.h" 8#include "core/arm/skyeye_common/armdefs.h"
8 9
9void switch_mode(arm_core_t *core, uint32_t mode) { 10void switch_mode(arm_core_t *core, uint32_t mode) {
diff --git a/src/core/core_timing.cpp b/src/core/core_timing.cpp
index 3aebd7e9d..d96d3fe16 100644
--- a/src/core/core_timing.cpp
+++ b/src/core/core_timing.cpp
@@ -7,8 +7,8 @@
7#include <mutex> 7#include <mutex>
8#include <vector> 8#include <vector>
9 9
10#include "common/assert.h"
10#include "common/chunk_file.h" 11#include "common/chunk_file.h"
11#include "common/log.h"
12 12
13#include "core/arm/arm_interface.h" 13#include "core/arm/arm_interface.h"
14#include "core/core.h" 14#include "core/core.h"
diff --git a/src/core/hle/config_mem.cpp b/src/core/hle/config_mem.cpp
index 721a600b5..68d3071f5 100644
--- a/src/core/hle/config_mem.cpp
+++ b/src/core/hle/config_mem.cpp
@@ -3,7 +3,7 @@
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include "common/common_types.h" 5#include "common/common_types.h"
6#include "common/log.h" 6#include "common/logging/log.h"
7 7
8#include "core/hle/config_mem.h" 8#include "core/hle/config_mem.h"
9 9
diff --git a/src/core/hle/hle.cpp b/src/core/hle/hle.cpp
index 5a2edeb4a..97d73781f 100644
--- a/src/core/hle/hle.cpp
+++ b/src/core/hle/hle.cpp
@@ -45,7 +45,7 @@ void CallSVC(u32 opcode) {
45} 45}
46 46
47void Reschedule(const char *reason) { 47void Reschedule(const char *reason) {
48 _dbg_assert_msg_(Kernel, reason != 0 && strlen(reason) < 256, "Reschedule: Invalid or too long reason."); 48 DEBUG_ASSERT_MSG(reason != nullptr && strlen(reason) < 256, "Reschedule: Invalid or too long reason.");
49 49
50 // TODO(bunnei): It seems that games depend on some CPU execution time elapsing during HLE 50 // TODO(bunnei): It seems that games depend on some CPU execution time elapsing during HLE
51 // routines. This simulates that time by artificially advancing the number of CPU "ticks". 51 // routines. This simulates that time by artificially advancing the number of CPU "ticks".
diff --git a/src/core/hle/kernel/event.cpp b/src/core/hle/kernel/event.cpp
index 898e1c98f..420906ec0 100644
--- a/src/core/hle/kernel/event.cpp
+++ b/src/core/hle/kernel/event.cpp
@@ -32,7 +32,7 @@ bool Event::ShouldWait() {
32} 32}
33 33
34void Event::Acquire() { 34void Event::Acquire() {
35 _assert_msg_(Kernel, !ShouldWait(), "object unavailable!"); 35 ASSERT_MSG(!ShouldWait(), "object unavailable!");
36 36
37 // Release the event if it's not sticky... 37 // Release the event if it's not sticky...
38 if (reset_type != RESETTYPE_STICKY) 38 if (reset_type != RESETTYPE_STICKY)
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp
index a2ffbcdb7..eb61d8ef3 100644
--- a/src/core/hle/kernel/kernel.cpp
+++ b/src/core/hle/kernel/kernel.cpp
@@ -52,7 +52,7 @@ void WaitObject::WakeupAllWaitingThreads() {
52 for (auto thread : waiting_threads_copy) 52 for (auto thread : waiting_threads_copy)
53 thread->ReleaseWaitObject(this); 53 thread->ReleaseWaitObject(this);
54 54
55 _assert_msg_(Kernel, waiting_threads.empty(), "failed to awaken all waiting threads!"); 55 ASSERT_MSG(waiting_threads.empty(), "failed to awaken all waiting threads!");
56} 56}
57 57
58HandleTable::HandleTable() { 58HandleTable::HandleTable() {
@@ -61,7 +61,7 @@ HandleTable::HandleTable() {
61} 61}
62 62
63ResultVal<Handle> HandleTable::Create(SharedPtr<Object> obj) { 63ResultVal<Handle> HandleTable::Create(SharedPtr<Object> obj) {
64 _dbg_assert_(Kernel, obj != nullptr); 64 DEBUG_ASSERT(obj != nullptr);
65 65
66 u16 slot = next_free_slot; 66 u16 slot = next_free_slot;
67 if (slot >= generations.size()) { 67 if (slot >= generations.size()) {
diff --git a/src/core/hle/kernel/mutex.cpp b/src/core/hle/kernel/mutex.cpp
index a811db392..be2c49706 100644
--- a/src/core/hle/kernel/mutex.cpp
+++ b/src/core/hle/kernel/mutex.cpp
@@ -64,7 +64,7 @@ void Mutex::Acquire() {
64} 64}
65 65
66void Mutex::Acquire(SharedPtr<Thread> thread) { 66void Mutex::Acquire(SharedPtr<Thread> thread) {
67 _assert_msg_(Kernel, !ShouldWait(), "object unavailable!"); 67 ASSERT_MSG(!ShouldWait(), "object unavailable!");
68 68
69 // Actually "acquire" the mutex only if we don't already have it... 69 // Actually "acquire" the mutex only if we don't already have it...
70 if (lock_count == 0) { 70 if (lock_count == 0) {
diff --git a/src/core/hle/kernel/semaphore.cpp b/src/core/hle/kernel/semaphore.cpp
index c8cf8b9a2..6aecc24aa 100644
--- a/src/core/hle/kernel/semaphore.cpp
+++ b/src/core/hle/kernel/semaphore.cpp
@@ -36,7 +36,7 @@ bool Semaphore::ShouldWait() {
36} 36}
37 37
38void Semaphore::Acquire() { 38void Semaphore::Acquire() {
39 _assert_msg_(Kernel, !ShouldWait(), "object unavailable!"); 39 ASSERT_MSG(!ShouldWait(), "object unavailable!");
40 --available_count; 40 --available_count;
41} 41}
42 42
diff --git a/src/core/hle/kernel/session.h b/src/core/hle/kernel/session.h
index 7cc9332c9..9e9288e0f 100644
--- a/src/core/hle/kernel/session.h
+++ b/src/core/hle/kernel/session.h
@@ -66,7 +66,7 @@ public:
66 } 66 }
67 67
68 void Acquire() override { 68 void Acquire() override {
69 _assert_msg_(Kernel, !ShouldWait(), "object unavailable!"); 69 ASSERT_MSG(!ShouldWait(), "object unavailable!");
70 } 70 }
71}; 71};
72 72
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp
index 7f629c20e..f8c834a8d 100644
--- a/src/core/hle/kernel/thread.cpp
+++ b/src/core/hle/kernel/thread.cpp
@@ -29,7 +29,7 @@ bool Thread::ShouldWait() {
29} 29}
30 30
31void Thread::Acquire() { 31void Thread::Acquire() {
32 _assert_msg_(Kernel, !ShouldWait(), "object unavailable!"); 32 ASSERT_MSG(!ShouldWait(), "object unavailable!");
33} 33}
34 34
35// Lists all thread ids that aren't deleted/etc. 35// Lists all thread ids that aren't deleted/etc.
@@ -144,7 +144,7 @@ void ArbitrateAllThreads(u32 address) {
144 * @param new_thread The thread to switch to 144 * @param new_thread The thread to switch to
145 */ 145 */
146static void SwitchContext(Thread* new_thread) { 146static void SwitchContext(Thread* new_thread) {
147 _dbg_assert_msg_(Kernel, new_thread->status == THREADSTATUS_READY, "Thread must be ready to become running."); 147 DEBUG_ASSERT_MSG(new_thread->status == THREADSTATUS_READY, "Thread must be ready to become running.");
148 148
149 Thread* previous_thread = GetCurrentThread(); 149 Thread* previous_thread = GetCurrentThread();
150 150
@@ -304,14 +304,12 @@ void Thread::ResumeFromWait() {
304 break; 304 break;
305 case THREADSTATUS_RUNNING: 305 case THREADSTATUS_RUNNING:
306 case THREADSTATUS_READY: 306 case THREADSTATUS_READY:
307 LOG_ERROR(Kernel, "Thread with object id %u has already resumed.", GetObjectId()); 307 DEBUG_ASSERT_MSG(false, "Thread with object id %u has already resumed.", GetObjectId());
308 _dbg_assert_(Kernel, false);
309 return; 308 return;
310 case THREADSTATUS_DEAD: 309 case THREADSTATUS_DEAD:
311 // This should never happen, as threads must complete before being stopped. 310 // This should never happen, as threads must complete before being stopped.
312 LOG_CRITICAL(Kernel, "Thread with object id %u cannot be resumed because it's DEAD.", 311 DEBUG_ASSERT_MSG(false, "Thread with object id %u cannot be resumed because it's DEAD.",
313 GetObjectId()); 312 GetObjectId());
314 _dbg_assert_(Kernel, false);
315 return; 313 return;
316 } 314 }
317 315
@@ -387,7 +385,7 @@ ResultVal<SharedPtr<Thread>> Thread::Create(std::string name, VAddr entry_point,
387// TODO(peachum): Remove this. Range checking should be done, and an appropriate error should be returned. 385// TODO(peachum): Remove this. Range checking should be done, and an appropriate error should be returned.
388static void ClampPriority(const Thread* thread, s32* priority) { 386static void ClampPriority(const Thread* thread, s32* priority) {
389 if (*priority < THREADPRIO_HIGHEST || *priority > THREADPRIO_LOWEST) { 387 if (*priority < THREADPRIO_HIGHEST || *priority > THREADPRIO_LOWEST) {
390 _dbg_assert_msg_(Kernel, false, "Application passed an out of range priority. An error should be returned."); 388 DEBUG_ASSERT_MSG(false, "Application passed an out of range priority. An error should be returned.");
391 389
392 s32 new_priority = CLAMP(*priority, THREADPRIO_HIGHEST, THREADPRIO_LOWEST); 390 s32 new_priority = CLAMP(*priority, THREADPRIO_HIGHEST, THREADPRIO_LOWEST);
393 LOG_WARNING(Kernel_SVC, "(name=%s): invalid priority=%d, clamping to %d", 391 LOG_WARNING(Kernel_SVC, "(name=%s): invalid priority=%d, clamping to %d",
@@ -425,7 +423,7 @@ SharedPtr<Thread> SetupIdleThread() {
425} 423}
426 424
427SharedPtr<Thread> SetupMainThread(u32 stack_size, u32 entry_point, s32 priority) { 425SharedPtr<Thread> SetupMainThread(u32 stack_size, u32 entry_point, s32 priority) {
428 _dbg_assert_(Kernel, !GetCurrentThread()); 426 DEBUG_ASSERT(!GetCurrentThread());
429 427
430 // Initialize new "main" thread 428 // Initialize new "main" thread
431 auto thread_res = Thread::Create("main", entry_point, priority, 0, 429 auto thread_res = Thread::Create("main", entry_point, priority, 0,
diff --git a/src/core/hle/kernel/timer.cpp b/src/core/hle/kernel/timer.cpp
index 4352fc99c..aa0afb796 100644
--- a/src/core/hle/kernel/timer.cpp
+++ b/src/core/hle/kernel/timer.cpp
@@ -38,7 +38,7 @@ bool Timer::ShouldWait() {
38} 38}
39 39
40void Timer::Acquire() { 40void Timer::Acquire() {
41 _assert_msg_(Kernel, !ShouldWait(), "object unavailable!"); 41 ASSERT_MSG( !ShouldWait(), "object unavailable!");
42} 42}
43 43
44void Timer::Set(s64 initial, s64 interval) { 44void Timer::Set(s64 initial, s64 interval) {
diff --git a/src/core/hle/result.h b/src/core/hle/result.h
index 9c6ca29e5..9dbd5a914 100644
--- a/src/core/hle/result.h
+++ b/src/core/hle/result.h
@@ -363,7 +363,7 @@ public:
363 /// Asserts that the result succeeded and returns a reference to it. 363 /// Asserts that the result succeeded and returns a reference to it.
364 T& Unwrap() { 364 T& Unwrap() {
365 // TODO(yuriks): Should be a release assert 365 // TODO(yuriks): Should be a release assert
366 _assert_msg_(Common, Succeeded(), "Tried to Unwrap empty ResultVal"); 366 ASSERT_MSG(Succeeded(), "Tried to Unwrap empty ResultVal");
367 return **this; 367 return **this;
368 } 368 }
369 369
diff --git a/src/core/hle/service/ac_u.cpp b/src/core/hle/service/ac_u.cpp
index 53d920de1..50644816b 100644
--- a/src/core/hle/service/ac_u.cpp
+++ b/src/core/hle/service/ac_u.cpp
@@ -2,7 +2,7 @@
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 "common/log.h" 5#include "common/logging/log.h"
6#include "core/hle/hle.h" 6#include "core/hle/hle.h"
7#include "core/hle/service/ac_u.h" 7#include "core/hle/service/ac_u.h"
8 8
diff --git a/src/core/hle/service/act_u.cpp b/src/core/hle/service/act_u.cpp
index 4ea7a9fb2..57f49c91f 100644
--- a/src/core/hle/service/act_u.cpp
+++ b/src/core/hle/service/act_u.cpp
@@ -2,7 +2,6 @@
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 "common/log.h"
6#include "core/hle/hle.h" 5#include "core/hle/hle.h"
7#include "core/hle/service/act_u.h" 6#include "core/hle/service/act_u.h"
8 7
diff --git a/src/core/hle/service/am_app.cpp b/src/core/hle/service/am_app.cpp
index df10db87f..684b753f0 100644
--- a/src/core/hle/service/am_app.cpp
+++ b/src/core/hle/service/am_app.cpp
@@ -2,7 +2,6 @@
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 "common/log.h"
6#include "core/hle/hle.h" 5#include "core/hle/hle.h"
7#include "core/hle/service/am_app.h" 6#include "core/hle/service/am_app.h"
8 7
diff --git a/src/core/hle/service/am_net.cpp b/src/core/hle/service/am_net.cpp
index c74012d9d..ba2a499f1 100644
--- a/src/core/hle/service/am_net.cpp
+++ b/src/core/hle/service/am_net.cpp
@@ -2,7 +2,6 @@
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 "common/log.h"
6#include "core/hle/hle.h" 5#include "core/hle/hle.h"
7#include "core/hle/service/am_net.h" 6#include "core/hle/service/am_net.h"
8 7
diff --git a/src/core/hle/service/am_sys.cpp b/src/core/hle/service/am_sys.cpp
index c5df8abda..7ab89569f 100644
--- a/src/core/hle/service/am_sys.cpp
+++ b/src/core/hle/service/am_sys.cpp
@@ -2,7 +2,6 @@
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 "common/log.h"
6#include "core/hle/hle.h" 5#include "core/hle/hle.h"
7#include "core/hle/service/am_sys.h" 6#include "core/hle/service/am_sys.h"
8 7
diff --git a/src/core/hle/service/apt_a.cpp b/src/core/hle/service/apt_a.cpp
index e1dd2a5fb..1c1d92572 100644
--- a/src/core/hle/service/apt_a.cpp
+++ b/src/core/hle/service/apt_a.cpp
@@ -2,7 +2,6 @@
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 "common/log.h"
6#include "core/hle/hle.h" 5#include "core/hle/hle.h"
7#include "core/hle/service/apt_a.h" 6#include "core/hle/service/apt_a.h"
8 7
diff --git a/src/core/hle/service/apt_u.cpp b/src/core/hle/service/apt_u.cpp
index ccfd04591..12af5e9f7 100644
--- a/src/core/hle/service/apt_u.cpp
+++ b/src/core/hle/service/apt_u.cpp
@@ -79,7 +79,7 @@ void Initialize(Service::Interface* self) {
79 notification_event->Clear(); 79 notification_event->Clear();
80 pause_event->Signal(); // Fire start event 80 pause_event->Signal(); // Fire start event
81 81
82 _assert_msg_(KERNEL, (nullptr != lock), "Cannot initialize without lock"); 82 ASSERT_MSG((nullptr != lock), "Cannot initialize without lock");
83 lock->Release(); 83 lock->Release();
84 84
85 cmd_buff[1] = RESULT_SUCCESS.raw; // No error 85 cmd_buff[1] = RESULT_SUCCESS.raw; // No error
diff --git a/src/core/hle/service/boss_p.cpp b/src/core/hle/service/boss_p.cpp
index b3aa6acee..8280830e5 100644
--- a/src/core/hle/service/boss_p.cpp
+++ b/src/core/hle/service/boss_p.cpp
@@ -2,7 +2,6 @@
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 "common/log.h"
6#include "core/hle/hle.h" 5#include "core/hle/hle.h"
7#include "core/hle/service/boss_p.h" 6#include "core/hle/service/boss_p.h"
8 7
diff --git a/src/core/hle/service/boss_u.cpp b/src/core/hle/service/boss_u.cpp
index 50bb5d426..2c322bdfd 100644
--- a/src/core/hle/service/boss_u.cpp
+++ b/src/core/hle/service/boss_u.cpp
@@ -2,7 +2,6 @@
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 "common/log.h"
6#include "core/hle/hle.h" 5#include "core/hle/hle.h"
7#include "core/hle/service/boss_u.h" 6#include "core/hle/service/boss_u.h"
8 7
diff --git a/src/core/hle/service/cam_u.cpp b/src/core/hle/service/cam_u.cpp
index cf3b27664..fcfd87715 100644
--- a/src/core/hle/service/cam_u.cpp
+++ b/src/core/hle/service/cam_u.cpp
@@ -2,7 +2,6 @@
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 "common/log.h"
6#include "core/hle/hle.h" 5#include "core/hle/hle.h"
7#include "core/hle/service/cam_u.h" 6#include "core/hle/service/cam_u.h"
8 7
diff --git a/src/core/hle/service/cecd_s.cpp b/src/core/hle/service/cecd_s.cpp
index 2c707baff..b298f151d 100644
--- a/src/core/hle/service/cecd_s.cpp
+++ b/src/core/hle/service/cecd_s.cpp
@@ -2,7 +2,6 @@
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 "common/log.h"
6#include "core/hle/hle.h" 5#include "core/hle/hle.h"
7#include "core/hle/service/cecd_s.h" 6#include "core/hle/service/cecd_s.h"
8 7
diff --git a/src/core/hle/service/cecd_u.cpp b/src/core/hle/service/cecd_u.cpp
index b7ea3a186..9125364bc 100644
--- a/src/core/hle/service/cecd_u.cpp
+++ b/src/core/hle/service/cecd_u.cpp
@@ -2,7 +2,6 @@
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 "common/log.h"
6#include "core/hle/hle.h" 5#include "core/hle/hle.h"
7#include "core/hle/service/cecd_u.h" 6#include "core/hle/service/cecd_u.h"
8 7
diff --git a/src/core/hle/service/cfg/cfg.cpp b/src/core/hle/service/cfg/cfg.cpp
index 8812c49ef..1a2104b48 100644
--- a/src/core/hle/service/cfg/cfg.cpp
+++ b/src/core/hle/service/cfg/cfg.cpp
@@ -3,7 +3,6 @@
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include <algorithm> 5#include <algorithm>
6#include "common/log.h"
7#include "common/make_unique.h" 6#include "common/make_unique.h"
8#include "core/file_sys/archive_systemsavedata.h" 7#include "core/file_sys/archive_systemsavedata.h"
9#include "core/hle/service/cfg/cfg.h" 8#include "core/hle/service/cfg/cfg.h"
@@ -109,7 +108,7 @@ ResultCode UpdateConfigNANDSavegame() {
109 mode.create_flag = 1; 108 mode.create_flag = 1;
110 FileSys::Path path("config"); 109 FileSys::Path path("config");
111 auto file = cfg_system_save_data->OpenFile(path, mode); 110 auto file = cfg_system_save_data->OpenFile(path, mode);
112 _assert_msg_(Service_CFG, file != nullptr, "could not open file"); 111 ASSERT_MSG(file != nullptr, "could not open file");
113 file->Write(0, CONFIG_SAVEFILE_SIZE, 1, cfg_config_file_buffer.data()); 112 file->Write(0, CONFIG_SAVEFILE_SIZE, 1, cfg_config_file_buffer.data());
114 return RESULT_SUCCESS; 113 return RESULT_SUCCESS;
115} 114}
diff --git a/src/core/hle/service/cfg/cfg_i.cpp b/src/core/hle/service/cfg/cfg_i.cpp
index 555b7884a..20b09a8cb 100644
--- a/src/core/hle/service/cfg/cfg_i.cpp
+++ b/src/core/hle/service/cfg/cfg_i.cpp
@@ -2,7 +2,6 @@
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 "common/log.h"
6#include "core/hle/hle.h" 5#include "core/hle/hle.h"
7#include "core/hle/service/cfg/cfg.h" 6#include "core/hle/service/cfg/cfg.h"
8#include "core/hle/service/cfg/cfg_i.h" 7#include "core/hle/service/cfg/cfg_i.h"
diff --git a/src/core/hle/service/cfg/cfg_s.cpp b/src/core/hle/service/cfg/cfg_s.cpp
index 2170894d6..d80aeae8d 100644
--- a/src/core/hle/service/cfg/cfg_s.cpp
+++ b/src/core/hle/service/cfg/cfg_s.cpp
@@ -2,7 +2,6 @@
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 "common/log.h"
6#include "core/hle/hle.h" 5#include "core/hle/hle.h"
7#include "core/hle/service/cfg/cfg.h" 6#include "core/hle/service/cfg/cfg.h"
8#include "core/hle/service/cfg/cfg_s.h" 7#include "core/hle/service/cfg/cfg_s.h"
diff --git a/src/core/hle/service/cfg/cfg_u.cpp b/src/core/hle/service/cfg/cfg_u.cpp
index 5aa53cf75..4c5eac382 100644
--- a/src/core/hle/service/cfg/cfg_u.cpp
+++ b/src/core/hle/service/cfg/cfg_u.cpp
@@ -3,7 +3,6 @@
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include "common/file_util.h" 5#include "common/file_util.h"
6#include "common/log.h"
7#include "common/string_util.h" 6#include "common/string_util.h"
8#include "core/settings.h" 7#include "core/settings.h"
9#include "core/file_sys/archive_systemsavedata.h" 8#include "core/file_sys/archive_systemsavedata.h"
@@ -84,7 +83,7 @@ static void GetCountryCodeID(Service::Interface* self) {
84 u16 country_code_id = 0; 83 u16 country_code_id = 0;
85 84
86 // The following algorithm will fail if the first country code isn't 0. 85 // The following algorithm will fail if the first country code isn't 0.
87 _dbg_assert_(Service_CFG, country_codes[0] == 0); 86 DEBUG_ASSERT(country_codes[0] == 0);
88 87
89 for (size_t id = 0; id < country_codes.size(); ++id) { 88 for (size_t id = 0; id < country_codes.size(); ++id) {
90 if (country_codes[id] == country_code) { 89 if (country_codes[id] == country_code) {
diff --git a/src/core/hle/service/csnd_snd.cpp b/src/core/hle/service/csnd_snd.cpp
index 39b00982c..6a1d961ac 100644
--- a/src/core/hle/service/csnd_snd.cpp
+++ b/src/core/hle/service/csnd_snd.cpp
@@ -2,7 +2,6 @@
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 "common/log.h"
6#include "core/hle/hle.h" 5#include "core/hle/hle.h"
7#include "core/hle/service/csnd_snd.h" 6#include "core/hle/service/csnd_snd.h"
8 7
diff --git a/src/core/hle/service/dsp_dsp.cpp b/src/core/hle/service/dsp_dsp.cpp
index a720b63f3..db1e3b5fd 100644
--- a/src/core/hle/service/dsp_dsp.cpp
+++ b/src/core/hle/service/dsp_dsp.cpp
@@ -2,7 +2,6 @@
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 "common/log.h"
6#include "core/hle/hle.h" 5#include "core/hle/hle.h"
7#include "core/hle/kernel/event.h" 6#include "core/hle/kernel/event.h"
8#include "core/hle/service/dsp_dsp.h" 7#include "core/hle/service/dsp_dsp.h"
diff --git a/src/core/hle/service/err_f.cpp b/src/core/hle/service/err_f.cpp
index 962de2170..8d765acb5 100644
--- a/src/core/hle/service/err_f.cpp
+++ b/src/core/hle/service/err_f.cpp
@@ -2,7 +2,6 @@
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 "common/log.h"
6#include "core/hle/hle.h" 5#include "core/hle/hle.h"
7#include "core/hle/service/err_f.h" 6#include "core/hle/service/err_f.h"
8 7
diff --git a/src/core/hle/service/frd_a.cpp b/src/core/hle/service/frd_a.cpp
index 79140a756..569979319 100644
--- a/src/core/hle/service/frd_a.cpp
+++ b/src/core/hle/service/frd_a.cpp
@@ -2,7 +2,6 @@
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 "common/log.h"
6#include "core/hle/hle.h" 5#include "core/hle/hle.h"
7#include "core/hle/service/frd_a.h" 6#include "core/hle/service/frd_a.h"
8 7
diff --git a/src/core/hle/service/frd_u.cpp b/src/core/hle/service/frd_u.cpp
index 59faca77a..6d2ff1e21 100644
--- a/src/core/hle/service/frd_u.cpp
+++ b/src/core/hle/service/frd_u.cpp
@@ -2,7 +2,6 @@
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 "common/log.h"
6#include "core/hle/hle.h" 5#include "core/hle/hle.h"
7#include "core/hle/service/frd_u.h" 6#include "core/hle/service/frd_u.h"
8 7
diff --git a/src/core/hle/service/fs/archive.cpp b/src/core/hle/service/fs/archive.cpp
index e197d3599..37bcec219 100644
--- a/src/core/hle/service/fs/archive.cpp
+++ b/src/core/hle/service/fs/archive.cpp
@@ -261,7 +261,7 @@ ResultCode RegisterArchiveType(std::unique_ptr<FileSys::ArchiveFactory>&& factor
261 auto result = id_code_map.emplace(id_code, std::move(factory)); 261 auto result = id_code_map.emplace(id_code, std::move(factory));
262 262
263 bool inserted = result.second; 263 bool inserted = result.second;
264 _assert_msg_(Service_FS, inserted, "Tried to register more than one archive with same id code"); 264 ASSERT_MSG(inserted, "Tried to register more than one archive with same id code");
265 265
266 auto& archive = result.first->second; 266 auto& archive = result.first->second;
267 LOG_DEBUG(Service_FS, "Registered archive %s with id code 0x%08X", archive->GetName().c_str(), id_code); 267 LOG_DEBUG(Service_FS, "Registered archive %s with id code 0x%08X", archive->GetName().c_str(), id_code);
diff --git a/src/core/hle/service/gsp_gpu.cpp b/src/core/hle/service/gsp_gpu.cpp
index 359e41dd1..4c3ac845b 100644
--- a/src/core/hle/service/gsp_gpu.cpp
+++ b/src/core/hle/service/gsp_gpu.cpp
@@ -2,8 +2,6 @@
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
6#include "common/log.h"
7#include "common/bit_field.h" 5#include "common/bit_field.h"
8 6
9#include "core/mem_map.h" 7#include "core/mem_map.h"
@@ -36,7 +34,7 @@ static inline u8* GetCommandBuffer(u32 thread_id) {
36} 34}
37 35
38static inline FrameBufferUpdate* GetFrameBufferInfo(u32 thread_id, u32 screen_index) { 36static inline FrameBufferUpdate* GetFrameBufferInfo(u32 thread_id, u32 screen_index) {
39 _dbg_assert_msg_(Service_GSP, screen_index < 2, "Invalid screen index"); 37 DEBUG_ASSERT_MSG(screen_index < 2, "Invalid screen index");
40 38
41 // For each thread there are two FrameBufferUpdate fields 39 // For each thread there are two FrameBufferUpdate fields
42 u32 offset = 0x200 + (2 * thread_id + screen_index) * sizeof(FrameBufferUpdate); 40 u32 offset = 0x200 + (2 * thread_id + screen_index) * sizeof(FrameBufferUpdate);
@@ -186,7 +184,7 @@ static void RegisterInterruptRelayQueue(Service::Interface* self) {
186 u32 flags = cmd_buff[1]; 184 u32 flags = cmd_buff[1];
187 185
188 g_interrupt_event = Kernel::g_handle_table.Get<Kernel::Event>(cmd_buff[3]); 186 g_interrupt_event = Kernel::g_handle_table.Get<Kernel::Event>(cmd_buff[3]);
189 _assert_msg_(GSP, (g_interrupt_event != nullptr), "handle is not valid!"); 187 ASSERT_MSG((g_interrupt_event != nullptr), "handle is not valid!");
190 g_shared_memory = Kernel::SharedMemory::Create("GSPSharedMem"); 188 g_shared_memory = Kernel::SharedMemory::Create("GSPSharedMem");
191 189
192 Handle shmem_handle = Kernel::g_handle_table.Create(g_shared_memory).MoveFrom(); 190 Handle shmem_handle = Kernel::g_handle_table.Create(g_shared_memory).MoveFrom();
diff --git a/src/core/hle/service/gsp_lcd.cpp b/src/core/hle/service/gsp_lcd.cpp
index d63fa1ee2..9e36732b4 100644
--- a/src/core/hle/service/gsp_lcd.cpp
+++ b/src/core/hle/service/gsp_lcd.cpp
@@ -2,8 +2,6 @@
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
6#include "common/log.h"
7#include "common/bit_field.h" 5#include "common/bit_field.h"
8 6
9#include "core/hle/service/gsp_lcd.h" 7#include "core/hle/service/gsp_lcd.h"
diff --git a/src/core/hle/service/hid/hid_spvr.cpp b/src/core/hle/service/hid/hid_spvr.cpp
index 054aa8b59..8f06b224d 100644
--- a/src/core/hle/service/hid/hid_spvr.cpp
+++ b/src/core/hle/service/hid/hid_spvr.cpp
@@ -2,7 +2,6 @@
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 "common/log.h"
6#include "core/hle/hle.h" 5#include "core/hle/hle.h"
7#include "core/hle/service/hid/hid_spvr.h" 6#include "core/hle/service/hid/hid_spvr.h"
8 7
diff --git a/src/core/hle/service/hid/hid_user.cpp b/src/core/hle/service/hid/hid_user.cpp
index 68edafebb..7f464705f 100644
--- a/src/core/hle/service/hid/hid_user.cpp
+++ b/src/core/hle/service/hid/hid_user.cpp
@@ -2,8 +2,6 @@
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 "common/log.h"
6
7#include "core/hle/hle.h" 5#include "core/hle/hle.h"
8#include "core/hle/kernel/event.h" 6#include "core/hle/kernel/event.h"
9#include "core/hle/kernel/shared_memory.h" 7#include "core/hle/kernel/shared_memory.h"
diff --git a/src/core/hle/service/http_c.cpp b/src/core/hle/service/http_c.cpp
index 6595ca572..0a3aba0a0 100644
--- a/src/core/hle/service/http_c.cpp
+++ b/src/core/hle/service/http_c.cpp
@@ -2,7 +2,6 @@
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 "common/log.h"
6#include "core/hle/hle.h" 5#include "core/hle/hle.h"
7#include "core/hle/service/http_c.h" 6#include "core/hle/service/http_c.h"
8 7
diff --git a/src/core/hle/service/ir_rst.cpp b/src/core/hle/service/ir_rst.cpp
index 31da8e160..4c26c2f03 100644
--- a/src/core/hle/service/ir_rst.cpp
+++ b/src/core/hle/service/ir_rst.cpp
@@ -2,7 +2,6 @@
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 "common/log.h"
6#include "core/hle/hle.h" 5#include "core/hle/hle.h"
7#include "core/hle/service/ir_rst.h" 6#include "core/hle/service/ir_rst.h"
8 7
diff --git a/src/core/hle/service/ir_u.cpp b/src/core/hle/service/ir_u.cpp
index 7fa233048..608ed3c06 100644
--- a/src/core/hle/service/ir_u.cpp
+++ b/src/core/hle/service/ir_u.cpp
@@ -2,7 +2,6 @@
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 "common/log.h"
6#include "core/hle/hle.h" 5#include "core/hle/hle.h"
7#include "core/hle/service/ir_u.h" 6#include "core/hle/service/ir_u.h"
8 7
diff --git a/src/core/hle/service/ldr_ro.cpp b/src/core/hle/service/ldr_ro.cpp
index ea96f64af..c0c4a2344 100644
--- a/src/core/hle/service/ldr_ro.cpp
+++ b/src/core/hle/service/ldr_ro.cpp
@@ -2,7 +2,6 @@
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 "common/log.h"
6#include "core/hle/hle.h" 5#include "core/hle/hle.h"
7#include "core/hle/service/ldr_ro.h" 6#include "core/hle/service/ldr_ro.h"
8 7
diff --git a/src/core/hle/service/mic_u.cpp b/src/core/hle/service/mic_u.cpp
index af967b5b6..25e70d321 100644
--- a/src/core/hle/service/mic_u.cpp
+++ b/src/core/hle/service/mic_u.cpp
@@ -2,7 +2,6 @@
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 "common/log.h"
6#include "core/hle/hle.h" 5#include "core/hle/hle.h"
7#include "core/hle/service/mic_u.h" 6#include "core/hle/service/mic_u.h"
8 7
diff --git a/src/core/hle/service/news_s.cpp b/src/core/hle/service/news_s.cpp
index d7537875b..302d588c7 100644
--- a/src/core/hle/service/news_s.cpp
+++ b/src/core/hle/service/news_s.cpp
@@ -2,7 +2,6 @@
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 "common/log.h"
6#include "core/hle/hle.h" 5#include "core/hle/hle.h"
7#include "core/hle/service/news_s.h" 6#include "core/hle/service/news_s.h"
8 7
diff --git a/src/core/hle/service/news_u.cpp b/src/core/hle/service/news_u.cpp
index a9e161c23..7d835aa30 100644
--- a/src/core/hle/service/news_u.cpp
+++ b/src/core/hle/service/news_u.cpp
@@ -2,7 +2,6 @@
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 "common/log.h"
6#include "core/hle/hle.h" 5#include "core/hle/hle.h"
7#include "core/hle/service/news_u.h" 6#include "core/hle/service/news_u.h"
8 7
diff --git a/src/core/hle/service/nim_aoc.cpp b/src/core/hle/service/nim_aoc.cpp
index ab2ef4429..7a6aea91a 100644
--- a/src/core/hle/service/nim_aoc.cpp
+++ b/src/core/hle/service/nim_aoc.cpp
@@ -2,7 +2,6 @@
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 "common/log.h"
6#include "core/hle/hle.h" 5#include "core/hle/hle.h"
7#include "core/hle/service/nim_aoc.h" 6#include "core/hle/service/nim_aoc.h"
8 7
diff --git a/src/core/hle/service/nwm_uds.cpp b/src/core/hle/service/nwm_uds.cpp
index 61fcb54ce..88be6c8d9 100644
--- a/src/core/hle/service/nwm_uds.cpp
+++ b/src/core/hle/service/nwm_uds.cpp
@@ -2,7 +2,6 @@
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 "common/log.h"
6#include "core/hle/hle.h" 5#include "core/hle/hle.h"
7#include "core/hle/service/nwm_uds.h" 6#include "core/hle/service/nwm_uds.h"
8 7
diff --git a/src/core/hle/service/pm_app.cpp b/src/core/hle/service/pm_app.cpp
index d61eaf80f..7420a62f4 100644
--- a/src/core/hle/service/pm_app.cpp
+++ b/src/core/hle/service/pm_app.cpp
@@ -2,7 +2,6 @@
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 "common/log.h"
6#include "core/hle/hle.h" 5#include "core/hle/hle.h"
7#include "core/hle/service/pm_app.h" 6#include "core/hle/service/pm_app.h"
8 7
diff --git a/src/core/hle/service/ptm_play.cpp b/src/core/hle/service/ptm_play.cpp
index b357057fd..f21d9088e 100644
--- a/src/core/hle/service/ptm_play.cpp
+++ b/src/core/hle/service/ptm_play.cpp
@@ -2,7 +2,6 @@
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 "common/log.h"
6#include "core/hle/hle.h" 5#include "core/hle/hle.h"
7#include "core/hle/service/ptm_play.h" 6#include "core/hle/service/ptm_play.h"
8 7
diff --git a/src/core/hle/service/ptm_sysm.cpp b/src/core/hle/service/ptm_sysm.cpp
index b6f688de3..96ef2dce0 100644
--- a/src/core/hle/service/ptm_sysm.cpp
+++ b/src/core/hle/service/ptm_sysm.cpp
@@ -2,7 +2,6 @@
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 "common/log.h"
6#include "common/make_unique.h" 5#include "common/make_unique.h"
7#include "core/file_sys/archive_extsavedata.h" 6#include "core/file_sys/archive_extsavedata.h"
8#include "core/hle/hle.h" 7#include "core/hle/hle.h"
diff --git a/src/core/hle/service/ptm_u.cpp b/src/core/hle/service/ptm_u.cpp
index 7c8d9ce8c..7121d837c 100644
--- a/src/core/hle/service/ptm_u.cpp
+++ b/src/core/hle/service/ptm_u.cpp
@@ -2,7 +2,6 @@
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 "common/log.h"
6#include "common/make_unique.h" 5#include "common/make_unique.h"
7 6
8#include "core/hle/hle.h" 7#include "core/hle/hle.h"
@@ -148,7 +147,7 @@ Interface::Interface() {
148 Service::FS::FormatArchive(Service::FS::ArchiveIdCode::SharedExtSaveData, archive_path); 147 Service::FS::FormatArchive(Service::FS::ArchiveIdCode::SharedExtSaveData, archive_path);
149 // Open it again to get a valid archive now that the folder exists 148 // Open it again to get a valid archive now that the folder exists
150 archive_result = Service::FS::OpenArchive(Service::FS::ArchiveIdCode::SharedExtSaveData, archive_path); 149 archive_result = Service::FS::OpenArchive(Service::FS::ArchiveIdCode::SharedExtSaveData, archive_path);
151 _assert_msg_(Service_PTM, archive_result.Succeeded(), "Could not open the PTM SharedExtSaveData archive!"); 150 ASSERT_MSG(archive_result.Succeeded(), "Could not open the PTM SharedExtSaveData archive!");
152 151
153 FileSys::Path gamecoin_path("gamecoin.dat"); 152 FileSys::Path gamecoin_path("gamecoin.dat");
154 FileSys::Mode open_mode = {}; 153 FileSys::Mode open_mode = {};
diff --git a/src/core/hle/service/soc_u.cpp b/src/core/hle/service/soc_u.cpp
index 414c53c54..231ead185 100644
--- a/src/core/hle/service/soc_u.cpp
+++ b/src/core/hle/service/soc_u.cpp
@@ -29,7 +29,6 @@
29#include <poll.h> 29#include <poll.h>
30#endif 30#endif
31 31
32#include "common/log.h"
33#include "common/scope_exit.h" 32#include "common/scope_exit.h"
34#include "core/hle/hle.h" 33#include "core/hle/hle.h"
35#include "core/hle/service/soc_u.h" 34#include "core/hle/service/soc_u.h"
@@ -259,7 +258,7 @@ union CTRSockAddr {
259 break; 258 break;
260 } 259 }
261 default: 260 default:
262 _dbg_assert_msg_(Service_SOC, false, "Unhandled address family (sa_family) in CTRSockAddr::ToPlatform"); 261 ASSERT_MSG(false, "Unhandled address family (sa_family) in CTRSockAddr::ToPlatform");
263 break; 262 break;
264 } 263 }
265 return result; 264 return result;
@@ -280,7 +279,7 @@ union CTRSockAddr {
280 break; 279 break;
281 } 280 }
282 default: 281 default:
283 _dbg_assert_msg_(Service_SOC, false, "Unhandled address family (sa_family) in CTRSockAddr::ToPlatform"); 282 ASSERT_MSG(false, "Unhandled address family (sa_family) in CTRSockAddr::ToPlatform");
284 break; 283 break;
285 } 284 }
286 return result; 285 return result;
diff --git a/src/core/hle/service/ssl_c.cpp b/src/core/hle/service/ssl_c.cpp
index 3f49c1c97..e634276fc 100644
--- a/src/core/hle/service/ssl_c.cpp
+++ b/src/core/hle/service/ssl_c.cpp
@@ -2,7 +2,6 @@
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 "common/log.h"
6#include "core/hle/hle.h" 5#include "core/hle/hle.h"
7#include "core/hle/service/ssl_c.h" 6#include "core/hle/service/ssl_c.h"
8 7
diff --git a/src/core/hle/service/y2r_u.cpp b/src/core/hle/service/y2r_u.cpp
index fc76d2721..a58e04d6d 100644
--- a/src/core/hle/service/y2r_u.cpp
+++ b/src/core/hle/service/y2r_u.cpp
@@ -2,7 +2,6 @@
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 "common/log.h"
6#include "core/hle/hle.h" 5#include "core/hle/hle.h"
7#include "core/hle/kernel/event.h" 6#include "core/hle/kernel/event.h"
8#include "core/hle/service/y2r_u.h" 7#include "core/hle/service/y2r_u.h"
diff --git a/src/core/hle/shared_page.cpp b/src/core/hle/shared_page.cpp
index 6033a53b4..f5f2a6858 100644
--- a/src/core/hle/shared_page.cpp
+++ b/src/core/hle/shared_page.cpp
@@ -3,7 +3,6 @@
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include "common/common_types.h" 5#include "common/common_types.h"
6#include "common/log.h"
7 6
8#include "core/core.h" 7#include "core/core.h"
9#include "core/mem_map.h" 8#include "core/mem_map.h"
diff --git a/src/core/hle/svc.cpp b/src/core/hle/svc.cpp
index 96da29923..17385f9b2 100644
--- a/src/core/hle/svc.cpp
+++ b/src/core/hle/svc.cpp
@@ -175,7 +175,7 @@ static ResultCode WaitSynchronizationN(s32* out, Handle* handles, s32 handle_cou
175 175
176 // NOTE: on real hardware, there is no nullptr check for 'out' (tested with firmware 4.4). If 176 // NOTE: on real hardware, there is no nullptr check for 'out' (tested with firmware 4.4). If
177 // this happens, the running application will crash. 177 // this happens, the running application will crash.
178 _assert_msg_(Kernel, out != nullptr, "invalid output pointer specified!"); 178 ASSERT_MSG(out != nullptr, "invalid output pointer specified!");
179 179
180 // Check if 'handle_count' is invalid 180 // Check if 'handle_count' is invalid
181 if (handle_count < 0) 181 if (handle_count < 0)
diff --git a/src/core/hw/hw.cpp b/src/core/hw/hw.cpp
index 503200629..a63ba6eeb 100644
--- a/src/core/hw/hw.cpp
+++ b/src/core/hw/hw.cpp
@@ -88,4 +88,4 @@ void Shutdown() {
88 LOG_DEBUG(HW, "shutdown OK"); 88 LOG_DEBUG(HW, "shutdown OK");
89} 89}
90 90
91} \ No newline at end of file 91}
diff --git a/src/core/mem_map_funcs.cpp b/src/core/mem_map_funcs.cpp
index 0e3b81b28..4f93c0e64 100644
--- a/src/core/mem_map_funcs.cpp
+++ b/src/core/mem_map_funcs.cpp
@@ -136,9 +136,9 @@ inline void Write(const VAddr vaddr, const T data) {
136 *(T*)&g_dsp_mem[vaddr - DSP_MEMORY_VADDR] = data; 136 *(T*)&g_dsp_mem[vaddr - DSP_MEMORY_VADDR] = data;
137 137
138 //} else if ((vaddr & 0xFFFF0000) == 0x1FF80000) { 138 //} else if ((vaddr & 0xFFFF0000) == 0x1FF80000) {
139 // _assert_msg_(MEMMAP, false, "umimplemented write to Configuration Memory"); 139 // ASSERT_MSG(MEMMAP, false, "umimplemented write to Configuration Memory");
140 //} else if ((vaddr & 0xFFFFF000) == 0x1FF81000) { 140 //} else if ((vaddr & 0xFFFFF000) == 0x1FF81000) {
141 // _assert_msg_(MEMMAP, false, "umimplemented write to shared page"); 141 // ASSERT_MSG(MEMMAP, false, "umimplemented write to shared page");
142 142
143 // Error out... 143 // Error out...
144 } else { 144 } else {
diff --git a/src/video_core/debug_utils/debug_utils.cpp b/src/video_core/debug_utils/debug_utils.cpp
index 12f0009bd..8c4ec1044 100644
--- a/src/video_core/debug_utils/debug_utils.cpp
+++ b/src/video_core/debug_utils/debug_utils.cpp
@@ -16,7 +16,7 @@
16 16
17#include <nihstro/shader_binary.h> 17#include <nihstro/shader_binary.h>
18 18
19#include "common/log.h" 19#include "common/assert.h"
20#include "common/file_util.h" 20#include "common/file_util.h"
21#include "common/math_util.h" 21#include "common/math_util.h"
22 22
@@ -197,7 +197,7 @@ void DumpShader(const u32* binary_data, u32 binary_size, const u32* swizzle_data
197 it->component_mask = it->component_mask | component_mask; 197 it->component_mask = it->component_mask | component_mask;
198 } 198 }
199 } catch (const std::out_of_range& ) { 199 } catch (const std::out_of_range& ) {
200 _dbg_assert_msg_(HW_GPU, 0, "Unknown output attribute mapping"); 200 DEBUG_ASSERT_MSG(false, "Unknown output attribute mapping");
201 LOG_ERROR(HW_GPU, "Unknown output attribute mapping: %03x, %03x, %03x, %03x", 201 LOG_ERROR(HW_GPU, "Unknown output attribute mapping: %03x, %03x, %03x, %03x",
202 (int)output_attributes[i].map_x.Value(), 202 (int)output_attributes[i].map_x.Value(),
203 (int)output_attributes[i].map_y.Value(), 203 (int)output_attributes[i].map_y.Value(),
@@ -571,7 +571,7 @@ const Math::Vec4<u8> LookupTexture(const u8* source, int x, int y, const Texture
571 571
572 default: 572 default:
573 LOG_ERROR(HW_GPU, "Unknown texture format: %x", (u32)info.format); 573 LOG_ERROR(HW_GPU, "Unknown texture format: %x", (u32)info.format);
574 _dbg_assert_(HW_GPU, 0); 574 DEBUG_ASSERT(false);
575 return {}; 575 return {};
576 } 576 }
577} 577}
diff --git a/src/video_core/gpu_debugger.h b/src/video_core/gpu_debugger.h
index a51d49c92..c2c898992 100644
--- a/src/video_core/gpu_debugger.h
+++ b/src/video_core/gpu_debugger.h
@@ -8,8 +8,6 @@
8#include <functional> 8#include <functional>
9#include <vector> 9#include <vector>
10 10
11#include "common/log.h"
12
13#include "core/hle/service/gsp_gpu.h" 11#include "core/hle/service/gsp_gpu.h"
14 12
15#include "command_processor.h" 13#include "command_processor.h"
diff --git a/src/video_core/primitive_assembly.cpp b/src/video_core/primitive_assembly.cpp
index 242a07e26..1776a1925 100644
--- a/src/video_core/primitive_assembly.cpp
+++ b/src/video_core/primitive_assembly.cpp
@@ -6,6 +6,7 @@
6#include "primitive_assembly.h" 6#include "primitive_assembly.h"
7#include "vertex_shader.h" 7#include "vertex_shader.h"
8 8
9#include "common/logging/log.h"
9#include "video_core/debug_utils/debug_utils.h" 10#include "video_core/debug_utils/debug_utils.h"
10 11
11namespace Pica { 12namespace Pica {
diff --git a/src/video_core/rasterizer.cpp b/src/video_core/rasterizer.cpp
index 06fd8d140..617c767e7 100644
--- a/src/video_core/rasterizer.cpp
+++ b/src/video_core/rasterizer.cpp
@@ -216,7 +216,7 @@ void ProcessTriangle(const VertexShader::OutputVertex& v0,
216 if (!texture.enabled) 216 if (!texture.enabled)
217 continue; 217 continue;
218 218
219 _dbg_assert_(HW_GPU, 0 != texture.config.address); 219 DEBUG_ASSERT(0 != texture.config.address);
220 220
221 int s = (int)(uv[i].u() * float24::FromFloat32(static_cast<float>(texture.config.width))).ToFloat32(); 221 int s = (int)(uv[i].u() * float24::FromFloat32(static_cast<float>(texture.config.width))).ToFloat32();
222 int t = (int)(uv[i].v() * float24::FromFloat32(static_cast<float>(texture.config.height))).ToFloat32(); 222 int t = (int)(uv[i].v() * float24::FromFloat32(static_cast<float>(texture.config.height))).ToFloat32();
@@ -232,7 +232,7 @@ void ProcessTriangle(const VertexShader::OutputVertex& v0,
232 232
233 default: 233 default:
234 LOG_ERROR(HW_GPU, "Unknown texture coordinate wrapping mode %x\n", (int)mode); 234 LOG_ERROR(HW_GPU, "Unknown texture coordinate wrapping mode %x\n", (int)mode);
235 _dbg_assert_(HW_GPU, 0); 235 UNIMPLEMENTED();
236 return 0; 236 return 0;
237 } 237 }
238 }; 238 };
@@ -282,7 +282,7 @@ void ProcessTriangle(const VertexShader::OutputVertex& v0,
282 282
283 default: 283 default:
284 LOG_ERROR(HW_GPU, "Unknown color combiner source %d\n", (int)source); 284 LOG_ERROR(HW_GPU, "Unknown color combiner source %d\n", (int)source);
285 _dbg_assert_(HW_GPU, 0); 285 UNIMPLEMENTED();
286 return {}; 286 return {};
287 } 287 }
288 }; 288 };
@@ -380,7 +380,7 @@ void ProcessTriangle(const VertexShader::OutputVertex& v0,
380 380
381 default: 381 default:
382 LOG_ERROR(HW_GPU, "Unknown color combiner operation %d\n", (int)op); 382 LOG_ERROR(HW_GPU, "Unknown color combiner operation %d\n", (int)op);
383 _dbg_assert_(HW_GPU, 0); 383 UNIMPLEMENTED();
384 return {}; 384 return {};
385 } 385 }
386 }; 386 };
@@ -404,7 +404,7 @@ void ProcessTriangle(const VertexShader::OutputVertex& v0,
404 404
405 default: 405 default:
406 LOG_ERROR(HW_GPU, "Unknown alpha combiner operation %d\n", (int)op); 406 LOG_ERROR(HW_GPU, "Unknown alpha combiner operation %d\n", (int)op);
407 _dbg_assert_(HW_GPU, 0); 407 UNIMPLEMENTED();
408 return 0; 408 return 0;
409 } 409 }
410 }; 410 };
diff --git a/src/video_core/renderer_opengl/gl_shader_util.cpp b/src/video_core/renderer_opengl/gl_shader_util.cpp
index e982e3746..42d0e597c 100644
--- a/src/video_core/renderer_opengl/gl_shader_util.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_util.cpp
@@ -3,7 +3,7 @@
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include "gl_shader_util.h" 5#include "gl_shader_util.h"
6#include "common/log.h" 6#include "common/logging/log.h"
7 7
8#include <vector> 8#include <vector>
9#include <algorithm> 9#include <algorithm>
diff --git a/src/video_core/renderer_opengl/renderer_opengl.cpp b/src/video_core/renderer_opengl/renderer_opengl.cpp
index aa47bd616..735c0cf45 100644
--- a/src/video_core/renderer_opengl/renderer_opengl.cpp
+++ b/src/video_core/renderer_opengl/renderer_opengl.cpp
@@ -99,15 +99,15 @@ void RendererOpenGL::LoadFBToActiveGLTexture(const GPU::Regs::FramebufferConfig&
99 const u8* framebuffer_data = Memory::GetPointer(framebuffer_vaddr); 99 const u8* framebuffer_data = Memory::GetPointer(framebuffer_vaddr);
100 100
101 // TODO: Handle other pixel formats 101 // TODO: Handle other pixel formats
102 _dbg_assert_msg_(Render_OpenGL, framebuffer.color_format == GPU::Regs::PixelFormat::RGB8, 102 ASSERT_MSG(framebuffer.color_format == GPU::Regs::PixelFormat::RGB8,
103 "Unsupported 3DS pixel format."); 103 "Unsupported 3DS pixel format.");
104 104
105 size_t pixel_stride = framebuffer.stride / 3; 105 size_t pixel_stride = framebuffer.stride / 3;
106 // OpenGL only supports specifying a stride in units of pixels, not bytes, unfortunately 106 // OpenGL only supports specifying a stride in units of pixels, not bytes, unfortunately
107 _dbg_assert_(Render_OpenGL, pixel_stride * 3 == framebuffer.stride); 107 ASSERT(pixel_stride * 3 == framebuffer.stride);
108 // Ensure no bad interactions with GL_UNPACK_ALIGNMENT, which by default 108 // Ensure no bad interactions with GL_UNPACK_ALIGNMENT, which by default
109 // only allows rows to have a memory alignement of 4. 109 // only allows rows to have a memory alignement of 4.
110 _dbg_assert_(Render_OpenGL, pixel_stride % 4 == 0); 110 ASSERT(pixel_stride % 4 == 0);
111 111
112 glBindTexture(GL_TEXTURE_2D, texture.handle); 112 glBindTexture(GL_TEXTURE_2D, texture.handle);
113 glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint)pixel_stride); 113 glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint)pixel_stride);
diff --git a/src/video_core/vertex_shader.cpp b/src/video_core/vertex_shader.cpp
index 48977380e..0bd52231b 100644
--- a/src/video_core/vertex_shader.cpp
+++ b/src/video_core/vertex_shader.cpp
@@ -146,13 +146,10 @@ static void ProcessShaderCode(VertexShaderState& state) {
146 case Instruction::OpCodeType::Arithmetic: 146 case Instruction::OpCodeType::Arithmetic:
147 { 147 {
148 bool is_inverted = 0 != (instr.opcode.GetInfo().subtype & Instruction::OpCodeInfo::SrcInversed); 148 bool is_inverted = 0 != (instr.opcode.GetInfo().subtype & Instruction::OpCodeInfo::SrcInversed);
149 if (is_inverted) { 149 // TODO: We don't really support this properly: For instance, the address register
150 // TODO: We don't really support this properly: For instance, the address register 150 // offset needs to be applied to SRC2 instead, etc.
151 // offset needs to be applied to SRC2 instead, etc. 151 // For now, we just abort in this situation.
152 // For now, we just abort in this situation. 152 ASSERT_MSG(!is_inverted, "Bad condition...");
153 LOG_CRITICAL(HW_GPU, "Bad condition...");
154 exit(0);
155 }
156 153
157 const int address_offset = (instr.common.address_register_index == 0) 154 const int address_offset = (instr.common.address_register_index == 0)
158 ? 0 : state.address_registers[instr.common.address_register_index - 1]; 155 ? 0 : state.address_registers[instr.common.address_register_index - 1];
@@ -342,7 +339,7 @@ static void ProcessShaderCode(VertexShaderState& state) {
342 default: 339 default:
343 LOG_ERROR(HW_GPU, "Unhandled arithmetic instruction: 0x%02x (%s): 0x%08x", 340 LOG_ERROR(HW_GPU, "Unhandled arithmetic instruction: 0x%02x (%s): 0x%08x",
344 (int)instr.opcode.Value(), instr.opcode.GetInfo().name, instr.hex); 341 (int)instr.opcode.Value(), instr.opcode.GetInfo().name, instr.hex);
345 _dbg_assert_(HW_GPU, 0); 342 DEBUG_ASSERT(false);
346 break; 343 break;
347 } 344 }
348 345
diff --git a/src/video_core/video_core.cpp b/src/video_core/video_core.cpp
index c9707e5f1..0a236595c 100644
--- a/src/video_core/video_core.cpp
+++ b/src/video_core/video_core.cpp
@@ -4,7 +4,6 @@
4 4
5#include "common/common.h" 5#include "common/common.h"
6#include "common/emu_window.h" 6#include "common/emu_window.h"
7#include "common/log.h"
8 7
9#include "core/core.h" 8#include "core/core.h"
10 9