Looks like this one is affected by the same player 2 input bug as s9x official. Rough mirror of the fix; the difference is port 1 gets controllers 1, 3, 5 and 7, and port 2 gets 2/4/6/8; this gets rid of a bitshift in the most common situation (joypad that isn't multitap).
Copy the cheat support code from the git commits of mainline.
Add cheat support (if that isn't in another commit), fix possible crash if a frontend is weird when it comes to variables.