Sfoglia il codice sorgente

Asserts: break/crash program, fit to style guide; log.h->assert.h

Involves making asserts use printf instead of the log functions (log functions are asynchronous and, as such, the log won't be printed in time)
As such, the log type argument was removed (printf obviously can't use it, and it's made obsolete by the file and line printing)

Also removed some GEKKO cruft.
archshift 11 anni fa
parent
commit
ef24e72b26
88 ha cambiato i file con 135 aggiunte e 217 eliminazioni
  1. 1 1
      externals/boost
  2. 5 5
      src/citra/emu_window/emu_window_glfw.cpp
  3. 1 1
      src/citra_qt/config/controller_config.cpp
  4. 1 1
      src/citra_qt/debugger/graphics_breakpoints.cpp
  5. 1 1
      src/citra_qt/debugger/ramview.cpp
  6. 2 3
      src/citra_qt/util/spinbox.cpp
  7. 1 1
      src/common/CMakeLists.txt
  8. 36 0
      src/common/assert.h
  9. 1 0
      src/common/break_points.cpp
  10. 4 5
      src/common/chunk_file.h
  11. 2 1
      src/common/common.h
  12. 15 20
      src/common/common_funcs.h
  13. 6 0
      src/common/common_types.h
  14. 2 3
      src/common/concurrent_ring_buffer.h
  15. 0 56
      src/common/log.h
  16. 2 2
      src/common/logging/backend.cpp
  17. 0 14
      src/common/msg_handler.h
  18. 1 0
      src/common/scope_exit.h
  19. 1 1
      src/common/symbols.cpp
  20. 1 1
      src/common/utf8.cpp
  21. 1 1
      src/common/utf8.h
  22. 1 1
      src/core/arm/disassembler/arm_disasm.cpp
  23. 1 0
      src/core/arm/dyncom/arm_dyncom_run.cpp
  24. 1 1
      src/core/core_timing.cpp
  25. 1 1
      src/core/hle/config_mem.cpp
  26. 1 1
      src/core/hle/hle.cpp
  27. 1 1
      src/core/hle/kernel/event.cpp
  28. 2 2
      src/core/hle/kernel/kernel.cpp
  29. 1 1
      src/core/hle/kernel/mutex.cpp
  30. 1 1
      src/core/hle/kernel/semaphore.cpp
  31. 1 1
      src/core/hle/kernel/session.h
  32. 6 8
      src/core/hle/kernel/thread.cpp
  33. 1 1
      src/core/hle/kernel/timer.cpp
  34. 1 1
      src/core/hle/result.h
  35. 1 1
      src/core/hle/service/ac_u.cpp
  36. 0 1
      src/core/hle/service/act_u.cpp
  37. 0 1
      src/core/hle/service/am_app.cpp
  38. 0 1
      src/core/hle/service/am_net.cpp
  39. 0 1
      src/core/hle/service/am_sys.cpp
  40. 0 1
      src/core/hle/service/apt_a.cpp
  41. 1 1
      src/core/hle/service/apt_u.cpp
  42. 0 1
      src/core/hle/service/boss_p.cpp
  43. 0 1
      src/core/hle/service/boss_u.cpp
  44. 0 1
      src/core/hle/service/cam_u.cpp
  45. 0 1
      src/core/hle/service/cecd_s.cpp
  46. 0 1
      src/core/hle/service/cecd_u.cpp
  47. 1 2
      src/core/hle/service/cfg/cfg.cpp
  48. 0 1
      src/core/hle/service/cfg/cfg_i.cpp
  49. 0 1
      src/core/hle/service/cfg/cfg_s.cpp
  50. 1 2
      src/core/hle/service/cfg/cfg_u.cpp
  51. 0 1
      src/core/hle/service/csnd_snd.cpp
  52. 0 1
      src/core/hle/service/dsp_dsp.cpp
  53. 0 1
      src/core/hle/service/err_f.cpp
  54. 0 1
      src/core/hle/service/frd_a.cpp
  55. 0 1
      src/core/hle/service/frd_u.cpp
  56. 1 1
      src/core/hle/service/fs/archive.cpp
  57. 2 4
      src/core/hle/service/gsp_gpu.cpp
  58. 0 2
      src/core/hle/service/gsp_lcd.cpp
  59. 0 1
      src/core/hle/service/hid/hid_spvr.cpp
  60. 0 2
      src/core/hle/service/hid/hid_user.cpp
  61. 0 1
      src/core/hle/service/http_c.cpp
  62. 0 1
      src/core/hle/service/ir_rst.cpp
  63. 0 1
      src/core/hle/service/ir_u.cpp
  64. 0 1
      src/core/hle/service/ldr_ro.cpp
  65. 0 1
      src/core/hle/service/mic_u.cpp
  66. 0 1
      src/core/hle/service/news_s.cpp
  67. 0 1
      src/core/hle/service/news_u.cpp
  68. 0 1
      src/core/hle/service/nim_aoc.cpp
  69. 0 1
      src/core/hle/service/nwm_uds.cpp
  70. 0 1
      src/core/hle/service/pm_app.cpp
  71. 0 1
      src/core/hle/service/ptm_play.cpp
  72. 0 1
      src/core/hle/service/ptm_sysm.cpp
  73. 1 2
      src/core/hle/service/ptm_u.cpp
  74. 2 3
      src/core/hle/service/soc_u.cpp
  75. 0 1
      src/core/hle/service/ssl_c.cpp
  76. 0 1
      src/core/hle/service/y2r_u.cpp
  77. 0 1
      src/core/hle/shared_page.cpp
  78. 1 1
      src/core/hle/svc.cpp
  79. 1 1
      src/core/hw/hw.cpp
  80. 2 2
      src/core/mem_map_funcs.cpp
  81. 3 3
      src/video_core/debug_utils/debug_utils.cpp
  82. 0 2
      src/video_core/gpu_debugger.h
  83. 1 0
      src/video_core/primitive_assembly.cpp
  84. 5 5
      src/video_core/rasterizer.cpp
  85. 1 1
      src/video_core/renderer_opengl/gl_shader_util.cpp
  86. 3 3
      src/video_core/renderer_opengl/renderer_opengl.cpp
  87. 5 8
      src/video_core/vertex_shader.cpp
  88. 0 1
      src/video_core/video_core.cpp

+ 1 - 1
externals/boost

@@ -1 +1 @@
-Subproject commit 728a4d7d1c8b28355544ae829df9c4b5f28373c5
+Subproject commit a1afc91d3aaa3da06bdbc13c78613e1466653405

+ 5 - 5
src/citra/emu_window/emu_window_glfw.cpp

@@ -36,15 +36,15 @@ const bool EmuWindow_GLFW::IsOpen() {
 }
 
 void EmuWindow_GLFW::OnFramebufferResizeEvent(GLFWwindow* win, int width, int height) {
-    _dbg_assert_(Frontend, width > 0);
-    _dbg_assert_(Frontend, height > 0);
+    ASSERT(width > 0);
+    ASSERT(height > 0);
 
     GetEmuWindow(win)->NotifyFramebufferSizeChanged(std::pair<unsigned,unsigned>(width, height));
 }
 
 void EmuWindow_GLFW::OnClientAreaResizeEvent(GLFWwindow* win, int width, int height) {
-    _dbg_assert_(Frontend, width > 0);
-    _dbg_assert_(Frontend, height > 0);
+    ASSERT(width > 0);
+    ASSERT(height > 0);
 
     // NOTE: GLFW provides no proper way to set a minimal window size.
     //       Hence, we just ignore the corresponding EmuWindow hint.
@@ -149,7 +149,7 @@ void EmuWindow_GLFW::OnMinimalClientAreaChangeRequest(const std::pair<unsigned,u
     std::pair<int,int> current_size;
     glfwGetWindowSize(m_render_window, &current_size.first, &current_size.second);
 
-    _dbg_assert_(Frontend, (int)minimal_size.first > 0 && (int)minimal_size.second > 0);
+    DEBUG_ASSERT((int)minimal_size.first > 0 && (int)minimal_size.second > 0);
     int new_width  = std::max(current_size.first,  (int)minimal_size.first);
     int new_height = std::max(current_size.second, (int)minimal_size.second);
 

+ 1 - 1
src/citra_qt/config/controller_config.cpp

@@ -92,4 +92,4 @@ void GControllerConfigDialog::EnableChanges()
     }
 }
 
-*/
+*/

+ 1 - 1
src/citra_qt/debugger/graphics_breakpoints.cpp

@@ -47,7 +47,7 @@ QVariant BreakPointModel::data(const QModelIndex& index, int role) const
                 { Pica::DebugContext::Event::VertexLoaded, tr("Vertex loaded") }
             };
 
