mGalaxy forum

General Discussions => Need Help? => Topic started by: jzeitlerj on March 03, 2019, 06:08:03 PM

Title: JNES keeps running in background and freezes mGalaxy
Post by: jzeitlerj on March 03, 2019, 06:08:03 PM
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
Title: Re: JNES keeps running in background and freezes mGalaxy
Post by: Aeliss on March 04, 2019, 02:54:23 PM
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]
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]
;Functions
Func Terminate()
   WinClose ( "VirtuaNES")
   WinClose ( "Jnes")
   Exit 0
EndFunc
Title: Re: JNES keeps running in background and freezes mGalaxy
Post by: jmd on March 04, 2019, 06:10:15 PM
Right...well seen Aeliss!
You can use the 'standard' close script:
Code: [Select]
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
Title: Re: JNES keeps running in background and freezes mGalaxy
Post by: Aeliss on March 05, 2019, 11:02:02 AM
Yep ProcessClose is better, more universal.

Realy few applications have problems with it.