MAMEWorld >> EmuChat
Previous thread Previous  View all threads Index   Next thread Next   Threaded Mode Threaded  

Pages: 1

Elaphe
MAME
Reged: 07/06/05
Posts: 127
Send PM


When MAME fails to load a game...
#315197 - 09/30/13 11:19 PM


I is there any way to send some info to the clipboard or to a log file so as to determine when MAME fails to load a game, be it because the file is corrupt of the romset outdated?






redk9258
Regular
Reged: 09/21/03
Posts: 3968
Loc: Troy, Illinois USA
Send PM


Re: When MAME fails to load a game... new [Re: Elaphe]
#315199 - 10/01/13 12:08 AM


Are you running from the command prompt?

Try -verbose

MAME -verbose pacman>pacman.txt



Elaphe
MAME
Reged: 07/06/05
Posts: 127
Send PM


Re: When MAME fails to load a game... new [Re: redk9258]
#315229 - 10/01/13 02:21 PM


Thanx, but I need this for a script. I need a way to tell the script if the game actually loaded or not.

I've figured out a reasonable way: mame game -log. This creates a error.log file. If this file has just one line (here I get something like "Physical width 1920, height 1080"), that means there was an error loading the game. I've tried with an incomplete romset and with a corrupt .zip file.

Can you confirm that in all other cases that file will have several lines of text? I can use that for a condition in my script.

Oh, and do you know if the -log option has any penalty in performance during the game or does it just work during the rom load?






krick
Get Fuzzy
Reged: 02/09/04
Posts: 4235
Send PM


Re: When MAME fails to load a game... new [Re: Elaphe]
#315234 - 10/01/13 05:08 PM


I think you can just check the return value of the MAME exe. Zero should be a normal exit, and non-zero should be an error.

Historically (in DOS), return values shouldn't be negative, but I don't know if MAME follows that convention.

http://en.wikipedia.org/wiki/Exit_status


http://stackoverflow.com/questions/33487...ws-command-line

Make sure to read the comments and the other solutions.

Edited by krick (10/01/13 05:11 PM)



GroovyMAME support forum on BYOAC



Elaphe
MAME
Reged: 07/06/05
Posts: 127
Send PM


Re: When MAME fails to load a game... new [Re: krick]
#315243 - 10/01/13 09:30 PM


Thanx. It worked. I just need to use runwait instead of run with Autohotkey and now it detects the errorlevel on mame's exit. If it's 2, that means the game failed to load.





Pages: 1

MAMEWorld >> EmuChat
Previous thread Previous  View all threads Index   Next thread Next   Threaded Mode Threaded  

Extra information Permissions
Moderator:  Robbbert, Tafoid 
1 registered and 141 anonymous users are browsing this forum.
You cannot start new topics
You cannot reply to topics
HTML is enabled
UBBCode is enabled
Thread views: 2032