citra-emu
/
citra-canary
Archived
1
0
Fork 0

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.
This commit is contained in:
archshift 2015-01-20 17:16:47 -08:00
parent 168eb27aee
commit ef24e72b26
88 changed files with 135 additions and 217 deletions

2
externals/boost vendored

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

View File

@ -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);

View File

@ -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();
}

View File

@ -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

View File

@ -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
src/common/assert.h Normal file
View File

@ -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!")

View File

@ -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>

View File

@ -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;

View File

@ -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"

View File

@ -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

View File

@ -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

View File

@ -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);

View File

@ -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

View File

@ -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...

View File

@ -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

View File

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

View File

@ -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) {

View File

@ -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"

View File

@ -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"

View File

@ -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".

View File

@ -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)

View File

@ -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()) {

View File

@ -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) {

View File

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

View File

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

View File

@ -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,

View File

@ -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) {

View File

@ -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;
}

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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;
}

View File

@ -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"

View File

@ -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"

View File

@ -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) {

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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);

View File

@ -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();

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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 = {};

View File

@ -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;

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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)

View File

@ -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 {

View File

@ -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 {};
}
}

View File

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

View File

@ -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 {

View File

@ -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;
}
};

View File

@ -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>

View File

@ -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);

View File

@ -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;
}

View File

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