1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-22 02:32:36 +01:00

- fix analog_t required for some games

- changing mapping to better fit to games (for example, select is rarely used)

Signed-off-by: Nicolas Adenis-Lamarre <nicolas.adenis.lamarre@gmail.com>
This commit is contained in:
Nicolas Adenis-Lamarre 2023-02-04 10:38:52 +01:00 committed by Megamouse
parent 37b46df738
commit 0023716053
3 changed files with 17 additions and 9 deletions

View File

@ -894,23 +894,25 @@ static bool gun_input_to_pad(const u32 gem_no, be_t<u16>& digital_buttons, be_t<
digital_buttons |= CELL_GEM_CTRL_MOVE;
if (gun.handler.get_button(gem_no, gun_button::btn_middle) == 1)
digital_buttons |= CELL_GEM_CTRL_SELECT;
if (gun.handler.get_button(gem_no, gun_button::btn_1) == 1)
digital_buttons |= CELL_GEM_CTRL_START;
if (gun.handler.get_button(gem_no, gun_button::btn_2) == 1)
if (gun.handler.get_button(gem_no, gun_button::btn_1) == 1)
digital_buttons |= CELL_GEM_CTRL_CROSS;
if (gun.handler.get_button(gem_no, gun_button::btn_3) == 1)
if (gun.handler.get_button(gem_no, gun_button::btn_2) == 1)
digital_buttons |= CELL_GEM_CTRL_CIRCLE;
if (gun.handler.get_button(gem_no, gun_button::btn_4) == 1)
digital_buttons |= CELL_GEM_CTRL_SQUARE;
if (gun.handler.get_button(gem_no, gun_button::btn_3) == 1)
digital_buttons |= CELL_GEM_CTRL_SELECT;
if (gun.handler.get_button(gem_no, gun_button::btn_5) == 1)
digital_buttons |= CELL_GEM_CTRL_TRIANGLE;
if (gun.handler.get_button(gem_no, gun_button::btn_6) == 1)
digital_buttons |= CELL_GEM_CTRL_SQUARE;
analog_t = gun.handler.get_button(gem_no, gun_button::btn_left) ? 0xFFFF : 0;
return true;
}

View File

@ -26,7 +26,10 @@ const std::map<gun_button, int> button_map
{gun_button::btn_2, BTN_2},
{gun_button::btn_3, BTN_3},
{gun_button::btn_4, BTN_4},
{gun_button::btn_5, BTN_5}
{gun_button::btn_5, BTN_5},
{gun_button::btn_6, BTN_6},
{gun_button::btn_7, BTN_7},
{gun_button::btn_8, BTN_8}
};
struct event_udev_entry

View File

@ -14,7 +14,10 @@ enum class gun_button
btn_2,
btn_3,
btn_4,
btn_5
btn_5,
btn_6,
btn_7,
btn_8
};
class evdev_gun_handler