P78 takes the input IRQ proof from P77 and uses it to send real Erlang
messages. The game server subscribes with chip:input_subscribe/0.
When sys_poll_events sees that the M-mode input IRQ counter changed,
it drains the MMIO FIFO and sends {input, Event} to that subscribed
process with globalcontext_send_message.
That gives the interactive game the architecture we wanted:
host key -> RTL FIFO -> input IRQ -> trap counter
-> sys_poll_events -> Erlang mailbox -> game server
The implementation is intentionally narrow. It does not install AtomVM’s
generic listener/port-driver machinery, and timeout waits are still
mtime busy-polls. But controls now arrive as ordinary mailbox messages
instead of requiring the game to poll chip:input_events/0.
Verification:
cd projects/78_atomvm_irq_mailbox/test
make all
make verilator-run-input-smoke
The passing smoke delivered six host events, sent six Erlang mailbox
messages, reported input mailbox delivered: 6, reported nonzero input
IRQ count, drained FIFO status to 0, rendered one frame, and halted
PASS after 15,456,265 post-load cycles.
Honest status: RTL simulation only. Generic AtomVM listener/port-driver integration was NOT RUN. F/D compliance was NOT RUN. LibreLane hardening was NOT RUN.