Software

 

Before we can use the LPT port to control our monitor, we need to be able to access it directly through software. This was easy enough to do in the days of Dos, but Windows likes to get in between you and the hardware sometimes. So we need to install a driver that will allow us to access the LPT port directly through Windows 98, NT, and XP. (I have not tested this with Vista yet.)

The driver is a free package, and can be downloaded here. (~1.5MB download) This must be installed for this control scheme to work.

Once the driver is installed, you can use either:

 

This command line utility. I wrote this utility so the monitor can be controlled via the command line, a batch file, or from a front end. Copy the rotate.exe file to your directory. There are two main ways to use this. From the command line you can type:

    ‘rotate’ by itself to list the options

    ‘rotate m 1’ sets LPT pin 6 high, turning on the monitor power if so connected
    ‘rotate m 0’ sets LPT pin 6 low, turning off the monitor power if so connected.

    The other syntax for the command is as follows:

    ‘rotate [direction] [timeout in seconds] [optional degauss time in seconds]’

      Valid values for direction are ‘r’ or ‘l’ (as in ‘r’ight and ‘l’eft)
      Valid values for timeout in seconds are 1-255
      Degauss time is optional. Valid values are 1-255.

    direction value ‘r’ sets pin 2 high until limit pin 12 is high or the timeout is reached.
    direction value ‘l’ sets pin 3 high until limit pin 13 is high or the timeout is reached

    The timeout value is required, and should be an integer from 1-255. This is a safety feature. Normally, the utility sets the output pin high, and checks the LPT port to see when the limit is reached. When the limit is reached, the output signal is turned off, and the utility exits. The timeout value is the maximum number of seconds the motor is allowed to run. If the limit signal is not detected in the specified number of seconds, the output signal is turned off and the utility exits. This is to prevent the motor from running continuously if the limit switch fails.

    The degauss value is optional. If a value is supplied, this is the number of seconds that LPT pin 5 will be set high. If a degauss circuit is connected to this pin, it will be activated for this amount of time once rotation has completed.

    Example:
            ‘rotate r 5’ 
                     will set pin 2 high until the limit is hit or 5 seconds has elapsed
            
             ‘rotate l 5 2’
                      will set pin 3 high until the limit is hit or 5 seconds has elapsed
                      and will then set pin 5 high for two seconds, activating the
                      degauss circuit for that amount of time.

     

    If you don’t want to use the command line utility, I have compiled two different versions of Mame (version 120) you can use instead. Each version will automatically rotate the monitor to the correct orientation of whichever game is played. You will need to use the -autorol parameter for Mame to utilize the new screen real estate. It uses a default timeout value of 5 seconds, and a 3 second degauss.

    This version, rotate1mame.exe, will launch, rotate the monitor to whatever orientation is appropriate for the game, and then simply exit when done, leaving the monitor in the same orientation as the game played. Your frontend will need to handle the orientation change.

    This version, rotate2mame.exe, will launch, rotate to the correct orientation, and when then game is exited, rotate the monitor back to the horizontal position. This way you can use a frontend without having to worry about different menu orientations.

    Just download whichever version you find useful. Extract the executable, and rename it to mame.exe if you want. Remember to use the -autorol option, There are no other changes to these versions of mame - just the addition of parallel port control.

    The source code for these versions is here. The only code changes are in the mame.c file, and the makefile. (In this .zip, if you want to compile, you will need to go into the /src/emu directory and rename rotate1mame.c or rotate2mame.c to mame.c, depending on which version you want)

    If you already have the source, there are some additional files you need: dlportio.h (header file for parallel io) needs to go in the /src/emu directory. Dlportio.a needs to go in the base directory of your source install. You can use rotate1mame.c or rotate2mame.c depending on which version you want. Just download and rename to mame.c, and place in the /src/emu directory. There is a makefile modified to link with dlportio,a., put both the makefile and dlportio.a files in the base directory of the source install.

     

       

[Home] [What you Need] [The Controller] [The LPT Port] [Monitor Power] [Degaussing] [Limit Switches] [Software] [Action!] [Notes]