WinGun V0.6B Readme (Now with 50% more Readme typos!) Author Acorns http://guncon.acornscity.com (View this document with Word Wrap enabled) Index: About WinGun Installation Uninstallation Main Menu Options Auto Calibration Manual Calibration Button Configuration Macros Information Screen Editing the INI Command Line Options Troubleshooting/Known problems Comming Soon (Next Release) Comming Later or Never Version Log --About WinGun:-- WinGun is a program which allows you to use a Guncon2 or compatible lightgun with a windows computer, through a composite video connection. The lightgun will only work with your TV or arcade monitor in its normal state. With a hardware modification it can be made to work on CRT monitors (your PC's monitor), but this is not for beginners. See my website under FAQ's for more information. WinGun is not exactly a "driver", it is a userlevel program that uses another driver to communicate with the USB Gun device. Because of this, WinGun.exe must be running in order to move the mouse and press the buttons. It uses no more CPU power than a normal driver would, and sometimes less. This program was inspired by Smog's Guncon2Mouse project, however it uses nothing from that project. It does not hack Smog's driver to work with rolling X guns, nor does it use any code from Smog's Guncon2Mouse. WinGun is a relatively new program and this release has not been widely tested, don't expect too much out of it. It may work for you, or it may not work for you. Visit the forums on my website for support and questions. NOTE ABOUT SCREEN BRIGHTENING: This WILL NOT work with every video card! Consider it a nice extra if it does! That said, the rate of success has been good. Every Nvidia card tested down to a TNT2 has worked. Every ATI card newer than a 9600 has worked. The ArcadeVGA card (a radeon 9200) does not work normally, however, it does seem to work in some PC games such as House of the Dead 2. --Installation:-- Although WinGun should install fine overtop of Smog's Guncon2Mouse for the sake of cleanliness and preventing any possible problems I recommend uninstalling Smog's driver from the Add/Remove programs list before installing WinGun. First extract all the files to the same directory. To install the go-between driver and WinGun program you must have your gun connected to the USB port. Some guns require that they be connected to your TV/Arcade monitor and be recieving a stream before they will function. After you have connected your gun, run Install.bat. If you had smogs driver installed previously, this will act as an upgrade - you can roll back to his driver or reinstall it to go back (not recommended, see above). One box for WinDriver and one for each of your connected guns should appear asking you to install an uncertified driver, respond yes to all. Sometimes the console will display a timeout error, this has not effected the installation for me. After running install.bat, run WinGun.exe. You MUST do this for WinGun to work, and every time you wish to use WinGun. A window should pop up asking you to calibrate you gun. If no gun is connected, after about 5 seconds you should recieve a timeout error. If your gun is connected, disconnect then reconnect it, and click "Detect" in the main menu. If the gun fails to connect the first time you run the program you must go into the calibration menu and select "Autocalibrate" before the calibration routine will run. --Uninstallation:-- Simply run Uninstall.bat in the directory you extracted WinGun to. --Main Menu Options:-- The main menu can be accessed by starting the program, right clicking on the WinGun icon in the system tray and selecting Config, or double clicking on the tray icon. Note: options in the tray icon apply to the currently selected gun in the main menu ONLY. AutoFire - when you hold down a button multiple clicks/keypresses are made very rapidly. Best used in short busts. AutoReload - After 6 shots one offscreen shot is inserted. You can define an offscreen shot to mame mode or any keypress in Button Config. Flash Screen - A very requested feature. Although this will not work with all video cards, if enabled it will attempt to brighten the screen to obtain a more valid coordinate to fire at when a trigger is depressed. May cause a slight delay in firing. Note: currently, the screen is brightened for as long as the trigger is depressed. Good for machine guns. I will add an option to change this later. Hide Mouse - Does not actually "hide" the mouse (it did at first and I found it very annoying. Try clicking a checkbox when you can't see the mouse), just causes no gun to send mouse move events. In other words, the gun will not track. Drag Mode - in drag mode, a keypress associated with the gun button is not released (let up) until you let up on the gun's button. Single mode - Each time you press a gun button, the associated keypress is performed completely, very quickly. It is pressed when you press the button, then released 20 milliseconds later regardless of the fact that you are still depressing the gun button. Gun # - select one of these radio buttons to configure a gun. Options shown apply to the current gun only, with the exception of Hide Mouse and Flash Screen. Detect - this button forces a redetection of avalible guns. It should not be nessessary to use this ever, unless you start the program without a gun connected. To Tray - closes the main menu, but leaves WinGun running in the system tray located beside the clock. It is an icon of a Mission Lightgun :) --Auto Calibration:-- The autocalibration option can be found in the calibration menu. To access it, open the main menu, select the radio button beside the gun you wish to calibrate and click Calibration then Autocalibrate. To begin calibration WinGun must decide if you are using a gun that has the Rolling X problem. Wave your gun across the screen at a medium speed from left to right, then right to left between the two red lines displayed (Note: if no red lines are displayed your TV may not draw the extreme edges. In this case, pretend like they are there :)). If you wave your gun to slowly and it has the rolling x problem, it will not be detected. If this happens, just redetect by pressing Select on your gun, or exit autocalibration (shoot offscreen, or use the mouse to click Cancel) and run it again. If your gun does not have the rolling x problem, you will have to continue waving it for 5-20 seconds before the program will decide you do not have the problem. After WinGun has decided which mode to run it, a screen with four red lines, one for each edge should appear and the numbers for the edges should begin changing. At this point, wave your gun (very slowly) across each of the red lines (four sides) of your TV. When you are satisfied with the values you can continue to target mode by pressing select, or clicking next (do not use the gun to click next). Note: Some TV's will return values that are too low or to high for edge calibration, in this case target calibration will help. In target calibration you will shoot 6 targets located around the screen. Aim the center of your gun's lens at the center of the red dot in the target. Take your time, the more accurately you shoot the targets the more accurate your calibration will be. Your gun should be pressed against the screen for best results. Do not shoot the targets with your gunsight! A lot of people were confused in this area and tried to shoot the targets with the mouse cursor. Because of this, I have "hidden" the cursor for this section. If you need to use it, you will find it tucked away in the bottom-right corner, fully operational. When you are finished, fire anywhere to save your settings and return to the main WinGun window. After finishing autocalibration you may manually adjust the values in manual calibration (see below) by entering new ones yourself. You do not need to restart the program for these to take effect. Centering is not autodetected at all, because it is a user preference value. See manual calibration below for more information. --Manual Calibration:-- To access the manual calibration screen, select the radio button beside the gun you with to manually calibrate and click Calibration from the main menu. You can change 6 values and the gun mode, 4 of the settings for edges and two of them for centering. Lower the top edge value to have the gun read closer to the edge of the screen, and raise it if your cursor is reaching the edge before you are pointing at it. In the same manner, lower the left edge value to have the gun read closer to the edge of the screen, and raise it if your cursor is reaching the edge before you are pointing at it. For the bottom and right, raise the values. Some experimenting will be necessary to find what works best for you. Centering values should only be changed when the gun tracks nearly perfect in relation to the center of the lens! It can be used to align with your gunsights, but it will not help with faulty calibrations. Enter values between -32500 and 32500. Positive values will move the pointer further to the right/bottom, and negitive values to the left/top. Finally, you can select the "Normal" or "Rolling" option to overwrite what Autocalibration detects. Do this if your gun is misdetected. --Button Configuration:-- You can assign your Gun's button to any mouse or keyboard button by clicking Button Config on the main screen. Remember to select the gun # of the gun you wish to configure before entering the menu. Clicking on Button Config will bring you to a screen showing your current configuration. Click on the button that has the name of the button you want to change, then press any key or click anywhere with the key/button you want to assign it to. Pressing the Tilde key "~" will clear the button and leave it unassigned. Currently, only mouse and keyboard mappings are supported. The new macro mode is discribed in detail below. Default Key Config: By default, the buttons on the gun #1 are assigned as such: Trigger = Left Click Trigger (when gun is pointed offscreen) = MAME mode (click once on the very edge of the screen) Start = Enter Select = Space Button A = A Button B = B Button C = C Dpad UP = Up Arrow Key Dpad Down = Down Arrow Key Dpad Left = Left Arrow Key Dpad Right = Right Arrow Key Primary Gun = Gun #1. Note: The primary gun is the one which track with the mouse on screen. This setting is ignored, but not changed, if Hide Mouse is enabled. When you are finished, clicking Finish will save your changes to the .ini file and return you to the main menu. You can reassign the keys in the WinGun.ini's manually as well. --Macros:-- You can now assign up to 20 events to take place each time you press a button on your gun. To set a macro, click the Macro button below the gun button you wish to assign. This will bring you to a screen with many options that are discribed below. Basic theory on macros: A macro is comprised of up to 20 "events". An event is one keypress, and various values associated with that keypress. Each event is executed independently with the exception of a ComboKey (see below). You may navigate though the list of events for the current macro by clicking the next and previous buttons. If you only wish to press one key, you can use the normal button config discribed above. Macro features: Get Key - Click this button to aquire a key or mouse press to be associated with the current event. After clicking the button, your can press any key on your keyboard or click any button on your mouse. Pressing the Tilde key "~" clears the current keypress and leaves it unset. Set as Alt - you may have noticed that the Get Key function will not accept Alt. You can still set Alt as the key associated with the event however, by clicking this button. Note that this does not add an Alt press to the current keypress. See ComboKeys below if you with to press "Alt-something". Hold Button - The amount of time in milliseconds to hold the key associated with the current event down. If you set this to lower than 20, most applications will not recognise that a key has been pressed. Note: this does not cause a key to be repeated, as holding a key down on the keyboard does. Use repeat event if you with to run the current event more than once, or enable autofire if you wish a key to be pressed repeatedly for as long as you depress a gun button. Delay Before - The amount of time in milliseconds to wait before executing the current event. This delay is implemented each time the event is ran, even if the event is run multiple times by setting the repeat value. Delay After - The amount of time in milliseconds to wait after executing the current event. This delay is implemented each time the event is ran, even if the event is run multiple times by setting the repeat value. Repeat - the amount of times to repeat the current event. If it is 0, the event will be executed once. If it is one, the event will be executed once then executed again as a "repeat". In other words, the event will be ran one time more than this number. Note: you cannot currently repeat a ComboKey event with success. The events are still independent at this point. Combo Key - if this checkbox is checked, the current event's keypress will not be released until the first event without combokey checked it reached. In other words, if you wish to press Ctrl-Alt-Del, then the events for Ctrl and Alt should have combokey checked and the event for Del should not. The Hold Button value is ignored for everything except the final combokey value (the one without combokey checked). Mouse X - If the current event is location sensitive you may set a location to move the mouse to. This will be done before the keypress is made. Values range from 0-65536, with 0 being the left side of the screen and 65536 being the right side. Mouse Y - Same as mouse X, with 0 being the top and 65536 being the bottom. Note: Your current mouse position is shown. You can use these values. Clear Event - Clears the current event, resetting all values to default. Does not clear the entire macro, only the current event. --Information Screen:-- This screen is mainly an aid to my troubleshooting other people's problems, however you may find it informative and useful for yourself. I will not do into depth, however I will make a couple quite notes. The direct values are values obtained directly from the gun, with no changes. Raw data. The translated values are from after the "location" and "section" parts of the direct values have been interpreted by my AI. These values are ready to be normalized into a mouse location. Absolute values show the current absolute location of the mouse. They only change when the gun is used to move the mouse. Log Console.txt creates or appends to a file called console.txt in the directory where wingun.exe is located. It is saved every time the console's buffer is reset, when you exit the program, and when you uncheck the Log Console checkbox. Log Data.txt creates a Gun#Data.txt in your wingun directory. It logs all data recieved from the currently selected gun. You may log for multiple guns by selecting the gun # and checking log data each time. WARNING: these logs will become large VERY quickly as they log a huge amount of data! Best used for short periods to resolve specific problems. --Editing the INI:-- You may open and edit any ini file manually, they are in plain text. All options except "Timeout" can be accessed from the configuration screens. Discriptions and possible values for each item are discribed inside the ini. Note for timeout: this is for use with people who have trouble with their guns disconnecting. It is set to NORMAL by default, which causes wingun to try and reconnect all guns after not receiving data for 2 seconds. If you find that you cannot open a game/program without the gun being reconnected set to NEVER or LONG. If your gun disconnects often, set to SHORT. --Command Line Options:-- Currently only two command line options are avalible, more will come later. "-m" - starts the program in minimised mode. The main menu will not be shown, and any scheduled autocalibrations will be skipped. This is mainly for people who want to start WinGun on startup, or without having to interact with it upcon opening. "-c" - starts WinGun in config mode. Forces all config options to be available even when no guns are connected. Good to use if you wish to configure a gun you do not current have to connect. --Troubleshooting/Known problems:-- The Rolling X problem is not fully fixable, we do not have all the information we need. Because of this, support for guns in Rolling X mode is a hack. The user MUST do the following with guns in Rolling X mode: When bringing the gun back onscreen from being offscreen, it must be done on the left or right side of the display. It cannot be on the top or bottom of the display. The gun should not be jerked from side to side, smooth motions work best. Guns in rolling x mode will always experience these problems: After pointing to a black or dark spot for a second or so, the gun may skip to the other side of the screen. Simply wave it offscreen then back on, or across the center in order to regain correct positioning. The gun cannot be moved across a dark center screen. If this situation occurs, you will need to bring the gun to the section you need to point at from the left/right edge (whichever is closer). Some guns (specifically the Namco official one) will jump to the center of the screen occasionally. This can cause the gun to move to the wrong side of the screen the same way a black spot can. I have done all I can to fix this, the gun is returning an incorrect position when it is in a darker but not black area. For all guns with the rolling x problem, you might have best luck shooting targets on the egdes of the screen by bringing the gun onscreen from the closest left/right edge. For both the rolling x and normal mode guns, tracking cannot be done on dark surfaces. So turn your brightness up, hope screen flashing works, and play a light game/use a light desktop. If you are playing a dark game like area51, the best you can do is aim at the target and fire - usually the pointer will be there, even if it did not track visibly across a dark surface to get to the target. For the INI file, completely blank lines can be read fine but the file is saved with none. I use // to add space. Negative numbers cannot yet be inputted into the CenterX or CenterX textboxes. You may put them in the INI however. Some needed options are missing, such as clear entire macro. These will be added in the next release. I probably have not estimated every possible situation, and as such many more things may not work, or not work as expected. If you have problems, post a question in my forums! (address listed on the top of the page) and I will try to help. --Comming Soon (Next Release):-- Hot swappable (through a gun button) profiles, loadable profiles, multiple profiles, etc :) Ability to map any gun button to an offscreen shot. I'd planned this one for this release, but it kept slipping by. More console options. User ability to set: Screen flash mode between Drag and Single Delay between autofire shots Amount of times to fire between reloads A finished built in help system, and an included FAQ.txt Those prettier buttons I promised :) maybe :( A secondary AI - to assist in dark spots on the screen, offscreen shots, and some button issues. Jitter reduction. A supprise "extra" --Comming Later or Never:-- Support for JoyStick emulation, as well as games that only accept relative mice. A windows installer wrap (I don't like this, but some people may find it easier. A normal .zip version will always be available) --Version Log:-- Versions are counted like this: A = Alpha B = Beta D = Development R = Release 0.0X will be the alpha releases 0.X will be the beta releases 0.XX will be development releases, and eventually X.XX X.X will be releases V0.6B Unfortunatly I did not keep a log of the changes, as I was not planning at the time on releasing further versions. One could say that WinGun has became an entirely new program in the meantime! I will try to list the main changes below: Support for multiple guns! Up to 4 guns will now work at the same time. Huge, huge thing to get working. Screen Brightening; causes the screen to flash bright when a trigger is depressed. Very requested, but doesn't work on all video cards. New autocalibration routine; includes easy to read on the TV instructions, and a new shoot the targets phase. Updated and further completed interface; includes a tray icon, and many more options. Redid so all menu's will fit on a 640*480 screen. Completely redone connection method. You can connect a gun and have it detected without user interaction, and if a gun stops sending data WinGun should attempt to reconnect it. Along with this change came many other connection code changes: it should be much more reliable now, and account for many more error situations. Added an "information" screen that is invaluable for debugging and troubleshooting. Added tons of console output messages for use with it, all timestamped and neat. Added the ability to log console output and gun output to files. Added support for basic macros in Button Config. Press Ctrl-Alt-Del, click in a specific location, etc. Up to 20 events, which can be delayed, told to execute multiple times, etc Added Hide Mouse option Redid, improved almost every internal function. Over 80% of the code for WinGun is different from 0.2B As noted, did and changed way more than I can possibly remember. V0.2B Interface for configuring the buttons. (woot!) New calibration routine, some tweaks to calibration. Fixed just about everything I know of that could help the rolling x problem. This is as good as it gets, until we solve it. Redid the interface. Added singlefire firemode, and option to switch in the interface Added the ability to switch between normal and rolling x modes manually in the interface Added auto-fire and auto-reload. Auto-fire is best not used in duck hunt, I've found. Fixed a bug where Buttons A-C wern't being read in from the INI and resorting to using the defaults. Cleaned up code, fixed other random minor bugs V0.1B First public release. Fixed a couple of file write bugs, added in about 10 error messages, and took out some debug code to make ready for a public release. Please note that the interface is brand new, most of the program was written using a console to output errors. It will be improved in the next release. V0.02A - Added ini file saving Added this readme Changed the routine for finding normal/rolling gun mode. The previous one took 30 seconds for guns that sent information at a slower rate. Fixed a couple of bugs V0.01A - First "release", only tested by one person other than myself.