NOTE: In order to view the ToolTips in the coding sections (aqua background), you must have javascript enabled. This page assumes you already have Johnny5 and your frontend of choice or BuddaMAME installed and just wish to add support for viewer static images from Johnny5.
CAUTION:
If you are used to working with text files, it
is easy to
accidentally double-click a batch file to edit it or right-click and
select "Open", rather then
right-clicking and selecting "Edit". Of course, this launches
the file. If this happens, press Ctrl-Alt-Delete, and then
End Task on the Cmd.exe entry.
INTRODUCTION AND THEORY
This page explains how to create a folder of images generated with the Johnny5 Viewer program. There are three primary situations where you might want to do this:
THEORY OF OPERATION
Special thanks to
BuddaBing for developing this procedure and walking me through getting
it working. This procedure relies on two batch files named
Batch2.bat and Batch1.bat. Batch2.bat simply calls Batch1.bat
repeatedly, passing a gamename (and maybe other parameters) to the
first batchfile. Batch1.bat reads a game name, passes it to
Johnny5 as an input with the -justprint take, and then renames and
saves the image file to a new directory.
PRELIMINARY SET-UP
First off, this is optional, but if you are using WinXP, I highly recommend installing the "Open Command Window Here" Powertoy from http://www.microsoft.com/windowsxp/downloads/powertoys/xppowertoys.mspx. This will let you right-click on a folder and have a command prompt pointing to it. I think Win98SE already includes this feature (although you might need TweakUI to add it). I'm not sure about other OS's. I will assume from here on that you have it installed. If you choose not to install it, you will have to navigate to the proper directory using "CD" commands as covered in the batch files below.
Other ways of adding this are shown here (Win2k), here (Win2k), here (Win2k), and here (Win98 up). In case all this fails (and for me in one case it did), you can simply copy cmd.exe from \WindowsRoot\System32\cmd.exe to the applicable folder and double-click that.
Next, you need to
verify that Johnny5's -justprint option is working. If you
didn't
earlier, download and install
Irfanview
and copy the main program file (usually i_view32.EXE) to the C:\johnny
folder. This causes Johnny5's
-justprint tag to save images in .PNG format rather than .BMP format.
Run Street Fighter with the -justprint flag, as
follows: Right-click on the C:\johnny folder and select "Open
Command Prompt" type Johnny5
sf -justprint
and press Enter. You should see an image named controls.png
in
the C:\johnny folder. Verify that the file shows your Street
Fighter layout. (There is a chance that you will see only a
controls.bmp image and no controls.png. We will deal with
this later, if required).
BATCH1.BAT
CREATION AND SETUP
Johnny5 will work with the romname only as an arqument, works better with the romname and parent rom as arguments, and works best with romname, parent rom and driver as arguments. I recommend creating Batch1.bat and Batch2.bat in the main Johnny5 folder. To create Batch1.bat, for now, assume all three parameters will be available and copy the following text and paste into Notepad and save in C:\Johnny as Batch1.bat. See the ToolTips for explanations and alternate methods:
If we cannot get driver info, this will be modified as follows:
If we cannot get driver or parent info, this will be modified as follows:
BATCH2.BAT CREATION AND SETUP
Batch2.bat will also be saved in the main johnny5 folder and will have the following format (with maybe only the first or first and second parameters instead of all three).
There are three ways to create this file:
BATCHFILE TESTING AND EXECUTION
CAUTION: If you are used to working with text files, it is easy to accidentally double-click a batch file to edit it or right-click and select "Open", rather then right-clicking and selecting "Edit". Of course, this launches the file. If this happens, press Ctrl-Alt-Delete, and then End Task on the Cmd.exe entry.
If desired, change your desktop resolution (1024x768, etc.) to the resolution that you wish to create the files in. (Note: I did not change this, but if you are running BuddaMAME at 800x600 or your frontend does not scale well, you might want to set this to the most-used value to minimize image scaling.)
If not previously done, create a c:\elimages\layouts (or whatever batch1.bat copies the files to) folder.
Before we run a full-blown session, it is a good idea to test this and make sure it works. Navigate to c:\johnny and copy your batch2.bat file to batch2test.bat. Right-click on this file, select "Edit", and delete all but about the first five lines. Save the file. Double-click the file and the screen should flash a few times and in a minute or so, you should have five gamename.png files in the c:\elimages\layouts folder. Verify these files look correct.
Now we are ready to run the full session!
CAUTION: Creating a full set of MAME layouts requires about 1 Gb of HD space. If the batch file created .BMP files instead of .PNG files, expect this number to be around 10 Gb. (If required, you can partially run the batchfile, then convert from .BMP to .PNG, but this is not recommended due to the likelihood of running out of HD space.)
CAUTION: The batchfile will take about 6-8 hours (estimated on a P4 1.8 Ghz) for a full MAME set. During this time, the computer will alternately flash the screen between black and normal applications. Needless to say you won't be getting any work done during this time. It is recommended that you run the batch file at night and turn off your computer monitor during execution. If required, execution may be terminated pressing Ctrl-Alt-Delete, and then End Task on the Cmd.exe entry.
Double-click batch2.bat in the c:\johnny folder, turn off the monitor, go to sleep, and check back in the morning.
NOTE: If it is necessary to cancel the batchfile before it finishes, there is no need to repeat all the work that has been completed. Simply navigate to the c:\elimages\layouts folder, sort by file date, see what the last file created was, and delete the entries up to this point from the batch file. Save the batch file with a new name and run the saved file. This procedure may also be used if you want to create the images in a several stage process rather than all at once.
IRFANVIEW BATCH CONVERSION (IF NEEDED)
The following procedure is only required if the batch files created .BMP files rather than .PNG files:
Navigate to the
c:\elimages\layouts folder and open any image in Irfanview™.
In Irfanview, select File>Batch Conversion/Rename.
On
the right select "Files of Type" - BMP/DIB/RLE Windows Bitmap.
On
the left side, select "Add All". On the right, select "Use
This
Directory as Output". On the right, under "Work As", select
Batch
Conversion. Under "Select Format", select "PNG - Portable
Network
Graphics". Check "Use Advanced Options". Click
Options and
select level of compression (recommed 9). Click "Set Advanced
Options" and select "Delete Original Files After Conversion" and "Save
Files With Original Date/Time". Click okay and then click
"Start"
on the left side. Irfanview should convert all the files for
you
pretty quickly.
EMULOADER INTEGRATION
Setting up EmuLoader to work with these files is extremely easy. First, I recommend using the Lanczos filter, as I feel it does the best job of keeping text legible as an image is scaled. Select it from the Images>Filter tab from the taskbar.
Next, from the taskbar, simply select File>Preferences>Folders/Zip Files tab. Select the Images tab and under Control Panel Layouts, select c:\elimages\layouts.
Done.
MAMEWAH INTEGRATION
Getting
these images to
display properly in MAMEwah is simply a matter of setting up a custom
layout in the layout editor that displays the images properly.
I
am not going to walk you through this, but it is fairly straightforward
and one of the strongest features of MAMEwah. I do show some
example layouts showing these images on the Introductory
Page.
OTHER FRONTENDS
Basically setup for other frontends just involves setting the frontend so it looks at the c:\elimages\layouts folder for one of the available image types.
BUDDAMAME INTEGRATION
See the bottom of the Introductory Page for information on displaying these images in BuddaMAME.
AHK SCRIPT INTEGRATION
If you wish to use an image viewer to show the images rather than launching Johnny5, you can do it using either IrfanView or CPVW. I have not tested either method, but I am pretty sure the IrfanView method will work, and am relying on papaschtroumpf from BYOAC for the CPVW info:
I haven't verified the CPVW method, so the %1%.png might need one less percent sign or something, but I think it will work. Let me know if it doesn't and you need to change something.
CONCLUSION
Well,
that's about all I
have to say. Hopefully this page was helpful for you.
If
you see anything major that I got wrong, know of a better way to do
this, or if you just can't get it to work, shoot me an E-mail and I will
either fix the page or try to help you out.L