Author Topic: How to launch another program with emulator?  (Read 10189 times)

Aeliss

  • Hero Member
  • *****
  • Posts: 900
Re: How to launch another program with emulator?
« Reply #13 on: June 19, 2015, 11:50:52 AM »
I m sorry but for me you are using a rocket launcher to pick strawberries.

Just for information.
If you are using mGalaxy you can just change/add a script called mGalaxy_Script.exe to use what you want for esc key.
Your control device haven't drivers or application to configure it ?
What don't you merge your 2 file in one JoyToKey(kega).exe and kega_script.exe if both are autoit script ?

Quote
No, I can't keep JoyToKey running because I only need it to run for 2 emulators that won't allow you to remap multiple controls for the same button (ZSNES and KegaFusion). The profiles for JoyToKey for the 2 emulators would clash with each other and clash with other emulators as well

IDK how you make your affair, but I have a standard joypad + X360XE(Xbox 360 device emulator) + XPadder so in some case when I press a button I have 3 information in same time without clash.

With Xpadder you can configure it to work only with somes applications and not the other.


bigjayb024

  • Newbie
  • *
  • Posts: 7
Re: How to launch another program with emulator?
« Reply #12 on: June 18, 2015, 10:39:10 PM »
Ok, I figured it out. Now everything opens and closes like it should. I tinkered with the code some more and it works. I defined each "$PID" and added a number next to it.

Code: (autoit) [Select]
    ;Parsing
    Local $count = StringInStr($CmdLineRaw, ".exe", 0, 1, 1)
    local $app = StringLeft ( $CmdLineRaw, $count + 4 )
    local $command = StringTrimLeft( $CmdLineRaw, $count + 4 )
    if not $command then exit 0

    ;run your 2d app
    local $PID1  = Run ('D:\Emulators\Consoles\Sega Genesis, SegaCD & 32X KegaFusion 3.64 x86\JoyToKey(kega).exe')
    local $PID2  = Run ('D:\Emulators\Consoles\Sega Genesis, SegaCD & 32X KegaFusion 3.64 x86\kega_script.exe')

    ;run emulator and wait for close
    Runwait ( '"' & $app & '" ' & $command )

    ;close the 2d app
     ProcessClose ( $PID1 )
     ProcessClose ( $PID2 )

    Exit 0

bigjayb024

  • Newbie
  • *
  • Posts: 7
Re: How to launch another program with emulator?
« Reply #11 on: June 18, 2015, 08:52:49 PM »
No, I can't keep JoyToKey running because I only need it to run for 2 emulators that won't allow you to remap multiple controls for the same button (ZSNES and KegaFusion). The profiles for JoyToKey for the 2 emulators would clash with each other and clash with other emulators as well.

KegaFusion is making it more annoying because it will not allow you to remap emulator functions.

I got the script to work half way right. It will open both JoyToKey and the AutoHotKey scrip on eumlator launch, but will only close the AutoHotKey script and not JoyToKey.

Code: (autoit) [Select]
    ;Parsing
    Local $count = StringInStr($CmdLineRaw, ".exe", 0, 1, 1)
    local $app = StringLeft ( $CmdLineRaw, $count + 4 )
    local $command = StringTrimLeft( $CmdLineRaw, $count + 4 )
    if not $command then exit 0

    ;run your 2d app
    local $PID  = Run ('D:\Emulators\Consoles\Sega Genesis, SegaCD & 32X KegaFusion 3.64 x86\JoyToKey(kega).exe')
    local $PID  = Run ('D:\Emulators\Consoles\Sega Genesis, SegaCD & 32X KegaFusion 3.64 x86\kega_script.exe')

    ;run emulator and wait for close
    Runwait ( '"' & $app & '" ' & $command )

    ;close the 2d app
     ProcessClose ( $PID )
     ProcessClose ( $PID )

    Exit 0

Aeliss

  • Hero Member
  • *****
  • Posts: 900
Re: How to launch another program with emulator?
« Reply #10 on: June 18, 2015, 10:49:19 AM »
Sure, but you realy need a script for joy2key ? This application can stay running, nope ?

bigjayb024

  • Newbie
  • *
  • Posts: 7
Re: How to launch another program with emulator?
« Reply #9 on: June 17, 2015, 12:08:52 AM »
Just curious, can the above script be modified to run a 3rd program besides joytokey and the emulator?

bigjayb024

  • Newbie
  • *
  • Posts: 7
Re: How to launch another program with emulator?
« Reply #8 on: June 12, 2015, 01:15:12 PM »
Its a compatibility issue. There are a couple commercial and homebrew games that I can't get to run in MESS, but they'll run in Nostalgia.

