home *** CD-ROM | disk | FTP | other *** search
/ Archive Magazine 1995 / ARCHIVE95.iso / text / hints / volume_04 / issue_01 next >
Text File  |  1995-02-16  |  8KB  |  188 lines

  1. Å 160k ADFS discs for the Archimedes?  If you have upgraded to the
  2. Archimedes from a Master, or even a Beeb with ADFS, you might have some
  3. 5.25ö discs you want to transfer.  According to the manuals, the
  4. Archimedes will only read and write to 640k (L) format, Arthur 800k (D)
  5. format, or the RISC-OS 800k (E) format using either 3.5ò or 5.25ö discs
  6. (80T).  However, the Master could read and write 40T 160k (S) format,
  7. 80T 320k (M) format, or 80T 640k (L) format discs.  I discovered by
  8. accident that the Archimedes will quite happily read 5.25ò 160k (S)
  9. discs in 40T mode, and in fact save them Ö I have not been able to try
  10. out 320k discs since I do not have any.  You cannot, however, format
  11. discs at either 160k or 320k on the Archimedes but then why would you
  12. want to anyway? Chris Hughes (Wakefield BBC Micro User Group).
  13. 4.01
  14. Å Apocalypse Tips Ö Progressing from planet to planet is really simple. 
  15. At the start of the game, a map of your selected planet is displayed. 
  16. All the objects on the planetæs surface are represented by coloured
  17. dots, about 80% of which must be destroyed for your craft to be
  18. withdrawn and for you to be allocated another planet.
  19. 4.01
  20. As you progress through the game and return to the ÉGuild of Spacingsæ
  21. you will be given various add-ons for your ship.  These include a super-
  22. cooler for your laser-canon and better shielding.  It is vital that you
  23. have these if you intend to progress at a reasonable pace, so it is
  24. advisable to get them as soon as possible.  Remember, you can only
  25. return a maximum of five times before being rejected by the Guild.  When
  26. you have destroyed your 80% or so, you will automatically be withdrawn
  27. by the Guild Ö this may take some time so donæt give up too quickly!
  28. 4.01
  29. If you prefer rather more action and less running away, the following
  30. lines of the BASIC file É!Apocalyps.Apocalypseæ can be changed.
  31. 4.01
  32. Line 290 is your starting score.
  33. 4.01
  34. Replace line 330 with:  330 !shieldcharge=16 :
  35. !rapidturnF=1:!guntempcooler=0
  36. 4.01
  37. Now delete lines 340 to 380 inclusive for all the extra features and
  38. (very) strong shields.
  39. 4.01
  40. Replace line 770 with: UNTIL 0 for infinite lives.  At line 1970
  41. !impcounter is the number of objects you have shot, which determines how
  42. many you have to go before advancing to the next planet.  For instant
  43. withdrawal, replace 1970 with: 1970 !impcounter=10000.
  44. 4.01
  45. Line 6910 is how many times you can return to the guild before rejection
  46. (this is normally 5).
  47. 4.01
  48. Å HFORM v1.72 bug or feature?  If you try to format an ST506 hard disc
  49. that has had a different profile (e.g. it was used on  a PC beforehand)
  50. with the Acorn HFORM program supplied on the RISC-OS Supplement Disc,
  51. the new disc shape option will not be acknowledged and so the full
  52. capacity of the drive may not be realised.  This can be overcome by
  53. removing the line that reads:
  54. 4.01
  55.    2130 IF cyl%=0 IF head%=0 IF Formatted% GOTO 2180
  56. 4.01
  57. Brian Oliver.
  58. 4.01
  59. Å Hostages cheat mode Ö If you hold down the <R>, <U>, <T> and <H> keys
  60. once the title screen has loaded and press <return>, you will enter into
  61. the cheat mode.  This allows you to jump to either section two or three
  62. of the game with three hostages and seven terrorists.
  63. 4.01
  64. Å RAM discs for the PC Emulator Ö It is possible to create a hard disc
  65. partition in any filing system.  For example, by altering the !PC.!Run2
  66. file so that the path for Drive D is ÉRAM:$.RamDiscæ and using the FDISK
  67. program to create a RAMFS hard disc partition, you can obtain any size
  68. RAM disc you require _ memory and pages sizes permitting.  Michael Ben-
  69. Gershon.
  70. 4.01
  71. Å Reading a system variable from BASIC Ö The question was, öIæve got a
  72. system variable being set in the !Run obey file:
  73. 4.01
  74.    Set MaxNumberOfFonts 32
  75. 4.01
  76. and I want to be able to read this value into a BASIC variable but when
  77. I use:
  78. 4.01
  79.    value% = VAL (ö<MaxNumberOfFonts>ò)
  80. 4.01
  81. it produces the error ÉVariable not foundæ, because it takes the É<æ
  82. character as meaning Éless thanæ rather than Éstart of system variableæ. 
  83. Using the BASIC keyword EVAL has the same effect.
  84. 4.01
  85. The first thing we need to do is to extract the value of the system
  86. variable into a string that we can manipulate.  After searching through
  87. the PRM volume II, I eventually found OS_ReadVarVal (SWI&23) on page
  88. 750.  On entry, R0 points to the name of the system variable to be read,
  89. R1 points to a suitable buffer to store the string in, R2 is the maximum
  90. length of this buffer, R3 is set to 0 to use the first occurance of the
  91. named system variable, and R4 is set to 3 so that an expanded string is
  92. returned in the buffer.
  93. 4.01
  94. On exit, we should now have the value of the system variable in the form
  95. of a string.  The next task is to convert this string into an integer,
  96. and this is easily performed by using OS_ReadUnsigned (SWI &21) on page
  97. 585.  On entry, R0 is set to 0 so that the base number used is assumed
  98. to be 10 unless the string indicates otherwise, R1 is the pointer to the
  99. string (note that this is the same as R1 for OS_ReadVarVal, which is
  100. preserved on exit).  On exit R2 contains the value of the system
  101. variable as an integer, using only two SWI calls.
  102. 4.01
  103. This is easily implemented in both BASIC and ARM assembler.
  104. 4.01
  105. In BASIC this can be achieved with 4 instructions:
  106. 4.01
  107.    MaxBufferLength = 16
  108. 4.01
  109.    DIM BufferPtr MaxBufferLength
  110. 4.01
  111.    SYS öOS_ReadVarValò, öMaxNumberOfFontsò, BufferPtr,
  112. MaxBufferLength,0,3
  113. 4.01
  114.    SYS öOS_ReadUnsignedò,0,BufferPtr TO ,,value%
  115. 4.01
  116. and if you want to do in Arm assembler, then only eight instructions are
  117. necessary:
  118. 4.01
  119.    ...
  120. 4.01
  121.    ADR R0, SystemVariablePtr ; point to system variable
  122. 4.01
  123.    ADR R1, BufferPtr; point to buffer
  124. 4.01
  125.    MOV R2, #MaxBufferLength ; length of buffer
  126. 4.01
  127.    MOV R3, #0 ; use first one found
  128. 4.01
  129.    MOV R4, #3 ; expand fully
  130. 4.01
  131.    SWI XOS_ReadVarVal ; R1 preserved
  132. 4.01
  133.    MOV R0, #0 ; use default base
  134. 4.01
  135.    SWI XOS_ReadUnsigned ; R2 = value%
  136. 4.01
  137.    SystemVariablePTr = öMaxNumberOfFontsò, 0 ; note no É<æ or É>æ are
  138. used
  139. 4.01
  140.    ALIGN
  141. 4.01
  142.    MaxBufferLength * 16
  143. 4.01
  144.    BufferPtr % MaxBufferLength ; reserve MaxBufferLength
  145. 4.01
  146.    ALIGN ; bytes of workspace
  147. 4.01
  148. To give a quick example of its use.  ÉSetMaxNumberOfFonts 16æ gives
  149. value% = 16.  ÉSetMaxNumberOfFonts &20 gives value% = 32.
  150. 4.01
  151. This may be of use to programmers, as it allows constants to be set up
  152. in the !Run obey file and users can modify them to fit their require
  153. ments, without having to modify the program itself.  John ÉLoftyæ
  154. Wallace.
  155. 4.01
  156. Å System Variables for the Filer Module (Archive 3.11 p7) Ö The problem
  157. with the Filer module not allowing you to include system variables can
  158. be solved a lot easier (and without taking up any valuable RMA space).
  159. 4.01
  160. I like to use icons for the directories which contain the third party
  161. applications, demos, utilities, etc.  This meant using an application
  162. directory and I wanted a general purpose !Run obey file to open the
  163. directory viewer (using Filer_OpenDir).  However, I came across the same
  164. problem as Simon Callan.  The solution I present here was passed on to
  165. me by Paul Fellows (who wrote ÉArchimedes Basic Compileræ amongst other
  166. things) and so I donæt wish to take the credit for such a neat idea.
  167. 4.01
  168. So that I donæt have the !Run, !Sprites, etc with the actual programs I
  169. want to view, I create a directory É_æ inside that application directory
  170. to hold them.  Thus my !Run obey file reads as follows:
  171. 4.01
  172.    |!Run obey file
  173. 4.01
  174.    |
  175. 4.01
  176.    IconSprites <Obey$Dir>.!Sprites
  177. 4.01
  178.    Set Alias$OpenDir Filer_OpenDir <Obey$Dir>._
  179. 4.01
  180.    OpenDir
  181. 4.01
  182. Setting a command string as an ÉAliasæ will expand any system variables
  183. within that command string.  This gets around the problem which Simon
  184. describes, and also means that you donæt need to run a program every
  185. time you switch the machine on.  John ÉLoftyæ Wallace.
  186. 4.01
  187.  
  188.