11 December 2005, 23:51 | #1 |
Zone Friend
Join Date: Dec 2005
Location: Charlestown/USA
Age: 49
Posts: 44
|
Light gun games
I am working on a universal convertor for all amiga light gun games. I want it to accept various light guns (whichever are most common) and output the Actionware, Trojan, Loriciel and any other light gun pinouts. So far, I can use my Sega 3050's (from the Sega Master System) with Actionware (including dual gun!) and Trojan games (including Die Hard 2!)
I need info on Loriciel's gun pinout/functioning though... I just found out about two games for the Golem light gun and will try to include support for them as well. Please, any info on Loriciel's gun will be greatly appreciated and will be included in the design which will be posted freely on a web site (yet to be created) to the benefit of all Amiga users. Thanks! |
12 December 2005, 13:53 | #2 | |
Moderator
Join Date: Sep 2004
Location: France
Age: 50
Posts: 4,277
|
Quote:
And I don't know pinout/functioning of the loriciel's phaser but I am very interested in your universal convertisor to play with my trojan phaser at Loriciel or ACTIONware games |
|
12 December 2005, 16:37 | #3 |
Zone Friend
Join Date: Dec 2005
Location: Charlestown/USA
Age: 49
Posts: 44
|
Trojan to Actionware
I will post a complete circuit on my web site as soon as I create the design and site...
But for now, the conversion from the trojan gun to work with actionware games is easy enough. The pin conversion should be as follows: To Amiga Joystick port 2: To Trojan Light Gun: Trigger 5 -------------- 3 (Joystick Left) HitSense 6 -------------- 6 (Joystick Fire Button) +5 7 -------------- 7 +5 Gnd 8 -------------- 8 Gnd This is based on my experiments with a Sega 3050 light gun (from a Sega Master System - incredibly common) and several Trojan light gun games. Please let me know if this works (it should). If someone could please disassemble 'Crazy Shot' and tell me what the game is looking for on the joystick port (port 2) at one particular time, I would greatly appreciate it. The particular time I am interested in is after you load the game, press the fire button on a joystick connected to port two and the guy behind the counter is moving around randomly. I'm pretty sure that the game is looking for light gun input at this point. What the game looks for at this point should be enough info so that I could design the universal convertor to support Loriciel games. Also, if anyone has 'Worldwide Hunting' and/or 'Sport' or the Golem light gun (do a search for Golem in these forums), I would like to make the convertor support these as well. However, I have found no information on either the games or the light gun. So any info there would also be helpful. Note that I intend to include support for dual light guns (for use with Actionware games) in the universal convertor. It is fairly simple and just requires a 74LS157 (if I remember right). Thanks! |
12 December 2005, 22:53 | #4 | |
Moderator
Join Date: Sep 2004
Location: France
Age: 50
Posts: 4,277
|
Quote:
for technical info about loriciel phaser, there was main code and doc of this phaser on the game westphaser: http://hol.abime.net/1690 Here are attached all files PS:I have quickly ressourced phaser.bin and included the source code |
|
13 December 2005, 18:16 | #5 |
Zone Friend
Join Date: Dec 2005
Location: Charlestown/USA
Age: 49
Posts: 44
|
Ok, I'm looking through the code. I think I've figured out the section where the light gun is read. It will take me a bit to fully understand it tho...
Thanks! Now, if anyone has info on the Golem gun... |
13 December 2005, 21:26 | #6 | |
Moderator
Join Date: Sep 2004
Location: France
Age: 50
Posts: 4,277
|
Quote:
|
|
15 December 2005, 16:25 | #7 |
Zone Friend
Join Date: Dec 2005
Location: Charlestown/USA
Age: 49
Posts: 44
|
Ok, I have very little time to figure out the asm code (I'm also very rusty on 68k assy) so if you can help figure this out, it would be helpful.
Here is what I have so far. The variables _PHASERX and _PHASERY (in your phaser.bin.asm) are filled on lines lbc0002CC and lbc00023A with the phaser x and y screen locations, so we must have detected the gun input by these points. (All other times when _PHASERX is filled, #$3E8 is put into it, which is the 1000 decimal needed in order to prepare for another firing). Now, if we get to the 2CC address, we must have gone through the 23A address (the branches in between indicate this), so detecting the guns location comes before the 23A address. By the way, we are in the _NEW_6C_INTERUPT subroutine (I guess we took an interupt to get here). Now, starting at the beginning of _NEW_6C_INTERUPT, the first hardware addresses accessed are $DFF09A, $DFF01E then $DFF004. The first two hardware addresses are related to interupts, and if we take either of the BEQ.W lbc0002DC we will skip writing _PHASERX and _PHASERY values. So, on to the $DFF004 hardware address access, which is the vertical position of the raster (VPOSR). We do some stuff with the raster position, then a few lines down we get another chance to branch to lbc0002DC, which we are still not interested in because it would again skip writing _PHASERX and _PHASERY. On the next line, we LEA ($BFD000).L into A0! This hardward address has to do with the parallel port! Now, why would we be interested in the parallel port? That must be where the light gun is plugged in! OK, so we later do btst #4,(a0) which indicates to me that we may need to see bit 4 high on the parallel port in order to determine that the trigger on the light gun has been pressed. A little after lbc00014C we MOVE.W #$FFF,($DFF180).L MOVE.W #$FFF,($DFF182).L this sets two colors to white. The screen is usually changedto white in order ensure that the screen is bright enough to sense the location of the light gun, but that usually only happens after the trigger from the light gun has been activated. That's how far along I am. What I'm trying to figure out is exactly which pins on the parallel port are used for the trigger input and the hitsense input (these are usually the only two outputs from a light gun). I also need to know if there is anything else the light gun and the computer communicate about, in case Loriciel decided to do things much differently. I'm not sure if all this is correct or not, but I would welcome any help/corrections to it. Thanks! |
16 December 2005, 00:53 | #8 |
Zone Friend
Join Date: Dec 2005
Location: Charlestown/USA
Age: 49
Posts: 44
|
K, I think I know what to input. I noticed in the code these statements...
LEA ($BFD000).L,A0 lbC000516 BSET #7,($200,A0) BCLR #4,($200,A0) BCLR #2,($200,A0) This is in the _InitPhaser subroutine. The BSET instruction sets bit 7 of $BFD200 (via adding $200 to A0 to get $BFD200). The next two instructions clear bits 4 and 2 respectivly of the same hardware address. That address refers to the hardware register that sets the direction of communication for the parallel port. Clearing bits 4 & 2 means that parallel port data bits 4 & 2 are setup to accept input. Setting bit 7 means that parallel port data bit 7 is setup to output data. I don't know why we need output on 7? Anyway, if bit 4 & 2 are the input bits, then pins 6 & 4 on the A500 should be the ones we are interested in using with the light gun. At this point I would appreciate someone telling me if I am way off on all this. Also, is the parallel port very sensitive (will I blow it up easily just by grounding pins 6 & 4?) I'll do some net searching... |
16 December 2005, 01:28 | #9 |
Zone Friend
Join Date: Dec 2005
Location: Charlestown/USA
Age: 49
Posts: 44
|
All right, something in my guess work is not right. I tried grounding pins 6 and 4 of the parallel port in crazy shot... nothing
Any ideas? Oddly enough, pressing the fire button on the joystick that is connected to port 2 makes the guy begin moving around randomly behind the counter (in Crazy Shot) and I think the game is waiting for a selection. |
16 December 2005, 02:05 | #10 | |
Moderator
Join Date: Sep 2004
Location: France
Age: 50
Posts: 4,277
|
Quote:
|
|
17 December 2005, 10:58 | #11 | |
Moderator
Join Date: Sep 2004
Location: France
Age: 50
Posts: 4,277
|
Quote:
the CPC Light phaser seems use joy port http://cpcrulez.free.fr/hardware_pistolet_phaser.htm but not amiga version I am trying to understand parallel or serial port seems used I am asking to DLSILVER it's seems he have got a loriciel's phaser I'm waiting his answer Last edited by CFou!; 20 December 2005 at 10:01. |
|
17 December 2005, 17:30 | #12 |
Workbitch 1.3
Join Date: Oct 2001
Location: Melbourne, Australia
Age: 46
Posts: 2,084
|
I don't know if it helps but the actionware gun is just an AtariXEGS system gun.
|
18 December 2005, 18:01 | #13 | |
Moderator
Join Date: Sep 2004
Location: France
Age: 50
Posts: 4,277
|
Quote:
So perhaps it will be difficult to do an adaptator for Sega/Trojan/Actionware phaser to loriciel's phaser.... I'am just finishing to re-write 'phase.bin.asm' source (linked). Not it's perhaps more easy to read and understand it.... I'am working on a whdload patch to support trojan phaser in CrazyShot and WestPhaser... If i finish it, a loriciel's adaptator will not needed for amiga, because it's seems only 2 games use loriciel's phaser.... and perhaps in a futur a support for trojan's phaser in some classic games like Cabal (keyboard for left/right/grenade+phaser), Terminator 2 Arcade etc.... but it's an heavy work... Last edited by CFou!; 24 December 2005 at 15:48. |
|
19 December 2005, 18:48 | #14 |
Zone Friend
Join Date: Dec 2005
Location: Charlestown/USA
Age: 49
Posts: 44
|
Just noticed some problems with my interpretation of the ASM code. According to
http://www.fortunaty.net/text/textfi...A/mapamiga.txt the register at $BFD000 has bits for both the parallel port and the serial port. Bit 2 is pin 13 of the parallel port, but bit 4 and 7 are pins 5 and 20 of the serial port! Now I am really confused about how Loriciel is doing it. Does anyone know how the amiga version of Loriciel's gun plugs into the amiga? |
19 December 2005, 19:53 | #15 | |
Moderator
Join Date: Sep 2004
Location: France
Age: 50
Posts: 4,277
|
Quote:
but I don"t understand the usage of all the (btst #2,$bfd000) perhaps just used for a synchro.... for trojan phaser only 2 registers are needed: bits 1 of $dff00c or $dff00a to test if trigger is pressed on port 1 or 0 and $dff006 to take the position of the screen spot 'see' by phaser want you press trigger. In resume: Trojan phaser (for Aliex game) btst #1,$dff00c or $dff00a : Trigger pressed? $dff006 : to take V & H position of screen's pot seen by phaser when trigger is pressed ($dff004 .w for 'h8 bits' not used =>only 160 lines for Aliex ) Loriciel phaser btst #4,$bfd000: Trigger pressed? $dff006.w & $dff004.w : to take V & H position of screen's pot too (200 vertical lines so $dff004 is used for bits 'H8') I'am just finishing a trojan drivers (I use whdload for test): http://download.abime.net/zone/TrojanTest.lha Can you test it with your trojan adaptator? (you must just launch 'TrojanTest.slave' via whdload or click on icon) now I try to add trojan phaser support in crasy shoot & westphaser bye Last edited by CFou!; 20 December 2005 at 09:01. |
|
19 December 2005, 20:20 | #16 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,507
|
According to HRM light pen is fully handled in hardware.
BPLCON0 bit 3 set = enabled, pulse in joystick pin 6 freezes VPOSR (until next frame) I am sure light guns use the exact same method (only way to make it accurate) |
19 December 2005, 20:29 | #17 | |
Moderator
Join Date: Sep 2004
Location: France
Age: 50
Posts: 4,277
|
Quote:
by example: move.w #$4008, $dff100 is needed (for a 4 bitplans screen with light pen or gun) |
|
20 December 2005, 05:59 | #18 |
Zone Friend
Join Date: Dec 2005
Location: Charlestown/USA
Age: 49
Posts: 44
|
I tried the program on my A500 and it worked fine. I have some sort of accelerator board with 2.0 roms (37.175) and a 68030 (or 68040, I don't remember right now). I do not have a hard drive with my amiga so I just put your WHDLoad program and all the others that were with it in the 'C' directory of a Workbench v2.04 rev 37.67 disk and booted off that. I usually boot from a special floppy I made that uses PC2Amiga to get the amiga to access Workbench from an IBM compatible. However, the phaser test program made the computer crash under my special PC2Amiga environment.
Anyway, I noticed two things about the test program: 1: There was a blue line at about the bottom third of the screen and yellow dots did not appear below that line when I shot below that line. 2: Sometimes the dot from my shot appeared significantly right of the screen position where I had fired. BTW, I have never tried WHLoad, but I have heard of it. It must be quite a boon to the Amiga community, so please allow me to just say thank you for all your work and effort on it. |
20 December 2005, 08:35 | #19 | |
Moderator
Join Date: Sep 2004
Location: France
Age: 50
Posts: 4,277
|
Quote:
in this first test I have used Aliex's screen: logical screen 352*160*4 physical screen 296*160 so you are big borders at left, right and bottom but I a working for an adaptation for a classical screen (like west phaser/crazy shoot) 320*200*4 (logical and physical screen) I have see also the bad point if I shoot out the screen I will fix it I have soon finished and I will send it to you for test ... Last edited by CFou!; 20 December 2005 at 09:06. |
|
20 December 2005, 11:56 | #20 | |
Moderator
Join Date: Sep 2004
Location: France
Age: 50
Posts: 4,277
|
Quote:
for me ActionWare phaser or Light pen Amiga port pins: Trigger 5 --------------trojan light gun Amiga port pins:in fact only trigger's test seems different between Trojan & actionware light guns:Trigger 3 -------------- btst #1,$dff00a or btst #1,$dff00c for Trojan light gun (joy port 0 & 1) 1 btst #8,$dff016 or btst #12,$dff016 for actionware light gun is it exact for you? indeed I am just buying a sega phaser (I would like to do a universal amiga drivers for Actionware/trojan and Sega master system phaser) Last edited by CFou!; 20 December 2005 at 13:02. |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
GOLEM Light Gun - for Action Games | shutter | support.Hardware | 15 | 16 July 2019 11:11 |
Light Gun | Amigaboy | Nostalgia & memories | 23 | 15 March 2014 22:20 |
Sega megadrive + Light gun + 7 Games | Wasagi | MarketPlace | 18 | 03 August 2010 15:39 |
[Request] PHAZER light gun | andreas | MarketPlace | 5 | 24 April 2004 12:12 |
Actionware Light Gun | Twistin'Ghost | MarketPlace | 0 | 03 May 2002 06:05 |
|
|