home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AMOS PD CD
/
amospdcd.iso
/
326-350
/
apd336
/
mcdriver.doc
< prev
next >
Wrap
Text File
|
1991-10-08
|
3KB
|
78 lines
Hi There!!
This disc contains two sample source files (and thier
execuatables) to help you include Trojan Phazer compatiblity in your
programs.
The files on this disc are:-
GunDemo1.s - Source for a simpler gun driver that will 'steal' a
frame from the game/program that is running.
LoseFrame - The object file produced by the above source.
GunDemo2.s - Source for a driver based in the VBL interrupt that
will not steal a frame from your program.
FrameGun - The object produced by the above source.
Both of these programs create a black screen with a small
white cross in the middle. This cross is the calibration point for the gun.
Fire carefully at the cross to calibrate the gun, then firing
will just plot a dot on the screen where the gun was aimed.
Method of Operation
-------------------
Both of the programs first set up the machine and a screen with
the LPEN bit (bit 3) set in the BPLCON0 register.
GunDemo1
--------
This sits in a main loop and tests the trigger bit,
if pressed it white outs the screen and waits for the frame end.
Once the frame has ended it looks at the lightpen latch register
(VPOSR) and calculates the screen X and Y.
GunDemo2
--------
This sits in an empty main loop and tests the trigger
in the VBL interrupt routine. If trigger pressed then sets a flag
(Scan_frame) and whites out to show current frame is a gun read frame.
At the next VBL the routine resets the palette and reads the
gun position from the appropriate register (and corrects it).
Calibration
-----------
Calibrating the gun is very important for two main
reasons :-
1 .... Each gun/tv/computer combination has slightly different
timings due to component tolerances etc. This means that
a gun has to be set for the individual system.
2 .... Every individual holds the gun at different angles etc.
Correct calibration makes the gun 'accurate' for a person.
Calibration involves firing at a predefined point (usually in
the centre of the screen) and then storing the actaul distance from this
point that the gun registerd. The X and Y difference are then used to
alter the gun XY position every time it is fired from then on.
On the Atari ST the calibrate routine actually modifies an
interrupt routine entry point as well as storing XY offsets. It
does this because the gun would not work correctly at the screen edges
otherwise.
If you have any difficulties in getting the guns to work properly
ring me (David Phillips) on 0554 777993.
Good Luck!!!
D.K.Phillips (Software Manager)
Trojan Software
Unit 7
Dafen Park
Dafen
Llanelli
SA14 8LX