-            _dbg_assert_(Debug_GPU, map.size() == static_cast<size_t>(Pica::DebugContext::Event::NumEvents));
+            DEBUG_ASSERT(map.size() == static_cast<size_t>(Pica::DebugContext::Event::NumEvents));
 
             return (map.find(event) != map.end()) ? map.at(event) : QString();
         }

+ 1 - 1
src/citra_qt/debugger/ramview.cpp

@@ -14,4 +14,4 @@ void GRamView::OnCPUStepped()
 {
     // TODO: QHexEdit doesn't show vertical scroll bars for > 10MB data streams...
     //setData(QByteArray((const char*)Mem_RAM,sizeof(Mem_RAM)/8));
-}
+}

+ 2 - 3
src/citra_qt/util/spinbox.cpp

@@ -32,8 +32,7 @@
 #include <QLineEdit>
 #include <QRegExpValidator>
 
-#include "common/log.h"
-
+#include "common/assert.h"
 #include "spinbox.h"
 
 CSpinBox::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
     if (strpos >= input.length() - HasSign() - suffix.length())
         return QValidator::Intermediate;
 
-    _dbg_assert_(Frontend, base <= 10 || base == 16);
+    DEBUG_ASSERT(base <= 10 || base == 16);
     QString regexp;
 
     // Demand sign character for negative ranges

+ 1 - 1
src/common/CMakeLists.txt

