srg320 / Saturn_MiSTer

159 stars 15 forks source link

SMPC joystick peripheral handling #6

Closed NolanNicholson closed 1 year ago

NolanNicholson commented 1 year ago

What does this do / why do we need it?

This change adds SMPC peripheral handling for the Arcade Racer wheel controller, the Mission Stick (single and dual configurations), and the Saturn 3D Pad.

Type of change

What should a reviewer look out for in this PR?

Pad SMPC data and OREG values were checked in the SmpcTest_1 and sdm_repack_2 ROMs, and was consistent with the pads' behavior in Mednafen. I also spot-checked the behavior of each pad using a compatible game. For example, SmpcTest_1 displays the Dual Mission Stick as an invalid input, but the dual stick seemed to work fine in Panzer Dragoon II Zwei.

Additional Comments (if any)

This PR only implements SMPC handling for these peripherals, so anything using SH-2 Direct for anything except the gamepad still won't work yet.

For now, only joysticks are supported - no mouse, keyboard, etc.

Analog triggers are not yet available in the framework, so those are just set to 0 for now. Ideally, the framework will be changed so that analog trigger data is also passed through hps_io and made available to the core.