add missing tools/pngdump to the repo
[gbajam22] / src / debug.h
1 #ifndef DEBUG_H_
2 #define DEBUG_H_
3
4 #include <stdarg.h>
5 #include "util.h"
6
7 extern unsigned char font_8x8[];
8
9 extern uint16_t vblperf_color[];
10 uint16_t *vblperf_palptr;
11 volatile int vblperf_count;
12
13 void vblperf_setcolor(int palidx);
14
15 #if defined(BUILD_GBA) && defined(VBLBAR)
16 #define vblperf_begin() \
17         do { \
18                 *vblperf_palptr = 0; \
19                 vblperf_count = 0; \
20         } while(0)
21
22 #define vblperf_end() \
23         do { \
24                 *vblperf_palptr = vblperf_color[vblperf_count]; \
25         } while(0)
26 #else
27 #define vblperf_begin()
28 #define vblperf_end()
29 #endif
30
31 extern int glyphcolor, glyphbg;
32 extern void *glyphfb;
33
34 void panic(void *pc, const char *fmt, ...) __attribute__((noreturn));
35
36 void dbg_drawglyph(int x, int y, int c);
37 int dbg_drawstr(int x, int y, const char *fmt, ...);
38 int dbg_vdrawstr(int x, int y, const char *fmt, va_list ap);
39
40 void emuprint(const char *fmt, ...);
41
42 #endif  /* DEBUG_H_ */