Attract-Mode Support Forum
Attract-Mode Support => General => Topic started by: prefor on June 07, 2020, 12:40:34 PM
-
Hello i'm trying to run my PSX games through a .bat file.
The only reason why i want to to run it through .bat file is because i can open 2 programs simultaneously or together, in this case both ePSXE and Antimicro.
I have configured Antimicro so i can save state and load state using my controller.
This is the code i wrote:
@ECHO OFF
start /d "C:\AttractMode\emulators\Playstation\antimicro" antimicro.exe
start /WAIT /d "C:\AttractMode\emulators\Playstation" ePSXe.exe -nogui -loadbin "[romfilename]"
Taskkill /IM Antimicro.exe /F
When i try to launch a game in Attract Mode, both Antimicro and ePSXe launches just fine, BUT i only get a black screen in ePSXe and nothing more. I don't think it loads the game correctly somehow.
I dont think "[romfilename]" work unless we remove the "[romfilename]" and specify it with a game. But if I do that, all the game that I choose will play that specific game...
Does someone know how i can fix this problem?
Or if there is an easier way for Antimicro to open whenever i launch a PSX game? :)
-
Hi.
[romfilename] is an "attractmode-specific" variable.
external programs cant deal with it.
you have to do it with a parameter transfer via commandline parameters (https://www.robvanderwoude.com/parameters.php) : %1
1) direct batch start:
for example to start notepad via batch file direct:@echo off
notepad
2) start batchfile Test123.bat and give notepad as parameter to this file Test123.bat:
using first commandline parameter:@echo off
%1
If you goto commandline and type : Test123.bat notepad
the batchfile Test123.bat starts.
get notepad as parameter
and replace %1 with notepad
or you can use commandline paremeters direct in AM.
I'm using this config for my OpenBOR-Games:
executable cmd
args /c cd C:\attract\EMU\OpenBOR\[name] & start OpenBOR.exe & start C:\attract\EMU\OpenBOR\wait_for_ESC.exe
rompath C:\attract\EMU\OpenBOR
romext <DIR>
-
Hi.
[romfilename] is an "attractmode-specific" variable.
external programs cant deal with it.
you have to do it with a parameter transfer via commandline parameters (https://www.robvanderwoude.com/parameters.php) : %1
1) direct batch start:
for example to start notepad via batch file direct:@echo off
notepad
2) start batchfile Test123.bat and give notepad as parameter to this file Test123.bat:
using first commandline parameter:@echo off
%1
If you goto commandline and type : Test123.bat notepad
the batchfile Test123.bat starts.
get notepad as parameter
and replace %1 with notepad
or you can use commandline paremeters direct in AM.
I'm using this config for my OpenBOR-Games:
executable cmd
args /c cd C:\attract\EMU\OpenBOR\[name] & start OpenBOR.exe & start C:\attract\EMU\OpenBOR\wait_for_ESC.exe
rompath C:\attract\EMU\OpenBOR
romext <DIR>
Thank you very much for replying! You have no idea how much I have played around with the dam codes! xD
Everything works smoothly with the others emulators except this one :P
I'm not 100% sure I understood about the %1 and what command I should use to get similar to mine, but I will see what i can do about it when I get home. :)
Hmm I didn't know we could use commandline parameters in AM directly.
But will it work even if I put the /Wait command and Taskkill /IM Antimicro.exe /F ??
I want it to force taskkill Antimicro when I close ePSXe emulator.
-
or you can use commandline paremeters direct in AM.
I'm using this config for my OpenBOR-Games:
executable cmd
args /c cd C:\attract\EMU\OpenBOR\[name] & start OpenBOR.exe & start C:\attract\EMU\OpenBOR\wait_for_ESC.exe
rompath C:\attract\EMU\OpenBOR
romext <DIR>
---------------------------------------------
UPDATE
I just want to write that i finally managed to fix it thanks to your tip! :D
I was missing something that's why it didn't work, but here is the complete code if anyone have similar problem.
Whenever i launch a game through AM, Antimicro/Xpadder/Joy2key launches. And whenever i close the game, Antimicro also closes. With this, my configured keys in antimicro will close all together and won't interfere the hotkeys i have in Retroarch if I change game or emulator :)
# Generated by Attract-Mode v2.6.1
#
executable cmd
args /c cd C:\AttractMode\emulators\Playstation\ & start antimicro.exe --no-tray & start /WAIT ePSXe.exe -nogui -loadbin "[romfilename]" & Taskkill /F /IM antimicro.exe
rompath C:\AttractMode\roms\Playstation\
romext .cue;.PBP;.iso
system Sony Playstation
info_source thegamesdb.net
artwork flyer C:\AttractMode\roms\Playstation\media\flyer
artwork marquee C:\AttractMode\roms\Playstation\media\marquee
artwork snap C:\AttractMode\roms\Playstation\media\snap
artwork wheel C:\AttractMode\roms\Playstation\media\wheel
Thank you very much @hermine.potter :D
-
I'm try to explain %1 parameter with the emulator zsnes (for snes games):
>zsnes started from CMD (the ordinary common way):
"C:\attract\EMU\zsnes\zsnesw.exe" -m "C:\attract\EMU\zsnes\ROMS\MyGame123.smc"
entered in AM:executable C:\attract\EMU\zsnes\zsnesw.exe
args -m "[romfilename]"
rompath C:\attract\EMU\zsnes\ROMS
romext .smc
>starting games via single game batches (each game got own batch file (for example : TestGame123.bat starts TestGame123.smc)):
content of TestGame123.bat:@echo off
"C:\attract\EMU\zsnes\zsnesw.exe" -m "C:\attract\EMU\zsnes\ROMS\TestGame123.smc"
entered in AM:executable cmd /c
args "[romfilename]"
rompath C:\attract\EMU\zsnes\ROMS
romext .bat
>general starter with dynamic commandline parameter %1:
create a general STARTER.bat with this content:@echo off
"C:\attract\EMU\zsnes\zsnesw.exe" -m %1
entered in AM:executable C:\attract\EMU\zsnes\STARTER.bat
args "[romfilename]"
rompath C:\attract\EMU\zsnes\ROMS
romext .smc
If you start a Game in AM (for example Test123.smc, this command starts in CMD:
"C:\attract\EMU\zsnes\STARTER.bat" "C:\attract\EMU\zsnes\ROMS\Test123.smc"
Within STARTER.bat %1 will be replaced by C:\attract\EMU\zsnes\ROMS\Test123.smc