Files
lowbit--ps5-doom/src/launcher/screen.h
T
rijads 93814c3e95 Send games from a PC or phone browser, with a QR code on screen
Add games gets a first row, Send from PC or phone. Its screen runs a small HTTP server for as long
as it is open (port 9666, or the next one the sandbox allows) and shows the address as text and as
a QR code. The page it serves takes dropped files and whole folders, uploads them one at a time with
progress, and lists what the console did with each. Game WADs are moved into place, archives go
through the importer and are deleted afterwards, add-ons and other files are refused with a reason.

qrcodegen 1.8.0 joins the pinned third-party fetch, renamed to fetch-third-party.sh; the page is
embedded at build time by tools/embed-file.py. tools/send.py does what the page does, for console
tests with test/console-send.cfg.
2026-10-04 15:25:39 +02:00

34 lines
1023 B
C

#ifndef SCREEN_H
#define SCREEN_H
#define SCREEN_WIDTH 320
#define SCREEN_HEIGHT 200
#define LINE_HEIGHT 10
typedef enum
{
INK_RED,
INK_WHITE,
INK_GOLD,
INK_GRAY,
INK_GREEN,
INKS
} ink_t;
int screen_init(const char *wad_path);
void screen_background(void);
void screen_logo(int y);
void screen_skull(int x, int y, int frame);
void screen_box(int x, int y, int width, int height, int filled);
int screen_text_width(const char *text, int scale);
void screen_text(int x, int y, const char *text, ink_t ink, int scale);
void screen_text_center(int y, const char *text, ink_t ink, int scale);
void screen_text_fit(int x, int y, int width, const char *text, ink_t ink, int keep_end);
int screen_wrap(int x, int y, int width, const char *text, ink_t ink);
// Draws text as a QR code with a white border, each module a square of the given size; returns its
// width in pixels, or 0 when the text does not fit.
int screen_qr(int x, int y, const char *text, int module);
void screen_present(void);
#endif