@@ -26,6 +26,7 @@ set(SRCS
             )
 
 set(HEADERS
+            assert.h
             bit_field.h
             break_points.h
             chunk_file.h
@@ -44,7 +45,6 @@ set(HEADERS
             hash.h
             key_map.h
             linear_disk_cache.h
-            log.h
             logging/text_formatter.h
             logging/filter.h
             logging/log.h

+ 36 - 0
src/common/assert.h

@@ -0,0 +1,36 @@
+// Copyright 2013 Dolphin Emulator Project / 2014 Citra Emulator Project
+// Licensed under GPLv2 or any later version
+// Refer to the license.txt file included.
+
+#pragma once
+
+#include "common/common_funcs.h"
+
+// TODO (yuriks) allow synchronous logging so we don't need printf
+#define ASSERT(_a_) \
+    do if (!(_a_)) {\
+        fprintf(stderr, "Assertion Failed!\n\n  Line: %d\n  File: %s\n  Time: %s\n", \
+                     __LINE__, __FILE__, __TIME__); \
+        Crash(); \
+    } while (0)
+
+#define ASSERT_MSG(_a_, ...) \
+    do if (!(_a_)) {\
+        fprintf(stderr, "Assertion Failed!\n\n  Line: %d\n  File: %s\n  Time: %s\n", \
+                     __LINE__, __FILE__, __TIME__); \
+        fprintf(stderr, __VA_ARGS__); \
+        fprintf(stderr, "\n"); \
+        Crash(); \
+    } while (0)
+
+#define UNREACHABLE() ASSERT_MSG(false, "Unreachable code!")
+
+#ifdef _DEBUG
+#define DEBUG_ASSERT(_a_) ASSERT(_a_)
+#define DEBUG_ASSERT_MSG(_a_, ...) ASSERT_MSG(_a_, __VA_ARGS__)
+#else // not debug
+#define DEBUG_ASSERT(_a_)
+#define DEBUG_ASSERT_MSG(_a_, _desc_, ...)
+#endif
+
+#define UNIMPLEMENTED() DEBUG_ASSERT_MSG(false, "Unimplemented code!")

+ 1 - 0
src/common/break_points.cpp

@@ -5,6 +5,7 @@
 #include "common/common.h"
 #include "common/debug_interface.h"
 #include "common/break_points.h"
+#include "common/logging/log.h"
 
 #include <sstream>
 #include <algorithm>

+ 4 - 5
src/common/chunk_file.h

@@ -180,7 +180,7 @@ public:
         case MODE_MEASURE: break;  // MODE_MEASURE - don't need to do anything
         case MODE_VERIFY:
             for (int i = 0; i < size; i++) {
-                _dbg_assert_msg_(Common, ((u8*)data)[i] == (*ptr)[i],
+                DEBUG_ASSERT_MSG(((u8*)data)[i] == (*ptr)[i],
                     "Savestate verification failure: %d (0x%X) (at %p) != %d (0x%X) (at %p).\n",
                     ((u8*)data)[i], ((u8*)data)[i], &((u8*)data)[i],
                     (*ptr)[i], (*ptr)[i], &(*ptr)[i]);
@@ -200,7 +200,7 @@ public:
         case MODE_MEASURE: break;  // MODE_MEASURE - don't need to do anything
         case MODE_VERIFY:
             for (int i = 0; i < size; i++) {
-                _dbg_assert_msg_(Common, ((u8*)data)[i] == (*ptr)[i],
+                DEBUG_ASSERT_MSG(((u8*)data)[i] == (*ptr)[i],
                     "Savestate verification failure: %d (0x%X) (at %p) != %d (0x%X) (at %p).\n",
                     ((u8*)data)[i], ((u8*)data)[i], &((u8*)data)[i],
                     (*ptr)[i], (*ptr)[i], &(*ptr)[i]);
@@ -505,8 +505,7 @@ public:
         case MODE_WRITE:    memcpy(*ptr, x.c_str(), stringLen); break;
         case MODE_MEASURE: break;
         case MODE_VERIFY:
-            _dbg_assert_msg_(Common,
-                !strcmp(x.c_str(), (char*)*ptr),
+            DEBUG_ASSERT_MSG((x == (char*)*ptr),
                 "Savestate verification failure: \"%s\" != \"%s\" (at %p).\n",
                 x.c_str(), (char*)*ptr, ptr);
             break;
@@ -524,7 +523,7 @@ public:
         case MODE_WRITE:    memcpy(*ptr, x.c_str(), stringLen); break;
         case MODE_MEASURE: break;
         case MODE_VERIFY:
-            _dbg_assert_msg_(Common, x == (wchar_t*)*ptr,
+            DEBUG_ASSERT_MSG((x == (wchar_t*)*ptr),
                 "Savestate verification failure: \"%ls\" != \"%ls\" (at %p).\n",
                 x.c_str(), (wchar_t*)*ptr, ptr);
             break;

+ 2 - 1
src/common/common.h

@@ -25,7 +25,8 @@ private:
     NonCopyable& operator=(NonCopyable& other);
 };
 
-#include "common/log.h"
+#include "common/assert.h"
+#include "common/logging/log.h"
 #include "common/common_types.h"
 #include "common/msg_handler.h"
 #include "common/common_funcs.h"

+ 15 - 20
src/common/common_funcs.h

@@ -44,15 +44,14 @@ template<> struct CompileTimeAssert<true> {};
 #include <sys/endian.h>
 #endif
 
-// go to debugger mode
-    #ifdef GEKKO
-        #define Crash()
-    #elif defined _M_GENERIC
-        #define Crash() { exit(1); }
-    #else
-        #define Crash() {asm ("int $3");}
-    #endif
-    #define ARRAYSIZE(A) (sizeof(A)/sizeof((A)[0]))
+#if defined(__x86_64__) || defined(_M_X64)
+#define Crash() __asm__ __volatile__("int $3")
+#elif defined(_M_ARM)
+#define Crash() __asm__ __volatile__("trap")
+#else
+#define Crash() exit(1)
+#endif
+
 // GCC 4.8 defines all the rotate functions now
 // Small issue with GCC's lrotl/lrotr intrinsics is they are still 32bit while we require 64bit
 #ifndef _rotl
@@ -97,10 +96,10 @@ inline u64 _rotr64(u64 x, unsigned int shift){
     #define LC_GLOBAL_LOCALE    ((locale_t)-1)
     #define LC_ALL_MASK            LC_ALL
     #define LC_COLLATE_MASK        LC_COLLATE
-    #define LC_CTYPE_MASK        LC_CTYPE
-    #define LC_MONETARY_MASK    LC_MONETARY
+    #define LC_CTYPE_MASK          LC_CTYPE
+    #define LC_MONETARY_MASK       LC_MONETARY
     #define LC_NUMERIC_MASK        LC_NUMERIC
-    #define LC_TIME_MASK        LC_TIME
+    #define LC_TIME_MASK           LC_TIME
 
     inline locale_t uselocale(locale_t new_locale)
     {
@@ -136,14 +135,10 @@ inline u64 _rotr64(u64 x, unsigned int shift){
     #define fstat64 _fstat64
     #define fileno _fileno
 
-    #if _M_IX86
-        #define Crash() {__asm int 3}
-    #else
-extern "C" {
-    __declspec(dllimport) void __stdcall DebugBreak(void);
-}
-        #define Crash() {DebugBreak();}
-    #endif // M_IX86
+    extern "C" {
+        __declspec(dllimport) void __stdcall DebugBreak(void);
+    }
+    #define Crash() {DebugBreak();}
 #endif // _MSC_VER ndef
 
 // Dolphin's min and max functions

+ 6 - 0
src/common/common_types.h

@@ -28,6 +28,12 @@
 #include <cstdint>
 #include <cstdlib>
 
+#ifdef _MSC_VER
+#ifndef __func__
+#define __func__ __FUNCTION__
+#endif
+#endif
+
 typedef std::uint8_t  u8;  ///< 8-bit unsigned byte
 typedef std::uint16_t u16; ///< 16-bit unsigned short
 typedef std::uint32_t u32; ///< 32-bit unsigned word

+ 2 - 3
src/common/concurrent_ring_buffer.h

@@ -11,7 +11,6 @@
 #include <thread>
 
 #include "common/common.h" // for NonCopyable
-#include "common/log.h" // for _dbg_assert_
 
 namespace Common {
 
@@ -93,7 +92,7 @@ public:
                 return QUEUE_CLOSED;
             }
         }
-        _dbg_assert_(Common, CanRead());
+        DEBUG_ASSERT(CanRead());
         return PopInternal(dest, dest_len);
     }
 
@@ -119,7 +118,7 @@ private:
     size_t PopInternal(T* dest, size_t dest_len) {
         size_t output_count = 0;
         while (output_count < dest_len && CanRead()) {
-            _dbg_assert_(Common, CanRead());
+            DEBUG_ASSERT(CanRead());
 
             T* item = &Data()[reader_index];
             T out_val = std::move(*item);

+ 0 - 56
src/common/log.h

@@ -1,56 +0,0 @@
-// Copyright 2013 Dolphin Emulator Project / 2014 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#pragma once
-
-#include "common/common_funcs.h"
-#include "common/msg_handler.h"
-#include "common/logging/log.h"
-
-#ifdef _MSC_VER
-#ifndef __func__
-#define __func__ __FUNCTION__
-#endif
-#endif
-
-#ifdef _DEBUG
-#define _dbg_assert_(_t_, _a_) \
-    if (!(_a_)) {\
-        LOG_CRITICAL(_t_, "Error...\n\n  Line: %d\n  File: %s\n  Time: %s\n\nIgnore and continue?", \
-                       __LINE__, __FILE__, __TIME__); \
-        if (!PanicYesNo("*** Assertion (see log)***\n")) {Crash();} \
-    }
-#define _dbg_assert_msg_(_t_, _a_, ...)\
-    if (!(_a_)) {\
-        LOG_CRITICAL(_t_, __VA_ARGS__); \
-        if (!PanicYesNo(__VA_ARGS__)) {Crash();} \
-    }
-#define _dbg_update_() Host_UpdateLogDisplay();
-
-#else // not debug
-#define _dbg_update_() ;
-
-#ifndef _dbg_assert_
-#define _dbg_assert_(_t_, _a_) {}
-#define _dbg_assert_msg_(_t_, _a_, _desc_, ...) {}
-#endif // dbg_assert
-#endif
-
-#define _assert_(_a_) _dbg_assert_(MASTER_LOG, _a_)
-
-#ifndef GEKKO
-#ifdef _MSC_VER
-#define _assert_msg_(_t_, _a_, _fmt_, ...)        \
-    if (!(_a_)) {\
-        if (!PanicYesNo(_fmt_, __VA_ARGS__)) {Crash();} \
-    }
-#else // not msvc
-#define _assert_msg_(_t_, _a_, _fmt_, ...)        \
-    if (!(_a_)) {\
-        if (!PanicYesNo(_fmt_, ##__VA_ARGS__)) {Crash();} \
-    }
-#endif // _WIN32
-#else // GEKKO
-#define _assert_msg_(_t_, _a_, _fmt_, ...)
-#endif

+ 2 - 2
src/common/logging/backend.cpp

@@ -4,7 +4,7 @@
 
 #include <algorithm>
 
-#include "common/log.h" // For _dbg_assert_
+#include "common/assert.h"
 
 #include "common/logging/backend.h"
 #include "common/logging/log.h"
@@ -67,7 +67,7 @@ Logger::Logger() {
 #undef SUB
 
     // Ensures that ALL_LOG_CLASSES isn't missing any entries.
-    _dbg_assert_(Log, all_classes.size() == (size_t)Class::Count);
+    DEBUG_ASSERT(all_classes.size() == (size_t)Class::Count);
 }
 
 // GetClassName is a macro defined by Windows.h, grrr...

+ 0 - 14
src/common/msg_handler.h

@@ -29,7 +29,6 @@ extern bool MsgAlert(bool yes_no, int Style, const char* format, ...)
     ;
 void SetEnableAlert(bool enable);
 
-#ifndef GEKKO
 #ifdef _MSC_VER
     #define SuccessAlert(format, ...) MsgAlert(false, INFORMATION, format, __VA_ARGS__)
     #define PanicAlert(format, ...) MsgAlert(false, WARNING, format, __VA_ARGS__)
@@ -55,16 +54,3 @@ void SetEnableAlert(bool enable);
     #define AskYesNoT(format, ...) MsgAlert(true, QUESTION, format, ##__VA_ARGS__)
     #define CriticalAlertT(format, ...) MsgAlert(false, CRITICAL, format, ##__VA_ARGS__)
 #endif
-#else
-// GEKKO
-    #define SuccessAlert(format, ...) ;
-    #define PanicAlert(format, ...) ;
-    #define PanicYesNo(format, ...) ;
-    #define AskYesNo(format, ...) ;
-    #define CriticalAlert(format, ...) ;
-    #define SuccessAlertT(format, ...) ;
-    #define PanicAlertT(format, ...) ;
-    #define PanicYesNoT(format, ...) ;
-    #define AskYesNoT(format, ...) ;
-    #define CriticalAlertT(format, ...) ;
-#endif

+ 1 - 0
src/common/scope_exit.h

@@ -5,6 +5,7 @@
 #pragma once
 
 #include "common/common_funcs.h"
+#include <utility>
 
 namespace detail {
     template <typename Func>

+ 1 - 1
src/common/symbols.cpp

@@ -54,4 +54,4 @@ namespace Symbols
     {
         g_symbols.clear();
     }
-}
+}

+ 1 - 1
src/common/utf8.cpp

@@ -456,4 +456,4 @@ std::wstring ConvertUTF8ToWString(const std::string &source) {
     return str;
 }
 
-#endif
+#endif

+ 1 - 1
src/common/utf8.h

@@ -64,4 +64,4 @@ std::string ConvertWStringToUTF8(const wchar_t *wstr);
 void ConvertUTF8ToWString(wchar_t *dest, size_t destSize, const std::string &source);
 std::wstring ConvertUTF8ToWString(const std::string &source);
 
-#endif
+#endif

+ 1 - 1
src/core/arm/disassembler/arm_disasm.cpp

@@ -963,4 +963,4 @@ Opcode ARM_Disasm::DecodeALU(uint32_t insn) {
     }
     // Unreachable
     return OP_INVALID;
-}
+}

+ 1 - 0
src/core/arm/dyncom/arm_dyncom_run.cpp

@@ -4,6 +4,7 @@
 
 #include <assert.h>
 
+#include "common/logging/log.h"
 #include "core/arm/skyeye_common/armdefs.h"
 
 void switch_mode(arm_core_t *core, uint32_t mode) {

+ 1 - 1
src/core/core_timing.cpp

@@ -7,8 +7,8 @@
 #include <mutex>
 #include <vector>
 
+#include "common/assert.h"
 #include "common/chunk_file.h"
-#include "common/log.h"
 
 #include "core/arm/arm_interface.h"
 #include "core/core.h"

+ 1 - 1
src/core/hle/config_mem.cpp

@@ -3,7 +3,7 @@
 // Refer to the license.txt file included.
 
 #include "common/common_types.h"
-#include "common/log.h"
+#include "common/logging/log.h"
 
 #include "core/hle/config_mem.h"
 

+ 1 - 1
src/core/hle/hle.cpp

@@ -45,7 +45,7 @@ void CallSVC(u32 opcode) {
 }
 
 void Reschedule(const char *reason) {
-    _dbg_assert_msg_(Kernel, reason != 0 && strlen(reason) < 256, "Reschedule: Invalid or too long reason.");
+    DEBUG_ASSERT_MSG(reason != nullptr && strlen(reason) < 256, "Reschedule: Invalid or too long reason.");
 
     // TODO(bunnei): It seems that games depend on some CPU execution time elapsing during HLE
     // routines. This simulates that time by artificially advancing the number of CPU "ticks".

+ 1 - 1
src/core/hle/kernel/event.cpp

@@ -32,7 +32,7 @@ bool Event::ShouldWait() {
 }
 
 void Event::Acquire() {
-    _assert_msg_(Kernel, !ShouldWait(), "object unavailable!");
+    ASSERT_MSG(!ShouldWait(), "object unavailable!");
 
     // Release the event if it's not sticky...
     if (reset_type != RESETTYPE_STICKY)

+ 2 - 2
src/core/hle/kernel/kernel.cpp

@@ -52,7 +52,7 @@ void WaitObject::WakeupAllWaitingThreads() {
     for (auto thread : waiting_threads_copy)
         thread->ReleaseWaitObject(this);
 
-    _assert_msg_(Kernel, waiting_threads.empty(), "failed to awaken all waiting threads!");
+    ASSERT_MSG(waiting_threads.empty(), "failed to awaken all waiting threads!");
 }
 
 HandleTable::HandleTable() {
@@ -61,7 +61,7 @@ HandleTable::HandleTable() {
 }
 
 ResultVal<Handle> HandleTable::Create(SharedPtr<Object> obj) {
-    _dbg_assert_(Kernel, obj != nullptr);
+    DEBUG_ASSERT(obj != nullptr);
 
     u16 slot = next_free_slot;
     if (slot >= generations.size()) {

+ 1 - 1
src/core/hle/kernel/mutex.cpp

@@ -64,7 +64,7 @@ void Mutex::Acquire() {
 }
 
 void Mutex::Acquire(SharedPtr<Thread> thread) {
-    _assert_msg_(Kernel, !ShouldWait(), "object unavailable!");
+    ASSERT_MSG(!ShouldWait(), "object unavailable!");
 
     // Actually "acquire" the mutex only if we don't already have it...
     if (lock_count == 0) {

+ 1 - 1
src/core/hle/kernel/semaphore.cpp

@@ -36,7 +36,7 @@ bool Semaphore::ShouldWait() {
 }
 
 void Semaphore::Acquire() {
-    _assert_msg_(Kernel, !ShouldWait(), "object unavailable!");
+    ASSERT_MSG(!ShouldWait(), "object unavailable!");
     --available_count;
 }
 

+ 1 - 1
src/core/hle/kernel/session.h

@@ -66,7 +66,7 @@ public:
     }
 
     void Acquire() override {
-        _assert_msg_(Kernel, !ShouldWait(), "object unavailable!");
+        ASSERT_MSG(!ShouldWait(), "object unavailable!");
     }
 };
 

+ 6 - 8
src/core/hle/kernel/thread.cpp

@@ -29,7 +29,7 @@ bool Thread::ShouldWait() {
 }
 
 void Thread::Acquire() {
-    _assert_msg_(Kernel, !ShouldWait(), "object unavailable!");
+    ASSERT_MSG(!ShouldWait(), "object unavailable!");
 }
 
 // Lists all thread ids that aren't deleted/etc.
@@ -144,7 +144,7 @@ void ArbitrateAllThreads(u32 address) {
  * @param new_thread The thread to switch to
  */
 static void SwitchContext(Thread* new_thread) {
-    _dbg_assert_msg_(Kernel, new_thread->status == THREADSTATUS_READY, "Thread must be ready to become running.");
+    DEBUG_ASSERT_MSG(new_thread->status == THREADSTATUS_READY, "Thread must be ready to become running.");
 
     Thread* previous_thread = GetCurrentThread();
 
@@ -304,14 +304,12 @@ void Thread::ResumeFromWait() {
             break;
         case THREADSTATUS_RUNNING:
         case THREADSTATUS_READY:
-            LOG_ERROR(Kernel, "Thread with object id %u has already resumed.", GetObjectId());
-            _dbg_assert_(Kernel, false);
+            DEBUG_ASSERT_MSG(false, "Thread with object id %u has already resumed.", GetObjectId());
             return;
         case THREADSTATUS_DEAD:
             // This should never happen, as threads must complete before being stopped.
-            LOG_CRITICAL(Kernel, "Thread with object id %u cannot be resumed because it's DEAD.",
+            DEBUG_ASSERT_MSG(false, "Thread with object id %u cannot be resumed because it's DEAD.",
                 GetObjectId());
-            _dbg_assert_(Kernel, false);
             return;
     }
     
@@ -387,7 +385,7 @@ ResultVal<SharedPtr<Thread>> Thread::Create(std::string name, VAddr entry_point,
 // TODO(peachum): Remove this. Range checking should be done, and an appropriate error should be returned.
 static void ClampPriority(const Thread* thread, s32* priority) {
     if (*priority < THREADPRIO_HIGHEST || *priority > THREADPRIO_LOWEST) {
-        _dbg_assert_msg_(Kernel, false, "Application passed an out of range priority. An error should be returned.");
+        DEBUG_ASSERT_MSG(false, "Application passed an out of range priority. An error should be returned.");
 
         s32 new_priority = CLAMP(*priority, THREADPRIO_HIGHEST, THREADPRIO_LOWEST);
         LOG_WARNING(Kernel_SVC, "(name=%s): invalid priority=%d, clamping to %d",
@@ -425,7 +423,7 @@ SharedPtr<Thread> SetupIdleThread() {
 }
 
 SharedPtr<Thread> SetupMainThread(u32 stack_size, u32 entry_point, s32 priority) {
-    _dbg_assert_(Kernel, !GetCurrentThread());
+    DEBUG_ASSERT(!GetCurrentThread());
 
     // Initialize new "main" thread
     auto thread_res = Thread::Create("main", entry_point, priority, 0,

+ 1 - 1
src/core/hle/kernel/timer.cpp

@@ -38,7 +38,7 @@ bool Timer::ShouldWait() {
 }
 
 void Timer::Acquire() {
-    _assert_msg_(Kernel, !ShouldWait(), "object unavailable!");
+    ASSERT_MSG( !ShouldWait(), "object unavailable!");
 }
 
 void Timer::Set(s64 initial, s64 interval) {

+ 1 - 1
src/core/hle/result.h

@@ -363,7 +363,7 @@ public:
     /// Asserts that the result succeeded and returns a reference to it.
     T& Unwrap() {
         // TODO(yuriks): Should be a release assert
-        _assert_msg_(Common, Succeeded(), "Tried to Unwrap empty ResultVal");
+        ASSERT_MSG(Succeeded(), "Tried to Unwrap empty ResultVal");
         return **this;
     }
 

+ 1 - 1
src/core/hle/service/ac_u.cpp

@@ -2,7 +2,7 @@
 // Licensed under GPLv2 or any later version
 // Refer to the license.txt file included.
 
-#include "common/log.h"
+#include "common/logging/log.h"
 #include "core/hle/hle.h"
 #include "core/hle/service/ac_u.h"
 

+ 0 - 1
src/core/hle/service/act_u.cpp

@@ -2,7 +2,6 @@
 // Licensed under GPLv2 or any later version
 // Refer to the license.txt file included.
 
-#include "common/log.h"
 #include "core/hle/hle.h"
 #include "core/hle/service/act_u.h"
 

+ 0 - 1
src/core/hle/service/am_app.cpp

@@ -2,7 +2,6 @@
 // Licensed under GPLv2 or any later version
 // Refer to the license.txt file included.
 
-#include "common/log.h"
 #include "core/hle/hle.h"
 #include "core/hle/service/am_app.h"
 

+ 0 - 1
src/core/hle/service/am_net.cpp

@@ -2,7 +2,6 @@
 // Licensed under GPLv2 or any later version
 // Refer to the license.txt file included.
 
-#include "common/log.h"
 #include "core/hle/hle.h"
 #include "core/hle/service/am_net.h"
 

+ 0 - 1
src/core/hle/service/am_sys.cpp

@@ -2,7 +2,6 @@
 // Licensed under GPLv2 or any later version
 // Refer to the license.txt file included.
 
-#include "common/log.h"
 #include "core/hle/hle.h"
 #include "core/hle/service/am_sys.h"
 

+ 0 - 1
src/core/hle/service/apt_a.cpp

@@ -2,7 +2,6 @@
 // Licensed under GPLv2 or any later version
 // Refer to the license.txt file included.
 
-#include "common/log.h"
 #include "core/hle/hle.h"
 #include "core/hle/service/apt_a.h"
 

+ 1 - 1
src/core/hle/service/apt_u.cpp

@@ -79,7 +79,7 @@ void Initialize(Service::Interface* self) {
     notification_event->Clear();
     pause_event->Signal(); // Fire start event
 
-    _assert_msg_(KERNEL, (nullptr != lock), "Cannot initialize without lock");
+    ASSERT_MSG((nullptr != lock), "Cannot initialize without lock");
     lock->Release();
 
     cmd_buff[1] = RESULT_SUCCESS.raw; // No error

+ 0 - 1
src/core/hle/service/boss_p.cpp

@@ -2,7 +2,6 @@
 // Licensed under GPLv2 or any later version
 // Refer to the license.txt file included.
 
-#include "common/log.h"
 #include "core/hle/hle.h"
 #include "core/hle/service/boss_p.h"
 

+ 0 - 1
src/core/hle/service/boss_u.cpp

@@ -2,7 +2,6 @@
 // Licensed under GPLv2 or any later version
 // Refer to the license.txt file included.
 
-#include "common/log.h"
 #include "core/hle/hle.h"
 #include "core/hle/service/boss_u.h"
 

+ 0 - 1
src/core/hle/service/cam_u.cpp

@@ -2,7 +2,6 @@
 // Licensed under GPLv2 or any later version
 // Refer to the license.txt file included.
 
-#include "common/log.h"
 #include "core/hle/hle.h"
 #include "core/hle/service/cam_u.h"
 

+ 0 - 1
src/core/hle/service/cecd_s.cpp

@@ -2,7 +2,6 @@
 // Licensed under GPLv2 or any later version
 // Refer to the license.txt file included.
 
-#include "common/log.h"
 #include "core/hle/hle.h"
 #include "core/hle/service/cecd_s.h"
 

+ 0 - 1
src/core/hle/service/cecd_u.cpp

@@ -2,7 +2,6 @@
 // Licensed under GPLv2 or any later version
 // Refer to the license.txt file included.
 
-#include "common/log.h"
 #include "core/hle/hle.h"
 #include "core/hle/service/cecd_u.h"
 

+ 1 - 2
src/core/hle/service/cfg/cfg.cpp

@@ -3,7 +3,6 @@
 // Refer to the license.txt file included.
 
 #include <algorithm>
-#include "common/log.h"
 #include "common/make_unique.h"
 #include "core/file_sys/archive_systemsavedata.h"
 #include "core/hle/service/cfg/cfg.h"
@@ -109,7 +108,7 @@ ResultCode UpdateConfigNANDSavegame() {
     mode.create_flag = 1;
     FileSys::Path path("config");
     auto file = cfg_system_save_data->OpenFile(path, mode);
-    _assert_msg_(Service_CFG, file != nullptr, "could not open file");
+    ASSERT_MSG(file != nullptr, "could not open file");
     file->Write(0, CONFIG_SAVEFILE_SIZE, 1, cfg_config_file_buffer.data());
     return RESULT_SUCCESS;
 }

+ 0 - 1
src/core/hle/service/cfg/cfg_i.cpp

@@ -2,7 +2,6 @@
 // Licensed under GPLv2 or any later version
 // Refer to the license.txt file included.
 
-#include "common/log.h"
 #include "core/hle/hle.h"
 #include "core/hle/service/cfg/cfg.h"
 #include "core/hle/service/cfg/cfg_i.h"

+ 0 - 1
src/core/hle/service/cfg/cfg_s.cpp

@@ -2,7 +2,6 @@
 // Licensed under GPLv2 or any later version
 // Refer to the license.txt file included.
 
-#include "common/log.h"
 #include "core/hle/hle.h"
 #include "core/hle/service/cfg/cfg.h"
 #include "core/hle/service/cfg/cfg_s.h"

+ 1 - 2
src/core/hle/service/cfg/cfg_u.cpp

@@ -3,7 +3,6 @@
 // Refer to the license.txt file included.
 
 #include "common/file_util.h"
-#include "common/log.h"
 #include "common/string_util.h"
 #include "core/settings.h"
 #include "core/file_sys/archive_systemsavedata.h"
@@ -84,7 +83,7 @@ static void GetCountryCodeID(Service::Interface* self) {
     u16 country_code_id = 0;
 
     // The following algorithm will fail if the first country code isn't 0.
-    _dbg_assert_(Service_CFG, country_codes[0] == 0);
+    DEBUG_ASSERT(country_codes[0] == 0);
 
     for (size_t id = 0; id < country_codes.size(); ++id) {
         if (country_codes[id] == country_code) {

+ 0 - 1
src/core/hle/service/csnd_snd.cpp

@@ -2,7 +2,6 @@
 // Licensed under GPLv2 or any later version
 // Refer to the license.txt file included.
 
-#include "common/log.h"
 #include "core/hle/hle.h"
 #include "core/hle/service/csnd_snd.h"
 

+ 0 - 1
src/core/hle/service/dsp_dsp.cpp

@@ -2,7 +2,6 @@
 // Licensed under GPLv2 or any later version
 // Refer to the license.txt file included.
 
-#include "common/log.h"
 #include "core/hle/hle.h"
 #include "core/hle/kernel/event.h"
 #include "core/hle/service/dsp_dsp.h"

+ 0 - 1
src/core/hle/service/err_f.cpp

@@ -2,7 +2,6 @@
 // Licensed under GPLv2 or any later version
 // Refer to the license.txt file included.
 
-#include "common/log.h"
 #include "core/hle/hle.h"
 #include "core/hle/service/err_f.h"
 

+ 0 - 1
src/core/hle/service/frd_a.cpp

@@ -2,7 +2,6 @@
 // Licensed under GPLv2 or any later version
 // Refer to the license.txt file included.
 
-#include "common/log.h"
 #include "core/hle/hle.h"
 #include "core/hle/service/frd_a.h"
 

+ 0 - 1
src/core/hle/service/frd_u.cpp

@@ -2,7 +2,6 @@
 // Licensed under GPLv2 or any later version
 // Refer to the license.txt file included.
 
-#include "common/log.h"
 #include "core/hle/hle.h"
 #include "core/hle/service/frd_u.h"
 

+ 1 - 1
src/core/hle/service/fs/archive.cpp

@@ -261,7 +261,7 @@ ResultCode RegisterArchiveType(std::unique_ptr<FileSys::ArchiveFactory>&& factor
     auto result = id_code_map.emplace(id_code, std::move(factory));
 
     bool inserted = result.second;
-    _assert_msg_(Service_FS, inserted, "Tried to register more than one archive with same id code");
+    ASSERT_MSG(inserted, "Tried to register more than one archive with same id code");
 
     auto& archive = result.first->second;
     LOG_DEBUG(Service_FS, "Registered archive %s with id code 0x%08X", archive->GetName().c_str(), id_code);

+ 2 - 4
src/core/hle/service/gsp_gpu.cpp

@@ -2,8 +2,6 @@
 // Licensed under GPLv2 or any later version
 // Refer to the license.txt file included.
 
-
-#include "common/log.h"
 #include "common/bit_field.h"
 
 #include "core/mem_map.h"
@@ -36,7 +34,7 @@ static inline u8* GetCommandBuffer(u32 thread_id) {
 }
 
 static inline FrameBufferUpdate* GetFrameBufferInfo(u32 thread_id, u32 screen_index) {
-    _dbg_assert_msg_(Service_GSP, screen_index < 2, "Invalid screen index");
+    DEBUG_ASSERT_MSG(screen_index < 2, "Invalid screen index");
 
     // For each thread there are two FrameBufferUpdate fields
     u32 offset = 0x200 + (2 * thread_id + screen_index) * sizeof(FrameBufferUpdate);
@@ -186,7 +184,7 @@ static void RegisterInterruptRelayQueue(Service::Interface* self) {
     u32 flags = cmd_buff[1];
 
     g_interrupt_event = Kernel::g_handle_table.Get<Kernel::Event>(cmd_buff[3]);
-    _assert_msg_(GSP, (g_interrupt_event != nullptr), "handle is not valid!");
+    ASSERT_MSG((g_interrupt_event != nullptr), "handle is not valid!");
     g_shared_memory = Kernel::SharedMemory::Create("GSPSharedMem");
 
     Handle shmem_handle = Kernel::g_handle_table.Create(g_shared_memory).MoveFrom();

+ 0 - 2
src/core/hle/service/gsp_lcd.cpp

@@ -2,8 +2,6 @@
 // Licensed under GPLv2 or any later version
 // Refer to the license.txt file included.
 
-
-#include "common/log.h"
 #include "common/bit_field.h"
 
 #include "core/hle/service/gsp_lcd.h"

+ 0 - 1
src/core/hle/service/hid/hid_spvr.cpp

@@ -2,7 +2,6 @@
 // Licensed under GPLv2 or any later version
 // Refer to the license.txt file included.
 
-#include "common/log.h"
 #include "core/hle/hle.h"
 #include "core/hle/service/hid/hid_spvr.h"
 

+ 0 - 2
src/core/hle/service/hid/hid_user.cpp

@@ -2,8 +2,6 @@
 // Licensed under GPLv2 or any later version
 // Refer to the license.txt file included.
 
-#include "common/log.h"
-
 #include "core/hle/hle.h"
 #include "core/hle/kernel/event.h"
 #include "core/hle/kernel/shared_memory.h"

+ 0 - 1
src/core/hle/service/http_c.cpp

@@ -2,7 +2,6 @@
 // Licensed under GPLv2 or any later version
 // Refer to the license.txt file included.
 
-#include "common/log.h"
 #include "core/hle/hle.h"
 #include "core/hle/service/http_c.h"
 

+ 0 - 1
src/core/hle/service/ir_rst.cpp

@@ -2,7 +2,6 @@
 // Licensed under GPLv2 or any later version
 // Refer to the license.txt file included.
 
-#include "common/log.h"
 #include "core/hle/hle.h"
 #include "core/hle/service/ir_rst.h"
 

+ 0 - 1
src/core/hle/service/ir_u.cpp

@@ -2,7 +2,6 @@
 // Licensed under GPLv2 or any later version
 // Refer to the license.txt file included.
 
-#include "common/log.h"
 #include "core/hle/hle.h"
 #include "core/hle/service/ir_u.h"
 

+ 0 - 1
src/core/hle/service/ldr_ro.cpp

@@ -2,7 +2,6 @@
 // Licensed under GPLv2 or any later version
 // Refer to the license.txt file included.
 
-#include "common/log.h"
 #include "core/hle/hle.h"
 #include "core/hle/service/ldr_ro.h"
 

+ 0 - 1
src/core/hle/service/mic_u.cpp

@@ -2,7 +2,6 @@
 // Licensed under GPLv2 or any later version
 // Refer to the license.txt file included.
 
-#include "common/log.h"
 #include "core/hle/hle.h"
 #include "core/hle/service/mic_u.h"
 

+ 0 - 1
src/core/hle/service/news_s.cpp

@@ -2,7 +2,6 @@
 // Licensed under GPLv2 or any later version
 // Refer to the license.txt file included.
 
-#include "common/log.h"
 #include "core/hle/hle.h"
 #include "core/hle/service/news_s.h"
 

+ 0 - 1
src/core/hle/service/news_u.cpp

@@ -2,7 +2,6 @@
 // Licensed under GPLv2 or any later version
 // Refer to the license.txt file included.
 
-#include "common/log.h"
 #include "core/hle/hle.h"
 #include "core/hle/service/news_u.h"
 

+ 0 - 1
src/core/hle/service/nim_aoc.cpp

@@ -2,7 +2,6 @@
 // Licensed under GPLv2 or any later version
 // Refer to the license.txt file included.
 
-#include "common/log.h"
 #include "core/hle/hle.h"
 #include "core/hle/service/nim_aoc.h"
 

+ 0 - 1
src/core/hle/service/nwm_uds.cpp

@@ -2,7 +2,6 @@
 // Licensed under GPLv2 or any later version
 // Refer to the license.txt file included.
 
-#include "common/log.h"
 #include "core/hle/hle.h"
 #include "core/hle/service/nwm_uds.h"
 

+ 0 - 1
src/core/hle/service/pm_app.cpp

@@ -2,7 +2,6 @@
 // Licensed under GPLv2 or any later version
 // Refer to the license.txt file included.
 
-#include "common/log.h"
 #include "core/hle/hle.h"
 #include "core/hle/service/pm_app.h"
 

+ 0 - 1
src/core/hle/service/ptm_play.cpp

@@ -2,7 +2,6 @@
 // Licensed under GPLv2 or any later version
 // Refer to the license.txt file included.
 
-#include "common/log.h"
 #include "core/hle/hle.h"
 #include "core/hle/service/ptm_play.h"
 

+ 0 - 1
src/core/hle/service/ptm_sysm.cpp

@@ -2,7 +2,6 @@
 // Licensed under GPLv2 or any later version
 // Refer to the license.txt file included.
 
-#include "common/log.h"
 #include "common/make_unique.h"
 #include "core/file_sys/archive_extsavedata.h"
 #include "core/hle/hle.h"

+ 1 - 2
src/core/hle/service/ptm_u.cpp

@@ -2,7 +2,6 @@
 // Licensed under GPLv2 or any later version
 // Refer to the license.txt file included.
 
-#include "common/log.h"
 #include "common/make_unique.h"
 
 #include "core/hle/hle.h"
@@ -148,7 +147,7 @@ Interface::Interface() {
         Service::FS::FormatArchive(Service::FS::ArchiveIdCode::SharedExtSaveData, archive_path);
         // Open it again to get a valid archive now that the folder exists
         archive_result = Service::FS::OpenArchive(Service::FS::ArchiveIdCode::SharedExtSaveData, archive_path);
-        _assert_msg_(Service_PTM, archive_result.Succeeded(), "Could not open the PTM SharedExtSaveData archive!");
+        ASSERT_MSG(archive_result.Succeeded(), "Could not open the PTM SharedExtSaveData archive!");
 
         FileSys::Path gamecoin_path("gamecoin.dat");
         FileSys::Mode open_mode = {};

+ 2 - 3
src/core/hle/service/soc_u.cpp

@@ -29,7 +29,6 @@
 #include <poll.h>
 #endif
 
-#include "common/log.h"
 #include "common/scope_exit.h"
 #include "core/hle/hle.h"
 #include "core/hle/service/soc_u.h"
@@ -259,7 +258,7 @@ union CTRSockAddr {
             break;
         }
         default:
-            _dbg_assert_msg_(Service_SOC, false, "Unhandled address family (sa_family) in CTRSockAddr::ToPlatform");
+            ASSERT_MSG(false, "Unhandled address family (sa_family) in CTRSockAddr::ToPlatform");
             break;
         }
         return result;
@@ -280,7 +279,7 @@ union CTRSockAddr {
             break;
         }
         default:
-            _dbg_assert_msg_(Service_SOC, false, "Unhandled address family (sa_family) in CTRSockAddr::ToPlatform");
+            ASSERT_MSG(false, "Unhandled address family (sa_family) in CTRSockAddr::ToPlatform");
             break;
         }
         return result;

+ 0 - 1
src/core/hle/service/ssl_c.cpp

@@ -2,7 +2,6 @@
 // Licensed under GPLv2 or any later version
 // Refer to the license.txt file included.
 
-#include "common/log.h"
 #include "core/hle/hle.h"
 #include "core/hle/service/ssl_c.h"
 

+ 0 - 1
src/core/hle/service/y2r_u.cpp

@@ -2,7 +2,6 @@
 // Licensed under GPLv2 or any later version
 // Refer to the license.txt file included.
 
-#include "common/log.h"
 #include "core/hle/hle.h"
 #include "core/hle/kernel/event.h"
 #include "core/hle/service/y2r_u.h"

+ 0 - 1
src/core/hle/shared_page.cpp

@@ -3,7 +3,6 @@
 // Refer to the license.txt file included.
 
 #include "common/common_types.h"
-#include "common/log.h"
 
 #include "core/core.h"
 #include "core/mem_map.h"

+ 1 - 1
src/core/hle/svc.cpp

@@ -175,7 +175,7 @@ static ResultCode WaitSynchronizationN(s32* out, Handle* handles, s32 handle_cou
 
     // NOTE: on real hardware, there is no nullptr check for 'out' (tested with firmware 4.4). If
     // this happens, the running application will crash.
-    _assert_msg_(Kernel, out != nullptr, "invalid output pointer specified!");
+    ASSERT_MSG(out != nullptr, "invalid output pointer specified!");
 
     // Check if 'handle_count' is invalid
     if (handle_count < 0)

+ 1 - 1
src/core/hw/hw.cpp

@@ -88,4 +88,4 @@ void Shutdown() {
     LOG_DEBUG(HW, "shutdown OK");
 }
 
-}
+}

+ 2 - 2
src/core/mem_map_funcs.cpp

@@ -136,9 +136,9 @@ inline void Write(const VAddr vaddr, const T data) {
         *(T*)&g_dsp_mem[vaddr - DSP_MEMORY_VADDR] = data;
 
     //} else if ((vaddr & 0xFFFF0000) == 0x1FF80000) {
-    //    _assert_msg_(MEMMAP, false, "umimplemented write to Configuration Memory");
+    //    ASSERT_MSG(MEMMAP, false, "umimplemented write to Configuration Memory");
     //} else if ((vaddr & 0xFFFFF000) == 0x1FF81000) {
-    //    _assert_msg_(MEMMAP, false, "umimplemented write to shared page");
+    //    ASSERT_MSG(MEMMAP, false, "umimplemented write to shared page");
 
     // Error out...
     } else {

+ 3 - 3
src/video_core/debug_utils/debug_utils.cpp

@@ -16,7 +16,7 @@
 
 #include <nihstro/shader_binary.h>
 
-#include "common/log.h"
+#include "common/assert.h"
 #include "common/file_util.h"
 #include "common/math_util.h"
 
@@ -197,7 +197,7 @@ void DumpShader(const u32* binary_data, u32 binary_size, const u32* swizzle_data
                         it->component_mask = it->component_mask | component_mask;
                     }
                 } catch (const std::out_of_range& ) {
-                    _dbg_assert_msg_(HW_GPU, 0, "Unknown output attribute mapping");
+                    DEBUG_ASSERT_MSG(false, "Unknown output attribute mapping");
                     LOG_ERROR(HW_GPU, "Unknown output attribute mapping: %03x, %03x, %03x, %03x",
                               (int)output_attributes[i].map_x.Value(),
                               (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
 
     default:
         LOG_ERROR(HW_GPU, "Unknown texture format: %x", (u32)info.format);
-        _dbg_assert_(HW_GPU, 0);
+        DEBUG_ASSERT(false);
         return {};
     }
 }

+ 0 - 2
src/video_core/gpu_debugger.h

@@ -8,8 +8,6 @@
 #include <functional>
 #include <vector>
 
-#include "common/log.h"
-
 #include "core/hle/service/gsp_gpu.h"
 
 #include "command_processor.h"

+ 1 - 0
src/video_core/primitive_assembly.cpp

@@ -6,6 +6,7 @@
 #include "primitive_assembly.h"
 #include "vertex_shader.h"
 
+#include "common/logging/log.h"
 #include "video_core/debug_utils/debug_utils.h"
 
 namespace Pica {

+ 5 - 5
src/video_core/rasterizer.cpp

@@ -216,7 +216,7 @@ void ProcessTriangle(const VertexShader::OutputVertex& v0,
                 if (!texture.enabled)
                     continue;
 
-                _dbg_assert_(HW_GPU, 0 != texture.config.address);
+                DEBUG_ASSERT(0 != texture.config.address);
 
                 int s = (int)(uv[i].u() * float24::FromFloat32(static_cast<float>(texture.config.width))).ToFloat32();
                 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,
 
                         default:
                             LOG_ERROR(HW_GPU, "Unknown texture coordinate wrapping mode %x\n", (int)mode);
-                            _dbg_assert_(HW_GPU, 0);
+                            UNIMPLEMENTED();
                             return 0;
                     }
                 };
@@ -282,7 +282,7 @@ void ProcessTriangle(const VertexShader::OutputVertex& v0,
 
                     default:
                         LOG_ERROR(HW_GPU, "Unknown color combiner source %d\n", (int)source);
-                        _dbg_assert_(HW_GPU, 0);
+                        UNIMPLEMENTED();
                         return {};
                     }
                 };
@@ -380,7 +380,7 @@ void ProcessTriangle(const VertexShader::OutputVertex& v0,
 
                     default:
                         LOG_ERROR(HW_GPU, "Unknown color combiner operation %d\n", (int)op);
-                        _dbg_assert_(HW_GPU, 0);
+                        UNIMPLEMENTED();
                         return {};
                     }
                 };
@@ -404,7 +404,7 @@ void ProcessTriangle(const VertexShader::OutputVertex& v0,
 
                     default:
                         LOG_ERROR(HW_GPU, "Unknown alpha combiner operation %d\n", (int)op);
-                        _dbg_assert_(HW_GPU, 0);
+                        UNIMPLEMENTED();
                         return 0;
                     }
                 };

+ 1 - 1
src/video_core/renderer_opengl/gl_shader_util.cpp

@@ -3,7 +3,7 @@
 // Refer to the license.txt file included.
 
 #include "gl_shader_util.h"
-#include "common/log.h"
+#include "common/logging/log.h"
 
 #include <vector>
 #include <algorithm>

+ 3 - 3
src/video_core/renderer_opengl/renderer_opengl.cpp

@@ -99,15 +99,15 @@ void RendererOpenGL::LoadFBToActiveGLTexture(const GPU::Regs::FramebufferConfig&
     const u8* framebuffer_data = Memory::GetPointer(framebuffer_vaddr);
 
     // TODO: Handle other pixel formats
-    _dbg_assert_msg_(Render_OpenGL, framebuffer.color_format == GPU::Regs::PixelFormat::RGB8,
+    ASSERT_MSG(framebuffer.color_format == GPU::Regs::PixelFormat::RGB8,
                      "Unsupported 3DS pixel format.");
 
     size_t pixel_stride = framebuffer.stride / 3;
     // OpenGL only supports specifying a stride in units of pixels, not bytes, unfortunately
-    _dbg_assert_(Render_OpenGL, pixel_stride * 3 == framebuffer.stride);
+    ASSERT(pixel_stride * 3 == framebuffer.stride);
     // Ensure no bad interactions with GL_UNPACK_ALIGNMENT, which by default
     // only allows rows to have a memory alignement of 4.
-    _dbg_assert_(Render_OpenGL, pixel_stride % 4 == 0);
+    ASSERT(pixel_stride % 4 == 0);
 
     glBindTexture(GL_TEXTURE_2D, texture.handle);
     glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint)pixel_stride);

+ 5 - 8
src/video_core/vertex_shader.cpp

@@ -146,13 +146,10 @@ static void ProcessShaderCode(VertexShaderState& state) {
         case Instruction::OpCodeType::Arithmetic:
         {
             bool is_inverted = 0 != (instr.opcode.GetInfo().subtype & Instruction::OpCodeInfo::SrcInversed);
-            if (is_inverted) {
-                // TODO: We don't really support this properly: For instance, the address register
-                //       offset needs to be applied to SRC2 instead, etc.
-                //       For now, we just abort in this situation.
-                LOG_CRITICAL(HW_GPU, "Bad condition...");
-                exit(0);
-            }
+            // TODO: We don't really support this properly: For instance, the address register
+            //       offset needs to be applied to SRC2 instead, etc.
+            //       For now, we just abort in this situation.
+            ASSERT_MSG(!is_inverted, "Bad condition...");
 
             const int address_offset = (instr.common.address_register_index == 0)
                                        ? 0 : state.address_registers[instr.common.address_register_index - 1];
@@ -342,7 +339,7 @@ static void ProcessShaderCode(VertexShaderState& state) {
             default:
                 LOG_ERROR(HW_GPU, "Unhandled arithmetic instruction: 0x%02x (%s): 0x%08x",
                           (int)instr.opcode.Value(), instr.opcode.GetInfo().name, instr.hex);
-                _dbg_assert_(HW_GPU, 0);
+                DEBUG_ASSERT(false);
                 break;
             }
 

+ 0 - 1
src/video_core/video_core.cpp

@@ -4,7 +4,6 @@
 
 #include "common/common.h"
 #include "common/emu_window.h"
-#include "common/log.h"
 
 #include "core/core.h"