mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-07-04 22:11:18 +12:00
Add debug asserts for invalid MEMPTR
Also fixed some corruptions this uncovered
This commit is contained in:
parent
7886b594a2
commit
808d1bb424
13 changed files with 193 additions and 156 deletions
|
@ -296,6 +296,61 @@ inline unsigned char _addcarry_u64(unsigned char carry, unsigned long long a, un
|
|||
|
||||
#endif
|
||||
|
||||
// asserts
|
||||
|
||||
|
||||
inline void cemu_assert(bool _condition)
|
||||
{
|
||||
if ((_condition) == false)
|
||||
{
|
||||
DEBUG_BREAK;
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef CEMU_DEBUG_ASSERT
|
||||
//#define cemu_assert_debug(__cond) -> Forcing __cond not to be evaluated currently has unexpected side-effects
|
||||
|
||||
inline void cemu_assert_debug(bool _condition)
|
||||
{
|
||||
}
|
||||
|
||||
inline void cemu_assert_unimplemented()
|
||||
{
|
||||
}
|
||||
|
||||
inline void cemu_assert_suspicious()
|
||||
{
|
||||
}
|
||||
|
||||
inline void cemu_assert_error()
|
||||
{
|
||||
DEBUG_BREAK;
|
||||
}
|
||||
#else
|
||||
inline void cemu_assert_debug(bool _condition)
|
||||
{
|
||||
if ((_condition) == false)
|
||||
DEBUG_BREAK;
|
||||
}
|
||||
|
||||
inline void cemu_assert_unimplemented()
|
||||
{
|
||||
DEBUG_BREAK;
|
||||
}
|
||||
|
||||
inline void cemu_assert_suspicious()
|
||||
{
|
||||
DEBUG_BREAK;
|
||||
}
|
||||
|
||||
inline void cemu_assert_error()
|
||||
{
|
||||
DEBUG_BREAK;
|
||||
}
|
||||
#endif
|
||||
|
||||
#define assert_dbg() DEBUG_BREAK // old style unconditional generic assert
|
||||
|
||||
// MEMPTR
|
||||
#include "Common/MemPtr.h"
|
||||
|
||||
|
@ -380,58 +435,6 @@ bool match_any_of(T1 value, T2 compareTo, Types&&... others)
|
|||
#endif
|
||||
}
|
||||
|
||||
inline void cemu_assert(bool _condition)
|
||||
{
|
||||
if ((_condition) == false)
|
||||
{
|
||||
DEBUG_BREAK;
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef CEMU_DEBUG_ASSERT
|
||||
//#define cemu_assert_debug(__cond) -> Forcing __cond not to be evaluated currently has unexpected side-effects
|
||||
|
||||
inline void cemu_assert_debug(bool _condition)
|
||||
{
|
||||
}
|
||||
|
||||
inline void cemu_assert_unimplemented()
|
||||
{
|
||||
}
|
||||
|
||||
inline void cemu_assert_suspicious()
|
||||
{
|
||||
}
|
||||
|
||||
inline void cemu_assert_error()
|
||||
{
|
||||
DEBUG_BREAK;
|
||||
}
|
||||
#else
|
||||
inline void cemu_assert_debug(bool _condition)
|
||||
{
|
||||
if ((_condition) == false)
|
||||
DEBUG_BREAK;
|
||||
}
|
||||
|
||||
inline void cemu_assert_unimplemented()
|
||||
{
|
||||
DEBUG_BREAK;
|
||||
}
|
||||
|
||||
inline void cemu_assert_suspicious()
|
||||
{
|
||||
DEBUG_BREAK;
|
||||
}
|
||||
|
||||
inline void cemu_assert_error()
|
||||
{
|
||||
DEBUG_BREAK;
|
||||
}
|
||||
#endif
|
||||
|
||||
#define assert_dbg() DEBUG_BREAK // old style unconditional generic assert
|
||||
|
||||
// Some string conversion helpers because C++20 std::u8string is too cumbersome to use in practice
|
||||
// mixing string types generally causes loads of issues and many of the libraries we use dont expose interfaces for u8string
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue