home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / osborne / e-sketch.bas < prev    next >
BASIC Source File  |  1994-07-13  |  9KB  |  209 lines

  1. 1 PRINT CHR$(26):GOSUB 9500:FOR M=1 TO 1000:NEXT M:REM **SETUP ROUTINE**
  2. 2 CLEAR :GOTO 18000
  3. 3 GOSUB 9100:FOR B=56500! TO 58980!:POKE B,32:NEXT B
  4. 45 PRINT CHR$(26)
  5. 50 GOSUB 9100
  6. 90 GOTO 1800
  7. 95 REM                                                 **DRAWING ROUTINE**
  8. 100 X$=INKEY$
  9. 110 IF X$="4" THEN GOTO 1000
  10. 120 IF X$="6" THEN GOTO 1200
  11. 130 IF X$="8" THEN GOTO 1400
  12. 135 IF X$="5" THEN 1800
  13. 137 IF X$="0" THEN PRINT CHR$(26)
  14. 140 IF X$="2" THEN GOTO 1600
  15. 150 IF X$="" THEN 100
  16. 160 IF ASC(X$)=27 THEN GOTO 8000
  17. 1000 X=X-1:PRINT FNP$(X,Y);FNG$(I);:GOSUB 9010:GOTO 100
  18. 1200 X=X+1: PRINT FNP$(X,Y);FNG$(I);:GOSUB 9010:GOTO 100
  19. 1400 Y=Y-1:PRINT FNP$(X,Y);FNG$(I);:GOSUB 9010:GOTO 100
  20. 1600 Y=Y+1:PRINT FNP$(X,Y);FNG$(I);:GOSUB 9010:GOTO 100
  21. 1800 PRINT FNP$(2,22);"CHARACTER:    ";
  22. 1810 Y$=INKEY$:IF Y$="" THEN 1810
  23. 1820 I=ASC(Y$):PRINT FNP$(14,22);FNG$(I);" ";
  24. 1825 IF I=27 THEN GOTO 18000
  25. 1830 PRINT FNP$(22,22);" ";:INPUT "X POSITION:  ",Z$
  26. 1835 PRINT FNP$(42,22);" ";:INPUT "Y POSITION:  ",Q$
  27. 1836 X=VAL(Z$):Y=VAL(Q$):IF ASC(Z$)=27 OR ASC(Q$)=27 THEN GOTO 18000     
  28. 1837 PRINT FNP$(2,22);"                                                              "
  29. 1838 PRINT FNP$(X,Y);
  30. 1839 GOTO 100
  31. 1850 REM                                           **SAVE DRAWING**
  32. 1860 REM
  33. 8000 PRINT FNP$(5,22);:LINE INPUT "File name (CAPS) to save under: ";FIL$
  34. 8100 PRINT FNP$(5,22);"                                                   ";
  35. 8180 OPEN "O",1,FIL$+".BAS"
  36. 8190 FILE =-1
  37. 8200 K=20
  38. 8205 IN=1
  39. 8210 PRINT #1,"10 PRINT CHR$(26)"
  40. 8212 FOR J=49151! TO 52175! STEP 128
  41. 8214 FOR I=1 TO 80 
  42. 8216 OUT 0,65
  43. 8218 Z=PEEK(I+J)
  44. 8220 OUT 0,1
  45. 8238 IF Z=160 OR Z=32 THEN GOTO 8330
  46. 8240 X$=STR$(Z)
  47. 8250 A$=STR$(I+J)
  48. 8255 L$=STR$(K+1)
  49. 8260 K$=STR$(K) : K$=MID$(K$,2,LEN(K$))
  50. 8270 P$="POKE":S$=",":O$=":":R$="OUT 0,1":Q$="OUT 0,65"
  51. 8280 T$=K$+" "+Q$+O$+P$+A$+S$+X$+O$+R$
  52. 8300 IF NOT FILE THEN 8320
  53. 8310 PRINT #1,T$
  54. 8320 K=K+IN:REM INCREMENT LINE NUMBER
  55. 8330 NEXT I
  56. 8335 NEXT J
  57. 8345 PRINT #1,"5000 CHAIN ";CHR$(34);"E-SKETCH";CHR$(34);",50"
  58. 8347 IF NOT FILE THEN END
  59. 8350 CLOSE:PRINT:PRINT "FILE CLOSED SUCCESSFULLY"
  60. 8355 PRINT FNP$(2,22);"                                   ";
  61. 8360 GOTO 50 
  62. 9010 J=(100*Y)+X
  63. 9020 POKE 56500!+J,I
  64. 9030 RETURN
  65. 9100 DEF FNP$(X,Y)=CHR$(27)+"="+CHR$(32+Y)+CHR$(32+X)
  66. 9150 DEF FNV(X,Y)=(X+(128*Y)+49151!)
  67. 9200 DEF FNG$(I)=CHR$(27)+CHR$(103)+CHR$(I)+CHR$(27)+CHR$(71)
  68. 9250 WIDTH 255
  69. 9300 RETURN
  70. 9400 REM                                          **OPENING SCREEN**
  71. 9410 REM
  72. 9500 GOSUB 9100
  73. 9559 FOR Y=21 TO 2 STEP -1:PRINT FNP$(5,Y);FNG$(118);:NEXT Y
  74. 9600 FOR X=5 TO 70:PRINT FNP$(X,2);FNG$(118);:NEXT X
  75. 9700 FOR Y=2 TO 21:PRINT FNP$(70,Y);FNG$(118);:NEXT Y
  76. 9800 FOR X=70 TO 12 STEP -1:PRINT FNP$(X,21);FNG$(118);:NEXT X
  77. 9900 FOR Y=21 TO 5 STEP -1:PRINT FNP$(12,Y);FNG$(118);:NEXT Y
  78. 9950 FOR X=12 TO 64:PRINT FNP$(X,5);FNG$(118);:NEXT X
  79. 9960 FOR Y=6 TO 18:PRINT FNP$(64,Y);FNG$(118);:NEXT Y
  80. 9970 FOR X=63 TO 18 STEP -1:PRINT FNP$(X,18);FNG$(118);:NEXT X
  81. 9975 FOR Y=17 TO 8 STEP -1:PRINT FNP$(18,Y);FNG$(118);:NEXT Y
  82. 9980 FOR X=19 TO 58:PRINT FNP$(X,8);FNG$(118);:NEXT X
  83. 9985 FOR Y=8 TO 15:PRINT FNP$(58,Y);FNG$(118);:NEXT Y
  84. 9990 FOR X=58 TO 25 STEP -1:PRINT FNP$(X,15);FNG$(118);:NEXT X
  85. 9992 PRINT FNP$(27,11);"Electronic Sketching Pad";
  86. 9994 PRINT FNP$(28,13);FNG$(115);" 1984  by W. vanRiper";
  87. 10000 RETURN
  88. 10500 REM                                         **INSTRUCTIONS**
  89. 10510 REM
  90. 11000 PRINT CHR$(26):PRINT TAB(15);"Instructions for Electronic Sketch Pad"
  91. 11010 PRINT TAB(15);"**************************************"
  92. 11020 PRINT
  93. 11030 PRINT TAB(10);"Basically, this program lets you draw pictures on the screen using"
  94. 11040 PRINT TAB(10);"graphic characters:"
  95. 11045 PRINT
  96. 11050 PRINT TAB(10);"          ";:FOR E=96 TO 122:PRINT FNG$(E);:NEXT E
  97. 11055 PRINT:PRINT
  98. 11060 PRINT TAB(10);"and the regular characters:"
  99. 11065 PRINT
  100. 11070 PRINT TAB(10);"          ";:FOR E=33 TO 80:PRINT CHR$(E);:NEXT E
  101. 11072 PRINT
  102. 11075 PRINT TAB(10);"          ";:FOR E=81 TO 95:PRINT CHR$(E);:NEXT E:FOR E=123 TO 126:PRINT CHR$(E);:NEXT E
  103. 11080 PRINT:PRINT
  104. 11090 PRINT TAB(10);"After these help screens goes away, you'll go back to the menu"
  105. 11095 PRINT TAB(10);"which will allow you to draw, save, or retrieve a drawing from"
  106. 11100 PRINT TAB(10);"disk storage.  To draw, use any of the lower case letters on"
  107. 11110 PRINT TAB(10);"the keyboard, which become graphics characters on the screen,"
  108. 11120 PRINT TAB(10);"or any of the other characters, which stay the same as they always"
  109. 11130 PRINT TAB(10);"were.  "
  110. 11135 PRINT FNP$(22,22);"HIT ANY KEY TO CONTINUE......";
  111. 11137 A$=INKEY$:IF A$="" THEN 11137
  112. 11138 PRINT CHR$(26)
  113. 11139 PRINT:PRINT
  114. 11140 PRINT TAB(10);"       What this means is that you can't use the lower case"
  115. 11150 PRINT TAB(10);"letters to draw with.  Select a character at the prompt in the "
  116. 11160 PRINT TAB(10);"lower left corner of the screen.  Use the 2,4,6, and 8 keys to"
  117. 11170 PRINT TAB(10);"move the letter around.  To change characters, hit the 5 key."
  118. 11180 PRINT TAB(10);"Hitting the <ESC> key at the CHARACTER prompt takes you back"
  119. 11185 PRINT TAB(10);"to the main menu.  Hitting the <ESC> key from INSIDE THE "
  120. 11187 PRINT TAB(10);"DRAWING will (non-destructively!) save that drawing.  This"
  121. 11190 PRINT TAB(10);"takes about a minute for most drawings......"
  122. 11192 PRINT TAB(10);"     Now, after selecting a character, the program asks for "
  123. 11193 PRINT TAB(10);"X-POSITION and Y-POSITION - just fill in the numbers."
  124. 11194 PRINT TAB(10);"       What numbers, you ask?  Hit N to see what I mean."
  125. 11195 PRINT:PRINT TAB(25);"Hit N.....";
  126. 11197 A$=INKEY$:IF A$="" THEN 11197
  127. 11198 IF A$="N" OR A$="n" THEN GOSUB 12000 ELSE 11197
  128. 11199 GOSUB 13000:PRINT FNP$(20,22);"HIT ANY KEY TO CONTINUE.....";
  129. 11200 A$=INKEY$:IF A$="" THEN 11200
  130. 11201 PRINT CHR$(26)
  131. 11202 PRINT:PRINT:PRINT:PRINT:PRINT TAB(10);"In summary:"
  132. 11210 PRINT:PRINT TAB(10);"   5  changes characters at any time and allows you to"
  133. 11220 PRINT TAB(10);"      jump the cursor to any place on the screen using:"
  134. 11222 PRINT:PRINT TAB(20);"X POSITION:"
  135. 11224 PRINT TAB(20);"Y POSITION:"
  136. 11230 PRINT:PRINT TAB(10);" <ESC>    takes you back to the menu from CHARACTER:"
  137. 11235 PRINT TAB(10);"        or  saves the screen you are working on"
  138. 11240 PRINT:PRINT:PRINT TAB(10); "Nothing to it.  Just try it out. Hitting any key takes"
  139. 11250 PRINT TAB(10);"you back to the top and another chance to read these"
  140. 11252 PRINT TAB(10);"instructions."
  141. 11255 PRINT FNP$(22,22);"HIT ANY KEY TO CONTINUE....";
  142. 11260 A$=INKEY$:IF A$="" THEN 11260
  143. 11265 PRINT CHR$(26)
  144. 11270 GOTO 18000
  145. 12000 FOR X=10 TO 70 STEP 10:PRINT FNP$(X,1);X:NEXT X
  146. 12100 FOR Y=1 TO 22:PRINT FNP$(1,Y);Y;:NEXT Y
  147. 12200 RETURN
  148. 13000 PRINT FNP$(10,17);"For instance:  X POSITION 40  and  Y POSITION 19  puts the cursor"
  149. 13050 PRINT FNP$(34,19);"here: ";FNG$(118);
  150. 13100 RETURN
  151. 16500 REM                                      **READER SUBROUTINE**
  152. 16600 REM
  153. 17000 GOSUB 17240
  154. 17050 PRINT CHR$(26)
  155. 17060 GOSUB 17190
  156. 17080 PRINT CHR$(26)
  157. 17170 GOTO 100
  158. 17190 PRINT FNP$(10,6);"Name of picture to show: ";
  159. 17200 LINE INPUT FIL$
  160. 17210 PRINT FNP$(10,8);"Loading memory, please relax a moment....."
  161. 17220 CHAIN FIL$
  162. 17230 RETURN
  163. 17240  WIDTH 255
  164. 17250 DEF FNP$(X,Y)=CHR$(27)+"="+CHR$(32+Y)+CHR$(32+X)
  165. 17260 DEF FNG$(A)=CHR$(27)+CHR$(103)+CHR$(A)+CHR$(27)+CHR$(71)
  166. 17270 RETURN
  167. 17280 RETURN
  168. 17900 REM                                     **MENU**
  169. 18000 PRINT CHR$(26):GOSUB 17240:GOSUB 20000
  170. 18010 PRINT FNP$(20,5);"Electronic Sketch Pad Menu"
  171. 18020 PRINT FNP$(15,8);"1.  Create new drawings"
  172. 18030 PRINT FNP$(15,9);"2.  Display and work on an old drawing"
  173. 18035 PRINT FNP$(15,10);"3.  Instructions"
  174. 18040 PRINT FNP$(15,12);"B.  Exit to Mbasic"
  175. 18050 PRINT FNP$(15,13);"C.  Exit to CP/M"
  176. 18060 PRINT FNP$(15,18);"Please indicate selection: ";
  177. 18070 A$=INKEY$:IF A$="" THEN 18070
  178. 18080 IF A$="1" THEN PRINT CHR$(26):GOTO 45
  179. 18090 IF A$="2" THEN GOTO 17000
  180. 18100 IF A$="B" OR A$="b" THEN PRINT CHR$(26):END
  181. 18200 IF A$="C" OR A$="c" THEN PRINT CHR$(26):SYSTEM
  182. 18300 IF A$="3" THEN GOTO 11000 ELSE 18060
  183. 18400 GOTO 18000
  184. 20000 GOSUB 9100
  185. 20020 PRINT CHR$(26)
  186. 20030 FOR X=7 TO 70
  187. 20040 Y=2:C=160:GOSUB 30000
  188. 20050 NEXT X
  189. 20060 FOR Y=2 TO 20
  190. 20070 X=70:C=160:GOSUB 30000
  191. 20080 NEXT Y
  192. 20090 FOR X=70 TO 7 STEP -1
  193. 20100 Y=20:C=160:GOSUB 30000
  194. 20110 NEXT X
  195. 20120 FOR Y=19 TO 3 STEP -1
  196. 20130 X=7:C=160:GOSUB 30000
  197. 20140 NEXT Y
  198. 20150 RETURN
  199. 30000 OUT 0,65
  200. 30010 POKE FNV(X,Y),C
  201. 30020 OUT 0,1
  202. 30030 RETURN
  203. 
  204. 20130 X=7:C=160:GOSUB 30000
  205. 20140 NEXT Y
  206. 20150 RETURN
  207. 30000 OUT 0,65
  208. 30010 POKE FNV(X,Y),C
  209.