home *** CD-ROM | disk | FTP | other *** search
/ Archive Magazine 1996 / ARCHIVE_96.iso / text / hints / volume_03 / issue_09 < prev    next >
Text File  |  1995-02-16  |  31KB  |  1,065 lines

  1. 3.9
  2. Å   Clear a line Ö To clear a text input in an editable field, press
  3. <ctrl-U>. For example, you can use this to clear the filename before
  4. typing a new entry. Philip Armstrong
  5. 3.9
  6. Å   !Draw Ö Someone mentioned converting sprite images to object
  7. orientated !Draw images. I have used a graph program and converted the
  8. sprite it created to a !Draw file by zooming up and drawing over the
  9. sprite. If you keep to, say, the bottom left of each pixel, it works OK
  10. and gives a much better printed image.
  11. 3.9
  12. To get vertical and horizontal lines, use the edit coordinated facility.
  13. Get one end correct then note its x or y location and then edit the
  14. other end to match it.
  15. 3.9
  16. If you have typed some incorrect text into a draw file, for example ÉFig
  17. 4.5æ needs to be changed to ÉFig 4.6æ, then you would normally have to
  18. re-type the line and be careful to locate it in the same place. If
  19. characters are changed leaving the string length the same then you could
  20. use !Edit to search and replace the text, once the draw file has been
  21. dragged onto the !Edit icon. Strings could also be padded out with
  22. spaces if a shorter replace string is required, but for a longer string
  23. it is usually easier to re-type in !Draw. Philip Armstrong
  24. 3.9
  25. Å   DXF files Ö Inclusion of a 41 group in TEXT entities permits
  26. characters with varying aspect ratios. A value of 0.5 matches the system
  27. fonts. Jim Markland.
  28. 3.9
  29. Å   Elektor sound sampler Ö In Decemberæs issue of the Netherlands
  30. edition of Elektor (November in the U.K. edition) they published a
  31. D.I.Y. sound sampler podule. This podule has been built freq-uently but
  32. there is one small problem. There are no commands provided to use the
  33. sampler so it is difficult to use it in your own software. I decided
  34. therefore to write a module.
  35. 3.9
  36. The module makes use of a timer within the 6522 on the board. This
  37. results in a very accurate sample-time. To make use of the module, you
  38. need to set a jumper on the podule which connects the 6522-IRQ-line to
  39. the FIQ-line of the Archimedes.
  40. 3.9
  41. Holding the podule with the 64-way-connector towards you and the print
  42. header at the right, you can place the jumper vertically at the right
  43. bottom of the print header.
  44. 3.9
  45. Now you can use the module. There is a SWI included:
  46. 3.9
  47. ElektorSampler_Sample (&500)
  48. 3.9
  49. R0 = Start address of the sample buffer
  50. 3.9
  51. R1 = End address of the sample buffer
  52. 3.9
  53. R2 = Sample time in ╡s
  54. 3.9
  55. R3 = Minimum level to start sampling
  56. 3.9
  57. R4 : bit 0: This bit defines the quality of the sample. Low quality
  58. sampling must be used unless you are prepared to allow the screen to be
  59. disabled. 0 = high quality sampling, 1 = low quality sampling.
  60. 3.9
  61.    bit 1: This bit defines whether the low order byte of the address
  62. where the sample is written to, must be placed on the userport or not.
  63. This enables you to take multi-channel samples (e.g. stereo) using an
  64. analogue multiplexer (e.g. HEF 4051). When youære not using this option,
  65. leave the bit É0æ. 0 = no output to the userport, 1 = output to the
  66. userport
  67. 3.9
  68.    Leave unused bits É0æ for upward compatibility
  69. 3.9
  70. After calling this SWI, the screen will be disabled during the sampling.
  71. While waiting for the minimum level, the border will be coloured yellow
  72. Ö whilst sampling, the border will be red. As long as the border is
  73. yellow, you can quit by pressing <escape>. The buffer will be filled
  74. with linear 8-bit signed numbers.
  75. 3.9
  76. The minimum sample-time that can be used on a normal Archimedes is about
  77. 9 ╡s. The minimum sample-time that can be used with the ZN427 (the ADC)
  78. is approx. 12 ╡s.
  79. 3.9
  80. The module could be used with the Armadeus sampler if Armadeus software
  81. were suitably modified. Since Armadeus is written in BASIC this should
  82. be possible.
  83. 3.9
  84. As far as Iæm concerned this module may be copied freely provided that
  85. my name, as author, remains within the software.
  86. 3.9
  87. Questions or suggestions? You can contact me via Archive.
  88. 3.9
  89. To conserve space, we have stripped the comments out of this listing.
  90. The full commented listing is available on the monthly program disc.
  91. 3.9
  92.  10 REM >SamplerSrc
  93. 3.9
  94.  20 REM Written by J.P.Hendrix
  95. 3.9
  96.  30 start=4:end=10:speed=9:ioc=8
  97. 3.9
  98. :rd427=5:wr427=6:bs6522=7:level=11
  99. 3.9
  100. :flags=12
  101. 3.9
  102.  40 DIM Code 1000
  103. 3.9
  104.  50 FOR Pass=4 TO 7 STEP 3
  105. 3.9
  106.  60 P%=0
  107. 3.9
  108.  70 O%=Code
  109. 3.9
  110.  80 [   OPT   Pass
  111. 3.9
  112.  90     EQUD  0
  113. 3.9
  114. 100     EQUD  0
  115. 3.9
  116. 110     EQUD  0
  117. 3.9
  118. 120     EQUD  0
  119. 3.9
  120. 130     EQUD  Title
  121. 3.9
  122. 140     EQUD  Help
  123. 3.9
  124. 150     EQUD  0
  125. 3.9
  126. 160     EQUD  &500
  127. 3.9
  128. 170     EQUD  Handler
  129. 3.9
  130. 180     EQUD  Table
  131. 3.9
  132. 190     EQUD  0
  133. 3.9
  134. 200
  135. 3.9
  136. 210     EQUS  öElektor Sampler
  137. 3.9
  138.  Module 1.03  (c) copyright
  139. 3.9
  140. 22 Apr 1990 by J.P. Hendrixö
  141. 3.9
  142. 220
  143. 3.9
  144. 230 .YelBorder
  145. 3.9
  146. 240     EQUB  0
  147. 3.9
  148. 250     EQUB  24
  149. 3.9
  150. 260     EQUB  255
  151. 3.9
  152. 270     EQUB  255
  153. 3.9
  154. 280     EQUB  0
  155. 3.9
  156. 290     ALIGN
  157. 3.9
  158. 300
  159. 3.9
  160. 310
  161. 3.9
  162. 320 .Handler
  163. 3.9
  164. 330     STMFD R13!,{r0-r12 ,R14}
  165. 3.9
  166. 340     CMP   R11,#&00
  167. 3.9
  168. 350     BNE   UnknownSWI
  169. 3.9
  170. 360     MOV   flags,R4
  171. 3.9
  172. 370     MOV   start,R0
  173. 3.9
  174. 380     MOV   end,R1
  175. 3.9
  176. 390     MOV   speed,R2,LSL #1
  177. 3.9
  178.  400     SUB   speed,speed,#2
  179. 3.9
  180.  410     AND   level,R3,#&7F
  181. 3.9
  182.  420     STMFD R13!,*{t ,end,speed}
  183. 3.9
  184.  430     SWI   öI/O_Podule_Hardwareò
  185. 3.9
  186.  440     BIC   R0,R1,#&00FF0000
  187. 3.9
  188.  450     ORR   wr427,R0,#%000<<11
  189. 3.9
  190.  460     ORR   rd427,R0,#%010<<11
  191. 3.9
  192.  470     ORR   bs6522,R1,#%101<<11
  193. 3.9
  194.  480     MOV   ioc,#&3200000
  195. 3.9
  196.  490     STMFD R13!,{wr427 ,rd427,
  197. 3.9
  198. bs6522,ioc}
  199. 3.9
  200.  500
  201. 3.9
  202.  510     MOV   R0,#0
  203. 3.9
  204.  520     MOV   R1,#3072
  205. 3.9
  206.  530     TST   flags,#1
  207. 3.9
  208.  540     SWIEQ öXOS_UpdateMEMCò
  209. 3.9
  210.  550
  211. 3.9
  212.  560     MOV   R0,#0
  213. 3.9
  214.  570     MOV   R1,#24
  215. 3.9
  216.  580     SWI   öOS_ReadPaletteò
  217. 3.9
  218.  590     ADR   R0,OrgColour
  219. 3.9
  220.  600     MOV   R2,R2,LSR #8
  221. 3.9
  222.  610     STRB  R2,[R0,#2]!
  223. 3.9
  224.  620     MOV   R2,R2,LSR #8
  225. 3.9
  226.  630     STRB  R2,[R0,#1]!
  227. 3.9
  228.  640     MOV   R2,R2,LSR #8
  229. 3.9
  230.  650     STRB  R2,[R0,#1]!
  231. 3.9
  232.  660
  233. 3.9
  234.  670     MOV   R0,#12
  235. 3.9
  236.  680     ADR   R1,YelBorder
  237. 3.9
  238.  690     SWIEQ öOS_Wordò
  239. 3.9
  240.  700
  241. 3.9
  242.  710     MOV   R1,#&0C
  243. 3.9
  244.  720     SWI   öOS_ServiceCallò
  245. 3.9
  246.  730
  247. 3.9
  248.  740     LDMFD R13!,{wr427 ,rd427,
  249. 3.9
  250. bs6522,ioc}
  251. 3.9
  252.  750
  253. 3.9
  254.  760     MOV   R0,#&00
  255. 3.9
  256.  770     STRB  R0,[ioc,#&38]
  257. 3.9
  258.  780
  259. 3.9
  260.  790
  261. 3.9
  262.  800     MOV   R0,#SamplerEnd-
  263. 3.9
  264. SamplerBegin
  265. 3.9
  266.  810     MOV   R1,#&1C
  267. 3.9
  268.  820     ADR   R2,SamplerBegin
  269. 3.9
  270.  830 .PokeLoop
  271. 3.9
  272.  840     LDR   R3,[R2,R0]
  273. 3.9
  274.  850     STR   R3,[R1,R0]
  275. 3.9
  276.  860     SUBS  R0,R0,#4
  277. 3.9
  278.  870     BPL   PokeLoop
  279. 3.9
  280.  880
  281. 3.9
  282.  890     LDMFD R13!,*{t ,end,speed}
  283. 3.9
  284.  900
  285. 3.9
  286.  910
  287. 3.9
  288.  920     TST   flags,#2
  289. 3.9
  290.  930     MOV   R0,#255
  291. 3.9
  292.  940     MOVEQ R0,#0
  293. 3.9
  294.  950     STRB  R0,[bs6522,#02*4]
  295. 3.9
  296.  960     AND   R0,speed,#&FF
  297. 3.9
  298.  970     STRB  R0,[bs6522,#06*4]
  299. 3.9
  300.  980     MOV   R0,speed,LSR #8
  301. 3.9
  302.  990     STRB  R0,[bs6522,#07*4]
  303. 3.9
  304. 1000     MOV   R0,#&40
  305. 3.9
  306. 1010     STRB  R0,[bs6522,#11*4]
  307. 3.9
  308. 1020     MOV   R0,#&00
  309. 3.9
  310. 1030     STRB  R0,[bs6522,#13*4]
  311. 3.9
  312. 1040     MOV   R0,#&C0
  313. 3.9
  314. 1050     STRB  R0,[bs6522,#14*4]
  315. 3.9
  316. 1060     AND   R0,speed,#&FF
  317. 3.9
  318. 1070     STRB  R0,[bs6522,#04*4]
  319. 3.9
  320. 1080
  321. 3.9
  322. 1090     STRB  R0,[wr427]
  323. 3.9
  324. 1100 .WaitLevel
  325. 3.9
  326. 1110     SWI   öOS_ReadEscapeStateò
  327. 3.9
  328. 1120     BCS   Exit
  329. 3.9
  330. 1130
  331. 3.9
  332. 1140     LDRB  R0,[rd427]
  333. 3.9
  334. 1150     STRB  R0,[wr427]
  335. 3.9
  336. 1160     TST   R0,#&80
  337. 3.9
  338. 1170     RSBEQ R0,R0,#&100
  339. 3.9
  340. 1180     AND   R0,R0,#&7F
  341. 3.9
  342. 1190     CMP   level,R0
  343. 3.9
  344. 1200     BHI   WaitLevel
  345. 3.9
  346. 1210     STRB  R0,[wr427]
  347. 3.9
  348. 1220
  349. 3.9
  350. 1230     SWI   öOS_IntOffò
  351. 3.9
  352. 1240
  353. 3.9
  354. 1250     TST   flags,#1
  355. 3.9
  356. 1260     MOV   R0,#12
  357. 3.9
  358. 1270     ADR   R1,RedBorder
  359. 3.9
  360. 1280     SWIEQ öOS_Wordò
  361. 3.9
  362. 1290
  363. 3.9
  364. 1300     MOV   R0,speed,LSR #8
  365. 3.9
  366. 1310     STRB  R0,[bs6522,#05*4]
  367. 3.9
  368. 1320
  369. 3.9
  370. 1330     MOV   R0,#&40
  371. 3.9
  372. 1340     STRB  R0,[ioc,#&38]
  373. 3.9
  374. 1350 .SampleLoop
  375. 3.9
  376. 1360     CMP   end,start
  377. 3.9
  378. 1370     BPL   SampleLoop
  379. 3.9
  380. 1380
  381. 3.9
  382. 1390     MOV   R0,#&00
  383. 3.9
  384. 1400     STRB  R0,[ioc,#&38]
  385. 3.9
  386. 1410 .Exit
  387. 3.9
  388. 1420     MOV   R0,#&7F
  389. 3.9
  390. 1430     STRB  R0,[bs6522,#14*4]
  391. 3.9
  392. 1440     MOV   R0,#&00
  393. 3.9
  394. 1450     STRB  R0,[bs6522,#13*4]
  395. 3.9
  396. 1460
  397. 3.9
  398. 1470     MOV   R1,#&0B
  399. 3.9
  400. 1480     SWI   öOS_ServiceCallò
  401. 3.9
  402. 1490     SWI   öOS_IntOnò
  403. 3.9
  404. 1500
  405. 3.9
  406. 1510     MOV   R0,#0
  407. 3.9
  408. 1520     STRB  R0,[bs6522,#02*4]
  409. 3.9
  410. 1530
  411. 3.9
  412. 1540     MOV   R0,#3072
  413. 3.9
  414. 1550     MOV   R1,#3072
  415. 3.9
  416. 1560     TST   flags,#1
  417. 3.9
  418. 1570     SWIEQ öOS_UpdateMEMCò
  419. 3.9
  420. 1580
  421. 3.9
  422. 1590     MOV   R0,#12
  423. 3.9
  424. 1600     ADR   R1,OrgColour
  425. 3.9
  426. 1610     SWIEQ öOS_Wordò
  427. 3.9
  428. 1620
  429. 3.9
  430. 1630     MOV   R0,#124
  431. 3.9
  432. 1640     SWI   öOS_Byteò
  433. 3.9
  434. 1650
  435. 3.9
  436. 1660     LDMFD R13!,{r0-r12 ,PC}^
  437. 3.9
  438. 1670
  439. 3.9
  440. 1680 .UnknownSWI
  441. 3.9
  442. 1690     LDMFD R13!,{r0-r12 ,R14}
  443. 3.9
  444. 1700     ADR   R0,Error
  445. 3.9
  446. 1710     ORRS  PC,R14,#2^28
  447. 3.9
  448. 1720
  449. 3.9
  450. 1730 .SamplerBegin
  451. 3.9
  452. 1740     STRB  start,[bs6522,#00*4]
  453. 3.9
  454. 1750     LDRB  R0,[rd427]
  455. 3.9
  456. 1760     EOR   R0,R0,#&80
  457. 3.9
  458. 1770     STRB  R0,[start],#1
  459. 3.9
  460. 1780     MOV   R0,#&C0
  461. 3.9
  462. 1790     STRB  R0,[bs6522,#13*4]
  463. 3.9
  464. 1800     STRB  R0,[wr427]
  465. 3.9
  466. 1810     SUBS  PC,R14,#4
  467. 3.9
  468. 1820 .SamplerEnd
  469. 3.9
  470. 1830
  471. 3.9
  472. 1840 .OrgColour
  473. 3.9
  474. 1850     EQUB  0
  475. 3.9
  476. 1860     EQUB  24
  477. 3.9
  478. 1870     EQUB  0
  479. 3.9
  480. 1880     EQUB  0
  481. 3.9
  482. 1890     EQUB  0
  483. 3.9
  484. 1900 .RedBorder
  485. 3.9
  486. 1910     EQUB  0
  487. 3.9
  488. 1920     EQUB  24
  489. 3.9
  490. 1930     EQUB  255
  491. 3.9
  492. 1940     EQUB  0
  493. 3.9
  494. 1950     EQUB  0
  495. 3.9
  496. 1960
  497. 3.9
  498. 1970 .Table
  499. 3.9
  500. 1980 .Title   EQUS  öElektorSamplerò
  501. 3.9
  502. +CHR$(0)
  503. 3.9
  504. 1990     EQUS  öSampleò+CHR$(0)
  505. 3.9
  506. +CHR$(0)
  507. 3.9
  508. 2000 .Help
  509. 3.9
  510. 2010     EQUS  öElektor Samplerò+CHR$
  511. 3.9
  512. (9)+ö1.03 (22 Apr 1990)ò+CHR$(0)
  513. 3.9
  514. 2020 .Error
  515. 3.9
  516. 2030     EQUD  1
  517. 3.9
  518. 2040     EQUS  öUnknown Sampler SWIò
  519. 3.9
  520. +CHR$(0)
  521. 3.9
  522. 2050 ]
  523. 3.9
  524. 2060 NEXT
  525. 3.9
  526. 2070
  527. 3.9
  528. 2080 SYS öOS_Fileò,10,öElektorSamò
  529. 3.9
  530. ,&FFA,,Code,O%
  531. 3.9
  532. Å   Extra Speed in high res modes Ö You can use SWI öOS_UpdateMEMCò to
  533. deny VIDC DMA access to the video RAM, which returns to the processor
  534. the bus bandwidth that was being used by the video system. Turning off
  535. VIDCæs access to the memory blanks the screen but makes the machine go
  536. faster even than in MODE 0. To kill VIDCæs access to memory: SYS
  537. öOS_UpdateMEMCò,0, 1024 To re-enable access use SYS öOS_Update
  538. MEMCò,1024,1024.
  539. 3.9
  540. While the screen is thus disabled, you can still write to it as normal
  541. and the results will be there when it is switched back on. This short
  542. program shows the enormous speed gains possible (49% in MODE 15, 120% in
  543. MODE 24) Ö it can reduce by a third, the time taken for a MODE 15 ray
  544. trace. Sean Kelly
  545. 3.9
  546.  10 mode=MODE
  547. 3.9
  548.  20 MODE 0
  549. 3.9
  550.  30 I%=0: T%=TIME
  551. 3.9
  552.  40 REPEAT: I%+=1: UNTIL TIME>=T%+100
  553. 3.9
  554.  50 MODE mode
  555. 3.9
  556.  60 J%=0: T%=TIME
  557. 3.9
  558.  70 REPEAT: J%+=1: UNTIL TIME>=T%+100
  559. 3.9
  560.  80 SYS öOS_UpdateMEMCò,0,1<<10
  561. 3.9
  562.  90 K%=0: T%=TIME
  563. 3.9
  564. 100 REPEAT: K%+=1: UNTIL TIME>=T%+100
  565. 3.9
  566. 110 SYS öOS_UpdateMEMCò,1<<10,1<<10
  567. 3.9
  568. 120 PRINTÉöLoops per second:òæ
  569. 3.9
  570. 130 PRINTöNormal mode 0 ò;I%
  571. 3.9
  572. 140 PRINTöNormal mode ò;mode;ö ò;J%
  573. 3.9
  574. 150 PRINTöBlanked mode ò;mode;ö ò;K%
  575. 3.9
  576. 160 PRINTöSpeed up ò;(K%-J%)/J%*100
  577. 3.9
  578. ;ö%ò
  579. 3.9
  580. Å   FormEd Ö I was very interested to see the tip on !FormEd in the May
  581. issue of Archive which really does make it easier to use. However, there
  582. is a slight snag with it as published as it is possible to close the
  583. sprite viewing window which cannot then be re-opened. Also, it is
  584. possible to activate the ÉToolæ window which allows editing of the
  585. sprites if the following changes are made to the !RunImage file.
  586. 3.9
  587. 1890   DATA öLoad templates>m_templates%
  588. 3.9
  589. ,Save templates>m_Savetemp%, Show Sprites, Show Toolbox#, Quitö
  590. 3.9
  591. 3090   ELSE PROCmergesprites (FNstring0
  592. 3.9
  593. (q%+44)):PROCspriteinfo
  594. 3.9
  595. 9781   WHEN 4 : PROCspriteinfo
  596. 3.9
  597. 9782   WHEN 5 : PROCencodepal (0,15) :
  598. 3.9
  599.  PROCfront (palette%) : PROChtpal
  600. 3.9
  601. 9790   WHEN 6 : PROCfinish : END
  602. 3.9
  603. Line 1890 adds two new options to the iconbar menu (ÉShow Spritesæ and
  604. ÉShow Toolboxæ). Line 3090 has the REM removed which allows merging of
  605. sprite files. Lines 9781 and 9782 are new and implement the opening of
  606. the sprite and tool win-dows. Line 9790 needs changing as ÉQuitæ is now
  607. the sixth item on the menu.
  608. 3.9
  609. Some of the sprite editing routines seem to be miss-ing from the
  610. !RunImage file (such as the Éspray canæ) so I just created a new blank
  611. sprite and altered the template file so that the non-working options
  612. donæt appear!
  613. 3.9
  614. As noted in the magazine, !Paint is better for creating sprites but
  615. these simple changes make !FormEd much more useful. One benefit is that
  616. the sprites edited in !FormEd are displayed in the windows where they
  617. will actually appear when the application runs. Paul Hobbs
  618. 3.9
  619. Å   Function key strips Ö In the past, many have tried to write a
  620. program which generates one or more function key-strips. In most cases,
  621. the graph-ics were not quite satisfying. When using MS-DOS software, the
  622. problem arises that you really need four rows (instead of the standard
  623. three) to cater for all possibilities: F-key, <shift-F-key>, <ctrl-F-
  624. key> and <alt-F-key>. To solve this problem I have made two draw-files,
  625. one for a 3-row function key-strip and one for a 4-row function key-
  626. strip.
  627. 3.9
  628. Both files require the presence of the font ÉHom-erton.Mediumæ.
  629. 3.9
  630. As an example, I have made a function key-strip for the MS-DOS program
  631. WordPerfect version 4.2. This file also requires the presence of the
  632. font ÉCor-pus.Mediumæ.
  633. 3.9
  634. From where I stand, I find the result of the Drawfiles better than what
  635. Iæve seen so far. (Available on the monthly program disc.) Maurice
  636. Hendrix
  637. 3.9
  638. Å   Hard disc and memory usage Ö I was interested to read about module
  639. killing in your First Word Plus column. I have a 1Mb machine and need
  640. all the memory I can get, so I have already experimented with simple
  641. module killing routines.
  642. 3.9
  643. Firstly, I altered all my !run files to keep track of Clib, FPE and the
  644. other common modules and kill them if they are no longer needed. This
  645. used a sys-tem variable for each module that stored the number of
  646. applications using it. This worked but had several drawbacks. The
  647. changing of all !run files did take a lot of work and each application
  648. left open its !run file until it was quit. As a result, I decided that
  649. man-ual module killing or Resetting is a better solution. One interest
  650. ing point highlighted by this, is that !Edit suffers a fatal error and
  651. all work is lost if the FPE is killed even though it does not need it!
  652. 3.9
  653. The one thing that I have found extremely useful is the setting up of a
  654. good hard disc structure and a !boot file. This has saved memory both on
  655. the disc due to duplication and when loading applications due to fewer
  656. icons needed to be loaded. It has also given me quicker and easier
  657. access to programs via the new task option.
  658. 3.9
  659. One thing that should be noted by hard disc users is that although
  660. directories allow a nice structure, they do use memory and also slow the
  661. access to certain parts of the disc, so donæt go overboard creating
  662. directories for everything.
  663. 3.9
  664. I will try to explain the structure of my hard disc. I have in my root
  665. directory the following directories and a !boot file.
  666. 3.9
  667. !fonts   Outline Fonts
  668. 3.9
  669. !system   System Modules
  670. 3.9
  671. Art   Artisan, !Paint etc
  672. 3.9
  673. Cad   !Draw etc
  674. 3.9
  675. Games   !Triv etc
  676. 3.9
  677. Library   Command line programs
  678. 3.9
  679. Misc   My working directory
  680. 3.9
  681. Text/DTP   !Edit, !Impress, !PrinterDM etc
  682. 3.9
  683. Utilities   !FormEd, !Hand, !Configure etc
  684. 3.9
  685. Others could include Sound, spreadsheets and lang-uages etc. Try to keep
  686. associated programs together but donæt have directories with lots of
  687. applications as all the icons are loaded and waste memory. Keep commonly
  688. used programs one level down and others in sub directories. This is
  689. especially true for the utilities directory.
  690. 3.9
  691. The next stage is to move all the commonly used modules into the
  692. !system.modules directory. This avoids duplication, ensures a module
  693. update is used by all programs and also simplifies things. The most
  694. common modules found are FPEmulator and Clib. Well-written programs will
  695. already use !System but some donæt and they will need their !run files
  696. mod-ified. The rmload commands need to load from :4.$. !system.modules.
  697. If the !run file does not contain the rmload commands it is probably
  698. best to leave its modules where they are unless you know what you are
  699. doing. Finding modules can be done using simple utilities such as !hand
  700. (helping hand) from the Data Store to search for the file type &FFA.
  701. 3.9
  702. Probably the most important part of a good hard disc setup is its !boot
  703. file. This gives the user an ideal chance to customise their system. My
  704. !boot file shown below sets up various system variables that perform a
  705. range of functions.
  706. 3.9
  707. | !Boot file for hard disc
  708. 3.9
  709. | Set variables for directory abbrevs
  710. 3.9
  711. Set r adfs::BigHardNo1.$.
  712. 3.9
  713. SetMacro u <r>Utilities.
  714. 3.9
  715. SetMacro a <r>ART.
  716. 3.9
  717. SetMacro d <r>Text/DTP.
  718. 3.9
  719. SetMacro g <r>GAMES.
  720. 3.9
  721. SetMacro System$Path <r>!System.
  722. 3.9
  723. SetMacro sm <r>!System.Modules
  724. 3.9
  725. | Set Alias to emulate two common
  726. 3.9
  727.  Unix commands
  728. 3.9
  729. Set Alias$LS Cat %0
  730. 3.9
  731. Set Alias$CD Dir %0
  732. 3.9
  733. | Setup directories to be searched
  734. 3.9
  735.  for a run command (using abbreviations to keep line
  736. 3.9
  737.  to <255 chars )
  738. 3.9
  739. SetMacro Run$Path ,%.,<sm>.,<r>L*.,
  740. 3.9
  741. <d>1*.,<r>CA*.,<a>,<d>,<r>M*.,
  742. 3.9
  743. <d>PI*.,<r>PC.,<u>,<u>CT*.,<u>F*.,
  744. 3.9
  745. <u>A*.,<u>B*.,<u>C*.,<u>D*.,
  746. 3.9
  747. <u>FO*.,<u>L*.,<u>T*.,<u>M*.,<r>T*.,
  748. 3.9
  749. <r>S*.,<g>I*.,<g>B*.,<g>A*.,<d>!i*.
  750. 3.9
  751. | Setup directories to be searched
  752. 3.9
  753.  for a load command (using abbreviations to keep line
  754. 3.9
  755.  to <255 chars )
  756. 3.9
  757. Setmacro File$Path ,%.,<sm>.,
  758. 3.9
  759. <r>Library.,<u>L*.,<d>!i*.
  760. 3.9
  761. | run common applications !boot files
  762. 3.9
  763.  to emulate the system seeing the application without cluttering
  764. 3.9
  765.  the $ dir.
  766. 3.9
  767. <a>!Draw.!Boot
  768. 3.9
  769. <a>!Paint.!Boot
  770. 3.9
  771. <d>!Edit.!Boot
  772. 3.9
  773. <d>!Impress.!Boot
  774. 3.9
  775. <u>FILES.!SPARK.!BOOT
  776. 3.9
  777. | set any commonly used key strings
  778. 3.9
  779. Key 1 *DESKTOP|M
  780. 3.9
  781. Key 2 EDIT|M
  782. 3.9
  783. | run desktop and display root directory
  784. 3.9
  785. Desktop Filer_OpenDir adfs::BigHardNo1.$
  786. 3.9
  787. The !boot file starts by defining a series of system variables that are
  788. to be used throughout the file. They include abbreviated variables to
  789. represent commonly used pathnames. System$Path is also defined here.
  790. 3.9
  791. The next section defines two aliasæs that emulate common Unix system
  792. commands. This is only of use if you switch operating systems commonly
  793. and tend to accidentally type in the wrong commands. A similar set could
  794. also be set up for PC users although a clash of the ödirò command would
  795. occur.
  796. 3.9
  797. The next two sections are similar and set up the vari-ables Run$Path and
  798. File$Path. Firstly, Run$Path can be used to define all the directories
  799. that you wish to be searched when a run program command is issued.
  800. Similarly File$Path does the same for loading files. They both include
  801. the first path which refers to the current directory.
  802. 3.9
  803. The system variables defined at the start have been used extensively and
  804. the * wildcard to keep the line shorter than the 255 character maximum.
  805. Be careful when using wildcards because a new directory could also match
  806. the search instead of the intended directory. As an alternative to this,
  807. a series of paths could be placed into system variables i.e. Run1$ Path,
  808. Run2$Path etc and then added together to give the complete Run$Path. Be
  809. careful when using sys-tem variables to get the correct punctuation.
  810. Each path must end with a full stop ö.ò although this can been included
  811. at the end of the system variables.
  812. 3.9
  813. The main reason for doing this is to allow the user to use the öNew
  814. Taskò option of the task menu. If all the directories are correctly
  815. listed in this section, you will be able to enter ö!Editò into the öNew
  816. Taskò option and the program will install itself onto the icon bar. This
  817. eliminates the need to know where in the directory structure it is. The
  818. same goes for loading a program or module. You can now tuck away those
  819. little used programs and still call them up as long as you know their
  820. name. The general effect is the same as if everything is in the library
  821. although loading commands can also be used.
  822. 3.9
  823. I have found it useful to emulate the system seeing commonly used
  824. applications such as !Draw, !Paint and !Edit. To do this all you must do
  825. is run each applicationæs !boot file. This will setup all the icons and
  826. system variables. This means that, for example, a draw file can be
  827. loaded without the application having being seen.
  828. 3.9
  829. A Hard disc !boot file is also the ideal place to set up any commonly
  830. used key strings as well as loading any important modules.
  831. 3.9
  832. Finally, the desktop can be called and I find it useful to open up the
  833. root directory. This can be done by the Filer_OpenDir command. Alterna
  834. tively, another obey file can be run after the desktop has been entered
  835. by the use of the -file option. If this is the case, it may be useful to
  836. create an application called !boot and rename the !boot file to !run.
  837. The second obey file can then be hidden inside this directory.
  838. 3.9
  839. To create and set up the !boot file╔ (1) Run !Edit (2) Create obey file
  840. (icon menu) (3) Type in !boot data (See above) (4) Save as !boot (in
  841. root directory) (5) Press <f12> and type
  842. 3.9
  843. OPT4,2
  844. 3.9
  845. Configure drive 4
  846. 3.9
  847. Configure boot
  848. 3.9
  849. Philip Armstrong
  850. 3.9
  851. Å   Hourglass Ö A quick hint for those writing a BASIC program using the
  852. Hourglass. Often, if an error is generated from BASIC when the hourglass
  853. is being used, it stays on the screen. This can be cured by
  854. SYSöHourglass_Smashò or, if you have already done your error checking,
  855. SYSöò causes a system error which has the same effect. Philip Armstrong
  856. 3.9
  857. Å   INKEY problems Ö If you have a loop which executes continuously and
  858. rapidly, you might want to use:
  859. 3.9
  860. key%=INKEY(0):IF key%=64
  861. 3.9
  862. PROC_Fred ELSE IF
  863. 3.9
  864. key%=65 PROC_Edith
  865. 3.9
  866. to detect a keypress. However, remember that you should have only one
  867. such INKEY statement in the loop even if you want to cater for many
  868. different key presses because a single keypress can only be det-ected by
  869. one INKEY(0) instruction. Steve Kirkby.
  870. 3.9
  871. Å   Keyboard cleaning (A300/400 series) Ö The keyboard that is supplied
  872. with the computer is of the open Printed Circuit Board type. That is, a
  873. conduc-tive film on the base of each key makes contact with large solder
  874. plated areas called lands on the main PCB. This makes for a cheap and
  875. reliable keyboard but it does have its problems because of its exposure
  876. to the air in that dust can and does get in.
  877. 3.9
  878. Iæve had my Archimedes A310 for over 2 years now and my wife lets it
  879. live in the living room with us. I suppose I should keep the keyboard
  880. covered with something when not in use but Iæve never got round to doing
  881. this. Consequently, the keyboard has had to put up with me eating
  882. biscuits, sandwiches and other unmentionables while typing. I suppose
  883. the inevitable had to happen and one day the keyboard rebelled! I had
  884. began to noticed over a period of several days that the space bar and
  885. left cursor key where playing up until they refused to work at all. Of
  886. course, this happened a week after the guarantee had run out!
  887. 3.9
  888. Visions of massive bills loomed before me so I decided to undertake the
  889. task of opening the keyboard case and having a look! I first switched
  890. off the Archimedes and unplugged the keyboard cord from the computer. I
  891. removed the mouse and turned the keyboard face down with the Reset
  892. button towards me. I noted that eight large, long hex screws held the
  893. back section of the keyboard case on. After removing these I just lifted
  894. the back section away and placed it somewhere safe. The Reset button
  895. looked slight delicate so I removed it by simply pulling it off. I made
  896. a mental note of which way round it came off.
  897. 3.9
  898. I had a good look and there were seven large, short hex screws holding
  899. the top keyboard casing to the main PCB frame. I removed these screws
  900. and lifted the PCB off, putting the top casing away to another safe
  901. place. I was half expecting the key tops and switches to try and escape
  902. at this point but they are firmly attached to a metal frame!
  903. 3.9
  904. Biscuit supply Ö Turning the PCB over and looking at the top surface
  905. between the key tops I was amazed to see a surprising amount of dust and
  906. what looked like a secret supply of Burtons biscuits! I duly removed
  907. this with a dry paper towel and again placed the board face down after I
  908. had a good look at the electronics on the board, but I resisted the
  909. temptation to touch (I suggest you do the same).
  910. 3.9
  911. All that now remained to do was remove the twenty small hex screws
  912. holding the PCB to the switches. I started with the black screw at S94
  913. position (this is written on the PCB) and noted that this was the only
  914. small screw not actually threaded on to a switch. I removed the other
  915. nineteen screws and gently lifted the PCB off the metal frame holding
  916. the keys on.
  917. 3.9
  918. The contact plates of all the key switches where now exposed and they
  919. consisted of thin silver discs which when pressed make contact with the
  920. PCB lands and therefore closed the contacts. These plates looked
  921. extremely fragile but clean so I left them well alone!
  922. 3.9
  923. Cleaning Ö The PCB lands were dirty, especially around the Space and
  924. Left Cursor key positions and, being very careful not to put any grease
  925. from my paws onto the board, I wiped the entire PCB with a dry paper
  926. towel. Reassembling the keyboard was easy. I just placed the PCB face
  927. down on to the metal frame holding the keys and lined up the small
  928. screws positions. A good tip in reassembling something like this is to
  929. begin placing the screws in from opposite ends and not to tighten up any
  930. of the screws until they are all in place.
  931. 3.9
  932. Once that was done, making sure that the black screw was in the correct
  933. position, I placed the top section face down on the work table and
  934. positioned the assembly down onto it, again fitting the seven large
  935. short hex screws in place. I refitted the Reset moulding into place with
  936. a resounding click and finished off by screwing down the last eight
  937. large long hex screws into place. I turned the complete keyboard over
  938. and plugged it back into the Archimedes and Iæm glad to say it works a
  939. treat! Stuart Halliday
  940. 3.9
  941. Å   OsSys module Ö Shortly after the release of the OsSys module, I was
  942. told that one couldnæt use SWIæs that needed a pointer to a buffer
  943. because no such facilities where made available. I argued that this was
  944. very easily implemented and changed the module accordingly. When doing
  945. this, I also noticed a minor bug in the module. When a string longer
  946. than 300 characters is passed, the module is supposed to generate an
  947. error. This works fine but, due to a problem during the development, I
  948. mistakenly thought that the pipeline was playing up when generating this
  949. error. (Not all of the error text was displayed: the first 4 characters
  950. were missing). I solved this by adding 4 to the PC when generating the
  951. error. Quite wrong of course. I discovered that not the pipeline but I
  952. was to blame. I had forgotten to put the error number (4 bytes) in
  953. before the error message.
  954. 3.9
  955. To upgrade the OsSys module to version 1.8, load the source code into
  956. BASIC V and change/add the following lines:
  957. 3.9
  958. 10 REM >OsSysSrc18
  959. 3.9
  960. 350 EQUS ö1.80 (05 Apr 1990)ò
  961. 3.9
  962. 600 MOV R3,#500
  963. 3.9
  964. 610 SWI öOS_Moduleò
  965. 3.9
  966. 611 ;By claiming a larger workarea than required by the
  967. 3.9
  968. 612 ;the module, you can use the top of the work area to
  969. 3.9
  970. 613 ;create workspace for SWI calls that require pointers to
  971. 3.9
  972. 614 ;such a workspace. Eg. calls to WIMP or VDU.
  973. 3.9
  974. 650 EQUS öOsSWICalls v1.80 by M. Hendrix => Installedò
  975. 3.9
  976. 2510 REM remove this line. Itæs incorrect
  977. 3.9
  978. 3180 EQUD &01 ;Error number
  979. 3.9
  980. Save and run the program.
  981. 3.9
  982. The new module will claim more workspace than it actually needs. The top
  983. 200 bytes can thus be used for SWI buffers. You can use *MEMORYA to edit
  984. the buffer(s). If you need more space for a buffer just change the value
  985. #500 in line 600 to your desired amount of memory. (Donæt forget to add
  986. 300 bytes for the module itself!) Maurice Hendrix
  987. 3.9
  988. Å   Random number generator Ö If you use the use the random number
  989. generator (RND in BASIC), it must be initialised with something really
  990. random, such as the current time. Otherwise, the same num-bers will be
  991. produced every time the program is run. The otherwise excellent game
  992. !Yahtzee on Care-ware 4 suffers from this problem but it can easily be
  993. solved: insert the line 123 Junk = RND(-TIME) and then every game is
  994. different. Jonathan Puttock
  995. 3.9
  996. Å   The Dreaded CLI! Ö One of the nicest aspects about the Archimedes is
  997. the Configure command. This command is often forgotten about as it lies
  998. in that terrible place called the Command Line Interpreter (CLI)
  999. accessed by pressing the dreaded function 12 key. One of the many things
  1000. that the Configure command does and seems to get lain aside is the
  1001. WimpFlags options. This very useful command determines the action of all
  1002. the windows used by RISC-OS in as far as it controls the two types of
  1003. window movement, resizing and scrolling. What two types?, I hear you
  1004. ask.
  1005. 3.9
  1006. Status Ö Well if youæve never used the WimpFlags command before then you
  1007. have probably put up with the kind of windows which, when you change
  1008. their size or move them, all you get is a large dotted outline which
  1009. turns into a solid window when you release <select> or <adjust>. Now you
  1010. have an alternative. If you first press F12 from the Desktop and type in
  1011. *STATUS <return> youæll get a large list of items and near the end is a
  1012. line Wimpflags x, this x number (it may be 0) is actually the decimal
  1013. representative of a binary pattern of this number which switches on or
  1014. off the various options under this command.
  1015. 3.9
  1016. If you type in *HELP WimpFlags <return> then the following should
  1017. appear:
  1018. 3.9
  1019. *HELP WimpFlags
  1020. 3.9
  1021. ==> Help on keyword WimpFlags
  1022. 3.9
  1023. *Configure WimpFlags sets the
  1024. 3.9
  1025.  default actions when dragging
  1026. 3.9
  1027. windows, as follows:
  1028. 3.9
  1029. bit 0 set: continuous window movement
  1030. 3.9
  1031. bit 1 set: continuous window resizing
  1032. 3.9
  1033. bit 2 set: continuous horizontal scroll
  1034. 3.9
  1035. bit 3 set: continuous vertical scroll
  1036. 3.9
  1037. bit 4 set: donæt beep when error box
  1038. 3.9
  1039.  appears
  1040. 3.9
  1041. Syntax: *Configure WimpFlags <number>
  1042. 3.9
  1043. Simply put, if you where to type in say:
  1044. 3.9
  1045. *CONFIGURE WimpFlags 1 <return>
  1046. 3.9
  1047. and press <ctrl-break> (you need to do this each time you enter new
  1048. values to actually change the values!) youæll see that if you move any
  1049. window it will be instant! If you want to try some more Éconfiguringæ
  1050. try changing the WimpFlags to 2 to see only instant window resizing or 3
  1051. for both. (Donæt forget to press <ctrl-break> afterwards!) If you do not
  1052. like this new look, simply change Wimpflags back to 0. The next two
  1053. options concern the scroll bars and these are really useful. If you
  1054. change WimpFlags to 8 youæll see that by dragging the pointer up and
  1055. down the vertical bar youæll get a smooth scroll effect, much better
  1056. than constantly clicking the arrow icons! Try WimpFlags set to 4 for
  1057. horizontal scroll or even 12 for them both at the same time.
  1058. 3.9
  1059. Error Ö The last option just stops the error box beeping at you. Try
  1060. WimpFlags set to 16 and then Select an empty disc drive. Remember you
  1061. can combine any of these together by simply adding their numbers
  1062. together and configuring the WimpFlags. Try WimpFlags set to 31, this is
  1063. my favourite! Stuart Halliday
  1064. 3.9
  1065.