Sorry for bumping such an old thread.
As pointed out in other threads, most notably here, the current M30 Bluetooth autoconf from the repo is wrong. @ SirBedwyr has the right values in his thread. (complying with the LXR/YBA format for the 6 face buttons)
I have slightly reworked his profile for d-input adding the “Heart” key as the Menu Toggle key and renamed “Mode” as “Minus (-)” so that is is easier to remap SNES or other systems. L & R on the M30 also mapped as L2 and R2 of the RetroPad. It should help with Saturn.
Haven’t checked X-Input / udev / USB mode yet but they may have the same issue?
# 8BitDo M30 BT - http://www.8bitdo.com/ - http://www.8bitdo.com/m30/
# Firmware v1.14 - http://support.8bitdo.com/
input_driver = "dinput"
input_device = "Bluetooth Wireless Controller "
input_device_display_name = "8BitDo M30"
input_vendor_id = "11720"
input_product_id = "1617"
# ---------------------------------------
input_b_btn = "1"
input_y_btn = "0"
input_select_btn = "10"
input_start_btn = "11"
input_a_btn = "7"
input_x_btn = "4"
input_l_btn = "3"
input_r_btn = "6"
input_l2_btn = "8"
input_r2_btn = "9"
input_menu_toggle_btn = "2"
input_b_btn_label = "B"
input_y_btn_label = "A"
input_select_btn_label = "Minus (-)"
input_start_btn_label = "START"
input_a_btn_label = "C"
input_x_btn_label = "Y"
input_l_btn_label = "X"
input_r_btn_label = "Z"
input_l2_btn_label = "L"
input_r2_btn_label = "R"
input_menu_toggle_btn = "Heart"
# ---------------------------------------
input_up_btn = "h0up"
input_down_btn = "h0down"
input_left_btn = "h0left"
input_right_btn = "h0right"
input_up_btn_label = "D-PAD UP"
input_down_btn_label = "D-PAD DOWN"
input_left_btn_label = "D-PAD LEFT"
input_right_btn_label = "D-PAD RIGHT"
input_l_x_plus_axis = "+0"
input_l_x_minus_axis = "-0"
input_l_y_plus_axis = "+1"
input_l_y_minus_axis = "-1"
input_l_x_plus_axis_label = "D-PAD RIGHT"
input_l_x_minus_axis_label = "D-PAD LEFT"
input_l_y_plus_axis_label = "D-PAD DOWN"
input_l_y_minus_axis_label = "D-PAD UP"
input_r_x_plus_axis = "+2"
input_r_x_minus_axis = "-2"
input_r_y_plus_axis = "+5"
input_r_y_minus_axis = "-5"
input_r_x_plus_axis_label = "D-PAD RIGHT"
input_r_x_minus_axis_label = "D-PAD LEFT"
input_r_y_plus_axis_label = "D-PAD DOWN"
input_r_y_minus_axis_label = "D-PAD UP"