Build Your Own Arcade Controls Forum
Main => Software Forum => Topic started by: papaschtroumpf on October 07, 2005, 11:15:11 am
-
I create a batch file to try and create a static image for all the games supported by controls.ini using johnny5.
I still don;t have Internet access at home so I don't have an exact copy of what I did but basically I have a for loop that calls another batch file that creates a single picture:
for %%f in (D:\mame\ROMS\*) do makeOne.bat %%~nf
and makeOne.bat along the lines of :
johnny5 %1 -position 0,0,800,600 -justprint
<more stuff here that weeds out the "not found" pictures>
This ended up crashing my computer, upon investigation it turns out I had dozens of i_view32 (or whatever it's called) processes.
I don't know if it's an issue with my specific version of irfanview (I tried what I think is the latest, and a much older one that I had around) but when I run the program from the command line, it doesn't seem to leave irfanview processes around.
Maybe it's a timing issue, irfanview "hangs around" after the makeOne batch file returns?
I went around the problem by removing irfanview from the johnny5 directory, and doing the bmp to png convertion by adding something like the following line after the call to johnny5
"C:\Program Files\Irfanview\i_view32" controls.bmp /convert=controls.png /one
Maybe it's the /one (run only one instance) that does the trick, or maybe it's the way I'm doing it with the batch file.
Either way, this may help someone that runs into the same problem
-
It's hwo you have things setup I'm guessing. You have a bat calling a bat, which can cause timing issues.
You need to take the contents of the bat and put them in the larger bat. Depending upon your os and dos version, the main batch file may not wait until the inner batch is launched and finished before going on to the next stage fo the loop. Irview would obviously become confused and halt because the image it's trying to convert would be constantly manipulated by the most recent j5.
This is assuming of course, that yoru for loop is in a batch file.... if it's in code then your problem is obvious. If you'll excuse me for using visual basic/c++ terms you are doing a "shell", not a "shellandwait".
Again, this is all a guess. IRview is free and that's why I originally added support for it, but they keep changing the command line switches and the internal workings, and I can't really keep up with it.
-
yeah, it's in a batch file. I should probably do "wait makeOne.bat" which is the batch file way of doing a "shellandwait" properly (I think, at least it is for external apps), even though windows XP documentation indicates that calling a batch file from another one should wait for the inner one to finish.
My solution of calling irfanview directly from my inner batch file works also, so I'm not too worried about this.
The reason I have 2 batch files, is that the outer one could be autogenerated with ListGen so that I don't bother generating pictures for games I don't play.
-
Xp's command line has more bugs than a three month old dead guy found on a hot summer's day. I love xp, but where the command line is "emulated" it can act crazy at times. You are probably right, but I wouldn't trust m$'s docs.
-
Xp's command line has more bugs than a three month old dead guy found on a hot summer's day.
That made me laugh!