-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Document:   DemulShooter user guide
Version:    DemulShooter v4.1
Author:     Argonlefou (argonlefou@gmail.com)

Date:       19th July, 2016
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


Table Of Contents
-----------------


   Section I:       Description
   SECTION II :		Installation
   Section III:		Configuration
   Section IV :		Execution
   Section V :		Demul
   Section VI :     Model2
   Section VII:     Taito Type X
   Section VIII :	Dolphin
   Section IX :		Windows Games



-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
	Section I : Description		|
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=+	

DemulShooter is a software interfering with (mostly) emulators to allow users to play railshooter games with 2 lightguns.
Except for some good-coded emulators (MAME, supermodel), others emulator either do not support rawiput or have not working.
It was greatly inspired by the TroubleShooter2 software (http://forum.arcadecontrols.com/index.php?topic=130784.0), which unfortunatelly did not support Demul and can be troublesome for users having swappable USB devices.


-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
	Section II : Installation	|
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=+	
                 
Zip package can be downloaded there : http://forum.arcadecontrols.com/index.php/topic,149714.0.html
Just unzip it in whatever directory you want.


-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
	Section III : Configuration	|
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=+	

Executing DemulShooter.exe without any command line argument (or executing it in the explorer) will display a very simple GUI with 3 tabs :
	
- Lightguns :
 	To choose devices to use for Player1 and Player2.
 	Only mice-like devices, supporting rawinput data will be listed (such as Aimtrak, ArcadeGuns, maybe Act Labs guns....)
 	
- Silent Hill :	
	1)To set keyboard keys used by the Taito Type X "Silent Hill The Arcade" game.
	  These keys need to be set for the game to be playable (with or without DemulShooter)
	1)A 2nd button is here to install a transparent cursor image, so that crosshair becomes invisible.
	
- Dolphin : 	
	To install a basic Dolphin Wiimote config file.
	This configuration is a base used by DemulShooter so that both Lightgun can be used. 
	It's a minimalist configuration and most of it can be modified so that each player can add whatever they want.


-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
	Section IV : Execution		|
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=+	

DemulShooter is a command line based executable :

	DemulShooter.exe -target=[target] -rom=[rom] [options]"

Supported [target] :
--------------------
	demul057    :	Demul 0.57
	demul058    :   Demul 0.582
	demul07a    :   Demul 0.7a 181215,201215,221215
	dolphin4	:	Dolphin x86 v4.0.2
	dolphin5	:	Dolphin x64 v5.0
	model2		:	Model2 Emulator v1.1a (EMULATOR.EXE)
	model2m		:	Model2 Emulator v1.1a (emulator_multicpu.exe)
	ttx			: 	Taito Type X	
	windows		:	Windows Games


Supported [rom] :
-----------------
Demul:
	confmiss 	:	Confidential Mission
	deathcox 	:	Death Crimson OX
	hotd2 		:	House of The Dead II
	lupinsho 	:	Lupin the Third (the shooting)
	mok 		:	The Maze of the kings
	ninjaslt 	:	Ninja Assault (Demul 0.582 and +)
	rangrmsn 	:	Ranger Mission (Demul 0.7a only)
	sprtshot 	:	Sports Shoting USA
	xtrmhunt 	:	Extreme Hunting (Demul 0.7a only)
	xtrmhnt2 	:	Extreme Hunting 2 (Demul 0.7a only)
	
Dolphin:
	- Parameter not used -

Model2:
	bel			:	Behind Enemy Lines
	gunblade	:	Gunblade NY
	hotd		:	House of the Dead
	rchase2		:	Railchase 2
	vcop		:	Virtua Cop
	vcop2		:	Virtua Cop 2
	
Taito Type X:
	sha			:	Silent Hill the Arcade
	
Windows Games :
	hod3pc		:	House of the Dead III

Supported Options :
-------------------
-noresize    	:   Fix demul bug (exiting fullscreen when shooting upper left corner). Note : blocks all mouse inputs to Demul GUI (menus, etc...)
-ddinumber		:	Dolphin's DirectInput number for P2 device (optional, default = 3)
-v              :   Verbose ON (debug information written to a text file)


Exemple : DemulShooter.exe -target=demul07a -rom=confmiss -noresize -v

Once launched, a notification icon will be shown in the systray.
DemulShooter wil shut itself down as soon as the target process is closed.


Display Help :
--------------
	DemulShooter.exe -h


-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
	Section V : Demul			|
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=+	

Multiple versions of Demul are supported, for users stuck with windows XP and an older version of Demul for example.
Latest version of Demul (07a) using DX11 is the best to use if you can !
You don't have to change anything about your controls in PadDemul pluggin settings.


1) 	Run DemulShooter for a Demul emulator/game

