-
Notifications
You must be signed in to change notification settings - Fork 8
/
trace.h
26 lines (21 loc) · 799 Bytes
/
trace.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#ifndef _TRACE_H
#define _TRACE_H
#include <stdio.h>
#define TRACE(...) \
if (trace) { \
fprintf(stderr, __VA_ARGS__); \
fputc('\n', stderr); \
}
#define TRACE_PC(...) \
if (trace) { \
fprintf(stderr, "%04X ", cpu6_pc()); \
fprintf(stderr, __VA_ARGS__); \
fputc('\n', stderr); \
}
#define WARN_PC(...) \
do { \
fprintf(stderr, "%04X ", cpu6_pc()); \
fprintf(stderr, __VA_ARGS__); \
fputc('\n', stderr); \
} while (0);
#endif