home *** CD-ROM | disk | FTP | other *** search
/ ftp.whtech.com / ftp.whtech.com.tar / ftp.whtech.com / Geneve / 9640news / CAT18 / LIGHTPEN.ARK < prev    next >
Text File  |  2006-10-19  |  7KB  |  186 lines

  1. ?
  2.  
  3.                                 99/4A LIGHT PEN
  4.                                 ===============
  5.  
  6.  
  7.         At one time I felt that a  light  pen  for  the  4A  was  1)  not
  8.         possible  on  the  TI and 2) even if it was possible, it would be
  9.         overpriced.  Well I was wrong on both counts.
  10.  
  11.         Thru the help a local 'hacker', we now have a working light  pen.
  12.         This pen is very 'simple' both in parts and constuction.  So lets
  13.         get started.
  14.  
  15.  
  16.                                   CONSTRUCTION
  17.                                   ============
  18.  
  19.         First off you will need the following:
  20.  
  21.              ONE- 9 pin D-plug (joystick plug)
  22.              TWO- lengths (your choice) of 2 conductor wire
  23.              TWO- CDS photocells
  24.              TWO- junk Flair pen w/cap
  25.                   (or anything big enough to hold the CDS cells
  26.  
  27.  
  28.         Now that you have the above, lets get to the fun part.  First off
  29.         gut  the  pens  out  and cut off the end that the tip was in, and
  30.         then punch out the end of the cap.  Feed the wire thru the bottom
  31.         of the pen out the tip.  Solder the the two wires to the leads of
  32.         the CDS cell, and place the cell into the cap and put it  on  the
  33.         old  pen  body.   Tape the wire around the pen to help prevent it
  34.         from pulling out by accident.
  35.  
  36.         Grab the D-plug and hard wire the leads (pin layout is below) for
  37.         pen  #1  to pin #7 and #9 (this would be the right direction with
  38.         CALL JOYST), with pen #2 solder it to pins #2 and #5 (CALL  JOYST
  39.         left direction).  If you have not figured it out yet, you can add
  40.         up to four more pens  using  the  other  moves  of  the  joystick
  41.         routine.  Wrap tape around the plug to protect the wiring.
  42.  
  43.         Now  if  you have not yet converted the included program get with
  44.         it, so you can test your new light pens.  As  you  can  tell  the
  45.         program  name  is "DOT" and you just touch the dots on the screen
  46.         with the pen.  Depending upon your TV/monitor, you  may  need  to
  47.         adjust the contrast/brightness.
  48.  
  49.         One  more  thing  before you get too busy with the pens I have to
  50.         give credit to Edwin McFall of Aberdeen,  Wash.   Thru  his  work
  51.         this  is possible.  Hopefuly he will be joining us here soon.  If
  52.         you have  any  questions  direct  them  to  me:  Garry  Noel  ID#
  53.         75166,324
  54.  
  55.  
  56.  
  57.                               JOYSTICK PORT PINOUT
  58.         ================================================================
  59.  
  60.                                  -------------
  61.                                  \ 1 2 3 4 5 /
  62.                                   \ 6 7 8 9 /
  63.                                    ---------
  64.  
  65.  
  66.                   PIN     USE
  67.                   ==============================
  68.                   1      NOT USED
  69.                   2      COMMON LINE JOYST #2
  70.                   3      UP
  71.                   4      FIRE
  72.                   5      LEFT
  73.                   6      NOT USED
  74.                   7      COMMON LINE JOYST #1
  75.                   8      DOWN
  76.                   9      RIGHT
  77.                   ==============================
  78.  
  79.  
  80. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  81.  
  82.  
  83. 100 !---------------------!
  84. 110 !                     !
  85. 120 !  0000   000  00000  !
  86. 130 !   0  0 0   0   0    !
  87. 140 !   0  0 0   0   0    !
  88. 150 !   0  0 0   0   0    !
  89. 160 !   0  0 0   0   0    !
  90. 170 !   0  0 0   0   0    !
  91. 180 !  0000   000    0    !
  92. 190 !                     !
  93. 200 !_____________________!
  94. 210 REM  by: Edwin McFall
  95. 220 REM      2005 W. 6th
  96. 230 REM      ABERDEEN WA.
  97. 240 REM               98520
  98. 250 REM  TI 99/4A  VER. 1.1
  99. 260 REM  REQUIRES  LIGHTPEN
  100. 270 REM  AND EXTENDED BASIC
  101. 280 REM
  102. 290 REM
  103. 300 CALL CLEAR :: CALL SCREEN(2)
  104. 310 FOR X=1 TO 10 :: CALL COLOR(X,5-11*(X>8),1):: NEXT X
  105. 320 RANDOMIZE
  106. 330 FOR X=0 TO 2
  107. 340 CALL CHAR(96+8*X,"3C7EFFFFFFFF7E3C")
  108. 350 CALL COLOR(9+X,1,1)
  109. 360 NEXT X
  110. 370 PRINT " `hp`hp      `hp    `hp`hp`   hp`  `    p`h `     p`h     hp`   h  hp
  111. `   h    p`h     hp`   h  hp`   h    p`h"
  112. 380 PRINT "  hp`   h  hp`   h    p`h     hp`   h  hp`   h    p`h     hp`  `    p
  113. `h `     p`h"
  114. 390 PRINT " `hp`hp      `hp      p`h": : : : :
  115. 400 PRINT : :"`hp`hp`hp`hp`hp`hp`hp`hp`hp`p     BY: EDWIN MCFALL     hh  TOUCH D
  116. OT TO CONTINUE.  p`ph`ph`ph`ph`ph`ph`ph`ph`ph`"
  117. 410 CALL JOYST(1,X,Y):: IF X<>0 OR Y<>0 THEN 480
  118. 420 FOR C=1 TO 3
  119. 430 CALL COLOR(9,7-4*(C=1)-8*(C=2),1)
  120. 440 CALL COLOR(10,7-4*(C=2)-8*(C=3),1)
  121. 450 CALL COLOR(11,7-4*(C=3)-8*(C=1),1)
  122. 460 NEXT C
  123. 470 GOTO 410
  124. 480 CALL SOUND(100,440,0):: CALL CLEAR :: SC=0
  125. 490 DISPLAY AT(12,9):"EASY      HARD"
  126. 500 DISPLAY AT(16,7):"SELECT DFFICULTY" :: DISPLAY AT(18,1):"EASY=LARGE DOTS, HA
  127. RD=SMALL."
  128. 510 CALL HCHAR(12,9,112):: CALL HCHAR(12,19,104)
  129. 520 CALL COLOR(11,16,16,10,2,2)
  130. 530 FOR I=1 TO 10
  131. 540 CALL JOYST(1,X,Y):: IF X=4 THEN CALL MAGNIFY(2):: GOTO 610
  132. 550 NEXT I
  133. 560 CALL COLOR(11,2,2,10,16,16)
  134. 570 FOR I=1 TO 10
  135. 580 CALL JOYST(1,X,Y):: IF X=4 THEN CALL MAGNIFY(1):: GOTO 610
  136. 590 NEXT I
  137. 600 GOTO 520
  138. 610 CALL CLEAR
  139. 620 CALL SPRITE(#1,96,16,92,124)
  140. 630 DISPLAY AT(16,6)BEEP:"TOUCH DOT TO START."
  141. 640 CALL JOYST(1,X,Y):: IF X<4 THEN 640
  142. 650 CALL SOUND(-100,220,5):: CALL SOUND(-100,880,0)
  143. 660 CALL CLEAR
  144. 670 FOR L=1 TO 20
  145. 680 CALL SPRITE(#1,96,16,INT(RND0)+1,INT(RND0)+10)
  146. 690 N=0
  147. 700 CALL JOYST(1,X,Y)
  148. 710 IF X=4 THEN 730
  149. 720 N=N+1 :: GOTO 700
  150. 730 SC=SC+N :: CALL SOUND(-100,440,5)
  151. 740 DISPLAY AT(1,1):"SCORE ";SC
  152. 750 FOR X=1 TO 100 :: NEXT X
  153. 760 NEXT L
  154. 770 FOR Z=1 TO SC STEP 10
  155. 780 CALL SOUND(-100,Z+110,0)
  156. 790 NEXT Z
  157. 800 CALL CLEAR :: CALL SPRITE(#1,96,16,150,123)
  158. 810 DISPLAY AT(10,6):"YOUR SCORE IS ";SC :: DISPLAY AT(18,3):"TOUCH DOT TO PLAY
  159. AGAIN."
  160. 820 IF SC>150 THEN 830 ELSE DISPLAY AT(12,6):"    YOU CAN'T FOOL ME!
  161.  YOU CHEATED!" :: GOTO 900
  162. 830 IF SC>200 THEN 840 ELSE DISPLAY AT(12,1):" VERY GOOD! YOU'VE MASTERED
  163.    THE DOTS." :: GOTO 900
  164. 840 IF SC>225 THEN 850 ELSE DISPLAY AT(12,1):"GEE WIZ! I DIDN'T KNOW THAT HUMANS
  165.  COULD MOVE THAT FAST!" :: GOTO 900
  166. 850 IF SC>250 THEN 860 ELSE DISPLAY AT(12,1):"NOT BAD, BUT YOU'LL NEVER   SWAT A
  167.  FLY AT THAT SPEED." :: GOTO 900
  168. 860 IF SC>300 THEN 870 ELSE DISPLAY AT(12,1):"YOU NEED ALOT MORE PRACTICE" :: GO
  169. TO 900
  170. 870 IF SC>350 THEN 880 ELSE DISPLAY AT(12,1):"I THINK YOU NEED A SLOWER   GAME.
  171. MAYBE CHECKERS." :: GOTO 900
  172. 880 IF SC>400 THEN 890 ELSE DISPLAY AT(12,1):"DIDN'T ANYONE TELL YOU THAT YOUR T
  173. RYING FOR A LOW SCORE!" :: GOTO 900
  174. 890 DISPLAY AT(12,1):"LOOKS LIKE YOU NEED HELP.   TRY POINTING THE PEN AT THE DO
  175. T STUPID!"
  176. 900 FOR Z=1 TO 500 :: CALL JOYST(1,X,Y):: IF X=4 THEN 930
  177. 910 NEXT Z
  178. 920 CALL CLEAR :: DISPLAY AT(12,1):" DOTS ALL FOLKS..." :: END
  179. 930 CALL DELSPRITE(ALL):: GOTO 480
  180.  
  181.  
  182.  
  183. Download complete.  Turn off Capture File.
  184.  
  185.  
  186.