2) 	Run corresponding Demul and launch a game (or use command line to run Demul with the game directly) 

3) 	The first time you launch a game, go to SERVICE/TEST menu and perform guns calibration.
	!! Beware : closing Demul with ALT + F4 or killing the process will prevent it to save calibration data to NVRAM !!	


Note:
----
- Atomiswave railshooter games are not supported by Demul untill 0.7a
- Atomiswave railshooter games calibration is basic and causes offset between cursor position/shoot position in 16/9 format


-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
	Section VI : Model2			|
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=+	

Troubleshooter2 is supporting 1.0 version of the emulator.
I decided to support on my side the latest build available, which is 1.1a.
There are 2 .exe available for it, one for single cpu and the other for multi cpu computers. Both are supported as long as you set the correct option in DemulShooter command line parameter.
You don't have to change anything about your controls in Model2 settings.


1) 	Download and unzip latest version (http://nebula.emulatronia.com/downloadgw.php?get=m2emulator.zip)

2) 	Edit the file "EMULATOR.INI" to change :
		UseRawInput=0
   	to :
   		UseRawInput=1
   	You don't have to change "RawDevP1" and "RawDevP2" to any specific number as opposed as what need to be done with Troubleshooter2

3) 	You can use :
		DrawCross=1
   	Genuine crosshairs will work with both players (I find it usefull to tune gun calibration in-game)
   	
4) 	Run DemulShooter for a model2 exe/rom

5) 	Run corresponding Model2 and launch a game (or use command line to run Model2 with the game directly) 


Note:
----
- Everygame is based on LeftCLick = Fire, RightClick = Reload. Except for Behind Enemy Lines for which secondary click is a grenade : I made it launch by a MiddleClick, so that it can be used aiming at a target on-screen (as right-click usually is firing out of screen borders)


-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
	Section VII : Taito Type X	|
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=+	 

For now only one game is supported, Silent Hill the Arcade.
Please use this link to download and install it : http://assemblergames.com/l/threads/pc-silent-hill-the-arcade-playable-on-windows-tutorial.50161/
There are 2 .exe available too : KSHA.exe and KSHA_no_cursor.exe, but only KSHA_no_cursor.exe is compatible with DemulShooter.
I personnaly use this version of the launcher : https://www.mediafire.com/?wix803bszhyxr#kc6wssht5ri8f

1) 	Donwload and install (might be the hardest part !)

2) 	You'll find in the game folder a "config.bat" app which to set game keys, but not for Player2. So use DemulShoter GUI to set both players controls (see Section III).
 
3) 	Run DemulShooter for this game.

4)	Then you'll have 2 ways to launch the game : 	
	a) 	Run KSHA_no_cursor.exe and that's all
	
	OR
	
	b)	Use the loader "Game Loader All RH.exe" to run the game with enhanced graphics but in that case you will have to uncheck "enable hotkeys" : it uses right click to pause the game so each time you'll reload manually...

5)	Just play the game WITHOUT doing any calibration, aim is complettely off in SERVICE menu but will work as expected in game.


Note:
----
- Left-click will send Trigger keys to the game, right-clic will reload
- Aim is totally off in the SERVICE menu for gun calibration, don't use it !
- Some versions of "Game Loader ALL RH" are not executing the good Silent Hill exe
- "Game Loader All RH.exe" adds his  own crosshair cursor, to make it disappear and play as in Arcade, just create a totally transparent cursor and overwrite the "CrossHair.cur" in "sv" subfolder


-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
	Section VIII : Dolphin		|
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=+	 

DemulShooter is compatible with  the latest stable version of Dolphin x86 4.0 : http://dl-mirror.dolphin-emu.org/4.0.2/dolphin-x86-4.0.2.exe
and with the latest stable version of Dolphin 5.0 : https://dl-mirror.dolphin-emu.org/5.0/dolphin-x64-5.0.exe 
All games are supported, there is no game-specific command option.

DemulShooter generates the following keys for Player1 device clicks :
- LeftClick => LeftClick (DInput/0/Keyboard Mouse)
- MiddleClick => MidleClick (DInput/0/Keyboard Mouse)
- RightClick => RightClick (DInput/0/Keyboard Mouse)

For Player2 device clicks :
- LeftClick => S (DInput/0/Keyboard Mouse)
- MiddleClick => D (DInput/0/Keyboard Mouse)
- RightClick => F (DInput/0/Keyboard Mouse)

1)	Download Dolphin, install, execute it a first time (to make it create it's config folder) then close it.

2)	Use DemulShooter GUI (see Section III) to make it copy Wiimote config file to Dolphin config folder (usually "MyDocuments\Dolphin Emulator\Config\WiimoteNew.ini"). This is a generic Wiimote config file working with most games. You'll be able to modify it later if needed.
	If an Aimtrak device is set for Player2, DemulShooter will tell you that a correctly modified file was copied with the correct Aimtrak ID.
	If you have another kind of device or if DemulShooter could not identify your Aimtrak, you will have to manually modify the WiimoteNew.ini file (see later below, Step 5)
	
