home *** CD-ROM | disk | FTP | other *** search
/ AMOS PD CD / amospdcd.iso / 326-350 / apd336 / mcdriver.doc < prev    next >
Text File  |  1991-10-08  |  3KB  |  78 lines

  1. Hi There!!
  2.     This disc contains two sample source files (and thier
  3. execuatables) to help you include Trojan Phazer compatiblity in your
  4. programs.
  5.  
  6.     The files on this disc are:-
  7.  
  8. GunDemo1.s - Source for a simpler gun driver that will 'steal' a
  9.          frame from the game/program that is running.
  10. LoseFrame  - The object file produced by the above source.
  11.  
  12. GunDemo2.s - Source for a driver based in the VBL interrupt that
  13.          will not steal a frame from your program.
  14. FrameGun   - The object produced by the above source.
  15.  
  16.  
  17.     Both of these programs create a black screen with a small
  18. white cross in the middle. This cross is the calibration point for the gun.
  19.  
  20.     Fire carefully at the cross to calibrate the gun, then firing
  21. will just plot a dot on the screen where the gun was aimed.
  22.  
  23. Method of Operation
  24. -------------------
  25.     Both of the programs first set up the machine and a screen with
  26. the LPEN bit (bit 3) set in the BPLCON0 register.
  27.  
  28.     GunDemo1
  29.     --------
  30.         This sits in a main loop and tests the trigger bit,
  31. if pressed it white outs the screen and waits for the frame end.
  32. Once the frame has ended it looks at the lightpen latch register
  33. (VPOSR) and calculates the screen X and Y.
  34.  
  35.     GunDemo2
  36.     --------
  37.         This sits in an empty main loop and tests the trigger
  38. in the VBL interrupt routine. If trigger pressed then sets a flag
  39. (Scan_frame) and whites out to show current frame is a gun read frame.
  40.     At the next VBL the routine resets the palette and reads the
  41. gun position from the appropriate register (and corrects it).
  42.  
  43.     Calibration
  44.     -----------
  45.         Calibrating the gun is very important for two main
  46. reasons :-
  47.     1 .... Each gun/tv/computer combination has slightly different
  48.            timings due to component tolerances etc. This means that
  49.            a gun has to be set for the individual system.
  50.  
  51.     2 .... Every individual holds the gun at different angles etc.
  52.                Correct calibration makes the gun 'accurate' for a person.
  53.  
  54.     Calibration involves firing at a predefined point (usually in
  55. the centre of the screen) and then storing the actaul distance from this
  56. point that the gun registerd. The X and Y difference are then used to
  57. alter the gun XY position every time it is fired from then on.
  58.  
  59.     On the Atari ST the calibrate routine actually modifies an
  60. interrupt routine entry point as well as storing XY offsets. It 
  61. does this because the gun would not work correctly at the screen edges
  62. otherwise.
  63.  
  64.     If you have any difficulties in getting the guns to work properly
  65. ring me (David Phillips) on 0554 777993.
  66.  
  67.     Good Luck!!!
  68.  
  69.     D.K.Phillips (Software Manager)
  70.     Trojan Software
  71.     Unit 7
  72.     Dafen Park
  73.     Dafen
  74.     Llanelli
  75.     SA14 8LX
  76.  
  77.  
  78.