Page 1 of 1

JNES keeps running in background and freezes mGalaxy

Posted: Mon Mar 04, 2019 12:08 am
by jzeitlerj
Hi,
Does anyone know how to get JNES to close when I exit a game from mgalaxy.  It appears to keep running in background and freezes mgalaxy.  I can see the game again when I exit mgalaxy.  I am running the version 6 since I couldn't get 7.1 to load.  Thank you

Re: JNES keeps running in background and freezes mGalaxy

Posted: Mon Mar 04, 2019 8:54 pm
by Aeliss
I have trying this emulator.

And yes, there is a bug on my version, on the script "Nestopia, JNES, VirtuaNES, FCEUX, NNNester [Script].au3" in mGalaxy\Data\Scripts folder

Code: Select all

HotKeySet("{ESC}", "Terminate")

Runwait ( '"' & $app & '" ' & $command )

Exit 0

;Functions
Func Terminate()
   WinClose ( "VirtuaNES")
   Exit 0
EndFunc
it can work only with VirtuaNES.

So edit the file and add

Code: Select all

;Functions
Func Terminate()
   WinClose ( "VirtuaNES")
   WinClose ( "Jnes")
   Exit 0
EndFunc

Re: JNES keeps running in background and freezes mGalaxy

Posted: Tue Mar 05, 2019 12:10 am
by jmd
Right...well seen Aeliss!
You can use the 'standard' close script:

Code: Select all

HotKeySet("{ESC}", "Terminate")

$PID = Run ('"' & $app & '" ' & $command)

While ProcessExists ( $PID )
   sleep(500)
WEnd

Exit 0

;functions
Func Terminate()
   While ProcessExists ( $PID )
	  ProcessClose ( $PID )
   WEnd
   Exit 0
EndFunc

Re: JNES keeps running in background and freezes mGalaxy

Posted: Tue Mar 05, 2019 5:02 pm
by Aeliss
Yep ProcessClose is better, more universal.

Realy few applications have problems with it.