Jump to content

All my products and services are free. All my costs are met by donations I receive from my users. If you enjoy using any of my products, please donate to support me. My bare hosting costs are currently not met so please consider donating by either clicking this text or the Patreon link on the right.

Patreon

Recommended Posts

Posted

Hi folks. Having a problem with Launch Before in advanced Emu Config.

Basically, looking to have two bat files running before and after launch/exit of Demul. These will load and save key configs for each game. The scripts:

Launch Before:

:: Load Controls ini for demul
:: By Stigzler 2013

@echo on
set romname=%1
set romname=%romname:~1,-1%
set workpath=%2
set workpath=%workpath:~1,-1%

:: --------------------------------------------------------------------
:: User Variables - SET HERE!
:: Location of Demul Controls Folder:
set controlsfolder=C:\Emulators\Dreamcast\demul_controls

:: Location of Demul Folder:
set demulfolder=C:\Emulators\Dreamcast\demul0582

:: -------------------------------------------------------------------
:: Code
set padfull=%demulfolder%\padDemul.ini
set controlsfull=%controlsfolder%\%romname%.ini

if NOT exist %controlsfull% (
set controlsfull=%controlsfolder%\default.ini
)

Copy /Y "%controlsfull%" "%padfull%"

cd %workpath%
Pause

::Exit

Launch After:

:: Create Controls ini for demul
:: By Stigzler 2013

@echo on
set romname=%1
set romname=%romname:~1,-1%

:: --------------------------------------------------------------------
:: User Variables - SET HERE!
:: Location of Demul Controls Folder:
set controlsfolder=C:\Emulators\Dreamcast\demul_controls

:: Location of Demul Folder:
set demulfolder=C:\Emulators\Dreamcast\demul0582

:: -------------------------------------------------------------------
:: Code
set padfull=%demulfolder%\padDemul.ini
set controlsfull=%controlsfolder%\%romname%.ini

Copy /Y "%padfull%" "%controlsfull%"

Exit

Have tested with just the Launch After command in config, and GameEx runs the emu and game fine and executes the 'after' script on exit fine. However, when I try to run the Launch Before with:

C:\GameEx\AHKS_BATS\Demul_load_controls.bat "[ROM]" "[WORKINGPATH]"

The script executes fine (watching debug mode) but then it returns straight back to GameEx without launching the emu/game. At this point, the cmd window is shut - so can't figure out what's going on. Had a look in the log, but didn't tell me much.

Can anyone lend a hand?

Have tinkered with various things - like Pause and exit commands, but these don't seem to make a difference.

Cheers

Posted

When you launch an app from gameex it watches the process, and once the process ends gameex takes over again. You can use an advanced config to watch for additional processes.

Posted

Thanks Tempest. I'm sure I tried it with Exit at the end though... (without the rem outs) which should have meant that GamEx then launched the emu + game?

In the end, grew frustrated and handled all via one bat with a start/wait command.

Thanks for the advice though.

Posted

I'm sorry, my answer would only have applied if you were launching running your emulator from within the bat file. :(

Posted

Funny turn this! Your answer may be what I'm looking for after all.

I'm now running a bat to do stuff, launch the emu, wait, do more stuff then close. Bat here:

http://www.gameex.info/forums/topic/14066-tool-autoloadsave-individual-game-control-configs-with-demul/

However, problem is that when I hit the Esc key, GameEx regains focus, but demul doesn't close (runs in background)

I'm wondering whether what you're talking about is the cause of this?

have the obligatory Mapping Off Exit Process Close running in advanced config. Hmmm.... befuddled.

Posted

That's because doing it from a BAT file or script isn't gonna let GameEx monitor the correct program (GameEx will not be monitoring programs that you launch from your script). You need to create your own Advanced Config and put DEmul exe in the Process Wait tab so GameEx knows to close it. :)

  • Like 1
Posted

Funny turn this! Your answer may be what I'm looking for after all.

I'm now running a bat to do stuff, launch the emu, wait, do more stuff then close. Bat here:

http://www.gameex.info/forums/topic/14066-tool-autoloadsave-individual-game-control-configs-with-demul/

However, problem is that when I hit the Esc key, GameEx regains focus, but demul doesn't close (runs in background)

I'm wondering whether what you're talking about is the cause of this?

have the obligatory Mapping Off Exit Process Close running in advanced config. Hmmm.... befuddled.

Yes. I gave you your answer before you knew you needed it! :P

Posted

:rolleyes: Stars as ever fellas. It's fun this tinkering with code lark isn't it! If only I had the faintest of ideas what I'm doing - it's the getting stuck part that sucks.

Guest
This topic is now closed to further replies.
×
×
  • Create New...