|
| 1 | +// Copyright 2013 Normmatt |
| 2 | +// Licensed under GPLv2 or any later version |
| 3 | +// Refer to the license.txt file included. |
| 4 | + |
| 5 | +#pragma once |
| 6 | + |
| 7 | +#include "common.h" |
| 8 | + |
| 9 | +#define BYTES_PER_PIXEL 3 |
| 10 | +#define SCREEN_HEIGHT 240 |
| 11 | +#define SCREEN_WIDTH_TOP 400 |
| 12 | +#define SCREEN_WIDTH_BOT 320 |
| 13 | + |
| 14 | +#define RGB(r,g,b) (r<<24|b<<16|g<<8|r) |
| 15 | + |
| 16 | +#define COLOR_BLACK RGB(0x00, 0x00, 0x00) |
| 17 | +#define COLOR_WHITE RGB(0xFF, 0xFF, 0xFF) |
| 18 | +#define COLOR_RED RGB(0xFF, 0x00, 0x00) |
| 19 | +#define COLOR_GREEN RGB(0x00, 0xFF, 0x00) |
| 20 | +#define COLOR_BLUE RGB(0x00, 0x00, 0xFF) |
| 21 | +#define COLOR_CYAN RGB(0x00, 0xFF, 0xFF) |
| 22 | +#define COLOR_MAGENTA RGB(0xFF, 0x00, 0xFF) |
| 23 | +#define COLOR_YELLOW RGB(0xFF, 0xFF, 0x00) |
| 24 | +#define COLOR_GREY RGB(0x77, 0x77, 0x77) |
| 25 | +#define COLOR_TRANSPARENT RGB(0xFF, 0x00, 0xEF) // otherwise known as 'super fuchsia' |
| 26 | + |
| 27 | +#define STD_COLOR_BG COLOR_BLACK |
| 28 | +#define STD_COLOR_FONT COLOR_WHITE |
| 29 | + |
| 30 | +#define DBG_COLOR_BG COLOR_BLACK |
| 31 | +#define DBG_COLOR_FONT COLOR_WHITE |
| 32 | + |
| 33 | +#define DBG_START_Y 10 |
| 34 | +#define DBG_END_Y (SCREEN_HEIGHT - 10) |
| 35 | +#define DBG_START_X 10 |
| 36 | +#define DBG_END_X (SCREEN_WIDTH_TOP - 10) |
| 37 | +#define DBG_STEP_Y 10 |
| 38 | + |
| 39 | +#define DBG_N_CHARS_Y ((DBG_END_Y - DBG_START_Y) / DBG_STEP_Y) |
| 40 | +#define DBG_N_CHARS_X (((DBG_END_X - DBG_START_X) / 8) + 1) |
| 41 | + |
| 42 | +#define TOP_SCREEN0 (u8*)(*(u32*)0x23FFFE00) |
| 43 | +#define TOP_SCREEN1 (u8*)(*(u32*)0x23FFFE00) |
| 44 | +#define BOT_SCREEN0 (u8*)(*(u32*)0x23FFFE08) |
| 45 | +#define BOT_SCREEN1 (u8*)(*(u32*)0x23FFFE08) |
| 46 | + |
| 47 | + |
| 48 | +void ClearScreen(unsigned char *screen, int width, int color); |
| 49 | +void ClearScreenFull(bool clear_top, bool clear_bottom); |
| 50 | + |
| 51 | +void DrawCharacter(unsigned char *screen, int character, int x, int y, int color, int bgcolor); |
| 52 | +void DrawString(unsigned char *screen, const char *str, int x, int y, int color, int bgcolor); |
| 53 | +void DrawStringF(int x, int y, bool use_top, const char *format, ...); |
| 54 | + |
| 55 | +void Screenshot(const char* path); |
| 56 | +void DebugClear(); |
| 57 | +void DebugSet(const char **strs); |
| 58 | +void DebugColor(u32 color, const char *format, ...); |
| 59 | +void Debug(const char *format, ...); |
| 60 | + |
| 61 | +void ShowProgress(u64 current, u64 total); |
0 commit comments