Troubleshooting why PS4 wireless controllers do not work when started via Retrobat in the MAME64 emulator.
USB wired controllers all work fine in Retrobat and opening MAME64 with TI-99/4A emulator (they do not have this issue),
but the bluetooth PS4 wireless controllers is having issues (combination of Retrobat + Windows+ MAME64 ?)
Sometimes after turning off the PS4 controller (with the P button on the controller - hold for 10 seconds and then turning on might work once in a while).
In Retrobat in the C:\RetroBat\emulationstation\emulatorLauncher.log
2024-01-13 18:21:46.866 [INFO] --------------------------------------------------------------
2024-01-13 18:21:46.875 [INFO] [Startup] "C:\RetroBat\emulationstation\emulatorLauncher.exe" -p1index 0 -p1guid 030000004c050000cc09000000006800 -p1path "\\?\hid#{00001124-0000-1000-8000-00805f9b34fb}_vid&0002054c_pid&09cc#9&31f89a67&1&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}" -p1name "PS4 Controller" -p1nbbuttons 16 -p1nbhats 0 -p1nbaxes 6 -system ti99 -emulator mame64 -core mame64 -gameinfo "C:\Users\globe\AppData\Local\Temp\emulationstation.tmp\game.xml" -rom "C:\RetroBat\roms\ti99\MarioBrosE.rpk"
2024-01-13 18:21:46.934 [INFO] [Game] MarioBros
2024-01-13 18:21:47.020 [INFO] [Generator] Using Mame64Generator
2024-01-13 18:21:47.083 [INFO] [PadToKey] Loaded C:\RetroBat\emulationstation\.emulationstation\es_padtokey.cfg
2024-01-13 18:21:47.086 [INFO] [Running] C:\RetroBat\emulators\mame\mame.exe ti99_4a -skip_gameinfo -rompath C:\RetroBat\bios;C:\RetroBat\roms\ti99 -cfg_directory C:\RetroBat\bios\mame\cfg -inipath C:\RetroBat\bios\mame\ini -hashpath C:\RetroBat\bios\mame\hash -artpath C:\RetroBat\saves\mame\artwork -snapshot_directory C:\RetroBat\screenshots -ioport peb -ioport:peb:slot2 32kmem -ioport:peb:slot3 speech -cart C:\RetroBat\roms\ti99\MarioBrosE.rpk -state_directory C:\RetroBat\saves\mame\states -ctrlrpath C:\RetroBat\saves\mame\ctrlr -nofilter -verbose -throttle -sound dsound -video d3d -resolution auto -aspect auto -waitvsync -dial_device joystick -trackball_device joystick -paddle_device joystick -positional_device joystick -mouse_device joystick -joystickprovider dinput
2024-01-13 18:21:47.175 [INFO] [PadToKey] Add joystick PS4 Controller - Device:0, Player:1, Path:\\?\hid#{00001124-0000-1000-8000-00805f9b34fb}_vid&0002054c_pid&09cc#9&31f89a67&1&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
2024-01-13 18:22:22.230 [INFO] PS4 Controller - Device:0, Player:1, Path:\\?\hid#{00001124-0000-1000-8000-00805f9b34fb}_vid&0002054c_pid&09cc#9&31f89a67&1&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
2024-01-13 18:22:29.029 [INFO] [PadToKey] Add joystick PS4 Controller - Device:0, Player:1, Path:\\?\hid#{00001124-0000-1000-8000-00805f9b34fb}_vid&0002054c_pid&09cc#9&31f89a67&1&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
2024-01-13 18:22:29.034 [INFO] [PadToKey] Add joystick PS4 Controller - Device:0, Player:1, Path:\\?\hid#{00001124-0000-1000-8000-00805f9b34fb}_vid&0002054c_pid&09cc#9&31f89a67&1&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
2024-01-13 18:25:27.744 [INFO] PS4 Controller - Device:0, Player:1, Path:\\?\hid#{00001124-0000-1000-8000-00805f9b34fb}_vid&0002054c_pid&09cc#9&31f89a67&1&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
2024-01-13 18:25:27.748 [INFO] PS4 Controller - Device:0, Player:1, Path:\\?\hid#{00001124-0000-1000-8000-00805f9b34fb}_vid&0002054c_pid&09cc#9&31f89a67&1&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
2024-01-13 18:25:29.438 [INFO] [PadToKey] Add joystick PS4 Controller - Device:0, Player:1, Path:\\?\hid#{00001124-0000-1000-8000-00805f9b34fb}_vid&0002054c_pid&09cc#9&31f89a67&1&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
2024-01-13 18:25:29.443 [INFO] [PadToKey] Add joystick PS4 Controller - Device:0, Player:1, Path:\\?\hid#{00001124-0000-1000-8000-00805f9b34fb}_vid&0002054c_pid&09cc#9&31f89a67&1&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
2024-01-13 18:25:58.868 [INFO] PS4 Controller - Device:0, Player:1, Path:\\?\hid#{00001124-0000-1000-8000-00805f9b34fb}_vid&0002054c_pid&09cc#9&31f89a67&1&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
2024-01-13 18:25:58.872 [INFO] PS4 Controller - Device:0, Player:1, Path:\\?\hid#{00001124-0000-1000-8000-00805f9b34fb}_vid&0002054c_pid&09cc#9&31f89a67&1&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
2024-01-13 18:26:01.502 [INFO] [PadToKey] Add joystick PS4 Controller - Device:0, Player:1, Path:\\?\hid#{00001124-0000-1000-8000-00805f9b34fb}_vid&0002054c_pid&09cc#9&31f89a67&1&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
2024-01-13 18:28:26.857 [INFO] PS4 Controller - Device:0, Player:1, Path:\\?\hid#{00001124-0000-1000-8000-00805f9b34fb}_vid&0002054c_pid&09cc#9&31f89a67&1&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
then copied this command line (and added -ui_active, or use mame.ini in the \bios\mame\ini\mame.ini file (to set ui_active 1)
See video part 1 (seems to work):
PS4 controller paired with Windows and turned on (connected), then start MAME64 and exit, start-again, exit, etc. it seems to work properly.
(sometimes the PS4 controller is seen in MAME64, but does not react to buttons, then turn it off (P button on the controller hold for 10 sec.)
and turn it on again, then suddenly it might work (verify it with the menu (via TAB button), to see if the wireless device/joystick receives input signals.
via Command line:
C:\RetroBat\emulationstation>
C:\RetroBat\emulators\mame\mame.exe ti99_4a -skip_gameinfo -rompath C:\RetroBat\bios;C:\RetroBat\roms\ti99 -cfg_directory C:\RetroBat\bios\mame\cfg -inipath C:\RetroBat\bios\mame\ini -hashpath C:\RetroBat\bios\mame\hash -artpath C:\RetroBat\saves\mame\artwork -snapshot_directory C:\RetroBat\screenshots -ioport peb -ioport:peb:slot2 32kmem -ioport:peb:slot3 speech -cart C:\RetroBat\roms\ti99\MarioBrosE.rpk -state_directory C:\RetroBat\saves\mame\states -ctrlrpath C:\RetroBat\saves\mame\ctrlr -nofilter -verbose -throttle -sound dsound -video d3d -resolution auto -aspect auto -waitvsync -dial_device joystick -trackball_device joystick -paddle_device joystick -positional_device joystick -mouse_device joystick -joystickprovider dinput -ui_active
See video part 2 (does not work):
PS4 controller paired with Windows and turned on (connected), then start Retrobat.
You can start it directly C:\Retrobat\retrobat.exe
but using this batch file (as in Retrobat forum there are other emulators that might lock the controller as well),
but so far all my other emulators work fine, except the Retrobat MAME64 combination.
Weird enough the escape (hotkey) by pressing Select + Start works in the emulator to go back to Retrobat (or maybe Retrobat is still managing the PS4 Controller)
Retrobatstart.bat
@echo off
taskkill /f /im explorer.exe
retrobat.exe
set "emulatorProcess=emulationstation.exe"
:CHECK_PROCESS
tasklist /fi "imagename eq %emulatorProcess%" | findstr /i /c:"%emulatorProcess%" > nul
if %errorlevel% equ 0 (
timeout /nobreak /t 5 > nul
goto :CHECK_PROCESS
)
start explorer.exe
exit /b 0
MAME64 and exit, start-again, exit, etc. it seems to work properly.
(sometimes the PS4 controller is seen in MAME64, but it does not react to buttons, then turn it off (P button on the controller hold for 10 sec.)
and turn it on again, then suddenly it might work (verify it with the menu (via TAB button), to see if the wireless device/joystick receives input signals.
In the video the PS4 controller works fine Retrobat, but not when starting MAME64. (but other emulators work fine via Retrobat with the PS4 wireless controller)