2015-11-02 00:24:11 +00:00
|
|
|
#ifndef _CTR_DEBUG_H__
|
|
|
|
#define _CTR_DEBUG_H__
|
|
|
|
|
|
|
|
#include <stdio.h>
|
2016-10-04 18:42:25 +00:00
|
|
|
#include <3ds/types.h>
|
2015-11-02 00:24:11 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
void wait_for_input(void);
|
|
|
|
void dump_result_value(Result val);
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define DEBUG_HOLD() do{printf("%s@%s:%d.\n",__FUNCTION__, __FILE__, __LINE__);fflush(stdout);wait_for_input();}while(0)
|
2015-11-24 10:05:31 +00:00
|
|
|
#define DEBUG_LINE() do{printf("%s:%d.\n",__FUNCTION__, __LINE__);fflush(stdout);}while(0)
|
2015-11-02 00:24:11 +00:00
|
|
|
#define DEBUG_STR(X) printf( "%s: %s\n", #X, (char*)(X))
|
|
|
|
#define DEBUG_VAR(X) printf( "%-20s: 0x%08X\n", #X, (u32)(X))
|
2015-12-24 22:16:40 +00:00
|
|
|
#define DEBUG_INT(X) printf( "%-20s: %10i\n", #X, (s32)(X))
|
2015-11-02 00:24:11 +00:00
|
|
|
#define DEBUG_VAR64(X) printf( #X"\r\t\t\t\t : 0x%016llX\n", (u64)(X))
|
2016-10-10 21:22:08 +00:00
|
|
|
#define DEBUG_ERROR(X) do{if(X)dump_result_value(X);}while(0)
|
2015-11-02 00:24:11 +00:00
|
|
|
#define PRINTFPOS(X,Y) "\x1b["#X";"#Y"H"
|
|
|
|
#define PRINTFPOS_STR(X,Y) "\x1b["X";"Y"H"
|
2016-09-29 19:14:12 +00:00
|
|
|
#define PRINTF_LINE(X) "\x1b["X";0H"
|
2015-11-02 00:24:11 +00:00
|
|
|
|
|
|
|
#endif //_CTR_DEBUG_H__
|