Repository navigation
v1.01 — the serial keyboard, fixed on hardware
The serial keyboard needed four fixes since v1.0, three of them in the path between a key being pressed on the EXT port and the character reaching the document, all found because a Flipper Zero on the bench kept losing letters and keeping their Enters.
What was wrong
The receiver in the 315-5309 is a one-byte latch with no FIFO behind it. At 4800 baud a byte completes every 2 ms, and a frame is 16 ms — so anything that sends a line ending after each character puts two or three bytes on the wire back to back, and the servant was only looking once a frame.
The port is now serviced inside the frame, not once per it. uart_poll() runs from wait_vblank()'s spin loops, where the printer's transmit pump already lived, and from inside the frame's long stretches — the 4000-byte copy+diff, the tile converter, the cart sector loops — each of which runs for milliseconds without reaching the blank. GEOS-Genesis services its receiver from HBlank for the same reason.
An overrun no longer destroys the byte it spared. The first version handled the RERR flag by reading the latch and discarding the value, but on an overrun the latch holds the byte that survived. One read now serves both flags; RERR is counted, not acted on.
Each scancode is acknowledged before the next is posted. GA_KEY is a single latest-wins word, and one post per frame meeting one INT2 per frame held right up until a serial keyboard could type during a redraw. The sub now echoes each sequence byte through the COMFLG byte that has been dead since boot, and the servant holds its queue until the echo matches, with a half-second timeout against an older EmuTOS.
EJECT.PRG no longer calls a NULL pointer. A driver built without CONF_WITH_SCD_DIAG — the default, so every release build — publishes scd_api.snapshot as NULL by design rather than a stub returning zeros. CDTEST.PRG checks it; EJECT.PRG did not, so the first thing after Opening the tray... was a call through NULL, in supervisor mode, that walked the vector table as instructions until it hit Panic: Illegal Instruction, pc=00000030. It checks now.
Downloads
emutosmd-U.iso + emutosmd-U.cue |
the disc, NTSC-U. Download both into the same folder — the .cue names the .iso |
m1emu.bin |
512 KB Mode 1 cartridge |
SHA256SUMS.txt |
checksums for the three files above |
Disc: burn the .cue/.iso pair; slow burns read more reliably on real hardware. Region-locked — tools/build-iso.sh J|E builds the others, and J still does not boot.
Cartridge: flash m1emu.bin, Mega CD attached, tray empty. Region-free, and it works on a console whose drive no longer does.
Controls
| D-pad | pointer |
| A / B | left / right click |
| Start | on-screen keyboard |
A real keyboard runs on the EXT port at 4800 8N1, enabled from a key on the on-screen keyboard — that is the path these fixes are about. A Sega Mouse in port 2 works too.
Drives
C: |
ramdisk, system drive; rebuilt every boot |
D: |
the disc (disc boot only) |
I: |
internal backup RAM, 8 KB |
S: |
cartridge save RAM, or a CD Backup RAM Cart |
Options → Save Desktop writes to I:, and both boots read it. Format I: once with FORMATI.PRG first — that erases game saves, so copy them off with SRAMTOOL.PRG beforehand. Seat a backup RAM cart before powering on; hot-inserting one erases it.