Author Topic: Launch before comand line Attract-Mode  (Read 3678 times)

Davsouto

  • Newbie
  • *
  • Posts: 3
    • View Profile
Launch before comand line Attract-Mode
« on: February 07, 2019, 03:57:41 PM »
Hello,
I am creating a series of .ini files to add together with DOFLinx to my cabinet with Attract Mode in Windows 10.
This will serve to have addressable LEDs in each game of MAME and when pressing a button, put coin or press start make a play of lights or show a message etc.
My problem arises that to be able to do this I need that every time a game is launched from the frontend, the following command line should be executed:
c:\directoutput\DOFLinxMSg.exe "SUP_ini=MAME\[gamename]"
Does anyone know how to do this?
On the other hand I also have doubts if the frontend calls each game [gamename] or [game] or [name].
I'm sorry for my English but I do not speak English very well.
I thank you very much and as soon as I can upload a video of the project.

rand0m

  • Sr. Member
  • ****
  • Posts: 343
    • View Profile
Re: Launch before comand line Attract-Mode
« Reply #1 on: February 08, 2019, 02:15:53 AM »
Hello,
I am creating a series of .ini files to add together with DOFLinx to my cabinet with Attract Mode in Windows 10.
This will serve to have addressable LEDs in each game of MAME and when pressing a button, put coin or press start make a play of lights or show a message etc.
My problem arises that to be able to do this I need that every time a game is launched from the frontend, the following command line should be executed:
c:\directoutput\DOFLinxMSg.exe "SUP_ini=MAME\[gamename]"
Does anyone know how to do this?
On the other hand I also have doubts if the frontend calls each game [gamename] or [game] or [name].
I'm sorry for my English but I do not speak English very well.
I thank you very much and as soon as I can upload a video of the project.

I have a note just for that in OneNote :D.

For a rom at  D:\Games\Penny.bin

[name] = Penny
[romext] = bin
[rompath]= D:\Games
[romfilename] = D:\Games\Penny.bin

Note: use asteriks "" if space in name



As for launching a command with/before every game:
1- Elegant way would be to utilize AM's built-in ability to pass arguments to emulator from layout and go forward from there. Its discussed here > https://github.com/mickelson/attract/commit/593ddc387cf3c9e9ca8ff7cbe992fe9a4c7791d4. I never personally used it but I would start with something like this:
Code: [Select]
if ("set of value" == true) return fe.plugin_command_bg("cmd.exe /C"....
2- Use a batfile which runs mame and DOFLinxMSg.exe together, this will be done in AM/emulators/[emulator].cfg. This will work and I personally use something like this for one system. The cfg I am using is:
Code: [Select]
executable           cmd
args                 /c cd "D:\Tools\Controller Tools\Antimicro\Antimicro v2.23 (x32)" & start "" antimicro.exe --hidden "D:\Tools\Controller Tools\Antimicro\Antimicro Profiles\[name].gamecontroller.amgp" & start "" /wait "[romfilename]" & call "D:\Tools\Controller Tools\Antimicro\exit-antimicro.bat"

^ Code is a work of beauty if I say so my self :D

You can call the emulator.exe & start the DOFLinxMsg. @hermine.potter has some great scripts for these kind of setups, so searching Emulators (in related stuff) will be helpful
« Last Edit: February 08, 2019, 02:19:36 AM by rand0m »

Davsouto

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Launch before comand line Attract-Mode
« Reply #2 on: February 09, 2019, 06:02:27 AM »
Thanks for responding so fast, I've been testing the bat option in emulators.cfg and it works but not quite right.
I explain:
This is the code that I wrote:
Code: [Select]
executable cmd
args /c start "" d:\hyperpc\Rocketlauncher\rocketlauncher.exe -s "[emulator]" -r "[name]" -p AttractMode & start /b c:\directoutput\doflinxmsg.exe "sup_ini=MAME\[name]"
rompath D:\HyperPC\Roms\arcade
romext .zip

I got the executable doflinxmsg.exe to recognize each game and look for each .ini file in the MAME folder but the problem arises when I launched the game from rocketlauncher through attract mode.
Instead of focusing the screen in the game through the emulator (Retroarch in my case) the screen is locked in the fade in of rocketlauncher and the emulator in the background.
In order to visualize the game I have to press ALT + TAB and for more tests that I have done I can not focus on the emulator.
Do you know or does anyone know how to fix it?
Any other way to implement the DOFLinxmsg script in retroarch or in AttractMode?
Thanks in advance.

rand0m

  • Sr. Member
  • ****
  • Posts: 343
    • View Profile
Re: Launch before comand line Attract-Mode
« Reply #3 on: February 10, 2019, 02:29:33 AM »
Sorry I have no hands on exp with rocketlauncher, the code seems to be ok. Forum member Keil has developed a fade to game plugin > https://github.com/keilmillerjr/fadetogame-plugin You can run AM directly with fade to game plugin enabled to check if same behavior is repeated.