MAMEWorld >> EmuChat
View all threads Index   Threaded Mode Threaded  

Pages: 1

ThumpieBunnyEve
Techno Mistress
Reged: 11/04/10
Posts: 13
Send PM


Mame Gives No Logs, PlzHlp!
#376767 - 06/10/18 01:58 AM


Im using a batch file to run Mame0.198b
i intend to do all my options through batch file command line switches rather then an .ini for reasons ill explain later.

The problem im having is no log output. at all. anyplace, from anything i run through command line...

example
Code:

start "MAME.198b_x64" C:\Games\Emu\Arcade\Mame0.198b\mame64.exe -v -help > mameLog.txt

pause

the mame window appears for a fraction of a second, then vanishes. mameLog.txt is created. and is blank...

example
Code:

start C:\Games\Emu\Arcade\Mame0.198b\mame64.exe -v -oslog -log -debug > mameLog.txt

pause



does the same thing, but at-least i get a CMD-window for a moment, that shows the data output of what was going on.. yet when it closes theres still no log file :{

how do you make the logs appear?
i want a text file copy of -everything- the CMD window displays. i want error logs, and success logs and all that. What am i doing wrong? i cant see why a file doesn't run, if the window disappears as soon as it encounters an error and leaves no trail for me to trace!

please keep in mind. im running from a .bat and I'm not using a mame.ini. this is intentional, as what im setting up to work with will be running default installed mame through command line switches only, and will (i hope) operate stand alone even when i update Mame version numbers.



John IV
IV/Play, MAME, MAMEUI
Reged: 09/22/03
Posts: 1969
Loc: Washington, USA
Send PM


Re: Mame Gives No Logs, PlzHlp! new [Re: ThumpieBunnyEve]
#376771 - 06/10/18 03:20 AM


Try change directory-ing into the mame directory first.
cd c:\mame
mame blah blah

[Edit] and you're not specifying a game/machine to run.



john iv
http://www.mameui.info/



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


Re: Mame Gives No Logs, PlzHlp! new [Re: ThumpieBunnyEve]
#376772 - 06/10/18 05:01 AM


I think the "start" command might be the problem.

I can run MAME directly in a batch file all day and capture the output in a log file.

Also, I'm not sure but you might need to add: 2>&1
to the end of your command line to capture both standard out and standard error...


C:\Games\Emu\Arcade\Mame0.198b\mame64.exe -v -help > mameLog.txt 2>&1


EDIT: I found more about redirecting the output when using "start"...

http://www.robvanderwoude.com/battech_redirection.php

Quote:



Escaping Redirection (not to be interpreted as "Avoiding Redirection")

Redirection always uses the main or first command's streams:

START command > logfile

will redirect START's Standard Output to logfile, not command's!
The result will be an empty logfile.

A workaround that may look a bit intimidating is grouping the command line and escaping the redirection:

START CMD.EXE /C ^(command ^> logfile^)

What this does is turn the part between parentheses into a "literal" (uninterpreted) string that is passed to the command interpreter of the newly started process, which then in turn does interpret it.
So the interpretation of the parenthesis and redirection is delayed, or deferred.
Note: Be careful when using workarounds like these, they may be broken in future (or even past) Windows versions.

A safer way to redirect STARTed commands' output would be to create and run a "wrapper" batch file that handles the redirection.
The batch file would look like this:

command > logfile

and the command line would be:

START batchfile






GroovyMAME support forum on BYOAC



ThumpieBunnyEve
Techno Mistress
Reged: 11/04/10
Posts: 13
Send PM


Re: Mame Gives No Logs, PlzHlp! new [Re: John IV]
#376773 - 06/10/18 01:09 PM


Im aware im not specifying a game to run. Im presently looking to capture the error of "no game selected" to a log file when i run the batch. Ill try a CD first. but for the record, the batch file is being run from -inside- the mame directory where the .EXE is.



RobbbertModerator
Sir
Reged: 08/21/04
Posts: 3198
Loc: A long way from you
Send PM


Re: Mame Gives No Logs, PlzHlp! new [Re: ThumpieBunnyEve]
#376774 - 06/10/18 01:45 PM


>



ThumpieBunnyEve
Techno Mistress
Reged: 11/04/10
Posts: 13
Send PM


Re: Mame Gives No Logs, PlzHlp! new [Re: Robbbert]
#376802 - 06/12/18 04:21 AM


well i sort of do have the basics worked out...

im using a Vector.ini for some default vector related changes as all the games i want on each screen are vector related. My initial intention was to do it all entirely through batch command line. which is still do abale. but kind of less necessary with a vector.ini though each game still requires some advanced spesiffic tweaking. which takes me back to the command line of course. Eventually ill have each of them cyceling between screens with even more. kinda like a screen saver. They aren't meant to be played so much as displayed. with the "-sound none" option as well or itd be a noisy mess!

but i am still not grasping how to escape//send the log-to-file aspect through start. some one posted a way to do it using ^escape characters but I've not been able to get such to work.

so heres what im looking add for each:
" >> C:\Games\Emu\Arcade\Mame0.198b\mameLog.txt 2>&1"
( which produced a blank log :{ )

(please note the >> as it indicates append rather then replace)

And heres my present working (but not logging).bat file below.

i still need help making that >> line work for each of these 4 start'ed commands.


Code:

start "STARWARS" C:\Games\Emu\Arcade\Mame0.198b\mame64.exe starwars1.zip -rp F:\ROMs\Arcade -skip_gameinfo -screen \\.\DISPLAY5 -triplebuffer -throttle -sleep -refreshspeed -sound none -bloom_overdrive 1.7,2.8,2.4 -phosphor_life 0.4,0.1,0.6 -flicker 0.9

timeout /t 7 /nobreak

start "ASTEROIDS" C:\Games\Emu\Arcade\Mame0.198b\mame64.exe asteroid.zip -rp F:\ROMs\Arcade -skip_gameinfo -screen \\.\DISPLAY4 -triplebuffer -throttle -sleep -refreshspeed -sound none -video auto -gamma 0.3 -full_screen_gamma 0.3 -bloom_overdrive 1.0,1.0,1.0 -phosphor_life 0.0,0.0,0.0 -bloom_scale 0.1 -flicker 0.5 -beam_width_min 1.0
-beam_width_max 1.0

timeout /t 7 /nobreak

start "TEMPEST" C:\Games\Emu\Arcade\Mame0.198b\mame64.exe tempest3.zip -rp F:\ROMs\Arcade -skip_gameinfo -screen \\.\DISPLAY3 -triplebuffer -throttle -sleep -refreshspeed -sound none -flicker 0.6

timeout /t 7 /nobreak

start "BATTLEZONE" C:\Games\Emu\Arcade\Mame0.198b\mame64.exe bzone.zip -rp F:\ROMs\Arcade -skip_gameinfo -screen \\.\DISPLAY2 -triplebuffer -throttle -sleep -refreshspeed -sound none -video auto -flicker 0.8




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


Re: Mame Gives No Logs, PlzHlp! new [Re: ThumpieBunnyEve]
#376804 - 06/12/18 05:42 AM Attachment: bench.zip 2 KB (0 downloads)


The part that I posted in the edit to my post and I highlighted in red text is the right way to do it.

Create 4 batch files and then call them each with start from the primary batch file


Code:

start "STARWARS" starwars.bat
timeout /t 7 /nobreak
start "ASTEROIDS" asteroid.bat
timeout /t 7 /nobreak
start "TEMPEST" tempest.bat
timeout /t 7 /nobreak
start "BATTLEZONE" bzone.bat



However, logging to a single file doesn't work with the start command because each start launches a separate process. So once the first one runs and opens the log file, none of the other processes will be able to write to the same log file.

Can't you just use a normal batch file and just run the MAME exe sequentially for each game? I do something similar with my benchmark script (attached).

You can use the seconds_to_run parameter to set how long the game should run instead of using "timeout".

I don't understand why you're so fixated on using the "start" command. What does it bring to the table?

Ultimately, what is your goal? What do you want this to do... EXACTLY?

Edited by krick (06/12/18 06:01 AM)



GroovyMAME support forum on BYOAC



katananja
Reged: 02/28/12
Posts: 3
Send PM


Re: Mame Gives No Logs, PlzHlp! new [Re: ThumpieBunnyEve]
#376805 - 06/12/18 06:06 AM


Is that what you want?

Code:

@echo off
set mame=D:\mame\mame.exe
set game=pong
set rompath=D:\mame\roms
set mame_options=-skip_gameinfo -triplebuffer -throttle -sleep -refreshspeed -flicker 0.9
set screen=\\.\DISPLAY1
set sound=none
set bloom_overdrive=1.7,2.8,2.4
set phosphor_life=0.4,0.1,0.6

echo "starting PONG"
%mame% %game% -rp %rompath% -skip_gameinfo -screen %screen% -sound %sound% -bloom_overdrive %bloom_overdrive% -phosphor_life %phosphor_life% -verbose > mamelog.txt |more 2>&1
timeout /t 7 /nobreak




ThumpieBunnyEve
Techno Mistress
Reged: 11/04/10
Posts: 13
Send PM


Re: Mame Gives No Logs, PlzHlp! new [Re: krick]
#376807 - 06/12/18 07:09 AM


im using the timeout only to create an interesting delay between each screen starting. my effects use a crt-startup effect. the timeouts also help against "cannot start direct3d" error that comes from starting more then one process at a time. something to do with how d3d loads, there is a preload phase before it settles into operation. once its operating and not preloading, then you can start a new instance. so initially my timeouts were 1 second. but i set them to 7. just cause it looks awesome on each screen to see it change one by one! *^-^*

the -reason- for not wanting a bunch of extra bat files i call on is just that. im not looking for 1 bat to rule them all. I'm looking for 1 bat to edit them all. i am not fond of having a separate ini for every rom, a separate bat for every rom, and then a separate bat to run all the bats. it's a circus to try to edit each one, when i can instead edit-and-run them all from just 1 instance.

now as to why i prefer to use start: The retitled CMD window that [start "NAME" [path]] is creating, allows me as a user (whom is witnessing them opening), to easily associate which cmd window is associated to which Display window. this is because for every mame instance, there is both a cmd output window for it, and a display window output for it. in my first experiments, i ended up with 4 cmd windows just called MAME. and the 4 display windows too. discerning which to close or look to for details, was a mess! the start command allows me to rename the title of the mame-cmd window that will be created.

but i will say, your input about the locked write process makes sense. i presumed it only opened wrote to saved and exited out of the log file when it needed to update something. but i realize even if that was the case id be getting any one of them mixing their feedback into the log file randomly. this is not desired at all.. thank you for helping me realize a flaw before i encountered it! I'll be changing the designated log for each instance hence forth so i can keep track of which mame is the one having issue when issue occurs. not that im having any issues now that its all working. but going forward i do want to have logs.

presently im looking into how to do windowed-fullscreen too, and set the windows as maximized without title-bars, and set them to "always on top" so i don't have to alt tab to see each one on each screen. >.<; that's my largest problem at the moment. and I've read in other forums, using "START" is how to manage window's window creation perimeters toward that regard.

EDIT:
i think im going to toy with "DxWnd" (v2_04_79_build.rar)
it can force a fullscreen-DirectX game to be windowed mode, and has a lot of switches i can call on to do things like maximize, and remove tital-bar i think. not sure if i can do "always on top" with it. but i know cmd: "start" can do that.

EDIT2
Nope fail drats! DxWnd works only on x86 (32 bit) processes. >.< its not recognizing my mame64 at all. Ill try GameCompanion(2.4 by BUDA20) or Borderless-Gaming (https://github.com/Codeusa/Borderless-Gaming)
though...
still need an effective way of still using start, and getting a log file from the mame that runs. maybe i can try a
Code:

start "asteroids" mame.exe asteroids.zip "> asteroidsLog.txt |more 2>&1"

sort of thing using quotes so its escaped once and sent as a parameter for mame to use and not for that bat to use.

EDIT3: Thanks Kirik!
Code:


start "TEMPEST" CMD.EXE /C ^(C:\Games\Emu\Arcade\Mame0.198b\mame64.exe tempest3.zip -rp F:\ROMs\Arcade -skip_gameinfo -screen \\.\DISPLAY5 -triplebuffer -throttle -sleep -refreshspeed -sound none -flicker 0.6 -window -maximize ^> tempestLog.txt 2^>^&1^)

seems to work for logging!

EDIT4:
still trying to tackle the maximized Windowed~borderless~fullscreen though (wow that's a mouthful)! Vas mentioned BGFX creates one, GPU rendered, but my attempt at adding -video BGFX did not result in a borderless window at all.

Here are my specs:
------------------------
Operating System: Win7Ult_x64 SP1 Eng
MotherBoard: ASUS E6356_P6X58-E_Pro
Processor: Intel® Core™ i7 CPU X 990 @ 3.5GHz [12 CPUs]
Memory: 48GB DDR3 RAM @1600MHZ 9-9-9-24 CL9
DirectX Ver: DirectX 9 & DirectX 11
GPU1 "\\.\DISPLAY1": Sea Hawk NVIDIA GeForce GTX 1080 HD
GPU2 "\\.\DISPLAY5": R6850 Cyclone 1GD5 Power Edition OC [AMD Radeon HD 6800 Series]
mame64.exe v0.198b :
------------------------

i used the following
Code:

-video bgfx -windowed -maximise



Edited by ThumpieBunnyEve (06/17/18 11:22 PM)



ThumpieBunnyEve
Techno Mistress
Reged: 11/04/10
Posts: 13
Send PM


Re: Mame Gives No Logs, PlzHlp! new [Re: katananja]
#376808 - 06/12/18 07:30 AM


having thought more about it and with some insight from user:krick I've come to the conclusion that i want something similar to your line with a simple name change:

Code:


> asteroidsLog.txt |more 2>&1
> starwarsLog.txt |more 2>&1
> tempestLog.txt |more 2>&1


and so on. using ">>" to append is a bad idea after all. and trying point all 4 running mames to log to the same log file was ill-planned on my part. So far however getting any of them to do logging from use of the "start" option has been nightmareish. but I've read using "start" is the only way to handle some of the future aspects ill be working with, such as starting in windowed fullscreen mode without a tital-bar, and setting each to always on top, so they are not obscured by other programs.

as noted elsewhere i only use the "timeout" line to delay the opening of the 4 instances running on each display. as d3d doesn't like to be initialised 4 times at the same time. i get no errors however if i give each d3d a moment to get past preloading. otherwise theres an error list of canot create dicrect3d resources. which repeats till the availibility to begin a new preloading of a d3d instance finally opens.

example output to make that easier to grasp:

Code:

start "STARWARS"
began a d3d process.
start "ASTEROIDS"
cannot create d3d process. is it busy?
cannot create d3d process. is it busy?
cannot create d3d process. is it busy?
cannot create d3d process. is it busy?
began a d3d process.
start "TEMPEST"
cannot create d3d process. is it busy?
cannot create d3d process. is it busy?
cannot create d3d process. is it busy?
cannot create d3d process. is it busy?
cannot create d3d process. is it busy?
cannot create d3d process. is it busy?
cannot create d3d process. is it busy?
cannot create d3d process. is it busy?
began a d3d process.
start "BATTLEZONE"
cannot create d3d process. is it busy?
cannot create d3d process. is it busy?
cannot create d3d process. is it busy?
cannot create d3d process. is it busy?
cannot create d3d process. is it busy?
cannot create d3d process. is it busy?
cannot create d3d process. is it busy?
cannot create d3d process. is it busy?
cannot create d3d process. is it busy?
cannot create d3d process. is it busy?
cannot create d3d process. is it busy?
cannot create d3d process. is it busy?
cannot create d3d process. is it busy?
cannot create d3d process. is it busy?
began a d3d process.



each one is progressively longer in log file error, only because all 4 are started figuratively at the same time

however when i add the timeout line, its just a pause of 7 seconds before automatically resuming the script. "Timeout" is just the command called "pause" with the option to "resume at the next command when user has not pressed a key". that's all timeout is. it's a good way to Sleep the script for a few seconds. or allow me to skip the sleep by pressing any key :}

EDIT
i think im going to toy with "DxWnd" (v2_04_79_build.rar)
it can force a fullscreen-DirectX game to be windowed mode, and has a lot of switches i can call on to do things like maximize, and remove tital-bar i think. not sure if i can do "always on top" with it. but i know cmd: "start" can do that.
EDIT2
Nope fail drats! DxWnd works only on x86 (32 bit) processes. >.< its not recognizing my mame64 at all. Ill try GameCompanion(2.4 by BUDA20) or Borderless-Gaming (https://github.com/Codeusa/Borderless-Gaming)
though...
still need an effective way of still using start, and getting a log file from the mame that runs. maybe i can try a
Code:

start "asteroids" mame.exe asteroids.zip "> asteroidsLog.txt |more 2>&1"

sort of thing using quotes so its escaped once and sent as a parameter for mame to use and not for that bat to use.

Edited by ThumpieBunnyEve (06/12/18 08:28 AM)



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


Re: Mame Gives No Logs, PlzHlp! new [Re: ThumpieBunnyEve]
#376825 - 06/13/18 03:44 AM


> i think im going to toy with "DxWnd" (v2_04_79_build.rar)
> it can force a fullscreen-DirectX game to be windowed mode, and has a lot of switches
> i can call on to do things like maximize, and remove tital-bar i think. not sure if i
> can do "always on top" with it. but i know cmd: "start" can do that.
> EDIT2
> Nope fail drats! DxWnd works only on x86 (32 bit) processes. >.< its not
> recognizing my mame64 at all. Ill try GameCompanion(2.4 by BUDA20) or
> Borderless-Gaming (https://github.com/Codeusa/Borderless-Gaming)


Do you need a separate utility? MAME has options for running in a window...

http://docs.mamedev.org/commandline/commandline-all.html

Quote:


-[no]window / -[no]w

Run MAME in either a window or full screen. The default is OFF (-nowindow).

-[no]maximize / -[no]max

Controls initial window size in windowed mode. If it is set on, the window will initially be set to the maximum supported size when you start MAME. If it is turned off, the window will start out at the smallest supported size. This option only has an effect when the -window option is used. The default is ON (-maximize).





> still need an effective way of still using start, and getting a log file from the
> mame that runs. maybe i can try astart "asteroids" mame.exe asteroids.zip ">
> asteroidsLog.txt |more 2>&1" sort of thing using quotes so its escaped once and sent
> as a parameter for mame to use and not for that bat to use.


Have you tried escaping with the '^' character like I suggested earlier?

Here's more info...
http://www.robvanderwoude.com/escapechars.php

Something like this...


Quote:


start "TEMPEST" CMD.EXE /C ^(C:\Games\Emu\Arcade\Mame0.198b\mame64.exe tempest3.zip -rp F:\ROMs\Arcade -skip_gameinfo -screen \\.\DISPLAY3 -triplebuffer -throttle -sleep -refreshspeed -sound none -flicker 0.6 ^> tempestLog.txt 2^>^&1^)





GroovyMAME support forum on BYOAC



ThumpieBunnyEve
Techno Mistress
Reged: 11/04/10
Posts: 13
Send PM


Re: Mame Gives No Logs, PlzHlp! new [Re: krick]
#376844 - 06/13/18 08:43 PM


@krick ~ just want to say thank you for your help so far!

My first attempts with what you mentioned earlier in this thread, (using ^ to escape elements to be passed,) did not work for me. but that may be due to my failure to structure it right. i didn't say anything, as i presumed my lack of grasp using ^ was the issue, and intended to give it a few more tries later after more research on the topic.

Ill try your provision shortly. Though reguarding the switches, does Mames -maximize option retain a menu bar at the top of its -window'ed maximized display? as it is the non-presence of a titlebar-menubar-banner that i am working to achieve with third party apps.

Ill try your modifications shortly, as im currently out and about.



ThumpieBunnyEve
Techno Mistress
Reged: 11/04/10
Posts: 13
Send PM


Re: Mame Gives No Logs, PlzHlp! new [Re: krick]
#376944 - 06/17/18 10:36 AM



krick wrote:
Quote:


start "TEMPEST" CMD.EXE /C ^(C:\Games\Emu\Arcade\Mame0.198b\mame64.exe tempest3.zip -rp F:\ROMs\Arcade -skip_gameinfo -screen \\.\DISPLAY3 -triplebuffer -throttle -sleep -refreshspeed -sound none -flicker 0.6 ^> tempestLog.txt 2^>^&1^)





@krick i gave it another try using your properly escaped version and it works! i got a log file through this method, from the Start option! exactly as you wrote it! thank you for helping! this ^ stuff is new to me. in all my years of batch files i never had to escape anything using this method before! thank you!

now i just need to find a fullscreen-windowed-mode build of mame. As mentioned in other replies, windowed mode is the only way i can display one on each screen without the others minimizing. Windowed mode allows for mouse and render focus to be outside of the running game window.

a "Fullscreen Windowed mode", or "Windowed Fullscreen", is when the game continues to be rendered by the cpu instead of gpu, and fills the whole screen area, with no Title-bar, Menu-bar,or Min-Max-Close banner.

Another term for it is Borderless Windowed mode. but that can be confused with one that does not fill the full screen.

Most games must be in any mode other then Fullscreen, in order to stream over something like skype or twitch. that means windowed modes are the only thing available to them. Fullscreen-Windowed mode fives the appearance of being true fullscreen, while actually being a window with no evidence that it is one. borders are hidden and the top banner of title and Min-Max-close are not present in this mode.

Does Mame have an option like that somehow?



Vas Crabb
BOFH
Reged: 12/13/05
Posts: 4462
Loc: Melbourne, Australia
Send PM


Re: Mame Gives No Logs, PlzHlp! new [Re: ThumpieBunnyEve]
#376945 - 06/17/18 11:03 AM


MAME runs in a borderless full-screen window with BGFX output, but it's still rendered by the GPU, not the CPU. Commercial games run in this mode, too (e.g. Hotline Miami). Running in a window doesn't imply CPU rendering.



ThumpieBunnyEve
Techno Mistress
Reged: 11/04/10
Posts: 13
Send PM


Re: Mame Gives No Logs, PlzHlp! new [Re: Vas Crabb]
#376961 - 06/17/18 10:49 PM


@Vas Crabb:

for me, on Mame0.198b mame64.exe
adding "-video BGFX -window -maximize"
does not provide me a borderless windowed screen, or a fullscreen bordeless window. Can you verify it works for you?

what i see still has the:

______________________
|Mameᅟᅟᅟᅟᅟ[_][☐][X] |
|¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯|

at the top.
here is my command:

Code:

start "TEMPEST" CMD.EXE /C ^(C:\Games\Emu\Arcade\Mame0.198b\mame64.exe tempest3.zip -rp F:\ROMs\Arcade -skip_gameinfo -screen \\.\DISPLAY5 -triplebuffer -throttle -sleep -refreshspeed -sound none -flicker 0.6 -video BGFX -window -maximize ^> tempestLog.txt 2^>^&1^)




Vas Crabb
BOFH
Reged: 12/13/05
Posts: 4462
Loc: Melbourne, Australia
Send PM


Re: Mame Gives No Logs, PlzHlp! new [Re: ThumpieBunnyEve]
#376966 - 06/18/18 01:42 AM


Use -video bgfx -nowindow to get a borderless window.



ThumpieBunnyEve
Techno Mistress
Reged: 11/04/10
Posts: 13
Send PM


Re: Mame Gives No Logs, PlzHlp! new [Re: Vas Crabb]
#376974 - 06/18/18 07:46 AM


TY Vas Crabb! that seems to have done it! though all my post processing effects in the vector.ini seem to be voided.


now to see how much of my post processing effects i can reinstate from the former d3d method of render to bgfx.

back to the drawing board!



ThumpieBunnyEve
Techno Mistress
Reged: 11/04/10
Posts: 13
Send PM


Re: Mame Gives No Logs, PlzHlp! new [Re: ThumpieBunnyEve]
#376975 - 06/18/18 07:56 AM


aww poo!!!

quote:
Quote:


(http://docs.mamedev.org/advanced/bgfx.html)
Tweaking BGFX HLSL Settings inside MAME

Warning: Currently BGFX HLSL settings are not saved or loaded from any configuration files. This is expected to change in the future.




So i lose all my automatic ini or command line hlsl shader options.... darnit!!!


Pages: 1

MAMEWorld >> EmuChat
View all threads Index   Threaded Mode Threaded  

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