• Bug 1261293 Get_pid_cwd Support For Mac

    Bug 1261293 Get_pid_cwd Support For Mac

    #9 - 03:01 PM - Josh Paetzel - Resolution set to fixed Pretty major rework of all of this in 8.0-RC5, I got m hands on a mac. Via vt8233 drivers for mac. Browsing works, as does time machine.

    1. Bug 1261293 Get_pid_cwd Support For Mac Office

    18: 40: 01.825: starting emulator # 2, command =. Exe - yiqcc 3.597545 - rompath “ QUASAR - ULTIMA e$ Emulation EMULATORS MAME roms ” - hashpath “ QUASAR - ULTIMA e$ Emulation EMULATORS MAME hash ” - samplepath “ QUASAR - ULTIMA e$ Emulation EMULATORS MAME samples ” lvgirl94 18: 40: 01.864: emulator # 2 started, PID = 461081760, running emulators = 1 18: 40: 01.866: retrieving game information for ‘ Las Vegas Girl ( Girl ’ 94 ) ’ 18: 40: 28.142: emulator # 2 finished, exit code = 3 ( fatal error ), exit status = normal, remaining emulators = 0 and then exits back to list. Is it an issue that I use UNC paths? I make sure to use relative paths everywere. Happens with any game. Icon is green. I haven’t touched defaults.

    (Could there be MAME.ini conflicting settings? Does QMC2 read that file?). Hmmm, that's very strange I have never used UNC paths, so I can't be sure, but I don't think it's related since the logged command looks good to me. When you say 'it stays at initializing for a while. And then exits back to list' you mean the emulator isn't starting, right? When you enable the 'verbose' option (in the emulator configuration), does the it spit any useful information to the 'emulator log'?

    What happens when you run the exact same command from a cmd prompt? QMC2 doesn't read mame.ini /.ini when launching an emulator, but the emulator may still do this if it sees the file(s) and the 'readconfig' option is not disabled. Note that MAMEUI's GUI is integrated with MAME, or rather IS sort of MAME in itself, so you can't really compare this to the behavior of (official) MAME with a front-end (like QMC2). The main difference here is that all parameters are passed to the emulator upon launching, which then is an external process outside of QMC2. If anything goes wrong during argument passing this can cause issues (i.e. The double-backslashes used in the UNC paths could be problematic, I'm not sure if Qt / QProcess handles them correctly, but I assume it does). However, when it starts loading in MAME, then it's probably an instability of the MAME version in use.

    20: 39: 03.962: analysis started 20: 39: 03.964: determining list of games to analyze 20: 39: 03.964: done ( determining list of games to analyze ) 20: 39: 03.964: 1 game to analyze 20: 39: 03.965: analyzing 'mspacman' 20: 39: 04.034: parsing XML data for 'mspacman' 20: 39: 04.041: done ( parsing XML data for 'mspacman' ) 20: 39: 04.042: checking 13 files for 'mspacman' 20: 39: 04.050: loading 'pacman.6e' with CRC 'c1e6ab10' from '. Roms/mspacman.zip' as 'pacman.6e' 20: 39: 04.053: loading 'pacman.6f' with CRC '1a6fb2d4' from '.

    Roms/mspacman.zip' as 'pacman.6f' 20: 39: 04.056: loading 'pacman.6h' with CRC 'bcdd1beb' from '. Roms/mspacman.zip' as 'pacman.6h' 20: 39: 04.058: loading 'pacman.6j' with CRC '817d94e3' from '. Roms/mspacman.zip' as 'pacman.6j' 20: 39: 04.061: loading 'u5' with CRC 'f45fbbcd' from '. Roms/mspacman.zip' as 'u5' 20: 39: 04.064: loading 'u6' with CRC 'a90e7000' from '. Roms/mspacman.zip' as 'u6' 20: 39: 04.066: loading 'u7' with CRC 'c82cd714' from '.

    Roms/mspacman.zip' as 'u7' 20: 39: 04.069: loading '5e' with CRC '5c281d01' from '. Roms/mspacman.zip' as '5e' 20: 39: 04.071: loading '5f' with CRC '615af909' from '. Roms/mspacman.zip' as '5f' 20: 39: 04.073: loading '82s123.7f' with CRC '2fc650bd' from '. Roms/mspacman.zip' as '82s123.7f' 20: 39: 04.075: loading '82s126.4a' with CRC '3eb3a8e4' from '. Roms/mspacman.zip' as '82s126.4a' 20: 39: 04.078: loading '82s126.1m' with CRC 'a9cc86bf' from '.

    Roms/mspacman.zip' as '82s126.1m' 20: 39: 04.080: loading '82s126.3m' with CRC '77245b66' from '. Roms/mspacman.zip' as '82s126.3m' 20: 39: 04.081: done ( checking 13 files for 'mspacman' ) 20: 39: 04.082: done ( analyzing 'mspacman' ) 20: 39: 04.082: 0 games left 20: 39: 04.084: analysis ended - elapsed time = 00: 00: 00.122 In front-end log. 20: 38: 07.006: starting emulator # 0, command =. Exe - paddledevice mouse - pedaldevice mouse - dialdevice mouse - trackballdevice mouse - lightgundevice mouse - positionaldevice mouse - verbose - redratio 1, 0, 0 - grnratio 0, 1, 0 - bluratio 0, 0, 1 - scale 1, 1, 1 - power 1, 1, 1 - yiqcc 3.597545 - mouse - joysticksaturation 0.250000 - cfgdirectory '. Cfg' - nvramdirectory '.

    Nvram' - memcarddirectory '. Memcard' - inputdirectory '. Inp' - statedirectory '.

    Sta' - snapshotdirectory '. Snap' - diffdirectory '. Diff' - commentdirectory '. Comments' - rompath '. Roms' - hashpath '. Hash' - samplepath '.

    Samples' - artpath '. Artwork' - ctrlrpath '.

    Ctrlr' - inipath '. Ini' - cheatpath '. Cheat' - crosshairpath '. Crosshair' mspacman 20: 38: 07.202: emulator # 0 started, PID = 423367584, running emulators = 1 20: 38: 09.996: emulator # 0 finished, exit code = 2 ( missing files ), exit status = normal, remaining emulators = 0 20: 38: 36.880: verifying ROM status for 'Ms. Pac-Man' 20: 38: 44.847: ROM status for 'Ms. Pac-Man' is 'correct' 20: 38: 44.882: done ( verifying ROM status for 'Ms.

    Pac-Man', elapsed time = 00: 08.004 ) 20: 38: 44.883: ROM state info: L: 19483 C: 17559 M: 1924 I: 0 N: 0 U: 0 20: 38: 44.887: applying ROM state filter 20: 38: 46.765: done ( applying ROM state filter, elapsed time = 00: 01.878 ) In emulator log (verbose on). 20: 38: 09.948: stdout # 0 : Parsing mame.

    Ini 20: 38: 09.951: last message repeated 1 time 20: 38: 09.951: stdout # 0 : Video: Monitor 010001 = '. BTW relative pathing seems to work mostly (as seen from ROM analysis etc.). Also history, snaps, cabinet etc. Show correctly using relative paths. (since QMC2 is in QUASAR-ULTIMA e$ Emulation EMULATORS MAME fronts qmc2, I have to use '. ' to refer to the folder structure in MAME) I don't know if the relative paths are the problem (somewhere parsing not working properly) or UNC or both. By using relative paths I warranty (if it works!) that I don't have to change configuration if I use QMC2 using mapped drive OR locally in the future.

    QUASAR-ULTIMA e$ Emulation EMULATORS MAME fronts qmc2. Mame64.exe -paddledevice mouse -pedaldevice mouse -dialdevice mouse -trackballdevice mouse -lightgundevice mouse -positionaldevice mouse -verbose -redratio 1,0,0 -grnratio 0,1,0 -bluratio 0,0,1 -scale 1,1,1 -power 1,1,1 -yiqcc 3.597545 -mouse -joysticksaturation 0.250000 -cfgdirectory ' QUASAR-ULTIMA e$ Emulation EMULATORS MAME fronts qmc2. Cfg' -nvramdirectory ' QUASAR-ULTIMA e$ Emulation EMULATORS MAME fronts qmc2.

    Nvram' -memcarddirectory ' QUASAR-ULTIMA e$ Emulation EMULATORS MAME fronts qmc2. Memcard' -inputdirectory ' QUASAR-ULTIMA e$ Emulation EMULATORS MAME fronts qmc2. Inp' -statedirectory ' QUASAR-ULTIMA e$ Emulation EMULATORS MAME fronts qmc2. Sta' -snapshotdirectory ' QUASAR-ULTIMA e$ Emulation EMULATORS MAME fronts qmc2.

    Snap' -diffdirectory ' QUASAR-ULTIMA e$ Emulation EMULATORS MAME fronts qmc2. Diff' -commentdirectory ' QUASAR-ULTIMA e$ Emulation EMULATORS MAME fronts qmc2. Comments' -rompath ' QUASAR-ULTIMA e$ Emulation EMULATORS MAME fronts qmc2.

    Roms' -hashpath ' QUASAR-ULTIMA e$ Emulation EMULATORS MAME fronts qmc2. Hash' -samplepath ' QUASAR-ULTIMA e$ Emulation EMULATORS MAME fronts qmc2. Samples' -artpath ' QUASAR-ULTIMA e$ Emulation EMULATORS MAME fronts qmc2. Artwork' -ctrlrpath ' QUASAR-ULTIMA e$ Emulation EMULATORS MAME fronts qmc2. Ctrlr' -inipath '.; QUASAR-ULTIMA e$ Emulation EMULATORS MAME fronts qmc2. Ini' -cheatpath ' QUASAR-ULTIMA e$ Emulation EMULATORS MAME fronts qmc2. Cheat' -crosshairpath ' QUASAR-ULTIMA e$ Emulation EMULATORS MAME fronts qmc2.

    Crosshair' mspacman WORKS! So is it possible to request a 'tick' were this substitution takes place? So that paths in the settings remain '. Blahblah' instead of full paths and it still works more 'portable'. Well, if I understand your request correctly, that's an OS thing! For example, when QMC2 is installed in /some/path (sorry, I'm using UNIX style paths now, but it's basically the same) and the working directory (of QMC2) is set to /some/other/path, every relative path used withing QMC2 would then be taken 'relative to /some/other/path'. So in case of Windows all you have to do is start QMC2 with the desired working directory, i.

    By setting it up through its desktop icon. Forgive me if I'm still misunderstanding your request, but it doesn't sound as if I have to change anything. I understand you but possibly you misunderstand me.

    (possibly) Let's use my real paths as an example. (call this case A) QMC2 is at: QUASAR-ULTIMA e$ Emulation EMULATORS MAME fronts qmc2 MAME is at: QUASAR-ULTIMA e$ Emulation EMULATORS MAME All MAME stuff is under: QUASAR-ULTIMA e$ Emulation EMULATORS MAME - for example roms are: QUASAR-ULTIMA e$ Emulation EMULATORS MAME roms The key here is that I am looking at a method where ' QUASAR-ULTIMA e$ Emulation ' is irrelevant and using the SAME config with NO changes works with plain relative paths. If my server that has those things turns back to normal shares, then ' QUASAR-ULTIMA e$ Emulation' will suddenly be 'Q: Emulation'. So the original paths above will become respectively: (case B) QUASAR-ULTIMA Emulation EMULATORS MAME fronts qmc2 QUASAR-ULTIMA Emulation EMULATORS MAME QUASAR-ULTIMA Emulation EMULATORS MAME roms etc. Now if I map either the first version or the second to a letter, OR access those things locally (on the server), they become like that: (case C) Q: Emulation EMULATORS MAME fronts qmc2 Q: Emulation EMULATORS MAME Q: Emulation EMULATORS MAME roms Indeed as you say the whole thing is an OS thing, but here we need to 'help' the OS. My QMC2 configuration is (I won't list all the paths, just give you an idea) like that: Executable file:././mame64.exe Working directory:././ Catver.ini:././catver.ini etc. As QMC works now, for some reason it DOES find the ROMs, because to QMC2.

    Rompath 'Q: Emulation EMULATORS MAME fronts qmc2. Roms' After all, now as QMC2 treats paths, we have a discrepancy: ROMs check ok, snaps show ok, mameinfo works etc. BUT 'for some reason' (call it OS or whatever) games do not run for the user. I just show you a way to fix this (even if it is not QMC2's fault). All these why?

    To make QMC2 more portable (note also that I pointed all.qmc files from user profile to QMC2's own directory (in a folder of course). To allow the users keep their MAME/MESS/whatever paths as they are. (QMC2's 'feature' gain) Hope I explain things better now. Roms' means nothing. I was nearly saying 'AHA! That's his problem!' , but then I tried it (on Linux) and it actually works to use relative paths.

    But: when MAME is launched through QMC2, you have to make sure that its current working directory (CWD) is set to whatever it's supposed to be, because only then '. Roms' makes real sense.

    I see no reason why it shouldn't work, really. But you have to set the CWD, and in case of your examples above that would have to be ' QUASAR-ULTIMA Emulation EMULATORS MAME fronts qmc2'! What you actually want me to do is 'let QMC2 find this out itself'. But how should it do that? It knows about its own CWD, and by coincidence that's the same which would have to be set in your use case, but that's not common or usual. So whatever path I might prepend automatically, which one should that be? Reading you from the top and pretending not to read the next lines before I answer the first.:D So you say that I have to set CWD in the settings, NOT a relative path, but an absolute path (which will have to change in each of the cases A, B or C or a case D where QMC2 is in an irrelevant folder - from same root though - which could be the case for others).

    With what I ask, it would still work, without making ANY change in config when calling QMC2 in any of the cases. And a basic question: CWD in settings is QMC2 path OR MAME/MESS/UME path? In my settings it is set to dictate where MAME is relative to QMC2 own path. By 'find out this out itself' I actually mean EXACTLY to use its OWN (QMC2's) CWD to form all other paths (that are set relative to QMC2 own path).

    As I said I can even describe a case D that maybe satisfies more users, where QMC2 is in a different path completely (but from same root) and my method would still work: Let say QMC2 is in ' QUASAR-ULTIMA Emulation Front-Ends QMC2'. Let say MAME (still) is in ' QUASAR-ULTIMA Emulation EMULATORS MAME'. Then I would set all MAME relative paths to something like '. EMULATORS MAME'. So since QMC2 (in all platforms) know its own CWD, by adding its CWD IN FRONT of the relative paths I set, EVERYTHING works. For example roms path is set using relative paths to be '.

    EMULATORS MAME roms' and CONSTRUCTED by a future QMC2 version to be ' QUASAR-ULTIMA Emulation Front-Ends QMC2. EMULATORS MAME roms'. This 'construction' is what I ask. Now if I suddenly map ' QUASAR-ULTIMA Emulation' to drive 'X:', everything would still work without any change. QMC2 would detect itself be run from 'X: Front-Ends QMC2'. It would then construct (from its own CWD plus the relative paths set) the correct paths for example to ROMs: 'X: Front-Ends QMC2.

    Bug 1261293 Get_pid_cwd Support For Mac

    EMULATORS MAME roms' and would work transparently to the user. Same if I call QMC2 whatever way. Hp laserjet 5550 driver mac os x. As long as all paths in QMC2 settings are set relative to (self-detected) QMC2 path, everything will work. I remind you there is a discrepancy now (so in a sense could be considered a bug - although it is not). As all QMC2 internal functions (like rom checking) work fine right now with relative paths, BUT calling MAME.exe and passing just the relative paths to it will never work as MAME.exe has no idea were to start from (and assumes its own CWD). So I ask you to ADD the correct CWD (which is QMC2 CWD) to the MAME.exe call command.

    Bug 1261293 Get_pid_cwd Support For Mac Office

    You might say 'then use paths relative to MAME'. Indeed this would make MAME.exe WORK. You know what it would mess though? QMC2 internal functions! (ROM testing would not work). If I set ROMs folder to be just 'roms', then calling a MAME would work (with -rompath 'roms'), but testing the rom from QMC2 would still assume that the rom is in a 'roms' folder IN QMC2 folder.

    I think you don't see what I say because many people (inc. You?) throw QMC2 in MAME folder. So in that case MAME CWD is same with QMC2 CWD. Well that is not the case always and with the seer amount of flexibility QMC2 offers already, I would say this is a limitation.

    (I wouldn't bother discussing it with a front-end dev with a way more limited front-end). Well, the CWD of QMC2 is implicitly the same as the CWD of MAME.exe IF no CWD has been specified for the emulator! But QMC2's CWD is not necessarily the same as its installation path! So to make it work the way you want, just put the CWD to be used into QMC2's desktop-icon's setting (when you've used the 'installer', the icon's CWD would be set to the same directory as the installation path, but that's no absolute requirement)! This, of course, may be different from system to system, depending of the network path or mapped drive letter.

    And THIS is what you actually want me to automatically find out / prepend, but that's impossible. No, I'm not putting QMC2 into the MAME/MESS/UME folder. It's not the standard way either, but some users do it.

    This is actually a complex discussion of its own since it (also) depends on common conventions on the different OSs in question, and Windows is the 'easier' OS in this regard:). Anyway, the reason why there's an individual setting for the emulator's CWD simply is that QMC2 does NOT have to be installed in the same folder as MAME/MESS/UME. So, to summarize what you have to do to make this work: 1) Specify the wanted CWD in QMC2's desktop-icon on all systems (these are probably different). 2) Leave the emulator's CWD setting empty (the default) That's it:). OK will try that.

    This of course means different desktop icons for each case (while 'my' method would work anywhere transparently by double-clicking the exe itself - OR using a shortcut). To make it absolutely clear: 1- What CWD is correct to put in QMC2 icon? QMC2's own path or MAME's? 2- What kind of folders do I set in config?

    For example should I set 'roms' folder to be 'roms' or 'a path to roms relative from QMC2 own folder'? 3- Will this allow both MAME.exe to be called properly AND QMC2's own internal tools to still find the stuff they need? To make my side clear (and I won't repeat it, it is already tiring for you and the other readers:D): I was not talking about icons. I was talking about let say 'pure' call to the executable (be it from icon, or from the exe directly, irrelevant). AFAIK (from my rusty coding experience) both in Windows and Linux, an executable can detect its own path (where it runs from). So QMC2 in any platform should know its OWN (not MAME) CWD without me telling it.

    Mac

    Is this correct? Because AFAIK it is correct, not impossible.:) Well this is what I ask, pass QMC2 own CWD every time.

    The only thing the user would have to set once, is make the other paths relative to QMC2 CWD. Your method means that people will need to make shortcut icons.

    Better than having to set CWD in QMC2 config every time. My method is just transparent though (and no need for icons - but also no problem with icons in case someone wants them). Anyway, please clear me the 1,2,3 above to test this. Thank you for your time btw. Answers to your questions: 1) With you specific setup, you'd have to put QMC2's installation path as the CWD (in QMC2's desktop-icon). Alternatively, you could use MAME's installation path, in which case you would not need to setup any of the search-paths for MAME, because they are (by default) local relative paths ( roms, samples etc.)!

    2) This is answered in 1) I suppose:). 3) QMC2's own data-path(s) are relative paths on Windows per default (relative to the CWD, of course). So there's a discrepancy and you have to decide which paths you would like to explicitly specify: MAME's or QMC2's See also 1):)! Answers to your last comment: Yes, an executable can detect which path it's executed from. That's not an issue.

    But it won't help here simply because QMC2 doesn't 'know' where the emulator's data / folders are (relative to its CWD). THIS is the 'impossible' part.

    It's not 'my method', it's a matter of principle. For instance, when you start an executable from a CMD prompt on Windows (or shell on UNIX), the CWD is implicitly set to whatever directory cmd.exe is currently at.

    So if you 'cd' to QMC2's installation folder and execute 'qmc2-mame.exe' from there, then QMC2's installation folder is the CWD. If you 'cd ' then the CWD is the root folder on the current drive etc however, it's not impossible to change the CWD at run-time, but it's impossible to guess what you want to achieve and thus to do this automatically:). D: cd FE QMC2 Then run qmc2-mame.exe, I suspect it can detect it run from D: FE QMC2 right?

    If instead I just change to drive D: but NOT 'cd' in FE QMC2, and instead call the program like that: FE QMC2 qmc2-mame.exe then what will the executable detect as CWD? Or again D: FE QMC2? I am not sure but even in the first case (it detects CWD as D: ) I think I remember there is a way to find out that in fact itself is resided in D: FE QMC2. I think also Linux allows for this.

    If I am correct then I have a point. If I am not correct then I understand what you are saying. D: cd FE QMC2 Then run qmc2-mame.exe, I suspect it can detect it run from D: FE QMC2 right? Yes, correct. If instead I just change to drive D: but NOT 'cd' in FE QMC2, and instead call the program like that: FE QMC2 qmc2-mame.exe then what will the executable detect as CWD? Or again D: FE QMC2?.

    D:. is the correct answer:). I am not sure but even in the first case (it detects CWD as D: ) I think I remember there is a way to find out that in fact itself is resided in D: FE QMC2. I think also Linux allows for this. If I am correct then I have a point. If I am not correct then I understand what you are saying. Unfortunately, you're not completely correct in this.

    Sure, the QMC2 executable can 'detect' that it's really executed from 'D: FE QMC2 qmc2-mame.exe', but which additional information would we gather by knowing this with regard to MAME? MAME could be installed anywhere, even on another drive so we win nothing from this knowledge. And that's the sole point I'm discussing with you all the time:) (it's OK to discuss this, don't get me wrong!). I guess what you want me to do is adding an option like 'automatically set QMC2's CWD to the path of its executable'. This should be an easy task. I hope YOU don't get me wrong for trying.:) Starting from the bottom, yes I would love this option. 'My' method indeed works if the drive root is common.

    (which for linux after all is ALWAYS common, it is '/' so everything is relative to that) In Windows indeed it needs a common drive (or UNC root). I would still love this option to be there in case someone needs it (like me:D). I do understand your argument sure.

    In the case (and only that case) where all the below check: - QNC2 and MAME are in different drives OR different UNC ROOT (which is ONLY when they are on a different server), or one is on UNC and the other on a local drive. AND - We are on Windows.

    (because in linux all local drives and remote mounts are still all under / root) then sure, 'my' method does not work. For all other cases it does work. So I.IF. it is as easy as issuing a call to QCoreApplication::applicationDirPath and you can place a tick somewhere for that, then I still would love to have it.

    Good thing that both sides are clear finally though.:D.

    Bug 1261293 Get_pid_cwd Support For Mac