EMULAB Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

The new forum is online, hope you enjoy it!

Pages: 1 2 [3]   Go Down

Author Topic: clrmame first-run questions  (Read 17405 times)

Shoegazer

  • Member
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 53
  • Operating System:
  • Linux Linux
  • Browser:
  • Firefox 131.0 Firefox 131.0
    • View Profile
Re: clrmame first-run questions
« Reply #40 on: 03 October 2024, 20:55 »

Thanks for the explanation, Roman.  Interesting issue, and yeah I see the four WaitForSingleObject return values listed on the Microsoft site as well. I blame Windows :P

I'll stay tuned for more.  Should you need anything else in the meantime, I'm happy to help.
Logged

Roman

  • Global Moderator
  • Member
  • ***
  • Karma: 120
  • Offline Offline
  • Posts: 3456
  • Operating System:
  • Windows NT 10.0 Windows NT 10.0
  • Browser:
  • Chrome 129.0.0.0 Chrome 129.0.0.0
    • View Profile
Re: clrmame first-run questions
« Reply #41 on: 04 October 2024, 06:51 »

Ok....I think I've found something about the problem behind it. After running my test builds on a virtual box in wine, I see that the process handle is invalid and so waiting for it fails.... Searching the internet gives me "Native *NIX processes won't have process handle - they are run outside Wine."
Asking an AI gives me a workaround by using a wrapper script....

#!/bin/bash
"$@" &
echo $! > /tmp/myprocess.pid
wait $!
rm /tmp/myprocess.pid

so my createProcess call runs the wrapper script and passing the actual command to it and waits for its completion. The script itself then runs my given commandline...

hmm....surely this would only needed on Linux/Wine (i.e. it would take some option/mechanism to activate it and is deactivated by default for normal windows users).
I will play around with it a bit


hmm...no luck yet.....seems that Wine users need to use datfiles ;-)
But maybe somebody has an idea
« Last Edit: 04 October 2024, 13:51 by Roman »
Logged

Shoegazer

  • Member
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 53
  • Operating System:
  • Linux Linux
  • Browser:
  • Firefox 131.0 Firefox 131.0
    • View Profile
Re: clrmame first-run questions
« Reply #42 on: 17 October 2024, 20:35 »

Hey Roman, your wrapper script idea seems promising and innovative and I hope you've had time for further thoughts or developments. I'd like to start testing your new tool more exhaustively and waiting to use the cleaner and less manually-intensive binary with flag option, so I'm sure anything you can do about this issue would help.

Of course, opening the source would probably invite more ideas if the zip library limitation can be worked out, I know that's in your plans but.. just sayin'. ;)

Thanks!
Logged

Roman

  • Global Moderator
  • Member
  • ***
  • Karma: 120
  • Offline Offline
  • Posts: 3456
  • Operating System:
  • Windows NT 10.0 Windows NT 10.0
  • Browser:
  • Chrome 129.0.0.0 Chrome 129.0.0.0
    • View Profile
Re: clrmame first-run questions
« Reply #43 on: 18 October 2024, 07:46 »

well...I ran some tests with the wrapper script but it didn't lead to anything useful yet.....
...and then real life came back and kept me busy this week.
Logged

Shoegazer

  • Member
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 53
  • Operating System:
  • Linux Linux
  • Browser:
  • Firefox 131.0 Firefox 131.0
    • View Profile
Re: clrmame first-run questions
« Reply #44 on: 18 October 2024, 20:27 »

No worries, whenever you have time.  :)
Logged

Roman

  • Global Moderator
  • Member
  • ***
  • Karma: 120
  • Offline Offline
  • Posts: 3456
  • Operating System:
  • Windows NT 10.0 Windows NT 10.0
  • Browser:
  • Chrome 130.0.0.0 Chrome 130.0.0.0
    • View Profile
Re: clrmame first-run questions
« Reply #45 on: 21 October 2024, 18:58 »

well, actually I made a little bit of success....I wrote a wrapper script file which is able to convert given wine paths to real linux paths, changes to the folder, runs the export. Yippie....this can be triggered from the wine clrmame executable.

Current problem is that the process is returned as being finished too early, so clrmame says that it can't read the export (which is still exporting). Another click on scan will then find the now finished export...

Close...but not fully there...but I guess it can be done....


Interested in the script?

w2l() {
  wine_path="$1"
  if [[ "$wine_path" =~ ^([A-Z]):\\ ]]; then
    drive="${BASH_REMATCH[1]}"
    linux_drive=$(readlink "$HOME/.wine/dosdevices/${drive}:")
    linux_path="${wine_path/${drive}:\\/$linux_drive/}"
    linux_path="${linux_path//\\//}"
  else
    echo "no valid wine path"
    return 1
  fi
  echo "$linux_path"
}
linuxExeFile="$(w2l "$1")"
linuxOutFile="$(w2l "$3")"
folder="$(dirname "$linuxExeFile")"
base="$(basename "$linuxExeFile")"
cd "$folder"
$base "$2" > "$linuxOutFile"

