aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/ps2/ps2debug.cpp
blob: 272d256232f0b4875e46d40a2e5db3dd1640a2de (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include "ps2debug.h"
#include <stdio.h>
#include <stdlib.h>
#include <sio.h>

void sioprintf(const char *zFormat, ...) {
	va_list ap;
	char resStr[2048];

	va_start(ap,zFormat);
	vsnprintf(resStr, 2048, zFormat, ap);
	va_end(ap);

	char *pos = resStr;
	while (*pos) {
		if (*pos == '\n') {
			// SIO terminal needs explicit CRLF
			sio_putc('\r');
			sio_putc('\n');
		} else
			sio_putc(*pos);
		pos++;
	}
}