home *** CD-ROM | disk | FTP | other *** search
/ Archive Magazine 1995 / ARCHIVE95.iso / text / hints / volume_01 / issue_05 < prev    next >
Text File  |  1995-02-16  |  12KB  |  342 lines

  1. Å   Text files for BASIC. I always used to write my BASIC programs in
  2. Wordwise and put an AUTO command as the top line then go into BASIC and
  3. NEW and then *EXEC <filename>. But I╒ve just discovered (what I╒m sure
  4. you all knew already) that BASIC can do it for me. You don╒t have to put
  5. AUTO at the top you just say  *BASIC -LOAD <filename> and it will load
  6. the text version of the program and put line numbers onto it. However,
  7. as with the *EXEC technique, you cannot use long multi-statement lines
  8. or you will get the öLine too longò error.
  9. 1.05
  10. (One reader, who was using Arthur 0.2, found that text files longer than
  11. 32k got corrupted, but I tried it on my system with BASIC 1.02 and
  12. Arthur 1.2 and it seemed OK.)
  13. 1.05
  14. Å   Fast screen save. This is obviously something which a number of you
  15. have been thinking about. I got a lot of response to my pleas for help.
  16. Several of you gave ways of *SAVEing the screen information from the
  17. appropriate bit of RAM and re-loading it there, though this obviously
  18. will not bring with it the palette information or the correct mode. For
  19. example:
  20. 1.05
  21. DEF PROCscreensave(filename$)
  22. 1.05
  23. LOCAL K%
  24. 1.05
  25. CASE MODE OF
  26. 1.05
  27.   WHEN 0,1,4,5,6 : K%=20
  28. 1.05
  29.   WHEN 2,3,8,9,11,18 : K%=40
  30. 1.05
  31.   WHEN 7,10,12,13,14,19 : K%=80
  32. 1.05
  33.   WHEN 16,17 : K%=132
  34. 1.05
  35.   WHEN 15,20 : K%=160
  36. 1.05
  37. ENDCASE
  38. 1.05
  39. !&80=149:!&84=-1
  40. 1.05
  41. SYS 49,&80,&88 : REM OS_ReadVduVariables
  42. 1.05
  43. OSCLIöSAVE ò+filename$+ö ò+STR$
  44. 1.05
  45. ~(!&88)+ö +ò+STR$~(K%*1024)
  46. 1.05
  47. ENDPROC
  48. 1.05
  49. This takes only a second or two to save the screen. It can be reloaded
  50. by typing *LOAD filename. The program saves the whole screen, not just
  51. the graphics window. You must not have scrolled the screen prior to
  52. saving or re-loading, but a CLS before re-loading will cancel the
  53. scrolling. Also, you must be in the right mode for the screen you are
  54. about to load and you need to have the same screen colour definitions
  55. set up.
  56. 1.05
  57. What we have been promised though is a module, which we hope to publish
  58. next month, which will give you legal *commands (or SWIs) for loading
  59. and saving screen information including palette and mode and you will
  60. find that it is several times faster than the existing SCREENSAVE
  61. routines.
  62. 1.05
  63. Å   Extra help on BASIC╔ (OS1.2) If you type *BASIC -help<return> you
  64. get a bit more help information about BASIC. (But does anyone know what
  65. the last two bits refer to? i.e. what is an öin-coreò program? Does it
  66. mean you can have more than one program in memory?)
  67. 1.05
  68. Å   ADFS: If you name all your discs with *NAMEDISC, the Archimedes will
  69. remember the previously mounted discs. So, for example, if you put in a
  70. disc called TESTING and you *MOUNT it and then put in a disc called
  71. BASICPROGS and *MOUNT that, you can then see the directory of TESTING
  72. without putting the disc back in again. All you do is type *MOUNT
  73. TESTING and you can *CAT it. If you then want to look at the disc that
  74. is in the drive, you will of course have to *MOUNT again. The only
  75. problem occurs when you have backup discs because they will have the
  76. same name ÿ this gives öAmbiguous disc nameò.
  77. 1.05
  78. Å   Sprite Editor. öTo create a new sprite╔ò It took me ages to find out
  79. how to create a new sprite. The manual tells you to click on the
  80. öCreateò box and öyou are then prompted for a name and a modeò. I was
  81. expecting a prompt something like: öPlease enter name:ò. I saw the words
  82. öCreate spriteò appear at the bottom of the screen and assumed it wanted
  83. some sort of confirmation that that was what I wanted to do, but
  84. whatever I did, the words disappeared again! In fact that is the actual
  85. prompt that the manual was referring to! All you do is type in the new
  86. name and press <return>. You would have thought they could have put in a
  87. more obvious prompt than that ÿ or maybe just switched on the cursor to
  88. indicate that it was time to type something rather than click on the
  89. mouse buttons, but perhaps I have been spoiled by using the Apple Mac
  90. where prompts are rather more obvious and logical! Huhh!
  91. 1.05
  92. Å   Reading the catalogue. An easier way to read the contents of a
  93. catalogue, rather than reading it off the screen (see Gus Gem╒s article
  94. last month) is to use SYS öOS_GBPBò as follows╔
  95. 1.05
  96. DIM C% 999
  97. 1.05
  98. !&80=&2A00
  99. 1.05
  100. SYS öOS_GBPBò,9,&80,C%,999,0,
  101. 1.05
  102. 999 TO ,,,ENTRIES
  103. 1.05
  104. This stores the filenames and sub-directories of the current directory
  105. at the address C%, in alphabetical order and each terminated by a zero
  106. byte. The number of entries is stored in the BASIC variable ENTRIES.
  107. 1.05
  108. Å   Neater than OSCLI╔ SYS 6 (equivalent of FX calls) is much neater
  109. than using OSCLIs: e.g. Matthew Treagus╒ screen bank switching would
  110. look neater if, instead of using OSCLI (öFX112,ò+STR$N%) he had used SYS
  111. 6,112,N%. If you don╒t like the anonymity of SYS 6, you can use SYS
  112. öOS_Byteò,112,N%. (See Gerald╒s article on page 12.)
  113. 1.05
  114. Å   Beebug╒s Masterfile can be made to work on the Archimedes without
  115. using the emulator ÿ it just needs a very few modifications ÿ contact
  116. Dr╩╩Peter Catermole at Winchester College, Kingsgate Road, Winchester,
  117. SO23 9PG.
  118. 1.05
  119. Å   BBC ROMs ÿ Continuing the saga of poking various bytes to get BBC
  120. ROMs to work under the emulator, View B3.0 should apparently have A8A1,
  121. 2 and 3 poked to &EA and Viewspell 1.0, &820F, 8210 and 8211 likewise.
  122. 1.05
  123. Å   When setting the clock, the setting box sometimes covers the face of
  124. the clock, so point at the bottom right hand corner of the clock box and
  125. then press the middle mouse button.
  126. 1.05
  127. Å   Plugging modules in and out. It╒s all very well to have lots of
  128. modules in the 1.2 ROM but, at power up, several of these modules are
  129. installed into ram which cuts down your available memory. Exactly which
  130. ones are installed is set by various bytes in the CMOS ram. To find out
  131. what all the modules are and whether they are actually active, type
  132. *ROMModules. (or just *ROM. for short.) You can öunplugò the modules by
  133. using *UNPLUG <modulename> and it stays unplugged until you öinsertò it
  134. again with *RMREINIT <modulename>. It seems that the extra space does
  135. not become available until you press <ctrl-break>. If you type *UNPLUG
  136. without a module name it tells you which modules are currently
  137. unplugged.
  138. 1.05
  139. Å   How╒s this for a screen dump? (sent in by Ken Yeardley) It is for
  140. mode 0, it works on the NEC PC8023, it can be put on a function key and
  141. it only takes 118 seconds.
  142. 1.05
  143. VDU2,1,27,84,1,&31,1,&36: FOR
  144. 1.05
  145. A%=&1FDCFB0 TO &1FDCFFF:VDU2,
  146. 1.05
  147. 1,27,83,1,&30,1,&35,1,&31,1,&32:
  148. 1.05
  149. FOR B%=A% TO A%-20400 STEP-&50:
  150. 1.05
  151. VDU1,?B%,1,?B%: NEXT: VDU1,10:
  152. 1.05
  153. NEXT: VDU3
  154. 1.05
  155. The reason it is so short is that the NEC printer has the MSB and LSB of
  156. the byte that defines which pins hit the paper, the opposite way round
  157. from Epson printers. (See page 9 for a sample screendump.
  158. 1.05
  159. Å   Beware the microwave! One reader was having problems with data
  160. corruption on the RS423 but it turned out to be only when his wife was
  161. using the microwave oven four yards away, the other side of a brick
  162. wall!
  163. 1.05
  164. Å   Here╒s a little routine sent in by Mike Hobart which uses the
  165. debugger module for disassembly and memory dumps. It doesn╒t quite rival
  166. Toolkit, but it╒s a bit cheaper!
  167. 1.05
  168. INPUTöDisassembly or Memory dump? (D/M)ò,R$
  169. 1.05
  170. CASE R$ OF
  171. 1.05
  172.   WHEN ödò,öDò : N%=FNi:REPEAT PROCx(öIò,N%,ö +10ò):UNTIL FALSE
  173. 1.05
  174.   WHEN ömò,öMò : N%=FNi:REPEAT PROCx(öò,N%,ö +FFò):UNTIL FALSE
  175. 1.05
  176. ENDCASE
  177. 1.05
  178. END
  179. 1.05
  180. DEFPROCx(S$,M%,L$)
  181. 1.05
  182. WHILE INKEY(-99)
  183. 1.05
  184.   OS_CLI(öMEMORYò+S$+ö ò+
  185. 1.05
  186. STR$~(N%)+L$)
  187. 1.05
  188.  N%=N%+100
  189. 1.05
  190. ENDWHILE
  191. 1.05
  192. ENDPROC
  193. 1.05
  194. DEFFNi
  195. 1.05
  196. INPUTöFrom(Address &nnnnnn)òÉN$
  197. 1.05
  198. PRINTöPress <space> to scrollò
  199. 1.05
  200. IF ASCN$<>ASCö&òTHEN N$=ö&ò+N$
  201. 1.05
  202. =EVAL N$
  203. 1.05
  204. Å   Desktop on 1.2. (All the remaining H & T are based on material sent
  205. in by Bruce Roberts.) As an alternative to double clicking on <select>
  206. to open a file or run an application, try a single click on the adjust
  207. button ÿ it has the same effect.
  208. 1.05
  209. The quick way to open a diary (or notepad), rather than opening the
  210. diary window first and then pressing <menu>, is to double click on the
  211. diary icon on the disk directory ÿ the window opens automatically.
  212. 1.05
  213. You can now save diaries and notepads with whatever name you like and
  214. you can also click, or move with the cursor keys, and put text anywhere
  215. in the window.
  216. 1.05
  217. The following keys can now be used on diary and notepad:
  218. 1.05
  219. <insert>   Insert single character
  220. 1.05
  221. <copy>   Delete character to the right of
  222. 1.05
  223.    the cursor
  224. 1.05
  225. <ctrl-insert>   Insert a line above the cursor
  226. 1.05
  227. <ctrl-copy>   Delete a line
  228. 1.05
  229. <shift-left/right>   Move 4 characters sideways
  230. 1.05
  231. <ctrl-left/right>   Move to the end of the line
  232. 1.05
  233. Notepads can be created from within View by saving a file (up to 100
  234. lines, 78 characters wide) and then doing a *SETTYPE <filename> &FEE.
  235. Existing notepads can be edited with View provided you use READ
  236. <filename> instead of LOADing it and WRITE <filename> instead of SAVEing
  237. it.
  238. 1.05
  239. Å   After using the desktop, the function keys do not produce the normal
  240. programmable strings or ASCII values. It seems that this is because
  241. Acorn have not stuck to their own rules (see Programmers╒ Reference
  242. Manual, page 488) because they do not call SWI Wimp_ CloseDown. The
  243. öfixò published elsewhere of typing *FX225,1 is fine if you only want to
  244. restore the strings to f0 - f9. To get f10 - f12 back, you need *FX221,1
  245. but the simplest thing seems to be to make sure that everything is back
  246. to its default setting by using a program, perhaps called QUIT, which
  247. you can run from the desktop instead of clicking on the exit icon. To
  248. set the default of all the combinations of <ctrl> and <shift> with all
  249. the function keys, you need:
  250. 1.05
  251.    *FX225,1
  252. 1.05
  253.    *FX226,&80
  254. 1.05
  255.    *FX227,&90
  256. 1.05
  257.    *FX228,0
  258. 1.05
  259.    *FX221,1
  260. 1.05
  261.    *FX222,&D0
  262. 1.05
  263.    *FX223,&E0
  264. 1.05
  265.    *FX224,&F0
  266. 1.05
  267.    MODE 0
  268. 1.05
  269.    *BASIC
  270. 1.05
  271. If you don╒t put in a MODE statement, you╒ll find yourself typing
  272. invisibly! The *BASIC means you come out into BASIC but with no program
  273. in memory.
  274. 1.05
  275. As an alternative, you could miss out the call to BASIC and put:
  276. 1.05
  277.    W%=GET
  278. 1.05
  279.    *MOUNT
  280. 1.05
  281.    *!BOOT
  282. 1.05
  283. The idea would be that you would click on this program, change to the
  284. disc you want to boot up, and press a key. You may want to include a
  285. prompt to the user to öreplace disc and press space barò or somesuch.
  286. The use of *!BOOT means that it doesn╒t matter if the boot file should
  287. be *EXECed or *RUN ÿ either will be done by the *!BOOT according to the
  288. file type.
  289. 1.05
  290. Å   Avoiding the desktop. If you donæt want to go into the desktop every
  291. time you switch on or press <ctrl-break>, do a *CONFIGURE LANGUAGE 4 and
  292. press <ctrl-break>. When you want to go into the desktop, type *DESKTOP
  293. or *DES. for short. If you change your mind, *CON. LANG. 3 will bring
  294. you into desktop at switch on or LANG. 0 will start you in the super
  295. visor mode.
  296. 1.05
  297. Å   View boot file. Here is a more sophisticated boot file than the one
  298. we gave originally:
  299. 1.05
  300. *ECHO<22><3>
  301. 1.05
  302. *| selects mode 3
  303. 1.05
  304. *GOS
  305. 1.05
  306. *65ARTHUR
  307. 1.05
  308. *GO F800
  309. 1.05
  310. *LOAD VIEW 8000
  311. 1.05
  312. *GO 8000
  313. 1.05
  314. *ECHO<19><0><16><48><48><240>
  315. 1.05
  316. *| sets background colour
  317. 1.05
  318. *ECHO<19><1><16><240><240><208>
  319. 1.05
  320. *| sets foreground colour
  321. 1.05
  322. *ECHO<19><2><24><240><128><0>
  323. 1.05
  324. *| sets border/line colour
  325. 1.05
  326. SET FI
  327. 1.05
  328. *| sets Format and Insert modes
  329. 1.05
  330. NEW
  331. 1.05
  332. Å   Avoiding *MOUNT. To avoid typing *MOUNT each time you put a new disc
  333. in the drive, you can set an alias with, for example, *SET ALIAS$? MOUNT
  334. | M CAT so that when you type *?<return> it does the mount and the
  335. catalogue all in one.
  336. 1.05
  337. Å   Centronics GLP screendump. The *HardCopyMX nearly works because the
  338. printer  is Epson-compatible-ish! All you need to do is issue, from
  339. BASIC, the following codes:
  340. 1.05
  341. VDU2,1,27,1,65,1,8,1,27,1,50,3
  342.