aboutsummaryrefslogtreecommitdiffstats
path: root/src/gb.c
diff options
context:
space:
mode:
authorgbc dev <gbc@localhost>2026-07-16 16:06:49 +0200
committergbc dev <gbc@localhost>2026-07-16 16:06:49 +0200
commit0b30297393430450486ce54ba5c3c47155a0dc68 (patch)
tree2d978d65bc50e99a95e7e9c8a56d3cbdfb68d093 /src/gb.c
parentmain: --shot with --headless dumps final LCD on exit (diff)
downloadsl0pboy-0b30297393430450486ce54ba5c3c47155a0dc68.tar.gz
sl0pboy-0b30297393430450486ce54ba5c3c47155a0dc68.tar.xz
sl0pboy-0b30297393430450486ce54ba5c3c47155a0dc68.zip
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.
Diffstat (limited to 'src/gb.c')
-rw-r--r--src/gb.c8
1 files changed, 5 insertions, 3 deletions
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
}