panic screen, debug font, asmutil.s
[gbajam21] / src / debug.h
index 41f2a23..844b465 100644 (file)
@@ -1,6 +1,36 @@
 #ifndef DEBUG_H_
 #define DEBUG_H_
 
+#include <stdarg.h>
+#include "util.h"
+
+extern unsigned char font_8x8[];
+
+extern uint16_t vblperf_color[];
+uint16_t *vblperf_palptr;
+volatile int vblperf_count;
+
+void vblperf_start(int palidx);
+void vblperf_stop(void);
+
+#define vblperf_begin()        \
+       do { \
+               *vblperf_palptr = 0; \
+               vblperf_count = 0; \
+       } while(0)
+
+#define vblperf_end() \
+       do { \
+               *vblperf_palptr = vblperf_color[vblperf_count]; \
+       } while(0)
+
+
+void panic(uint32_t pc, const char *fmt, ...);
+
+void dbg_drawglyph(int x, int y, int c);
+int dbg_drawstr(int x, int y, const char *fmt, ...);
+int dbg_vdrawstr(int x, int y, const char *fmt, va_list ap);
+
 void emuprint(const char *fmt, ...);
 
 #endif /* DEBUG_H_ */