guide: how to set up gyro controls in MAME
the steam controller 2 is rapturously good. you don't need me to tell you that. however, this guide should hopefully work with any controller that has integrated gyro, as long as it can be connected through steam input. it's probably not good enough for lightgun games (sorry, death crimson fans) but it should work with most things you throw at it, including some dial/spinner-based games (Bomb Bee plays very well this way) and turret-based rail shooters (this is probably the closest you can get to the actual arcade controls for Starblade short of building something custom).
MAME setup
go into general settings > input device options, and then set "Trackball Device Assignment", "AD Stick Device Assignment", "Paddle Device Assignment" and "Dial Device Assignment" all to mouse. then set "Mouse Input Provider" to "dinput". this step ensures that the games will be reading analogue input from the mouse rather than from the keyboard or controller analogue sticks.
you may also want to toggle on "Low latency" in advanced options to reduce latency. this is best paired with some experimentation with video mode in video options, but that's outside the scope of this guide (though i find bgfx gives me the lowest latency personally)
steam setup
add MAME to steam (games > add a non-steam game to my library > add the MAME executable) and make sure MAME is being launched through steam.
open steam's controller configuration and set gyro behavior to "gyro to mouse". you may also want to click the gear next to that setting and switch gyro enable/suppress/toggle to "toggle gyro on/off", and then choose a button to toggle the gyro function. i personally use an action set so i can switch between several control schemes for different arcade games, but that's out of the scope of this guide.
and yeah, that's pretty much it. all the other control mapping can be handled from within MAME itself, including inverting the Y axis on a per-game basis if needed.