It's programmable, you had to flip a switch, do each move on the joystick while pressing the corresponding key to have it learn, then flip the switch back. It of course forgot on power down so you had to teach it every time.
I opened it again yesterday and checked the few chips. It's actually much simpler than I thought :
- 2 * SN74LS367 (Hex Buffer Tri-State)
- 2 * N82S129N (1Kbit TTL bipolar PROM, 256*4bit)
- M58725P (2kB static RAM)
- 16 * 2200 ohm resistors
- 2 other resistors, 2 caps and 1 diode.
The joystick input goes to more address bits on the SRAM.
I think it uses the PROM to implement address decoding to snoop the VIA and PSG accesses, assert IOCONTROL and the SRAM chip enable, and then the SRAM sends whatever data was found on the data bus when learning for the same joystick move.
There must probably be some state machine because of how the keyboard is addressed through the PSG, but it's much simpler than I thought.
One interesting thing with this kind of design is the SRAM could possibly be dumped and restored with additional logic, maybe even auto-loaded when selecting some TAP or DSK if we had an integrated device.
Also, since the joystick input is taken as binary in the SRAM addresses, it means it can handle diagonals and move+fire as separate keys, unlike if it just mapped each direction to a key.
Ugh, now I just notice something very odd: all data bits of the SRAM are wired together, and apparently going nowhere. I suspect some trace goes from under the chip but it's really odd design. This means it can only serve as a single bit. Ah yes I think I saw the trace from under the chip. It goes through a diode then to pin 16 of the EXP connector, which is… D3, I didn't see this coming. Ohhh, right: the keyboard PCB actually asserts an input if the current matrix position is pressed, so both the column and row is scanned. And the PROM are there to map back the scanning to addresses on the SRAM, which then only knows when to tell if a key is pressed. I suppose there's a trick to keep the data on the PROM output around.
I'll be taking photos of the PCB to try and reverse-engineer it some more.