How to launch another program with emulator?

Get answers to questions about using mGalaxy.
Post Reply
User avatar
Luikuri
Newbie
Newbie
Posts: 4
Joined: Fri May 23, 2014 7:54 pm
Location: Vinland

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
Aeliss
Hero Member
Hero Member
Posts: 900
Joined: Thu Apr 04, 2013 5:55 pm

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: Select all

;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 edited by Aeliss on Sat May 24, 2014 5:57 pm, edited 1 time in total.
User avatar
Luikuri
Newbie
Newbie
Posts: 4
Joined: Fri May 23, 2014 7:54 pm
Location: Vinland

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
Hero Member
Posts: 900
Joined: Thu Apr 04, 2013 5:55 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).
Aeliss
Hero Member
Hero Member
Posts: 900
Joined: Thu Apr 04, 2013 5:55 pm

It's for which one emulator ? Lot of them don't need special script for that.
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.
;run your 2d app
local $PID  = Run ('completepath/ControlMK.exe')
But it is according to the emulator, there is a script by emulator.
bigjayb024
Newbie
Newbie
Posts: 7
Joined: Wed Jun 10, 2015 8:41 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
Hero Member
Posts: 900
Joined: Thu Apr 04, 2013 5:55 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
Newbie
Posts: 7
Joined: Wed Jun 10, 2015 8:41 am

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.
bigjayb024
Newbie
Newbie
Posts: 7
Joined: Wed Jun 10, 2015 8:41 am

Just curious, can the above script be modified to run a 3rd program besides joytokey and the emulator?
Aeliss
Hero Member
Hero Member
Posts: 900
Joined: Thu Apr 04, 2013 5:55 pm

Sure, but you realy need a script for joy2key ? This application can stay running, nope ?
bigjayb024
Newbie
Newbie
Posts: 7
Joined: Wed Jun 10, 2015 8:41 am

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: Select all

    ;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
bigjayb024
Newbie
Newbie
Posts: 7
Joined: Wed Jun 10, 2015 8:41 am

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: Select all

    ;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
Aeliss
Hero Member
Hero Member
Posts: 900
Joined: Thu Apr 04, 2013 5:55 pm

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 ?
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.
Post Reply