This shop on Tindie sells modified Chinese NES64 controller rip-offs that connect directly to any 9-pin joystick connectors. The mod is available as a kit or fully assembled and ready to plug into your game port.
It depends on what you call "compatible". On any DB9 joystick, the directions and at least 1 button will work
If you're aiming 1 button joystick, then you can pick any controller you'll find a button that works.
Now if you need 2 buttons, only sega controllers have a chance to work, but the buttons that work aren't the most naturally located. I ...
The Amiga 9-pin joystick port is compatible with:
Atari 800/VCS joysticks and paddles;
Atari ST joysticks;
Commodore Vic-20, C64, C64GS and C128 joysticks;
Commodore Amiga computer joysticks and joypads; and
Amiga CD32 joypads.
This table from Wikipedia's page on the Atari Joystick Port showing the pin assignments of various systems using a 9-pin input ...
The PET keyboards did have something akin to scan codes. Electrically, the keys were arranged in a matrix of rows and columns, and scanning the keyboard involved selecting each row in sequence (via one of the PIA chips), then reading the column values to see which (if any) keys in that row were pressed. Since there were two keyboard layouts (the 'graphics' ...