From 0699cbd82b577a4358d199a627e9bc4497f436e7 Mon Sep 17 00:00:00 2001 From: Jari Vetoniemi Date: Wed, 4 Jul 2018 20:25:49 +0300 Subject: initial commit --- clients/vita/screen.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 clients/vita/screen.h (limited to 'clients/vita/screen.h') diff --git a/clients/vita/screen.h b/clients/vita/screen.h new file mode 100644 index 0000000..e1ec9d4 --- /dev/null +++ b/clients/vita/screen.h @@ -0,0 +1,24 @@ +#pragma once + +#include +#include + +void screen_deinit(void); +bool screen_init(void); +void screen_clear(void); +int screen_puts(const char *msg); + +__attribute__((format(printf, 1, 2))) +int screen_printf(const char *fmt, ...); + +#define printf screen_printf +#define errx(code, fmt, ...) { \ + screen_init(); \ + printf("ERROR @ %s:%lu "fmt"\n", __func__, (uint32_t)__LINE__, ##__VA_ARGS__); \ + while (true) { sceKernelDelayThread((SceUInt)~0); } \ +} + +#define warnx(fmt, ...) { printf("WARN @ %s:%lu "fmt"\n", __func__, (uint32_t)__LINE__, ##__VA_ARGS__); } +#define err(code, fmt, ...) { errx(code, fmt": %s", ##__VA_ARGS__, strerror(errno)); } +#define warn(fmt, ...) { warnx(code, fmt": %s", ##__VA_ARGS__, strerror(errno)); } +#define assert(x) { if (!(x)) { errx("assertion failed for %s", #x); } } -- cgit v1.2.3