PayloadLoaderInstaller/source/WiiUScreen.h

53 lines
1.2 KiB
C
Raw Normal View History

2020-10-14 13:54:25 +02:00
#pragma once
#include <whb/log.h>
#include <whb/log_console.h>
#include <coreinit/memheap.h>
#include <coreinit/cache.h>
#include <coreinit/memfrmheap.h>
#include <coreinit/memory.h>
#include <coreinit/screen.h>
#include <proc_ui/procui.h>
#include <cstring>
2020-10-15 20:14:00 +02:00
#include "utils/logger.h"
2020-10-14 13:54:25 +02:00
#define NUM_LINES (16)
#define LINE_LENGTH (128)
#define CONSOLE_FRAME_HEAP_TAG (0x000DECAF)
#define PRINTF_BUFFER_LENGTH 2048
2020-10-15 20:14:00 +02:00
#define DEBUG_CONSOLE_LOG(FMT, ARGS...)do { \
DEBUG_FUNCTION_LINE(FMT, ## ARGS); \
WiiUScreen::drawLinef(FMT, ## ARGS); \
} while (0)
2020-10-14 13:54:25 +02:00
class WiiUScreen {
public:
static uint32_t ProcCallbackAcquired(void *context);
static uint32_t ProcCallbackReleased(void *context);
static bool Init();
static void DeInit();
static void drawLinef(const char *fmt, ...);
static void drawLine(const char *fmt);
2020-10-16 19:48:13 +02:00
static void drawLine();
2020-10-15 20:14:00 +02:00
static void flipBuffers();
2020-10-14 13:54:25 +02:00
static void clearScreen();
private:
static void *sBufferTV, *sBufferDRC;
static uint32_t sBufferSizeTV, sBufferSizeDRC;
static bool sConsoleHasForeground;
static uint32_t consoleColor;
static uint32_t consoleCursorY;
};