Author Topic: Mame (AutoIt)  (Read 15049 times)

davhuit

  • Full Member
  • ***
  • Posts: 173
Re: Mame (AutoIt)
« Reply #18 on: September 08, 2013, 01:29:59 PM »
I'll post again here later if I notice the same problem with "MameUI" :)

Aeliss

  • Hero Member
  • *****
  • Posts: 900
Re: Mame (AutoIt)
« Reply #17 on: September 08, 2013, 01:08:33 PM »
You are right, I m trying the official version and the application is just called "mame.exe".

We can try with a command to active mGalaxy in autoit, if your problem is still here.

Code: [Select]
WinActivate ("mGalaxy")
« Last Edit: September 08, 2013, 01:12:25 PM by Aeliss »

davhuit

  • Full Member
  • ***
  • Posts: 173
Re: Mame (AutoIt)
« Reply #16 on: September 08, 2013, 10:38:18 AM »
Seems to work with "MameIU32" though it also open a dosbox at the start, will see if I get the problem again later or not.

davhuit

  • Full Member
  • ***
  • Posts: 173
Re: Mame (AutoIt)
« Reply #15 on: September 08, 2013, 10:21:03 AM »
No real reason, just took the first one I found (the official website don't seem to have true windows version : http://mamedev.org/release.html).

But yeah, as I wrote at the end of my previous message, I plan to try a Windows based version to see if the problem come from that.

If someone know whre to find the 0149b version for Windows, I'm interested.

Edit : Okay, it seems the true windows version waqs called "Mame32" (for the 32 bits version) and now renamed "MAMEUI".
« Last Edit: September 08, 2013, 10:30:57 AM by davhuit »

Aeliss

  • Hero Member
  • *****
  • Posts: 900
Re: Mame (AutoIt)
« Reply #14 on: September 08, 2013, 09:49:13 AM »
Why do you not use "mame64.exe" ? (no dos box with it)

davhuit

  • Full Member
  • ***
  • Posts: 173
Re: Mame (AutoIt)
« Reply #13 on: September 08, 2013, 07:36:05 AM »
I found a little problem with my script, but it's probably not coming from v5.0, it's probably just that I didn't noticed it before.

Sometimes, when I quit Mame, mGalaxy lost the focus and I have to use ALT-TAB several times to get the focus back.

Here's an example of it in a video : http://www.youtube.com/watch?v=vp1gYtm35R8&feature=youtu.be

It often happen when I reset the game, then quit. It seems that the cause would be the command-line window that appear when you start/reset a game (as it's the only emulator which have that "bug" in my list).

Is there a way to fix the focus when I quit Mame by modifying the AutoIt script?

Meanwhile, I'll try that : http://www.mgalaxy.com/forum/index.php?topic=15.msg125#msg125

Maybe it can fix the problem (if it's really related to the command-line window).
« Last Edit: September 08, 2013, 07:39:14 AM by davhuit »

davhuit

  • Full Member
  • ***
  • Posts: 173
Re: Mame (AutoIt)
« Reply #12 on: August 17, 2013, 06:46:25 AM »
This time it's working, thanks :)

Here's the whole script, if someone else need it one day :

Code: (AutoIt) [Select]
HotKeySet("{ESC}", "Terminate")
$path = "F:\Jeux PC [Downloads]\Emulation\mame0149b\"
$app = "mame.exe"

If $CmdLine[0] > 0 Then
    $PID = Run( $path & $app & ' ' & $CmdLineRaw )
    While 1
          Sleep(100)
    WEnd
EndIf

exit 0

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

Aeliss

  • Hero Member
  • *****
  • Posts: 900
Re: Mame (AutoIt)
« Reply #11 on: August 17, 2013, 02:51:06 AM »
I forget A space I think try with PID = Run( $path & $app & ' ' & $CmdLineRaw )

davhuit

  • Full Member
  • ***
  • Posts: 173
Re: Mame (AutoIt)
« Reply #10 on: August 16, 2013, 02:00:00 PM »
Yeah, I use the same xml infos.

With this version, it stay on mGalaxy main screen (no more console with the error).

@mGalaxy : There's no hurry, have a great holliday :)
« Last Edit: August 16, 2013, 02:07:45 PM by davhuit »

Aeliss

  • Hero Member
  • *****
  • Posts: 900
Re: Mame (AutoIt)
« Reply #9 on: August 16, 2013, 10:50:57 AM »
If you use in your xml part

Code: [Select]
<Cmd id="0" name="MAME" value="-rompath &quot;%path&quot; %file%ext %volume -skip_gameinfo -nowindow" />
try with

Code: [Select]
HotKeySet("{ESC}", "Terminate")
$path = "F:\Jeux PC [Downloads]\Emulation\mame0149b\"
$app = "mame.exe"

If $CmdLine[0] > 0 Then
    $PID = Run( $path & $app & $CmdLineRaw )
    While 1
          Sleep(100)
    WEnd
EndIf

exit 0

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

mgalaxy

  • Administrator
  • Hero Member
  • *****
  • Posts: 1165
    • Email
Re: Mame (AutoIt)
« Reply #8 on: August 16, 2013, 09:47:32 AM »
I'll help you as soon as I'm back from my holidays. I've tried to help with my first reply to your post...but it was done quickly on my phone. I'll take some times to reply you efficiently in 2-3 days!!

davhuit

  • Full Member
  • ***
  • Posts: 173
Re: Mame (AutoIt)
« Reply #7 on: August 16, 2013, 02:18:08 AM »
I tested several new things and the best I could do is :

Code: [Select]
HotKeySet("{ESC}", "Terminate")
$path = "F:\Jeux PC [Downloads]\Emulation\mame0149b\"
$app = "mame.exe"

If $CmdLine[0] > 0 Then
    $PID = Run( $path & $app & ' -rompath')
    While 1
          Sleep(100)
    WEnd
EndIf
Func Terminate()
    While ProcessExists ( $PID )
ProcessClose ( $PID )
    WEnd
    Exit 0
EndFunc

which now output this error :

Error: Option -rompath excepted a parameter.

No more "-rompath-rompath" (twice the same line) but it still don't work.
« Last Edit: August 16, 2013, 02:45:50 AM by davhuit »

davhuit

  • Full Member
  • ***
  • Posts: 173
Re: Mame (AutoIt)
« Reply #6 on: August 15, 2013, 05:40:15 AM »
Like that ?

Code: (AutoIt) [Select]
HotKeySet("{ESC}", "Terminate")
$path = "F:\Jeux PC [Downloads]\Emulation\mame0149b\"
$app = "mame.exe"

If $CmdLine[0] > 0 Then
    $PID = Run( $path & $app & ' -rompath' & $CmdLineRaw, $path)
    While 1
          Sleep(100)
    WEnd
EndIf
Func Terminate()
    While ProcessExists ( $PID )
ProcessClose ( $PID )
    WEnd
    Exit 0
EndFunc


Mame give me the following error :

Code: [Select]
Error: unknow option: -rompath-rompath
« Last Edit: August 15, 2013, 08:55:04 AM by davhuit »

Aeliss

  • Hero Member
  • *****
  • Posts: 900
Re: Mame (AutoIt)
« Reply #5 on: August 15, 2013, 04:49:03 AM »
You still have 2 errors.

$CmdLine[1] = first param, so you pass the param "-rompath" and  only this one, try $CmdLineRaw (contains the entire command line)

$CmdLine[0] == 1 : in your case you have more than 1 param so better use
$CmdLine[0] <>0 or $CmdLine[0] > 0

More infos here http://www.autoitscript.com/autoit3/docs/intro/running.htm#CommandLine

davhuit

  • Full Member
  • ***
  • Posts: 173
Re: Mame (AutoIt)
« Reply #4 on: August 14, 2013, 03:17:49 PM »
Ah, as it was working in command line without it, I thought it was optional.

I tested with your line and it still don't work ???. mGalaxy say "launching game" but it stay on the games list window.

Code: (AutoIt) [Select]
HotKeySet("{ESC}", "Terminate")
$path = "F:\Jeux PC [Downloads]\Emulation\mame0149b\"
$app = "mame.exe"

If $CmdLine[0] == 1 Then
    $PID = Run( $path & $app & ' -rompath' & $CmdLine[1], $path)
    While 1
          Sleep(100)
    WEnd
EndIf
Func Terminate()
    While ProcessExists ( $PID )
ProcessClose ( $PID )
    WEnd
    Exit 0
EndFunc
« Last Edit: August 14, 2013, 03:23:43 PM by davhuit »