Skip to content

Commit 2065e84

Browse files
author
Alexandre Derumier
committed
liretro: fix modern arcade stick alt layout
The current implementation in lr-mame with mapping through .cfg is not (or not work anymore) with trigger axis for L2 R2. That break modern arcade stick alternative layout. This patch is fixing, doing the switch of L1 R1 -> R1 R2 in the retroarch remap directly. (and the classic layout is still done in lr-mame cfg) Also add support for fbneo && flycast core
1 parent 01a70a0 commit 2065e84

File tree

3 files changed

+25
-10
lines changed

3 files changed

+25
-10
lines changed

Diff for: package/batocera/core/batocera-configgen/configgen/configgen/generators/libretro/libretroControllers.py

+9
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,15 @@ def generateControllerConfig(
113113
'pageup': 'l', 'pagedown': 'r', 'l2': 'l2', 'r2': 'r2', \
114114
'l3': 'l3', 'r3': 'r3', \
115115
'start': 'start', 'select': 'select'}
116+
117+
# X Y L1 L2 ---> X Y R1 L1
118+
# A B R1 R2 ---> A B R2 L2
119+
if system.isOptSet("altlayout") and system.config["altlayout"] == "fightstick":
120+
retroarchbtns['pageup'] = 'l2'
121+
retroarchbtns['pagedown'] = 'l'
122+
retroarchbtns['l2'] = 'r2'
123+
retroarchbtns['r2'] = 'r'
124+
116125
retroarchGunbtns = {'a': 'aux_a', 'b': 'aux_b', 'y': 'aux_c', \
117126
'pageup': 'offscreen_shot', 'pagedown': 'trigger', \
118127
'start': 'start', 'select': 'select'}

Diff for: package/batocera/core/batocera-configgen/configgen/configgen/generators/libretro/libretroMAMEConfig.py

+4-10
Original file line numberDiff line numberDiff line change
@@ -505,26 +505,20 @@ def getMameControlScheme(system: Emulator, rom: Path) -> str:
505505

506506
romName = rom.stem
507507
if romName in capcomList:
508-
if controllerType in [ "auto", "snes" ]:
508+
if controllerType in [ "auto", "snes", "fightstick" ]:
509509
return "sfsnes"
510510
if controllerType == "megadrive":
511511
return "megadrive"
512-
if controllerType == "fightstick":
513-
return "sfstick"
514512
elif romName in mkList:
515-
if controllerType in [ "auto", "snes" ]:
513+
if controllerType in [ "auto", "snes", "fightstick" ]:
516514
return "mksnes"
517515
if controllerType == "megadrive":
518516
return "mkmegadrive"
519-
if controllerType == "fightstick":
520-
return "mkstick"
521517
elif romName in kiList:
522-
if controllerType in [ "auto", "snes" ]:
518+
if controllerType in [ "auto", "snes", "fightstick" ]:
523519
return "kisnes"
524520
if controllerType == "megadrive":
525521
return "megadrive"
526-
if controllerType == "fightstick":
527-
return "sfstick"
528522
elif romName in neogeoList:
529523
return "neomini"
530524
elif romName in twinstickList:
@@ -533,7 +527,7 @@ def getMameControlScheme(system: Emulator, rom: Path) -> str:
533527
return "qbert"
534528
else:
535529
if controllerType == "fightstick":
536-
return "fightstick"
530+
return "sfsnes"
537531

538532
return "default"
539533

Diff for: package/batocera/emulationstation/batocera-es-system/es_features.yml

+12
Original file line numberDiff line numberDiff line change
@@ -1644,6 +1644,12 @@ libretro:
16441644
choices:
16451645
"Off": always hide
16461646
"On": always show
1647+
altlayout:
1648+
prompt: SPECIAL CONTROL LAYOUTS
1649+
description: Controls for 5/6 button games and other unique controls
1650+
choices:
1651+
"Default Only": "default"
1652+
"Modern Fightstick Style": "fightstick"
16471653
systems:
16481654
neogeo:
16491655
cfeatures:
@@ -1941,6 +1947,12 @@ libretro:
19411947
choices:
19421948
"Off": 0
19431949
"On": 1
1950+
altlayout:
1951+
prompt: SPECIAL CONTROL LAYOUTS
1952+
description: Controls for 5/6 button games and other unique controls
1953+
choices:
1954+
"Default Only": "default"
1955+
"Modern Fightstick Style": "fightstick"
19441956
systems:
19451957
atomiswave:
19461958
cfeatures:

0 commit comments

Comments
 (0)