diff --git a/package/batocera/core/batocera-configgen/configgen/configgen/generators/cemu/cemuControllers.py b/package/batocera/core/batocera-configgen/configgen/configgen/generators/cemu/cemuControllers.py index a468406c64c..7065b05461e 100644 --- a/package/batocera/core/batocera-configgen/configgen/configgen/generators/cemu/cemuControllers.py +++ b/package/batocera/core/batocera-configgen/configgen/configgen/generators/cemu/cemuControllers.py @@ -20,7 +20,10 @@ def generateControllerConfig(system, playersControllers): WIIMOTE = "Wiimote" API_SDL = "SDLController" + API_DSU = "DSUController" + DEFAULT_IP = 'localhost' + DEFAULT_PORT = '26760' DEFAULT_DEADZONE = '0.25' DEFAULT_RANGE = '1' @@ -212,6 +215,15 @@ def getConfigFileName(controller): addTextElement(entryNode, "mapping", key) addTextElement(entryNode, "button", value) + # Add motion control + if (system.isOptSet('cemuhook_server_port')): + motionControllerNode = ET.SubElement(root, 'controller') + addTextElement(motionControllerNode, 'api', API_DSU) + addTextElement(motionControllerNode, 'uuid', '0') + addTextElement(motionControllerNode, 'motion', 'true') + addTextElement(motionControllerNode, 'ip', getOption('cemuhook_server_ip', DEFAULT_IP)) + addTextElement(motionControllerNode, 'port', getOption('cemuhook_server_port', DEFAULT_PORT)) + # Save to file with open(getConfigFileName(nplayer), 'wb') as handle: tree = ET.ElementTree(root) diff --git a/package/batocera/core/batocera-configgen/configgen/configgen/generators/citra/citraGenerator.py b/package/batocera/core/batocera-configgen/configgen/configgen/generators/citra/citraGenerator.py index 0f87b8c7363..92f7873cb1a 100644 --- a/package/batocera/core/batocera-configgen/configgen/configgen/generators/citra/citraGenerator.py +++ b/package/batocera/core/batocera-configgen/configgen/configgen/generators/citra/citraGenerator.py @@ -245,6 +245,18 @@ def writeCITRAConfig(citraConfigFile, system, playersControllers): # We only care about player 1 if controller.player != "1": continue + if system.isOptSet("citra_motion_device"): + citraConfig.set("Controls", "profiles\\1\\motion_device", system.config["citra_motion_device"]) + citraConfig.set("Controls", "profiles\\1\\motion_device\\default", "false") + if system.isOptSet("citra_touch_device"): + citraConfig.set("Controls", "profiles\\1\\touch_device", system.config["citra_touch_device"]) + citraConfig.set("Controls", "profiles\\1\\touch_device\\default", "false") + if system.isOptSet("citra_udp_input_address"): + citraConfig.set("Controls", "profiles\\1\\udp_input_address", system.config["citra_udp_input_address"]) + citraConfig.set("Controls", "profiles\\1\\udp_input_address\\default", "false") + if system.isOptSet("citra_udp_input_port"): + citraConfig.set("Controls", "profiles\\1\\udp_input_port", system.config["citra_udp_input_port"]) + citraConfig.set("Controls", "profiles\\1\\udp_input_port\\default", "false") for x in citraButtons: citraConfig.set("Controls", "profiles\\1\\" + x, f'"{CitraGenerator.setButton(citraButtons[x], controller.guid, controller.inputs)}"') for x in citraAxis: