home *** CD-ROM | disk | FTP | other *** search
/ Archive Magazine 1995 / ARCHIVE95.iso / text / hints / volume_04 / issue_02 < prev    next >
Text File  |  1995-02-16  |  15KB  |  353 lines

  1. Å 160k ADFS Discs (continued from Archive 4.1 p9) Ö It is certainly true
  2. that the Archimedes can be made to read and write 160k or 320k ADFS
  3. discs correctly.  I think, however, that the Archimedes Éseesæ these as
  4. 640k L format discs and if a read or write operation directs it to a
  5. track beyond 39 (160k) it will try to push the disc head off the edge of
  6. the disc searching for tracks that arenæt there.  Fine if you know what
  7. youære doing.  Lorcan Mongey.
  8. 4.02
  9. Å Am I in the desktop?  You can use the Wimp_ReadSysInfo SWI command to
  10. see if your program is running in the desktop or not.  The command
  11. returns the number of active tasks, which will be zero if the program is
  12. running outside of the desktop environment.  The example program below
  13. will sense whether it has been run from the desktop environment and if
  14. not, it will start up the desktop before running another application (in
  15. this case !Edit).
  16. 4.02
  17.    program segment missing
  18. 4.02
  19. Adrian Look.
  20. 4.02
  21. Å Apocalypse hints & tips Ö If you shoot the green T-shaped buildings
  22. with a triangular roof using a mega photon your shield will be replen
  23. ished.  If you shoot a purple and green mushroom, your shield will go
  24. into override but your points are decreased for anything you hit with
  25. the photons you are allocated.  If you shoot a rectangular brown
  26. building they leave a shallow pyramid and if you shoot this, a Rakon
  27. Gomjabba will appear and you will get a few more points for destroying
  28. this.  If you shoot a Snail Rider with a mega photon, your energy banks
  29. are recharged.  If you shoot a green mushroom, your score will decrease
  30. for everything you hit with the mega photons allocated.
  31. 4.02
  32. If you type in and run the following program with disc two in drive 0
  33. you will then be able to access all of Apocalypseæs nine worlds.
  34. 4.02
  35.    program segment missing
  36. 4.02
  37. Paul Bedford.
  38. 4.02
  39. Å Bug in the Debugger Module Ö Some of you may be aware of a problem
  40. with the Debugger module failing to disassemble certain instructions
  41. correctly if they contain an immediate constant.  An immediate constant
  42. is stored as an eight-bit value with a 4-bit shift applied, and the
  43. debugger normally expands this format to its correct value, but
  44. occasionally fails, e.g.
  45. 4.02
  46.    E28F0C01 ADD R0,PC, #&0100 correctly expanded
  47. 4.02
  48.    E28F0D01 ADD R0,PC, #&01,26 failed to expand (should be #&40)
  49. 4.02
  50. I have disassembled the debugger module and found the offending piece of
  51. code.  It doesnæt seem to be a bug, rather a deliberate move to expand
  52. constants differently under certain circumstances but for no obvious
  53. reason.  Anyway, the fix is to change the word at offset &920 in the
  54. module from &1A000028 to &FA000028, effectively changing a BNE to a BNV. 
  55. This seems to solve the problem, although I havenæt tested this fix
  56. exhaustively, so proceed with caution.  Lorcan Mongey.
  57. 4.02
  58. Å BUILDing !Run files Ö If you write a !Run file using *BUILD and want
  59. to include a line such as:
  60. 4.02
  61.    Run <Obey$Dir> .!RunImage
  62. 4.02
  63. then, instead, you should type:
  64. 4.02
  65.    Run |<Obey$Dir>.!RunImage
  66. 4.02
  67. to prevent RISC-OS from inserting the value of Obey$Dir into the file. 
  68. It may be obvious but until now I have been using !Edit to write a two
  69. line Obey file!  Elliott Hughes.
  70. 4.02
  71. Å Copy Options Ö öConfirmò and öVerboseò Ö I think this is probably one
  72. of those hints which would be classed as öobviousò by those who know it: 
  73. The Archimedes User Guide and the PRM both describe, at some length, the
  74. use of the system variable Copy$Options which sets default options for
  75. the *Copy command.  However, neither make if clear that the desktop
  76. filer has its own öConfirmò and öVerboseò options which are quite
  77. independent of those which are stored in the system variable.  Thus no
  78. amount of modification of Copy$Options in boot files or elsewhere will
  79. affect the way the desktop behaves.
  80. 4.02
  81. The filer options can be read and changed by clicking the menu button
  82. over any directory window and choosing the Options option.  The options
  83. selected by this route differ in one significant way from the
  84. Copy$Options in that they are stored in battery-backed RAM and thus are
  85. preserved when the machine is switched off or reset.  They are stored in
  86. byte 198 of the CMOS RAM (not byte 195 as my copy of the PRM says) along
  87. with various other desktop options:
  88. 4.02
  89.    program segment missing
  90. 4.02
  91. Having these options stored in CMOS RAM can sometimes be an advantage
  92. but on the whole I find it rather inconvenient.  For instance, I often
  93. change temporarily from an icon display to öFull Infoò and would like
  94. icons to be restored after a reset.  Luckily this sort of preference can
  95. easily be dealt with by a few lines in the boot routine.  For instance,
  96. the following lines of BASIC will reset the Display mode to small icons
  97. while preserving the other options:
  98. 4.02
  99.    program segment missing
  100. 4.02
  101. Hugh Eagle.
  102. 4.02
  103. Å Cut and paste clip board Ö Many RISC-OS applications have a Écut and
  104. pasteæ option.  If these applications can also edit more than one
  105. document at a time then you can use the Écut and pasteæ option as a clip
  106. board to transfer data from one document to another.  For example, you
  107. can select a block of text in one !Edit document, move to another
  108. document and then use the <ctrl><c> option to copy the block into that
  109. document.  This method will also work with applications such as
  110. PipeDream but not Ovation or Impression, etc as they use the Éclip
  111. boardæ method.  Steve Drain.
  112. 4.02
  113. Å Deskjet Plus Ink Cartridges, Recharging Ö You may have discovered the
  114. same problem as me when trying to recharge these cartridges, namely that
  115. the ink wonæt go in the hole!
  116. 4.02
  117. A bit of reverse engineering, with the aid of a hacksaw, has revealed
  118. the cause.  The container is filled with a dense spongy material which
  119. holds the ink, but this does not enter the cavity formed by the raised
  120. green portion with the central vent hole.  If a syringe needle is
  121. entered through this hole it must be long enough to reach into the
  122. sponge.  At least 20mm is required.  If this is not the case then the
  123. inserted ink charge is held on top of the sponge by surface tension, and
  124. quickly overflows through the charge hole.
  125. 4.02
  126. The only syringes which I can get hold of are intended for diabetics and
  127. have a needle which is too short to reach the sponge through the top
  128. hole.  The solution is to fill the sponge through the top hole.  The
  129. solution is to fill through a second hole, drilled as small as possible,
  130. on the 3mm wide land to the side of the raised portion.  In this
  131. location there is a small internal cavity not filled with sponge.  This
  132. prevents capillary leakage after recharging.
  133. 4.02
  134. Archive readers may be interested in the following program which will
  135. draw a sketch showing the location of the hole.  It should be made as
  136. close to the vertical wall of the raised portion as is possible.
  137. 4.02
  138.    program segment missing
  139. 4.02
  140. With regard to inks I have excellent results with Rotring Art Pen Ink
  141. which comes in many colours.  Bill Graham.
  142. 4.02
  143. Å MEMC DMA control register Ö With reference to Sean Kellyæs tip in June
  144. É90 for gaining extra speed from the Archimedes by disabling the VIDCæs
  145. DMA access.  Although the technique normally works without any trouble,
  146. occasionally the machine crashes or has its memory contents corrupted. 
  147. As Sean correctly stated, bit 10 of the MEMC register controls VIDC DMA,
  148. however, as the dynamic RAM (DRAM) in the machine is no longer being
  149. read by the VIDC it is also no longer being refreshed properly.  Bits 8
  150. & 9 of the MEMC come to the rescue, they are the DRAM refresh control
  151. bits.
  152. 4.02
  153. There are three available modes of refresh:-
  154. 4.02
  155.             bit 8   bit 9
  156. 4.02
  157. a) no refresh         1   0
  158. 4.02
  159.     (not used by the Archimedes)
  160. 4.02
  161. b) refresh during video flyback      0   1
  162. 4.02
  163. c) continuous refresh         1   1
  164. 4.02
  165. Flyback time during standard modes (0-16 & 24) is greater than the DRAM
  166. holding time and as such requires refresh during flyback.  In multi-sync
  167. modes the flyback time is much faster and the memory does not need to be
  168. refreshed by the MEMC.
  169. 4.02
  170. The codes for the various modes are:-SYSöOS_UpdateMEMCÉ,768,1792 to turn
  171. off the VIDC DMA and invoke continuous refresh and
  172. SYSöOS_UpdateMEMCÉ,1536,1792 to return to normal for standard modes.
  173. 4.02
  174. It should be pointed out that the continuous refresh mode uses the DMA
  175. video pointer as the refresh address source, incrementing the pointer
  176. after use.  As such this should be used with care if the pointer is used
  177. as an active part of your program whilst the screen is blanked.  (But
  178. why would you want to move the pointer if you canæt see it??)
  179. 4.02
  180. There is also a sound DMA control bit in the MEMC but as this does not
  181. affect memory refresh bits 8 and 9 which do not need to be altered.
  182. 4.02
  183. Bit 11 Ö 0 Sound DMA disable
  184. 4.02
  185.               1 Sound DMA enable
  186. 4.02
  187. Rob Swain.
  188. 4.02
  189. Å Modifying the RISC-OS dot matrix printer driver Ö To add a new dot
  190. matrix printer configuration to the RISC-OS printer driver you will need
  191. to alter the ÉPrDataæ file in the É!PrinterDMæ directory (on you
  192. Applications Disc One or RISC-OS Extras Disc = Shareware 17):
  193. 4.02
  194. 1)  Make sure you have made a back up copy
  195. 4.02
  196. 2)  Run the !Edit program on Applications Disc One
  197. 4.02
  198. 3)  Double click on the copy of !PrinterDM that you wish to alter,
  199. whilst holding the <shift> key down Ö a filer window will then open with
  200. the contents of the !PrinterDM application inside
  201. 4.02
  202. 4)  Double click on the ÉPrDataæ file in the !PrinterDM filer window Ö a
  203. text window will then open
  204. 4.02
  205. 5)  Use the arrow keys to position the caret (red vertical text cursor)
  206. just before the ÉConfigured optionsæ heading and after the row of full
  207. stops
  208. 4.02
  209. 6)  Add the following text changing the information to match your
  210. printer (the example below adds a Shinwa CP80/Lucas LX80 option to the
  211. RISC-OS printer driver):
  212. 4.02
  213.    program segment missing
  214. 4.02
  215. Alan Dawes
  216. 4.02
  217. Å Nevryon hints & tips Ö Nevryon passwords for level three, five and
  218. seven are given at the foot of this column, the letters being reversed
  219. for the benefit of those who prefer to ignore them.
  220. 4.02
  221. The following Nevryon cheat allows the ship to be upgraded to have any
  222. weapons desired and energy/credits/lives may also be altered.
  223. 4.02
  224. Load the É!Nevryon.Multiæ file on the Nevryon disc 1 and insert the
  225. following at line 211.
  226. 4.02
  227.    211 Dump=PAGE-&3F800:Dump?n=value
  228. 4.02
  229. where n is:
  230. 4.02
  231. n=27:   Ship speed, 4 recommended
  232. 4.02
  233. n=28:   Shield orb (top), 1=ON 0=Off
  234. 4.02
  235. n=29:   Shield orb (bottom), 1=ON 0=OFF
  236. 4.02
  237. n=30:   RAM, 1=ON, 0=OFF
  238. 4.02
  239. n=32:   Gun droids, 0-2
  240. 4.02
  241. n=33   Lasers, 0-2
  242. 4.02
  243. n=35:   Number of credits (default 3)
  244. 4.02
  245. n=36:   Number of lives (default 4)
  246. 4.02
  247. n=37:   Starting secondary weapons status, 0=Off, 1=flamer, etc
  248. 4.02
  249. n=38:   Gold bar status, 0=OFF, 1=flamer, 2=mines, etc
  250. 4.02
  251. n=43:   Amount of energy (default 12)
  252. 4.02
  253. Change as many of these values as you want and save altered program and
  254. repeat the process for the $.Multi file on the Nevryon 2 disc.  Jeremy
  255. Mears.
  256. 4.02
  257.    upside down words missing!
  258. 4.02
  259. Å Printing a full path name Ö This is a reply to the cry of help in
  260. February 1990 from Richard Skemp about how to get the printer driver to
  261. include the full pathname.  If you add the following line to the Library
  262. program in the !PrinterDM directory, the printer driver will print the
  263. full file pathname of any text file you print.
  264. 4.02
  265.    3281 BPUT#outfile%, CHR$13+CHR$10 +öPrinting file ò+filenam$
  266. +CHR$13+CHR10+CHR$10
  267. 4.02
  268. Lorcan Mongey.
  269. 4.02
  270. Å Reinstating the filer module Ö An item on system variables mentions
  271. that if you *RMFaster the filer module from the desktop, you lose the
  272. filer icons and canæt get them back (Archive 3.11 p7).  To retrieve
  273. them, try:
  274. 4.02
  275.    <F12>
  276. 4.02
  277.    Desktop
  278. 4.02
  279.    <Return>
  280. 4.02
  281. this doesnæt interfere with anything already in the desktop but re-
  282. starts any of the default tasks that have been lost, namely Filer,
  283. PaletteUtil an TaskManager.  Note, however, that if you *RMKill or
  284. *RMFaster the Task Manager, you canæt get a *prompt by pressing F12!  To
  285. get around this, make up an Obey file containing the command
  286. 4.02
  287.    *Desktop
  288. 4.02
  289. and this will do the trick.  Itæs quite interesting to see the Task and
  290. Palette icons in the öwrongò place on the icon bar!  However, I feel
  291. that you should not deliberately interfere with desktop modules and this
  292. method should really be regarded as a Éget-you-homeæ technique in case
  293. of problems.  Lorcan Mongey.
  294. 4.02
  295. ÅREMming your programs Ö When writing a program, in any language, it is
  296. good practice to put plenty of comments in to remind oneself what each
  297. particular section of code does.  However, in BASIC, there are two
  298. things which tend to deter one from following this practice.  The first
  299. is that the interpreter has to recognise a REM statement before it knows
  300. to ignore it.  This takes time, which may be undesirable in procedures
  301. and loops.  The second deterrent is the amount of space taken by the
  302. text of the comment, which is stored verbatim in the program.
  303. 4.02
  304. I have a practice, when commenting procedures and functions, of placing
  305. explanatory comments outside the procedure/function block.  For
  306. instance:
  307. 4.02
  308.    program segment missing
  309. 4.02
  310. Clearly, the above practice prevents the REM statements from impacting
  311. the performance of the procedure/function, as they are in section of the
  312. code which the interpreter will never see.
  313. 4.02
  314. This last observation leads to an additional possibility for interpreted
  315. code (but not for compiled BASIC).  Since the interpreter never sees
  316. these lines between procedure/function blocks, the normal syntax rules
  317. can be broken without an error being generated.  Thus, we can save some
  318. space, as well as execution time, by omitting the REM key words.  Note
  319. that this will only work if the comments are where the interpreter
  320. cannot see them.  If you are in the habit of using GOTO statements
  321. (sometimes a handy way of removing umpteen layers of IF... THEN... ELSE
  322. statements if you are checking for exceptions and, despite common
  323. Éwisdomæ, still used frequently by professional programmers), this
  324. placing of syntactically incorrect code beyond the bounds of a procedure
  325. block might allow the trapping of such errors as omitting the ENDPROC or
  326. = statements.  David Hazel.
  327. 4.02
  328. Å Star LC10 Ö An undocumented feature on a Star LC10 Colour Printer, is
  329. that if you open out a file to the printer and try and print characters
  330. 27 and 102 to it, it prints out the current dip switch setting:
  331. 4.02
  332.    program segment missing
  333. 4.02
  334. Jason Ede.
  335. 4.02
  336. Å System Variables (continued from 4.1 p9 & 4.1 p10) Ö I had had similar
  337. problems and came up with a different solution which can solve both
  338. problems, i.e. reading system variables to BASIC and passing system
  339. variables to the Filer module.  I use a call to OS_EvaluateExpression,
  340. which can return a numeric or string value, as follows:
  341. 4.02
  342.    program segment missing
  343. 4.02
  344. This is an artificial example; in practice you would know whether you
  345. were expecting a numeric value or a string, such as Obey$Dir.  Lorcan
  346. Mongey.
  347. 4.02
  348.  
  349. 4.02
  350.  
  351. 4.02
  352.  
  353.