gint/src/render/dprint.c
lephe e1aca8d89b
exc: add exception handlers, use them in the DMA
This change introduces exception handlers that default to a fatal error
with an on-screen description of the exception and some debugging
information.

It also adds the dprint() function as a definitely-needed helper and
removes bootlog_unmapped() by using the exception handler for the fatal
error display. (Also printf() is now required in all gint add-ins; this
is sad, but space is not as much of a constraint as debugging.)

Finally, the exception handler is used to handle an interrupt which is
an exception in practice, the DMA address error. On fx-CG 50, additional
DMA-related information is displayed on the screen. This is left out on
fx-9860G as there is not enough space.
2019-09-03 22:15:00 +02:00

16 lines
305 B
C

#include <gint/display.h>
#include <gint/std/stdio.h>
/* dprint(): Display a formatted string */
void dprint(int x, int y, int fg, int bg, char const *format, ...)
{
char str[256];
va_list args;
va_start(args, format);
vsnprintf(str, 256, format, args);
va_end(args);
dtext(x, y, str, fg, bg);
}