home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Archive Magazine 1996
/
ARCHIVE_96.iso
/
text
/
hints
/
volume_3
< prev
next >
Wrap
Text File
|
1995-06-25
|
140KB
|
4,097 lines
Å Acorn DTP fonts and print outs Ö P.J.Burn says that in order to
print out Acorn DTP documents on an A310 you should select mode 11 as
this releases 40k of memory. He also says that in order to increase the
speed of the DTP screen update you should ensure that the font cache is
24k or larger.
3.1
Å Acorn DTP double spacing Ö Some readers have complained that when
starting a new paragraph the Acorn DTP will always produce a double
space. This can be solved by altering the space above setting of the
paragraphæs style.
3.1
Å BASIC listings for !Edit Ö Mark Taylor says that it is easy to
create an ASCII copy of a BASIC program. Just install !Edit in the
normal way and then create a task window (this can be done by clicking
the MENU button on the !Edit icon and selecting the ÉNew task windowæ
item from the ÉCreateæ sub-menu). In this window start BASIC by typing
*BASIC, then just LOAD the required program and LIST it. You can now
save the contents of the window as a normal ASCII file.
3.1
Å C operating system calls (issue 2.12 p 36 cont) Ö Ray Loades-Bannon
says that to access OSCLI commands from C you should use either:
3.1
system (öscreensave <pathname>òò)
3.1
or:
3.1
{3 .1
char *cptr;
3.1
strcpy (cptr,öscreensave ò);
3.1
strcat(cptr,pathnameptr);
3.1
system(cptr);
3.1
}
3.1
See the ÉCalling other programs from Cæ chapter in the C manual for
further details.
3.1
Å Debugger BreakPoints Ö When stepping though code, it is useful to
run the code up to a breakpoint, and then remove the breakpoint and
reposition it further ahead. Here are three function keys defin-itions
suggested by Robin Terry to help you do this:
3.1
*Key1 öBreakClr PC|MBreakSet ò
3.1
*Key2 öContinue|Mò
3.1
*Key3 öMemoryI PC|Mò
3.1
The first breakpoint is set by using *BreakSet, but subsequent break
points can be set by pressing <f1> and typing in the address. Then press
<f2> should be pressed to execute the code , and <f3> should be pressed
to look at where youæve got to.
3.1
Å Droom under RISC-OS Ö A.H.Eagle says that when using Droom under
RISC-OS the $.Data.Map program just caused the computer to freeze at
line 820. This line reads 820 ?&CFF=L, and doesnæt seem to serve any
purpose (perhaps it is a hang-over from the BBC version). He removed
this line and the program now seems to work OK ( ... so far!).
3.1
Å Econet and the Desktop Ö A warning to all people using the desktop
on the network: *commands are truncated to about 80 characters by the
NetFiler, so for example, if you are several directories down and you
rename a file, it could be renamed to something that you didnæt quite
expect. More dangerous is the *Delete, in that you could want to *delete
net#254:<pathname>.FredOld but your good copy is deleted when the
command is truncated to *delete net#254:<pathname>.Fred. Truncation
occurs due to the Acorn fileservers only being able to cope with data
packets of around 80 characters (although the SJ Research fileserver can
handle packets up to 128 characters). Another interesting feature is
that if the *command is over 128 characters, no truncation occurs and a
Net error is generated.
3.1
Å Filer_OpenDir revisited (issue 2.12 p 6 cont) Ö A simpler way of
using system variables with the *Filer_OpenDir command has been
suggested by one of the Archive BBS callers:
3.1
*Set Alias$temp Filer_OpenDir <system variable>|MUnset Alias$temp|M
3.1
*temp
3.1
This sets up a system variable, called Alias$temp, which is used to
expand the system variable and then delete itself once called.
3.1
Å Hard Disc Backup program on Careware 3 Ö Terry Bromilow says: öThe
program was originally written to run under Arthur OS using the D or L
format discs. I put a new front end on it to make an application for
RISC-OS and put in some lines to accommodate E format discs. It is now
evident that the latter did not get tested.
3.1
The BASIC program !Hdb_v200 in the !HDBackup directory should be amended
as follows:-
3.1
Interchange the adjacent lines 2140 and 2150 and put a new line between
them: 2141 *DISMOUNT
3.1
Å Hard disc parking (2.11 p 13 cont) Ö Martyn Lovell says that
although *bye from a non-adfs filing system wonæt park an adfs hard disc
*adfs:bye will (SCSI hard drive owners should use *scsi:bye).
3.1
Å Keyboard condensation Ö One reader has noted that there is no
lacquer on the top surface of the keyboard PCB. It is not unusual for
people to blow dust, etc away from the keyboard, however, this will
cause condensation onto the PCB and cause some minor corrosion. This can
easily be wiped away.
3.1
Å Limited ADFS memory error Ö The ADFS module will remember the
catalogues of any discs it sees (e.g. those that it *mounts). However,
it is limited to the amount of memory it can allocate to Érememberingæ
these catalogues. This is governed by the *Configure ADFSDirCache
command. When the ADFS directory cache is full, the oldest catalogues
should be discarded as new ones are encountered. Unfortunately, the
module has a bug, which prevents it from doing this properly. What makes
this bug so serious is that it can cause the dreaded ÉFilecore in useæ
error, which cannot be rectified, thereby making it impossible for you
to save any data, etc that you might have been working on. (If Phil
Colmer at Acorn, or whoever, could give us a clue on this one, that
would be useful. Ed.)
3.1
Å Naming discs Ö You may already realise that you should not give
discs the same name (using the *NameDisc command) as RISC-OS will only
access one of the discs i.e. the one most recently *MOUNTed. David
Leckie found that this also holds up for fileservers discs. He had two
separate fileservers 254 and 245 both with hard disks called FS, as you
can imagine this cause much confusion!
3.1
Å Obey module bug Ö öSpeak and I shall obey ... or maybe not.ò There
is a bug in the obey module supplied in the ROMS (v0.07). If an
environment variable is set to a string ending with the tilde character
(~) then the string will magically acquire a few extra characters, or
worse.
3.1
Using Edit, create a new obey file containing the command:
3.1
Set testvariable abcdef~
3.1
or similar, ensuring that the <return> key is pressed immediately after
the tilde (~). Save the file to a directory window and then double click
on the file icon to run the file. This will create the variable
ötestvariableò. Press <f12> to get a system prompt and type
3.1
Show testvariable
3.1
to display the variableæs value. It will show some-thing like
3.1
testvariable : abcdef~~&æ
3.1
i.e. it has acquired a few extra characters. (N.B. Iæve been unable to
repeat (see below) this so the characters may be wrong Ö but I do know
where they originate from so this is an educated guess)
3.1
Worse is that depending on the exact situation when the file is run an
öAbort on Data Transferò error may occur (!!) and the variable will not
have been created.
3.1
The problem is easily solved Ö donæt try and create a string ending with
~ in an obey file. If necessary a space can be placed after the tilde
(~) and this will be enough to prevent the error. Clifford Hoggarth
3.1
Å RAM disc size Ö To read the size of a RAM disc, not *configured but
set from within the desktop task manager you should use:
3.1
SYS öOS_ReadRAMFsLimitsò TO A,B
3.1
(B-A)/1024 gives the size of the the RAM disc in kbytes.
3.1
To check if a *configured ram disc exists then try:
3.1
SYS öOS_Byteò,161,144 To ,,ramdiscsize%
3.1
The variable ramdiscsize% indicates the number of RAM pages to be
allocated to the RAM disc e.g. 8k blocks for a 300 series.
3.1
Å Recursive directory copying Ö If you copy a directory into itself
(as Clive Payne did with his library directory in issue 2.11 p 15) the
computer will get into an infinite loop of copying directories inside of
themselves. To stop the computer from using all your disc space up, you
can press the escape key. The error can then be rectified by going into
the parent directory and deleting its children i.e. you donæt have to
reformat your disc!
3.1
Å ROM Speed Up Ö In several Archive issues (e.g. issue 2.11 p 8) we
have pointed out that the speed at which the Archimedes runs its ROMs
can be increased. Martyn Lovell advises us that this can cause RISC-OS
to crash and so is not very reliable.
3.1
Å Squish Ö I am very pleased with Mike Harrisonæs öSQUISHò program (on
Careware disc 2). It enables me to write meaningful, well laid out
programs and then to gain processing speed following compression.
Brilliant!
3.1
I have, however, discovered a bug. This occurs whenever you use a
statement such as:
3.1
IF a=b c=d
3.1
What actually happens is that it compresses to:
3.1
IF a=bc=d
3.1
The program then fails öUnknown or missing variableò. To circumvent
this, the full construct IF ... THEN ... should be used. B.R.Wilson,
Solihull
3.1
Å Uncluttering catalogues (2.11 p 13 cont) Ö If you close down an
application using the ADJUST button the filer will (re)open the viewer
containing the file you last accessed.
3.1
Å Using Sys$DateFormat (issue 2.12 p 19 cont) Ö Mark Taylor (along
with several others) has answered a question which appeared in last
monthæs Help!!! column.
3.1
The system variable Sys$DateFormat is only used by the SWI call
OS_ConvertStandardDate AndTime and not by the BASIC pseudo variable
TIME$ (see pp 400-402 of the old PRM for further details).
3.1
10 REM >$.Convert
3.1
20 REM a program to convert TIME &
3.1
DATE in to a string,
3.1
30 REM in the format of the system
3.1
variable Sys$DateFormat
3.1
40 :
3.1
50 REM some workspace for the time
3.1
& date SYS call
3.1
60 DIM block% 100
3.1
70 :
3.1
80 *Set Sys$DateFormat
3.1
%yr%mn%dy%24%mi%se
3.1
90 string$=FNtime_date
3.1
100 PRINT öThe time is
3.1
(YYMMDDHHMMSS) = ö;string$
3.1
110 END
3.1
120 :
3.1
130 DEFFNtime_date
3.1
140 REM first get 5 byte time code
3.1
150 REM using OS_Word &0E,3
3.1
160 SYS öOS_Wordò,&0E,3 TO r0,r1
3.1
170 :
3.1
180 REM get date & time string
3.1
190 SYS öOS_ConvertStandardDate
3.1
AndTimeö,block%,block%+50,49
3.1
TO r0,r1,r2
3.1
200 :
3.1
210 REM extract string from data
3.1
block
3.1
220 date$=öò
3.1
230 FOR x%=0 TO (12-r2)
3.1
240 data$+=CHR$(r0?x%)
3.1
250 NEXT x%
3.1
260 =date$
3.1
3.1
Å VIDC warning Ö Someone (Philip Green, I think) sent in a warning to
say that you should NEVER connect and disconnect video and monitor
connections with the computer switched on for fear of damaging the VIDC.
3.1
I have been doing just that for two years now on several different
Archimedes computers and have NEVER had any problems, so I wasnæt going
to bother printing the warning Ö it seemed a little over cautious. This
morning I connected up a brand new monitor, live as usual, and got a
funny picture. öDratò, says I, öItæs a DOA and will have to go back to
the distributor from whence it came!ò However, further fiddling and
switching of monitors (live) between computers revealed that the
computer was at fault Ö there were funny dark vertical lines down the
display and the sound was a bit croaky (sound comes through VIDC). This
is what you call learning the hard way or öPride comes before a fallò or
something. Anyway, donæt say we didnæt warn you! Ed.
3.1
Å Hints & Tips printing error, Archive 2.12 p 7. The IF statement at
line 750 is incorrect Ö a 7 has been cut off by the editor Ö Ékey% < 5æ
should read Ékey% <57æ.
Å *RMTidy and ADFS Ö If you perform a *RMTidy any discs will be
dismounted and any directory settings (*DIR) will be lost. This is
because this function re-initialises all the modules including the
FileCore%ADFS and ADFS modules.
3.2
Å Acorn DTP Ö if you want to import text that has a return at the end
of each line e.g. spooled BASIC programs, poetry, songs, etc then if you
import them directly Acorn DTP will ignore the returns and give you a
continuous block of text. There is a way around this problem:
3.2
1) In Acorn DTP define a new style say PROGRAM or SONG, etc
3.2
2) Set the space above parameter to 0
3.2
3) Load your text into !Edit
3.2
4) Select the find window of the !Edit menu i.e. press <f4>
3.2
5) Select the Émagic charactersæ option
3.2
6) Type: \x0A into the find box and /x0a/x0a in the replace box
3.2
7) Select the GO option and then select the Éreplace end of fileæ option
3.2
The effect is that each line is treated as a new paragraph with its
style defined as PROGRAM.
3.2
Å Alphabase RISC-OS compatible? I read Gerald Fittonæs tale of woe
(Archive 2.12 p43) just two days after encountering exactly the same
problem myself with Alphabase. The ÉReadmeæ file on the program disc
states that hard disc installation can be done in Éthe usual RISC-OS
manneræ rather that using the ÉInstallæ file. It seems to me that it
must be done in the former way! Apart from messing up the configure
settings as Gerald describes, ÉInstallæ fails to copy the !Alphabase
application directory to drive 4 (it canæt, since the *COPY command
issued at line 160 has no R option). Remedying this doesnæt help: the
program still crashes with a Écanæt findæ message when you attempt to
boot via the Library. After wasting many hours in debugging attempts, I
scrubbed the lot and simply copied !Alphabase to :4.$, whence the
program is run without problems by clicking on the desktop. Inciden
tally, again contrary to what is said on the ÉReadmeæ file, the floppy
disc stubbornly refused to boot on Shift-Break. Bill Templeton.
3.2
Å Archimedes Fans Ö Ray Maidstone of Norwich has been investigating
Archimedes fans (the cooling kind). He says that if you plug in any
extensions on to your Archimedes e.g. backplanes, RAM upgrades, etc then
you really should be using a fan. This keeps the temperature of the
Archimedes at an acceptable level, thereby extending the life of the
components.
3.2
Å Binary-Chop Ö Michael Sawle sent in this routine which can be used
for locating an item in an array Ö one of the beauties of this routine
being that it only needs enough characters to uniquely identify the
string being searched for. The routine requires data to be stored
alphabetically in a matrix M$(1),M$(2),...,M(NR%) where NR% is the
number of records currently stored. The routine returns the matrix
element number of the desired record (or nearest available).
3.2
DEFFNbinarychop(find$)
3.2
LOCAL A%,B%,R%
3.2
where=0 : A%=0 : B%=NR%
3.2
REPEAT
3.2
R%=INT((A%+B%)/2)
3.2
IF M$(R%)>find$ THEN
3.2
B%=R%
3.2
ELSE
3.2
IF M$(R%)<find$ THEN A%=R%
3.2
ELSE
3.2
where=R%
3.2
ENDIF
3.2
ENDIF
3.2
UNTIL where>0 OR B%-A%=1
3.2
IF where=0 THEN where=A%+1
3.2
=where
3.2
In fact this routine should be called a binary search routine. It chops
the list of records in two and then checks which half of the data set
the search string should appear. It then chops this half in two and so
on until finds the string or it realises the string does not exist. This
means that the computer can significantly reduce the number of checks it
has to make before reaching a result e.g. if you have 32768 (i.e. 2^15)
records then the computer will make a maximum of 15 checks. The price
that must be paid for this efficiency is that the data set must be
sorted in some recognisable order e.g. alphabetically, numerically,
ASCII, etc. The best versions of this technique are usually recursive.
(Perhaps someone might like to have a go at writing one?)
3.2
Å Colour TVæs as monitors Ö Several times in Hints & Tips, connection
of the Archimedes to colour TVæs has been mentioned. I have succeeded in
doing just this. In Archive 2.7 p11, Oliver Cornes says that plugging
the Archimedesæ SCART into a video recorder doesnæt work Ö this is
because a VCR only deals with composite signals, not RGB. However, if
your TV has a SCART socket, and many new ones do, then connection may
well be possible direct to the TV. You will have to tell the TV to use
RGB input, not the composite (it only uses composite then for timing).
There may be (indeed, it would be odd if there wasnæt) a way of doing
this with the TV controls. My TV has two sockets and if you tell it to
use socket 0 it uses socket one with RGB.
3.2
However, I didnæt find this out until I found out that one of the pins
on the SCART standard is for just this type of use Ö pin 16 must be
between +1V and +3V with respect to pin 18 (i.e. connect a 1.5V battery
between them Ö the Öve end to pin 18, the +ve end to pin 16). The TV
then automatically switches to SCART RGB input. Note that this overrides
any channel selection made, so you should put a switch in line so you
can switch the signal off, otherwise you canæt watch TV. Connection to
the SCART plug is often maligned as difficult, but it is only a case of
knowing how to do it. The proper way is to remove the pin you wish to
make connection to, connect it up and then put it back. The pins have
barbs to prevent them from falling out, so use a pair of narrow pliers
to squeeze the barb back and push the pin out through the rear of the
plug. Also make sure that you re-insert the pin the right way round Ö
just copy the other pins. They only go in properly one way round anyway.
Kevin Quinn
3.2
Å FileCore in use remedy Ö If the Archimedes Éseesæ too many ADFS
directories then a ÉFilecore in useæ error may occur and you will be
unable to save any data in your machine. You can overcome this by typing
the following four lines after the error has occurred:
3.2
*RmReInit FileCore (this will fail giving a Bad number error)
3.2
*RmReInit FileCore
3.2
*RmReInit ADFS
3.2
*RmReInit HardDisc (A300æs and A3000æs only)
3.2
Å MaxGammon update Ö The MaxGammon game on Careware 2 cannot be played
in mode 15. In order to over come this you should:
3.2
1) Load in the BASIC !RunImage file in the !MaxGammon directory.
3.2
2) Type the following:
3.2
10840colour%=FNmg_Colour(mg_red
3.2
_player%)
3.2
11230tc%=mgc_grey_point%
3.2
3) Save the program.
3.2
Å Oak MS-DOS SCSI as Drive D Ö I use the PC emulator occasionally for
my work. It therefore did not take very long to use up all 10M of the
MS-DOS drive C partition on my 47M SCSI drive. The obvious thing to do
would be to create another MS-DOS partition for drive D. However on the
version of the PC emulator that I am using (Emulate121) the Archimedes
hard discs 4 and 5 are mapped to MS-DOS discs C and D. Therefore drive C
and D cannot both exist on the same hard disc (on the emulator) and two
hard disc drives are required for two partitions.
3.2
On the OAK SCSIFS each winchester drive has the following information:-
3.2
a) filing system drive number (e.g. :4 or :5)
3.2
b) SCSI hardware address (each device on the SCSI bus has a unique
address)
3.2
c) logical unit number (SCSI Ésoftwareæ address)
3.2
If you are lucky enough to have an OAK SCSI (::SCSIDisk4) with an MS-DOS
partition (Drive _C) then hereæs how to create MS-DOS drive D.
3.2
1. Run ÉSCSIFormæ
3.2
2. Note that drive :4 is SCSI ID = 0, LUN = 0
3.2
3. Add drive 5 with SCSI with SCSI ID = 0, LUN = 0 (same as drive :4)
3.2
4. Exit SCSIForm and enter the desktop. There should be an additional
hard disc icon ÉSCSI 5æ
3.2
5. Start up the PC emulator (version 1.20 or greater?)
3.2
6. Type FDISK. An extra option should appear (5 Ö select next fixed disc
drive). Select this and the disc drive should now become number 2. Then
select option 1 ÉCreate DOS Partitionæ
3.2
7. Type Format D:
3.2
8. Type CHKDSK D: (this checks partition is OK)
3.2
9. When using the desktop always us SCSIFS::SCSIDisc4. Ignore disc 5
3.2
Ralph Barrett
3.2
(We have not had a chance to try this out yet, so you follow these
suggestions at your own peril. Ed)
3.2
Å Recursive directory move bug Ö one reader noted that while in the
desktop, if you moved a directory into itself (by holding the shift
button down while copying) the files in the directory will be moved
further and further down a directory tree until your whole disc has been
filled with directories! The problem with this bug is that you canæt
move your files back to their original position because the disc is
already full. You must copy the other files onto another disc and then
remove the offending directory.
3.2
Å To scroll or not to scroll? The strange behaviour mentioned in the
BASIC V Forum (Archive 3.1 p36) is actually caused by the *Configure
Scroll or *Configure NoScroll setting. This setting allows us to control
the behaviour of the ends of lines. *Configure Scroll should be used for
compatibility with earlier machines. The RISC-OS desktop, however, has a
habit of countermanding the configured values and in this case it
decides that it prefers NoScroll. If you have a program which relies on
the behaviour of the ends of lines, then you can execute VDU 23,16,&FE,1
|| to temporarily obtain the Scroll option, or VDU 23,16,&FE,0 || to
obtain NoScroll behaviour.
3.2
Å AutoCAD to !Draw conversion Ö The RISC-OS application !Draw can
accept input from a DXF (Drawing Interchange Format) file. These files
can be produced by packages such as ÉAutoSketchæ and ÉAutoCADæ. To get a
file from a IBM PC running the ÉAutoCADæ package to !Draw the following
procedure should be used.
On the IBM PC:
1. Do a ÉDXFOUTæ command from within Auto-CAD to output the current
file in DXF format.
2. This file should be copied to a IBM format 5.25ö or 3.5ò disc.
On the Archimedes:
3. Start the PC emulator on the Archimedes.
3.3
4. Perform a Éputfile MS_DOS_Name.dxf ADFS_Nameæ from within the
emulator to transfer the file from MS-DOS to RISC-OS.
3.3
5. From within RISC-OS set the file type of your file to &DEA
(*SETTYPE ADFSName DEA).
3.3
6. Start !Draw and drag the DXF file to its icon or into a !Draw
window.
3.3
!Draw will ask you a question about the Éunitsæ (scale) before redrawing
the image in the window. This may require some thought to get the
required effect. !Draw appears to get confused with some entries in DXF
files and refuse to load the file. Deleting the text in the original
picture may cure the problem. AutoSketch on the Archimedes can also
produce DXF type files for input into !Draw.
3.3
Å ÉCæ Operating System calls (contæd) Ö The following example program
shows how system commands can be invoked from a C-program. It was tested
under Acorn ANSI C version 2. The use of the function Ésystemæ is part
of the proposed ANSI standard for C, although its exact implement-ation
is left up to the individual versions of C. The Acorn ÉANSI Cæ library
function Ésystemæ returns a zero value if the command executes success
fully and non-zero if it fails. Problems will occur if the command being
executed over-writes the C-prog-ram (for example if the command starts
up a second C-program), but in the example both commands are Ébuilt-inæ
and therefore do not overwrite the invok-ing program. In theory, the
*RMLoad command fails if there is not enough RMA, but in testing the
example, it worked even when the free RMA was configured to 0k.
3.3
/* > c.systest */
3.3
#include <stdlib.h> /* General
3.3
utilities */
3.3
#include <stdio.h> /* Input/output
3.3
*/
3.3
int main ()
3.3
{3 .3
static char rmload[]=örmload
3.3
system:modules.memallocö;
3.3
static char screensave[]=
3.3
öscreensave screenfileò;
3.3
int result1,result2;
3.3
result1=system(rmload);
3.3
result2=system(screensave);
3.3
printf(öResult1=%d, Result2=%d\nò
3.3
,result1,result2);
3.3
return(0);
3.3
}
3.3
Å Dead modules Ö If you install a module which claims a vector and
then press the reset button, something very strange happens when you
want to *RMKill the module. Because the vector canæt be released, the
module isnæt killed properly. To let you know about this, RISC-OS puts
the dummy address DEADDEAD where you would expect the workspace address:
3.3
*rmkill printkill
3.3
Bad vector release
3.3
*modules
3.3
No Position Workspace Name
3.3
1 0380873C 00000000 UtilityModule
3.3
2 0381FB94 01800014 FileSwitch
3.3
...
3.3
27 0387EA48 00000000 SpriteUtils
3.3
28 01813BC4 DEADDEAD PrintKey
3.3
etc
3.3
Å Definitive modem connections? The following connections work with
ArcTerm601, Hearsay and the Archive BBS for the WS3000 and SM2400
modems:
3.3
Arc RX (2) to Modem TX (3)
3.3
Arc TX (3) to Modem RX (2)
3.3
Arc GND (5) to Modem GND (7, not 1)
3.3
Arc RI (9) to Modem DCD (8)
3.3
Arc CTS (8), DCD (1), and DTR(4) to Modem DTR (20)
3.3
Arc RTS (7) to Modem RTS (4)
3.3
Arc DSR (6) to Modem CTS (5)
3.3
Å Digitisers? Who needs one, anyway ? We recently faced the problem of
how to get the company logo into a DRAW file, and came up with a
solution which may be useful to other people. It is most applicable to
images bounded largely by straight lines.
3.3
First take the image and enlarge it repeatedly using a photocopier until
it fills more than a third of the screen of the monitor you are using.
Then make one more enlargement, onto the transparent acetate sheets used
for overhead projector foils. If you do not have a copier you will find
most high street copier services can do all this for you, probably for
less than a pound. Our copier will enlarge to 145% at a time.
3.3
Now cut out the piece of acetate showing the image, and put it on your
monitor screen. You will find it sticks most satisfyingly. Enter DRAW
and register the coordinates of the corners of the image. You may want
to have a grid on the screen to ensure you line up the acetate image
with the edges of the screen. You can also check alignment by reading
the coordinates of points which should be the same distance from an edge
of the screen and adjusting them as necessary.
3.3
We found this was much easier than transcribing even simple shapes by
eye, as it was hard to get the proportions right that way. It was also
much quicker than drawing a grid and transcribing coordinates from that.
Laurie van Someren, Aleph One Ltd
3.3
Å Interdictor Flight Recorder! Ö It is possible to fly the plane on
your own, run or even record a demo flight. This can be done by altering
the !Run file in the !Interdictor directory. On the bottom line of this
directory is the Éflyæ command. Its permutations are as follows:
3.3
fly (just fly the plane as usual)
3.3
fly playback <filename> (replay a demo flight from a file)
3.3
fly record <filename> (record the flight to a file)
3.3
If you want an example of how this works, you can look at the !RunDemo
file in the Interdictor direct-ory. This file runs the demo file call
DemoFlight.
3.3
Å Low Batteries? One reader noticed that after 15 months, his
Archimedesæ configuration settings began to change inexplicably e.g. the
loss of all disc drive icons in the desktop. Eventually, after various
problems (e.g. the Beebug Serial Link buffer setting kept changing) the
whole system finally froze. However, the problem was fully resolved by
replac-ing the batteries. So be warned. (Acorn recommend replacement
every 12 months.)
3.3
Å MS-DOS Hard Disc Partitions Ö The easiest way of getting two hard
disc partitions for the PC Emulator is to get version 1.33, which can be
downloaded from the Archive BBS or SID. Alternatively send us a donation
to our charity pot along with an 800k formatted 3.5ö disc.
3.3
Å Multi-tasking First Word Plus? If you rename the !Run file in the
!1stWord+ directory to !Boot then First Word Plus becomes multitasking.
Unfortunately, you cannot reach the disc, palette or task icons.
3.3
Å Noisy Fans 1 Ö If you have a fan in your Archim-edes, you should not
disconnect it. The reason for this is that the fan will then be blocking
up the air vent and so the computeræs PSU will operate at too high a
temperature. If you want to reduce the noise of the fan, you should
either completely remove the fan or refer to the following hint.
3.3
Å Noisy Fans 2 Ö I have looked at the physical design of the Archi
medes PSU and done a few temperature measurements and it is my belief
that you ought to have a fan fitted and working. So, what can you do to
reduce the annoying noise of the fans? Well, we have several Archimidi
here and the noise drove us to distraction so, being hardware oriented,
I looked at the infernal (sic) fan. Yes, I have found a way of shutting
it up, but before you get too excited, allow me to explain a little
more.
3.3
These fans are most certainly not your average Scalectrix car 12volt
motor with a set of plastic blades stuck on the front! In fact, we
couldnæt have wished for a better headache Ö these fans (of which weæve
even found two different manufacturers so far) consist of a transistor
circuit driving a coil assembly that is alternately fluxing a permanent
magnet within the plastic rotor. At the same time, the rotor is having
its rotational speed monitored by a hall effect switch, busily counting
the revolutions! How are we going to slow that down? The answer we came
up with was a small transistor circuit of our own that takes the 12v
D.C. input and feeds to the fan a suitably pulsed supply that allows the
fan to start but not reach full speed. Cunning, eh?!
3.3
Yes, we had to make two slightly different versions of our circuit, as
the fans were not the same electrically. Weæll let you know how they get
on as weære still testing them, but there no problems so far. Ray
Maidstone.
3.3
If you want more technical info, drop Ray a line via the Archive office.
Ed.
3.3
Å Presenter II Stacked Bar option Ö If one of the data sets (columns)
contains several NULL (0 or zero) entries then on the display, some of
the stack-ed bar may be displaced vertically downwards. This is easily
corrected by replacing the NULL entry with a very small value. E.g., if
the data maximum is 100 then a value of 0.1 or 0.05 will do the trick.
3.3
Å Second floppy disk drive Ö If you want a second disc drive and donæt
need the a new front fascia for two drives, you can install an NEC 1036A
into the Archimedes, which can be obtained for around ú50.
3.3
You will also need to buy some ribbon cable, power leads and extra plugs
for the leads. Donæt forget to set the drive to operate as drive 1 and
to *Configure Floppies 2 on the Archimedes.
3.3
Å 80k of RMA and rising! RMA stands for Relocatable Module Area. In
English, this is the area of memory which some parts of the operating
system (modules) use as work space. This is why when you first
initialise your computer you will find that your RMA takes over 80k of
memory. For those of you who are curious, here is a guide to the memory
each module claims on power up:
3.04
Module Workspace (bytes)
3.04
FileSwitch 2400
3.04
Desktop 528
3.04
SystemDevices 288
3.04
BBCEconet 80
3.04
InternationalKeyboard 528
3.04
Debugger 448
3.04
SoundChannels 8464
3.04
Sound Scheduler 8208
3.04
WaveSynth 1760
3.04
StringLib 8576
3.04
Perussion 8800
3.04
SpriteExtend 1296
3.04
Draw 272
3.04
FontManager 2832
3.04
WindowManager 7920
3.04
NetStatus 16
3.04
Podule 208
3.04
ADFS 656
3.04
FileCore%ADFS 12,464
3.04
HourGlass 1952
3.04
TaskManager 3760
3.04
PaletteUtil 3632
3.04
Filer 4993
3.04
ADFSFiler 2336
3.04
ShellCLI 1872
3.04
Total 84308
3.04
RMA is also used to contain WIMP sprites (especially application icons
stored in their !Sprite files) and relocatable modules, which add extra
facilities to the ROM based operating system e.g. 65Tube provides BBC
emulation. This means that as the Archimedes Éseesæ and loads more
applications/modules the memory acquired by the RMA grows and can quite
easily reach 300k plus!
3.04
Since there are several uses for the RMA, there are several ways of
reducing the memory it requires:
3.04
a) Remove individual modules using the *RMKill command e.g. *RMKill
Percussion Ö this will only temporarily remove the facilities provided
by a module.
3.04
b) Unplug unwanted modules using the *RMUnplug command e.g. *RMUnplug
BBCEconet Ö this will permanently remove the facilities provided by an
operating system ROM module Ö so if you donæt have Econet or donæt use
the Debugger then you can unplug the relevant modules and release their
workspace. Note, you can reinvoke the facilities of a module by using
the *RMReInit command.
3.04
c) Use the following BASIC V program to clear the RMA sprite area:
3.04
program segment missing
3.04
d) If you have finished processing and saved all your work you could
press <ctrl-break> but this is rather drastic.
3.04
Å ArcTerm update Ö Hugo Fiennes has updated ArcTerm v6.01 so that it
works properly with the CET and CET+ standards. An upgrade can be
obtained direct from Hugo Fiennes free of charge.
3.04
Å Arthur desktop Ö If any of you have changed over to RISC-OS but are
pining for the old Arthur desktop (!) then see if you can get hold of a
copy of Brainsoftæs Disk Transfer program. This provides a modified ram
copy of the desktop with extra features added. You will then be able to
access your old desktop diaries, etc. Dave Woods.
3.04
Å ASCII BASIC programs Ö BASIC V can load and renumber an untokenised
text file with the *BASIC -load <filename> command (the same applies
with the -chain option). Thus you donæt really need a BASIC to ASCII
convertor; you could just keep all your BASIC programs in ASCII, at
least while you develop them, and still be able to edit them using a
text editor, e.g. TWIN or !Edit.
3.04
Å Auto-booting applications Ö If you want a RISC-OS application to load
or run as soon as the disc is inserted then you should modify the !Boot
file in the application to execute the !Run file i.e. add the command
*Run <Obey$Dir>.!Run in the !Boot file. This technique could be used,
for example, to automatically load the BASIC Editor when a development
disc is inserted.
3.04
Å Break key action Ö You can set the action of the <break> key using the
*FX 247,<n> command. The value byte <n> alters <break> and modifiers of
it as follows:
3.04
Bits Key Combination
3.04
0.1 <break>
3.04
2.3 <shift-break>
3.04
4.5 <ctrl-break>
3.04
6.7 <ctrl-shift-break>
3.04
Each two bit number may take on one of these values:
3.04
Value Effect
3.04
00 Act as <reset> key
3.04
01 Act as <escape> key
3.04
10 No effect
3.04
11 Undefined
3.04
The default is *FX 247,1 which makes <break> act as if it were <escape>
and all other combinations cause a reset.
3.04
Å Desktop grey scale? If you modify colours 0 or 7 (white or black)
using the desktop palette utility then the palette application will
attempt to interpolate the colours in between i.e. colours 1-6. Try it
and see!
3.04
Å Donæt move your mouse! Whilst waiting for a program to complete a
lengthy process (e.g. when the hourglass is on) it is best not to move
the mouse as keeping track of the mouse movements takes up processor
time.
3.04
Å Faster BASIC SWIæs Ö When using the SYS command within a BASIC V
program, it is quicker to use a number instead of a string. e.g. SYS6
instead of SYS öOS_Byteò. However, the best way to obtain the number
values is to use a BASIC variable and öOS_SWINumberFromStringò. This
increases speed while maintaining machine independence and readability.
For example:
3.04
program segment missing
3.04
Å Insert/overwrite with !Edit Ö It is possible to toggle between insert
and overwrite mode in Edit by pressing <shift-f1>.
3.04
Å Mouse step Ö you can set the sensitivity of your mouse by using the
BASIC V MOUSE STEP command e.g. MOUSE STEP 4 means that the pointer will
move 4 O.S. pixels for every mouse pulse. The Ésensitivity parameteræ
can take a zero or even a negative value, so that you can freeze the
mouse or even invert it!
3.04
Å Multiple entry PROCæs and FNs Ö You can have multiple entries to
procedures and functions, although it may not be good programming style.
This is because lines beginning with DEF are not executed, so you can
have further DEFs within the body of a procedure/function, and enter at
these points with an appropriate call Ö this might be particularly
useful to have a first entry, set up some default parameters, and then
have entry to override them:
3.04
program segment missing
3.04
Å O.S. case sensitivity Ö Contrary to what has been said in the past,
the operating system is almost entirely case-insensitive, unlike BASIC,
and although the case of filenames and variable names is preserved it is
not significant. Quotes are also generally unnecessary except when
including a space in a parameter.
3.04
Å Removing recursive directories (contæd) Ö If you accidentally copy a
directory into itself then the best way to tidy the disc up is to create
a RAM disc and move the unwanted files into it (you can move a file by
dragging it into the filer window while holding the <shift> button
down).
3.04
Å Time for function keys Ö Function key strings are just treated as OS
variables called Key$<n>, where <n> is the key number. This means that
all the commands relate to system variables can be used with function
keys e.g. *ShowKey$ will display key definitions. *SetMacro Key$0
<Sys$Time> will make <f0> display the time and so on.
3.04
Å Using *GOS Ö You can use the *GOS command from the desktop to prevent
returning if you accidentally hit the <return> key. Once you have
finished typing your *commands you can use the ÅQuit command to go back
to the desktop.
3.04
Å Window resizing bugs/errors Ö The bug in Interactive help Archive
2.11 page 8 is not a bug but a result of !Help setting a window work
area extent in less than a multiple of four. The program is in C so I
canæt edit it. I discovered this when writing my own software. When a
window was stretched to its full extent it would not grow smaller in the
y direction until you moved in to the left. R.D.
Å *WIPE with mouse Ö In BASIC, (or at the operating system prompt for
that matter. Ed.) if you have the pointer ON (*POINTER) and do *WIPE *,
a mouse pointer appears enabling you to use <se-lect> to delete the file
and <menu> or <adjust> to keep the file.
3.5
Å Alerion cheat Ö For those who have the RISC-OS version of Alerion,
you can select the wave you wish to play by pressing the letters <A> to
<O> while on the title screen.
3.5
Å BASIC Editor bugs Ö There is a bug or two in the Basic Editor v1.00
that comes on the Applications Disc 2. If you exactly fill the first
line so that the cursor jumps to the next line, and then press return,
the screen looks something like this:
3.5
10 REM This is meant to be right over to the edge
3.5
11 C
3.5
20 xxxxxxxxxxxx
3.5
30 xxxx
3.5
If you then press the <page down> key, the comp-uter will freeze.
3.5
Another bug, whose circumstances cannot be so readily repeated, occurs
when pressing the <cursor down> key causing the program to shoot off the
top of the screen, and nothing will bring it back again.
3.5
Both of these are Émildæ bugs because pressing <reset> followed by
typing *BASIC and OLD and EDIT restores everything back to it original
state.
3.5
Å BASIC first please Ö If you want your computer to start up in BASIC
instead of the desktop, use *CON. LAN. 4 and then do a <ctrl-break>.
This also means that the full computer memory is available to your
program. If you go to BASIC with <f12> to get a star command and then
typing BASIC, you only get the memory available that has been allocated
to the next application under the task display (651516 bytes). The
reason for this is that BASIC is being run as the next task within the
desktop environment. This can be seen by typing QUIT which will drop you
back into the desktop with everything as it was before.
3.5
The other way to get the full memory available is to press <shift-ctrl-
f12> which will drop you out of the desktop completely, closing all
tasks. This drops you into the operating system, so typing BASIC and
then QUIT brings you back to the operating system prompt, not into the
desktop.
3.5
(This is one of those things which, according to Adrian is öobviousò,
but to those of us who never reads manuals, it is news! So, the next
time you discover something which someone else thinks is öobviousò, send
it in to us as an H&T. Ed.)
3.5
Å CTRLing VDU scrolling Ö You can use the <scroll lock> key on the
Archimedes to stop the computer printing (either to the screen or
printer). Another method of doing this is to hold down the <shift> and
<ctrl> keys. However, if you just hold the <ctrl> key down then you can
slow down the speed of printing to about a 20th of it original speed.
3.5
Å Database routine Ö If youæve written a database in BASIC e.g. an
address book, it can be difficult to find a name unless you stick to a
format where all entries are in upper case, or lower case apart from the
initial letters. This little routine which uses 104 bytes is the
solution. As well as accepting upper or lower case it also will accept
the character ö#ò as a single character wildcard .
3.5
It is identical to the BASIC command.
3.5
INSTR(string,substring,start of search)
3.5
Except the variables A%, $B% and $C% are declared before X=USR(code) is
called, i.e.
3.5
$B%=ömain stringò
3.5
$C%=ösubstringò
3.5
A%=start of search
3.5
X=USR(code)
3.5
There is an example program with the listing.
3.5
160 DEFPROCass
3.5
170 FORopt=0TO3 STEP3
3.5
180 P%=code
3.5
190 [ OPT opt
3.5
200 STMFD R13!,{r1-r12 ,R14} ;store
3.5
registers. not R0
3.5
210 MOV R5,R0 ;start of search
3.5
220 MOV R0,#0 ;reset R0 (A%) for
3.5
return
3.5
230 LDRB R7,[R2,#0] ;load R7 with
3.5
first byte of $C%
3.5
240 CMP R7,#13 ;is it a CR?
3.5
250 BEQ end ;i.e. null sub-
3.5
string. exit to BASIC
3.5
260
3.5
270 .nomatch
3.5
280 MOV R4,#0 ;initialise counters
3.5
290 MOV R3,#0
3.5
300 .nextchar
3.5
310 LDRB R6,[R1,R5] ;get byte of
3.5
string
3.5
320 CMP R6,#13 ;is it CR ie end
3.5
of string
3.5
330 BEQ end ;if yes, substring
3.5
not found. exit
3.5
340 AND R6,R6,#95 ;AND to ignore
3.5
case
3.5
350 LDRB R7,[R2,R4] ;first byte of
3.5
substring
3.5
360 CMP R7,#13 ;is it a CR?
3.5
370 SUBEQ R0,R5,R3 ;yes i.e. end
3.5
of substring
3.5
380 ;R5-R3 gives
3.5
position in string
3.5
390 ADDEQ R0,R0,#1 ;plus 1. First
3.5
char=0
3.5
400 BEQ end ; and exit
3.5
410
3.5
420 AND R7,R7,#95 ;AND to ignore
3.5
case
3.5
430 ADD R5,R5,#1 ;increment
3.5
counters for next chars
3.5
440 ADD R4,R4,#1
3.5
450 CMP R7,#3 ;is it a hash?
3.5
If so make equal
3.5
460 MOVEQ R6,R7
3.5
470 CMP R6,R7 ;ARE bytes equal
3.5
480 ADDEQ R3,R3,#1 ;yes Ö get next
3.5
sub string char
3.5
490 BEQ nextchar
3.5
500 BNE nomatch ;no try next
3.5
string char
3.5
510 .end
3.5
520 LDMFD R13!,{r1-r12 ,R15};restore
3.5
registers. R0 has INSTR
3.5
530 ]
3.5
540 NEXT
3.5
550 ENDPROC
3.5
Å Disappearing menus Ö After selecting an option on a menu, the menu
disappears. To prevent this: instead of using <select> to select option,
use <adjust>, and the menu will then stay on the screen.
3.5
Å Drawing with Outline fonts - If you possess Acorn DTP, you can use
the !FontEd public domain program to create !Draw paths of the
individual letters. This is done by dragging the character in the main
!FontEd window into the !Draw document window. Once transferred, the
letter can be manip-ulated just like any other drawing e.g. rotated,
stret-ched, filled, etc. With a little patience, some very effective
titles can be created.
3.5
Å DTP memory Ö A couple of hints to give extra memory when using Acorn
DTP with a 1M machine: load the printer driver first and then quit
before entering DTP. Only the modules are used for printing, which are
left installed after you quit. Secondly, the use of screen mode 1 uses
only 24k of memory and since it is a four colour mode, it gives a better
grey scale than Mode 0.
3.5
Å E-Type bug Ö There is a bug in ÉAll Tracksæ option of E-Type. If you
press hard on the brakes when the time reaches 0:01 the program
sometimes goes bonkers and when you are placed on the new track, your
Trip Score increases.
3.5
Å External ST506 drives Ö If you add an external hard drive to an old
440 or 310, you may find that the whole system dies completely for no
apparent reason. The problem is that if the external drive is powered up
before the computer, a small voltage can be produced within the computer
so when the power suplly on the computer tries to power up, it sees this
voltage, panics and shuts down again! The simple solution is to power up
the computer first and then the external drive.
3.5
When switching off, work on the ölast in, first outò principle and
switch off the drive first. This is good practice since, if the drive is
left switched on, as the computer powers down, extraneous signals on the
driveæs data and control lines could conceivably be interpreted as
something nasty like, ö Please wipe track 0, sector 0ò and you end up
with a öBad Free Space Mapò! (Iæm sure that is Somebodyæs Law.)
3.5
Å Interdictor Cheat Ö It is possible to alter your landing pad in
Interdictor. Edit StateSave via !Edit. Go down to the 10th number and
alter it. Note that Landing pad 2 is actually Landing pad 1 and so alter
the 10th number to a 1 and so on. Also note that there are 7 runways,
the 7th being known as the number 6. This might sound confusing but
really itæs not!
3.5
Å Large hard drives on A410/1? Ö Someone asked us to find out whether
it was possible to put hard drives with more than 8 heads onto an A410/
1. All we have been able to find out is that, to get the extra head
select line, you need to change links LK12 and LK13. Whether the
software will cope, we do not know. If anyone has any success with it,
perhaps they would let us know.
3.5
Å Virus protection Ö If you are passing discs around, especially PD
discs, guard yourself against the virus. When you receive or pass on a
disc, you run the risk of your machine picking or up a virus or logic
bomb.
3.5
Passing on files: Format an unused disc and copy only the files you wish
to send. Alternatively, wipe the disc (*Wipe * FR~C), copy the files and
run my disc wiping program (see below). This is needed because deleting
a file does not erase the data on the disc; it just causes the computer
to forget about it. The data can be retrieved by anyone with a disc
sector editor, so run the program if you want to thoroughly scrub the
unused parts of the disc.
3.5
Receiving files: Copy across only those files which you need. Try not to
use the desktop as some logic bombs can sit in an applicationæs !Boot
file and spring out at you when you open their directory viewer.* After
copying, the original disc should be cleared by reformatting.
3.5
10 REM >Eradicate
3.5
20 REM Guards against the Virus and
3.5
accidental giveaways of data
3.5
30 REM Erases totally the unused parts
3.5
of a disc
3.5
40 REM PUBLIC DOMAIN by Sandie Goh
3.5
50 REM Version 1.21 (20-Sep-1989)
3.5
60 :
3.5
70 MODE 3:OFF:DIM blankspace 409600
3.5
80 PRINTöDisc Eradicatorò
3.5
90 PRINTö===============òÉ
3.5
100 PRINTöPUBLIC DOMAIN by Sandie Goh,
3.5
Version 1.21 (20-Sep-1989)öÉ
3.5
110 PRINTöErases totally the unused
3.5
parts of a disc.ö
3.5
120 PRINTöHELPS guard against viruses,
3.5
logic bombs etc.öÉ
3.5
130 PRINTöInsert disc to be cleaned in
3.5
drive 0 and press a key.öÉ
3.5
140 *FX 15,1
3.5
150 IF GET
3.5
160 PRINTöCompacting, to collect free
3.5
space into a single block.ö
3.5
170 REPEAT
3.5
180 *COMPACT 0
3.5
190 SYSöADFS_FreeSpaceò,ö0ò TO total,
3.5
biggest
3.5
200 UNTIL biggest=total
3.5
210 PRINTöSaving dummy files into the
3.5
free space to wipe anything there.ö
3.5
220 REM Use unlikely filenames to avoid
3.5
clashes
3.5
230 IF biggest>409600 THEN
3.5
240 OSCLI (öSAVE ZZDelONN12 ò+STR$~
3.5
blankspace+ö +64000ò)
3.5
250 biggest=biggest-409600
3.5
260 ENDIF
3.5
270 OSCLI (öSAVE XXDelONN12 ò+STR$~
3.5
blankspace+ö +ò+STR$~biggest)
3.5
280 PRINTöDeleting the dummy files to
3.5
release the space.öÉ
3.5
290 *REMOVE ZZDelONN12
3.5
300 *DELETE XXDelONN12
3.5
310 PRINTöI now pronounce this disc
3.5
clean.ö
3.5
*If you donæt believe me, I was myself the victim of a booby-trapped
disc. After mounting a disc I picked up from a friend, I copied its
contents across to my hard disc, only to find that it (the winchester)
was now blank! Believing the problem to be a bug in the desktop or
chance disc failure, I restored the hard disc and tried again Ö the same
thing happened again, but this time when I did a *Compact 4.
3.5
I tried everything and was just about to give up and complain to Acorn
when a friend phoned me with the same problem. It turns out that he too
had a copy of the disc I had picked up and I immediately became
suspicious. Further research showed that the disc contained an invisible
program which sat in the machine waiting for an opportune moment, then
zapped the Winchester with a *Wipe :4.* FR~C.
3.5
The subtlety of the program makes it even more deadly Ö the öerrorò
occurs when you write to the hard disc using the desktop, so you are
lead to think (as I was) that a bug or disc error is responsible. So be
warned. Guard against the virus.
3.5
Å !chars Ö which is available as !1stchars with FWPlus version 2 and
is also available on SID + Archive BBS + various PD discs, can be used
for ömousingò text into !Draw applications.
3.6
Å !Draw Ö You can use the cursor keys for fine positioning when
drawing Bezier curves or lines.
3.6
Å !Madness Ö I was always very disappointed with this Demo Ö until I
looked at the !RunImage file and found a variable called madspeed% Ö
guess what changing it to 1 does? Rob Davison
3.6
Å !system on floppies Ö Those of you without hard discs will have
!system on various of your floppies. The trouble is that when you change
to other discs, even if they have !system on them, you will be asked to
insert the disc containing !system that the com-puter saw first of all.
To get round this, double click on !system on the current disc before
trying to launch applications from the disc.
3.6
Å Art Nouveau Ö Fills approximating to graduated, logarithmic,
circular etc can easily be Édesignedæ and saved to disc. For example:
3.6
Approx circle fill Ö Set a small grid size and switch it on. Draw
several concentric filled circles, selecting each shade as you go. Smear
the edges with Écolour mergeæ if you donæt want the bands of colour to
show. Pick it up as a brush and use with: brush, effects1, distort x (or
y). Some of the effect that Pro-Artisan and Atelier have as features can
be cobbled together with a little effort using Art Nouveau (at half the
price!). D P Allen.
3.6
Å Beware the SUM! Ö If you rely on indentation in your programs to
keep a check on the structure of the various loops, beware that SUM(A())
will cause an extra indent. Is there any way round this? Fred Hartley,
Hayes.
3.6
Å Booting Ö When booting the Archimedes up it is tempting to just
refer to applications assuming their path starts at the root ($). e.g.
!Edit Ö can be installed on the desktop using just !Edit in a boot file.
3.6
However, this will not ensure the appropriate system variable is set up
with the full pathname. Again using !Edit as example, you would get just
Ö Edit$Dir = !Edit
3.6
To avoid this put the full name in the desktop boot file, e.g.
3.6
*Run adfs:HardDisc.$.!Edit
3.6
Only of much use if, like me, you decide to set the directory yourself
while using Desktop (despite what Acorn advise!). Ian Pollock
3.6
Å Graph-Box Ö superb program but I find it very annoying that it
Édiesæ when you close the window. The following changes will give
Graphbox an icon on the iconbar. It will only Édieæ when you click
<menu> followed by Équitæ as Edit and Draw etc. This lets you clear some
valuable desktop space to write a letter or whatever. while still having
Graphbox available on the icon bar.
3.6
*BASIC
3.6
LOAD ö!GraphBox.!RunImageò
3.6
220 WHEN 3:PROCclosew(!q%):IF!q%=
3.6
w_graphbox% THEN mainclosed%=TRUE
3.6
560 quit%=FALSE:mainclosed%=FALSE
3.6
4590 WHEN0:PROCclosew(w_graphbox%)
3.6
:quit%=TRUE
3.6
5291 Icon%=sprites%:!Icon%=TRUE:
3.6
DIM Spritename% 14:$Spritename%=
3.6
ö!graphboxò:Icon%!4=0:Icon%!8=0:
3.6
Icon%!12=64:Icon%!16=68:Icon%!20=
3.6
(&311A OR (7<<28))
3.6
5292 Icon%!24=Spritename%:Icon%!28=1:
3.6
Icon%!32=12:SYS öWimp_CreateIconò
3.6
,,Icon% TO graph_iconbar%
3.6
5445 READ t$:m_iconbar%=FNcrmenu(t$)
3.6
5447 DATA ö#Graphbox,Info>w_pinfo%,
3.6
Quitö
3.6
5710 REM quit%=TRUE
3.6
6395 IF mh%=-2 AND mb%=4 OR mb%=1024
3.6
AND mi%=graph_icnbar% THEN PROCgetw
3.6
(w_graphbox%):PROCfront(w_graphbox%
3.6
,420,150):mainclosed%=FALSE
3.6
7375 WHEN-2:IFmi%=graph_icnbar% THEN
3.6
PROCpop(m_iconbar%,-1)
3.6
8219 IF menu%=m_iconbar% my%+=64
3.6
8545 WHEN m_iconbar%:IF !mlist%=1
3.6
THEN quit%=TRUE
3.6
16505 IFmainclosed%=TRUE PROCfront
3.6
(w_graphbox%,420,150):
3.6
mainclosed%=FALSE
3.6
SAVE ö!GraphBox.!RunImageò
3.6
NOTE: Graphbox claims what you have in your next slot up to a max of
640k but as the program needs only a minimum of around 200k to run,
thereæs space for a very big graph! Before loading Graphbox, drag the
Énextæ slot down to about 330k to free some more space. You can edit the
!run file and change the -max to reconfigure it more permanently. Rob
Davison
3.6
Å Installing Alerion Ö Here are the steps you must take in order to
install RISC-OS Alerion onto your hard disc:
3.6
(i) create a RAM disc with at least 432k
3.6
(ii) copy the !Alerion directory into the RAM disc
3.6
(iii) alter the RAM disc !Boot file in the !Alerion directory so that it
reads:
3.6
IconSprites <Obey$Dir>.!Sprites
3.6
(iv) also alter the !Run file so that reads:
3.6
Set Alerion$Dir <Obey$Dir>
3.6
RMClear
3.6
RMLoad MemAlloc
3.6
RMSize 320k
3.6
ScreenSize 160k
3.6
RMKill MemAlloc
3.6
Run <Alerion$Dir>.!RunImage
3.6
(v) copy the !Alerion directory from the RAM disc to your hard disc.
3.6
Å Rounding Errors Ö Try typing P.STR$(0.6) in BASIC. If you are
putting the string of a variable into a writeable menu option when
programming a wimp system and this rounding error comes up, the
resulting string can overwrite some of the data structure for your menu.
The result is often an öAbort on data transferò! This can be quite hard
to track down so be careful. DIMming the block to 5 bytes will stop a
crash but will leave the user with a 0.6666666669 to edit instead of
0.6. This can be a bit disconcerting. To solve it, set @% to round to
e.g. 2 decimal places before doing the STR$ and reset @% afterwards Ö
see 400 series BASIC Guide pp277-278 for details. Rob Davison
3.6
Å Screen modes & memory claiming Ö If your program has a proper RISC-
OS front end, it can change modes without worrying about screen memory.
If there is enough in Éfreeæ and Énextæ it will be shunted to screen
memory and the mode selected. Rob Davison
3.6
Å Synthesiser MIDI modes Ö The answer to Gerald Fittonæs problem
(issue 2.12 p 18) that his Korg synthesiser plays all channels no matter
what he does, is that his synthesiser is not in the correct MIDI mode.
3.6
All MIDI devices operate under modes. These are as below:
3.6
MIDI mode 1: OMNI On/Poly
3.6
MIDI mode 2: OMNI On/Mono
3.6
MIDI mode 3: OMNI Off/Poly
3.6
MIDI mode 4: OMNI Off/Mono
3.6
OMNI On/Off selects whether the device receives on all MIDI channels
(OMNI On) or only on one MIDI channel (OMNI Off). Poly means that the
device will be able to play two or more notes at the same time and Mono
means that it will only be able to play one at a time. The Korg will
almost certainly be in MIDI mode 1, which is how most synthesisers are
set up when they are sent from the shop. The answer is to change the
MIDI mode to 3 or 4 and to set the Korg to receive on the same MIDI
channel as Maestro is sending.
3.6
Å Wimp Resizing Ö I have written a program which needs a large area of
memory as store for data. The program works in the desktop and claims
memory via SYS öWimp_SlotSizeò. Initially, I used the BASIC statement
öEND=HIMEM + value%ò but this also changes the address of HIMEM. Loops,
procedures and local variables are stored just below HIMEM so my data
was being overwritten. I tried lowering HIMEM immediately afterwards but
things still went wrong so I use öWimp_SlotSizeò directly. BASIC is
ignorant of the new memory area and it can therefore be safely used as a
store. Use a variable öClaimer%æ and exit the Wimp_Poll loop if itæs not
zero then call Wimp_SlotSize. R.D.
3.6
Å !Draw Ö I used to find it difficult to get to grips with !Draw
because I couldnæt visualise the final layout. However, if you use the
Énew viewæ option together with Ézoomæ you can get a WYSIWYG view. Not
only this, but it is possible to manipulate the major view from the
minor view. L Kennedy.
Å Acorn DTP Ö This may seem obvious but I only just figured it out!
When printing documents from Acorn DTP, I found that footers (in
particular) wouldnæt print. I spent ages looking through the DTP manual
trying to figure out why. I suddenly occurred to me that it might be the
printer driver and sure enough, it was. The page size for A4 paper has
margins set all round, in particular a bottom margin of 20 mm is set,
and it is this which is Éclippingæ out the footers. Set this to 0 (say)
and the problem is solved. Kevin Quinn
3.7
Å BASIC programs from !Edit Ö When in !Edit you can actually run BASIC
programs etc from within the desktop without pressing <f12>. I happened
to come across this accidentally. Press <menu> on the Edit icon and
click on New Task Window. This will produce a task window on the screen
and will allow you to execute the BASIC environment without leaving the
desktop and allow you to format disks also allowing you to nearly multi-
task formatting disks, you can suspend the task get on with something
then resume the task and the formatter will continue where it left off!
Press-ing <menu> from within the task window will give a list of
commands (anyone know what link/unlink does??) Graham Bisset
3.7
Å Changing your batteries and keeping your CMOS RAM settings intact.
If you connect a 100 microfarads capacitor in series with a 100 ohm
resistor and clip them across the battery connec-tions, (+ve of the
capacitor to +ve of the battery) you will have about 70-100 seconds to
change your batteries without losing your CMOS settings. The computer
should be kept switched off throughout the operation. J W E Jones
3.7
Å Current directory path Ö With reference to Richard Skempæs query in
Archive 3.5 p43 about getting the full pathname of the current direc
tory, the Éeasiest on your fingersæ method uses system variables. It was
difficult to implement and required a fair amount of digging in the
manuals but it does demonstrate the use of *Set, *SetMacro and *SetEval,
so here it is:
3.7
Place the following two lines into an Obey file, either via *Build or by
using !Edit. Save it in the library directory of your current disc as
öPathò and set the filetype to be an Obey file (*SetType %.Path Obey).
Execute it with *Path. Subsequent use of *Path will have other effects Ö
see later.
3.7
Set Path$ $
3.7
SetMacro Alias$Path Dir %%0||mIf ö%%0ò = öò Then Set Path$ $ Else If
ö%%0òLEFT1 = ö$ò Then Set Path$ %%0 Else SetEval Path$ Path$ + ö.%%0ò
3.7
How it works: öSet Path$ $ò sets up a system variable called öPath$ò and
assigns to it the string value ö$ò, which you will recognise as being
the name of the root directory.
3.7
öSetMacro Alias$Path ╔ò creates a macro system variable called öPathò.
3.7
When ö*Path [<directory path>]ò is executed, the macro first selects the
directory specified in <dir-ectory path> by way of the old *Dir command.
3.7
If no directory path is specified, the old *Dir selects the root
directory. The macro examines <directory path> and, if it is a null
string (öò), it sets Path$ to ö$ò.
3.7
If the leftmost character of <directory path> is ö$ò, the macro replaces
Path$ with <directory path>.
3.7
If <directory path> is not null and does not have ö$ò as its leftmost
character, the macro appends a full stop and the string specified in
<directory path> to whatever Path$ contains.
3.7
Path$ thus always contains the full pathname of the currently selected
directory (CSD).
3.7
You can actually redefine *Dir itself to do this, so that you donæt have
to remember to use *Path ins-tead of *Dir. In other words, it becomes
transparent.
3.7
All you do is to change the first occurrence of Path (in öAlias$Pathò)
to Dir (i.e. öAlias$Dirò) and change the öDir %%0ò to ö%Dir %%0ò. The
extra % sign in front of Dir is to enable the original version of Dir to
be used (FORTH programmers will recognise this as smudging). I have not
actually tried this, but it should work!!
3.7
How to use it:
3.7
Use öPathò wherever you would use öDirò. In fact, do not use öDirò at
all (more on this later). Also use full pathnames, as opposed to
wildcarded path-names. This is not really necessary, but it looks
neater.
3.7
The command ö*Path Basic.Games.Adventureò, executed from the root
directory, would set sub-directory öAdventureò as the CSD, exactly in
the same way as ö*Dir Basic.Games.Adventureò would do.
3.7
Notes:
3.7
1. No leading asterisks. You may enter them, but they are superfluous,
as these lines are sent direct to the CLI.
3.7
2. The use of two double bar characters in ||m. This is so that Obey
will insert it in the macro variable as |m, instead of as ASCII 13.
3.7
Alias$Path is a multi-line (well, a 2-line) com-mand. This is quite
acceptable, provided each line is separated by a carriage return (ASCII
13, or |m).
3.7
Note that the (*)Dir command is at the start of the macro. Putting it
at the end causes errors related to the (*)If╔Then╔Else construct.
3.7
3. Double percentage character in %%0. This is so that Obey will insert
it in the macro variable as %0, instead of attempting to evaluate a
(non-existent) parameter when the command *SetMacro is executed.
3.7
4. Double quote marks where the parameter is to be evaluated as a
string. This is so that string evaluation will proceed correctly.
3.7
5. Use of upper and lower case. In general they are interchangeable at
will.
3.7
(*)Eval supports a number of operators (see p.394 in the Archimedes User
Guide). Some are in the form of ordinary words, such as LEFT, MOD, AND,
OR, etc, and others are symbols, such as *, +, >>, etc. The ordinary
words must be in UPPER CASE, otherwise they are not recognised.
3.7
Disc-related commands seem to be quite happy when offered system
variables as pathnames. If an application sets up its own pathname as,
say, öApplication$Dirò, you can make the first line of a BASIC program.
3.7
10 REM > <Application$Dir>.Program
3.7
and be confident that the BASIC command SAVE will put it in the right
place, as the Filer (I think) evaluates <Application$Dir> correctly.
Also *Eval Application$Dir (without the <>) also returns the value of
the variable.
3.7
You can get the value of the system variable into a BASIC variable with
the following FN:
3.7
buffer_length%=255
3.7
DIM buffer% buffer_length%
3.7
PRINT FNevalOS(öApplication$Dirò) : REM NB!! no < >
3.7
END
3.7
3.7
DEF FNevalOS(A$) LOCAL T%,L%
3.7
SYS öOS_EvaluateExpressionò, A$,buffer%,buffer_length% TO ,T%,L%
3.7
IF T%=0 THEN = L% : REM integer result
3.7
buffer%?L%=13
3.7
=$buffer% : REM string result
3.7
Anton Mans, Durban
3.7
Å Double height in Fortran Ö The following short FORTRAN routine can
be used for the Archimedes to Étart upæ screen output. It is a routine
for printing text in double height on the screen and uses OS_Word call
10 to read the system font bit pattern. A VDU23 call is used to define a
pair of characters consisting of the upper and lower halves of the input
character. These two characters are then printed, one above the other,
giving a double-height character. Itæs very useful for printing headings
in screen output and doesnæt require messing about with special fonts
(Iæm going to go on to that next!).
3.7
I claim no originality for the overall method. A routine in BBC BASIC to
do this was published in Beebug some years ago (I forget who the author
was), but I thought it was worth publicising a FORTRAN version of it in
Archive because I donæt think the translation is immediately obvious and
readers may not have been aware of the technique anyway. It should be
easily extendible to double width, quadruple height, etc.
3.7
Rather than just give the bare routine, I have produced a short program
incorporating it, that writes out a couple of strings. Much use is made
of the É$æ format to suppress CRLF when characters are being sent to the
VDU driver. The routine is more complex than the BASIC equivalent for
two reasons. Firstly, although there is a word ÉLENæ in FORTRAN, it only
seems to give the maximum length of any given string, i.e. the length
that it is originally declared to be (e.g. CHARACTER*78 TXT; LEN(TXT)
gives 78). So in SUBROUTINE DOUBLE, there are a few lines to find the
length of the string passed to it by counting backwards from the maximum
length until a non-space character is reached. N.B. this will fail if
the string is put into the argument list, e.g. CALL DOUBLE(10,20,ÉHi
thereæ). Secondly, since individual bytes in memory are not accessible
to FORTRAN, you have to get the result back as three (4-byte) integers,
and use IAND with ISHFT to gain access to the bytes.
3.7
PROGRAM DHTEST
3.7
C *******************************
3.7
C A DEMONSTRATION PROGRAM FOR
3.7
PRINTING DOUBLE HEIGHT
3.7
C TEXT IN ANY MODE (NOT 7) ON THE
3.7
ACORN ARCHIMEDES,
3.7
C IN ACORNSOFT FORTRAN. USES ACORN
3.7
EXTENSIONS: OSWORD, ISHFT, IAND
3.7
C BY R.D.WRIGHT
3.7
C *******************************
3.7
CHARACTER*78 TXT
3.7
WRITE(6,æ($,2A)æ)CHAR(22)
3.7
,CHAR(12)
3.7
WRITE(6,*)æDOUBLE HEIGHT TESTæ
3.7
TXT=æTHIS IS A VERY LONG TEST
3.7
STRINGæ
3.7
CALL DOUBLE(10,20,TXT)
3.7
TXT=ÉAND MOREæ
3.7
CALL DOUBLE(10,23,TXT)
3.7
STOP ÉEND OF DEMOæ
3.7
END
3.7
SUBROUTINE DOUBLE(ICOL,IROW,TXT)
3.7
CHARACTER*78 TXT
3.7
INTEGER BLOCK(0:2)
3.7
INTEGER B(0:8)
3.7
N=79
3.7
10 N=N-1
3.7
IF (TXT(N:N).EQ.É æ) GO TO 10
3.7
DO 20 I=1,N
3.7
BLOCK(0)=ICHAR(TXT(I:I))
3.7
CALL OSWORD(10,BLOCK)
3.7
DO 2010 J=1,3
3.7
BLOCK(0)=ISHFT(BLOCK(0),-8)
3.7
B(J)=IAND(BLOCK(0),?IFF)
3.7
2010 CONTINUE
3.7
B(4)=IAND(BLOCK(1),?IFF)
3.7
DO 2020 J=5,7
3.7
BLOCK(1)=ISHFT(BLOCK(1),-8)
3.7
B(J)=IAND(BLOCK(1),?IFF)
3.7
2020 CONTINUE
3.7
B(8)=IAND(BLOCK(2),?IFF)
3.7
WRITE(6,É($,10A)æ)CHAR(23),CHAR(
3.7
240),CHAR(B(1)),CHAR(B(1))
3.7
+,CHAR(B(2)),CHAR(B(2)),CHAR(B(3
3.7
)),CHAR(B(3)),
3.7
+CHAR(B(4)),CHAR(B(4))
3.7
WRITE(6,É($,10A)æ)CHAR(23),CHAR(
3.7
241),CHAR(B(5)),CHAR(B(5))
3.7
+,CHAR(B(6)),CHAR(B(6)),CHAR(B(7
3.7
)),CHAR(B(7))
3.7
+,CHAR(B(8)),CHAR(B(8))
3.7
IX=ICOL+I-1
3.7
IYU=IROW
3.7
IYL=IROW+1
3.7
WRITE(6,É($,8A)æ)CHAR(31),CHAR(
3.7
IX),CHAR(IYU),CHAR(240)
3.7
+,CHAR(31),CHAR(IX),CHAR(IYL)
3.7
,CHAR(241)
3.7
20 CONTINUE
3.7
RETURN
3.7
END
3.7
R.D.Wright
3.7
Å Easy ÉCæ Compilation I Ö While working on a C program it can become
quite tedious to type in the same parameters every time you want to
compile the latest version of your program. One way to get around this
is to use something like öC-Frontò from Mitre which allows you to
compile directly from the desktop. A simpler and cheaper way is to use
an ÉObeyæ file which will do the job for you. Below is an example that
has been written to make the compilation of C (Release 3) programs
easier. Using this method, you can still work from the desktop editing
your text in !Edit, saving it, then pressing <f12>. You can then use the
following command:
3.7
*c <inputname> [outputname]
3.7
It will then automatically Compile and Link your new masterpiece!
3.7
The program has been fully commented to aid understanding. It should be
saved as an ÉObeyæ file in the ÉLibraryæ directory under the name öCò.
Obviously it should be customised to suit your own directory layout and
preferred compiler options.
3.7
| ÉCæ Obey file, Compiler & Linker -
3.7
16/02/90 Mark Taylor
3.7
| Syntax : ö*C <inputname> [output
3.7
name]ö
3.7
| Where Éinputnameæ is the name of
3.7
the file to be compiled
3.7
| and Éoutputnameæ is the name of the
3.7
output file, e.g. !RunImage, etc.
3.7
|
3.7
| Check for parameters. If none
3.7
present then error and output
3.7
a message.
3.7
if ö%0ò = öò then error 0 Error in
3.7
ÉCæ Compiler & Linker. Syntax : *C |<inputname|> [outputname]
3.7
|
3.7
| Set system variable Éipname$æ to
3.7
first parameter after the öcò.
3.7
Set ipname$ %0
3.7
|
3.7
| Check for a second and if there is
3.7
one set Éopname$æ to that
3.7
variable,
3.7
| else set Éopname$æ equal Éipname$æ.
3.7
If ö%1ò > öò then Set opname$ %1 else
3.7
Set opname$ %0
3.7
|
3.7
| Compile with Éipname$æ, do NOT Link
3.7
(-c). ANSI 3 Standard method.
3.7
cc -c <ipname$> -I$.RISC-OSLib
3.7
|
3.7
| Link Éipname$æ with standard lib-
3.7
raries and output as Éopname$æ.
3.7
link -o <opname$> o.<ipname$> $.RISC
3.7
-OSLib.o.RISC-OSLib $.CLib.o.Stubs
3.7
|
3.7
| Echo finishing message.
3.7
Echo File É<ipname$>æ successfully
3.7
compiled as É<opname$>æ.
3.7
| Unset the temporary variables.
3.7
Unset ipname$
3.7
Unset opname$
3.7
Below is a cut down version that is not quite as sophisticated but is
easier to understand.
3.7
| ÉCæ Obey file, Compiler & Linker -
3.7
16/02/90 Mark Taylor
3.7
| Syntax : ö*C nameò Where Énameæ is
3.7
the name of the file to be
3.7
compiled.
3.7
cc -c %0 -I$.RISC-OSLib
3.7
link -o %0 o.%0 $.RISC-OSLib.o.RISC
3.7
-OSLib $.CLib.o.Stubs
3.7
Echo File É%0æ successfully compiled.
3.7
3.7
Å Easy ÉCæ Compilation II Ö This is not a new idea but it is still
worth mentioning. To speed up the compilation of ÉCæ programs it is a
good idea to copy the necessary files to a RAM disc. I have written an
Obey file to achieve this. It is best saved into the Library directory
so that it may be called from the star (*) prompt any time. The way the
file is set up at the moment means that it will copy files from the hard
disc to a RAM disc of some 1.5M. The RAM disc is set up using the
öMemAllocò module (this can be found in the !Lander directory on the
Apps2 disc of RISC-OS). It should be copied in the mod-ules directory of
the !System folder. The directory layout reflects a fairly standard
system under release 3 of Acornæs ANSI C.
3.7
Important!
3.7
You must remember to copy the files you have changed during your session
back to disc before switching off!
3.7
| Obey file to set up RAM disc as the
3.7
working disc for ÉCæ 18/1/90
3.7
|
3.7
| First create large RAM disc: 1.5MB!
3.7
RMensure MemAlloc 0.11 RMload :4.$.
3.7
!System.modules.memalloc
3.7
RAMFSSize 1500
3.7
RMensure SharedClibrary 3.50 RMload
3.7
:4.$.!System.modules.clib
3.7
RMensure FPEmulator 2.80 RMload :4.$.
3.7
!System.modules.FPE280
3.7
|
3.7
CDir RAM:$.RISC-OSlib
3.7
CDir RAM:$.Clib
3.7
CDir RAM:$.User
3.7
Copy ADFS:$.RISC-OSlib.* RAM:$.RISC-
3.7
OSlib.* ~cr~v
3.7
Copy ADFS:$.CLib.* RAM:$.Clib.* ~cr~v
3.7
Copy ADFS:$.User.* RAM:$.User.* ~cr~v
3.7
CDir RAM:$.Library
3.7
Copy ADFS:$.Library.link RAM:$.Library.* ~c~v
3.7
Copy ADFS:$.Library.cc RAM:$.Library.* ~c~v
3.7
Copy ADFS:$.Library.squeeze RAM:$.Library.* ~c~v
3.7
| Copy my single letter Obey file ÉCæ.
3.7
Copy ADFS:$.Library.c RAM:$.Library
3.7
.* ~c~v
3.7
|
3.7
|Define function keys.
3.7
k.1c
3.7
k.2cc -c
3.7
k.3-I$.RISC-OSLib
3.7
k.4link -o
3.7
k.5$.RISC-OSLib.o.RISC-OSLib
3.7
k.6$.CLib.o.Stubs
3.7
k.7Squeeze -v
3.7
| Delete all unwanted object files!
3.7
k.12wipe o.* ~c
3.7
|Perform *RAM at the end!
3.7
RAM
3.7
|Select $.User directory!
3.7
Dir $.User
3.7
Echo RAM Disc now setup correctly
3.7
(DIR=$.User)
3.7
Echo
3.7
free
3.7
Filer_OpenDir RAM:$.User.c
3.7
Å Music Maestro please! Ö The !Maestro applic-ation provided by Acorn
is very powerful, if very complex. However, it still has a number of
short-comings relative to the old Island Logicæs öMusic Systemò for the
BBC micro. These include the inability to delete whole bars or several
bars; the inability to handle triplets; the inability to change Tempo
within a passage. Also, entering scores by dragging icons is extremely
slow and laborious and finally, öMusic Systemò counted notes in a bar
and, when the right time had been used, automatically entered a bar-
line. This not only saved an operation, it also provided a cross-check
on typing accuracy: the unexpected appearance of a bar-line indicated a
mistake somewhere.
3.7
!Maestroæs !RunImage file has been modified to permit changing of the
Tempo during a passage. This required a new sprite, placed in the space
in the top right corner, next to the hemi-demi-semi-quaver rest; ÉMæ for
Metronome seemed to be a reasonable choice. This sprite can be picked
up, just like the others, and placed above the appropriate bar-line.
When it is Éclickedæ to fix it in position, it changes into the crotchet
symbol followed by ö=<num>ò, where <num> is a number from 40 to 210,
representing the Tempo as selected by the Tempo sub-menu from the main
Maestro menu. The numbers (of beats per minute) are given on page 1810
of the Programmeræs Reference Manual.
3.7
During these investigations, a few small errors were noticed in the
Programmeræs Reference Manual (RISC-OS Edition). In Vol.4, under Music
Files:
3.7
p.1809 öMaestroò is followed by öLine-feedò, &0A (not &0D)
3.7
Music Data: Not ö4*8 length of queue of notes╔ò but ö5*8ò because the
length is written to file as an integer variable, FINE%(C%) (as in DC al
fine!), so it consists of one byte (&40:integer) followed by 4 bytes
(value).
3.7
p.1811 Attributes: Clef Bit 5 is unused Bits 6 & 7 are (StaveÖ1), range
0Ö3. The attributes as defined in !Maestro. !RunImage lines 28900Ö29020
agree with those obtained by a *DUMP of a Music file. Alan Quayle
3.7
Å Shift Caps Lock will give you capitals normally but will enable
lower case characters to be typed by holding down the shift key Ö very
useful when writing BASIC programs. Fred Lee
3.7
Å SID Ö There is a mail-server on the SID database and so if you can
use E-MAIL (e.g. if you are a student at University, like me) then you
can mail it at SIDInfo@uk.co.acorn with a message contain-ing the word
Éhelpæ and it will mail you a file telling you how to download stuff.
It only has the free PD stuff though (obviously). The advantages of this
service work both ways Ö the SID machine can schedule the replies in
non-peak times and you are not using lots of on-line time down-loading.
Kevin F. Quinn
3.7
Å TinyDirs Ö it may be obvious to most of you but╔ The TinyDirs
program not only allows directories to be installed on the icon bar but
allows applications to be as well. After all they are only directories
really. The application can then be run by clicking on the icon on the
icon bar in just the same way as any other application. This means you
can have your favourite programs on the icon bar without having to worry
about how to install them there. The TinyDirs program will also cope
with more than one directory. (A friend was running a new copy of
TinyDirs each time he wanted a new directory installed.) If you just
drag the icon for the directory you want installed onto one of those
already there it will be added to the list. Andrew Ling.
3.7
Å Turkish Éiæ Ö There is a minute error in the char-acter set supplied
as öLatin3ò on the Archimedes which, according to Acornæs manual,
corresponds to ISO 8859/3 covering German, Spanish, Turkish etc.
Character 185 is supposed to be the Turkish lower case Éiæ, i.e. like
the English Éiæ but without the dot. (The Mac has let me down for once Ö
no Turkish Éiæ! Ed.) Instead, it replicates the standard Latin Éiæ.
3.7
To overcome this, insert the following in a boot file:
3.7
*echo <23><185><0><0><56><24><24>
3.7
<24><60><0>
3.7
John Morgan
3.7
Å Working on a 1Mbyte machine Ö When loading applications within the
desktop especially on a 1Mb machine, always call up the task display and
reduce the size of the next slot to as low as the machine will allow,
some applications will allow you to set it to 8k and they will just grab
as much memory as they need, however some will report ÉApp need XXXk to
startæ so change the slot to about XXX+20k for workspace. If you do this
then the application can only grab as much memory as it needs. However,
if you leave say 640k in the next and you click on an application then
its likely that the application will grab about 600k or so leaving
precious little for other programs, data etc Users of 2Mb+ machines
donæt have the problem, but they still need to be careful of memory
grabbing applications! Graham Bisset
3.7
Å Auto-Booting on Startup Ö The following tip is of particular use to
users of hard disks.
3.8
With so many extensions to RISC-OS being avail-able, most notably the
Outline Font Manager, it can be inconvenient if your applications canæt
find them and even worse if the first !System directory that is seen is
on a floppy.
3.8
The simplest solution to this is to put !Fonts and !System in the root
directory of your hard disk and then open the root directory as your
first action.
3.8
However, if the same action has to be performed repeatedly, then the
computer must be able to do it for you and it can.
3.8
First you should create a command file called !Boot in Edit. This should
contain something like:
3.8
adfs::4.$.!System
3.8
adfs::4.$.!Fonts
3.8
DESKTOP
3.8
This will then initialise the system and font paths before starting the
desktop. To make it run on startup, you must configure the system to
execute the !boot file, this is done from an operating system * prompt
by:
3.8
*configure boot
3.8
*configure drive 4
3.8
*opt 4,3
3.8
The last option sets the current drive to execute the !boot file, rather
than attempting to run it as a BASIC program.
3.8
This is not the end of the startup. When you invoke the desktop, it is
possible have one or more applications run automatically. To run a
single application, just append the application path on the end of the
DESKTOP command, for example:
3.8
DESKTOP adfs::4.$.!Edit
3.8
This will startup the desktop with Edit on the menu bar. To initialise
more than one application, you specify a text file which lists all the
applications that you wish to start.
3.8
DESKTOP -File adfs::4.$.Startup
3.8
The file Startup might contain the following list of files:
3.8
adfs::4.$.!Draw
3.8
adfs::4.$.!Edit
3.8
adfs::4.$.!Paint
3.8
This will then enter the desktop and start Draw, Edit and Paint
automatically. One word of warning, if you are limited to 1 Mb, be
careful as it would be very easy to use up all the available memory.
3.8
Further customisation could be had by adding RMload commands to the !Run
file of !System to automatically load modules (such as NewModes) and
Filer_OpenDir pathname to the !Run files of applications in the startup
file to automatically open directory viewers. Phil Kitching
3.8
Å BasicEdit Ö For users of the Data Store !Basic-Edit application:
Because this application uses the DSUtil module to alter the operation
of the mouse pointer it is not possible to run desktop programs
successfully from Edit without returning to the desktop first. This,
however, has the disadvantage that programs are more difficult to debug:
when a program ends it returns to the desktop and all the variables are
lost. A few simple changes to the !BasicEdit.!RunImage program, however,
seem to provide a satisfactory remedy. Insert near the start of the
program the following function key definitions:
3.8
*KEY 2 *BEUtilOff|M*BASIC|MOLD|M
3.8
RUN|M
3.8
*KEY 3 *BEUtilOn|MEDIT .|M
3.8
Then to run any program from the Edit screen simply press <f1> once and
<f2> once. If the prog-ram uses the Wimp, the desktop will reappear as
it was before you ran !BasicEdit with the new program running as well.
After the program ends, a öcommand windowò will appear where you can use
LVAR or any other BASIC commands. To return to the Edit screen where you
left it, simply press <f3>. Hugh Eagle
3.8
Å Battery changing Ö You donæt have to bother with adding capacitors
etc as mentioned last month. All you need to do is leave the computer
switched on while changing the batteries (but mind your fingers on the
fan!). There is no danger involved, as the mains is totally enclosed,
and it will not harm the machine. Mike Harrison.
3.8
Å C programming Ö When writing desktop applications, put ÿDATEÿ in the
version string. So, if you forget to update the version number when
modifying the source files, it doesnæt really matter because when the
info is given from the menu, you can then find out what date the file
was compiled. R Bunnett.
3.8
Å Closing the Edit window using <adjust> (instead of <select>) the
source directory is opened after the window has been closed. Holding the
<shift> key down simultaneously, will cause the directory viewer to be
opened without closing the Edit window (this allows you to drag-save the
file into the same directory, but with a different name). This is also
true for Draw and Paint.
3.8
Å Double clicking problems Ö Double clicking on an application
installed on the icon bar by !TinyDirs can result in the application
running twice. This can have the confusing result that when you quit the
application a second copy of it immediately appears in its place.
3.8
I have found a somewhat cumbersome solution to this problem which is to
include the following code in the WimpPoll loop:
3.8
WHEN 17 : IF block%!4<>TaskId% AND block%!16=&400C2 THEN
3.8
PROCInsertCR(block%+28)
3.8
dummy$=$(block%+28)
3.8
IF dummy$=TaskName$ THEN
3.8
quit%=TRUE
3.8
ENDIF
3.8
ENDIF
3.8
.
3.8
.
3.8
DEF PROCInsertCR(mem%)
3.8
LOCAL I%
3.8
I%=mem%
3.8
REPEAT
3.8
I%+=1
3.8
UNTIL ?I%=0
3.8
?I%=13
3.8
ENDPROC
3.8
When the first application receives the message that is broadcast when a
new application starts (i.e. it receives reason code 17 with
block%!16=&400C2) and it finds that the new task has the same name
(TaskName$) as itself, it sets quit%=TRUE which makes the application
quit at the end of the poll loop.
3.8
Note that when each application starts, it receives the message
broadcast by itself, hence the com-parison of block%!4 (which holds the
handle of the sender of the message) with TaskId% to prevent the task
from shutting itself down!
3.8
Note also that the little procedure PROCInsertCR seems to be necessary
to convert the string at block%+28 from a zero terminated string to a
normal &0D terminated one. (Can anyone explain please RISC-OSæs
infatuation with these wretched zero-terminated strings ... and to say
that itæs because C or Unix, or whatever, uses them is no answer!) Hugh
Eagle
3.8
Å Filer_OpenDir Ö The command ÉFiler_Open Diræ may be used for any
file path. This includes Éfiling systemsæ created using a system
variable (e.g. System$Path) may be referred to as the filing system
Ésystem:æ. Some Éfiling systemsæ are one direction only (e.g. printer:).
The command can also use SystemDevicesæ own Éfiling systemsæ:
3.8
kbd: / rawkd: the keyboard
3.8
null: the Énull deviceæ
3.8
printer: the printer
3.8
serial: the serial port
3.8
vdu: / rawvdu: the screen
3.8
netprint: the network printer
3.8
Examples: dragging a file onto the view opened by:
3.8
*Filer_OpenDir printer: will spool it to the printer
3.8
*Filer_OpenDir vdu: will send it to the vdu driver (try it with a text
file)
3.8
*Filer_OpenDir null: <shift> dragging will Émoveæ a file to null: i.e.
delete it
3.8
Å FormEd Update Ö Users who have downloaded the !FormEd template
editor from Acornæs SID board (also available on shareware disc 20)
might like to know how to put back the Ésprite routinesæ.
3.8
The version of !FormEd refered to has a !Help file stating a date of 16-
May-89, and a ReadMe file stating version 1.00, but shows version 1.01
and date of 23-May-89 in its Info window. The ReadMe file shows that
this is an unsupported Acorn application.
3.8
The !Help file states ÉSome previous versions of FormEd used to provide
facilities for editing sprites. These are now provided only in the
!Paint applicationæ, also that when a sprite file is dragged onto the
FormEd icon on the iconbar, a window will display the sprites. In the
supplied state, no window is opened and you do not know what your sprite
names are, or even if you have loaded the correct file, until you define
an icon as a named sprite which you hope is in the file!
3.8
I was having problems with not enough memory on a 1Meg machine for
!Paint, !FormEd, the sprite files and the templates being built. (It IS
possible with very careful setting of the æFreeæ and ÉNextæ bars in the
Task Manager, but you canæt have any printer drivers etc). An examina
tion of the !FormEd reveal-ed that by removing the REM statements from
just 2 lines the sprite routines were again available.
3.8
Load the !RunImage for !FormEd and LIST lines 2270 and 3080. Edit those
lines to remove the REM before PROCspriteinfo in each, so that the lines
are as shown below:
3.8
2270 WHEN &FF9:PROCloadsprites (f$)
3.8
:PROCspriteinfo
3.8
3080 PROCloadsprites(FNstring0(q%
3.8
+44)):PROCspriteinfo
3.8
Save the file back to the disk. When a sprite file is dragged to the
FormEd icon, a sprite window is shown and the sprite editing routines
appear to work OK (although !Paint is more powerful). Douglas Potter
3.8
Å GraphBox Ö Maybe this is an obvious point to some users but it took
me a while to discover. Graphs imported into !Draw can be disassembled
to a remarkable degree (using ungroup) right down to facets of
individual 3D bars. This allows extensive re-orienting, re-colouring
options which can avoid some of the problems with dark colours and
overlaps when colour printing on a dot matrix printer. John Wann
3.8
Å Hardware developeræs tool Ö On the monthly program disk is a utility
(ÉSVCBASæ) which is very useful for hardware developers. It patches
BASIC so that memory indirection operators (? and !) operate in
supervisor mode. This allows quick Étweakingæ of hardware devices while
testing. Documentation is minimal, since those who are likely to need it
should not need any! Mike Harrison.
3.8
Å Maestro Ö There are (I think!) several errors in the description of
the !Maestro file format on pages 1809 to 1813 of the PRM:
3.8
a) in the ÉMusic dataæ the number of bytes of gate data is given, not
the number of gates as the PRM says
3.8
b) the number of bytes of gate data is preceded by &40
3.8
c) each of the next eight words (which give the length in bytes of the
queues of note/rest data for the eight channels) is also preceded by &40
3.8
d) in the ÉStave dataæ, the number of music staves is reduced by 1
(i.e. if there are 4 music staves this is recorded as 3)
3.8
e) in the descriptions of the ÉGate Attributesæ, the binary represen
tations of the bottom few bits of each byte are given with the least
significant bit first. Thus where the ÉClefæ description says öBits 0 Ö
2 : 001 binaryò it means that bits 0 and 1 are 0 and bit 2 is 1.
3.8
f) within the ÉClefæ attribute data, the stave number (minus 1) is
given in bits 6 and 7, not bits 5 and 6. Hugh Eagle
3.8
Å Problems with an Epson LQ1050? When printing from Impression, !Draw,
etc using the !PrinterDM application, the 360 x 360 dpi mode may cause
spurious characters to be printed, which results in a poor quality
printout. The reason for this is that the firmware in the Epson printer
does not support the [Esc]+ control sequence which is nec-essary to set
a line feed of 1/360th of an inch. In order to get this option working
you will need a new version of the printeræs ROM. This can be purch-ased
from Applied Technology Ltd. David Crofts
3.8
Å Re-inking your ink-cartridge Ö It is possible to re-ink an ink-
cartridge for an HP-Deskjet Plus printer and probably other inkjet
printers by buying one of the inks listed below and then using a syringe
to insert the ink through a hole on the top of the cartridge. (a)
Fountain pen ink (Pelikan), (b) Diadye ink (photo-shop), (c) Rotring
air-brush ink. Tony Hopstaken
3.8
Å Rotor passwords Ö Lee Thake has sent in the passwords for Rotor, but
in case you would rather not know, here they are in very simple coded
form so that once you have the first password, you will be able to work
out the others. QJU, HBH, MJQ, TMZ, NFX, BXF, UOU, FOE.
3.8
Å Sparkplug Ö We have a lot of questions about how to decompress
programs such as PCDir which appear on our program and Shareware discs.
Let me try to explain in more detail.
3.8
The reason the programs are compacted is that there would not be enough
room on the disc for the uncompacted version. Thus, if you are to uncom-
pact them, you need to do so onto another (prefer-ably blank) disc. If
you have two drives or a hard disc on your computer, the job is easier
then if you are trying to do it on a single drive, so I will do it the
hard way first.
3.8
Insert a blank disc in the drive and open its filer window. Remove this
disc and insert the Program Disc (or Shareware disc, or whatever) in the
drive and open its filer window. If you have not already done so,
install !sparkplug onto the icon bar by double-clicking on it. Drag the
icon of the program to be decompacted onto the !sparkplug icon on the
icon bar. A pseudo-filer window opens. Drag the icon or icons from there
into the filer window of the blank disc. You will be prompted to insert
that disc into the drive and will probably then have to keep swapping
the discs over as prompted until all of the compacted files and folders
have been uncom-pacted and copied across onto the other disc. This may
actually require quite a number of repetitions, so it may be better to
create as large a ram disc as possible and drag the files from the
!Sparkplug filer window onto the ram disc then change discs and copy
back from the ram disc to the blank disc. This, of course, will not work
if you cannot make a ram disc big enough to accommodate the uncompacted
files.
3.8
If you have two discs, simply put the program disc in one drive and the
blank disc in the other. Proceed as above, except that you will not be
prompted to change discs since both are accessible to the computer at
the same time.
3.8
Å Too many fonts Ö If you have too many anti-aliased fonts, !Edit will
crash with a ÉFatal internal error type=5æ. So those of you who are
purchasing the new onslaught of outline fonts should not put them all
into one !Fonts directory.
3.8
Å VIDC parameters Ö On the monthly program disk is a text file of all
the VIDC and VDU para-meters for the standard screen modes. This makes
life a lot easier when defining your own modes, especially without the
aid of an oscilloscope to monitor the video waveform, and a VIDC data-
sheet. Itæs much easier to tweak the existing num-bers than to work them
out from scratch! Mike Harrison.
3.8
Å Wimp programming Ö If you get unexpected messages such as öToo many
nested structuresò when running a BASIC program in a Desktop application
it may be simply because you have failed to allocate a large enough
Wimpslot. Hugh Eagle
3.8
Å Z88 file transfer Ö The Z88 can save files to disc. Ranger sell a
battery powered disc drive which reads and writes 3.5ö discs in 720k
MSDOS format. The trouble is it costs as much as the Z88.
3.8
The Z88 does not insist on sending a line feed, see Printered.
3.8
Since the Z88 serial port uses XOn/XOff by default, a three wire serial
lead will suffice if the Archim-edes is using similar software. Be sure
to short other handshaking lines. The simplest method of sending data to
the Archimedes is to use:
3.8
*SPOOL file
3.8
*FX21,1
3.8
*FX2,1
3.8
and just print from the Z88. Make sure the last lines in the file being
printed have *SPOOL *FX 2,0.
3.8
The next stage up is to use a communications pack-age such as Hearsay
and the Filer to send or receive files. There is a nice routine on the
Data Store utilities disc which does the job using the Filer.
3.8
Lastly the best way of transferring data is to use the PCLink ROM and
the Z88 filer that comes with Pipedream. Unfortunately PCLink comes with
a Z88 to PC cable so some soldering is still required. Data transfer
with PCLink is unnecessarily slow, a version of Kermit would have been
more use and faster. Bruce Edelsten
3.8
(How about using the Archimedes-Z88 link that we supply for ú35? Ed.)
3.8
3.9
Å Clear a line Ö To clear a text input in an editable field, press
<ctrl-U>. For example, you can use this to clear the filename before
typing a new entry. Philip Armstrong
3.9
Å !Draw Ö Someone mentioned converting sprite images to object
orientated !Draw images. I have used a graph program and converted the
sprite it created to a !Draw file by zooming up and drawing over the
sprite. If you keep to, say, the bottom left of each pixel, it works OK
and gives a much better printed image.
3.9
To get vertical and horizontal lines, use the edit coordinated facility.
Get one end correct then note its x or y location and then edit the
other end to match it.
3.9
If you have typed some incorrect text into a draw file, for example ÉFig
4.5æ needs to be changed to ÉFig 4.6æ, then you would normally have to
re-type the line and be careful to locate it in the same place. If
characters are changed leaving the string length the same then you could
use !Edit to search and replace the text, once the draw file has been
dragged onto the !Edit icon. Strings could also be padded out with
spaces if a shorter replace string is required, but for a longer string
it is usually easier to re-type in !Draw. Philip Armstrong
3.9
Å DXF files Ö Inclusion of a 41 group in TEXT entities permits
characters with varying aspect ratios. A value of 0.5 matches the system
fonts. Jim Markland.
3.9
Å Elektor sound sampler Ö In Decemberæs issue of the Netherlands
edition of Elektor (November in the U.K. edition) they published a
D.I.Y. sound sampler podule. This podule has been built freq-uently but
there is one small problem. There are no commands provided to use the
sampler so it is difficult to use it in your own software. I decided
therefore to write a module.
3.9
The module makes use of a timer within the 6522 on the board. This
results in a very accurate sample-time. To make use of the module, you
need to set a jumper on the podule which connects the 6522-IRQ-line to
the FIQ-line of the Archimedes.
3.9
Holding the podule with the 64-way-connector towards you and the print
header at the right, you can place the jumper vertically at the right
bottom of the print header.
3.9
Now you can use the module. There is a SWI included:
3.9
ElektorSampler_Sample (&500)
3.9
R0 = Start address of the sample buffer
3.9
R1 = End address of the sample buffer
3.9
R2 = Sample time in ╡s
3.9
R3 = Minimum level to start sampling
3.9
R4 : bit 0: This bit defines the quality of the sample. Low quality
sampling must be used unless you are prepared to allow the screen to be
disabled. 0 = high quality sampling, 1 = low quality sampling.
3.9
bit 1: This bit defines whether the low order byte of the address
where the sample is written to, must be placed on the userport or not.
This enables you to take multi-channel samples (e.g. stereo) using an
analogue multiplexer (e.g. HEF 4051). When youære not using this option,
leave the bit É0æ. 0 = no output to the userport, 1 = output to the
userport
3.9
Leave unused bits É0æ for upward compatibility
3.9
After calling this SWI, the screen will be disabled during the sampling.
While waiting for the minimum level, the border will be coloured yellow
Ö whilst sampling, the border will be red. As long as the border is
yellow, you can quit by pressing <escape>. The buffer will be filled
with linear 8-bit signed numbers.
3.9
The minimum sample-time that can be used on a normal Archimedes is about
9 ╡s. The minimum sample-time that can be used with the ZN427 (the ADC)
is approx. 12 ╡s.
3.9
The module could be used with the Armadeus sampler if Armadeus software
were suitably modified. Since Armadeus is written in BASIC this should
be possible.
3.9
As far as Iæm concerned this module may be copied freely provided that
my name, as author, remains within the software.
3.9
Questions or suggestions? You can contact me via Archive.
3.9
To conserve space, we have stripped the comments out of this listing.
The full commented listing is available on the monthly program disc.
3.9
10 REM >SamplerSrc
3.9
20 REM Written by J.P.Hendrix
3.9
30 start=4:end=10:speed=9:ioc=8
3.9
:rd427=5:wr427=6:bs6522=7:level=11
3.9
:flags=12
3.9
40 DIM Code 1000
3.9
50 FOR Pass=4 TO 7 STEP 3
3.9
60 P%=0
3.9
70 O%=Code
3.9
80 [ OPT Pass
3.9
90 EQUD 0
3.9
100 EQUD 0
3.9
110 EQUD 0
3.9
120 EQUD 0
3.9
130 EQUD Title
3.9
140 EQUD Help
3.9
150 EQUD 0
3.9
160 EQUD &500
3.9
170 EQUD Handler
3.9
180 EQUD Table
3.9
190 EQUD 0
3.9
200
3.9
210 EQUS öElektor Sampler
3.9
Module 1.03 (c) copyright
3.9
22 Apr 1990 by J.P. Hendrixö
3.9
220
3.9
230 .YelBorder
3.9
240 EQUB 0
3.9
250 EQUB 24
3.9
260 EQUB 255
3.9
270 EQUB 255
3.9
280 EQUB 0
3.9
290 ALIGN
3.9
300
3.9
310
3.9
320 .Handler
3.9
330 STMFD R13!,{r0-r12 ,R14}
3.9
340 CMP R11,#&00
3.9
350 BNE UnknownSWI
3.9
360 MOV flags,R4
3.9
370 MOV start,R0
3.9
380 MOV end,R1
3.9
390 MOV speed,R2,LSL #1
3.9
400 SUB speed,speed,#2
3.9
410 AND level,R3,#&7F
3.9
420 STMFD R13!,*{t ,end,speed}
3.9
430 SWI öI/O_Podule_Hardwareò
3.9
440 BIC R0,R1,#&00FF0000
3.9
450 ORR wr427,R0,#%000<<11
3.9
460 ORR rd427,R0,#%010<<11
3.9
470 ORR bs6522,R1,#%101<<11
3.9
480 MOV ioc,#&3200000
3.9
490 STMFD R13!,{wr427 ,rd427,
3.9
bs6522,ioc}
3.9
500
3.9
510 MOV R0,#0
3.9
520 MOV R1,#3072
3.9
530 TST flags,#1
3.9
540 SWIEQ öXOS_UpdateMEMCò
3.9
550
3.9
560 MOV R0,#0
3.9
570 MOV R1,#24
3.9
580 SWI öOS_ReadPaletteò
3.9
590 ADR R0,OrgColour
3.9
600 MOV R2,R2,LSR #8
3.9
610 STRB R2,[R0,#2]!
3.9
620 MOV R2,R2,LSR #8
3.9
630 STRB R2,[R0,#1]!
3.9
640 MOV R2,R2,LSR #8
3.9
650 STRB R2,[R0,#1]!
3.9
660
3.9
670 MOV R0,#12
3.9
680 ADR R1,YelBorder
3.9
690 SWIEQ öOS_Wordò
3.9
700
3.9
710 MOV R1,#&0C
3.9
720 SWI öOS_ServiceCallò
3.9
730
3.9
740 LDMFD R13!,{wr427 ,rd427,
3.9
bs6522,ioc}
3.9
750
3.9
760 MOV R0,#&00
3.9
770 STRB R0,[ioc,#&38]
3.9
780
3.9
790
3.9
800 MOV R0,#SamplerEnd-
3.9
SamplerBegin
3.9
810 MOV R1,#&1C
3.9
820 ADR R2,SamplerBegin
3.9
830 .PokeLoop
3.9
840 LDR R3,[R2,R0]
3.9
850 STR R3,[R1,R0]
3.9
860 SUBS R0,R0,#4
3.9
870 BPL PokeLoop
3.9
880
3.9
890 LDMFD R13!,*{t ,end,speed}
3.9
900
3.9
910
3.9
920 TST flags,#2
3.9
930 MOV R0,#255
3.9
940 MOVEQ R0,#0
3.9
950 STRB R0,[bs6522,#02*4]
3.9
960 AND R0,speed,#&FF
3.9
970 STRB R0,[bs6522,#06*4]
3.9
980 MOV R0,speed,LSR #8
3.9
990 STRB R0,[bs6522,#07*4]
3.9
1000 MOV R0,#&40
3.9
1010 STRB R0,[bs6522,#11*4]
3.9
1020 MOV R0,#&00
3.9
1030 STRB R0,[bs6522,#13*4]
3.9
1040 MOV R0,#&C0
3.9
1050 STRB R0,[bs6522,#14*4]
3.9
1060 AND R0,speed,#&FF
3.9
1070 STRB R0,[bs6522,#04*4]
3.9
1080
3.9
1090 STRB R0,[wr427]
3.9
1100 .WaitLevel
3.9
1110 SWI öOS_ReadEscapeStateò
3.9
1120 BCS Exit
3.9
1130
3.9
1140 LDRB R0,[rd427]
3.9
1150 STRB R0,[wr427]
3.9
1160 TST R0,#&80
3.9
1170 RSBEQ R0,R0,#&100
3.9
1180 AND R0,R0,#&7F
3.9
1190 CMP level,R0
3.9
1200 BHI WaitLevel
3.9
1210 STRB R0,[wr427]
3.9
1220
3.9
1230 SWI öOS_IntOffò
3.9
1240
3.9
1250 TST flags,#1
3.9
1260 MOV R0,#12
3.9
1270 ADR R1,RedBorder
3.9
1280 SWIEQ öOS_Wordò
3.9
1290
3.9
1300 MOV R0,speed,LSR #8
3.9
1310 STRB R0,[bs6522,#05*4]
3.9
1320
3.9
1330 MOV R0,#&40
3.9
1340 STRB R0,[ioc,#&38]
3.9
1350 .SampleLoop
3.9
1360 CMP end,start
3.9
1370 BPL SampleLoop
3.9
1380
3.9
1390 MOV R0,#&00
3.9
1400 STRB R0,[ioc,#&38]
3.9
1410 .Exit
3.9
1420 MOV R0,#&7F
3.9
1430 STRB R0,[bs6522,#14*4]
3.9
1440 MOV R0,#&00
3.9
1450 STRB R0,[bs6522,#13*4]
3.9
1460
3.9
1470 MOV R1,#&0B
3.9
1480 SWI öOS_ServiceCallò
3.9
1490 SWI öOS_IntOnò
3.9
1500
3.9
1510 MOV R0,#0
3.9
1520 STRB R0,[bs6522,#02*4]
3.9
1530
3.9
1540 MOV R0,#3072
3.9
1550 MOV R1,#3072
3.9
1560 TST flags,#1
3.9
1570 SWIEQ öOS_UpdateMEMCò
3.9
1580
3.9
1590 MOV R0,#12
3.9
1600 ADR R1,OrgColour
3.9
1610 SWIEQ öOS_Wordò
3.9
1620
3.9
1630 MOV R0,#124
3.9
1640 SWI öOS_Byteò
3.9
1650
3.9
1660 LDMFD R13!,{r0-r12 ,PC}^
3.9
1670
3.9
1680 .UnknownSWI
3.9
1690 LDMFD R13!,{r0-r12 ,R14}
3.9
1700 ADR R0,Error
3.9
1710 ORRS PC,R14,#2^28
3.9
1720
3.9
1730 .SamplerBegin
3.9
1740 STRB start,[bs6522,#00*4]
3.9
1750 LDRB R0,[rd427]
3.9
1760 EOR R0,R0,#&80
3.9
1770 STRB R0,[start],#1
3.9
1780 MOV R0,#&C0
3.9
1790 STRB R0,[bs6522,#13*4]
3.9
1800 STRB R0,[wr427]
3.9
1810 SUBS PC,R14,#4
3.9
1820 .SamplerEnd
3.9
1830
3.9
1840 .OrgColour
3.9
1850 EQUB 0
3.9
1860 EQUB 24
3.9
1870 EQUB 0
3.9
1880 EQUB 0
3.9
1890 EQUB 0
3.9
1900 .RedBorder
3.9
1910 EQUB 0
3.9
1920 EQUB 24
3.9
1930 EQUB 255
3.9
1940 EQUB 0
3.9
1950 EQUB 0
3.9
1960
3.9
1970 .Table
3.9
1980 .Title EQUS öElektorSamplerò
3.9
+CHR$(0)
3.9
1990 EQUS öSampleò+CHR$(0)
3.9
+CHR$(0)
3.9
2000 .Help
3.9
2010 EQUS öElektor Samplerò+CHR$
3.9
(9)+ö1.03 (22 Apr 1990)ò+CHR$(0)
3.9
2020 .Error
3.9
2030 EQUD 1
3.9
2040 EQUS öUnknown Sampler SWIò
3.9
+CHR$(0)
3.9
2050 ]
3.9
2060 NEXT
3.9
2070
3.9
2080 SYS öOS_Fileò,10,öElektorSamò
3.9
,&FFA,,Code,O%
3.9
Å Extra Speed in high res modes Ö You can use SWI öOS_UpdateMEMCò to
deny VIDC DMA access to the video RAM, which returns to the processor
the bus bandwidth that was being used by the video system. Turning off
VIDCæs access to the memory blanks the screen but makes the machine go
faster even than in MODE 0. To kill VIDCæs access to memory: SYS
öOS_UpdateMEMCò,0, 1024 To re-enable access use SYS öOS_Update
MEMCò,1024,1024.
3.9
While the screen is thus disabled, you can still write to it as normal
and the results will be there when it is switched back on. This short
program shows the enormous speed gains possible (49% in MODE 15, 120% in
MODE 24) Ö it can reduce by a third, the time taken for a MODE 15 ray
trace. Sean Kelly
3.9
10 mode=MODE
3.9
20 MODE 0
3.9
30 I%=0: T%=TIME
3.9
40 REPEAT: I%+=1: UNTIL TIME>=T%+100
3.9
50 MODE mode
3.9
60 J%=0: T%=TIME
3.9
70 REPEAT: J%+=1: UNTIL TIME>=T%+100
3.9
80 SYS öOS_UpdateMEMCò,0,1<<10
3.9
90 K%=0: T%=TIME
3.9
100 REPEAT: K%+=1: UNTIL TIME>=T%+100
3.9
110 SYS öOS_UpdateMEMCò,1<<10,1<<10
3.9
120 PRINTÉöLoops per second:òæ
3.9
130 PRINTöNormal mode 0 ò;I%
3.9
140 PRINTöNormal mode ò;mode;ö ò;J%
3.9
150 PRINTöBlanked mode ò;mode;ö ò;K%
3.9
160 PRINTöSpeed up ò;(K%-J%)/J%*100
3.9
;ö%ò
3.9
Å FormEd Ö I was very interested to see the tip on !FormEd in the May
issue of Archive which really does make it easier to use. However, there
is a slight snag with it as published as it is possible to close the
sprite viewing window which cannot then be re-opened. Also, it is
possible to activate the ÉToolæ window which allows editing of the
sprites if the following changes are made to the !RunImage file.
3.9
1890 DATA öLoad templates>m_templates%
3.9
,Save templates>m_Savetemp%, Show Sprites, Show Toolbox#, Quitö
3.9
3090 ELSE PROCmergesprites (FNstring0
3.9
(q%+44)):PROCspriteinfo
3.9
9781 WHEN 4 : PROCspriteinfo
3.9
9782 WHEN 5 : PROCencodepal (0,15) :
3.9
PROCfront (palette%) : PROChtpal
3.9
9790 WHEN 6 : PROCfinish : END
3.9
Line 1890 adds two new options to the iconbar menu (ÉShow Spritesæ and
ÉShow Toolboxæ). Line 3090 has the REM removed which allows merging of
sprite files. Lines 9781 and 9782 are new and implement the opening of
the sprite and tool win-dows. Line 9790 needs changing as ÉQuitæ is now
the sixth item on the menu.
3.9
Some of the sprite editing routines seem to be miss-ing from the
!RunImage file (such as the Éspray canæ) so I just created a new blank
sprite and altered the template file so that the non-working options
donæt appear!
3.9
As noted in the magazine, !Paint is better for creating sprites but
these simple changes make !FormEd much more useful. One benefit is that
the sprites edited in !FormEd are displayed in the windows where they
will actually appear when the application runs. Paul Hobbs
3.9
Å Function key strips Ö In the past, many have tried to write a
program which generates one or more function key-strips. In most cases,
the graph-ics were not quite satisfying. When using MS-DOS software, the
problem arises that you really need four rows (instead of the standard
three) to cater for all possibilities: F-key, <shift-F-key>, <ctrl-F-
key> and <alt-F-key>. To solve this problem I have made two draw-files,
one for a 3-row function key-strip and one for a 4-row function key-
strip.
3.9
Both files require the presence of the font ÉHom-erton.Mediumæ.
3.9
As an example, I have made a function key-strip for the MS-DOS program
WordPerfect version 4.2. This file also requires the presence of the
font ÉCor-pus.Mediumæ.
3.9
From where I stand, I find the result of the Drawfiles better than what
Iæve seen so far. (Available on the monthly program disc.) Maurice
Hendrix
3.9
Å Hard disc and memory usage Ö I was interested to read about module
killing in your First Word Plus column. I have a 1Mb machine and need
all the memory I can get, so I have already experimented with simple
module killing routines.
3.9
Firstly, I altered all my !run files to keep track of Clib, FPE and the
other common modules and kill them if they are no longer needed. This
used a sys-tem variable for each module that stored the number of
applications using it. This worked but had several drawbacks. The
changing of all !run files did take a lot of work and each application
left open its !run file until it was quit. As a result, I decided that
man-ual module killing or Resetting is a better solution. One interest
ing point highlighted by this, is that !Edit suffers a fatal error and
all work is lost if the FPE is killed even though it does not need it!
3.9
The one thing that I have found extremely useful is the setting up of a
good hard disc structure and a !boot file. This has saved memory both on
the disc due to duplication and when loading applications due to fewer
icons needed to be loaded. It has also given me quicker and easier
access to programs via the new task option.
3.9
One thing that should be noted by hard disc users is that although
directories allow a nice structure, they do use memory and also slow the
access to certain parts of the disc, so donæt go overboard creating
directories for everything.
3.9
I will try to explain the structure of my hard disc. I have in my root
directory the following directories and a !boot file.
3.9
!fonts Outline Fonts
3.9
!system System Modules
3.9
Art Artisan, !Paint etc
3.9
Cad !Draw etc
3.9
Games !Triv etc
3.9
Library Command line programs
3.9
Misc My working directory
3.9
Text/DTP !Edit, !Impress, !PrinterDM etc
3.9
Utilities !FormEd, !Hand, !Configure etc
3.9
Others could include Sound, spreadsheets and lang-uages etc. Try to keep
associated programs together but donæt have directories with lots of
applications as all the icons are loaded and waste memory. Keep commonly
used programs one level down and others in sub directories. This is
especially true for the utilities directory.
3.9
The next stage is to move all the commonly used modules into the
!system.modules directory. This avoids duplication, ensures a module
update is used by all programs and also simplifies things. The most
common modules found are FPEmulator and Clib. Well-written programs will
already use !System but some donæt and they will need their !run files
mod-ified. The rmload commands need to load from :4.$. !system.modules.
If the !run file does not contain the rmload commands it is probably
best to leave its modules where they are unless you know what you are
doing. Finding modules can be done using simple utilities such as !hand
(helping hand) from the Data Store to search for the file type &FFA.
3.9
Probably the most important part of a good hard disc setup is its !boot
file. This gives the user an ideal chance to customise their system. My
!boot file shown below sets up various system variables that perform a
range of functions.
3.9
| !Boot file for hard disc
3.9
| Set variables for directory abbrevs
3.9
Set r adfs::BigHardNo1.$.
3.9
SetMacro u <r>Utilities.
3.9
SetMacro a <r>ART.
3.9
SetMacro d <r>Text/DTP.
3.9
SetMacro g <r>GAMES.
3.9
SetMacro System$Path <r>!System.
3.9
SetMacro sm <r>!System.Modules
3.9
| Set Alias to emulate two common
3.9
Unix commands
3.9
Set Alias$LS Cat %0
3.9
Set Alias$CD Dir %0
3.9
| Setup directories to be searched
3.9
for a run command (using abbreviations to keep line
3.9
to <255 chars )
3.9
SetMacro Run$Path ,%.,<sm>.,<r>L*.,
3.9
<d>1*.,<r>CA*.,<a>,<d>,<r>M*.,
3.9
<d>PI*.,<r>PC.,<u>,<u>CT*.,<u>F*.,
3.9
<u>A*.,<u>B*.,<u>C*.,<u>D*.,
3.9
<u>FO*.,<u>L*.,<u>T*.,<u>M*.,<r>T*.,
3.9
<r>S*.,<g>I*.,<g>B*.,<g>A*.,<d>!i*.
3.9
| Setup directories to be searched
3.9
for a load command (using abbreviations to keep line
3.9
to <255 chars )
3.9
Setmacro File$Path ,%.,<sm>.,
3.9
<r>Library.,<u>L*.,<d>!i*.
3.9
| run common applications !boot files
3.9
to emulate the system seeing the application without cluttering
3.9
the $ dir.
3.9
<a>!Draw.!Boot
3.9
<a>!Paint.!Boot
3.9
<d>!Edit.!Boot
3.9
<d>!Impress.!Boot
3.9
<u>FILES.!SPARK.!BOOT
3.9
| set any commonly used key strings
3.9
Key 1 *DESKTOP|M
3.9
Key 2 EDIT|M
3.9
| run desktop and display root directory
3.9
Desktop Filer_OpenDir adfs::BigHardNo1.$
3.9
The !boot file starts by defining a series of system variables that are
to be used throughout the file. They include abbreviated variables to
represent commonly used pathnames. System$Path is also defined here.
3.9
The next section defines two aliasæs that emulate common Unix system
commands. This is only of use if you switch operating systems commonly
and tend to accidentally type in the wrong commands. A similar set could
also be set up for PC users although a clash of the ödirò command would
occur.
3.9
The next two sections are similar and set up the vari-ables Run$Path and
File$Path. Firstly, Run$Path can be used to define all the directories
that you wish to be searched when a run program command is issued.
Similarly File$Path does the same for loading files. They both include
the first path which refers to the current directory.
3.9
The system variables defined at the start have been used extensively and
the * wildcard to keep the line shorter than the 255 character maximum.
Be careful when using wildcards because a new directory could also match
the search instead of the intended directory. As an alternative to this,
a series of paths could be placed into system variables i.e. Run1$ Path,
Run2$Path etc and then added together to give the complete Run$Path. Be
careful when using sys-tem variables to get the correct punctuation.
Each path must end with a full stop ö.ò although this can been included
at the end of the system variables.
3.9
The main reason for doing this is to allow the user to use the öNew
Taskò option of the task menu. If all the directories are correctly
listed in this section, you will be able to enter ö!Editò into the öNew
Taskò option and the program will install itself onto the icon bar. This
eliminates the need to know where in the directory structure it is. The
same goes for loading a program or module. You can now tuck away those
little used programs and still call them up as long as you know their
name. The general effect is the same as if everything is in the library
although loading commands can also be used.
3.9
I have found it useful to emulate the system seeing commonly used
applications such as !Draw, !Paint and !Edit. To do this all you must do
is run each applicationæs !boot file. This will setup all the icons and
system variables. This means that, for example, a draw file can be
loaded without the application having being seen.
3.9
A Hard disc !boot file is also the ideal place to set up any commonly
used key strings as well as loading any important modules.
3.9
Finally, the desktop can be called and I find it useful to open up the
root directory. This can be done by the Filer_OpenDir command. Alterna
tively, another obey file can be run after the desktop has been entered
by the use of the -file option. If this is the case, it may be useful to
create an application called !boot and rename the !boot file to !run.
The second obey file can then be hidden inside this directory.
3.9
To create and set up the !boot file╔ (1) Run !Edit (2) Create obey file
(icon menu) (3) Type in !boot data (See above) (4) Save as !boot (in
root directory) (5) Press <f12> and type
3.9
OPT4,2
3.9
Configure drive 4
3.9
Configure boot
3.9
Philip Armstrong
3.9
Å Hourglass Ö A quick hint for those writing a BASIC program using the
Hourglass. Often, if an error is generated from BASIC when the hourglass
is being used, it stays on the screen. This can be cured by
SYSöHourglass_Smashò or, if you have already done your error checking,
SYSöò causes a system error which has the same effect. Philip Armstrong
3.9
Å INKEY problems Ö If you have a loop which executes continuously and
rapidly, you might want to use:
3.9
key%=INKEY(0):IF key%=64
3.9
PROC_Fred ELSE IF
3.9
key%=65 PROC_Edith
3.9
to detect a keypress. However, remember that you should have only one
such INKEY statement in the loop even if you want to cater for many
different key presses because a single keypress can only be det-ected by
one INKEY(0) instruction. Steve Kirkby.
3.9
Å Keyboard cleaning (A300/400 series) Ö The keyboard that is supplied
with the computer is of the open Printed Circuit Board type. That is, a
conduc-tive film on the base of each key makes contact with large solder
plated areas called lands on the main PCB. This makes for a cheap and
reliable keyboard but it does have its problems because of its exposure
to the air in that dust can and does get in.
3.9
Iæve had my Archimedes A310 for over 2 years now and my wife lets it
live in the living room with us. I suppose I should keep the keyboard
covered with something when not in use but Iæve never got round to doing
this. Consequently, the keyboard has had to put up with me eating
biscuits, sandwiches and other unmentionables while typing. I suppose
the inevitable had to happen and one day the keyboard rebelled! I had
began to noticed over a period of several days that the space bar and
left cursor key where playing up until they refused to work at all. Of
course, this happened a week after the guarantee had run out!
3.9
Visions of massive bills loomed before me so I decided to undertake the
task of opening the keyboard case and having a look! I first switched
off the Archimedes and unplugged the keyboard cord from the computer. I
removed the mouse and turned the keyboard face down with the Reset
button towards me. I noted that eight large, long hex screws held the
back section of the keyboard case on. After removing these I just lifted
the back section away and placed it somewhere safe. The Reset button
looked slight delicate so I removed it by simply pulling it off. I made
a mental note of which way round it came off.
3.9
I had a good look and there were seven large, short hex screws holding
the top keyboard casing to the main PCB frame. I removed these screws
and lifted the PCB off, putting the top casing away to another safe
place. I was half expecting the key tops and switches to try and escape
at this point but they are firmly attached to a metal frame!
3.9
Biscuit supply Ö Turning the PCB over and looking at the top surface
between the key tops I was amazed to see a surprising amount of dust and
what looked like a secret supply of Burtons biscuits! I duly removed
this with a dry paper towel and again placed the board face down after I
had a good look at the electronics on the board, but I resisted the
temptation to touch (I suggest you do the same).
3.9
All that now remained to do was remove the twenty small hex screws
holding the PCB to the switches. I started with the black screw at S94
position (this is written on the PCB) and noted that this was the only
small screw not actually threaded on to a switch. I removed the other
nineteen screws and gently lifted the PCB off the metal frame holding
the keys on.
3.9
The contact plates of all the key switches where now exposed and they
consisted of thin silver discs which when pressed make contact with the
PCB lands and therefore closed the contacts. These plates looked
extremely fragile but clean so I left them well alone!
3.9
Cleaning Ö The PCB lands were dirty, especially around the Space and
Left Cursor key positions and, being very careful not to put any grease
from my paws onto the board, I wiped the entire PCB with a dry paper
towel. Reassembling the keyboard was easy. I just placed the PCB face
down on to the metal frame holding the keys and lined up the small
screws positions. A good tip in reassembling something like this is to
begin placing the screws in from opposite ends and not to tighten up any
of the screws until they are all in place.
3.9
Once that was done, making sure that the black screw was in the correct
position, I placed the top section face down on the work table and
positioned the assembly down onto it, again fitting the seven large
short hex screws in place. I refitted the Reset moulding into place with
a resounding click and finished off by screwing down the last eight
large long hex screws into place. I turned the complete keyboard over
and plugged it back into the Archimedes and Iæm glad to say it works a
treat! Stuart Halliday
3.9
Å OsSys module Ö Shortly after the release of the OsSys module, I was
told that one couldnæt use SWIæs that needed a pointer to a buffer
because no such facilities where made available. I argued that this was
very easily implemented and changed the module accordingly. When doing
this, I also noticed a minor bug in the module. When a string longer
than 300 characters is passed, the module is supposed to generate an
error. This works fine but, due to a problem during the development, I
mistakenly thought that the pipeline was playing up when generating this
error. (Not all of the error text was displayed: the first 4 characters
were missing). I solved this by adding 4 to the PC when generating the
error. Quite wrong of course. I discovered that not the pipeline but I
was to blame. I had forgotten to put the error number (4 bytes) in
before the error message.
3.9
To upgrade the OsSys module to version 1.8, load the source code into
BASIC V and change/add the following lines:
3.9
10 REM >OsSysSrc18
3.9
350 EQUS ö1.80 (05 Apr 1990)ò
3.9
600 MOV R3,#500
3.9
610 SWI öOS_Moduleò
3.9
611 ;By claiming a larger workarea than required by the
3.9
612 ;the module, you can use the top of the work area to
3.9
613 ;create workspace for SWI calls that require pointers to
3.9
614 ;such a workspace. Eg. calls to WIMP or VDU.
3.9
650 EQUS öOsSWICalls v1.80 by M. Hendrix => Installedò
3.9
2510 REM remove this line. Itæs incorrect
3.9
3180 EQUD &01 ;Error number
3.9
Save and run the program.
3.9
The new module will claim more workspace than it actually needs. The top
200 bytes can thus be used for SWI buffers. You can use *MEMORYA to edit
the buffer(s). If you need more space for a buffer just change the value
#500 in line 600 to your desired amount of memory. (Donæt forget to add
300 bytes for the module itself!) Maurice Hendrix
3.9
Å Random number generator Ö If you use the use the random number
generator (RND in BASIC), it must be initialised with something really
random, such as the current time. Otherwise, the same num-bers will be
produced every time the program is run. The otherwise excellent game
!Yahtzee on Care-ware 4 suffers from this problem but it can easily be
solved: insert the line 123 Junk = RND(-TIME) and then every game is
different. Jonathan Puttock
3.9
Å The Dreaded CLI! Ö One of the nicest aspects about the Archimedes is
the Configure command. This command is often forgotten about as it lies
in that terrible place called the Command Line Interpreter (CLI)
accessed by pressing the dreaded function 12 key. One of the many things
that the Configure command does and seems to get lain aside is the
WimpFlags options. This very useful command determines the action of all
the windows used by RISC-OS in as far as it controls the two types of
window movement, resizing and scrolling. What two types?, I hear you
ask.
3.9
Status Ö Well if youæve never used the WimpFlags command before then you
have probably put up with the kind of windows which, when you change
their size or move them, all you get is a large dotted outline which
turns into a solid window when you release <select> or <adjust>. Now you
have an alternative. If you first press F12 from the Desktop and type in
*STATUS <return> youæll get a large list of items and near the end is a
line Wimpflags x, this x number (it may be 0) is actually the decimal
representative of a binary pattern of this number which switches on or
off the various options under this command.
3.9
If you type in *HELP WimpFlags <return> then the following should
appear:
3.9
*HELP WimpFlags
3.9
==> Help on keyword WimpFlags
3.9
*Configure WimpFlags sets the
3.9
default actions when dragging
3.9
windows, as follows:
3.9
bit 0 set: continuous window movement
3.9
bit 1 set: continuous window resizing
3.9
bit 2 set: continuous horizontal scroll
3.9
bit 3 set: continuous vertical scroll
3.9
bit 4 set: donæt beep when error box
3.9
appears
3.9
Syntax: *Configure WimpFlags <number>
3.9
Simply put, if you where to type in say:
3.9
*CONFIGURE WimpFlags 1 <return>
3.9
and press <ctrl-break> (you need to do this each time you enter new
values to actually change the values!) youæll see that if you move any
window it will be instant! If you want to try some more Éconfiguringæ
try changing the WimpFlags to 2 to see only instant window resizing or 3
for both. (Donæt forget to press <ctrl-break> afterwards!) If you do not
like this new look, simply change Wimpflags back to 0. The next two
options concern the scroll bars and these are really useful. If you
change WimpFlags to 8 youæll see that by dragging the pointer up and
down the vertical bar youæll get a smooth scroll effect, much better
than constantly clicking the arrow icons! Try WimpFlags set to 4 for
horizontal scroll or even 12 for them both at the same time.
3.9
Error Ö The last option just stops the error box beeping at you. Try
WimpFlags set to 16 and then Select an empty disc drive. Remember you
can combine any of these together by simply adding their numbers
together and configuring the WimpFlags. Try WimpFlags set to 31, this is
my favourite! Stuart Halliday
3.9
Å Arthur Fonts Ö when using the FontDes program supplied with Arthur
operating system, it is possible to vary the thickness of one or both
ends of the line. This is achieved by using the adjust button when the
mouse is positioned over a line in a öchar fullò window (this then
highlights the line) and then pressing the menu button at either end of
the line. This will bring up a Épen ratioæ window which allows you to
alter the percentage ratio of the pen at that point, the ratio is set by
clicking on the percentage windowæs quit box.
3.10
3.10
Å Extra Brushes for !Paint Ö you can add your own brushes to the !Paint
package by including the desired shapes in the ÉSpritesæ file i.e.
3.10
(i) Open up the !Paint directory by double clicking on !Paint while
holding the shift button down
3.10
(ii) Load the ÉSpritesæ file into !Paint
3.10
(iii) Create the brush shapes you want in this file
3.10
(iv) Save the ÉSpritesæ file
3.10
Donæt forget to make a note of the names of the brushes you created so
that you can access them from the tools menu. David Parker
3.10
3.10
Å Hard Spaces can be entered using the <alt> key and typing <1><6><0> on
the numeric keypad but a much quicker way is just to type <alt><space>.
Charles Moire
3.10
3.10
Å Lightning strikes Ö Be warned! Donæt leave your modem connected to
the phone line when there is an electrical storm. I did and the spikes
that came up the phone line killed a new V22bis modem and the RS423 port
on the Archimedes! David Leckie.
3.10
3.10
Å Memory Saving Ö It is worth remembering that sprites with masks take
up twice as much room as those without. If all sprites are altered with
!Paint to remove the mask, a considerable amount of memory can be saved.
Ian Hamilton.
3.10
3.10
Å Printing with 1M Ö when using Draw, Paint, Impression, Acorn DTP, etc
you can quit !PrinterDM (or whatever printer driver you use) to reclaim
about 80k of RAM. It would appear that these applications only need the
modules that remain in the RMA area after the !PrinterDM application has
been quit so all the print options are still available. R J Denison
3.10
3.10
Å Wimp Window Drawing Ö The usual construction for defining a graphic
window and drawing into it would look something like this:
3.10
DEFPROCgraphic_window
3.10
VDU26,5,24,graphicsbx%;graphicsby%;graphicstx%;graphicsty%
3.10
ORIGIN reportbx%-scrollx%,reportty%-scrolly%
3.10
ENDPROC
3.10
3.10
DEFPROCdraw_text (x%,y%,text$)
3.10
MOVE x%,y% : PRINT text$
3.10
ENDPROC
3.10
3.10
This will work okay until the values in the origin statement exceed
32767. I found that I had blank screens in the middle of large reports.
The following changes cured the problem:
3.10
DEFPROCgraphic_window
3.10
VDU26,5,24,graphicsbx%;graphicsby%;graphicstx%;graphicsty%
3.10
y%=reportty%-scrolly% : compensationy%=0
3.10
REPEAT
3.10
IF y%>32000 THEN y%-=32000 : compensationy%+=32000
3.10
UNTIL y%<=32000
3.10
ORIGIN reportbx%-scrollx%,y%
3.10
ENDPROC
3.10
3.10
DEFPROCdraw_text (x%,y%,text$)
3.10
MOVE x%, y%+compensationy%: PRINT text$
3.10
ENDPROC
3.10
Although you would have a problem in the x-direction, it is unlikely
that a window would be that wide. A similar change could be applied if
this was necessary. Ian Hamilton.
3.10
Å Blanking discs Ö (Iæm sure weæve had this before, but not everyong has
picked it up and I couldnæt find a reference to it in the Archive
database.) If you have a disc that has lots of files on it and you try
to clear them all off by deleting them, it can take ages Ö it would be
quicker to reformat the disc. Even quicker though is to get an existing
blank disc and do a backup from that to the disc to be blanked Ö it
takes just a couple of seconds.
3.11
Å ChkSpr Ö In answer to Ray Dawsonæs plea for help about !ChkSpr
supplied on shareware disc 19: if you open up the !ChkSpr directory,
amongst the files you will find one called Échkspræ and one called
!BootÉ. If these two files are copied into any Impression document
directory and if you then rename the document directory, instead of the
Impression sprite not appearing because the name no longer corresponds
to the document name (as normally happens) it will appear correctly.
This is because the chkspr utility, when run by the new !Boot file,
checks the name of the first sprite in the sprite file and changes it if
the name is not the same as that of the document. This utility can also
be used to keep the correct sprites for applications. For example, when
developing an application, different versions may be kept, all with the
right sprite file. Simon Burrows and Emmet Spier.
3.11
Å ColourTrans module Ö I have noticed that each of the printer drivers
on the RISC OS extras disc contain their own copy of the Colours module!
This is at odds with the policy of storing all shared modules in the
!System directory (you will probably already have a copy of the Colours
module there Ö many applications use it).
3.11
To avoid wasting disc space (though Colours uses little) you can remove
this module from within each printer driversæ directory and edit the
!Run file for each driver to call Colours from the !System folder.
3.11
i.e. in each !Run file the line
3.11
RMEnsure ColourTrans 0.52 RMLoad <PDriver$Dir>.Colours
3.11
should be replaced with
3.11
RMEnsure ColourTrans 0.52 System:Modules.Colours
3.11
To be even more correct two extra lines should also be added (e.g. like
the !Spark and !Draw applications). The above on its own relies on the
desktop having already seen your !System directory, you should therefore
put the line
3.11
Ifö<System$Path>ò = öò Then Error 0 System resources cannot be found
3.11
before the changed line above to check that this is the case. You
should also put the line
3.11
RMEnsure ColourTrans 0.52 Error You need ColourTrans 0.52 or later
3.11
after the changed line Ö this will check that the module has been loaded
satisfactorily.
3.11
The Printer Drivers on the original RISC-OS Application Disc I did not
load the Colours module when they were installed and so do not have this
problem. Simon Butler.
3.11
Å Debugger/Dissassemble returns an incorrect length for SWI instructions
Ö it returns the length as one too many Ö you get an extra null
character on these instructions. As all returned strings are null
terminated, I found it easier to scan for the null in order to find the
length. The zero makes no difference to screen or printing, but if
written to a text file looks ugly in !Edit. Kevin Quinn.
3.11
Å Desktop bug Ö There appears to be a fatal bug in the Window Manager of
RISC-OS 2.00. It occurs when you drag a menu, and whilst you are
dragging it, press the <escape> key to remove it. If you then stop
dragging the menu, the system will report an ÉAddress exception at
&386BCICæ, the application which created the menu will die fatally and
most often, all the other applications will die as well, resulting in
the computer Ébombing outæ of the desktop into the CLI. Tom Lakofski.
3.11
Å DXF files Ö Users of DXF files which are comprised only of BLOCKS and
ENTITIES (or maybe just ENTITIES alone) will find that !Draw does not
enable the use of its facility for specifying font types when the DXF
file is just loaded.
3.11
The inclusion of the code below (i.e. a TABLES section) appears to solve
this problem. Of course !Draw must have previously Éseenæ the relevant
!Fonts directory. The full sequences for the sections, if all are
present is HEADER followed by TABLES, then BLOCKS + ENTITIES. Jim
Markland.
3.11
0
3.11
SECTION
3.11
2
3.11
TABLES
3.11
0
3.11
TABLE
3.11
2
3.11
STYLE
3.11
70
3.11
20
3.11
40
3.11
0
3.11
41
3.11
1
3.11
50
3.11
0
3.11
71
3.11
0
3.11
3
3.11
STANDARD
3.11
0
3.11
ENDTAB
3.11
0
3.11
ENDSEC
3.11
Å Greek3 re-caching Ö To stop the Greek3 outline font supplied with
Impression from recaching itself too often all you have to do is rename
it from ÉGreek3æ to ÉGreekæ. Michael Ben-Gershon.
3.11
Å On/Off icons, for example option icons in windows, are implemented by
using the ÉSæ command in the validation string of an icon with
indirected text and sprites on. FormEd will allow you to set these up Ö
switch on indirected stuff, put text (if any) into the text item, and
select sprite Ö donæt put anything in the sprite sub-menu writeable icon
and put the sprite name(s) in the indirected validation string, e.g.
Ésopton,optoffæ. Then by inverting the iconæs inverted bit it will swap
over the icons Ö see the calls Wimp_SetIconState and Wimp_GetIconState
(pages 1211-1213 of PRM). Details of validation strings are on pages
1184-1187 of the PRM. Kevin Quinn.
3.11
Å OS_Heap Ö While trying to use the Heap facility in RISC-OS, we found
that OS_Heap 6, which returns the size of a heap block, returns the size
including the word at the start containing length. This is unexpected
given the Abstract Data Type philosophy that appears to have been used
for the rest of the system and means that the user knows where the
length of a block is stored and can read it without using OS_Heap 6 Ö
and incidentally, means Acorn canæt rewrite their Heap manager unless
this word is left in the same place. James Chong.
3.11
Å RenderBender on SCSI hard disc drives. As you will know, you cannot
access the hard drive, by using the HARD 4 icon. Some of you may have
already tried unsuccessfully to alter the program, by altering the
variable HD% to 1, to try to force the program into recognising the hard
drive. The following alterations should be made to the !Runfile, Render
and Anirout in the utilities directory. The code will save all pictures
to the specified directory if you have not put the Render Bender
directory in $...
3.11
For the Render program :
3.11
15 *SET RendHard1 SCSIFS::4.$.!Render
3.11
40 curd$=ö4ò:moder%=FALSE
3.11
15890 A%=32
3.11
15940 IF A%=32 AND HA%>0 GOTO 15920
3.11
16020 IF A%=32 THEN curd$=ö4ò:*SET REdrive SCSIFS::4.$.!Render
3.11
For the Anirout program:
3.11
6800 IF A%=BE% THEN *SET REdrive SCSIFS::4.$.!Render
3.11
You should then use the edit program to alter the !Run file as follows:
3.11
The line that begins *IF obey$dir... should be changed to...
3.11
*IFobey$dir=öadfs::Render.$.!Renderò THEN *SET RendHard1 SCSIFS::4.
3.11
$.!Render ELSE *SET RendHard1<Obey$Dir>
3.11
The previous code may seem a bit long winded but I have unfortunately
not been able to get the *KILLADFS command to work with my version.
Neil Berry.
3.11
Å Screen size Ö The screen size in O.S. co-ordinates may be found using
OS_ReadVduVariables and variable numbers 4 (XEigFactor),5(YEigFactor),11
(XWindLimit) and 12 (YWindLimit). The last two are hidden over the page
and for a while I missed them (pages 345-348 and 350-352). There is
also a message that the Wimp broadcasts when the user changes mode,
enabling your task to keep uptodate on screen sizes Ö important for drag
boxes amongst other things. See page 1259. Kevin Quinn.
3.11
Å System Variables for Filer Module Ö This little routine enables you to
use RISC-OS variables with the Filer_OpenDir and Filer_CloseDir
commands. This means that you can do commands such as öFiler_OpenDir
<Obey$Dir>.DataFilesò and make programs totally independent of where
they are on the disc. The module requires about 14k of free memory in
the RMA. The program has been written in such a way that it should work
with all future versions of the Filer.
3.11
REM >Filer
3.11
*RMKill Filer
3.11
*RMReInit Filer
3.11
*RMFaster Filer
3.11
SYS öXOS_Moduleò,18,öFiler%Baseò TO ,,,CodeBase%
3.11
TableBase%=CodeBase%+CodeBase%!ñ18
3.11
Info%=FN_LookupInfo(öFiler_OpenDirò)
3.11
TableBase%!Info%=TableBase%!Info% OR &00000100
3.11
Info%=FN_LookupInfo(öFiler_CloseDirò)
3.11
TableBase%!Info%=TableBase%!Info% OR &00000100
3.11
END
3.11
:
3.11
DEF FN_LookInfo(Text$)
3.11
LOCAL Offset%,Command$
3.11
Offset%=0
3.11
REPEAT
3.11
Command$=öò
3.11
REPEAT
3.11
Command$+=CHR$(TableBase%?Offset%)
3.11
Offset%+=1
3.11
UNTIL TableBase%?Offset%=0
3.11
Offset%=(Offset%+16+3) AND NOT 3
3.11
UNTIL Command$=Text$ OR TableBase%? Offset%=0
3.11
IF Command$=Text$ THEN =Offset-12 ERROR 0, öI canæt find ò+Text$
3.11
There is one slight problem with this routine due to the way that RISC-
OS implements the *RMFaster command by re-initialising the module. This
means that the Filer icon disappears from the Desktop and cannot be
recovered without restarting the desktop so the routine is probably best
placed in a boot routine that subsequently starts up the desktop. Simon
Callan.
3.11
Å TWIN 8000 Ö If you load TWIN at an address other than hex 8000 the
<f10> key functions (goto, newtime, etc) do not work. It caused me no
end of problems and phone calls to Acorn before I realised this.
3.11
Å Greek3 outline font problem Ö I was very interested to read, in
Archive 3.11, about solving the problem of the slowness of the Computer
Concepts Greek3 font. The root of the problem was that the internal and
external names should be the same, and the article suggests that you can
simply rename the !Fonts.Greek3 directory to !Fonts.Greek, which is very
quick and easy. However, if you do this then any existing !Draw files,
etc containing the Greek3 font will not display with ordinary system
font characters. It seems desirable to retain the external name Greek3.
3.12
I think that the best course of action is to change the internal name
from Greek to Greek3, using the Acorn !FontEd application. The article
mentions this without saying HOW to do it; it was all GREEK to me! So
after I found out the hard way, here is an idiots guide...
3.12
Install !FontEd on the iconbar, open up the !Fonts.Greek3 directory, and
you will see the IntMetrics and Outlines files. Drag the Outlines file
onto the !FontEd icon on the iconbar. A window will then open showing
all the Greek characters. After a pause, you will hear a beep to show
that the operation is complete. Now click <menu> over this window and
use the Alter->Font name option to change it from Greek to Greek3. Now
choose the Save->Outlines and Save->Metrics options in turn; just click
on the OK boxes, as the file and path names are fine as they are. Be
very careful not to change anything else! Richard Stery (Wakefield BBC
Micro User Group)
3.12
Make sure you take a backup before you try this as you risk losing the
font if you get it wrong. Donæt say we didnæt warn you! Ed.
3.12
Å Recovering deleted files Ö If you accidentally delete a file you can
still recover it so long as you take the following steps:
3.12
(i) Do NOT write any data on the disk.
3.12
(ii) Use the !DiscEdit program on Careware 2 and look for your file on
the disc and note the address (in hex) of the start and end of the file.
3.12
(iii) Now you can use these addresses with the file recoverer program on
Shareware 9 to extract the file from the disc. Dirk Schafer.
3.12
Å RenderBender on SCSI Ö In the hint last month, Neil Berry was
obviously using an early version of Oakæs SCSI interface software in
which the filing system was referred to as SCSIFS, so all references to
öSCSIFS::ò should be replaced by öSCSI::ò.
3.12
Å SWIöOS_PrettyPrintò works in VDU 5 mode (print text at graphics
cursor) as well as VDU 4 mode (print text at text cursor). It formats
the text according to the current graphics clipping window (set by VDU
24). For more details on OS_PrettyPrint see Archive 1.7 p9. Paul
Witheridge.
3.12
Å System variables for the Filer Module (revisited) Ö Here is a simpler
solution to the problem of not being able to use system variables with
the *Filer_OpenDir and *Filer_CloseDir commands than was suggested in
Archive 3.11 p7.
3.12
*SetMacro Alias$Filer_OpenDir Set Alias%Foo %Filer_OpenDir
%0|Mfoo|MUnset Alias%foo|M
3.12
*SetMacro Alias$Filer_CloseDir Set
Alias$foo%Filer_CloseDir%0|Mfoo|Munset Alias%foo|M
3.12
Once these two lines have been typed, *Filer_OpenDir and *Filer_CloseDir
can then be used with system variables. Michael Ben-Gershon.
3.12
Å !Edit functions keys Ö Two more undocumented function key actions for
EDIT (in addition to <shift><f1> as described in Archive 3.4 p5). These
are: <Ctrl><f2> which is equivalent to clicking on the window close icon
and <ctrl><f7> which toggles between the current caret position and the
beginning of a marked block. Paul Witheridge.
3.12