/*
** This is a replacement for the amiga.lib kprintf for PowerPC.
** It uses the WarpUp SPrintF function to do debug output
** to the serial connector (or Sushi, if it's installed).
*/

#include <proto/exec.h>
#include <stdarg.h>
#include <stdio.h>

int minigl_debug = 0;

int kprintf(char *format, ...)
{
	int n;

#ifndef GLNDEBUG
	char msg[1024];
	va_list marker;

//	if (minigl_debug == 0)
//		return 0;

	va_start(marker, format);
	n = vsnprintf(msg, 1000, format, marker);
	va_end(marker);

	IExec->DebugPrintF("%s", msg);

	return n;
#endif
	return 0;
}
