844b465771b87c027a82ddb5afcd736b1f29a24b
[gbajam21] / 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_start(int palidx);
14 void vblperf_stop(void);
15
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
27
28 void panic(uint32_t pc, const char *fmt, ...);
29
30 void dbg_drawglyph(int x, int y, int c);
31 int dbg_drawstr(int x, int y, const char *fmt, ...);
32 int dbg_vdrawstr(int x, int y, const char *fmt, va_list ap);
33
34 void emuprint(const char *fmt, ...);
35
36 #endif  /* DEBUG_H_ */