JOHNNY5 VIEWER USAGE
Heeeeeeeeeeere's
Johnny(5) (click to enlarge and click again to
expand, they will look MUCH better):


The above images
show the output of Howard Casto's Johnny5
Viewer with the games 1943 and Joust. I highly recommend
using this viewer over my previous suggestions, which are posted here.
BACKGROUND AND HISTORY
I just realized some
of you may not have heard of the Johnny5 Viewer and may be wondering
what it does. Mahuti from BYOAC provided a pretty good
textbook style definition, which I have expanded below:
- A graphical viewer which shows game control information
ovelayed on an image of YOUR control panel, based on a
gamename sent to it from a frontend, your key assignments in MAME, and
information in controls.ini.
And here's a more
real-world example, based on the 1943 image above:
- Most of us who use MAME have wondered how a new game was
played, forgotten how we mapped the keys in a particular game, or shown
our control panel/cabinet to a friend only to have them look at it and
say "That's cool!!! How do I use it???". Johnny5 answers
these questions for us. For example, I can send Johnny5 1943 from
the command prompt (or a frontend/script) and the image on the left above will appear, telling
me:
- The full name of the game
- How many players it supports
- Whether gameplay is Simultaneous or Alternating
- That it uses an 8-way Joystick
- That my Prodigy™ joystick should have the lever switched to the right to be in this mode.
- That the red buttton is FIRE and the yellow button is SPECIAL (based on the actual arcade control panel labels)
- That pressing both buttons together causes the plane to loop.
Finally, to really
appreciate Johnny5, we should look at how it has evolved:
- Prior to the controls.dat project, if I wanted to know how to
play 1943, I would have to start MAME and go to the Inputs - This Game
screen. This would tell me that the game used a joystick and two
buttons and the buttons were mapped to L Ctrl and L Alt. I would
have to remember which buttons corresponded to Ctrl and Alt on my
panel, and play the game and mash buttons to see what they did or
whether the joystick was 8-way or 4-way.
- After the controls.dat project, I could open controls.ini in a
text viewer and find out that the joystick was 8-Way, Button 1 was
FIRE, Button 2 was SPECIAL, and pressing both buttons together caused
the plane to loop. So I had all the data I needed to play the
game, but it was very hard to obtain.
- After the release of Johnny5, (with proper frontend support), I
can view the image above and know what the controls are used in the
game. This is great, but doesn't help me if I fire up MAME
without looking at the info first, or forget what it was after starting
the game
- Recently (as of Sep2005), Howard Casto has released an AutoHotKey
(AHK) script for WinXP users and Buddabing has released BuddaMAME (for
Win98SE or WinXP) which allows users to view Johnny5 output while MAME
is paused. Life is good!
INTRODUCTION
This site is best
viewed in at 800x600 or higher resolution. Note that
much of the code sections use ToolTips and JavaScript is required to
view them.
This page will
detail the many ways of using the Johnny5
viewer with a frontend and will take you through the process of setting
it up and
getting it working. I tend to take a systematic, crawl before
you walk method, so I will generally show you how to do things and have
you test things out along the way to make sure the basic steps (running
the viewer with default layouts, running the viewer with custom
layouts, launching the viewer from a frontend) are working, before
adding more advanced steps.
Also, detailed
instructions are provided for EmuLoader only,
(although some MAMEwah references are included also), but most
frontends can support at least some of these procedures.
There are basically five ways of integrating Johnny5 with a
frontend and MAME. (Note that for the most part, any of the
methods may be used independently or in combination. An
overview of the different methods and their implementation follows:
METHOD 1 -
STATIC IMAGE VIEWING
This is perhaps the
most universal method (greatest frontend / OS support) of using
Johnny5 with a frontend. The idea is that screenshots of
Johnny's
output are saved
in an images folder and viewed in the frontend as desired.
Here
are screenshots showing the images method in use in EmuLoader and with
two different layouts in MAMEwah. (Again, click to enlarge
and click again to expand for best image quality. The MAMEwah
images were highly compressed and show lots of pixellation.
The actual screen images are much better.) (I
personally use this method and
Method 5 below).



- Advantages
- Doesn't
require
any additional CPU
loading or memory requirements. Simple for users to use. At
least in EmuLoader, information is
available
if desired, not available if not desired. (You don't have to
view the
info if you don't want to).
- Disadvantages
- Initial set-up of a full
MAME
set probably takes about 6-8
hours to run on a P4 1.8 Ghz computer, and the screen is constantly
flashing,
so you can't do much else with it. . . (This is an overnight
enterprise).
Images are around 200K each, so I think a full set would be about 1Gb
of
storage required. Images are static, so if Controls.ini
changes, or you
re-map controls in MAME, you have to create a new image.
Image is not very
helpful if you are in the middle of a game and realize you don't know
how to
play it.
- Limitations - Should work with any OS,
once the images are created. Should work with any frontend
that can display images (you might have to replace the snapshots with
CP images. Works best with desktop computers and frontends
that scale images well. On an arcade monitor or with a busy
layout, they information displayed my be too small to be useful.
METHOD 2 -
LAUNCH FROM HOTKEY
This method involves
pressing a HotKey (such as "J") to
launch either the Johnny5 viewer or display a screenshot of it similar
to the images above. MameWah supports this.
EmuLoader does not support this method. I think
Dragon King will support it.
- Advantages
- Image is only viewed when needed.
Assuming Johnny5 is launched, image is current with latest
key-mapping and controls.ini data.
- Disadvantages
- Casual users or visitors wouldn't know it was
there. Old users would have to remember what the HotKey is.
Also not useful once MAME is launched.
- Limitations - Will only work
with certain frontends. Frontend must be able to call a
separate (from MAME) application and pass at least the gamename to it
when a specified key combination is pressed.
METHOD 3 -
LAUNCH PRIOR TO MAME
LAUNCH
Under this method,
Johnny5 comes up immediately prior to the
initial launch of MAME.
- Advantages
- Image is current
with latest keymapping and controls.ini data and displayed when you
start the game, so if you forgot before launching MAME you still get to
see it.
- Disadvantages
- Personally, it
would get a little
annoying waiting for the
viewer to come up to explain how to play Galaga, for example.
OTOH, other
users might not know how to play Galaga and want to see the
screen. Also,
if you get used to clicking through this screen, you could think you
know what
the controls are, but then not know when you are actually playing the
game (and not be able to bring the viewer back up)..
- Limitations - Requires a
frontend that can launch a batch file with the game name rather than
MAME (or launch a separate application prior to launching MAME).
METHOD 4 -
LAUNCH AUTOHOTKEY
SCRIPT ALONG WITH MAME - JOHNNY5 LAUNCHES WHEN MAME IS PAUSED
This is actually the
method Howard Casto is working on and
favors. Basically, when you are playing a game and press the
P key, MAME is minimized and Johnny5 is displayed. When you
press the P key again, Johnny exits and MAME resumes.
- Advantages
- Almost the best of
all
worlds. If you need to
know what the buttons do, just pause the game. If you don't,
just keep
playing. Works with all MAME's without requiring any changes
or customs
builds.
- Disadvantages
- Script is
still kinda buggy (12Sep2005). There are two Error Modes.
In the first mode, MAME does not pause when the
viewer
launches, so you have a chance of your character dying before you can
get back to the game. In the second mode, MAME pauses, but
when
you exit the viewer, MAME remains paused, and it is unpredictable when
MAME will restart.
In reality, there is a greater drawback even if the script were working
perfectly: The concept works fine for short pauses to view
the
controls used. However, the current method of pausing MAME
leaves
the screen intact (but dimmed) so you can plan your next move.
(I.e., Enemies approaching from the NE, need to flee to the
NW).
With the current script, this reference information is lost,
so
if you took a LONG pause and returned, you would likely die soon after
exiting the viewer. This could of course be minimized in some
games by pausing at normal intermissions, if possible.
- Limitations - AutoHotKey works
fine with Win98, but
the script and MAME do not. So this can only be used with
WinXP,
Win2k, (or WinNT?). Win98SE does not work (and likely will
not
ever), and presumably WinME will not work either. Also,
frontends
must be capable of launching a batch file with the game name rather
than
MAME (or launching a separate application prior to launching MAME).
METHOD 5 - LAUNCH AUTOHOTKEY
SCRIPT ALONG WITH MAME - JOHNNY5 IS AVAILABLE FROM A HOTKEY
This
implementation uses a
modified version of the AHK script to launch the viewer while MAME is
paused. I personally am using this along with Method 1 above.
I chose to use the Start of Button 1 buttons to launch Johnny5. So if I want to
know what controls a game uses, I pause MAME and press Player1 Button1 or Player1 Start and the viewer
comes up. Then Escape or pressing the button again takes me back to MAME (paused) and
P
allows me to continue.
- Advantages
- Out of all of the implementations, I
like this the best, and I consider this entire concept the best
improvement since automatic video hardware stretching.
- Disadvantages
- Visitors may not know that this is
available or what the key is to launch the viewer.
- Limitations - As above - only
works with NT-based OS's, frontend must be able to launch batch files.
IMPLEMENTATION
See
this page for getting Johnny
setup and working. Then decide
which
method(s) you want to use and see this
page for Method 1 - Static Image
Viewing, this page for
Method 2 - Launch From Hotkey, this
page for
Method 3 - Launch Prior to MAME Launch, this
page for Method 4 - Launch AutoHotKey Script Along With MAME
- Johnny
Launches When MAME is Paused, and this
page for Method 5 - Launch
AutoHotKey Script Along With MAME - Johnny is Available From a HotKey.
COMBINATIONS
Basically any of the
methods may be combined with the other
ones as follows:
Method 1 and Method
2 are independent, and activating either
has no effect on any of the other methods.
Method 3 - Launch
Prior to MAME Launch may be combined with
either of the AHK script methods by combining the batch files so the
new batch file launches Johnny, the AHK script, and then MAME, in that
order.
Method 4 and Method
5 COULD be combined by adding the two
script components together, although I can't imagine why you might want
to do so.
ADVANCED CONCEPTS
Basically, in this
section, I am posting other ideas for what
COULD be done with Johnny5 and the AHK Script. None of these
have been tested, but if someone wants to experiment, or if anyone has
other unique ideas and wants me to add them, let me know.
Update - There has been a lot of success with the advanced concepts below and I have moved the data to it's own page here.
Johnny5 - Basically,
there aren't a whole lot of uses for Johnny5 outside of MAME (more
below). OTOH, by the time you have Johnny5 set-up, you
probably have a very good rendering of your Control Panel which could
be very useful. (I think Howard Casto will eventually modify
Johnny5 to work with other emulators, though.)
AHK Script - The
AHK Script is a great discovery and I can see lots of ways to exploit
it. A few are listed below:
- MAME
- It would be fairly simple to modify the AHK
script to launch different programs or additional programs along with
Johnny5. So, when MAME was paused, in addition to Johnny5,
AHK could launch WinAmp to play your PacManFever.mp3 file, er, or maybe
that's just my idea, uh, nevermind . . .
- ZINC
- IIRC, Zinc uses the same structure and even
many of the same games as MAME. It should be possible to
tweak the controls.ini file and the AHK Script and point Johnny5 to the
Zinc folder and have Johnny5 launch when Zinc was paused.
- MESS - Again,
IIRC MESS uses the same format as MAME, so it should be possible to
develop a controls.ini file (Huge . . . good luck) and then tweak the
AHK Script and point Johnny5 to the MESS folder and have Johnny5 launch
when MESS is paused.
- DAPHNE,
Chankast - I will cover this for Daphne, but the
Chankast solution would be similar, especially if you were only
interested in a few titles in Chankast. Daphne is a great
program, but it only supports a few games. The easiest
solution would be to take the image files used by Johnny, add custom
titles and labels to them in PhotoShop or another editor, and then use
some program (maybe Irfanview), called from the AHK script to display
them full-screen when MAME was paused. Another possibility
would be to create faked controls.ini files and MAME-style ctrlr.cfg
files for the games and then use Johnny to display them as if they were
MAME games.
- NES, SNES,
N64 Emulation, Console Emulation in General - This
is the opposite of the Daphne example above. Daphne supports
a handful of games using different control panels. Console
support hundreds of games using the exact same controller.
The solution here would be to create a simple panel image in
Photoshop that would work for each particular console, and then modify
the AHK Script to display this image when the console emulator was
paused.
ALTERNATIVES
Now that you have a
feel for what can be done with Johnny5, I
thought it would be a good
idea
to cover the alternatives to using Johnny5, not really because I
recommend any of them (with the conditional exception of BuddaMAME),
but more to save you the trouble of wasting your time setting them up,
only to find Johnny5 more useful. There are three programs
that
will be considered as alternatives - CPViewer, CPMAKER, and BuddaMAME.
Detailed information beyond what I am posting here is also
available in this thread on BYOAC.
CPViewer - CPViewer
is JCrouse's application, and is available here.
I evaluated it after I had Johnny5 working, so that has some
bearing on the discussion. The program is VERY easy to use
and
set-up (but Johnny is also if I hadn't wrestled with using it in 98
before it supported it). My main gripe with it is that it
lacks
the ability to display labels such as "2-Player Alternating"
"Player Joystick Type" (2-Way Joystick (Horizontal) above) or
the
miscDetails field from controls.ini. Unfortunately, I
consider
this very important information. The viewer does have the
ability
to display text labels inverted for use on cocktail cabinets, which I
don't think Johnny5 supports. I haven't tested it, but I
think
the AutoHotKey (AHK) Script could be modified to call CPViewer instead
of Johnny, if you decided to use it instead.
CCCPVW - CPVW is available here.
This is JCrouse's explanation of it: CPVW is a stand alone
viewer that is MUCH faster at displaying the image on the screen and
filling the labels. It's written by Jerry Fath. It's only tie to
CPViewer is that it uses a CPViewer layout file to find out the label
attributes.
CPMaker - CPMaker
is BuddaBing's viewer. The files are available here
and documentation is available here.
Here is a screenshot of CPMaker output for 1942 (click twice
to enlarge, but it doesn't look much better either way):

Perhaps, I could
have cleaned up the fonts, but the program
will
never display ANY info besides the button labels and directionals.
It also was
VERY
hard to set-up. I have been using computers since before
Windows 3.1
and it took several PM's and E-mails to Buddabing to get the image
above to this point. The main "feature" of CPMaker is
supposed to be
the ability to shade controls that are not used. Personally,
if
Johnny5 doesn't throw a label on a button, I can make a pretty good
guess that it's not used. And if you REALLY want to, you can
shade
unused buttons in Johnny5, although you might end up with a LOT of
images and LOF files if you choose to do this.
BuddaMAME
- BuddaMAME
is BuddaBing's solution for displaying images when MAME is paused.
It is also available here
and documentation is available here.
I recommend not using it with CPMaker, but rather creating
static
images using Method 1 above, and then viewing them in BuddaMAME.
This
works very well in horizontal games and not so well in vertical games
as the images is "squished" to the same width as the MAME game borders.
Screenshots from 1943 and 1944 (see disadvantages) are here
(again click twice to
view):


BuddaMAME also
incorporates skip warnings, -skip startup
frames, LED
driver engine, and MAME movie maker, making it a very nice MAME build
in its own right. (I use it as my primary build with CPMaker
disabled).
- Advantages
- Principal
advantage is this can be used in Win98SE, while the AHK Script cannot.
Another advantage is that since the code is
integrated into
MAME, there are no "timing" errors with MAME not properly
pausing/unpausing at the proper time. Also, since the code is
intergrated into MAME, there is no problem using this method with ANY
frontend.
- Disadvantages
- Principal
disadvantage is that the display is less than optimal, especially for
vertical games. Also, I personally prefer that AHK and Johnny
pretty well works with any MAME version, while BuddaMAME has only been
created since MAME 0.92 and I have to wait for Budda to update it or
try to compile my own to use it with later/earlier versions of MAME.
It also may be difficult to read at low screen resolution and
suffers from the same "situational awareness" problem as Method 4
above. Also, running at artwork resolution 2 may cause
performance issues with slower CPU's in games using artwork.
- News: Leave
it to me
to find the one game bug with the program. I originally tried
to
take the 1944 image above on a Win2k machine with BuddaMAME 0.97.
1944 was running centered at the top border of the screen at
about 3/4 screen width. I tried on a WinXP box with BuddaMAME
0.96, manually copying the controls.png hints file to the BuddaMAME
directory and disabled makectrlr.bat (when I should have been
trying to sleep). The game was full screen, but the image
didn't
display because I had copied it to the wrong directory. I
copied
controls.png again, BuddaMAME ran full-screen, but when I paused it, I
found I had copied the 1942 artwork, and the artwork was displaying at
approximately 3/4 screen width. I finally got the correct
controls.png file, but now 1944 was running at 3/4 screen width also.
I then ran 88games, which was full-screen and actually used
it to
take the shot, which was full-screen also. Then I changed
desktop
resolution to from 1024x768 to 800x600 (Mame runs at 800x600).
1944 was still 3/4 screen width. Then I changed
back to
1024x768 and edited mame.ini to disable intctrlr and extctrlr.
1944 was still 3/4 screen width. Then I deleted
controls.png and 1944 was full screen. (Weird!!!)
- Set-Up and
Usage - I will assume that you have already set
up Johnny5 per this page
and created a library of images in C:\elimages\layouts per this page. Buddamame
does not include all of the standard MAME folders, so the first step is
to install a current build of MAME (I recommend installing to C:\MAME)
from http://www.mame.net/downmain.html
and then if you need help setting it up, configuring it per the MAME
guide at EasyEmu
(don't set any mame.ini file options yet, though). Next, you
want
to download BuddaMAME from the link above and extract it to the C:\MAME
(if you used my advice) directory, overwriting the official files.
Next step is to create a mame.ini file. If
C:\MAME\mame.ini
exists, delete it. Then open a command prompt and type the
following pressing enter after each line. (See ToolTips for
explanations.)
- C:
cd\
cd MAME
mame -cc
- The next step is to open the
mame.ini file (in Notepad or Wordpad) and modify the following lines in
these two sections (See ToolTips for explanations):
- In ### Mame CORE misc options ###
- artwork_resolution
2
- In ### Options added by
Buddabing ###
- intmakectrl
0
extmakectrl
1
ctrlr_override 0
noshowctrl
0
- All other values
may be set
according to personal preference.
- The final step is to create the
makectrl.bat file. To do this, copy the text below, and paste
it into WordPad or NotePad. Fix the directory names as
required, and save the file as a text file named makectrl.bat in the
main BuddaMAME directory (the one with mame.exe). Thanks to
Buddabing for providing the file. See ToolTips for
explanations:
- del controls.png
if exist
"c:\elimages\layouts\%1.png" goto copygameimage
if exist "c:\elimages\layouts\%2.png" goto copyparentimage
rem neither game
image nor parent image exists
goto end
:copygameimage
copy "c:\elimages\layouts\%1.png" controls.png
goto end
:copyparentimage
copy "c:\elimages\layouts\%2.png" controls.png
:end
- At this point, BuddaMAME should
be working and display your controller files when you pause a game.