KeyStatusHandlerRaw in the Circle baremetal kernel dropped the
ucModifiers byte and sized the keyboard state arrays to 0x100 entries,
too small for libretro modifier keycodes (RETROK_LSHIFT=304, etc.).
As a result, holding Shift (or Ctrl/Alt) produced no XT scan code in
the shared frontend, so shifted key combinations never worked.
- Translate ucModifiers bits to RETROK_LCTRL/LSHIFT/LALT/RCTRL/RSHIFT/RALT
so the existing RETROK_LSHIFT -> 0x2A / RETROK_RSHIFT -> 0x36 mapping
in src/frontend/core.c fires correctly.
- Resize key_states/key_states_current and the dispatch / input_state
loops from 0x100 to RETROK_LAST so modifier and other high keycodes
fit and are not silently truncated.
- Add bounds guard for mapped raw keycodes.
Also stages long-pending packaging fixes in tools/package/rpi/package-rpi.sh
(Pi 4/5 KERNEL_MAX_SIZE bump, Pi 4 family DTBs, disable_splash, [pi400]
and [cm4] stanzas) and updates docs/STATUS.md.
Verified with 'make rpi' for Pi 3/4/5 and the new kernel images
written to /dev/sda1.
Replaces the synchronous Core 0 bridge with the guest-visible async
polling protocol that was proven working on Pi 3 USB floppy boot.
Core changes:
- Disk controller now handles VXT_DISK_NOT_READY from frontends
- Pending operation state tracks multi-sector transfers
- VXTX BIOS polls port 0xB1 and reads AL/AH from 0xB2/0xB3
- Added floppy_timing / harddrive_timing INI toggles
Circle frontend:
- vfs_read/vfs_write return VXT_DISK_NOT_READY for USB handles
- Core 0 processes blocking USB jobs via usb_disk_process()
- Core 1 BIOS polling loop runs without stalls
Docs:
- Added async completion protocol to SPEC.md
- Updated STATUS.md for verified Pi 3 USB floppy boot
Default Pi config remains safe (no USB passthrough enabled).
Implements lazy-resolution USB block device VFS layer that allows
USB floppy drives and USB sticks to be mounted as raw disk images
via machine.ini paths like A=usbfd: or C=umsd1:.
Key design decisions:
- No startup delay: USB devices are resolved on first I/O, allowing
POST to begin immediately while USB enumeration happens in background
- Supports both UFI floppy (usbfd:, ufd1:) and bulk-only mass storage
(usbhd:, umsd1:) device types
- Thread-safe: CSpinLock protects USB handle state across emulation
and USB interrupt threads
- Zero emulator core changes: all logic in frontend VFS layer
- Handles hot-plug gracefully: device re-resolved on each I/O call
Fixes:
- Correctly uses TRUE for bBlockDevice parameter in GetDevice() calls
(was FALSE, causing device lookup to always fail)
- Removes problematic pre-boot USB polling that broke keyboard enumeration
Tested on Raspberry Pi 3 Model B+ with USB floppy drive.
Pi 3 bare-metal improvements:
- Offload CRT filter to Core 2 via CRT_FILTER_EXTERNAL compile flag.
Core 1 queues frames; Core 2 worker (RenderThread) processes
asynchronously with 1-frame latency. Trampoline pattern in crt.c/h.
- Add 4:3 letterboxed scaling on Core 2 render thread.
HW framebuffer created once at physical display resolution
(CBcmFrameBuffer auto-detect); largest centered 4:3 rect computed,
black bars cleared once, nearest-neighbor scale into target rect.
- Raise KERNEL_MAX_SIZE to 0x1400000 (20 MB) across Circle Config.mk,
kernel Makefile, and package-rpi.sh to accommodate ~19 MB .bss.
- Add vxt_peripheral_print_status() in src/vxt/peripheral.c that logs
CPU type (8088/V20), frequency, installed peripherals, IO map ranges,
and memory map ranges. Called from retro_load_game() in core.c.
Refs: docs/STATUS.md
Fix four critical issues preventing VirtualXT from booting on Raspberry Pi 3B+:
1. vfs_file_load was a stub returning NULL - implement real VFS-backed
loader using peripheral arena allocator
2. setup_machine_from_ini never wired disk.file_api - refactor to two
passes (instantiate + wire APIs, then configure)
3. Missing vfs_tell in Circle kernel - null pointer crash when disk
mount tried to get file size
4. Libretro VFS seek returns position, but disk module expects POSIX
0/-1 - add adapter in disk_file_seek
Also:
- Add NO_DEFAULT_DISK and NO_SAMPLES build flags for baremetal size
- Replace GLABIOS.ROM with vxtbios.bin in raspberrypi.ini
- Add package-rpi.sh packaging script with cmdline.txt LOGFILE support
- Raise KERNEL_MAX_SIZE to 17 MB for Circle sysinit
- Clean up kernel error handling (halt() instead of error_halt)
- Update STATUS.md with known bugs and recent changes