2021-10-09 00:58:55 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <whb/log.h>
|
|
|
|
#include <whb/log_console.h>
|
|
|
|
|
2022-07-26 08:16:27 +02:00
|
|
|
#include "utils/logger.h"
|
2021-10-09 00:58:55 +02:00
|
|
|
#include <coreinit/cache.h>
|
|
|
|
#include <coreinit/memfrmheap.h>
|
2022-07-26 08:16:27 +02:00
|
|
|
#include <coreinit/memheap.h>
|
2021-10-09 00:58:55 +02:00
|
|
|
#include <coreinit/memory.h>
|
|
|
|
#include <coreinit/screen.h>
|
|
|
|
#include <cstring>
|
2022-07-26 08:16:27 +02:00
|
|
|
#include <proc_ui/procui.h>
|
2021-10-09 00:58:55 +02:00
|
|
|
|
2022-07-26 08:16:27 +02:00
|
|
|
#define NUM_LINES (16)
|
|
|
|
#define LINE_LENGTH (128)
|
2021-10-09 00:58:55 +02:00
|
|
|
#define CONSOLE_FRAME_HEAP_TAG (0x000DECAF)
|
2022-07-26 08:16:27 +02:00
|
|
|
#define PRINTF_BUFFER_LENGTH 2048
|
2021-10-09 00:58:55 +02:00
|
|
|
|
2022-07-26 08:16:27 +02:00
|
|
|
#define DEBUG_CONSOLE_LOG(FMT, ARGS...) \
|
|
|
|
do { \
|
|
|
|
DEBUG_FUNCTION_LINE(FMT, ##ARGS); \
|
|
|
|
WiiUScreen::drawLinef(FMT, ##ARGS); \
|
2021-10-09 00:58:55 +02:00
|
|
|
} while (0)
|
|
|
|
|
|
|
|
|
|
|
|
class WiiUScreen {
|
|
|
|
|
|
|
|
public:
|
2022-07-26 09:24:06 +02:00
|
|
|
static uint32_t ProcCallbackAcquired([[maybe_unused]] void *context);
|
2021-10-09 00:58:55 +02:00
|
|
|
|
2022-07-26 09:24:06 +02:00
|
|
|
static uint32_t ProcCallbackReleased([[maybe_unused]] void *context);
|
2021-10-09 00:58:55 +02:00
|
|
|
|
|
|
|
static bool Init();
|
|
|
|
|
|
|
|
static void DeInit();
|
|
|
|
|
|
|
|
static void drawLinef(const char *fmt, ...);
|
|
|
|
|
|
|
|
static void drawLine(const char *fmt);
|
|
|
|
|
|
|
|
static void drawLine();
|
|
|
|
|
|
|
|
static void flipBuffers();
|
|
|
|
|
|
|
|
static void clearScreen();
|
|
|
|
|
|
|
|
private:
|
|
|
|
static void *sBufferTV, *sBufferDRC;
|
|
|
|
static uint32_t sBufferSizeTV, sBufferSizeDRC;
|
|
|
|
static bool sConsoleHasForeground;
|
|
|
|
static uint32_t consoleColor;
|
|
|
|
static uint32_t consoleCursorY;
|
|
|
|
};
|