From 24a015ff047d4b7bb955ba4bc61d5793d7492878 Mon Sep 17 00:00:00 2001 From: gbc dev Date: Wed, 15 Jul 2026 23:44:28 +0200 Subject: serial: headless mode tying serial port to stdio for OS debugging - --headless: no rendering/TUI; serial TX -> stdout, RX <- stdin (nonblocking) - generalize serial: serial_out_fd/serial_in_fd on the GB; internal-clock transfer now shifts in a real RX byte (from stdin) instead of always 0xFF - paced to native speed by default, --uncapped for turbo; pipes/scripts cleanly - README: document headless serial console --- src/gb.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/gb.h') diff --git a/src/gb.h b/src/gb.h index 7439615..7218648 100644 --- a/src/gb.h +++ b/src/gb.h @@ -114,6 +114,8 @@ struct GB { u64 cycles; // total T-cycles elapsed bool serial_log; // print serial output to stderr (blargg tests) + int serial_out_fd; // if >=0, transmitted serial bytes written here (stdout) + int serial_in_fd; // if >=0, received serial bytes read here (stdin), else 0xFF }; void gb_init(GB *gb); -- cgit v1.3.1-sl0p