2)	Now execute Dolphin
	
3a)	In the "Graphics" menu, check "Render To Main Window". Without this step, some strange bugs sometimes appear.
3b)	In the "Graphics" menu, set "Aspect Ratio" to "Stretch To Window". Without this step, aim will be off if Dolphin doesn't use all of it's window.	

4)	In "Controllers" settings, Wiimote1 and Wiimote 2 should be set to "Emulated Wiimote". Open the "Configure" window for Wiimote2

-- If you had a success message for step 2, you can jump to step  6) ---
5) 	In the "Device List" dropdown list, search for your Player2 Lightgun (ex : DInput/0/ATRAK Device #2 for Aimtrak with ID=2) and note the exact name
	Now close Dolphin, edit manually with a text editor the WiimoteNew.ini file on your computer and replace all occurence of "DInput/0/ATRAK Device #2" by your DeviceName (4 lines to modify : number 36,37,38,39) and go back to Dolphin
------------------------------------------------------------------------

6) 	In the "Device List" dropdown , you'll see both Wiimote are set to "DInput/0/Keyboard Mouse", this is normal do not change it !!!
	That way you can add whatever key you want with a Keypress and use Autohotkey or anything else. Only P2 axes are not modified by keyboard.

7)	In the "Device List" dropdown list, search for your Player2 Lightgun (ex : DInput/0/ATRAK Device #2 for Aimtrak with ID=2) and note it's exact position in the list (usually, KeyboardMouse is 1st, then are following other plugged device in an order I can't know about)

8)	Run DemulShooter for this emulator/game (-rom option is not needed) with the -ddinumber option set to the number you just got. If you don't specify the -ddinumber option, the default value will be 3 (usually, 1 -> KeyboardMouse / 2 -> Aimtrak #1 / 3 -> Aimtrak #2).
	The device order will always be the same with the same devices plugged. Only adding/removing devices can change the order.
	Example for DemulShooter : 
		DemulShooter.exe -target=dolphin5 -ddinumber=4

9)	Launch a game (or use command line to run Dolphin with the game directly) 

Note:
----
-	To make it quick, to make Player2 work you need your exact DeviceName in the WiimoteNew.ini config file AND the exact position number of this Device in Dolphin's device list for DemulShooter

- 	In Wiimote settings, for Player1 or Player2 you can modify everything you want to make the configuration fit some games needs :
	!!! Just don't modify Player2 AXIS buttons !!!
	Set click 0, click 1 and click 2 for DemulShooter's device#1 clicks and S, D and F keyboard button for DemulShooter's device #2
	
-	My trick to make it all work is to use an AutohotKey script to copy/paste a corresponding WiimoteNew.ini file (according to the game I want) before executing Dolphin + Game, and to map aimtrak buttons (others than mouse clicks) to keyboard key (according to WiimoteNew.ini file)


-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
	Section IX : Windows		|
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=+	 

For now only one game is supported : House of The Dead III
Controls for Aimtrak are :
- Left click = Shoot
- Right click = Reload
- Middle click = Left / Right (for when the game is asking you to choose a path)

1)Install the game

2)Launch the config window (hod3launch.exe) and set both players controls to keyboard.
Keys can be changed as needed without any trouble, as I read choosen values directly into Windows Registry to send needed key codes.
In case the registry cannot be read, DemulShooter will use a default configuration so if you're in trouble please set HOD3 keys to (for an AZERTY keyboard) :
P1 Trigger = X			P2 Trigger = N
P1 Reload = Z			P2 Reload = B
P1 Right = D			P2 Right = L
P1 LEft = G				P2 Left = J

3)Launch the game

4)Run DemulShooter for this game

Note:
----
- To run directly the game and  bypass the launcher screen, you have to set a register value before running the main hod3pc.exe. It can be done with an Autohotkey script for example :

	----- AHK script -----
	RegWrite, REG_DWORD, HKEY_LOCAL_MACHINE, SOFTWARE\Wow6432Node\SEGA\hod3\Settings, Played, 1 
	Run, C:\Program Files (x86)\SEGA\THE HOUSE OF THE DEAD3_EU\exe\hod3pc.exe
	----------------------

- I made a No-Crosshair patch, it is available here : http://forum.arcadecontrols.com/index.php?topic=149714.0
Just overwrite the SPR.AFS original file which is located on the "fs" folder inside game install folder (for me it's C:\Program Files (x86)\SEGA\THE HOUSE OF THE DEAD3_EU\fs\SPR.AFS)





