This is the keymapping of the original C64.
If you run a game on the c64 and it says "Push fire on joystick in port 2"
By pressing "C=" & "K" the game would start.
the joystick control lines of both Control ports are directly connected to CIA1 6526. same connections as the keyboard.
The paddles wonn't work, because they were connected to the SID.
So as long as the CIA emulation works, the MEGA will interpret those inputs as joystick.
Voila, joysticks would work.
(At least, theoretically ;-) )