The NEW Build Your Own Arcade Controls

Main => Software Forum => Linux => Topic started by: MacGyver on July 06, 2018, 07:59:50 pm

Title: RGBCommander + AttractMode + Supermodel or Daphne minus RetroPie (plain Linux)
Post by: MacGyver on July 06, 2018, 07:59:50 pm
I've been trying but can't seem to get an Attract-mode launched non-MAME emulator to display anything but the "default" lighting scheme when launched.

here is what I have in my rgbcmdd.xml file for the Model3 emulator Supermodel.
Code: [Select]
<emulator binary="supermodel" arcade="0" name="Sega Model 3" active="White" inactive="Off" retropie="0">
<rom id="default" way="8">
<control name="P1_START" colour="White"/>
<control name="P1_COIN" colour="White"/>
<rom id="fvipers2" way="8">
<control name="P1_COIN" colour="White"/>
<control name="P1_START" colour="White"/>
<control name="P1_BUTTON1" colour="White"/>
<control name="P1_BUTTON2" colour="White"/>
<control name="P1_BUTTON3" colour="White"/>
<control name="P1_JOYSTICK" colour="White"/>
<control name="P2_COIN" colour="White"/>
<control name="P2_START" colour="White"/>
<control name="P2_BUTTON1" colour="White"/>
<control name="P2_BUTTON2" colour="White"/>
<control name="P2_BUTTON3" colour="White"/>
<control name="P2_JOYSTICK" colour="White"/>

it is launched by Attractmode like this:

Code: [Select]
/arcade/model3/supermodel /arcade/model3/Roms/ -fullscreen -crosshairs=1 -res=800,600 -new3d

from the Attractmode emulator config file configured like this:
Code: [Select]
executable           /arcade/model3/supermodel
args                    [rompath][name][romext] -fullscreen -crosshairs=1 -res=800,600 -new3d
rompath               /arcade/model3/Roms/
romext                .zip

I have also tried it this way in case RGBC was looking at the last argument for the rom name:

Code: [Select]
/arcade/model3/supermodel -fullscreen -crosshairs=1 -res=800,600 -new3d /arcade/model3/Roms/

Daphne behaves the same way, it will use the default rom lighting scheme, but never the scheme from the rom launched.
I just figured that was because the method for launching Daphne was a billion times more crazy and RGBC couldn't figure it out.
Code: [Select]
executable           /arcade/daphne/daphne.bin
args                    singe vldp -fastboot -fullscreen_window -x 320 -y 240 -noissues -scanlines -min_seek_delay 100 -seek_frames_per_ms 20 -nolog -noserversend -opengl -homedir /home/user/.daphne -framefile /home/user/.daphne/vldp_dl/[name]/[name]_framefile.txt -script /home/user/.daphne/vldp_dl/[name]/cdrom-[name].singe
rompath              /home/user/.daphne/roms/
romext                .zip

Could you explain how to configure a non-Retropie method for configuring emulators other than MAME? (which works perfectly the way  :cheers:)

Thanks again for all the help already.
Title: Re: RGBCommander + AttractMode + Supermodel or Daphne minus RetroPie (plain Linux)
Post by: ZoOl007 on July 11, 2018, 04:48:57 pm
I don't have enough info with what you wrote but you are running recent mame version on linux that supports the new network communication system, you have attractmode as your frontend and you are not using the retropie system/distro and you are running on amd64 yes?
If so the mame integration functions because the moment RGBcommander sees the mame process it starts to talk to it and that way I can detect the running rom and light leds and switch joysticks accordingly. That's why I call it fe-agnostic eg you don't have to do anything special in the fe - you just need to launch the rom.
Now if you launch a non-mame emu RGBcommander sees that process but it can't talk to it because the emu doesn't support it hence it'll light default leds. Makes sense.
Now you can work around it using the set rom feature using rgbcmdcon. The idea is that you tell the daemon that you are going to launch for example the rom 'myVeryOwnRom' before you launch the emu XYZ. RGBcommander sees a known process (here XYZ) and given that the XYZ's emu section contains and entry for myVeryOwnRom it'll act accordingly.
You can make a shell script that you use as a launcher and first call rgbcmdcon and then start your emu
just open a shell prompt and type rgbcmdcon <enter> and then ? <enter> and it'll show all options. Among those you'll find
set,rom,<rom>   forces supplied rom instead of the default one for the next normal emu process
and that one can be passed as args to rgbcmdcon in your launcher. You can test it from an interactive rgbcmdcon session and by tailing the log.
Just give it a go - you'll sort it out just fine.
It is documented in the xml too

If you should be wondering how everything just works in retropie or recallbox that's because it works in a similar fashion but I automated it - it is not with rgbcmdcon but it's more or less the same methodology but using what's available in both distro's launcher system

Title: Re: RGBCommander + AttractMode + Supermodel or Daphne minus RetroPie (plain Linux)
Post by: MacGyver on July 11, 2018, 08:04:02 pm
That was exactly what I needed spelled out for me.

I used that info and an existing Attract-Mode plugin to hack together this AT plugin for RGBCommander.

It's simple and could be better but it works, share it with whomever you wish to make their non-mame installs easier.

Code: [Select]
// Attract-Mode Frontend - RBGCommander plugin
// For use with the Linux RGBCommander program.
// Used to inform rgbcmdcon of the rom name of
// non-mame emulators so that the lighting can work
// (shamelessly hacked from the UltraStik360 plugin)

// The UserConfig class identifies plugin settings that can be configured
// from Attract-Mode's configuration menu
class UserConfig </ help="Integration plug-in for use with RGBCommander software made by ZoOl007:" /> {

</ label="Command", help="Path to the RGBC executable", order=1 />


local config=fe.get_config(); // get user config settings corresponding to the UserConfig class above

// Copy the configured values from uconfig so we can use them
// whenever the transition callback function gets called

fe.add_transition_callback( "rgbc_plugin_transition" );

function rgbc_plugin_transition( ttype, var, ttime ) {

if ( ScreenSaverActive )
return false;

switch ( ttype )
case Transition.ToGame:
fe.plugin_command( config["command"], " set,rom," + fe.game_info( Info.Name ));

return false; // must return false

Thanks again for your help.  :cheers: