From 0b30297393430450486ce54ba5c3c47155a0dc68 Mon Sep 17 00:00:00 2001 From: gbc dev Date: Thu, 16 Jul 2026 16:06:49 +0200 Subject: main/gb: --keys button-script harness + serial_no_eof for OSK testing --keys "udlrabse." plays scripted joypad taps (each char = one button held 10 frames then released 10, so the guest sees a clean edge); pairs with --headless --shot to drive on-screen input and capture the result. When --keys is active, serial-RX EOF stays pending instead of sending $04, so a shell blocked on read waits for OSK input instead of exiting. --- src/gb.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/gb.c') diff --git a/src/gb.c b/src/gb.c index 3caa986..fc19e25 100644 --- a/src/gb.c +++ b/src/gb.c @@ -140,9 +140,11 @@ void gb_write(GB *gb, u16 addr, u8 val) { gb->sc &= ~0x80; gb_request_interrupt(gb, INT_SERIAL); } else if (n == 0) { - gb->sb = 0x04; // EOF -> EOT (Ctrl-D) - gb->sc &= ~0x80; - gb_request_interrupt(gb, INT_SERIAL); + if (!gb->serial_no_eof) { + gb->sb = 0x04; // EOF -> EOT (Ctrl-D) + gb->sc &= ~0x80; + gb_request_interrupt(gb, INT_SERIAL); + } // else: stay pending (OSK provides input) } // n < 0 (EAGAIN on a live tty): stay pending, poll again } -- cgit v1.3.1-sl0p