It's easier for me to create remap script in AutoHotKey, because it's really dumbed down.

Aeliss

  • Hero Member
  • *****
  • Posts: 900
Re: How to launch another program with emulator?
« Reply #7 on: June 12, 2015, 12:12:45 PM »
Have you tried Mess, but idk for compatibility list.

But you just need a normal autoscript to quit with the key you want like this one
http://www.mgalaxy.com/forum/index.php?topic=692.0
You just need to change the hotkeyset

Or use joy2key or Xpadder.

bigjayb024

  • Newbie
  • *
  • Posts: 7
Re: How to launch another program with emulator?
« Reply #6 on: June 11, 2015, 11:51:16 AM »
It's for Nostalgia. Apparently you can't remap the exit key. The cabinet that I'm building will be utilizing a separate keypad for system controls, but it doesn't have an ESC key.

Aeliss

  • Hero Member
  • *****
  • Posts: 900
Re: How to launch another program with emulator?
« Reply #5 on: June 11, 2015, 11:42:12 AM »
It's for which one emulator ? Lot of them don't need special script for that.

Quote
I need to know where to put the path to the emulator, and the path to the secondary program

You don't need to put emulator path, just configure it in mGalaxyrunaway.
Path to the secondary program is in this line.

Quote
;run your 2d app
local $PID  = Run ('completepath/ControlMK.exe')

But it is according to the emulator, there is a script by emulator.


Aeliss

  • Hero Member
  • *****
  • Posts: 900
Re: How to launch another program with emulator?
« Reply #4 on: May 24, 2014, 12:59:54 PM »
If you are searching the simplicity try fs-uae
http://fs-uae.net/

Same core than WinUAE but more friendly to use (with an "on screen display" menu option).

Luikuri

  • Newbie
  • *
  • Posts: 4
Re: How to launch another program with emulator?
« Reply #3 on: May 24, 2014, 06:58:59 AM »
Thank you.  :D

I'll give WinUAE config another shot but now I got the code to fall back on. I've tried it directly with WinUAE but with little luck.

And the reason for WinUAELoader: laziness. It works (well, apart from the mouse-thingy) and it was easy to set up without any AutoIt:ting. I'm new to the whole WHD-thing (been using WinUAE for a while, though) and haven't really messed about with all the possibilities. I read the thread you had about the subject but decided for the easy route as I wanted to get things rolling and saw no greater advantages with the other route. Maybe now I'll give it a go.

Aeliss

  • Hero Member
  • *****
  • Posts: 900
Re: How to launch another program with emulator?
« Reply #2 on: May 24, 2014, 04:35:17 AM »
With WinUAE (WinUAELoader is just a loader not the principal application) you can configure mouse AND joystick on the same joystick.
I use one analogue for pad the other for mouse and with 12 button it s not a problem to find 2 button for mouse on the pad.

But if you really want to use 2 applications it s not a problem with script, something like that

Code: (autoit) [Select]
;Parsing
Local $count = StringInStr($CmdLineRaw, ".exe", 0, 1, 1)
local $app = StringLeft ( $CmdLineRaw, $count + 4 )
local $command = StringTrimLeft( $CmdLineRaw, $count + 4 )
if not $command then exit 0

;run your 2d app
local $PID  = Run ('completepath/ControlMK.exe')
 
;run winUAE and wait for close
Runwait ( '"' & $app & '" ' & $command )

;close the 2d app
 ProcessClose ( $PID )
 
Exit 0

Another question !
Why do you use WinUAELoader and not directly WinUAE, If you use it because of Whdload archive, theses one haven't crack screen.
« Last Edit: May 24, 2014, 12:57:47 PM by Aeliss »

Luikuri

  • Newbie
  • *
  • Posts: 4
How to launch another program with emulator?
« Reply #1 on: May 23, 2014, 03:17:22 PM »
Hello eveybody

Sorry if this has been answered somewhere somehow already, couldn't find it anywhere.

So what I need to do is launch ControlMK (preferably before) WinUAELoader so's I can use my cabinet's joystick as an Amiga mouse. (Some of the games have "crack screens" or mouse-operated menus and in theory one could even do some Insult Sword Fighting.)
And ControlMK should also close when exiting WinUAELoader, because the button bindings will most likely mess up the other emulators.

So if there is another thread dealing with starting and closing a program alongside an emulator, I can (propably) adapt the solution from there.

Or indeed if there is a better way to emulate tha Amiga mouse with a joystick, I'd be grateful for that info also (I understand that WinUAELoader can do it by itself but I haven't had any luck with it)

Cheers