so you give in z:\home\vboxuser\something\mame -listxml z:\home\vboxuser\somewhereelse\blaexport.xml
...and it should work in Linux :-)



....well...and you'd need to tell clrmame to use the wrapper...guess that'll be a simple entry in its settings.xml then
« Last Edit: 21 October 2024, 19:02 by Roman »
Logged

Shoegazer

  • Member
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 53
  • Operating System:
  • Linux Linux
  • Browser:
  • Firefox 131.0 Firefox 131.0
    • View Profile
Re: clrmame first-run questions
« Reply #46 on: 22 October 2024, 00:30 »

Thanks, Roman.  I know you put a lot of thought and work into this.  So should I wait for the change to settings.xml for clrmame to see the script before actually testing?  Also, are you planning to internalize the script to the clrmame binary itself once testing is completed, so the extra setup and procedure isn't needed?  I just hope this is going to be less complicated than writing a quick bash script to run mame -listsoftware and then launch clrmame upon its completion.
Logged

Roman

  • Global Moderator
  • Member
  • ***
  • Karma: 120
  • Offline Offline
  • Posts: 3456
  • Operating System:
  • Windows NT 10.0 Windows NT 10.0
  • Browser:
  • Chrome 130.0.0.0 Chrome 130.0.0.0
    • View Profile
Re: clrmame first-run questions
« Reply #47 on: 22 October 2024, 09:16 »

Forget about what I said regarding settings.xml...it will work out of the box since I can detect if I run under Wine or native Windows. So it's either using the wrapper script or not.

Currently I only have 2 1 issue:

- running the script returns too early (so mame is still exporting the xml data but the script already signals a run completion) (technical background: in Windows you'd have the same problem, but there I can use PipeObjects to grab the data......but no worries...I'm playing around....)
- the script file needs to get a one time chmod +x....actually it should be possible to already add that in the zipfile somehow...will see
« Last Edit: 22 October 2024, 18:00 by Roman »
Logged

Shoegazer

  • Member
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 53
  • Operating System:
  • Linux Linux
  • Browser:
  • Firefox 131.0 Firefox 131.0
    • View Profile
Re: clrmame first-run questions
« Reply #48 on: 22 October 2024, 18:27 »

Thanks, Roman.  I'm still getting the same parsing error as before though, and with execute perms set properly.  How are you launching the clrmame and script via wine in your environment?
Logged

Roman

  • Global Moderator
  • Member
  • ***
  • Karma: 120
  • Offline Offline
  • Posts: 3456
  • Operating System:
  • Mac OS X Mac OS X
  • Browser:
  • Safari 18.0.1 Safari 18.0.1
    • View Profile
Re: clrmame first-run questions
« Reply #49 on: 22 October 2024, 19:27 »

Erm….you cant do anything at the moment…you need to wait for a new (test) version which makes use of the wrapper script…
Logged

Shoegazer

  • Member
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 53
  • Operating System:
  • Linux Linux
  • Browser:
  • Firefox 131.0 Firefox 131.0
    • View Profile
Re: clrmame first-run questions
« Reply #50 on: 23 October 2024, 03:14 »

Thanks, I figured the script could run on the existing release but I understand now.
Logged

Roman

  • Global Moderator
  • Member
  • ***
  • Karma: 120
  • Offline Offline
  • Posts: 3456
  • Operating System:
  • Windows NT 10.0 Windows NT 10.0
  • Browser:
  • Chrome 130.0.0.0 Chrome 130.0.0.0
    • View Profile
Re: clrmame first-run questions
« Reply #51 on: 23 October 2024, 19:34 »

ok here we go, a new round of Linux/Wine testing

https://mamedev.emulab.it/clrmamepro/binaries/clrmame_006_013_4.zip

after unpacking you need to do a "chmod +x ./wrapper.sh" to make the wrapper script executable.
Basically that's it...after that you should be able to import from a linux mame binary (at least it works for me on Ubuntu / Wine running on a virtualBox ;-))


Update (since a virtualbox seems to react a bit more differently than a real one....)

https://mamedev.emulab.it/clrmamepro/binaries/clrmame_006_013_5.zip
https://mamedev.emulab.it/clrmamepro/binaries/clrmame_006_013_6.zip

Played a bit with export timing and added some information on trace log level....Shoegazer, please let me know if this leads to something, if not, trace level output would be interesting to see....
« Last Edit: 25 October 2024, 18:44 by Roman »
Logged
Pages: 1 2 [3]   Go Up
 

Page created in 0.062 seconds with 22 queries.