Attract-Mode Support Forum
Attract-Mode Support => General => Topic started by: tommy on May 22, 2021, 04:32:53 AM
-
Well, this issue makes perfect logical sense but I wonder how to solve it. It is so basic I am surprised I failed to see someone else discuss it here (unless if I missed the thread)
As you probably all do, I sometimes use a batch or script to launch an emulator
ex
Batch file to launch dos box with a particular game
script file to launch Nintendo DS emulator then send Alt+Enter to maximise it
Issue is that the batch/script IS the executable file from AM's point of view
So when I press the exit hotkey, AM immediately terminates the batch file, but it doesn't terminate the ACTUAL EMULATOR EXE file
An example
I launch Keen (Dos Game) with a batch file that invokes Dosbox with the keen.exe file as a parameter
when I press the hotkey to terminate and return to AM, the batch file is terminated, but dosbox is still running in the background, and now I have so much noise because there is the video of keen playing on AM + the music of the actual game running in dosbox the background.
Is there a solution to this? Can I (somehow) program AM to terminate batch file PLUS dos box or go.vbs (script) PLUS Desmume?
Thanks heaps!
-
Let me ask it in another way:
When you press the exit hotkey set by attract mode, it immediately terminates the executable (that was set in settings)
but can I make it terminate more than one file? i.e the batch file (executable) PLUS the actual executable of the emulator
-
why not just use dosbox pure, via retroarch....it works so good...
-
Thanks for the reply but this is for my bartop that i built on an old laptop and there is an issue with the graphic driver that makes retroarch crash all the time :(
i.e so I am stuck with dosbox on its own
-
1- Use start /wait for running dosbox
2- Create another bat file for terminating dosbox and call it at the end. Something like following where dosbox.exe is the main executable:
taskkill /IM dosbox.exe /F
exit
-
1- Use start /wait for running dosbox
2- Create another bat file for terminating dosbox and call it at the end. Something like following where dosbox.exe is the main executable:
taskkill /IM dosbox.exe /F
exit
Perfect, but how do I call this batch file that terminates dosbox?
i.e is there a way to get AM to EXECUTE the batch file when i press the EXIT hotkey to close the emulator?
Thanks
-
im thinking this would do what u need...http://forum.attractmode.org/index.php?topic=3478.msg24371#msg24371 (http://forum.attractmode.org/index.php?topic=3478.msg24371#msg24371)
-
just my 2 cents, but somtime this old pc stuff might be time to go...i love to repurpose things...
but im thinking a pi3 might be like 40$ and you could use the screen from the old computer...
anyway back to work so i can by a new pc.....lol hope that helps
-
why not just use dosbox pure, via retroarch....it works so good...
Dosbox pure is not the best choice in this moment, I can't play some game in it. Dosbox core is the best :)
-
1- Use start /wait for running dosbox
2- Create another bat file for terminating dosbox and call it at the end. Something like following where dosbox.exe is the main executable:
taskkill /IM dosbox.exe /F
exit
Perfect, but how do I call this batch file that terminates dosbox?
i.e is there a way to get AM to EXECUTE the batch file when i press the EXIT hotkey to close the emulator?
Thanks
You can create a dosbox.bat in dosbox folder and call it from there. What is the "executable" and "args" in dosbox emulator.cfg? Since dosbox already supports an exit function, it would be best to simply add -exit if you start dosbox directly e.g:
executable d:\games\dos\dosbox\dosbox.exe -exit -fullscreen
if spaces in path, use:
executable "d:\games\dos\dos space box\dosbox.exe" -exit
If you start dosbox via batch then add -exit after dosbox.exe then rest of the command e.g.:
dosbox.bat (launches dosbox)
@echo off
start /d "d:\games\dos\dosbox" dosbox.exe -exit %1
This will exit dosbox when you exit the game.
-
If you start dosbox via batch then add -exit after dosbox.exe then rest of the command e.g.:
dosbox.bat (launches dosbox)
@echo off
start /d "d:\games\dos\dosbox" dosbox.exe -exit %1
This will exit dosbox when you exit the game.
Yes it will. But only if I normally exit the game. ie. by pressing escape then confirming exit with "y"...etc
What I want is a way to terminate Dosbox even if I exit with AM's HOT KEY that terminates the emulator immediately.
It terminates the batch file that starts dosbox, but not dosbox itself.
I am not sure if I'm making my problem clear to you? Sorry english is not my first language.
-
I got it working on my end, pressing exit_key will quit dosbox and turn teh focus back on AM. What are the "executable" and "args" you are using in emulator for dosbox (in AM/emulators)?
-
Have a look to similar batch problems (http://forum.attractmode.org/index.php?topic=3985.msg27857#msg27857)
-
Have a look to similar batch problems (http://forum.attractmode.org/index.php?topic=3985.msg27857#msg27857)
THIS! I always knew the best way to do it is to be able to execute a batch file on emulator exit but I didn't know how to do it. This plugin was exactly what I was looking for. I am putting the link below for future reference for anybody who has my same issue.
Thanks heaps to everybody who commented and special thanks for Hermine and rand0m
http://forum.attractmode.org/index.php?topic=3918.0
Edit:
To be more precise, I made a file called after.bat and placed rand0m's code in it
taskkill /IM dosbox.exe /F
exit
and this way attract mode called it every time after a dos game was terminated