dinput: Move joystick mapping functions to the generic part.