aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
authorgbc dev <gbc@localhost>2026-07-18 20:41:19 +0200
committergbc dev <gbc@localhost>2026-07-18 20:41:19 +0200
commitfa1579cc9f209dbeb14ab277dc9c4ac741ace57c (patch)
tree7ca130f0d360e93460de2cae71daeb97c3819d0f /src/main.c
parentmain: allow --sock (control/debug socket) in headless mode (diff)
downloadsl0pboy-fa1579cc9f209dbeb14ab277dc9c4ac741ace57c.tar.gz
sl0pboy-fa1579cc9f209dbeb14ab277dc9c4ac741ace57c.tar.xz
sl0pboy-fa1579cc9f209dbeb14ab277dc9c4ac741ace57c.zip
render: --shrink N - downscale the half-block live display (1-4)
Decimates the LCD N x N before the half-block encode so the monitor pane takes 160/N cols x 72/N rows. Display-only: capture, recording and sixel still read the full-res framebuffer. Decimation is max-luma pick, not box-average: terminal fonts are 1px bright strokes on dark background, and averaging dims them into grey mush (the 'blurry font' regression). Keeping the brightest source pixel of each block preserves stroke brightness and hue.
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index 0dec4df..811e0a4 100644
--- a/src/main.c
+++ b/src/main.c
@@ -76,6 +76,8 @@ static void print_usage(FILE *out, const char *prog) {
" --sixel [scale] sixel graphics output; scale = pixel zoom 1-6 (def 2)\n"
" --chrome draw a Game Boy body around the LCD (sixel display)\n"
" --palette NAME recolor the LCD: dmg|green (pea green), pocket|gray\n"
+" --shrink N shrink the half-block display N x (1-4); capture and\n"
+" recording stay full-res\n"
" --green alias for --palette dmg\n"
" --frameskip N draw 1 of every (N+1) frames\n"
"\n"
@@ -172,6 +174,9 @@ int main(int argc, char **argv) {
} else if (!strcmp(a, "--sixel")) {
sixel = true;
if (has_val) sixel_scale = atoi(argv[++i]);
+ } else if (!strcmp(a, "--shrink")) {
+ if (!has_val) { fprintf(stderr, "%s: --shrink needs a value\n", prog); return 1; }
+ render_set_shrink(atoi(argv[++i]));
} else if (!strcmp(a, "--chrome")) {
chrome = true;
} else if (!strcmp(a, "--palette")) {