8080-Emulator  0.1
An Intel 8080 emulator for Space Invaders
debug.h
Go to the documentation of this file.
1 
11 #ifndef _DEBUG_H_
12 #define _DEBUG_H_
13 
14 #ifdef DEBUG
15 
21 #define DEBUG_PRINT( fmt, args... ){ \
22  fprintf(stderr, "DEBUG: %-15s:%d:%-15s():", __FILE__, \
23  __LINE__, __func__);\
24  fprintf(stderr, fmt, args );\
25 }
26 
33 #define WARN( X, fmt, args... ){ \
34  if ( !(X) ){\
35  fprintf(stderr, "WARN: %-15s:%d:%-15s():", __FILE__, \
36  __LINE__, __func__);\
37  fprintf(stderr, fmt, args );\
38  }\
39 }
40 
41 #else
42 
49 #define DEBUG_PRINT( ... ) do {} while( 0 );
50 #define WARN( ... ) do {} while( 0 );
52 
53 #endif /* DEBUG */
54 
55 #ifdef DECOMPILE
56 
62 #define DECOMPILE_PRINT( PC, fmt, args... ){ \
63  fprintf(stdout, "%04x : ", PC);\
64  fprintf(stdout, fmt, args );\
65 }
66 
67 #else
68 
74 //{@
75 #define DECOMPILE_PRINT( ... ) do {} while( 0 );
77 
78 #endif /* DECOMPILE */
79 
80 #endif /* _DEBUG_H_ */