home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Archive Magazine 1997
/
ARCHIVE_97.iso
/
text
/
hints
/
volume_02
< prev
next >
Wrap
Text File
|
1995-06-25
|
256KB
|
8,037 lines
Å How to wipe a disc clean Ö If you want to wipe a disc completely
clean, you can use *WIPE * ~CFR<return> (Use this command with care Ö
thereæs no going back once youæve pressed <return>!) Ö in other words,
remove files with any name (*), donæt ask for confirmation of each wipe
(~C), force them (F) to be deleted even if they are locked and do it
recursively (R) so that the contents of all directories are deleted.
However, even this drastic measure wonæt allow you to delete a library
directory if one exists. So do a *Lib öò<return> before the *WIPE
command.
2.1
Å GammaPlot/System Delta Plus Ö If you have been trying to import SDP
files into GammaPlot and have been unsuccessful, read on╔ Firstly you
have to copy the System Delta Plus software onto your GammaPlot disc.
Then if it still doesnæt work, it will be because you have an older
version of System Delta Plus. Send the original SDP disc back to Minerva
and ask for an up-grade.
2.1
Å Mounting problems (sic) Ö Do you find that sometimes it refuses to
respond to a *MOUNT command even if you take the disc out and put it
back in again? Two solutions: type *BYE and then you should find that
*CAT will cause it to access the disc OR if, like me, youæve got *MOUNT
on a function key, just do a *MOUNT with no disc in the drive then
*MOUNT with the new disc in place. If you are in First Word Plus where
you cannot issue star commands anyway, the latter technique should do
the trick since you can achieve the equivalent of *MOUNT by clicking on
the close box (the X) in the file menu. (Just as a matter of interest,
does anyone know why it gets into this state sometimes?)
2.1
Å Users of C (and other compiled languages) may find the following
command file useful, as sent in by Peter Linstead. You can put it in the
$ directory of your hard disc and use it when starting a C programming
session. Once you have assigned your current programæs name to NAME
using, for example, *SET NAME MYPROG you can edit the source file by
pressing <f1>. Once out of TWIN, <f2> will compile and link the source
code and <f3> will execute the run code. By using SETMACRO, you can
change the working name with another *SET command without running the
command file again. It assumes that both FPE and TWIN are in the
$.Library.
2.1
*| > $.Library .C
2.1
*FPE
2.1
*DIR $.ARM.BENCH
2.1
*SETMACRO ALIAS$AUTOT *TWIN
2.1
C.<NAME> |M
2.1
*SETMACRO ALIAS$AUTOC *CC <NAME>
2.1
Ö LINK |M
2.1
*SETMACRO ALIAS$AUTOR *RUN
2.1
P.<NAME> |M
2.1
*KEY 1 *AUTOT|M
2.1
*KEY 2 *AUTOC|M
2.1
*KEY 3 *AUTOR|M
2.1
*SET RUN$PATH ,%.,$.ARM.LIBRARY.,@.P.
2.1
*GOS
2.1
(I have just reproduced this from Peteræs hand-written letter and I
havenæt got C to try it out on, so I hope Iæve transcribed it correctly.
If it hadnæt been for the postal strike Iæd have sent it to David Wild
first, so please bear with us if you find it is not completely correct.
Ed.)
2.1
Å ANSI C Compiler Ö Mike Sherratt writes╔ öOn a very fundamental note╔
The manual is very terse. To compile the demo programs on the distribu
tion diskette Ö Balls64, Sieve and Hello, heed the ReadMe file where it
says ÉRMLoad the FP emulator etc i.e. RMload fpe240æ. Get to the
directory level ÉBenchæ then do:
2.1
*CC ÖArthur Sieve
2.1
The spaces are significant, ÉÖæ is minus. The Sieve source file is in
sub-directory Écæ. The executable file is now in sub-directory Épæ.
2.1
The program can be run from the star prompt by typing *Sieve. The Éc.æ
prefix is embedded (for lack of a better word) in the compiler, so donæt
try to create the prefix!! You are now on the way.
2.1
This information came thanks to Watford Elec-tronics who used Acornæs
dealer hot-line for me.ö
2.1
(Because of the postal strike, this has been inserted by the Ed rather
than sending it to David for checking, so hopefully it will be OK!?)
2.1
Å Formatting from programs Ö If you want to write a disc copier
program, as we at Archive obviously did for copying the program discs,
you have to find some way to get round the fact that *FORMAT asks for a
keyboard confirmation. We did it by creating a file on the second drive
that consisted of just <Y> and then called that is input from the
program. Ingenious! But then we found the easy (undocumented) way of
doing it:
2.1
*FORMAT 0 D Y
2.1
Simple if you know how!
2.1
Å Replacement 3.5ö disc drives Ö One reader had to replace his 3.5ò
drive and Acorn could only offer him the official second disc drive up-
grade (which includes a new front facia which he didnæt need) so he
bought an un-cased 3.5ö drive from Matmos Ltd (1 Church Street,
Cuckfield, W.Sussex, RH17 5JZ, 0444Ö414484) for ú59.50 + ú3 carriage +
VAT. This drive was almost a direct fit and only required some judicious
filing of the button slot to complete the replacement.
2.1
Å Debugging ARM code listings Ö It is sometimes useful for non-ARM
code specialists who want to type in ARM code program listings to have
Éwayside pointersæ as the code runs to help them debug the program and
find out where they have made typing errors. Adding the occasional SWI
&1nn (where nn is 30 to 39 for number 0 to 9) will print out these
numbers as an indication of how far the program has got. (Better still,
buy the monthly program disc!!! Ed.)
2.1
Å Mannisman Tally printers with serial interface Ö Pin connections
are: pins 1, 4 and 6 linked together on the Archimedes, pin 3 to pin 3
on the printer, pin 5 to pin 7 on the printer and pin 8 to both pins 11
and 19 on the printer.
2.2
Å SWI öXOS...ò Ö If you are using SWI öXOS...ò commands so that you
can handle your own errors, it will fail if you try to return
immediately after this command to the calling routine. A dummy instruc
tion needs to be inserted before the LDMFD instruction. Presumably a
Éfeatureæ of OS 1.2.
2.2
Å Problems with *Memory and *MemoryI Ö If you try to use these two
commands in the debugger with the aim of dumping to printer, you will
find that codes above &7F are not weeded out Ö they are all sent to the
printer regardless which can cause all sorts of problems. The following
program patch will solve the problem.
2.2
10 REM> DEBUGPCH
2.2
20 REM (C) JW^2 4th OCTOBER 1988
2.2
30 DIM A% &270C
2.2
40 OSCLIöSAVE Debugged_D 38486A0
2.2
+270Cö
2.2
50 OSCLIöLOAD Debugged_D ò+STR$~A%
2.2
60 FOR F=0 TO 3 STEP 3
2.2
70 P%=A%+&2230
2.2
80 [
2.2
90 OPT F
2.2
100 STMDB R13!,{r0-r9 ,R14}
2.2
110 .LOOP
2.2
120 LDRB R0,[R9],#1
2.2
130 CMP R0,#&7F
2.2
140 MOVHS R0,#&2E
2.2
150 CMP R0,#&1F
2.2
160 MOVLS R0,#&2E
2.2
170 SWI öXOS_WriteCò
2.2
180 BVS (LOOP+&35D)
2.2
190 SUBS R2,R2,#1
2.2
200 BNE LOOP
2.2
210 ]
2.2
220 NEXT
2.2
230 OSCLIöSAVE Debugged_D ò+STR$~A%+
2.2
ö +270Cò
2.2
240 OSCLIöSETTYPE Debugged_D &FFAò
2.2
Å EDITæs disappearing cursor Ö If you use Éoptionsæ (<shift-f3>), you
can change to a non-flashing cursor which is visible all the time, and
you donæt have to change it each time you switch on the machine because
EDIT stores its options in cmos ram. (Anyone know if thereæs a way to
re-program it to change the colour of the cursor?)
2.2
Å Putting sound through the monitor Ö It is perfectly possible to put
the sound output from the 3.5mm stereo jack socket on the Archimedes
through the amplifiers and speaker(s) of both the standard Acorn colour
monitor and also the Phillips CM8833. All you need is a piece of twin
screened cable (though actually I used ordinary thin three core mains
flex which is OK for such a short length) and a 3.5 mm stereo jack plug
(RS Components 274Ö284, ú1.19 for two). The SCART plug connections are
that pin 2 is right audio, 4 is earth and 6 is left audio. The pins
should be numbered, but if not, 2, 4 and 6 are the first three pins
along the long edge of the plug starting from the rectangular end.
2.2
Three possible problems: firstly, you may find that the SCART plug has
no pins at positions 2, 4 and 6 in which case you will have to buy a new
plug (Tandy N╝ 15Ö7030, ú1.49 each) and re-wire the other connections.
Secondly, you may find that your cable doesnæt fit through the space
available for the cable entry in the SCART plug Ö in which case, some
judicious hacking of the plastic is needed. Finally, if the SCART plug
has got pins at 2, 4 and 6, you may not be able to get at them to solder
onto them. The solution here is to push each of the three pins back out
through the body of the plug, solder them then push them back in again.
It sounds easy but itæs not Ö there are little barbs the stop the pins
being pushed out so you have to try to manipulate these and push the
pins out at the same time Ö OK if you have three hands!
2.2
The result Ö If the kids want to play Orion at full volume, they can,
but I can turn it back down to a sensible volume when I use the system.
2.2
Å Stereo Speakers Ö I recently followed the suggestion in Archive 1.2,
page 7 and purchased the amplified speakers (Model 40-1259E) from a
local Tandy store. Initially I also purchased a couple of mains adaptors
to power each unit but I found that this caused a considerable mains hum
through both speakers. Upon returning to the Tandy store, I was advised
that hum was caused by the mains adaptors not being earthed and, rather
than spending more money on earthed mains adaptors, I exchanged the
original adaptors for re-chargeable batteries which seem to work fine Ö
there are also fewer wires trailing around! Whilst the stereo effect is
very good, there is a problem in that there is no volume control fitted
to these speakers; the suggestion from one of the staff at Tandy was to
wire in two of their öL-Pad Speaker Level Controlsò. Have any other
Archive readers tried this or come up with a different solution?
2.2
I have found that by amending the *Configure SoundDefault middle
parameter to a lower value than 7, the volume can be reduced, this does
provide some measure of control of sound volume; these parameters can
take a value of 0 to 7 with each unit corresponding to one eighth of the
overall maximum volume (see PRM, page 537).
2.2
Å Monitor problems (with solutions!) Ö Fujitsu and MAG 14C Ö The
problem began on the MAG with a distortion of the top few lines of the
display when in a multisync mode. The nature of this problem suggested
that the monitor took several scan lines to lock onto the composite sync
signal fed to it from the Archimedes. It was decided to feed it with
separate vertical (frame) and horizontal (line) sync signals, which
necessitated having to alter the preset links 10 and 11 within the
Archimedes. At present this involves cutting a track (Lk10) and
inserting a link (Lk11), since these links are not brought out on the
normal Molex type links. Having done this modification you need a
*Configure Sync 0 to set ÉVertical sync onlyæ instead of ÉComposite
syncæ to the monitor, otherwise the display rolls (indicating lost frame
sync). This then cured the screen distortion problem but because of the
way Acorn have put Composite/Vertical sync on the green signal, it kills
the green output. With much trepidation this problem was overcome by
disabling Acornæs implementation of this signal by cutting pin 2 of IC
4. The result is a perfect picture.
2.2
The Fujitsu monitor problem was much simpler and cured far easier after
the troubles with the MAG.
2.2
Although the picture quality was very good, there was an excess of
green, even though R39 had been removed (see Archive 1.3 p8) It was
originally thought that some internal adjustment of the green gun was
needed but, with the experience of MAG monitor (and having tried it on
the modified sync signal from the green output) the link changes proved
unnecessary as the monitor worked perfectly happily with composite sync.
Again the result was a perfect picture.
2.2
Anyone wanting further information on this modi-fication can either
contact Reg Dalton on 0742 487992 (less technical/Evenings only) or
Steve Bass (who did all the work) on 0742 708028 (Daytime) or 0742
886622 (Evenings).
2.2
Å Screen saving from the SCML Teletext adaptor Ö R L Jefferies has
worked out how to dump screens from the SCML Teletext Adaptor. (Pressing
the ÉSæ command option gives an error but SCML have not replied to his
questions about that yet.) He has utilised Robin Newmanæs mode 7 to mode
9 utility as supplied on program disc 1.10. He copied this into the
library directory on the Teletext disc and then created a mode 7 to mode
9 screensave module using Neil Strongæs öPrintkey screen dumpò (issues
1.10 p 45 and 1.11 p 7). Two lines need altering in the source program:
2.2
line 840 should be changed to cmp r0,#83 and line 920 should be equs
öM7M9 screensave scr<file>ò
2.2
Note that you should *SETEVAL file XX before you load the öSò key module
and before executing the Teletext module. One small niggle is that Robin
Newmanæs module returns with the cursor ON. Is there an easy way to get
rid of this?
2.2
Å Bug in C Ö Karl Strickland writes╔ There appears to be a bug in the
fgets() function in version 1.54A (latest public release) of ANSI C.
Instead, use the function given below and declare it using
2.2
char *xfgets (char*,int,FILE*);
2.2
We have to use xfgets (as opposed to fgets) because the linker gets
confused if it finds the same function declared twice.
2.2
char* xfgets (char* a,int b,FILE *s)
2.2
{2 .2
int c,d;
2.2
*a=NULL; /* Must include STDIO.H */
2.2
for (c=0;c<b;c++) {2 .2
d=fgetc(s);
2.2
if (d==EOF)
2.2
return NULL;
2.2
else
2.2
if (d==13)
2.2
return a;
2.2
else
2.2
strncat(a,(char*)&d,1);
2.2
}
2.2
return a;
2.2
}
2.2
Å A hint for Twin from Bj┐rn Fl┐tten Ö When using Twin to edit large
BASIC programs you can easily run out of memory. (Twin complains by
hanging up the computer when called.) This is because of the inconveni
ent way Twin is called from BASIC. Because Twin works on ASCII files,
BASIC has to expand the current program from tokenised form to ASCII.
This copy is placed on top of the BASIC program and is maybe 20-30%
larger than the original. Then Twin is called and makes a new copy of
the program which it places on top of itself. This means that an
unnecessary lot of memory is used.
2.2
One solution is to let Twin run from the address of PAGE. This works
because Twin is not loaded into memory before the BASIC program is
expanded. However, you will have to ensure that the BASIC program is
bigger than Twin, if not, Twin will be loaded over the expanded version
of your program.
2.2
(This unfortunately makes the problem of Twin not releasing some vectors
worse. This means that these vectors will point into the middle of your
BASIC program after exiting from Twin. Use reset after exiting to BASIC
and then OLD, to cure this.)
2.2
Å Problems with (Master) EDIT Ö If you get rubbish when you load up
the EDIT ROM image from the BBC Master into the 6502 emulator, try
loading it with:
2.2
*65arthur
2.2
*GO F800
2.2
*EDIT
2.2
Å From Arthur to BASIC Ö If you are in the Arthur supervisor and you
type *Progname where Progname is a BASIC program, it will run the
program and drop you back out into the supervisor (equivalent to *BASIC
Öchain Progname). However, if you *LOAD Progname, it switches to BASIC,
loads the program and gives you back control with a É>æ prompt Ö
equivalent to *BASIC Öload Progname but shorter to type and certainly
easier than *BASIC followed by LOAD öPrognameò. If you do a *SHOW, you
will see the filetype definitions which make sense of it all.
2.2
Å Sprites and Sprite Commands Ö Paul White-horn writes╔ The Sprite
Editor on the Welcome disc does not work properly being unable to create
masked sprites (those with a transparent back-ground) or to save shades
of colour that have been set up in the various edit modes. For many
board style games this is not an insuperable difficulty and for chess
and checkers, mode 1 creates reasonably detailed sprites in red, yellow,
black and white.
2.2
The simplest way of getting your own sprites from the Welcome disc onto
your game or program disc is to *SNEW to wipe out anything that can be
called a sprite in RAM, *SLOAD (by name or number) your sprite or sprite
file into the machine from the Welcome disc (you donæt need to be in the
Sprite Editor to do this), take out the Welcome disc, insert your game
disc, *MOUNT it and *SSAVE (name) the contents of the machineæs RAM.
Whatever sprites you have in RAM at this point will all go into a file
created and named by the *SSAVE command and will be placed on your own
disc.
2.2
To check that they are all safely installed on your game disc *SNEW
again (to clear RAM) and *SLOAD (name) the sprite(s) you have just
*SSAVEæd on your disc. Now typing *SLIST will bring up a list of ALL the
sprites in RAM which should correspond to the ones you have just
transferred from the Welcome disc. At this point you can rename the
sprites you see listed before you but the syntax for the *SRENAME
command is not as it appears in the User Guide. Type *SRENAME (oldname)
(newname) without commas or other punctuation marks separating the two
names and without any quote marks round the names. This renames sprites
in RAM and if you want these new names preserved on your disc then they
must be *SSAVEæd collectively back to disc and you can save them with a
different file name if you wish.
2.2
*SDELETE (name) deletes a sprite in RAM whereas *DELETE (name) deletes a
sprite (or file of sprites) on disc. Having weeded out sprites you donæt
require with *SDELETE it is best to *SSAVE those you do need (possibly
with a new file name) and *SNEW to clear RAM before proceeding further.
This way you will not have rogue sprites lurking in RAM or in files on
your disc where they may be called by default if they have the same name
or number as the new ones.
2.2
To create files of sprites from different sources you can use *SMERGE
which merges a sprite (or file of same) from disc with those already
installed in RAM. Those coming from disc have priority so if you have
two sprites with the same name or number, the one on the disc will
overpower its namesake in RAM. This command seems a little haphazard on
my 310 especially with sprites which are numbered and occasionally
several tries are needed to make it happen as required.
2.2
If you intend to choose sprites during the course of your game as a
consequence of numerical operations then it is necessary to use numbers
as names so that they can be called with the VDU command. The VDU call
takes variables with a range between 0 and 255 so make sure your sprites
donæt exceed this range.
2.2
*SINFO prints the size of the sprite workspace and *SCOPY (oldname)
(newname) copies the named sprite. *SGET picks up a portion of the
screen as a sprite but for details of this see the User Guide.
2.2
Å EMR SoundSynth + CC ROM podule Ö There has been a problem of a clash
between EMRæs SoundSynth and Computer Conceptsæ ROM/RAM podule in that
after using SoundSynth, the contents of the RAM filing system disap
peared! (Fortunately, I had a recent backup!) EMR have been looking into
the problem and have sorted it out. If you have had the same problem,
return your disc to EMR and they will replace it öin most cases, free of
chargeò.
2.2
Å Loading palette files Ö Here is a simple BASIC program to load a
ö!Paletteò file and set the palette up. The file format really is
simple: 3 bytes are stored for each colour Ö red, green and blue
respectively. This group of 3 bytes is repeated for all 20 colours saved
Ö logical colours 0-15, the border, and mouse colours 1-3.
2.2
10 REM >TestPal
2.2
20 REM ===> To demonstrate reading a
2.2
30 REM ===> Desktop !Palette file
2.2
40 REM By John Smith, September 1988
2.2
50 REM
2.2
60 MODE 12 :REM Any 16-colour mode
2.2
will do.
2.2
70 :
2.2
80 REM Put all 16 colours on screen,
2.2
and a 2-colour mouse pointer.
2.2
90 FOR x%=0 TO 15
2.2
100 GCOL x%
2.2
110 RECTANGLE FILL x%*80,0,80,1023
2.2
120 NEXT
2.2
130 MOUSE ON
2.2
140 *POINTER 1
2.2
150 PRINTTAB(0,0);öNow press a key to
2.2
load the É!Paletteæ fileö
2.2
160 dummy=GET
2.2
170 :
2.2
180 REM Now load the palette file.
2.2
190 handle%=OPENIN ö!Paletteò
2.2
200 REM Do östandardò colours first.
2.2
210 FOR loop%=0 TO 15
2.2
220 COLOUR loop%, BGET#handle%,
2.2
BGET#handle%, BGET#handle%
2.2
230 NEXT
2.2
240 :
2.2
250 REM Screen Border
2.2
260 VDU 19,0,24, BGET#handle%,
2.2
BGET#handle%, BGET#handle%
2.2
270 :
2.2
280 REM Mouse colour 1
2.2
290 MOUSE COLOUR 1, BGET#handle%,
2.2
BGET#handle%, BGET#handle%
2.2
300 MOUSE COLOUR 2, BGET#handle%,
2.2
BGET#handle%, BGET#handle%
2.2
310 MOUSE COLOUR 3, BGET#handle%,
2.2
BGET#handle%, BGET#handle%
2.2
320 CLOSE#handle%
2.2
Å InterWord to ArcWriter Ö if you have InterWord files from BBC days
and want to transfer them to ArcWriter, look in the First Word Plus
hints below where the transfer to FWP is achieved by transferring first
to ArcWriter.
2.2
Å Double-precision to BBC BASIC Ö following on from the floating point
BCD to BBC BASIC conversion program published in Archive 1.11, page 32,
Carl Cepurneek has done a routine which converts from the more efficient
Double-precision reals to BBC BASIC.
2.2
10 REM>Carl - FPU number conversion
2.2
20 REM BBC BASIC V to FPU memory
2.2
30 REM format conversions
2.2
40 REM Packed decimal print routine
2.2
50
2.2
60 REM Carl P.Cepurneek 26 Clyde St
2.2
70 REM Parkside, S.A.5063,Australia
2.2
100
2.2
110 DEFPROCcvt_s(bbc,adr) :REM from
2.2
BBC real at |bbc to FP at adr
2.2
120 LOCAL exp%,sign%,mant%
2.2
130 !adr=0:adr!4=0 :REM clear
2.2
140 IF |bbc=0:!adr=0:ENDPROC
2.2
150 exp%=(bbc?4)-&80 :REM get
2.2
adjusted exponent
2.2
160 IFexp%>0 exp%=exp%+126 ELSE exp%=
2.2
126-ABS(exp%)
2.2
170 !adr=!adr OR exp%<<23:REM set
2.2
exponent bits
2.2
180 sign%=!bbc AND &80000000
2.2
:REM isolate sign bit
2.2
190 !adr=!adr OR sign%:REM set sign bit
2.2
200 mant%=!bbc AND &7FFFFFFF :REM
2.2
clear neg bit if set
2.2
210 !adr=!adr OR mant%>>>8:REM set
2.2
mantissa
2.2
220 ENDPROC
2.2
230
2.2
240 DEFPROCcvt_d(bbc,adr):REM from
2.2
real at address bbc
2.2
250 LOCAL exp%,sign%,mant%
2.2
260 !adr=0:adr!4=0
2.2
270 IF |bbc=0:!adr=0:ENDPROC
2.2
280 exp%=(bbc?4)-&80 :REM get
2.2
adjusted bbc exponent
2.2
290 IF exp%>0 exp%=exp%+1022 ELSE exp%
2.2
=1022-ABS(exp%)
2.2
300 !adr=!adr OR exp%<<20
2.2
310 sign%=!bbc AND &80000000
2.2
:REM isolate sign bit
2.2
320 !adr=!adr OR sign%:REM set sign bit
2.2
330 mant%=!bbc AND &7FFFFFFF
2.2
:REM clear sign bit set
2.2
340 !adr=!adr OR mant%>>>11 :REM set
2.2
mantissa msbits
2.2
350 mant%=mant%<<21 :REM shift over
2.2
low bits
2.2
360 adr!4=adr!4 OR mant% :REM set
2.2
mantissa lsbits
2.2
370 ENDPROC
2.2
380
2.2
390 DEFPROCcvt_e(bbc,adr):REM from
2.2
BBC real at |bbc
2.2
400 LOCAL exp%,sign%,mant%
2.2
410 !adr=0:adr!4=0:adr!8=0 :REM clear
2.2
destination
2.2
420 IF |bbc=0:!adr=0:ENDPROC
2.2
430 exp%=(bbc?4)-&80 :REM get
2.2
adjusted exponent
2.2
440 IFexp%>0 exp%=exp%+16382 ELSE
2.2
exp%=16382-ABS(exp%)
2.2
450 !adr=!adr OR exp% :REM set
2.2
exponent bits
2.2
460 sign%=!bbc AND &80000000
2.2
:REM isolate sign bit
2.2
470 !adr=!adr OR sign%:REM set sign bit
2.2
480 mant%=!bbc OR &80000000 :REM set
2.2
top bit (J)
2.2
490 adr!4=adr!4 OR mant% :REM set
2.2
mantissa
2.2
500 ENDPROC
2.2
510
2.2
520 DEFFNprint_packed(base%)
2.2
530 LOCAL ms%,ms$,es%,es$,m%,s%
2.2
540 @%=&00001
2.2
550 m%=(!base% AND &80000000)>>>31
2.2
560 IF m%=0 ms$=ö+ò ELSE ms$=ö-ò
2.2
570 PRINT ms$;
2.2
580 m%=(!base% AND &F<<8) >>>8
2.2
590 PRINT m%;ö.ò;
2.2
600 FOR s%=4 TO 0 STEP -4
2.2
610 m%=(!base% AND &F<<s%) >>>s%
2.2
620 PRINT m%;
2.2
630 NEXT
2.2
640 FOR w%=4 TO 8 STEP 4
2.2
650 FOR s%=28 TO 0 STEP -4
2.2
660 m%=(w%!base% AND &F<<s%) >>>s%
2.2
670 PRINT m%;
2.2
680 NEXT
2.2
690 NEXT
2.2
700 e%=(!base% AND &40000000)>>>30
2.2
710 IF e%=0 es$=ö+ò ELSE es$=ö-ò
2.2
720 PRINTö Eò;es$;
2.2
730 FOR s%=24 TO 12 STEP -4
2.2
740 m%=(!base% AND &F<<s%) >>>s%
2.2
750 PRINT m%;
2.2
760 NEXT
2.2
770 =öò
2.2
Å Using 40-track drives Ö If you have a 40 track 5.25ö drive as used
on PC clones, you can use it under the PC emulator but, in native
Archimedes ADFS modes you will have problems. To get round it, format
the disc as normal then, when it goes beyond öFormatting 40ò and starts
clicking as it reaches the end of the travel on the head movement, press
<ctrl-break>. The disc is now formatted, but the free space map and
catalogue have not been installed. This can be done with:
2.2
DIM buffer% 3072
2.2
SYSöADFS_DiscOpò,,1,0,buffer%,3072
2.2
SYSöADFS_DiscOpò,,2,1,buffer%,3072
2.2
You try this entirely at your own risk! Ed.
2.2
Å Problems with ON ERROR LOCAL Ö John Smith says he thinks heæs
discovered a problem when using LOCAL ERROR with ON ERROR LOCAL. It
occurs because ON ERROR LOCAL stores the exact position in the program
structure. The User Guide mentions this with respect to REPEAT...UNTIL
and WHILE...ENDWHILE loops, but it also seems to apply to IF..THEN...
ELSE...ENDIF constructs. Once the error handler has done its job,
processing must continue at the same part in the structure in which the
original error happened. For example,
2.2
1000 DEF PROCtest(arg)
2.2
1010 LOCAL ERROR
2.2
1020 ON ERROR LOCAL PRINT öCanæt
2.2
divide by zero Ö try againö
2.2
1030 IF arg < 100 THEN
2.2
1040 INPUT value
2.2
1050 PRINT arg/value
2.2
1060 ENDIF
2.2
1070 ENDPROC
2.2
If a value of zero is input, line 1050 will error. As written, the above
code will then print a warning message and effectively execute a öGOTO
1030ò. At this point, the error handler stack is corrupted. The program
may appear to work without problem, but if any future error should
occur, the program may produce a run-time error something like öAttempt
to exit from badly nested error handlerò or something similar. Occasion
ally, I have even managed to produce the dreaded öAddress Exception
errorò!
2.2
The solution to this problem is quite simple Ö place the code that could
error together with the relevant error handler in a separate PROCedure.
I have not (yet) had any problems doing this:
2.2
1000 DEF PROCtest(arg)
2.2
1030 IF arg < 100 THEN
2.2
1050 PROCprint(arg)
2.2
1060 ENDIF
2.2
1070 ENDPROC
2.2
2000 DEF PROCprint(arg)
2.2
2010 LOCAL ERROR
2.2
2020 ON ERROR LOCAL PRINT öCanæt
2.2
divide by zero Ö try againö
2.2
2040 INPUT value
2.2
2050 PRINT arg/value
2.2
2060 ENDPROC
2.2
First Word Plus Hints & Tips
2.2
Here are a few of the many contributions weæve been sent about First
Word Plus. Weæve got a file of about ten other contributions, so we do
need someone who knows FWP, has a reasonable skill at writing and has a
bit of spare time to field the enquiries, assimilate the hints and tips
and regurgitate something to us each month.
2.2
Å First Word Plus startup Ö If you are getting fed up of starting
First Word Plus and finding yourself in lower case, you could *Configure
Nocaps, but that is a nuisance if you do programming and want to start
up in Shiftcaps. The solution is to extend the boot file, adding
*FX202,48.
2.2
Å LQ850 with sheetfeeder Ö If youære having problems with this
combination, Acorn say that you should edit the printer driver so that
entry 4 (vertical tab) is commented out by pre-fixing it with a ö*ò.
Also, note that if your printer is doing auto-linefeeds, you should also
edit option 1 to remove the line feed value (A) from the line to leave
just the carriage return (D).
2.2
Å Star LC10 Ö (ref. the Help enquiry we had last month) David Francis
says he uses the Epson FX driver successfully with this printer. He has
the dip switches set as follows: 1-1 to 1-8 and 2-1 and 2-4 are all ON
and 2-2 and 2-3 are OFF. The Archimedes is configured to IGNORE 0. With
this setting, the printer prints out the test, including the graphics
part. As set, it also prints under <ctrl-B> as well as with Artisan.
Heæs also tried to change the hex file to get it to work with quadruple
size, but hasnæt succeeded yet.
2.2
Å Printer drivers Ö In designing my own printer drivers for both the
Citizen 120D and Star LC-10 printers, I have not come across the problem
noted, but mine were modified from the Epson LX printer driver. There
was an item on the Letters section (page 128) of Octoberæs issue of the
Micro User referring to an apparently similar problem, which the writer
cured by öcommenting outò line &20 of the printer driver. I must admit
that I cannot understand why this should have any effect, but in case it
benefits other Archive readers, I detail below those elements of the
printer drivers I have set up relating to form or line feeds (refer also
to page 227 of the First Word Plus manual):
2.2
1D, A Ö Linefeed (N.B. carriage return & linefeed)
2.2
1E, C Ö Formfeed (N.B. &C = 12 as mentioned in the article)
2.2
1F, 12 Ö Horizontal initialisation (N.B. appears to cancel condensed)
2.2
20, 1B, 52, 0 Ö Vertical initialisation (N.B. appears to select USA
characters)
2.2
A further possible cause of problems may be to do with the printeræs dip
switches, on page 218 of the First Word Plus manual it does state that:
2.2
Skip over perforation must be DISABLED and Auto linefeed must be
DISABLED
2.2
Å Printer Drivers with extended characters Ö Ted Peat has sent in
various bits for FWP which weæve put on the program disc.
2.2
The printer drivers were written to permit both the Panasonic KXP-1081
and the Diablo-ecs printer to access the same set of extended characters
(those with codes from 160 to 255). The character set of the Archimedes
is also modified to suit.
2.2
The Diablo-ecs printers use a daisy wheel with a double row of charac
ters, giving 192 in all. The usual ASCII set is supplemented by
characters with codes >128. The description given here applies to the
Éscientificæ wheel containing Greek and mathematical symbols. The KXP-
1081 can be switched to emulate the IBM Graphics set, which also
includes some Greek letters and some (but not all) useful mathematical
symbols, again with codes >128. There are also some table-drawing
symbols which are replicated several times over, and accented characters
not needed for this application. Since up to 40 user-defined characters
are possible, these redundant characters can be replaced. This then
offers the opportunity to produce matched sets of symbols for the two
printers and the Archimedes.
2.2
I decided to include the complete Greek alphabet, which involves
duplication of some upper case letters, and (for the KXP-1081 only), one
set of table-drawing symbols. Two other symbols were added: an overline
and backspace. Backspace is entered into the text as a large leftward
pointing arrow-head (stored as character 161), but interpreted by the
printer as a true backspace. One consequence of this, of course, is that
text loses its WYSIWYG property. The advantage, however, is that both
superscripts and subscripts can be attached to the same symbol, and the
overline can be used to write a bar above a character. Since these
peculiar needs are only likely within equations, the loss of on-screen
text formatting is a minor irritation. Another complication was that the
Diablo lost its left margin alignment after a backspace, when printing
in the reverse direction. This option had to be switched off, slowing
the printer down.
2.2
There were two options for changing the Archi-medes character set. One
was to change the Archi-medes font, to match that desired as far as
possible, and then to redefine characters for the few changes needed.
The most useful character set is that described as BFONT on p. 458 of
the User Guide. To access this you need to *Configure Country Master.
The second way: which is the one I adopted was to redefine all charac
ters from 160 to 255. To do this I added a section to the 1st Word +
loading program (Library.1stWord+ on the program disc).
2.2
Once this was done, mapping the new character set to the Diabloæs set
was easy: merely rewrite one of the provided Diablo Printer Drivers (in
the hex dir-ectory) by changing the character translation table which
forms the last part of the printer driver text.
2.2
The KXP-1081 offered more complications. Firstly, it is necessary to
download the redefined character set before loading 1stWordPlus. Another
addition to the loader program, together with a user prompt, took care
of this. Secondly, switching this printer to its IBM Graphics mode
caused comp-lications with graphics printing: all the linefeeds became
doubled! The printer driver codes were therefore expanded so that for
each character the printer was switched into IBM Graphics set, the
character printed, and then switched back to the Epson mode. This sends
seven characters to the printer for every one actually printed. Since
these are only occasional characters, the loss of efficiency is not
important
2.2
Å Printer Driver Generator Ö John Smith has sent in, not another
printer driver, but a printer driver generator program. Heæs given it to
be used as public domain software, so we have put it on Shareware disc
number 2. For best results, copy the PDG program onto a copy of the 1st
Word Plus Utilities disk before running it.
2.2
Å Tabs and underlining Ö This one is for dum-dums like me, writes
David Crofts, who learn word-processing at the finger tip.
2.2
Underlining Ö I spent many happy, but frustrating, hours fiddling with
forms to try to sort out under-lining in intervening spaces, till I
discovered that the hated TAB holds the key! (I expect this is obvious
for lots of people, but hold on to the yawns.) I was used to VIEW where
the TAB key worked öprop-erlyò. (It inserted a TAB character, whatever
that was, but it meant that a change in ruler meant a change in layout.)
In FWP the Indent key does this job, except that it puts in a special
stretch space which is fixed in spite of further ruler alterations.
Because of this I had ignored TAB as useless.
2.2
TAB inserts a set of normal spaces which have to be deleted individually
Ö a nuisance if you are experi-menting with documents. But Ö you can
underline TAB spaces, whereas you canæt underline Indents! And therein
lies the hint!
2.2
By all means use indents to facilitate experi-mentation but, in the end,
TABs are preferable, where you wish subsequently to underline. If you
have used Indents, then all is not lost, though fiddle is the name of
the game. Turn off Insert, and turn on Underline (f2), then fill in the
spaces with Fixed Space (f10). Then use the mouse or keyboard to
underline the words.
2.2
e.g. Say you have a form, the head of which is:
2.2
Name Address Telephone
2.2
the above is the result using Indent, but using TAB you will achieve:
2.2
Name╩╩╩╩╩╩Address╩╩╩╩╩╩Telephone╩╩╩╩╩
2.2
Placing a TAB at the appropriate point near the end of the ruler allows
the line to be printed to the same length on each line.
2.2
Å InterWord to FWP via ArcWriter Ö This is how Ian Barnes achieves the
transfer:
2.2
1. Transfer file from IW to AW_DOC directory
2.2
2. Run ArcWriter
2.2
3. Press <select> for filing menu
2.2
4. Highlight file x
2.2
5. Press <menu>, select import, flowing, return
2.2
6. Press <select> for filing menu
2.2
7. Press <menu> and select export plus new name
2.2
8. Transfer file to 1WP.doc directory
2.2
9. Run 1WP and open file
2.2
10. Select WPmode from edit menu
2.2
11. Tidy up text by deleting control characters, changing any odd
letters and inserting returns at line ends to leave a presentable result
2.2
Å Files from ArcWriter Ö The article by Brian Carroll in Julyæs issue
of Archive under the heading of öFirst Word Plus Notesò (pages 21-23)
was very useful together with the program ConvertWP (also on that
monthæs Magazine disc). Although designed to convert Wordwise Plus
files, the program works quite well with ArcWriter as well. Briefly the
procedure to convert ArcWriter files into First Word Plus is as follows:
2.2
1. From the ÉFilingæ menu in ArcWriter select the ÉExportæ option to
save the file (e.g. under the name ötestARCò) and then exit from
ArcWriter.
2.2
2. Load the ConvertWP program and enter the appropriate Source
(ötestARCò) and Destination (e.g. ötest1WPò) filenames.
2.2
3. Load First Word Plus and then the converted file (ötest1WPò).
2.2
4. Select ÉWPmode onæ from the Edit menu.
2.2
5. Reformat the whole text by using the Style menu to ÉReformatæ the
ÉWhole documentæ.
2.2
Odd words may sometimes get missed out of the converted text, possibly
due to the fact that this data was preceded by ötabsò in ArcWriter.
2.2
Å Fontsize problems? (Ed. got caught out on this one) With Claresæ
Sound and Graphics demo, when you start it up, it says it needs 44k of
fontsize, so I tried to re-configure with fontsize 6 on the basis that 6
times 8k = 48k. Now, as Iæm sure you will all realise, that didnæt work
because fontsize is specified in 4k chunks, not 8k or 32k.
Å Logotron printer dump Ö Logotron told one of our readers that there
is no printer dump for their Archimedes Logo. However, our Printkey Dump
program (issue 1.10, page 45) works fine.
Å RX80 dumps for Artisan Ö Clares originally said that Artisan
wouldnæt dump pictures on an Epson RX-80 and that the FX-80 was the
Ébase-lineæ printer as far as they were concerned. How-ever, they have
since produced a Éhelp-sheetæ of the pokes needed to convert the dump to
an RX-80.
2.3
The gist of the change is as follows;
2.3
If your printer will support CRT mode graphics, (ESC ö*ò,4) then use it.
If not then use ESC öKò for normal single density bit image mode, but
CRT mode gives a much better image and less distortion.
2.3
*LOAD ART6 10000
2.3
!&10EC5=&042A1B for CRT or =&4B1B00 for single density
2.3
*SAVE ART6 10000 +12FF
2.3
*SETTYPE ART6 &FF8
2.3
The resultant print produces oval circles(!) but can be triggered from
Artisan.
2.3
Å Monochrome displays on the 440 Ö Brian Cowan writes, I was lucky
enough to have one of the first release of 440æs which I used with one
of the Acorn colour monitors. I know that the resolution of these
monitors is nothing fantastic, but it seemed sensible to purchase them
together; at that stage I was not sure what connection standards were
used.
2.3
About six months later I had reason to use an ordinary mono monitor on
the 440, and imagine my horror when I found it did not work. Ordinarily
I would have sent the computer back to the supplier to have it fixed
under warranty. However, the machine was in constant use so we decided
to live with it, using only a colour monitor.
2.3
I now discover that there is nothing wrong with the 440!! When these
machines leave the factory they are not configured to drive standard
resolution mono monitors, they are set up for high res monitors. Inside
the case, on the PCB are some jumpers that must be set according to what
sort of monochrome monitor you want to drive.
2.3
At the north-west corner of the board is a plug called PL2. I think this
does nothing except carry some pin connector links. A little further
southwards on the board are some pins labeled LK13 and LK14. If you want
to drive a standard resolution monochrome monitor, you must take two
links from PL2 and place one on LK13 and the other on LK14.
2.3
Connection to a monochrome monitor on 440 machines is through two BNC
sockets on the back panel. One socket is marked SYNC and the other is
labeled MONO. For high resolution, both of these are used but for
standard resolution only the SYNC socket is used. Since this is a BNC
socket rather than the phono socket on the 300 series, you will have to
make up or purchase a special lead or a converter.
2.3
For those of you contemplating the purchase of a multisync monitor for
those extra modes etc. you will be happy to hear that the Archimedes
connect-ions are the same as those on PC machines. This means that if
the monitor comes with a lead, it will probably be suitable for the
Archimedes. This is certainly true for the Taxans that I use. Inciden
tally, concerning the Taxans, some have rather dull pictures. Has anyone
tried brightening them up?
2.3
Å Desktop calculator Ö öThe calculator on my desktop doesnæt respond
to the keyboard whereas your review of Arthur 1.2 said it did.ò So I
tried to work the calculator with the keyboard keys myself and it didnæt
seem to work. Then I realised that it wonæt respond until you enable it
for keyboard input by clicking on it with the mouse. The top bar then
goes red and itæs ready to take input from either the main keyboard or
the numeric pad, delete being the equivalent of clear. Easy when you
know how.
2.3
Å Conditional booting. If you have a boot file in the RFS on battery-
backed RAM, you may want to do some things when you first switch on but
not every time you do <ctrl-break>. You can achieve this by making it
conditional on the monotonic timer, i.e. the timer which is initialised
at switch-on and not reset in any other way. To read this timer, use SYS
&42 TO T% where T% then gives the time in centiseconds so you can say
that IF T%<200 (say) then do the switch-on bits and pieces ELSE do the
<ctrl-break> things.
2.3
Å CharDes fonts Ö If you have fonts produced by CharDes, you can
convert them for use on the Archimedes as follows. Enter 65Arthur and
type
2.3
*spool thin2
2.3
*thin
2.3
*spool
2.3
where thin is the name of the original font file and thin2 is going to
be the new file. Then use a text editor (such as the Master128æs öEditò)
and edit out the first and last line (i.e. the *thin and *spool). Then
resave as thin2 and settype it as &FF7 (BBC font). When you need it,
just type *thin2. If you do a *SHOW, you will see that the load and run
actions of a file type &FF7 is to *PRINT it Ö which is just what you
want.
2.3
Å Command files Ö In order to disable vdu output during a command file
e.g. the !boot file, try:
2.3
*echo ||U
2.3
...
2.3
...
2.3
*echo ||F
2.3
Two string escape characters are needed (as Iæve explained in a previous
tip) so that the final command executed is *echo |U
2.3
i.e. <ctrl-U>. This issues a VDU 21 which disables vdu output until a
VDU 6 is issued <ctrl-F>.
2.3
This is similar to the ECHO OFF command of MS-DOS. Indeed if the string
used is:
2.3
*echo ||U|H|Hoff
2.3
then all that is visible is öecho offò which explains why nothing else
is visible to the user and also hides the control code sequence used.
The öcompiledò string is then *echo |U<8><8>off. One side effect is that
two line feeds will occur so if this is undesirable a couple of reverse
line feeds can be incorporated with
2.3
*echo ||U|H|Hoff|K|K
2.3
Note that the use of single string escape characters means that the
cursor control codes will have immediate effect whereas the <ctrl-U>
will only be issued when the echo command is executed.
2.3
The double string escape characters are only needed for use with *Build,
if a text editor is used then only single characters are needed but the
control codes must be input directly, e.g. so they appear as inverse
video in TWIN, for those cases where the affect is immediate.
2.3
(Sorry if this sounds a bit confusing but the difference between two and
one |æs, and when to use which, is an entire discussion point on its
own. Perhaps this could be a short article Ö it is important whenever
command files issue messages etc.) Clifford Hoggarth.
2.3
Å Quick *COPYing and *WIPEing Ö When you enter a wild card *COPY or
*WIPE on a list of files such as TEST1, TEST2, TEST3, etc. you are
presented with a list of options at the end of the copy or wipe
statement
2.3
*COPY :0.TEST* :1.TEST*
2.3
Copy file adfs::0.TEST1 as adfs::1.
2.3
TEST1 (Y/N/Q/A)?
2.3
etc.
2.3
The option Y, N, Q and A mean the following :-
2.3
Y Ö means copy that file
2.3
N Ö means donæt copy that file
2.3
Q Ö means quick copy all file with the wild card specification after and
including that one with no further confirmation prompts
2.3
A Ö means abort from copying
2.3
The *WIPE option works in a similar manner but deleting.
2.3
Å Stereo Speakers Ö After reading the hint in Archive 1.2 about adding
a pair of Tandy amplified speakers, I promptly rushed off Éto townæ.
They had just run out of stock, because the ú25 price-tag was a special
offer. However Tandy were very helpful and ordered me a pair which
arrived within a week and which at ú29.95 are still excellent value.
However, a set of alkaline batteries was quoted as ú7.95!! Instead, a
surplus old calculator mains adaptor and two power plugs (30p each from
a local electronics shop) provided a cheaper source of power. If you
donæt have a spare one, a new power supply from Rapid Electronics costs
less than ú4. The magic moment arrived and I switched on! The buzz from
the speakers was horrific!, but soon drowned by mayhem and destruction
from Zarch, which in turn was swamped by the dulcet tones of Éher
ladyshipæ complaining from the other end of the house about the volume!
2.3
Back to the drawing board Ö two capacitors, recovered from an old tape
recorder smoothed the power supply output and banished the buzz. The
solution to the lack of volume control was to add two potentiometers.
Whilst I was at it, I decided to wire the volume controls into a socket,
so that Zarch could be enjoyed at a reasonable volume late at night
through a pair of personal stereo headphones as well as through speakers
at a more civilised hour. An houræs work, a couple of pounds and I now
have glorious stereo sound, at a reasonable volume!
2.3
The diagrams below show the set up. A twin pot could be used instead of
two single ones, so that both speakers are controlled from one knob. Any
value pot from 100 ohms up to about 4.7k ohms will work, but 100 ohms is
ideal, though 470 ohm pots are easier to obtain. Logarithmic pots are
best, but linear ones work fine and are again are easier to obtain. The
big capacitor can be anywhere in the region shown (2500 microfarads/30V)
Ö the small one takes out the higher frequencies and again its value
(220 microfarads/16V) is not critical.
2.3
Itæs worth noting that the speakers cut off only after a minute or two
if there is no sound being produced. Presumably there is a small
capacitor inside which needs to run down first. Similarly, they need a
certain minimum signal for a very short time in order for them to switch
back on. David Kent
2.3
Å Ultra-cheap sound amplification Ö Maplin Electronics (0702Ö554161)
have an amazing offer including a pair of walkman-type headphones AND a
pair of monitor speakers for just ú3.95! I donæt know how good they are,
but at that price, you canæt go far wrong. (Oh, thereæs a handling
charge of 50p and a postage charge of 50p Ö still, itæs not bad.)
2.3
Å View öOCò Command Ö In View B3.0, one of the highlights can be set
to 27 instead of the normal 128 for underline and 129 for emphasise. In
doing this, commands may be made directly to the printer as in the
Wordwise OC command. For example, to set highlight 1 to 27
2.3
<Shift-f8> HT<return> 1 27 <return>
2.3
On pressing <f4> (underline) the next character will be sent to the
printer as a command, i.e. ShFn4x1(-x1) will turn on NLQ mode (on some
Epson compatible printers). This system seems to work for most commands,
but some commands need an ASCII ,1 so to get round this set highlight
key 2 (emphasise) as 1 and type ShFn4wShFn5 (-x*) to turn on double
height for example. This does have the disadvantage that things canæt be
turned on and off in the same line as you have to set highlight 2 back
to 0 to turn it off.
2.3
Å Two ARM Code Assembly Macros Ö (Richard Averill) Ö Here are two
useful macros for use in the BASIC V ARM assembler. They both use the
same method of loading 32-bit words into a specified register, which is
detailed below:
2.3
Originally, I had the idea that if I used the following piece of code:
2.3
LDR <reg>, [PC, #-4] !
2.3
EQUD <value>
2.3
then the processor would load the value and jump on to the next
instruction. However, what actually happens is that the value is loaded
and the ARM tries to execute the value as an instruction. If the high-
byte of the value is zero, then this will not cause a problem, but it is
not advisable to use routines that are not totally water-tight.
2.3
Here is the improved code:
2.3
LDR <reg>, [PC]
2.3
MOV PC, PC
2.3
EQUD <value>
2.3
which only takes one more word of code and works all the time. The MOV
PC,PC is there to make sure that the ARM executes the instruction that
is in the pipeline, and not the instruction in <value>.
2.3
Using these ideas, I have developed two useful routines detailed below:
2.3
DEF FNload(reg%, val%)
2.3
[ OPT opt% AND &E
2.3
LDR reg%, [PC]
2.3
MOV PC, PC
2.3
EQUD val%
2.3
] : =opt%
2.3
DEF FNadr(reg%, adr%)
2.3
[ OPT opt% AND &E
2.3
FNload(reg%, adr%-P%-20)
2.3
ADD reg%, PC, reg%
2.3
] : =opt%
2.3
As you can see, the macros can be used as any other instruction in the
assembler as such:
2.3
MOV R0, #123
2.3
FNload(1, &12345678)
2.3
FNadr(2, pointer)
2.3
SWI öOS_Anythingò
2.3
A demonstration program is given (on the program disc) to illustrate the
use of these macros.
2.3
Å Running ViewPlot under 65Arthur Ö Richard Averill Ö Listed here are
the changes needed to make ViewPlot Éharness the power of the Archi
medes!æ. They will tidy the programs up, allowing ViewPlot to run in any
mode and to print and save screens. A *Exec file of these changes is
provided on the monthly disc.
2.3
To use this file, transfer the ViewPlot disc onto ADFS into a directory
such as ÉViewPlotæ. You can either create a text file of these commands
(with *Build or a text editor) or you can type the commands in yourself.
Either way, you should make sure that you are in the ViewPlot directory
when you try to convert the programs.
2.3
*|Running ViewPlot under 65Arthur.
2.3
(C) Richard Averill, 1988.
2.3
*BASIC
2.3
LOAD öViewPltò
2.3
390
2.3
SAVE öViewPltò
2.3
LOAD öV__Dò
2.3
730 IF M=248 OSCLI(öScreensave Imageò)
2.3
:PROC2(R%)
2.3
SAVE öV__Dò
2.3
LOAD öV__Mò
2.3
1140 DEF PROC0:VDU 28,0,23,39,5:CLS
2.3
1190 REPEAT
2.3
1200 INPUT öEnter screen mode (not
2.3
text) ? ö M%
2.3
1210 UNTIL FNcheckmode(M%)=TRUE
2.3
DELETE 1220,1290
2.3
3000 DEF FNcheckmode(mode%)
2.3
3010 LOCAL col$,ok%
2.3
3020 ok%=FALSE
2.3
3030 IF mode%=0 OR mode%=8 OR mode%=12
2.3
OR mode%=15 OR mode%=18 OR mode%=19 OR mode%=20 THEN C%=16:ok%=TRUE
2.3
3040 IF mode%=1 OR mode%=4 OR mode%=9
2.3
OR mode%=13 THEN C%=32:ok%=TRUE
2.3
3050 IF mode%=2 OR mode%=5 OR mode%=10
2.3
THEN C%=64:ok%=TRUE
2.3
3060
2.3
3070 col$=ö04ò
2.3
3080
2.3
3090 IF mode%=0 OR mode%=4 OR mode%=18
2.3
THEN col$=ö04ò
2.3
3100 IF mode%=1 OR mode%=5 OR mode%=8
2.3
OR mode%=19 THEN col$=ö15ò
2.3
3110 IF mode%=2 OR mode%=9 OR mode%
2.3
=12 OR mode%=20 OR mode%=10 OR mode%=13 OR mode%=15 THEN col$=ö2ò
2.3
3120 IF ok%=TRUE THEN OSCLI(öLOAD Colò
2.3
+col$+ö 2600ò)
2.3
3130 =ok%
2.3
SAVE öV__Mò
2.3
LOAD öV__Pò
2.3
250DATA 0,0,0,0,0,0,2,4,4,4,2,16,8,1
2.3
,16,0,0,0,2,2,16,4,1,16,0,0,0,2,
2.3
1,16,0,0,0,0,0,0,2,8,2,2,4,4,2,
2.3
2,16,2,1,16,2,8,2,2,8,2
2.3
1740DEFPROCJ(b%):e%(b%)=0:ONM%+1GOTO
2.3
1770,1810,1880,1880,1770,1810,1880, 1880,1810,1880,1880,1880,1880,1880
2.3
,1880,1880,1880,1880,1880,1770
2.3
,1810,1880,1880,1770,1770
2.3
2070DEFPROCE:FORb%=1TO8:e%(b%)=b%?
2.3
(&2608+((a%-1)*2+a%-10)*8-1):ONM%+1
2.3
GOTO 2110,2150,2200,2200,2110,2150,
2.3
2200,2200,2150,2200,2200,2200,2200, 2200,2200,2200,2200,2200,2200,
2.3
2110,2150,2200,2200,2150,2150
2.3
SAVE öV__Pò
2.3
Å Cheap colour monitors Ö Peter Sykes bought a Commodore 1084 monitor
which seems to be identical to the Phillips 8833 but cheaper. He got his
from Eazyprint in Staines, Middlesex for ú240, around ú20 less than the
cheapest he could find the Phillips 8833. (Thereæs an Acorn one for sale
in the small adæs, but there must be other folk by now who are up-
grading to multi-syncs and have monitors for sale Ö send in your small
adæs folks Ö no charge.)
2.3
Å Use of Archimedes on Econet Ö Copying ADFS format discs to NET and
vice-versa, no utility is needed as Archimedes has it all built in:-
2.3
*COPY -adfs-$.* -net-$.whatever.* QRC
2.3
Here ADFS is the source, NET is the destination. The Éwhateveræ is the
chosen destination directory, or directory path (e.g. replace Éwhateveræ
with Éfred.mary.utilsæ) The * is to indicate all files. The Q indicates
QUICK copying using all available RAM. This damages resident programs
but considerabley speeds the copying process. It is also almost
essential if using early versions of the Econet Software Modules (NETFS,
ECONET) due to bugs in these which cause ÉNot Listeningæ messages. Later
versions do not suffer this. The R to indicates recursive copying of
sub-directories. The C turns OFF confirmation so that copying occurs for
all files without question.
2.3
Simple modifications to the command line allow copying in the reverse
direction.
2.3
(This was sent in by Michael Ryan, editor of the Econet User Group
Magazine (NEUS) which carries regular articles on Archimedes on the
network (and many less esoteric matters as well). We have also been
licensed by Acorn to provide free upgrades to Econet software modules
for those unable to obtain them elsewhere. Econet User Group, Balkeerie
Cottage, Eassie by Forfar, Angus, DD8 1SR.)
2.3
FWP Hints & Tips
2.3
compiled by Mike Hobart
2.3
Å Changing default drive Ö those of you with dual drives may want to
be able to get FWP to default to looking for data on drive 1. To do
this, all you do is load $.library.1wp and change the line that sets up
the documents directory to:
2.3
*set FirstWordPlus$Docs :1.$.
2.3
Å Saving to a fresh disk Ö If you need to save your work onto a fresh
disk, you may have difficulty in persuading the save to work: you get
silly messages about the disk being write-protected and directories not
being present. This is very frustrating if you have just written the
first chapter of your bestseller. Try öSave as...ò, taking special care
either to see that you are in the correct directory as specified in the
directory box at the top of the save window or create a new file in the
root directory by clicking repeatedly on the X icon until you are left
with only a ö*ò. Thanks to Peter Tettmar, on whose solution is differ
ent, but less convenient as you have to anticipate the problem!
2.3
Å Form feeds in the wrong places Ö Edit your printer driver (the öhexò
directory one) to inactivate the övertical tab to lineò feature. This is
done by placing a ö*ò at the beginning of the line (line no 4, which
should now read *4, 1B,42,80,0,B or near). If you have serious troubles
with irrational formfeeds, try setting the CONFIGURE IGNORE of the
battery-backed RAM to prevent the computer ever sending to crucial code
to the printer. (Thanks to David Adamiak and from him to GST Holdings).
2.3
Å Use of IBM fonts Ö Steve Jones points out that there can be
advantages in using the IBM font set, if your printer supports it. The
monthly disk con-tains his very full instructions and programs. The main
reason for using the IBM fonts is the availability of certain symbols
for maths and graphical characters. These can be especially useful for
designing forms.
2.3
Å Graphics problems (e.g. that white is printed grey etc.) can be
cured by preparing the graphics in 1st Word palette. For Artisan, copy
1stwordæs Resources.1wp.!palette as artisan.1wppal (or what takes your
fancy) on the Artisan disk, then boot up Artisan, grab the disk ikon and
finally select the new palette. The result is not artistic, but a quick
roller brush over the background with white, followed by the artwork in
e.g. black produces a picture you can import and have printed correctly.
The reason this works is that the graphics dump routine in 1st Word
assumes the use of the programæs own palette, or at least that it is
trying to produce a paper version of what you see on the screen. It is,
incidentally, quite an intelligent and quick dump, which checks to see
if there are pixels to print before printing a line, and issuing a
linefeed if not.
2.3
Å Conversion from WWPlus Ö The following hint might be useful to
people still trying to convert WW+ file to 1WP. The convert program
published in Archive does a wonderful job. However, I found it a bit
irksome having to edit out all the ÉUSæs and ÉUEæs etc which are left
after the program has dealt with the green and white embedded commands.
(This just goes to show how quickly we start to take things for
granted!!). I also found that it was impossible to reformat the text to
a new line length. The latter problem seemed to be that 1WP ended lines
with &0E, whist converted WW+ files ended with the last letter of the
last word on the line.
2.3
The solution to both problems is as follows:
2.3
1 SPOOL out the WW+ file, using Option 8 (This removes all embedded
commands and centres text and produces indents and TABs)
2.3
2 Reload the spooled file and use Search & Replace to change all
double returns to @@ (or any other unused combination of letters)
2.3
3 Change all of the remaining single returns to <space>-return
2.3
4 Change all of the @@s (or whatever) to <space>-return-return
2.3
5 SAVE the modified file using Option 1
2.3
6 Run the SAVED file through the convert program
2.3
The effect of 2, 3 and 4 is to save the paragraph breaks, but end all of
the lines with a space. The result is a file with no extra Éremainsæ of
embedded commands, and which will reformat correctly in First Word Plus.
2.3
H & T are a bit thin on the ground this month because this issue is
being finished before Christmas so I get some time off and itæs only a
couple of weeks since I closed the December issue, so not much has come
in yet. Most of the H & T that we have got were sent in by Anton Carver.
Thanks Anton!
2.4
Å Using function keys Ö If you want to get the function keys to
produce ASCII codes, say, 200, 201, 202 etc, you use *FX 225,200 but
this only works for keys <f0> (the print key) to <f9>. If you want to
use <f10> upwards, you need to use *FX 221,200. This also makes <insert>
into the equivalent of <f13> i.e. it generates, in this case, ASCII 213.
2.4
Å Troubles with Mitsubishi Drives? Ö Yes, there are problems with some
of the new 5.25ò Mitsubishi drives with some of the 5.25ò disc inter
faces, but they can be solved. The problem is the use of pin 2 on the
interface. It was not used on the BBC micro, but on the new Mitsubishi
drives it is used for DC interrupt. The solution is to put a little bit
of masking tape on the edge connector inside the drive mechanism so that
it doesnæt make contact with the p.c.b. Pin 2 is on the top of the board
at the outside edge.
2.4
Å Programmable reset Ö A hang-over from the BBC micro is that if you
program function key 10, you will find that if you press <reset>,
function key 10 will be executed! If you donæt know about this, it can
come as something of a shock, but it could be that you would want to
make use of it if you were, say, developing a machine code program which
kept hanging up the machine and forcing you to press <reset>. You could
program it as *KEY 10 *BASIC|MOLD|MEDIT .|M and it would jump you back
into editing the program at the point where you were.
2.4
Å Is it still going? Ö If you are doing some heavy machine code
programming and want to know if the computer is still working or whether
you have locked it up completely, try pressing the caps lock and/or
scroll lock keys and if they are still responding, your computeræs not
dead yet! The caps and scroll lock LEDæs are controlled by the computer
in response to the key presses, so if they are working, it tells you
that the processor is still reponding to interrupts.
2.4
Å Using ARMBE Ö It is useful to be able to enter ARMBE at the point of
the last error. Here is a program which sets up function key 4 so that
it enters ARMBE at the point where the error occurred or, if no error
then it enters where you were last editing by using öEDIT .ò.
2.4
10 *set key$edit IF ERL=0 THEN OSCLI (|öKEY 4 *FIXKEY4||mEDIT . ||m|ò)
ELSE OSCLI(|öKEY 4 *FIXKE Y4||mEDIT |ò + STR$(ERL) + |ö||m |ò)|mMISTAKE
|m*FX138,0,132|m
2.4
20 *set alias$fixkey4 set key$4 |<key$edit>
2.4
30 *fixkey4
2.4
Å REMæs Ö Although the User Guide says that REM statements are ignored
by BASIC, this is not completely true in BASIC V. This is because the
block conditional IF╔THEN╔ELSE╔ ENDIF requires the THEN to be the last
statement on the line. Adding a REM to the end of the line will change
the flow of control, thus:
2.4
>LIST
2.4
10 OK%=TRUE
2.4
20 IF NOT OK% THEN
2.4
30 PRINT öWrong!ò
2.4
40 ELSE
2.4
50 PRINT öRightò
2.4
60 ENDIF
2.4
>RUN
2.4
Right
2.4
>LIST
2.4
10 OK%=TRUE
2.4
20 IF NOT OK% THEN :REM Danger!
2.4
30 PRINT öWrong!ò
2.4
40 ELSE
2.4
50 PRINT öRightò
2.4
60 ENDIF
2.4
>RUN
2.4
Wrong!
2.4
Å MODE3/6 gaps Ö There is an undocumented difference between the way
that the gaps between lines are coloured in the 25-row modes. In modes 3
and 6, the gaps are the border colour and in modes 11, 14 and 17, they
are the background colour.
2.4
By experimenting with SWIöOS_ReadMode Variableò, I discovered that bit 3
of variable 0 (Modeflags) indicates the condition. If the bit is set to
0, the gaps will be background colour and if 1 they are border colour,
thus:
2.4
10 For mode%=0 TO 17
2.4
20 MODE mode%
2.4
30 VDU 10,0,24,128,0|
2.4
40 SYSöOS_ReadModeVariableò
2.4
,MODE,0 TO ,,modeflag%
2.4
50 PRINT öMode= ò;MODE
2.4
60 IF (modeflag% AND (1<<3))
2.4
<>0 THEN t$=öBorderò ELSE t$=öBackgroundò
2.4
70 IF (modeflag% AND (1<<2))
2.4
<>0 THEN t$=öNoò
2.4
80 PRINT t$;ö gapsò
2.4
90 wait%=GET
2.4
100 NEXT
2.4
Å Auto linefeed Ö Some software packages, like First Word Plus for
instance, insist that you set your printer so that it does not generate
auto-matic linefeeds. This means that if you list a BASIC program with
lines that are longer than the carriage length, the line wraps round and
is overprinted. To avoid this and the difficulty of fiddling with dip
switches, use the BASIC command WIDTH before printing. To do this, type
WIDTH <carriage length> (e.g. WIDTH 80) before printing and WIDTH 0 to
reset to the default setting after printing.
2.4
Å How to wipe a disc clean Ö Having explained in H & T in issue 2.1
how to use *LIBöò and *WIPE * ~C to wipe a disc clean, here is the
really quick way! Take a blank disc and do a *BACKUP onto the disc to be
purged Ö takes about 10 seconds all together, even with only a single
drive!
2.5
Å Microlink Modem connections Ö We have at last sorted out the
connections necessary for the Microlink Multispeed modem. The problem is
that it seems to need two different connections depending on whether you
are using ArcTerm or Hearsay. Anyway, here are some connections that
seem to work OK. ArcTerm version first:
2.5
Modem Computer
2.5
GND 1
2.5
}╤ 5 GND
2.5
GND 7
2.5
RXD 2 ╤ 3 TXD
2.5
TXD 3 ╤ 2 RXD
2.5
RTS 4 ╤ 7 RTS
2.5
CTS 5 ╤ 8 CTS
2.5
6 DSR
2.5
DSR 6 ╤{2 .5
1 DCD
2.5
DTR 20 ╤ 4 DTR
2.5
Note that the Archimedes DCD is not connected to the modem DCD but to
the DSR to ensure that it is ON all the time. The modem DCD is only ON
whilst on-line. Here are the Hearsay connections:
2.5
Modem Computer
2.5
GND 1
2.5
}╤ 5 GND
2.5
GND 7
2.5
RXD 2 ╤ 3 TXD
2.5
TXD 3 ╤ 2 RXD
2.5
RTS 4 ╤ 7 RTS
2.5
CTS 5 ╤ 6 DSR
2.5
DSR 6 (NC)
2.5
DTR 20 (NC)
2.5
DCD 8 ╤ 9 RI
2.5
1 DCD}
2.5
4 DTR} linked
2.5
8 CTS}
2.5
Å BBC Hard Discs Ö If you have BBC hard discs that use the 1 MHz bus,
you can run them on the Archimedes under the new 6502 emulator,
ö65hostò, that comes with RISC-OS. All you do is enter 65host and load
the BBC 1770 ADFS then, assuming you have an I/O podule, connect the
hard disc to the 2 MHz bus and away you go.
2.5
(Surely it wouldnæt be too difficult, would it(?), to patch it into the
existing operating system to make the hard discs accessible in native
mode instead of limiting it to use with the emulator? Could anyone do
that for us? Ed.)
2.5
Å Naff RTC Month Ö If you get this error message when running the
desktop, the chances are that it is time to change your batteries. Acorn
suggest changing them once a year.
2.5
Å Repton 3 Ö first a comment Ö The characters included are exactly the
same as in the BBC version even though they are mode 9, so it looks like
mode 5 on the BBC. This is disappointing as the extra resolution and
colour are wasted unless you redefine the characters Ö a mammoth task as
there are 768 altogether! (Phil Armstrong, Doncaster)
2.5
Phil also says╔ I redesigned the first 48 characters which took quite
some time and I did encounter a few problems, namely my maps occasion
ally were wiped or the start position changed. To get round this
problem, I examined the data files and found:
2.5
&0000 to &10A0 8 Map definitions and colours for each map
2.5
&10A0 to &70A0 48 character definitions
2.5
So if you lose your maps or wish to copy a character set to another set
of maps, follow these operations:
2.5
*Load Newdata 10000 load new char-acters as saved by editor
2.5
*Save Char 110A0 170A0 save character set alone
2.5
*Load Olddata 10000 load file contain-ing required maps
2.5
*Load Char 110A0 overlay new character set
2.5
*Save Newfile 10000 170A0 save maps and characters together
2.5
Newfile can then be loaded into the game. Changing characters does not
seem to affect the competition numbers the game gives you.
2.5
Å Games on the 440 Ö Many games programs will not run on the 440 if
the screensize is set above 160k, so you should try *Configure Screen
size 5 before running the game.
2.5
Å Pacmania Ö Two avid öPacmaniacsò, Harjit Takshak and Linus Twizell,
have provided some Pacmania hints:
2.5
Do a *LOAD PACMANIA 10000 then you can set the number of lives with
?&102C8 = n (but too many slows the games down) and ?&113D4 = n sets the
number of points per pill and ?&10234 = n sets the number of credits and
then CALL &10000 starts off the game.
2.5
Å GammaPlot Ö It is possible to change the colour of a line on a line
graph by using the command *SG17,n,128 where n is the GCOL number (e.g.
48 = blue). This command can also be used in the Macro mode followed by
a line with GRAPH (just the graph) or CHART (graph and axis). The colour
will be saved, along with the graph, to disc.
2.5
Å Printer problems Ö there have been one or two problems with spurious
operation of printers, especially with Integrex printers when doing
graphics dumps. These are caused by timing problems on the Archimedesæ
parallel port control lines and can be solved by an internal circuit
board modification that Acorn have recognised as a field change, i.e. if
you are having problems, go to your local Archimedes dealer and ask if
he can do field change 2002 for you. (D.I.Y. field changes will void
your warranty, but if you want details anyway, send us an S.A.E.)
2.5
Å Conditional booting (cf Archive 2.3, page 13) Philip Colmer says
that unfortunately *FX200,2 followed by reset is treated as a power-on
reset so the monotonic clock is reset. Probably a better way is
SYSöOS_Byteò,253,0,255 TO break% where break% is 0 for soft break, 1 for
power-on reset and 2 for a hard break Ö a bit more reliable than
checking a clock value.
2.5
Å BCPL on ADFS Ö J Laski writes╔ I am a BCPL freak: due to the fact
that ADFS was not available when it was designed, the ROM system causes
files to be read/written with OSBGET/PUT rather than OSFILE/OSGBPB;
also, intermediate files in the compiler and editor use names such as
Backup$ which ADFS abhors.
2.5
To get round this, patch the routine in the ROM (image disk) FSTYPE
(G39) always to return 7 (see manual p117). In both BCPLARG and BCPLCCG,
patch the second static load (LLL) in G1 from öOCODE$$ò to öOCODE!!ò. In
ED, in G318 patch the static load in G318 about 40 words before the SWL
near the end of the routine; this can best be found by looking for the
long forward jump about 30 Cintcodes from the beginning. (N.B. I use an
extended ED, so have only given rough positions; G318 is the last
routine called from G1.)
2.5
If you feel you cannot make these changes yourself, and send me a disk
with proof that you have a legal copy of BCPL and a stamped self-
addressed mailer, and I will send you a modified version. I would
appreciate, but do not insist on, any utilities that you think might
amuse me.
2.5
I am seeking a version of BCPL in ARM code and, if ACORN cannot be
persuaded to release their version, will do it myself, probably somewhat
Éadhoclyæ. If you have any views on desirable facilities, I should be
glad to read them. I shall shareware distribute with a licence fee
requested. (Dr J Laski, 18 Ebury Street, London, SW1W 0LU.
2.5
Å öColour Printouts Ö The Easy Wayò Ö I read with considerable
interest the article by W R (Basil) Davis on taking 35mm photographs of
the monitor screen. (Archive 1.9, page 52) I was able to put this to
practical use recently since I wished to design and produce some
graphics screens (using GammaPlot) and use these in a conference
presentation. I did consider using acetates with an overhead projector,
but decided 35mm slides would be more suitable.
2.5
The following additional comments (which should be read in conjunction
with the original article) may assist other Archive readers contemplat
ing taking such pictures:
2.5
1) Before embarking on photographing any screen displays, it is
important to remember that any apparently minor öblemishò will be
magnified considerably if your results are being projected using 35mm
slides. Careful thought should be given to the screen layout and the
choice of colours; provided they donæt clash, brighter foreground
colours are preferable, with black or a dark blue making an ideal
background. The normal Archimedes text is quite visible when projected
using 35mm slides; additionally I used a GammaPlot feature to enlarge
the standard text for titles etc. and, whilst this was quite acceptable
on a monitor screen, when projected it did appear noticeable öchunkyò.
Next time I will use the Archimedes special fonts with GammaPlot
instead.
2.5
2) In choosing the 35mm film to use, one important consideration may be
the speed with which you wish the results to be returned to you. Whilst
most colour print films can be developed overnight or even within an
hour or so, this is not the case with colour slide films. Most have to
be sent away for processing and a delay of 10Ö14 days is not untypical.
If you want colour slide film developed quickly it is best to use (non
öprocess paidò) Kodak Ektachrome film which good photographic shops
should get returned to them within 2Ö3 days. There are also a few
specialist laboratories which offer a 2Ö3 hour service.
2.5
3) When determining the correct Épeak whiteæ exposure using an automatic
camera, it is possible for the cameraæs metering system to be too
sophisticated! I was using a Minolta 7000 AF camera and the exposure
settings fluctuated quite rapidly as the monitor screen picture was
scanned and refreshed. Checking the exposure using a different camera
confirmed the articleæs öif all else failsò assumed exposure settings.
2.5
4) Focusing may well be perfectly feasible when using a camera with
auto-focus. I found it best to set the initial focus with a screen
display visible, rather than a blank screen, and then switch the auto-
focus off Ö this is because the Minolta 7000 AF system tries to refocus
after every picture is taken. In setting the combination of shutter
speed and aperture, it is probably preferable to err towards the slower
shutter speed/smaller aperture (higher Éfæ number) setting as this will
increase the Édepth of fieldæ and give a greater safety margin if the
focusing is not quite right.
2.5
5) As mentioned in the original article, a sturdy tripod is virtually
essential and a remote shutter release (or possibly the cameraæs Delayed
Action feature Ö if fitted) must be used to avoid camera shake and
consequent blurred pictures. Additionally, switching off the room lights
when taking the photographs should avoid any extraneous reflections off
the monitor screen possibly spoiling the finished results.
2.5
6) If you are using 35mm slides and the results are to be projected
using a professional (rather than domestic) slide projector, it is
definitely worthwhile having the slides Églass mountedæ Ö although this
does increase the cost! This prevents the heat from the projector lamp
öpoppingò the slide and causing part(s) of it to appear out of focus.
For those who are interested in further reading on the subject, there is
an article in January 1989æs issue of BBC Acorn User (pages 81-83) on
the subject of taking photographs of the computer screen, there is even
advice on taking pictures of commercial games software. Rob Brown.
2.5
2.5
Å Willie Stott has sent in a very complete set of facilities for
support of the Epson LQ series, including a download font designer. This
will only be of interest to those with the right hardware, but he has
used a neat idea to get control of any extra facilities that your
printer supports, but for which First Word Plus has no category. He
points out that foreign characters can be used as printer definitions.
The characters with ASCII values between &E0 and &EE appear on the
bottom line of the character window and you have to do three things:
2.5
a) Define the character as a suitable message to the printer in the
character translation table of the hex file, then turn it into a driver.
2.5
b) Design suitable character definitions (using VDU23,...) to
represent the action of the printer so that it is added to the compu
teræs character table when FWP is booted up.
2.5
c) Include your definitions in the FWP boot file before the *key 1 ...
line.
2.5
Å A tip from an unknown writer (maybe Paul knows who to acknowledge Ö
Sorry, no. Ed.): how would you like to be able to produce a spool file
of your FWP output? What? Not much!? You may be missing something, as
you could then move the file to another machine and get a printout via
that machine, e.g. via an IBM or a mainframe. The trick is to *SET
PrinterType$4 <spoolfilespec> before booting up FWP. Then select
önetwork portò from the printer box in FWP. The system variable
PrinterType$4 holds the pathname for network printer output. The
<spoolfilespec> needs to include the full adfs:$.filename format.
2.5
Å Someone besides me is the kind of two-fingered typist that hits
<ctrl> at the same time as <A>. What should our correspondent do? File
his fingers down? Stick a piece of rough Velcro on the <ctrl> key? No,
contact the Archive office and have someone write a module to intercept
<ctrl-A> and make a beep. The trouble is that when you are just feeling
bold enough to try to modify a bit of assembler to help a friend, you
should not choose a keyboard buffer intercept. There is no way to try it
out safely, or even to get a decent service from the debugger as every
keypress goes via your duff code. You cannot even type ö*rmkillò
successfully. The only key which really works is <reset>. Help!! All
serious programmers out there: where did I go wrong? Why does the IRQ
stack pointer unwind so fast? P.S. If you can include a <ctrl-f12> =
swapcase facility in the module, you will win a large öthank youò and a
small prize for the best solution. You can start with the PrintKey
module program in Archive1.10, page 45.
2.5
Å There is a new version of FWP available from Acorn for those whose
copy does not pause at the ends of each page, even if the flag has been
correctly set in the printer driver. Return your disk to Customer
Support, Acorn Computers Ltd., Fulbourn Rd., Cherry Hinton, Cambridge
CB1 4JN. (Reprinted from BBC Acorn User, Feb æ89, p 10).
2.5
It is rumoured that there is a genuinely new version on its way, perhaps
to coincide with RISC-OS.
2.5
Å Johnathan Young has a cure for the FWP buzz (the one which comes out
of the speaker or down the external audio output, and sounds like the
onset of tinnitus): boot up and then exit EMRæs sound synth package. A
bit expensive for silence, but you get the music program free! Has
anyone an explanation or a better solution?
2.5
Å Dacom modem connections Ö If you want to connect a Dacom modem to
the Archimedes, try the following connections:
2.6
Archimedes Modem
2.6
2 ╤ 3
2.6
3 ╤ 2
2.6
5 ╤ 7
2.6
9 ╤ 6
2.6
Also link 1, 4 and 8 at the Archimedes end and also 6 to 7. If you are
using Hearsay 1.04, use the Tandata modem driver, not the Dacom one.
2.6
Å Easy copying Ö If you have a single drive, try setting
2.6
*set alias$dcopy %0 :0.%0 PQ
2.6
Then you can use, say,
2.6
*dcopy filetocopy
2.6
and this will copy the file öfiletocopyò onto another disc on the same
drive, prompting for disc changes.
2.6
Å Easy compacting Ö This could apply to a number of commands, but if
you want, for example, to compact a disc several times, you can use
*repeat 6 compact which will do a *compact 6 times if you have previ
ously set an alias for repeat as follows:
2.6
*set alias$repeat if %0>0 then repeat %0-1 %*1|m if %o>0 then %*1
2.6
Å Masked Sprites Ö The Welcome Disc Sprite Editor was criticised in
November 88 Archive as not working properly. It does work properly, well
almost!
2.6
To create a masked sprite, first draw your sprite as normal, then press
<shift-f9> (create mask) then select the colour that you want to be
transparent and fill in any areas that are to be transparent. The
display will show a hatched effect for that colour.
2.6
To plot a masked sprite, remember that you must use a GCOL 8,0 before
plotting the sprite.
2.6
Å Hard disc Backup program Ö Paul Hobbs sent in the following
improvement to last monthæs hard disc backup program╔ The very useful
hard disk backup program in Archive 2.5 can, I think, be improved very
easily by the addition of the following lines after the line PRINT
CHR$(13);òScanning: ö;... etc in PROCaction(). It allows a check to be
made for directories not to be backed up. The full path name should be
given as in the example below. Quite a few of the directories on my disk
are backed up on their own floppies and this modification saves a lot of
time.
2.6
1621 RESTORE
2.6
1622 skip=FALSE
2.6
1623 REPEAT
2.6
1624 READ nocop$
2.6
1625 IF LEFT$(dir$,LENnocop$)
2.6
=nocop$ THEN skip=TRUE
2.6
1626 UNTIL nocop$=ö*** END ***ò
2.6
1627 IF skip=TRUE THEN ENDPROC
2.6
7000DATA :4.$.1WP.cfg,:4.$.1WP.doc
2.6
.BAK,:4.$.TMP,:4.$.BBCTelSoft
2.6
7001DATA :4.$.TMP,:4.$.CPROGGIES,
2.6
:4.$.BACKUP,:4.$.1WP.hex
2.6
7002DATA ö*** END ***ò
2.6
Å Hard disc squeek Ö Those who are lucky enough to have hard discs may
be suffering a continuous high pitched squeal from the drive when the
machine is switched on. My dealer assured me that it would eventually go
away, but I lost patience and cured it by lubricating the disc drive
spindle with WD-40 (or similar). If you remove the disc drive and look
into the connector end, between the printed circuit board and the drive
body, you should be able to see a carbon pad mounted on the PCB which
rubs against the end of the spindle (to earth it and avoid static
problems). Using an aerosol can fitted with a long tube, a few drops of
lubricant on this pad will cure the noise. Take care when squirting Ö
and naturally no responsibility is accepted!
2.6
Å C routines Ö When using the tmpnam() or tmpfile() routines in the
ANSI C library, a directory &.Tmp needs to be created on the current
drive. This is not present on the master floppy, nor is it created by
the hard disc install procedure (installHD).
2.6
Å ANSI C command line parameters Ö page 31 of the manual says that
öArguments to main() are the words of the command line, delimited by
spacesò, but gives no further information. The parameters are actually
passed in the same way as the Unix2 environment does Ö for those
programmers unfamiliar with Unix, the main procedure is called with two
arguments, which are declared as:
2.6
int main(argc,argv)
2.6
int argc;
2.6
char *argv[];
2.6
{2 .6
/* argv[1] points to first
2.6
parameter
2.6
argv[2] points to second,
2.6
etc.
2.6
Program name is at argv[0] */
2.6
where argc is the number of parameters given (which includes the program
name, so this will always be at least 1) and argv is an array of
pointers to the parameters Ö argv[0] is the command name and argv[1] is
the first parameter. Parameters are normally separated by spaces, but
quoted strings are passed as one unit. Some programmers prefer to
declare argv as:
2.6
char **argv;
2.6
and use it as a pointer to a list of pointers to the arguments.
2.6
Å BBC Master Edit Ö If you want to use an image of the Edit ROM (the
Master version) under 65Arthur, you need a *ALPHABET BFONT before
running it up, otherwise the on-screen help display looks very confus
ing. This ROM, by the way, uses CMOS byte 8 (öreserved for Acorn useò)
in which to save the screen mode and help level.
2.6
Å *COPY without the ÉQæ Ö omitting the Q option when copying a file
forces Arthur to ignore bad sectors or tracks in a file. This allows you
to recover screens or text files from corrupted discs If you have a
single drive and donæt want to perform umpteen swaps then proceed as
follows:
2.6
*DELETE or *COPY (with Q) the other files until you have room for
another copy of the bad file.
2.6
Then *COPY :0.filenme :0.BADfilenme ~C~PV
2.6
Å Orion loading speed Ö To speed up the loading, note that there is
what appears to be a non fatal bug in the ö$.Orion.Orion_basò program.
It *sloadæs a sprite file seven times!
2.6
LOAD ö$.Orion.Orion_basò
2.6
now look round about line 3000 and you will find the *sload command that
should be outside the FOR/NEXT loop!
2.6
Edit this and then save the program back onto the disc. (The name at the
top of the program has an extra Énæ at the end which has to be deleted
from the filename as displayed by the editor if you try to save it with
<f3>)
2.6
Å Orion Ö Feel like a laugh? Instead of EDITing ö$.Orion.Orion_basò as
above, try :
2.6
*con. scr. 20
2.6
*con. spr. 20
2.6
<ctrl-break>
2.6
*DIR Orion
2.6
LOAD öOrion_basò
2.6
701 *UNSET BJS
2.6
RUN
2.6
Then when you press <space> to load the game you get a marvelous
digitised laugh! This is apparently a (very clever) part of the
protection used in the program.
2.6
Å Extended life for Orion Ö While the instructions are scrolling up
the screen try pressing <U>, <L>, <C> and <space> together but in that
order. It then allows you to select a level at which to start the game
and you will find that you start with 10 lives & 10 smart bombs!
2.6
Å Zarch cheat Ö you can get into the cheat mode if, when you first
start up and are sitting on the landing pad, you press <Q>, <T> and <U>
together but in that order. You may have to try it a few times. Now <L>
gives you an extra life, <F> refuels (in mid-air) and <D> toggles the
auto-pilot.
2.6
Å Zarch Ö Some new landscapes make this game much better. (Program
NewWorld on monthly program disc or send S.A.E. for listing.) This
program works with the original protected version of Zarch as long as
you have screen size to 160k and other sizes to zero. It uses a
variation of the PRINTKEY program in one of the earlier Archives.
(PRINTKEY had a bug in it! P%=0:O%=code% OPT 4-7)
2.6
Å Terramex. For endless lives, with Terramex disc in drive, type:
2.6
*LOAD TERRACODE 9000
2.6
!&CF18=&FAFFDC3E
2.6
!&CF20=&FAFFDC3E
2.6
CALL &9000
2.6
Å Quazer Ö with the Impact software version of Quazer (which appears
to be the same as V1.42) type:
2.6
*SETEVAL Quazer%MeatHead 1 -Immortal
2.6
(also try Quazer%Lives, Quazer%Level)
2.6
Then use *Quazer to Run
2.6
Å OS_FSControl problem Ö David Scott reckons there is a problem with
the system command for the COUNT operation. The OS_FSControl (&29)
system command for filing system control with R0 set to 28 (page 262 of
the Programmers Reference Manual) has a problem which is not apparent
from the description given.
2.6
If the call is used in a program to obtain values for use by the program
it is not possible to do this without the information also being printed
on the screen. This is because bit 8 of the action mask in R3 must be
set in order to get the correct values returned in R2 and R3.
2.6
The way round this problem is to turn the screen output off using VDU21
before making the system call and then to turn it back on afterwards
with VDU6. If a printer is connected then this will also have to be
temporarily disconnected with VDU3 before and VDU2 after the call.
2.6
Å Potential Electrocution! (Archive 2.5 p19) Ö This is a problem with
most colour monitors. The explanation is as follows... When you turn the
power off, a static charge forms on the screen surface, creating a
potential difference of several KV between the monitor chassis and the
screen surface. If you then pick the monitor up with the screen facing
your body, the screen is effectively connected to your body, and so the
potential now exists between you and the monitor chassis, and remains
there due to the insulating properties of the plastic case. If you then
touch the chassis via a mounting screw or the rear connector, the
potential will be discharged, possibly painfully! (I speak from
experience!) The answer is to make sure you are touching the chassis
(e.g. the RGB connector shell) BEFORE picking it up, and keep hold of it
whilst carrying the monitor. The other answer is to lift and carry it
with the screen away from you.
2.6
Å Pipedream on RISC-OS Ö As reported last month, the current version
of Pipedream DOES work under RISC-OS. All you have to do is *RMKILL
International to kill the international keyboard. This is because Acorn
have changed the use of the <alt> key under RISC-OS and Pipedream uses
this for its drop-down menus.
2.6
Å PC Emulator problems Ö You may have problems with the computer
locking up when you are using the PC emulator. This happens sometimes
when you have a modem connected to the RS423 port which is not switched
on. I suspect it may be the öunknown IRQ at &00000000ò which Arthur
manages to cope with but perhaps the PC emulator canÉt. Try keeping the
modem switched on.
2.6
Å Stacked bar charts in Gammaplot Ö In Gammaplot it is not possible to
produce directly östackedò or segmented bar charts such as:-
2.6
2.6
2.6
2.6
Nor is it possible to create directly bar charts with gaps between the
bars such as-:
2.6
2.6
2.6
2.6
but it is possible to create them indirectly by using a table with (say)
only 1 in 5 of the values as a non-zero number (i.e. make other gaps by
introducing zeros in the spreadsheet).
2.6
Multiple bar charts such as:-
2.6
2.6
2.6
2.6
2.6
Can be created by producing three (or more) separate graphs from three
separate spreadsheets and then overlaying one on the other by using
öDisplay all graphsò and using the öWindow facility to move each (of the
3) separately to the desired position. The diagonal lines and any text
(such as scales or title) is added in öCustomiseò afterwards.
2.6
I know of NO package which produces segmented bar charts. Presenter will
produce multiple bars directly but without the flexibility of Gamma
Plot.
2.6
If you had the patience then you could make several different bar charts
and use the öBlock Moveò facility of öCustomiseò to stack the blocks of
the bars but it would take time and might be a lot easier in, say,
Artisan which has a ötransparentò colour for use with its sprites.
2.6
(N.B. Overlaid line graphs and multiple pie charts are very easy in
Gammaplot.)
2.6
2.7
Å BBC winchester on Archimedes!! Alan Glover says╔ I have got it to
work on the i/o podule under RISC-OS. Hereæs what you do: from the
!65Host directory:
2.7
*RMLOAD !RunImage
2.7
*CACHEROM 0 dnfs
2.7
*CACHEROM 1 ARFS
2.7
*CACHEROM 2 <>.ADFS130
2.7
*EMU.
2.7
Note: Must be ADFS 130 Ö i.e. a B/B+ version and you must find an image
of this yourself as it is not provided with RISC-OS. To use the
Archimedesæ ADFS type *ARFS.
2.7
The winchester is connected to the 2 MHz bus (theoretically 1 MHz!) on
the I/O podule as it would be on a BBC.
2.7
Å Configuration problems in Art Nouveau Ö If you select ÉConfigure
machineæ from the opening menu when you have already configured the
machine, you lose your old configuration when you quit and you are left
with Art Nouveauæs own configuration. This is because it doesnæt keep
track of whether you have already configured it. I was lucky Ö I had
written a program long ago that translates a *SPOOLed *STATUS into a
load of *Configureæs and I keep a copy of this spool on my hard disc at
all times. You have been warned. Martyn Lovell.
2.7
Å Graphic Writer with a Star SG-10 Ö If you can have one complaint
about Graphic Writer (apart from the manual) itæs the printer support. I
own a Star SG-10 and am trying to let Graphic Writer use it to the full.
The Star has an NLQ character set, but this cannot be combined with any
other text style except underlined. So what I want is to adapt the
printer driver so that it would normally print NLQ and for the other
effects resort to draft printing. For this, I used the Printcon program
and gave the following codes:
2.7
Initialisation:
2.7
ESC ö@ò
2.7
ESC öGò
2.7
ESC ö4ò
2.7
Which resets the printer, turns on double-strike (gives better bold, but
you may omit it) and NLQ. Make sure the printer is in IBM mode.
2.7
For configuration (leave the rest the same as a FX80):
2.7
Plain: 27,70,27,52
2.7
Bold: 27,53,27,69
2.7
Italic on: ESC öIò,1
2.7
Italic off:ESC öIò,0
2.7
Note that the input routine of the printcon program doesnæt accept two
öESCò sequences on one line, but it accepts two 27æs. The italic codes
are different from an FX80. In fact, FX80 compatibility turns out to be
somewhere in between the öStarò and öIBMò modes of the Star SG-10. The
trick is the plain and bold codes. When Graphic Writer finds a öBoldò
code it now also sends an NLQ-off code to the printer, which in effect
makes the printer print in draft, emphasized and double-strike, the
latter being already set at initialisation. (Yes, it is confusing, isnæt
it?!) This makes it possible to mix NLQ, bold and italic-bold in the
text. However, you canæt use italics or super/subscript without bold.
These just print in normal NLQ.
2.7
The same method should apply to other printers which canæt do everything
in NLQ.
2.7
Another tip on Graphic Writer is that you should always make any graphic
as big as possible, i.e. use the whole graphic area, however small you
want the picture to be. This makes page composition a lot easier and
also causes less problems with distortion when rescaling.
2.7
Å Interrupt module Ö The interrupt module by Steve Hoare (Archive 2.6
p44) is very useful especially, as he states in his article, with First
Word Plus for creating directories etc. However there is a problem
associated with *interrupt 0. This is that the pound key also generates
ASCII 0 (a bug in OS1.2 I think) which means that every time you type a
Époundæ, the interrupt module takes over and opens up the OS window.
However, <ctrl-O> is unused by First Word Plus, so I use *interrupt 15
instead.
2.7
The module also comes in handy when using a comms program to check on
filenames, *type logfiles etc, but there is an enhancement that I think
would make it more useful still. While in the OS window, it is possible
to type <ctrl-Z> to open up the text window to the full screen which is
handy, but on exit (in a WIMP program) only the top half of the screen
is restored. If the source code could be modified to issue a redraw
request for the whole screen it would be an improvement. Having looked
at the code, it should be easy to do. Any offers?
2.7
Å Memory shortage on Logistix and First Word Plus Ö To get round the
Éout of memoryæ snag which seems to turn up so often with First Word
Plus and Logistix, if you have the 1.20 PC emulator, use the PC.PC
startup routine first and then, instead of using the MS.DOS disc, insert
Logistix instead and <reset>. <Ctrl-break> will then autoboot Logistix
with a whole 275k of memory free to use.
2.7
Å Mitsubishi Disc Drives Ö Here are a number of points to bear in
mind, writes Vic Budd, when adding external disc drives. If, after
considering these, you feel competent to carry out the work, go ahead.
If not, it is prudent to entrust the work to an experienced operator to
avoid frustrations and disappointments.
2.7
There are different circuit board layouts, but the basic checks on the
drives are the same.
2.7
1. Remove link MS if made and change to adjoining position MM.
2.7
2. Remove link IU if made and discard it. On some drives there is no
removable link. However, there is a circuit board foil link, DI, near
the data cable edge connector, which is connected to pin 2, and this
should be cut in these instances.
2.7
3. Move drive selector link to position 1, 2 or 3 according to which
command you wish it to respond. (This assumes that the internal drive is
to be 0).
2.7
4. The resistor pack should be in place. On some drives this consists
of a single plug-in IC type device, whilst on others there is a row of
DIL pins which should have shorting links inserted.
2.7
5. Make sure the data cable is correctly orientated Ö it will need to
be at 180 degrees compared to the three and a half inch drive
connectors.
2.7
6. If, as I do, you wish to run a second three and a half inch
external drive and a five and a quarter inch drive, the connecting cable
will, of course, need to be turned through 180 degrees to connect the
drives together.
2.7
7. If you decide to use the Archimedesæ power supply, check the
connections carefully before attaching the cable connectors, making
quite sure you do not get the 12v and 5v leads confused.
2.7
If you do all these things correctly, you too should have no problems
with the Beebug lead and will be able to access drives A, B and C under
the PC Emulator, as well as 0,1, and 2 under Énativeæ Archimedes.
2.7
Å Moving the pointer when it is not linked to the mouse can be greatly
simplified by using the POINT TO x%,y% command which does exactly what
is needed (note that you must unlink the pointer from the mouse first
with MOUSE ON 129). Details are in the User Guide and under HELP POINT.
Having looked at the relevant part of the PRM, it appeared to be
impossible to do this, so I decided to have a rummage around in the
BASIC module. This resulted in the discovery of some undocumented calls!
Basically these are extensions of OSWORD &15 whereby putting &05 instead
of &03 at R1+0 causes the pointer position to be set instead of the
mouse position (see PRM p.133). Also, values of &04 and &06 appear to
read the mouse and pointer positions respectively, though the code to
read the mouse position contains a fatal bug in Arthur 1.2 and cannot be
used! In theory it might be possible to patch it with a copy of the
UtilityModule in RAM but this module refuses to be RMKILLed. Martin
Simmons
2.7
Å Problems with *UP Ö If you are having problems (as expressed in the
Help Section last month) with *UP or the use of ^ in a pathname, it is
probably because of a bug in the ADFS. The problem occurs when a
directory is renamed. The ADFS does not seem to keep track of it
properly. The solution, apparently, is to do a *COMPACT on the disc.
2.7
Å Repton 3 again (Philip Armstrong) Ö Iæve got a few more comments on
Repton 3. Firstly I hope that no one saved the new characters and maps
onto the original disc. I have found that occasionally, the maps have
been corrupted and thus rendered impossible. If you find a screen that
you canæt do then check it with the original version. For those people
that canæt get to grips with the array of different characters, create a
second disc with all the files using a standard set of characters. This
makes the screens easier to complete. I have included on the monthly
program disc, the new characters that I use. They are not brilliant, but
a distinct improvement on the original set. Superior Software only state
that characters and maps cannot be used for commercial exploitation, so
it is OK for us to distribute in this way. There is also a simple
program to merge maps and my characters. Also, if you cannot stand the
tune that accompanies the loading program of Repton, then change *tune1
to *tune0 in the öconfigò file.
2.7
Here is a list of Passwords for Repton 3. Sorry itæs not complete, but I
do have other things to do. If anyone can do screen E of WORK
(p=scratch), Iæd be pleased to hear from them because it looks imposs
ible and I have checked it against the original. I suspect a transporter
has been defined wrongly.
2.7
A Prelude B Rescind C Periwig D Mortify E Forsake
F Gratify G Thistle H Spangle
2.7
A Toccata B Nocturn C Liberal D Inspect E Delight
F Botanic G Vitriol H Sacking
2.7
A Finale B Yardarm C Zealous D Without E Aviator
F Elderly G Juniper H Crimson
2.7
A America B Herbage C Kitchen D Outcast E Quarter
F Untwine G Tremble H Strange
2.7
A Arctic B Kinetic C Gondola D Lozenge E Rotunda
F Frontal G Younger H
2.7
A Orient B Organic C Armhole D Visible E Neglect F
Biplane G H
2.7
A Oceans B Distain C Mundane D Eclipse E Warning F
G H
2.7
A Africa B Quickly C Zigzags D Closely E Panoply F
Bonfire G H
2.7
A Baby B Startle C Measles D Granite E WhimperF
Cushion G Alimony H Utensil
2.7
A School B Qualify C Knicker D Dynamic E Tendril F
Lanyard G Vinegar H Yaskmak
2.7
A Teenage B Eternal C Whisper D Feather E Rhubarb F
Jasmine G H
2.7
A Work B Inverse C Parapet D Elegant E Scratch F G
H
2.7
A Oap B Jackdaw C Rupture D Archery E Figment F
Natural G Tonight H Brigade
2.7
A Prehist B Dormant C Mineral D Varnish E Dashpot F
Lobelia G Upright H
2.7
A Egypt B Lobster C Tabloid D Achieve E Gristle F
Deceive G Scalpel H
2.7
A Victori B Earnest C Pervade D Violent E Bashful F
Magnify G Wrought H Horizon
2.7
A Now B Charity C Funeral D Justify E Naughty F
Isolate G Radical H
2.7
A Future B Primate C Mustang D Iterate E F G H
2.7
Å Shared C Library Ö Users of release 2 of ANSI C might like to know
how to use the Shared C Library which is included on the disc but which
does not seem to be documented in the User Guide. Normally, the AOF
file, generated by compiling the C source, is linked with the C ANSI
library file, $.ARM.CLib.O.AnsiLib. This produces an image file which
can be executed directly by *RUNning it. This image file tends to be
quite long as large port-ions of the C ANSI library are incorporated in
it.
2.7
On the C disc, is a file called $.Library.CLib which contains the C ANSI
library in the form of a relocatable module. The interface between the
user program and this Shared C Library module is a small file called
$.ARM.CLib.O.Stubs which simply defines each ANSI library function as a
SWI which is then recognised by the library module.
2.7
As an example of the use, try the following. Mount your working copy of
the C disc and enter directory $.ARM.CBench. Now compile the source file
C.HelloW using the -c option so as not to invoke the linker:
2.7
*CC HelloW -c
2.7
Now link the resulting AOF file with the Stubs library:
2.7
*Link -o HelloW O.HelloW $.ARM.CLib.O.Stubs
2.7
Next load the Shared C Library module:
2.7
*RMLoad $.Library.CLib
2.7
And finally run the program:
2.7
*Run HelloW
2.7
Note that an image file generated in this way is not truly stand-alone
as it needs the Shared C Library module to be loaded in order for it to
run (but then again many programs need the Floating Point Emulator to be
loaded in order to run). A big advantage is that the image file is very
much smaller than it would be if it had been linked with the ANSI
library in the normal way. One can envisage several C programs multi
tasking under RISC-OS, sharing the resources of the Shared C Library.
2.7
It should be noted that the Arthur-specific functions declared in the
ArthurLib header file are not incorporated in the Shared C Library. If
your program uses these functions you must include
$.ARM.CLib.O.ArthurLib at the linking stage. So try the following:
2.7
*CC Balls64 -c
2.7
*Link -o Balls64 O.Balls64 $.ARM.CLib.O.Stubs $.ARM.CLib.O.ArthurLib
2.7
*Run Balls64
2.7
Provided the Shared C Library module is loaded, the program should run
normally. John Morley
2.7
Å Sprite Animation Ö There have been many articles relating to the use
of Sprites on the Archimedes. These have covered the use of PLOT &ED,X,Y
to display a Sprite in its defined colours at point (X,Y) and the use of
a Mask to allow a background to appear through the Éunusedæ parts of a
sprite. They have also shown the use of Exclusive OR plotting using GCOL
11,0 to allow the sprite to be moved over any coloured background.
2.7
The EOR solution to this last problem, of moving a multi-coloured sprite
over a multi-coloured background, does work, but unless a great deal of
thought is given to palette selection, the sprite does not retain its
defined colour during movement.
2.7
Many games will require the facility to define a sprite in specified
colours, with a mask and to move it still retaining those colours rather
than those produced by EOR.
2.7
A solution is to use the standard Move/Display/Erase in a loop but not
to use EOR. The following algorithm does this :
2.7
1 Define the sprite ÉMySpriteæ with a mask (using SEDIT on the Welcome
Disk).
2.7
2 Determine the size of ÉMySpriteæ. This may be known but a SYS call
does it for you.
2.7
LOOP
2.7
3 Determine the position where ÉMySpriteæ is to be plotted.
2.7
4 Grab a sprite ÉTempæ from the screen at this position the same size
as ÉMySpriteæ.
2.7
5 Plot ÉMySpriteæ with the mask.
2.7
6 Plot the grabbed sprite ÉTempæ to ERASE ÉMyspriteæ.
2.7
ENDLOOP
2.7
The following program demonstrates this :
2.7
10 REM > SpritePlot
2.7
20 REM Copyright Ian Smith
2.7
30 REM March 1989
2.7
40
2.7
50 REM An example program to show
2.7
the use of sprites moving
2.7
60 REM across a multi coloured
2.7
background by grabbing an area
2.7
70 REM of screen as a sprite and
2.7
then using it to overwrite the
2.7
80 REM moving sprite.
2.7
90
2.7
100 MODE 15 :REM Works in other
2.7
modes
2.7
110 T$=öTempò : REM Will be the
2.7
sprite grabbed from screen
2.7
120 M$=öMySpriteò : REM A masked
2.7
sprite created with SEDIT
2.7
130 *SLOAD !Sprites
2.7
140
2.7
150 SYS &2E,40,,T$ TO ,,,W,H :REM
2.7
Find size of sprite to grab
2.7
160 : REM W)idth and H)eight
2.7
170 PROCDrawBackground : REM Draw
2.7
a Multicoloured background
2.7
180 PROCTitle:REM and put titles on
2.7
190
2.7
200 REPEAT
2.7
210 REM ****** MOVE ******
2.7
220 MOUSE X,Y,B
2.7
230 SYS &2E,16,,T$,1,X,Y,X+W*2,
2.7
Y+H*4 : REM Grab sprite
2.7
from screen
2.7
240
2.7
250 OSCLI(öSCHOOSE ò + M$ ) :REM
2.7
Select original sprite
2.7
260
2.7
270 REM ****** DISPLAY ******
2.7
280 GCOL 8,0 :REM Now plot it with
2.7
its mask
2.7
290 PLOT &ED, X,Y :REM at the
2.7
mouse position
2.7
300 PLOT &ED,900,800 : REM and
2.7
display it in rectangle
2.7
310
2.7
320 WAIT:WAIT : REM Synchronise
2.7
output
2.7
330
2.7
340 OSCLI(öSCHOOSE ò + T$) :REM
2.7
Now plot the grabbed sprite
2.7
350
2.7
360 REM ****** ERASE ******
2.7
370 GCOL 0,0
2.7
380 PLOT &ED,X,Y : REM at the same
2.7
place
2.7
390 PLOT &ED,1000,800 :REM and in
2.7
its rectangle
2.7
400 UNTIL B=7 : REM 3 buttons
2.7
terminates
2.7
410 END
2.7
420
2.7
430 DEF PROCDrawBackground
2.7
440 GCOL 3 : RECTANGLE FILL 0,0,
2.7
300,300 : REM Just a
2.7
couple of
2.7
450 GCOL 4 : RECTANGLE FILL 50,50,
2.7
50,50 : REM rectangles and
2.7
460 GCOL 12:CIRCLE FILL 800,400,200
2.7
: REM circles
2.7
470 GCOL 5 :CIRCLE FILL 600,300,100
2.7
480 OSCLI(öSCHOOSE ò + M$)
2.7
490 PLOT &ED,75,90 : REM and the
2.7
sprite
2.7
500 ENDPROC
2.7
510
2.7
520 DEF PROCTitle
2.7
530 GCOL 1
2.7
540 RECTANGLE 900-2,800-4,W*2+4,
2.7
H*4+8 :REM Draw rectangles
2.7
550 RECTANGLE 1000-2,800-4,W*2+4,
2.7
H*4+8 : REM in which sprites
2.7
560 PRINT TAB(53,2);öS P R I T E Sò
2.7
: REM are displayed
2.7
570 PRINT TAB(52,3);öoriginal
2.7
grabbedö
2.7
580 PRINT TAB(0,1);öSPRITE
2.7
DEMONSTRATION : use mouse
2.7
to move spriteö
2.7
590 ENDPROC
2.7
Comments on the program
2.7
PROCDrawBackgound sets up a background to move over.
2.7
PROCTitle puts text and a couple of rectangles on the screen
2.7
150 uses a SYS call to find the Width and Height of ÉMySpriteæ. This
is needed so that the right size ÉTempæ can be grabbed. (See PRM pp
429,433.)
2.7
230 grabs the sprite from the screen using a SYS call. Note the *2 and
*4 to compensate for screen MODE 15. Youæll need to change this for
other resolution modes.
2.7
250 selects ÉMySpriteæ
2.7
280 selects the Mask Plot option GCOL 8.
2.7
290 plots the sprite at the Mouse selected point
2.7
300 plots the sprite in a rectangle to show its original colours.
2.7
340 selects ÉTempæ
2.7
380 plots ÉTempæ effectively erasing ÉMySpriteæ
2.7
390 plots ÉTempæ in its rectangle. The effect of 390 has an interest
ing side-effect. When you run the program move the sprite over the
rectangle! See what happens!
2.7
The program ÉSpritePlotæ and the sprite file É!Spritesæ are on this
monthæs disk but you can use the program by keying it in and also
creating a masked sprite in mode 15 using SEDIT and saved as !SPRITES.
2.7
The program can obviously be modified to run in other modes. The flicker
on the sprite could be removed by modifying the program to plot only if
the mouse has been moved. Ian Smith
2.7
Å Star-Trader Cheats Ö Here are some ideas and cheats for
ÉStarTraderæ. It is an excellent game, all the more impressive when you
consider it is written in BASIC!
2.7
Load the main game and enter the EDIT editor. (The main game file is
É$.Resouces.StarTrader. StarTraderæ.) You can alter as many as the
following as you like to make the game a bit easier to get into;
2.7
Line 290 change to: SUN=1 for a SunBurst
2.7
DEATH=1 for a DeathBlossom
2.7
CELL=1 for a super energy cell
2.7
ENG=3 for the most powerful engines (Note ENG=2 & ENG=1 are available
as well)
2.7
NUMPT=10 for the number of photon torpedoes. Having 10 doesnæt spoil
the display!
2.7
Line 390 change CRD to the number of credits you want (STDA is the
stardate)
2.7
Line 420 change MAXHOL to the size of the hold you want fitted.
2.7
Note: DAMCAP is used in Line 13570 to calculate the remaining hold
capacity.
2.7
PRC() holds the value of each of the tradegoods you are carrying CTOTAL
is the total weight of cargo you are carrying at the moment (also used
in 13570)
2.7
The messages you occassionally get when transporting down to a planet
are held in code. If you want to see them, then type the following
changes in immediate mode.
2.7
LOAD öStarTraderò
2.7
DELETE 0,39349
2.7
DELETE 39560,39580
2.7
DELETE 39640
2.7
DELETE 39650,39690
2.7
39351 DIM CMG$(20)
2.7
39554 FOR T=0 TO 20
2.7
39651 NEXT
2.7
PROCCLUE (If <ctrl-B> is used first, the messages can be sent to a
printer.)
2.7
There is a 50:50 chance of getting a clue on any planet landing. 16
messages have a 95% chance of being called, the other 4 messages only
5%. The rumour sends you to a randomly chosen planet! Some messages are
tradehints, some are adverts for other games(!) and a couple are very
useful clues to the solution of the puzzle.
2.7
The planets on which the segments are found and the code are chosen at
the creation of the universe stage. RUN the game, then immediately save
it. TYPE in CHEAT4 to get a list of planet numbers where the segments
are. CHEAT4 also prints out the code letters. These are held in the
array ZTX()
2.7
10 REM >CHEAT4
2.7
20 DIM PKLR(800),GR(800),ANAME$
2.7
(800),TYP(800),SS(800),PO(800)
2.7
,STARSS(120),PX(120),PZ(120), PC(9),SP(9),PRC(13), UNI(120,12),ZTX(8)
2.7
30 BB=OPENIN(ö:1.xxxxxò):REM
2.7
change xxxxx to name of
2.7
SaveGame file
2.7
40 INPUT# BB,SUN,DEATH,CELL,ENG,
2.7
FS, PS,SS,AS,PTD,PSD,DAMCAP,HD, TE,NUMPT,PE,EPS,STDA,CRD,PN,SY
2.7
50 FORT=1TO800:INPUT# BB,PKLR(T),
2.7
GR(T),ANAME$(T),TYP(T), SS(T),PO(T):NEXTT
2.7
60 FORT=1TO120:INPUT# BB,SARSS(T)
2.7
,PX(T),PZ(T):NEXTT
2.7
70 FORT=1TO9:INPUT# BB,PC(T),SP(T)
2.7
:NEXTT
2.7
80 FORT=1TO13:INPUT# BB,PRC(T)
2.7
:NEXTT
2.7
90 FORZ=1TO119
2.7
100 FORT=1TO12:INPUT# BB,UNI(Z,T)
2.7
:NEXTT
2.7
110 NEXTZ
2.7
120 FORT=1TO8:INPUT# BB,ZTX(T)
2.7
:NEXTT
2.7
130 CLOSE# BB
2.7
140 FOR LOOP=1 TO 9:PRINT PC(LOP),
2.7
SP(LOOP)æ:NEXT:REM planets
2.7
150 FOR LOOP=1 TO 8:PRINTCHR$(64+
2.7
ZTX(LOOP)):NEXT:REM code
2.7
You get a nice fanfare when you collect a segment. The percentage
chances reported during a scan can be as low as 45% or as high as 90% on
a planet which actually has a segment.
2.7
If you have two drives, it is quite easy to use drive 1 as the GameSave
drive (as in the program above). Just change (input$) in Lines 3770,
4020 and 4050 to (ö:1.ò+input$). Dave Kent
2.7
Å TV output from Archimedes? Ö It is possible to connect a TV to an
Archimedes, though only in monochrome and via a video. Connect a wire
(co-ax) from a phono plug plugged into the Archimedes mono video socket
to pin 20 (centre core of Co-ax) and any one of the many 0V lines (i.e.
connect the braid screen to 0V) on a SCART plug. This means that it only
works on video machines with a SCART socket on them (if no SCART socket,
then connect to VIDEO IN via a phono or BNC plug). This also means that
you can make demo videos and stuff by taping the pictures. Sound can be
connected to pins 2 and 6, I think, never tried it! (See Archive 2.2 p
6) Does anyone now how to convert the Archie mono out to colour?
Plugging the Archie SCART cable to the video doesnæt work! Oliver
Cornes.
2.7
Å Using First Mail Ö At first, I regarded First Word Plus as a very
ordinary word processor. The need to keep reformatting with <f12> seemed
to be a step backward. However First Mail changes the picture for me.
Here are one or two ideas on how to use First Mail for handling ordinary
day-to-day cor-respondence.
2.7
I ömerge fromò a file carrying my letterhead. In fact I have a few
different letterheads for different purposes. In addition to the
letterhead my öfromò file has the following First Mail commands:
2.7
longdate
2.7
input öaddress file?ò, address
2.7
input ötext file?ò, text
2.7
includefile dat.address
2.7
Dear
2.7
includefile doc.text
2.7
includefile dat.address
2.7
(The bits in italic that should be in light type. It is not obvious
which the light bits should be; but see the note on p. 206 of the First
Word Plus manual.)
2.7
The system asks me for an address file and then a file containing the
text of the letter, both of which it merges with the letterhead. The
second printing of the address comes after a hard page break. Since I
specify pauses on page breaks, this allows me to remove the letter from
the printer and replace it with the envelope (or sticker) for the second
address to be printed on that. I can cancel this when I do the draft
copy, which I keep for my own files. I save my letter texts in the doc
directory and addresses in the dat directory. This allows me to use the
same name for both if that is more convenient.
2.7
Incidentally I use a brother daisywheel for most of my letter quality
printing; and I have configured the driver to print my letterhead in
bold red. A nice feature of First Word Plus is that you can have several
drivers for the same printer if you give them different names. Not only
that, but with a daisy-wheel you can have two configurations on the same
driver by making the NLQ configuration different from the draft
configuration, though of course, the terms draft and NLQ will have no
real meaning for a daisywheel.
2.7
There are some errors in the Brother driver supplied, by the way; so
check with the manual, especially if you are Danish or are in the habit
of using some of the more obscure symbols. The First Word Plus manual is
a bit vague about full pathnames, too. For instance, to install a
different default printer you have to type, say,
2.7
*copy 1wp.cfg.epson_fx resources.
2.7
1wp.1wp_print
2.7
I find the First Word Plus file window most useful for exploring discs.
If you click on the window exit symbol you get the parent directory.
Clicking on a directory name in the window lists that directory in the
window as well as selecting it in the directory slot. Glyn Emery.
2.7
2.7
We begin a new section this month to help you get to grips with RISC-OS.
When you buy RISC-OS, you get a disc full of information from software
houses (see list below) about how to get their software running under
RISC-OS, but I suspect that because RISC-OS is so new, there will be
lots for us all to learn Ö hence this column.We really need a volunteer
to be the editor of this corner Ö someone to whom I can send all the
info and who will then collate it, check it and regurgitate it to me
(preferably via Eureka II for speed). Anyway, Mike Harrison, Matthew
Treagus, Keith Milner and Ting Kuei start us off.
2.7
Å Flashing screens Ö Iæve just got hold of the release RISC-OS User
Guide and noticed that it does not seem to mention the fact that in
modes 21, 24 and 28, the screen blanks when accessing floppies, due to
the high DMA rate. Iæm sure many dealers will get calls from worried
users who think that fitting RISC-OS has damaged their machine because
of the screen flashing on and off!
2.7
Å Logistix Ö Logistix users must replace the Floating Point Emulator
in the Library of the Log-istix Disc (version 2.50) with the later one
which is supplied with RISC-OS, i.e. FPE version 2.60. It can also be
found on the ABC Compiler Disc. If this is not done Logistix, will not
run correctly.
2.7
Å TWIN Ö If, like me, you are annoyed at the delay in loading TWIN
when editing programs, especially with BASIC using TWINO8, make an Obey
file that does the following :
2.7
Set Run$Path Ram:,<Run$Path>
2.7
Copy Twin Ram:Twin f~c
2.7
(Ensure that your configured RamFS size is big enough first!). After
running this, Twin will be instantly loaded from Ram Disk. You can of
course also include in the file a *Key command to define your favourite
function key to call Twin, e.g.
2.7
Key 1 |UTWINO8|M
2.7
For BASIC. The |U deletes any crud which may have been on the command
line before you hit <f1>.
2.7
Å Virsuses on RISC-OS!!! Ö I wonder how many people will look at this
in panic. Donæt worry. There is a virus on RISC-OS, even before it is
released, but it is totally harmless. In fact it is quite fun. First, a
brief description of how most viruses work:
2.7
Most business machines load their operating system from disk. So, in
order to Évirusæ one of these machines, the offending program just
becomes part of the operating system in some way. It copies itself onto
other discs with operating systems on and soon every copy of the OS you
have is öinfectedò.
2.7
On a sensible computer, such as the Archimedes(!) the operating system
is on ROM, and cannot be altered! Thus if someone decides to write a
virus program, once it is detected, turning the machine off will remove
it. It is, however, possible to install a virus on other files on disc.
This is much more difficult to do, is easier to detect and easier to
remedy. For instance, the !BOOT file is a common file to be found on a
disc, and a virus could conceivably attach onto this, although it would
be very difficult since every !BOOT file is different.
2.7
I will not disclose how the RISC-OS virus installs itself as it will
only encourage people to write viruses. I will say, however, that once
detected, it is ((very simple)) to remove it with no after effects. If
the virus (which actually originates from Acorn!) appears on your disc,
not much actually happens╔ or at least it appears that way. You are
using the desktop as normal and suddenly, a small fish appears on the
screen and swims across, behind all the windows, leaving a trail of
bubbles which rise to the top of the screen and disappear. Several more
fish swim backwards and forwards on the desktop until the machine is
reset. This virus is totally harmless, the only ill effect is to use up
a bit of processor time! In fact, I have installed it deliberately as it
is quite relaxing!
2.7
Another virus we have heard of is the FF8 virus which adds itself to
filetype FF8 files. It displays a message and prevents the affected file
from running on the 13th of the month.This it is a real pain if you are
not careful, i.e. if you forget to turn the computer off before running
a new program! There is a detector program available (downloadable from
area 2 on Eureka II) but it will only check for the existence of the
virus and will not destroy it.
2.7
Å Manuals Ö Q: When RISC-OS is available, does it mean that the
manuals I purchased are outdated or will Acorn publish a cheap edition
to add to it?
2.7
A: The bulk of the PRM remains correct, however there is a wealth of
brand new information and a new PRM will be out in due course, probably
in three volumes!
2.7
The following firms have provided help on RISC-OS compatibility. The
information is on the Support Disc that comes with RISC-OS.
2.7
Abacus Training Ltd
2.7
Ace Computing
2.7
Acorn Computers Ltd
2.7
AVP Computing
2.7
Cambridge Micro Systems Ltd
2.7
Clares Micro Supplies Ltd
2.7
Colton Software
2.7
Dabs Press
2.7
Dixon and Dixon
2.7
Emmerich (Berlon) Ltd
2.7
GEM Electronics
2.7
Intelligent Interfaces Ltd
2.7
Institute of Ophthalmologists
2.7
Lendac Data Systems Ltd
2.7
Lingenuity (Lindis International Ltd)
2.7
Magenta Research Ltd
2.7
Maze Technology
2.7
Meadow Computers
2.7
Minerva Systems Ltd
2.7
Mitre Software Ltd
2.7
Oak Professional Software Ltd
2.7
Silicon Vision Ltd
2.7
Watford Electronics Ltd
Å Floppy programs on hard discs Ö Hereæs the best method Iæve come
across of getting floppy programs to run on a HD machine. You need two
FFF type files (or Obey if you want) One called ÉFloppyæ should contain:
2.8
*CON. Drive 0
2.8
*CON. NoBoot
2.8
The other called Hard should be:
2.8
*CON. Drive 4
2.8
*CON. Boot
2.8
If you put these in the library you can then
2.8
*Floppy
2.8
<ctrl-break>
2.8
<shift-break>
2.8
do whatever else
2.8
<ctrl-break>
2.8
*DIR :4
2.8
*hard
2.8
<ctrl-break>
2.8
(This assumes you have a !Boot on your hard disc.) Martyn Lovell
2.8
Å Head alignment problems? Ö If you are getting disc errors and
suspect that the problem might be head alignment, one way of confirming
this is to use the disc copier program that you will find on Share-ware
N╝2. The program does a check of the whole disc to find bad sectors. If
one of the heads is misal-igned, you will probably find that all the bad
sectors reported are on one or other of the heads. Then itæs time to
take it off to your local dealer for repair.
2.8
Å Hearsay Ö If you need to change modem baud rates with ATB3 or ATB0
after calling one remote system and before calling another, you can do
so by using a dial prefix in the modem driver edit screen by putting
öATB3Dò or öATB0Dò as appropriate.
2.8
Å Matrix Procedures and Functions Ö This was prompted by Steve Drainæs
article in Archive 2.1 p.17 where he stated that a numerical method for
the inverse of a square matrix needs a good guess of the inverse and
uses the transposed matrix as a starting point. His excellent program
has been timed to invert a 20 x 20 matrix to 1 part in 10^9 in approx-
imately 10 seconds.
2.8
A good guess or even a desirable result can be ob-tained by a procedure
described below. It calculates an inverse of 20x20 matrix in about 280
centisec-onds giving an error in the non-diagonal elements of the
identity matrix of less than 1 part in 10^6.
2.8
The method used is based on the following. The matrix M to be inverted
is premultiplied by its transposed MÉ, giving MæM. The result is
decomposed in a lower triangular matrix L satisfying the identity
LLæ=MæM. Then I, which is the inverse of L, can be determined in a
straight forward way. Matrix IæI thus equals the inverse of MæM, and
finally IæIMÉ gives the result wanted. This is correct as can be seen
when premultiplying a vector x by M giving a vector v, and solving for
x.
2.8
Mx=v ==> MæMx=Mæv==> LLæx=Mæv ==> IæILLæx=IæIMæv ==> x=IæIMæv
2.8
In fact, this is the least square solution for vector x, i.e. r
equations with c unknown variables ( r>=c ) are solved using the
criterium that the sum of the squares of the deviations to a solution of
vector x obtains a minimal value.
2.8
The program presented below uses PROC lst_sq_inv to determine the
Éinverseæ Mi of any matrix M. If M is a square matrix then MiM = E and
also MMi = E, E being the identity matrix. As an Éextraæ, the determi
nant of the square matrix M can easily be calculated. To my knowledge
the method is numerically very stable.
2.8
10 REM >Matrix_Inv
2.8
20 :
2.8
30 *********************************
2.8
40 REM Inverting an arbitrary matrix
2.8
50 REM E.D. Engelhardt, March 1989
2.8
60 *********************************
2.8
70 :
2.8
80 REM *** Generate random matrix M,
2.8
col% columns and row% rows
2.8
90 CLS
2.8
100 PRINTÉö Inverting an arbitrary
2.8
matrixöÉ
2.8
110 REPEAT:INPUTö Rows :
2.8
örow%:UNTIL row%>0
2.8
120 REPEAT:INPUTö Columns <= rows :
2.8
öcol%:UNTIL col%<=row% AND col%>0
2.8
130 CLS:PRINTÉö Rows : òSTR$row%
2.8
Éö Columns : òSTR$col%
2.8
140 row%-=1:col%-=1
2.8
150 DIM M(row%,col%)
2.8
160 FOR r%=0TOrow%:FOR c%=0TOcol%:
2.8
M(r%,c%)=RND(1)*SGN(0.5-RND(1)) :NEXT:NEXT
2.8
170 :
2.8
180 start%=TIME
2.8
190 :
2.8
200 REM Determine the Éleast squareæ
2.8
inverse Mi of M. Result : Mi.M is equal to the identity matrix E.
2.8
If rows = cols also M.Mi = E.
2.8
210 :
2.8
220 DIM Mi(col%,row%):PROClst_sq_inv
2.8
(M(),Mi())
2.8
230 end%=TIME
2.8
240 :
2.8
250 PRINTÉö Time(centisecs) : ò;
2.8
STR$(end%-start%)Éæ
2.8
260 :
2.8
270 PROCprint
2.8
280 END
2.8
290 ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ-300 DEFPROClst_sq_inv(R(),Ri())
2.8
310 REM Ri is Éleast squareæ inverse
2.8
of R, i.e. Ri.R = E (identity matrix). If rows = cols
also
2.8
R.Ri = E.
2.8
320 REM Dimensions R(v%,h%),Ri(h%,v%)
2.8
==> v% : rows , h% : columns
2.8
330 REM E.D. Engelhardt, March 1989
2.8
340 :
2.8
350 LOCAL RtR(),L(),I(),v%,h%,c%,r%,t%
2.8
360 v%=DIM(R(),1):h%=DIM(R(),2)
2.8
370 DIM RtR(h%,h%),L(h%,h%),I(h%,h%)
2.8
380 :
2.8
390 REM Determine transpose of R
2.8
400 FOR r%=0 TO v%:FOR c%=0 TO h%:
2.8
Ri(c%,r%)=R(r%,c%):NEXT:NEXT
2.8
410 :
2.8
420 REM Calculate square matrix to be
2.8
inverted
2.8
430 RtR()=Ri().R()
2.8
440 :
2.8
450 REM Calc lower triangle L of RtR
2.8
460 FOR c%=0 TO h%:FOR r%=c% TO h%
2.8
470 L(r%,c%)=RtR(r%,c%):t%=c%-1
2.8
480 IF t%>=0 FOR t%=t%TO0STEP-1:
2.8
L(r%,c%)=L(r%,c%)-L(r%,t%)*
2.8
L(c%,t%):NEXT
2.8
490 IF r%>c% THEN L(r%,c%)=L(r%,c%)
2.8
/L(c%,c%) ELSE L(r%,c%)=SQR L(r%,c%)
2.8
500 NEXT:NEXT
2.8
510 :
2.8
520 REM If R is square (rows = cols)
2.8
its determinant equals the product of the diagonal elements of L. The
determinant of RtR equals the
2.8
square of the determinant of L.
2.8
530 :
2.8
540 REM Invert triang matrix L to I
2.8
550 FOR c%=0 TO h%:FOR r%=c% TO h%
2.8
560 FOR t%=c% TO r%-1:I(r%,c%)=
2.8
I(r%,c%)-L(r%,t%)*I(t%,c%):NEXT
2.8
570 IF r%>c% THEN I(r%,c%)=I(r%,c%)
2.8
/L(r%,r%) ELSE I(r%,c%)=1/L(r%,r%)
2.8
580 NEXT:NEXT
2.8
590 :
2.8
600 REM Determine transpose L of
2.8
inverse triangle I
2.8
610 FOR r%=0 TO h%:FOR c%=0 TO
2.8
h%:L(c%,r%)=I(r%,c%):NEXT:NEXT
2.8
620 :
2.8
630 REM Inverse matrix of R is Ri
2.8
640 RtR()=L().I():Ri()=RtR().Ri()
2.8
650 :
2.8
660 ENDPROC
2.8
670 ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ-680 DEFPROCprint
2.8
690 VDU 14
2.8
700 PRINTö ******** Elements MatrixòÉ
2.8
710 FOR r%=0 TO row%:FOR c%=0 TO
2.8
col%:PRINT M(r%,c%):NEXT:PRINT:NEXT
2.8
720 PRINTö ******** Elements inverse
2.8
MatrixöÉ
2.8
730 FOR r%=0 TO col%:FOR c%=0 TO row%
2.8
:PRINT Mi(r%,c%):NEXT:PRINT:NEXT
2.8
740 DIM E(col%,col%)
2.8
750 E()=Mi().M()
2.8
760 PRINTö ******** Elements of
2.8
Inverse_Matrix.MatrixöÉ
2.8
770 FOR r%=0 TO col%:FOR c%=0 TO col%
2.8
:PRINT E(r%,c%):NEXT:PRINT :NEXT
2.8
780 VDU 15
2.8
790 ENDPROC
2.8
Å Repton 3 Ö There is a bug in screen E of WORK, so to get past it,
you will need to know the next password which is COUNTER.
2.8
Å Three floppies under Arthur Ö Here is a solution to the problem of
three floppies on the desktop (Archive 2.7.12). Enter the following in a
file called ÉDesktopæ in the library directory, use *BUILD or a text
editor such as Twin to enter it.
2.8
*BASIC
2.8
LOAD öDESKFS:DeskTopMgr2ò
2.8
11 OSCLI öDESKFSò
2.8
12291 IFfloppies%>2 THEN PROCsys_
2.8
addtoiconbar_left(öfloppy2ò,
2.8
ödisc3.5ò,&301A,icon_fgcol,
2.8
icon_bgcol, icon_width%)
2.8
28600 DEFFNselect_floppy2
2.8
28610 =0
2.8
28620 DEFFNmenu_floppy2
2.8
28630 PROCsys_definetextmenu
2.8
(öfloppy2ò,öfloppy :2ò,öFormatò)
2.8
28640 =0
2.8
28650 DEFFNaction_floppy2
2.8
28660 =FNfilehandler_open_dir
2.8
(ö-adfs-:2ò,öFloppy :2ò,0)
2.8
28670 DEFFNmenuselect_floppy2
2.8
28680 CASEitem0% OF
2.8
28690 WHEN0: PROCfilehandler_
2.8
formatfloppy(ö2ò)
2.8
28700 ENDCASE
2.8
28710 =0
2.8
RUN
2.8
When you wish to use the three floppy version of the desktop, instead of
typing *DeskTop, enter */DeskTop, this will ensure that the upgrade
program in the library directory is run instead of activating the
desktop in the normal way.
2.8
Unfortunately, there is no way of permanently updating the desktop so
that you can power up into the desktop with three floppies since it is
held in ROM which obviously cannot be changed.
2.8
If you wish to power up in the desktop with three floppies then you
could do the following:
2.8
*Configure Boot
2.8
*Configure Language 0
2.8
and setup a !Boot file as follows:
2.8
*/Desktop
2.8
ensure that when you switch the computer on, your boot disc is in drive
0 (or your default drive as configured with *Configure Drive) and the
desk top will appear after a short delay.
2.8
N.B. No damage will be caused to the disc in powering up with the disc
in the drive since the latch will be across the disc surface and the
disc heads not in contact with the disc surface.
2.8
The other solution is to upgrade to RISC-OS which can support up to four
floppies! Darren Jackson
2.8
Å Zarch Ö To put Zarch onto a hard disk, use....
2.8
*UNPLUG SoundChannels
2.8
*ZARCH
2.8
When error occurs type the following,
2.8
*RMREINIT SoundChannels
2.8
*SAVE :4.ZARCHcopy 8000+20800
2.8
*BUILD :4.ZARCHgo
2.8
LOAD ZARCHcopy
2.8
MEMORYA E1AC E1A0F00E
2.8
CHANNELVOICE 1 6
2.8
CHANNELVOICE 2 7
2.8
CHANNELVOICE 3 8
2.8
CHANNELVOICE 4 9
2.8
GO 1FF30
2.8
Then press <escape>. Type ZARCHgo to run the copy from hard disk. Tony
Porter
2.8
2.8
First Word Plus Extended Dictionary
2.8
I was asked to review the First Word Plus Extended Dictionary which is
available from Science Frontiers. It seems unfair to review it in only
one paragraph, but Paulæs maxim is, öSpace in Archive is at a premium,
so say what is worth saying as briefly as possible, then shut up!ò
(Well, thatæs the jist of what I say! Ed.)
2.8
First Word Plus Extended Dictionary comprises an 80,000 word dictionary
which replaces that in the Acorn package, and three specialized
supplementary dictionaries covering computer terms, geographical
locations and Christian names. It is an entirely competent package,
though necessarily not the most fascinating in content. If you need more
words in your dictionary, buy it, but if you need to work with large
documents, do not load it, as bigger dictionaries do take up more space.
2.8
FWP Extended Dictionary costs ú6.95 (ú6.50 from Archive) and is produced
by Science Frontiers.
2.8
From FWP to DTP?
2.8
Although it is not strictly the business of the First Word Plus column,
I took a good look at the Desktop Publishing program when visiting the
Acorn stand at the Which Computer? Show. It should be available a few
weeks after RISC-OS and is reported to be öfinishedò and about to go
into production. However, it was apparently not the öfinishedò version
at the show. My informant assures me that the production version will be
even better, which should certainly be good indeed. Even the present
version has a Ésecretæ feature which is quite impressive and even Apple
cannot match it.
2.8
<ctrlÖA> Solution?
2.8
I have discovered why my ö<ctrl-a> makes a bleepò modules reported in
Archive 2.5 p. 18 absolutely refused to work: the answer is on the top
of page 34 of the Programmeræs Reference Manual: never use OS_WriteC
routines when you have intercepted an interrupt. The solution (but donæt
hold your breath) is to insert a <ctrl-g> into the input buffer. This
works absolutely perfectly Ö except in FWP, where it is interpreted as a
call to read the ruler!!
2.8
No-one else has produced a solution which actually works, so the small
prize is still unclaimed.
2.8
Shareware disk N╝6
2.8
We get a lot of enquiries about printer drivers. The problem is that we
do not have that many different kinds of printer, so cannot help much.
Besides, printer drivers are (however necessary and satisfactory a
solution they may be) a pain and a bore, except when they are to drive
the printer you use. I am trying to compile a disk of all the contrib
uted ögoodiesò, especially printer drivers and related information and
ideas. If you have a contribution, please let me have it in the next
couple of weeks. We have printer drivers for: Taxan-Kaga KP810 = Canon
PW 1080; Citizen 120; Epson LX800 and LQ500; Star LC10 and NL10;
Panasonic KXP1080; H-P DeskJet. Quite a few of these have interesting
variants and associated ideas which may be useful for doing the special
things you want to do with your printer.
2.8
Once the shareware disk is available, printer driver enquiries will be
at the bottom of the pile!
2.8
(Mike sent me a pre-release version of this which I published as
Shareware N╝6, thinking it was the finished article. Ooops! We will
continue to supply N╝6 as it is and then offer free up-grades when the
final version is ready. Sorry about that! Ed.)
2.8
Two related matters
2.8
Å If you get the monthly disk, you will probably have installed the
IntModule from Steve Hoare (Archive 2.6, p. 44), and you will agree with
me that it is quite the best thing that has happened to First Word Plus
since its launch! I am sure that my life-expectancy has been increased
by being able to access the ö*ò commands we all love (and hate). If you
have not installed it, copy the IntModule to your 1st Word startup disk,
then modify !boot by adding lines 23 and 26 as follows:
2.8
23 *rmrun IntModule
2.8
26 *Interrupt 15
2.8
Now if you press <ctrl-o>, the screen goes bright blue and gives you a *
prompt. Create your directories, mount disks or whatever, then just *
<return> and you are back. Wonderful. If you do not get the disks, more
fool you, this one was worth a yearæs subscription, but it will be on
the proposed ösharewareò disk.
2.8
Å Just who do you think we are? Not very different from you is the
answer, I guess. I suspect that most of the contributors to Archive are
either people who enjoy computers as a hobby which can be useful, people
who use computers as part of their work, but are not professionals in
computing, or students or teachers of computing. I am actually a vet.
who does human genetics and immunology research, approaching fifty, bald
and paunchy! The point is, please do not expect too much from us/me. I
actually took this column on when a broken collar-bone got in the way of
decorating! Sadly, bones heal╔
2.8
Two quickies
2.8
Å If you have more than one sprite in a file, FWP only loads the first
sprite.
2.8
Å There is a funny bug in the spelling list : FABRICATION is flagged
as wrong, but it appears when you browse. To add confusion, when you ask
to guess, it comes up with faArication, which is unbrowsable!! Thanks to
Colin Garlick. A review of letters received earlier reveals that the
problem is more widespread than this: Kenneth Gardner rep-orts that the
same (?) bug affects fable, fabric, -ate, -ated, -ation, fabulous, -ly,
fab, haar, maar, nascelle, oaf, zag. Kenneth provides more data on
making merged supplementary dictionaries, but the problem is obviously a
bug. Over to you Acorn!
2.8
FWP and RISC-OS╔
2.8
The support disk which comes with RISC-OS has the necessary instructions
for conversion and the files. It is in the Acorn directory.
2.8
It may be easier to have Edit installed and the mode set to 0 before you
start. Then you can have a decent RAMfs space for the copied files
(assuming you do not have two drives). You can keep the instructions in
sight this way.
2.8
╔and the IntModule
2.8
It is all quite smooth, but if you want the splendid IntModule facility
to give you access to the OS, it is a bit more complicated. Edit has no
öloadò command. You load things by grabbing their icons and dropping
them on the installed Edit icon. But it is not obvious how to get at the
öObeyò files in the !1stWord+ directory from the desktop. The secret is
to hold down shift while clicking on the !1stWord+ directory. You should
be a bit careful about what you do, so make a backup before mucking
about. Now edit it as follows:
2.8
a) (This is most important.) Rename the !Run file you got from the
Support Disc as, e.g. !RunAcorn.
2.8
b) Insert tthree lines before that beginning örunò (next to last) (the
third line is optional Ö it turns the caps lock off)
2.8
rmload $.intmodule
2.8
interrupt 15
2.8
fx202,48 REM
2.8
c) Save as !Run
2.8
d) Check that the file type is obey. If not, get an OS prompt by
pressing f12 on the desktop and öSetfiletype !run obeyò.
2.8
e) Remember to copy IntModule onto the disk in directory $.
2.8
It should work, accessing the OS when <ctrl-O> is pressed, though I get
a white border around the top and right after going to the OS but it
seems to go away, though.
2.8
I suspect there are a few missing twiddly bits about ensuring that the
correct directory names are used, so I still have some reading to do.
More next month!
2.8
It also happens that you can edit obey files in FWP, and further, FWP is
not squeemish about loading the öObeyò files from an application
directory. If you do this you will certainly have to set the filetype.
2.8
First Mail
2.8
Here are a couple more tips on 1st Mail from Glyn Emery:
2.8
Mail merging normally means sending the same, or very slightly differ
ent, letters to a number of recipients. I recently had occasion to turn
this process on its head and send several different letters to the same
recipient; but I found 1st Mail up to the task. The occasion was that I
had to write reports on a batch of candidates, which, for the conveni
ence of his filing system, I prepared in the form of a batch of separate
letters all addressed to the administrator involved. To print them I
prepared a ömerge fromò file as follows:
2.8
read text
2.8
display ötext letter startedò
2.8
includefile letterhead
2.8
includefile dat.administrator
2.8
Dear Mr Administrator
2.8
includefile doc.text
2.8
Yours sincerely
2.8
display öletter finishedò
2.8
repeat
2.8
ötextò here is used as a 1st Mail keyword. The file öletterheadò
incorporates the date. I put a hard page break just before the repeat
command to make the sheet-feeder on my printer pick up the next piece of
A4. The ödisplayò commands were put in during development and proved to
be too confidence-giving to be deleted. The file dat.administrator is
the administratoræs address.
2.8
The reports, together with a covering letter were prepared as separate
files; and a datafile was prepared listing the file names. This was
saved in the dat. directory, not forgetting to switch off WP mode before
saving it. If you donæt switch off WP mode the merge tends to öhangò. I
donæt know why.
2.8
The second point is that I have incorporated Steve Hoareæs IntModule
(Archive 2,6 p44) into the libraries of my letter-writing discs.
Unfortunately Steveæs suggestion to use <ctrl-@> does not quite work for
me, because the ú key seems to return ASCII 0 in the First Word Plus
context, presumably in order that different codes for ú can be included
to satisfy different printers. Steve, being in America, probably had no
occasion to notice this. What I did in the end was to include
2.8
*RMLoad %.IntModule
2.8
*Interrupt 205 1stMail
2.8
into the startup program for First Word Plus, and
2.8
*RMLoad %.IntModule
2.8
*Interrupt 205 1stWord+
2.8
into the startup program for 1stMail. I can then use the öinsertò key to
toggle between the two, and save quite a lot of keystrokes in doing so.
Notice that I had to use % in the RMLoad command but not in the
Interrupt command because % appears in my Run$Path but not in my
File$Path.
2.8
An interesting application for FWP
2.8
Dave Livsey
2.8
Those of you who, like me, have to report on the progress of large
numbers of individuals of various levels of ability (i.e. teachers!) and
are the proud possessors of an Archimedes and First Word Plus now have
the means to reduce the increasingly onerous task of reporting, imposed
by the introduction of Érecords of achievementæ (ROA). (If you do not
have First Word Plus, or something better, you deserve all the hard work
you have to do!) Using First Word Plus, it is fairly easy to set up a
ÉMail mergeæ which will print out the documents required for the ROA.
2.8
The clue to doing this lies in the example mail-merge letter on the
First Word Plus disk. As with most problems, there are probably many
(or, at least, a few) different solutions Ö this is one. I hope it will
help reduce your load as much as it has mine!
2.8
In all that follows, the underlined words below are supposed to be in
light type which I am unable to print in Elite type. The page numbers
refer to the First Word Plus handbook.
2.8
In outline, you will need to set up four files: a command file, a data
file, a file containing the com-ment bank and the Émainæ file (which
corresponds to the letter in the mail-merge example).
2.8
The command file (called Écommandæ): This needs to contain the informa
tion which indicates the location of the data file (see below), any
individual input to the ROA document (Éinputæ typed in Élightæ type
p.165 Ö 169 ) and a reference to the basic form as an Éincludefileæ
statement. The WP mode can be left switched on when creating this file
and saving it.
2.8
The data file (Éformdataæ) must be created in the dat. directory and
contains only the data you wish to be inserted into the final document
as it is printed and is simply a list of names (firstname, secondname),
sex (He/She), tutor group (or Form, or whatever cockeyed system your
educational establishment has decided to inflict on you), date and any
other required information. As pointed out in the handbook, each item of
data must be separated from the next by a comma. There is also a problem
of commas in an item of data but this is catered for by enclosing them,
as explained on p.165. A specimen layout could be as shown :
Fred,Bloggs,He,4Z,Nov 1988,Swahili
2.8
Note that the data fields are comma separated fields and may include
spaces (p.165). This file must be created in non-WP mode and the mode
left switched off when saving; ignore the pop-up reminder which appears
when you try to save the file.
2.8
The comment bank file (ÉROAæ), obviously, contains all the comments
which you may wish to make about any group of students. Each comment is
prefixed by a suitable identifier e.g. K1. In order to be able to use
these comments, each identifier must be set up as a keyword (p.163) by
preceding it with Ésetvalæ in light type e.g.
2.8
setval K1, öname1 is a complete idiot when it comes to practical work.
sex is a complete liability as sex has 11 thumbs on two left hands.ò
2.8
Note the <,> and the <ö>. I found that it was easier to type the comment
with the WP mode switched on and then to switch the WP mode off and move
all the text onto one line. The WP mode was then switched on again as
the document does not print out correctly otherwise.
2.8
The setval definition seems to need all the text on one line but as this
can be 160 characters long, that is not too much of a problem. These
definitions can also contain key words, in light type, for insertions
from the data file into the final document. This is useful as it means
that you can specify he or she along with the name in the data file.
N.B. Changing the ruler turns off the Élightæ type causing the defini
tions and insertions to be ignored in the final print-out.
2.8
The final file (called Éformæ); the document you are going to print,
contains very little other than keywords spaced out as is appropriate
for your ROA. The first line must be a read statement which, being a
keyword is in light type. Following this is a list of fields in ordinary
type and in the same order as in the data file. The rest of the file is
mainly spaces preceded by a keyword placed where you want your printing
to be done. Eg.
2.8
read name1,name2,sex,date,tutor, subject (reads from Éformdataæ)
2.8
name1, name2 tutor subject date
2.8
includefile ROA (this reads in the comment bank)
2.8
name1 K1 (prints öFred is an idiot .....ò)
2.8
sex C3 (prints in the comment on comprehension)
2.8
sex I1 (prints in the comment on intelligence) etc.
2.8
This file will, of course, need the WP mode swit-ched on in order to
retain all the formatting infor-mation which is necessary for the
automatic form-atter to work when insertions are made in the text.
2.8
The ROA is printed out by clicking on Éformæ and Éformdataæ (from the
doc. directory) using the mail-merge facility on the First Word Plus
disc. Full details of this are given in the Handbook.
2.8
Font Fiddling on First Word Plus
2.8
Reg Dalton (& Steve Bass)
2.8
Reg tells us the saga of creating character sets for First Word Plus and
his NEC P2200. A sample printout is shown opposite, and the programs and
printer drivers are on the program disc and downloadable from Eureka II.
2.8
In an earlier edition of Archive (1.12 p 7) was printed a short routine
to convert the extra fonts, supplied on the Master Welcome disc, from
BBC to Archimedes format. On the face of it, this looked as if it would
be a useful little routine but there was a problem; only half of the
character set was defined. i.e. characters 32 to 126. My friend Steve,
in his wisdom, decided that one of the fonts (7by8) looked very good
with First Word Plus and decided to redefine the rest of the characters
to match the ones already done.
2.8
The next step in the story was when I foolishly mentioned that it would
be quite simple to set up First Word Plus to utilise the IBM graphics
available in one of the alternative character sets within the printer we
both had (NEC P2200). We then decided that redesigning the fonts using
the Master was not the way to do this, mainly because the fonts would
then have to be converted to Archimedes, so we converted the CHARDES
program, which was mainly in BASIC, to a form that would save fonts in
the correct format and also run with the Archimedes mouse.
2.8
The problem of modifying the program to work on the Archimedes was not
too difficult by even an amateur programmeræs standards but to make it
save the font in its correct form for the Archimedes proved more
problematical. A number of abortive attempts were made to rewrite the
save font routine but each time nothing was achieved except making the
computeræs character set look like hieroglyphics. Eventually, it all
fell into place and we had a working program.
2.8
We then decided that a program for transposing characters within the
character set itself might not be a bad idea. This was written fairly
speedily, but then the next task was to create the printer driver for
First Word Plus. This marathon is usually achieved by modifying an
existing wordprocessor/printer driver file, which involves changing the
relevant values for the various functions listed within the file, e.g.
superscript, subscript, nlq etc. After this fairly simple part comes the
task of entering all the codes to achieve the extra characters which
cannot enter from the keyboard. For characters 32 to 127 this was
obviously quite simple as all that was needed in this instance was each
characteræs number, but it was soon noticed by both of us that the
characters between &80 and &9F (decimal 128 to 159) were not defined by
the existing list. After an abortive attempt to define these characters,
and failing to get them to install, it was decided that we would have to
discard 32 (yes a whole 32) of the characters so lovingly designed by
Steve.
2.8
Notes on the font fiddling programs
2.8
(These refer to programs on the monthly disc.)
2.8
1 !BOOT is the program for interchanging the position of the
characters.
2.8
2 After running the above program, the Acorn Character Designer
Program (modified for use on the Archimedes), Chardes_C, can be entered
and 1 above repeated as many times as necessary.
2.8
3 The modified Printer driver for 1WP is in the CFG directory.
2.8
4 The modified Printer driver hex file for 1wp is in the HEX
directory.
2.8
5 Before booting the disc, the font style to be modified must first be
loaded e.g. by using *NEC_Afont.
2.8
Å External drive hang-ups Ö If you have an external 5.25ö drive
configured and it is not kept on-line (i.e. it is switched off) then the
machine hangs up if the ADFS is searching for a named disc which is not
in drive 0 at the time that the command was issued, e.g. when attempting
to copy file(s) from one 3.5ò disc to another. The solution appears to
be either always have the external drive switched on, or to configure it
out of the system during periods when it is switched off.
Å GWBASIC to BBC BASIC Ö I wanted to convert a GWBASIC program to a
BBC BASIC one, but both BASICæs store programs with the keywords
tokenised. Therefore I needed the equivalent of the *SPOOL command. The
answer seems to be that from GWBASIC either:
SAVE öfilenameò,A
or
LIST ,öfilenameò
Both give a version of the listing which, when ported across via
putfile, can be *EXEC-uted.
Å Mouse problems Ö I had a problem with my mouse. Sometimes when I
moved the mouse down, the pointer moved UP. At other times it worked
perfectly. I tried everything Ö including measuring the electronics
inside the mouse, and inside the keyboard, adjusting the sensitivity and
cleaning the inside and outside of the mouse. Finally I discovered that
the problem was a broken wire in the cable out from the mouse. Odd
Bakken
2.9
Å NEC multisync modifications Ö With a NEC multisync II monitor, I
found that the horizontal width of the picture was not optimal. There
was a black border on each side of the picture and, in modes 18-20, the
picture was even smaller, making the letters a little hard to read. I
called the local dealer and got a copy of their service manual. You can
adjust the horizontal size with coil L505. I got some improvement by
removing the core of the coil but not enough. So I shorted the coil
completely (after consulting the dealer, who said it would not harm the
monitor). By doing this I got a 10% wider picture. (I still have the
distortion of the top lines in mode 18-20.) Odd Bakken
2.9
Å OS_PrettyPrint Ö There has been very little in the literature about
the use of OS_PrettyPrint to avoid word wraparound in, for example, the
preparation of instruction notes at the beginning of a program. (You can
use SYS &44 instead of writing the full command). All that is needed is
a simple BASIC program such as :
2.9
10 SYS &44,ö<Block of words>ò
2.9
20 PRINT;ö ò;:REM Insert space
2.9
or 20 PRINT:REM New Line
2.9
30 SYS &44,ö<Continuation of
2.9
text>ö
2.9
40 PRINT;ö ò; etc.
2.9
The text in line 30 continues from the point where it ended in line 10.
Unfortunately the OS command strips the leading and trailing spaces from
the block of text. The PRINT statements are therefore necess-ary to
separate the end of the text in line 10 from the beginning of the text
in line 30 or to force a new line. The word block length has the
standard BASIC line limitation which amounts to roughly three lines of
text in the 80 chars/line modes. The command works in any mode and by
judicious placing of PRINT and COLOUR statements you can have sections
of the text or even single words in colour.
2.9
Å Pipedream and the LC10 Ö To print in colour on a Star LC 10 colour
printer, if Pipedream is config-ured with a printer driver which
includes the follow-ing codes, the various printing styles available on
the Star LC 10 C can be selected when the printer is switched on, and
printed in colour.
2.9
On Off Description
2.9
H1 27 114 1 27 114 0 Red Text
2.9
H2 27 114 2 27 114 0 Blue Text
2.9
H3 27 114 3 27 114 0 Violet Text
2.9
H4 27 114 4 27 114 0 Yellow Text
2.9
H5 27 114 5 27 114 0 Orange Text
2.9
H6 27 114 6 27 114 0 Green Text
2.9
Å Pipedream line spacing Ö (Colton Softwareæs reply to a request for
1.5 line spacing on Pipedream) Pipedream knows only integral line
spacing; single, double etc, but the line spacing on the printer can be
set independently by sending out some codes with the printer-on string
(PON). For example, PON ESC ö2ò would give 1.5 line spacing on
Epson compatible printers.
2.9
Å Multi Sync Owners! Out here in New Zealand, the average multisync
monitor costs about ú60 more than the standard Acorn monitor. As a
result around 60-80% of Archimedes owners have multisyncæs. I havenæt a
clue as to why they are so much dearer in the U.K. but suggest that
someone somewhere is making a great deal of money! Most of the programs
available donæt provide a multisync option which is a real shame as that
extra 256 pixels make all the difference. Iæve tried to convert some
programs but havenæt had much luck except for Render Bender.
2.9
To convert Render Bender proceed as follows:
2.9
Make a new backup of your Render Bender System Disc. Label it öRender
Bender Modes 15 & 21ò or somesuch. Enter BASIC and load the main program
ö!RENDER.RENDERò. Change or add the following lines.
2.9
60 DIM loadadd &F100,sb1%32*1023
2.9
:org=loadadd+&A100
2.9
2550 XRES=640:YRES=256:SC%=100:
2.9
DES=1000:IND=1.5:SKYCOL=13
2.9
:SKYDEP=600:AVE=1:SHAD=1:SHGR=0
2.9
2950 IF YRES=256 AND SCRADD%<=
2.9
&1FB0000 YRES=512:PROCbox
2.9
(17,16,14,2,öHIGH*RESOLUTIONò
2.9
,14,0):ENDPROC
2.9
2960 YRES=256:PROCbox(17,16,14,2,
2.9
öLOW*RESOLUTIONò,14,0):ENDPROC
2.9
3981 IF RES=320 THEN XRES=640:
2.9
YRES=256
2.9
13590 vars!xlim=XL:vars!ylim=YL
2.9
:vars!reso=XRES
2.9
14010 A$=LEFT$(name$,8):A$=A$+
2.9
STR$FILFR%:IF YRES=256 ENS%
2.9
=&28000 ELSE ENS%=&50000
2.9
14090 XL=XRES/SIZE%:YL=YRES/SIZE%
2.9
:PROCcoeffin
2.9
14110 IF YRES=256 MODE15 ELSE MODE21
2.9
14190 IF YRES=256 MODE15 ELSE MODE21
2.9
14280 XL=XRES/SIZE%:YL=YRES/SIZE%
2.9
:PROCcoeffin:SCROFF%=1
2.9
:PROCisflooron
2.9
14290 IF YRES=256 MODE15 ELSE MODE21
2.9
15150 IF YRES=256 PROCbox(17,16,14,2,
2.9
öLOW*RESOLUTIONò,14,1)ELSE PROCbox
2.9
(17,16,14,2,öHIGH*RESOLUTIONò,14,1)
2.9
11320 GCOL63 TINT 255:VDU5:IF
2.9
YRES=256 PRINTTAB(0,31);öClick
2.9
Mouseö ELSE PRINTTAB(0,62);
2.9
öClick Mouseò
2.9
14380 GCOL63 TINT255:IFYRES=256
2.9
PRINTTAB(0,31);öTime taken ò;
2.9
:PROCtime(TI) :GCOL 25:PRINT;
2.9
ö Click mouseò ELSE PRINTTAB(0,62);öTime taken ò; :PROCtime(TI):GCOL 25:
2.9
PRINT;ö Click mouseò
2.9
SAVE ö:0.$.!RE*.RENDERò
2.9
Then to modify the Picture Compressor
2.9
$.!RE*.UTIL*.PICCOMP
2.9
*BASIC
2.9
*LOAD :0.$.!RE*.UTIL*.PICCOMP 8F00
2.9
*ACCESS :0.$.!RE*.UTIL*.PICCOMP WR
2.9
!&90C0=&E3520015
2.9
!&90C4=&03A0B805
2.9
!&92F0=&E3500015
2.9
!&92F4=&03A08805
2.9
*SAVE :0.$.!RE*.UTIL*.PICCOMP 8F00+534
2.9
*SETTYPE :0.$.!RE*.UTIL*.PICCOMP &FFA
2.9
To modify the Animator
2.9
*BASIC
2.9
LOADö:0.$.!RE*.UTIL*.ANIROUTò
2.9
140DIM buff &50000,DUM 1:anipo%=DUM
2.9
+&6000:PROCboot:!anipo%=0
2.9
1371IF !mode=21 length%=&50000
2.9
2251IF MODE=21 length%=&50000
2.9
SAVE ö:0.$.!RE*.UTIL*.ANIROUTò
2.9
Finally to get Render Bender going you need a new startup file
2.9
*BUILD :0.$.Rend21
2.9
*ECHO <22> <21>
2.9
*SET RENDER :0.$.!RENDER
2.9
*set OBEY$DIR adfs::0.$.!RENDER
2.9
*set FROM$DESK 0
2.9
*SET RendHard1 adfs::4.$.GRAPHICS.
2.9
!Render \ or your path here
2.9
*SET HardRoot $
2.9
*RMLOAD <RENDER>.Utilities.FSLOAD
2.9
*RMLOAD <RENDER>.Utilities.PicComp
2.9
*BASIC <RENDER>.START
2.9
<Escape>
2.9
*SETTYPE :0.$.Rend21 &FFE
2.9
Then to run Render Bender using:
2.9
*CO. SCR. 320K
2.9
<ctrl-break>
2.9
*:0.$.Rend21
2.9
All this is supplied on the monthly program disc as a series of exec
files so to modify Render Bender you just do this (where <comment>=just
that!)
2.9
<insert Render Bender Disc>
2.9
LOADö:0.!RENDER.RENDERò
2.9
<insert program disc and *MOUNT or
2.9
use winnie>
2.9
*EXEC Rendermods.RendMods
2.9
<insert Render disc and *MOUNT>
2.9
SAVE ö:0.$.!RENDER.RENDERò
2.9
LOAD ö:0.!RENDER.UTIL*.ANIROUTò
2.9
<insert my disc and *MOUNT or use
2.9
winnie>
2.9
*EXEC Rendermods.AniMods
2.9
<insert Render disc and *MOUNT>
2.9
SAVE ö:0.!RENDER.UTIL*.ANIROUTò
2.9
COPY Rend21 across to $ <On Render
2.9
Disc!>
2.9
*WIPE $.!RE*.U*.PICCOMP F~C <get rid
2.9
of old PicComp>
2.9
COPY PicComp across to $.!RENDER.
2.9
UTILITIES <On Render Disc!>
2.9
then you should be ready to go!
2.9
Å Eigenvalues of a matrix Ö The following program is meant for readers
who are interested in the determination of eigenvalues of a matrix. It
is based on the idea that the eigenvalues of a matrix do not change by a
similarity transformation. Decomposing a square, symmetric matrix S in
its lower and upper triangular forms (L and U respectively satisfying
LU=S) gives a new matrix UL having the same eigenvalues as S, since UL =
(U^Ö1)ULU. It can be proved that by repeating this process, a matrix is
obtained containing zero elements, except for the eigenvalues residing
on the main diagonal.
2.9
Consider an arbitrary matrix M, having a number of rows equal to or
greater than its number of columns. Then MæM (MÉ standing for transposed
of M) is a square, symmetric matrix having the same eigen-values as M.
Some of these values may equal zero indicating that the dimensionality
of M is smaller than its number of columns. Or in other words, the
matrix spans an x-dimensional space, where x equals the number of non-
zero eigenvalues of M.
2.9
10 REM >Eig_values
2.9
20 :
2.9
30 ********************************
2.9
40 REM Eigenvalues of an arbitrary
2.9
50 REM matrix. E.D. Engelhardt,
2.9
March 1989
2.9
60 ********************************
2.9
70 :
2.9
80 PROCinit
2.9
90 :
2.9
100 PROCmenu
2.9
110 :
2.9
120 PROCinput
2.9
130 :
2.9
140 start%=TIME
2.9
150 PROCmain
2.9
160 end%=TIME
2.9
170 :
2.9
180 PROCprint
2.9
190 END
2.9
200 ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
2.9
210 DEFPROCinit
2.9
220 @%=&0A0A:CLS
2.9
230 ENDPROC
2.9
240 ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
2.9
250 DEFPROCmenu
2.9
260 OFF
2.9
270 PRINTTAB(31,12)öEIGENVALUESòÉ
2.9
280 PRINTTAB(27,14)ö[1] Random matrixò
2.9
290 PRINTTAB(27,15)ö[2] Fixed demo
2.9
5x4 matrixö
2.9
300 PRINTTAB(27,16)ö[3] Fixed demo
2.9
4x4 matrixö
2.9
310 ENDPROC
2.9
320 ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
2.9
330 DEFPROCinput
2.9
340 while=TRUE
2.9
350 WHILE while
2.9
360 CASE GET$ OF
2.9
370 WHEN ö1ò:while=FALSE:ON
2.9
380 REM Generate random matrix M,
2.9
col% columns and row% rows
2.9
390 REPEAT:
2.9
INPUTÉö Rows : ò
2.9
row%:UNTIL row%>0
2.9
400 REPEAT:INPUTÉö Columns
2.9
<= rows : öcol%:UNTIL col%
2.9
<=row% AND col%>0
2.9
410 CLS:
2.9
PRINTÉö Rows : òSTR$
2.9
row%Éö Columns : òSTR$col%
2.9
420 row%-=1:col%-=1
2.9
430 DIM M(row%,col%)
2.9
440 FORr%=0TOrow%:FORc%=0TOcol%
2.9
450 M(r%,c%)=RND(1)*SGN(0.5-
2.9
RND(1))
2.9
460 NEXT:NEXT
2.9
470 :
2.9
480 WHEN ö2ò:while=FALSE:ON
2.9
490 REM *** Fixed data for demo
2.9
5x4 matrix having one zero
2.9
eigenvalue
2.9
500 CLS:PRINTÉö Rows : 5ò
2.9
Éö Columns : 4ò
2.9
510 row%=4:col%=3:DIM M(4,3)
2.9
520 M(0,0)=4:M(0,1)=3:M(0,2)=2:
2.9
M(0,3)=1
2.9
530 M(1,0)=2:M(1,1)=4:M(1,2)=1:
2.9
M(1,3)=3
2.9
540 M(2,0)=6:M(2,1)=7:M(2,2)=3:
2.9
M(2,3)=4
2.9
550 M(3,0)=8:M(3,1)=11:M(3,2)=4:
2.9
M(3,3)=7
2.9
560 M(4,0)=8:M(4,1)=6:M(4,2)=4:
2.9
M(4,3)=7
2.9
570 :
2.9
580 WHEN ö3ò:while=FALSE:ON
2.9
590 REM Fixed data for demo 4x4
2.9
matrix having four eigenvalues
2.9
600 CLS:PRINTÉö Rows : 4ò
2.9
Éö Columns : 4ò
2.9
610 row%=3:col%=3:DIM M(3,3)
2.9
620 M(0,0)=1.00:M(0,1)=0.42:
2.9
M(0,2)=0.54:M(0,3)=0.66
2.9
630 M(1,0)=0.42:M(1,1)=1.00:
2.9
M(1,2)=0.32:M(1,3)=0.44
2.9
640 M(2,0)=0.54:M(2,1)=0.32:
2.9
M(2,2)=1.00:M(2,3)=0.22
2.9
650 M(3,0)=0.66:M(3,1)=0.44:
2.9
M(3,2)=0.22:M(3,3)=1.00
2.9
660 ENDCASE
2.9
670 ENDWHILE
2.9
680 ENDPROC
2.9
690 ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ-
2.9
700 DEFPROCmain
2.9
710 DIM Mt(col%,row%),MtM(col%,col%)
2.9
,E(col%)
2.9
720 PROCtranspose(M(),Mt())
2.9
730 PROCsquare_sym(M(),Mt(),MtM())
2.9
740 PROCeigenvalues(MtM(),E())
2.9
750 ENDPROC
2.9
760 ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ-
2.9
770 DEFPROCtranspose(R(),Rt())
2.9
780 LOCAL v%,h%
2.9
790 v%=DIM(R(),1):h%=DIM(R(),2)
2.9
800 FOR r%=0 TO v%:FOR c%=0 TO h%:
2.9
Rt(c%,r%)=R(r%,c%):NEXT:NEXT
2.9
810 ENDPROC
2.9
820 ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ-
2.9
830 DEFPROCsquare_sym(R(),Rt(),RtR())
2.9
840 RtR()=Rt().R()
2.9
850 ENDPROC
2.9
860 ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ-
2.9
870 DEFPROCeigenvalues(RtR(),EV())
2.9
880 REM Eigenvalues are determined
2.9
from R-transposed x R, using the property that eigenvalues do not
change by a similarity
2.9
890 REM *** transformation. Rt.R is
2.9
decomposed in a lower and upper
2.9
tri-angular matrix, Rt.R=LU. Then
2.9
UL has the same eigenvalues as LU.
2.9
900 REM Repeating this process
2.9
iterates all non-diagonal elements to 0, and the diagonal
elements
2.9
to the eigenvalues.
2.9
910 :
2.9
920 REM E.D. Engelhardt, March 1989
2.9
930 :
2.9
940 LOCAL L(),U(),UL(),h%,c%,r%,t%,
2.9
repeat,max,iterations%
2.9
950 h%=DIM(EV(),1)
2.9
960 DIM L(h%,h%),U(h%,h%),UL(h%,h%)
2.9
970 :
2.9
980 PRINTTAB(1,30)öIteration : ò
2.9
:REM This info may be left out
2.9
990 :
2.9
1000 repeat=TRUE
2.9
1010 REPEAT
2.9
1020 iterations%+=1:PRINTTAB(13,30)
2.9
iterations% :REM may be left out
2.9
1030 REM Calculate lower triangle
2.9
L of RtR
2.9
1040 FOR c%=0 TO h%:FOR r%=c% TO h%
2.9
1050 L(r%,c%)=RtR(r%,c%):t%=c%-1
2.9
1060 IF t%>=0 FORt%=t%TO0STEP-1:
2.9
L(r%,c%)=L(r%,c%)-L(r%,t%)
2.9
*L(c%,t%):NEXT
2.9
1070 IF r%>c% THEN L(r%,c%)=
2.9
L(r%,c%)/L(c%,c%)
2.9
1080 IF r%=c% IF L(r%,c%)<0 THEN:
2.9
FOR t%=0 TO h%:L(t%,c%)=0:NEXT
2.9
1090 IF r%=c% L(r%,c%)=SQR L(r%,c%)
2.9
1100 IF r%=c% AND L(r%,c%)=0 r%=h%
2.9
1110 NEXT:NEXT
2.9
1120 :
2.9
1130 PROCtranspose(L(),U())
2.9
1140 :
2.9
1150 REM Matrix similar to RtR (ie
2.9
having same eigenvalues) is UL
2.9
1160 UL()=U().L()
2.9
1170 :
2.9
1180 REM Determine if diagonals of
2.9
RtR and UL are equivalent
2.9
1190 t%=0
2.9
1200 REPEAT
2.9
1210 IF UL(t%,t%)<>RtR(t%,t%)
2.9
:repeat=FALSE
2.9
1220 t%+=1:IF t%>h% repeat=FALSE
2.9
1230 UNTIL repeat=FALSE
2.9
1240 IF t%<=h% repeat=TRUE:RtR()=
2.9
UL()
2.9
1250 UNTIL repeat=FALSE
2.9
1260 :
2.9
1270 REM Put eigenvalues smaller then
2.9
non-diagonal elements to zero
2.9
1280 FOR t%=0 TO h%:UL(t%,t%)=0:NEXT
2.9
1290 FOR r%=1 TO h%-1:FOR c%=1 TO r%
2.9
1300 IF ABS UL(r%,c%)>max max=ABS
2.9
UL(r%,c%)
2.9
1310 NEXT:NEXT
2.9
1320 FOR c%=0 TO h%
2.9
1330 EV(c%)=RtR(c%,c%):IF EV(c%)<=
2.9
max EV(c%)=0
2.9
1340 NEXT
2.9
1360 ENDPROC
2.9
1370 ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
2.9
1380 DEFPROCprint
2.9
1390 VDU 14
2.9
1400 CLS:PRINTÉö Rows : òSTR$
2.9
row%Éö Columns : òSTR$col%
2.9
1410 PRINTÉö Time(centisecs) : ò;STR$
2.9
(end%-start%)Éæ
2.9
1420 PRINTö ******** Eigenvalues : òÉ
2.9
1430 FOR c%=0 TO col%
2.9
1440 PRINT E(c%)
2.9
1450 NEXT:PRINT
2.9
1460 VDU 15
2.9
1470 ENDPROC
Å Partitioning hard drives Ö It is possible to partition hard drives
with less than 10 Mbyte. The answer is in the REM statements in the
Harddisc program on the PC disc. Change the A2080 in line 610 to any
multiple of &8800 (in hex). Details are given in the REMs.
Å Hearsay Ö We mentioned changing modem baud rates in H & T in May.
Philip Green sends us a way of doing this automatically suggested by
Alfons Tjin. Use a dial prefix in the modem driver edit screen of just
öATò and then put B3D or B0D, as necessary, in front of the phone number
in the telephone directory.
Å Case sensitive system variables Ö Some readers have had problems
using the *SETMACRO Alias$ command. This is because system variables are
case sensitive i.e. you need to type: Alias$ not ALIAS$
Å Overload passwords: A B BROS, CABBAGED, SLIPPERS, PREVIOUS,
PILLAGED, BOVERBOD, LAVATORY, CASSETTE, WHALE╩FM, EXTRACTS, STOPKETS
The following hints were sent in by Lorcan Mongey
Å ÉTæ Option in LDR and STR Ö Assembly language programmers may have
noticed that the Programmeræs Reference Manual mentions a ÉTæ option in
the description of the LDR and STR com-mands (page 608), but neglects to
say what it does. It is, in fact, used for setting the write-back option
and has exactly the same effect as É!æ. Note that the *MEMORYI disassem
bler always disassembles pre-indexed write-back with É!æ and post-
indexed write-back with ÉTæ, although you may use either form when
assembling. Bear in mind that post-indexed write-back always takes
place, regardless of the state of the write-back flag.
2.10
Å Bit patterns for LDR and STR Ö There is an omission in Appendix C of
the öARM Assembly Language programmingò book published by Com-puter
Concepts. Appendix C gives the bit patterns of the ARM instruction set,
but does not describe the ÉLæ bit of the ÉSingle Data transferæ
instruction. This is the Load/Store bit: 0=store (STR), 1=load (LDR).
2.10
This description also applies to the ÉBlock data transferæ instructions
(STM and LDM).
2.10
Å BASIC restrictions Ö In BASIC II on the BBC B (and IV on the Master)
there were a number of restrictions which no longer apply to BASIC V on
the Archimedes, but have not been specifically mentioned in the
Archimedes User Guide. They are worth noting because they have probably
become ingrained in BBC B users who may not have realised that they have
been lifted.
2.10
1) You can now change MODE inside a procedure or function. This is
because the screen RAM is now completely separate from the program area.
2.10
2) The nesting limits of FOR, REPEAT and GOSUB (10, 20 and 26 respec
tively) no longer apply. Instead of a fixed limit, you can now nest
loops until you run out of RAM. I have successfully nested loops 15,000
deep and run a recursive procedure 30,000 levels deep! Strangely,
nesting GOSUBs too deeply is not trapped and will corrupt your program,
but this situation is unlikely to happen in practice.
2.10
Å BASIC errors Ö I have found four BASIC errors not listed in the User
Guide (Issue 2). They are:
2.10
11 No room for this dimension Ö An attempt was made to dimension an
array for which there was insufficient space.
2.10
25 Bad MODE Ö An attempt was made to select a screen mode for which
there is insufficient memory. More memory can be allocated by *CONFIGURE
SCREENSIZE.
2.10
37 No room for function/procedure call Ö An attempt was made to Énestæ
too many function and/or procedure calls.
2.10
44 Too many nested structures Ö An attempt was made to Énestæ too many
FOR...NEXT, REPEAT...UNTIL and/or WHILE... ENDWHILE loops.
2.10
Note that 11 and 44 are covered in the Archimedes 400 series BBC BASIC
Guide.
2.10
Å Using FORTRAN 77 Ö The article on using FORTRAN 77 in Archive 1.7
included a sample subroutine showing how to access graphics from
FORTRAN. There are a number of problems with this subroutine. It canæt
cope with negative graphics coordinates (needed after an origin shift),
it sends a line feed to the screen when it is used, which can cause your
graphics to scroll upwards, and it uses an output channel which should
be kept free for file access. The following solves all the problems:
2.10
SUBROUTINE PLOT(K,X,Y)
2.10
INTEGER X,Y I1=IAND(X,?IFF)
2.10
I2=ISHFT(IAND(X,?IFF00),-8)
2.10
J1=IAND(Y,?IFF)
2.10
J2=ISHFT(IAND(Y,?IFF00),-8)
2.10
PRINT 100,CHAR(25),CHAR(K),CHAR(I1),
2.10
CHAR(I2),CHAR(J1),CHAR(J2)
2.10
RETURN
2.10
100 FORMAT (6A1$)
2.10
END
2.10
This method masks out the unwanted bits and shifts the data into the
l.s.b., thus preserving the sign. It uses PRINT instead of WRITE,
avoiding the need for a channel number. The $ at the end of the FORMAT
statement suppresses the line feed. (No criticism of the original
authors is intended; my first attempt looked very similar!)
2.10
Included on this monthæs program disc is Graph_ FOR, the FORTRAN source
of a set of graphics subroutines which provide a full set of VDU calls.
Some, like BELL for instance, are trivial, but others are more
complicated.
2.10
Å Printer conventions Ö Many people seem to have difficulty with
setting up the correct linefeed or non-linefeed for their printers for
different app-lications, so I.J. King has tried to explain it for us╔
2.10
How the Archimedes deals with varying printer standards Ö Since there
are two standards for printers, the Archimedes has a mechanism to allow
it to cope with both. The standards in question affect the way the paper
is fed through the mechanism and there are two possible cases:
2.10
A. Auto Linefeed: every time the printer receives a carriage return
character (code 13), it generates a line feed (code 10) to move the
paper up a line.
2.10
B. Non-Auto Linefeed: the printer does not gener-ate its own linefeed
characters but relies on the com-puter to send a linefeed after every
carriage return.
2.10
Most modern printers will actually have a switch to select either of
these modes, allowing them to be compatible with most computers, but
this is likely to be difficult to reach. The Archimedes will (in the
case of virtually all software) send a line feed after every carriage
return. To allow compatibility with printers in mode (A) above, it is
possible to tell the machine to ignore a particular code when sent to
the printer. By setting this to 10 (the code for line feed), no line
feeds will be sent to the printer and you are compatible with type (A)
printers.
2.10
This code is set up using the *IGNORE command, for example:
2.10
*IGNORE 10
2.10
To disable the trap altogether, simply enter *IGNORE on its own. Either
of these may be preceded by CONFIGURE to make the effect permanent, e.g.
2.10
*CONFIGURE IGNORE 10
2.10
The Archimedes is set up with a factory default ignore code of 10,
making the system compatible with type (A) printers when it arrives.
2.10
Problems arising when the protocol is ignored Ö The above should make
everything seem fairly simple and indeed it ought to be. However, some
software houses, notably GST and Grafox (i.e. First Word Plus and
Logistix) have chosen to ignore the sensible protocols described above
and override the *IGNORE status in such a way that they are only
compatible with type (B) printers, regardless of the setting of *IGNORE.
2.10
This means that the hapless user will have been forced to configure his
printer to be type (B) but will not have re-configured his Archimedes
since the software will override the settings and work anyway. They then
go out and purchase a correctly written package, such as System
DeltaPlus etc, and the result is a type (B) printer (generating no line
feeds) on a machine configured for a type (A) printer (and so sending no
line feeds) which results in no line feeds at all and the text all comes
out on the same line.
2.10
A subsidiary problem occurs in some cases, when reconfiguring the
Archimedes to work with type (B) printers, as is necessary if you wish
to use both First Word Plus/Logistix and other, correctly written,
software. The correct way to do this is to enter the command *CONFIGURE
IGNORE with no parameters, completely disabling the printer trap. It is
not correct to enter *CONFIGURE IGNORE 0 as this prevents code 0 from
being sent to the printer and may corrupt some graphics/font change
sequences used by certain software.
2.10
Conclusions Ö If you are using any package which overrides the Acorn
protocols for printer compatibility in the way described above and also
wish to use correctly written software (in my case, I use both Logistix
and System DeltaPlus), you should take the following steps:
2.10
1. Set your printer so that Auto Linefeed is OFF (usually a DIP switch).
2.10
2. Enter *CONFIGURE IGNORE
2.10
3. Press <ctrl-break> to reconfigure your machine.
2.10
This now only leaves us with one question Ö why are Acornsoft apparently
condoning this system of forcing the user to have a printer type
different from that for which the machine is configured by default?!
2.10
Å PC Emulator Star Commands (Response to query in Archive 2.5 p5) Ö
There is no need for a *Configure Floppies command from the PC emul-ator
when copying from one 3.5ö disc to another. You must understand the
distinction between log-ical and physical drives: logical drives are
known to the emulator as A, B, C, etc, and are mapped onto the physical
drives 0, 1, etc. It is possible to have more than one logical drive
assigned the same phys-ical drive. This is what happens when you have
your Archimedes configured for one floppy Ö the emul-ator maps logical
drives A and B onto physical drive 0 and, recognising this when you copy
from A to B, prompts for a disc change. If you have two floppies, the
emulator maps A and B onto 0 and 1 respect-ively. I use an external
5.25ò 40/80 track drive on my Archimedes and my config.sys file, listed
below, illustrates the way around the problem.
2.10
device=driver.sys /d:0 /t:80 /f:2
2.10
device=driver.sys /d:1 /t:80 /f:2
2.10
device=driver.sys /d:1 /t:40 /f:0
2.10
device=driver.sys /d:1 /t:40 /f:0
2.10
files=20
2.10
buffers=10
2.10
The first four lines assign more logical drives (which the emulator
gives the letters C, D, E and F) to the physical drives 0 and 1. The
meaning of the parameters is:
2.10
/d: physical drive number
2.10
(0 for internal, 1 for external)
2.10
/t: number of tracks on disc
2.10
(80 for 720k and 40 for 360k)
2.10
/f: disc format
2.10
(2 means 720k, 0 means 360k)
2.10
The first line assigns logical drive C to physical drive 0. You can now
copy from 3.5ö to 3.5ò by using Écopy a:x.dat c:æ and DOS will prompt
for a disc change. The second line maps logical drive D to physical
drive 1, enabling copying between 5.25ö 80-track floppies (copy b:x.dat
d:). The last two lines assign two 40-track drives (E and F) to physical
drive 1, allowing copying between 40-track 5.25ò discs (copy e:x.dat f:)
in the same way.
2.10
You should be aware that loading all these device drivers will use up
some application workspace, leaving less for programs, so only install
them when you need them!
2.10
Å Three SWIs which are not mentioned in the Programmeræs Reference
Manual (Issue 1):
2.10
OS_AddToVector &47
2.10
OS_WriteEnv &48
2.10
WaveSynth_Load &40300
2.10
(WaveSynth_Load was mentioned but not ident-ified in Archive 1.8, p9)
2.10
Also, there is one SWI which seems to have been mis-spelled in the
Arthur 1.20 ROMs, namely:
2.10
Sound_QSDispatch &401C4
2.10
The ÉSæ between Q and Dispatch shouldnæt be there. If you refer to SWIs
by name rather than number then you must mis-spell this one in the same
way otherwise it wonæt be recognised!
2.10
Å Infinite energy for ThunderMonk Ö J.R. Donaldson sent in this
program, which will alter your ThunderMonk disk to give you infinite
energy.
2.10
10 REM > Thun_Cheat
2.10
20 REM Joe Pineapples Ö Cool Assassin
2.10
30
2.10
40 DIM sector% &400
2.10
50
2.10
60 MODE 0
2.10
70 PRINT öPlease insert ThunderMonk
2.10
disc and press a key.ö
2.10
80 G = GET
2.10
90
2.10
100 PRINT ÉöNow loading relevant
2.10
sectoröÉ
2.10
110
2.10
120 SYS öADFS_DiscOpò,, 1, &C6400,
2.10
sector%, &400
2.10
130
2.10
140 PRINT öDo you want to play
2.10
(C)heat or Normal ?ö
2.10
150 G = GET
2.10
160
2.10
170 IF G=ASC(öCò) OR G=ASC(öcò) THEN
2.10
180 sector%!&388 = &E59C0044
2.10
190 sector%!&38C = &E28000FE
2.10
200 sector%!&390 = &E58C0044
2.10
210 ELSE
2.10
220 sector%!&388 = &059C0044
2.10
230 sector%!&38C = &02400001
2.10
240 sector%!&390 = &058C0044
2.10
250 ENDIF
2.10
260
2.10
270 PRINT ÉöNow saving relevant
2.10
sectoröÉ
2.10
280
2.10
290 SYS öADFS_DiscOpò,, 2, &C6400,
2.10
sector%, &400
2.10
300
2.10
310 PRINT öChange complete. Now use
2.10
disc as normal.ö
2.10
320 END
2.10
Å Thunder Monk passwords Ö the Thunder Monk passwords change from disc
to disc (or do they change from month to month? Ed), but they can be
found at address &4E400. Just find your level two password in the list
below and next two words will be used for levels three and four e.g. our
level two password is STEVES so the passwords for the next levels are
BIRTHDAY and MIDSUMMER.
2.10
SHIRT JUMPER WELLIES Y-FRONTS LOVERS HEARTS CUPID VALENTINE DANIEL AND
SIMONS BIRTHDAY JOKES SHOWERS FOOL SPRING POLE EXAMS SUNNY STUDY STEVES
BIRTHDAY MIDSUMMER WARMER HOLIDAYS MAJORCA SUNHAT HOTTER RESULTS FAILED
PASSED PISSUP SCORCHER RESTART SUNBURN ARCHIE SPOOK SHIVER HALLOWEEN
COOLING BONFIRE WEEEEEE FIREWORKS CHILLY CHRISTMAS HOLLY PRESENTS MERRY!
2.10
(Dæyou get the significance of the passwords?? Ed.)
2.10
Å View to FWP Ö When using the utility provided with First Word Plus
to convert View files, Robert Leon noted that the left margin default
(in the Print File dialogue window) should be changed to 4, otherwise
the file is not printed properly.
2.10
Å Using 1st Mail for multi-column printouts Ö David Scott Ö Text which
is to be printed in more than one column is first prepared with First
Word Plus and it is at this stage that preparations must be made for the
print format. The text format must suit the final required column width
otherwise First Mail will ignore the instructions to print out in multi
columns.
2.10
An example will show how to lay out the text. Suppose that you require
two columns each 31 characters wide set side by side on a 65 character
wide sheet. This will be possible as it allows 3 characters for the
central white column since
2.10
31 + 3 + 31 = 65
2.10
The text must be prepared using a line length of 31 characters. The page
markings in First Word Plus will show final page 1 column 1 as page 1,
final page 1 column 2 as page 2, final page 2 column 1 as page 3 and so
on.
2.10
When the text has been fully prepared enter First Mail and follow the
instructions given on pages 196 and 197 of the manual. The number of
columns must be set to 2 in this example.
2.10
Å Another possible bug in First Mail Ö David Leckie Ö When using First
Word Plus with the ruler set to double line spacing, continuous text,
i.e. no returns are double spaced but text followed with a return is not
double spaced as you would expect.
2.10
However when a First Mail mail-merge is done from the file, the mrg file
contains double spaced text where there was single spaced text in the
original doc. Thus if you want, say, your address lines to be double
spaced then they should be a RETURN between each line in the doc file
only if you are not going to do a First Mail mail merge. If you are
doing a mail merge then they should be single spaced i.e. no RETURNS
because after the mail merge double line spacing will be inserted! Very
funny!
2.10
Å öMemallocò module Ö John Fidler was playing with the !Lander program
in RISC-OS when he realised that it should not have run with the
configuration settings on his machine. He looked in the !Lander
directory (by clicking on the icon in the directory viewer while holding
the <shift> key) and found the Memalloc module.
2.10
This module provides nine new star commands, which allow you to check
and alter the size of various memory pools i.e. system heap, RMA, screen
area, sprite area and font cache.
2.10
==> Help on keyword MemAlloc
2.10
Module is: MemAlloc util 0.11 (06 Dec 1988)
2.10
Commands provided:
2.10
SystemSize RMASize ScreenSize SpriteSize FontSize
2.10
RAMFSSize RMAFree SpriteFree FontFree
2.10
Å Desktop ScreenSize configuration Ö When using the desktop, the
memory allocated to the screen area is regulated by the desktop screen
mode and not the configuration setting e.g. if you are in mode 12 then
the screen area will have 80k allocated to it (or 96k for the 400
series).
2.10
Å Desktop startup commands Ö When starting the desktop using *Desktop,
you can make the Archimedes run a file or perform a star command. This
facility could be used to start the desktop up in a predefined state.
2.10
==> Help on keyword Desktop
2.10
*Desktop starts up any dormant Wimp modules, and also passes an optional
2.10
*command or file of *commands to Wimp_StartTask.
2.10
Syntax: *Desktop [<*command> | -File <filename>]
2.10
Å Converting ArcTerm 6.01 to RISC-OS Ö Arc-Term 6.01 will work under
RISC-OS if you make a !Run file in the !ArcTerm application directory:
2.10
RMEnsure InternationalKeyboard 0.17
2.10
RMReInit InternationalKeyboard
2.10
DIR <Obey$Dir>.!ArcTerm
2.10
Run ArcTerm
2.10
Å Extra Options for the Copy Command Ö The new User Guide (page 208)
lists a number of new options for the Copy command which considerably
extend its usefulness. The L and N options are par-ticularly useful for
performing backups from hard disc to floppy disc. Thus the command:
2.10
*Copy HD::$.A.* FL::$.* ~CFQR
2.10
will make a quick backup, without confirmation, of all the files and
subdirectories in directory A of the hard disc named HD onto the floppy
disc named FL. If however the option N is also added then only the files
which have changed since the last backup will be copied, thus reducing
the backup time consider-ably. If the L option is also added then even
more time is saved as the directories of both source and destination
disks are checked before any attempt is made to load the files
themselves.
2.10
If suitable Copy commands are added to the end of an application !Run
file then an automatic backup of changed files can be made when you have
finished using the application. In this case it is vital to quote the
name of the required backup floppy disc so that a request to load it can
be given if it is not already in the drive.
2.10
Å RISC-OS RS423 Ö Richard House says that using RISC-OS he can now
communicate with his BBC Model B at 19200 baud, without any errors
(whereas under Arthur 1.2, even with the patch, he was limited to 9600
baud).
2.10
Å Diagram II using RAMdisc Ö Load the file öSetupò and change the ö8ò
in lines 10045, 10750, 10765, 10805 and 11325 to ö23ò. This will cause
it to access the ram-disk (assuming you copied Diagram II over to the
ram-disk) thereby running much faster during scrolling and saving wear
and tear on your floppy or hard disk. (J.Daniels of Pineapple Software)
2.10
Å MIDI !Maestro Ö One reader says that there is an undocumented
facility in the !Maestro application which can play a MIDI instrument if
the MIDI podule is fitted.
2.10
Å Typing control characters Ö If you wish to use a önon-keyboardò
character under RISC-OS, just hold down the <ALT> key and type in the
character number on the keypad.
2.10
Å RMReInit SpriteUtils Ö Many applications unplug modules and
reinitialise them later. Often, under RISC-OS, the SpriteUtils module
does not get reinitialised. If you have any problems loading sprites or
get the öSWI not knownò error, you can check whether your modules have
been reinitialised properly by typing *ROMModules.
2.10
One reader says that ÉPacmaniaæ can be cured of this by adding the
following line to the !BOOT file:
2.10
935 *RMReInit SpriteUtils
2.10
Å Multi-Tasking Ö How many tasks can RISC-OS run simultaneously? The
manual doesnæt say, so I decided to find out by loading multiple copies
of the desktop clock. When I tried to load the 29th clock I got an error
message öToo many tasksò, making the upper limit 28.
2.10
Å Leaving the Desktop from a Command File Ö David Scott Ö The answer
to my own previous help query is actually quite simple when you know
how! The last command in the file, which must be an obey file, (it does
not work with an exec file) must be:
2.10
*fx138,0,252
2.10
which simulates pressing <control-shift-f12>.
2.10
Å Space for large applications Ö The methods used by Acorn and other
suppliers of application software to load their applications which
require a lot of space, seem to be both devious and, in many cases,
ineffective since they result in less space being available for the
application than under Arthur 1.2.
2.10
The method illustrated below allows over 300k of data space in Logistix
or over 600k of memory with the PC Emulator on a 1Mbyte machine. The
technique is a three stage process and is illustrated for Logistix.
2.10
Note that the machine will have to be reset after using the application
in order to restore all the normal modules and their facilities.
2.10
Note also that the amount of free space will vary depending on the
configuration settings. In my case, these are 80k for the screen (Mode
12) and 0K for System sprites, font cache and RAM FS.
2.10
If you use Econet then the modules NetFS, NetPrint, BBCEconet, NetFiler
and NetStatus should also be killed in Stage 2. If you do not use Econet
then you will gain marginally more space for all applications by
*Unplugging these modules as I have done.
2.10
Stage 1 Ö Set up the standard !Run file for the application so that it
sets a function key to execute the stage 2 file after quitting the
desktop.
2.10
| >$.!Logistix.!Run
2.10
IconSprites <Obey$Dir>.!Sprites
2.10
Key1 Quit|MDir $|MExec $.!Logistix.Lgx1|M
2.10
Fx138,0,252
2.10
Fx138,0,129
2.10
Stage 2 Ö This file must be an command file (not Obey). It clears the
temporary modules and then kills all the unwanted modules. A function
key is then set up to execute Stage 3 and the file ends by recovering
the freed space using the RMTidy com-mand which must be the last command
in the file.
2.10
| >$.!Logistix.Lgx1
2.10
RMClear
2.10
RMKill Debugger
2.10
RMKill Desktop
2.10
RMKill WindowManager
2.10
RMKill FontManager
2.10
RMKill InternationalKeyboard
2.10
RMKill SoundScheduler
2.10
RMKill StringLib
2.10
RMKill Percussion
2.10
RMKill SpriteExtend
2.10
RMKill Draw
2.10
RMKill Hourglass
2.10
RMKill Podule
2.10
Key 1 *Obey $.!Logistix.Lgx2|M
2.10
FX138 0 129
2.10
RMTidy
2.10
Stage 3 Ö This Obey file sets the current directory (it was cleared by
the radical effects of RMtidy) and then loads the Floating point
emulator and Logistix directly. The final line is an optional backup
command which automatically backs the new and changed data files up to a
floppy disc (named S1 in this case).
2.10
| >$.!Logistix.Lgx2
2.10
Dir $.!Logistix
2.10
RMLoad $.!System.Modules.
2.10
FPEmulator
2.10
Lgx
2.10
COPY :DJS.!Logistix.Sheet.* :S1.*
2.10
~CFLNQ
2.10
PC Emulator Ö The method is similar for stages 1 and 2 except the
following additional modules can be killed in stage 2: SystemDevices,
TaskManager, PaletteUtil, Filer, ADFSFiler, RAMFSFiler, ShellCLI and
RamFS. Stage 3 is not required as the line which sets the function key
termination command is:
2.10
Key 1 PC.Emulate|M
2.10
which enters the PC Emulator directly. Note that the PC directory must
be in the root and must be called PC otherwise the Emulator fails during
loading.
2.10
Å Getting First Word Plus started Ö further to the comments on page
20/21, last month, it is not a good idea to use *MOUNT as First Word
Plus will then not allow you to change discs, *DRIVE should be used and
this works fine. My machine is configured to boot with the external
drive selected, which usually holds a ölibrary discò, which is how I
discovered the problem. First Word Plus now boots happily under RISC-OS,
including an amended version of the key press module which traps <ctrl-
f12> to provide a command line similar to that on the desk top Ö i.e.
scrolling up from the bottom of the screen. (Weæll try to get hold of
this for the monthly disc. Ed.)
2.10
Å First Word Plus from the RISC-OS desktop Ö create the following run
file:
2.10
!Run
2.10
| !Run for !First Word Plus+ version 0.01
2.10
IconSprites <Obey$Dir>.!Sprites
2.10
WimpSlot -min 400k
2.10
set FirstWordPlus$Resources $.Resources.1wp.
2.10
set FirstWordPlus$Docs &.1wp.
2.10
echo<5><23><17><7><6><8><0><8><0>
2.10
<0><0><0><0>
2.10
run ö<FirstWordPlus$Resources>1wpò
2.10
Å First Mail under RISC-OS Ö David Leckie Ö While First Word Plus has
drawn a lot of comment, very little mention has been made First Mail,
the mail merge program that accompanies it.
2.10
When run under RISC-OS the main window will not resize. Now this may not
seem like much of a problem but the trouble is that the printer window
is hidden under the main window and cannot be easily accessed.
2.10
Fortunately the corners of the window are just visible and can be
clicked on. The printer driver window pops up when clicked on ok, but
while the destination printer window can be clicked on, the name of the
selected destination printer is still hidden. This problem is compounded
by the last line of the 1st paragraph on page 154 of the manual being
wrong. öThe four options Parallel Port, Serial Port, Network Port and
Disc will appear in rotation.
2.10
They do not rotate in the order above. Parallel Port is the first and
Disk is the third not fourth but which is network and serial? Can
someone with Arthur please tell us?
2.10
Thus, if you want to do a merge to parallel printer it works fine. For
disc, point to the corner of the window and give 2 clicks (not 3). If
you need serial or network, try 1 or 3 clicks.
2.10
Thanks to Mark Burch who helped to crack the problem.
2.10
Å Installing Artisan Ö Sean Kelly Ö There are three tips: the first is
on getting Artisan to return control to the desktop without resetting
the system; the second is on putting Artisan in any chosen directory;
the third is not strictly related to RISC-OS, but is on persuading
Artisan to work with compressed screens.
2.10
Returning to the desktop Ö When Artisan is installed as described on the
RISC-OS support disc, it does not return correctly to the desktop. The
following modification was made to the program on my A440, and works
perfectly:
2.10
1. Load program ART5 and, using the BASIC EDITOR, find the line: öDEF
PROCLARò
2.10
2. The next line should be a multi-statement line containing in-line
assembly code. If so, you have found the correct routine. Delete
everything on this line except for the first three statements and then
add ö:QUITò so that the new line reads:
2.10
MODE12:OSCLIöFX4ò:OSCLIöUPò:QUIT
2.10
3. Rename the old ART5 (in case you have made a mistake) and save the
new version as ART5.
2.10
This new version returns to the desktop, in the same condition as when
Artisan was called, when you quit Artisan.
2.10
Altering the directory structure Ö When installed using the hard disc
install program, Artisan insists on living in a directory called
:4.$.Artisan. This can be changed Ö the following details relate to my
chosen directory of :4.$.APPS.!ARTISAN.
2.10
1. !RUN should be altered from the support disc version. The new version
is:
2.10
ECHO <22><&8C>
2.10
WIMPSLOT -MIN 200k
2.10
DIR :4.$.APPS.!ARTISAN *** put your own directory here ***
2.10
URD @ BASIC ART4
2.10
In my case, the pathname of !RUN is ö:4.$.APPS. !ARTISAN.!RUNò. Before
changing !RUN, re-name the old one in case of accident.
2.10
2. Alter ART5 using the Basic Editor. Several lines need changing; in
each case the change consists of altering the given directory to point
to your new directory. The lines that need altering can be found by
searching for the following strings using the editor (they are all
unambiguous, but the case of each letter is crucial):
2.10
cLare%=FALSE:
2.10
A%=cLARESMI
2.10
WHEN12:OSCLI
2.10
WHEN1:OSCLIöLOAD
2.10
OSCLIöCDIR
2.10
OSCLIöDIR ò+ClA$+
2.10
Preserve the old ART5 in case of problems.
2.10
Å Adapting Artisan for Compressed Screens Ö I use a modified version
of the screen compression routine originally published in Personal
Computer World magazine. It uses the commands *CSCREENLOAD and
*CSCREENSAVE to load and save compressed screens, and compressed screens
are given the filetype &010. The adaptation below will work equally well
with other com-pression routines with the proviso that the compressed
screen loading routine must recog-nize and correctly deal with normally
saved screens (filetype &FF9).
2.10
1. Load ART5 and modify it using the BASIC Editor (first rename ART5, in
case of errors). Immediately after the REM statements at the start of
the program, add these two lines (substituting your own compressed
screen save and load commands):
2.10
*SET Alias$SCREENSAVE CSCREENSAVE %0
2.10
*SET Alias$SCREENLOAD CSCREENLOAD %0
2.10
Substitute the names of your own commands for CSCREENSAVE and
CSCREENLOAD.
2.10
2. Find DEFPROCcLaRESM with the editor. Look about 14 lines down and
there will be a line beginning with WHEN&FF9. Four lines further down
should be a line beginning with ENDIF. Add two new lines after this
ENDIF line (substituting your own compressed screen filetype):
2.10
WHEN &010
2.10
RES%=3:mIC%=ReSM%:ReSM%+=1:cLarESM%=7
2.10
3. Find DEFPROCPS with the editor. Look about seventeen lines down and
there will be a line beginning with WHEN&FF9. Six lines further down
should be a line beginning with ENDIF. Add two new lines after this
ENDIF line (substituting your own compressed screen filetype):
2.10
WHEN &010
2.10
PROCGw(laRES%): clArES%=4
2.10
The modified version of ART5 will correctly handle compressed and
uncompressed screens for loading, and will normally save screens in
compressed form.
2.10
Å RISC-OS Postscript Printer Drivers Ö One of our readers can only use
a laser printer from an Apple Mac, but wanted to obtain good quality
images of the documents that he produced in !Draw and !Edit. In order to
do this he redirected the output of the !PrinterPS to a file and
Éportedæ the file across to the Mac. The reason why this works is
because the output of !PrinterPS application is straight ASCII Post
script text, so in theory, the resulting file could be used by any
Postscript set up.
2.10
Å Configuring !PrinterDM Ö some readers have had problems outputting
to their dot matrix printers. This might be because the !PrinterDM
application must be configured for the printer you are using. This can
be done by clicking, with <select>, on the printer icon (once installed)
and then clicking on the printer name that appears in a window, until
the name of your printer appears. Then select the öSave Choiceò option
on the !PrinterDM menu. The printers that !PrinterDM supports are: Epson
FX, LQ, and LQ-850 compatibles and the NEC Pin-Writer P6 plus.
2.10
Å RISC-OS multisync text scaling solution! Ö Richard Averill Ö If you
turn back to Archive 2.9 p14, you will see the problem of text scaling
in multisync modes raised. Having also experienced this problem, I tried
to solve it.
2.10
Firstly, I tried using the output to sprites feature to modify this.
Since this did not alter the size of the font at all, I then tried a
more interesting method. I knew that the standard vdu 5 font size was
8x8 pixels, so I ran the following program to tell me which locations in
the operating systemæs workspace (&0000-&7FFF) contained the value 8.
2.10
10 REM > $.TextSize.Find8
2.10
20 REM (C) Richard Averill, 1989.
2.10
30 FOR I%=0 TO &7FFC STEP 4
2.10
40 IF !I%=8 THEN PRINT ~I%;
2.10
50 NEXT
2.10
I then had a list of locations, so I set vdu 5 mode and *Memoryæed each
of the locations to have a closer look. Storing 16 in the second
location (&1360) caused the x text size to be doubled! There were 3 more
8És consecutively after this value, so after a little testing I came to
the conclusion shown by the following table:
2.10
Address Contents
2.10
&1360 x size
2.10
&1364 y size
2.10
&1368 x spacing
2.10
&136C y spacing
2.10
All values are given in pixels, so by default these are 8,8,8,8. The
WIMP manager changes the x and y values according to the x and y Éeigæ
factors read by swi OS_ReadModeVariable detailed in OS1.2 PRM pages
124Ö126. Note that the values need not be multiples of 8, but the
characters will look rather odd otherwise!
2.10
The following procedure will enable you to set the text size and
spacing. The syntax is PROCtextsize(x size, y size, x spacing, y
spacing).
2.10
10000 DEF PROCtextsize(x%,y%,sx%
2.10
,sy%)
2.10
10010 !&1360=x%
2.10
10020 !&1364=y%
2.10
10030 !&1368=sx%
2.10
10040 !&136C=sy%
2.10
10050 ENDPROC
2.10
For example, PROCtextsize(16,8,16,8) will give you double width text
when in VDU 5 mode. This will be square in mode 12 etc. and of a
rectangular shape in mode 20 etc. The text spacing will usually be the
same as the text size.
2.10
To set the default text size from the RISC-OS desktop (the answer to the
query,) run the following program (which is in the ö$.TextSizeò
directory of the monthly disc) from within the desktop, and it will
redraw the whole screen to enable the new size to take effect.
2.10
10 REM > $.TextSize.SetSize
2.10
20 REM (C) Richard Averill, 1989.
2.10
30 REM restores default text size and spacing in the RISC-OS desktop.
2.10
40
2.10
50 !&1360=8
2.10
60 !&1364=8
2.10
70 !&1368=8
2.10
80 !&136C=8
2.10
90 SYS öWimp_Initialiseò,200,
2.10
&4B534154 TO task%
2.10
100 SYS öWimp_ForceRedrawò,-1,0,0,
2.10
&FFFF,&FFFF
2.10
110 SYS öWimp_CloseDownò,task%,
2.10
&4B534154
2.10
120 QUIT
2.10
This will set the text size to 8 pixels, the same as under the Arthur
WIMP manager. So if you have a high resolution monochrome, the text will
become four times smaller in each direction than normal!
2.10
Unfortunately, there is a slight problem. The RISC-OS WIMP assumes
scaling will be done to ensure that the size of the text is always 16x32
OS units and uses these values when calculating text widths/heights
instead of finding the sizes from the operating system. So any verti
cally centred text (such as window titles) will not be centred properly
in multisync modes!
2.10
For real compatibility with Arthur 1.2 WIMP applications, you can save
the Arthur 1.2 WindowManager module from ROM to disc and *RMLoad this
into RISC-OS instead. The Arthur 1.2 WIMP module is in the ö$.TextSizeò
directory of this monthæs programs disc.
2.10
Å Limited ADFS memory (RISC-OS/Arthur 1.2) Ö One reader has written in
saying that his Archimedes will only *MOUNT six discs. On the seventh,
the drive spins continuously until the disc is removed. This happens
because the ADFS only has a limited amount of memory to store the
directory information. The amount of memory allocated for this can
controlled by using *Configure ADFSDirCache.
==> Help on keyword ADFSDirCache
*Configure ADFSDirCache sets the size of the directory cache (in Kbytes)
used by the ADFS. A value of 0 selects a default value which depends on
RAM size.
Syntax: *Configure ADFSDirCache <size>[K]
You can also make the Archimedes forget that it has seen the disc by
using *DISMOUNT.
2.11
==> Help on keyword Dismount
2.11
*Dismount closes files, unsets directories and parks the given disc.
2.11
Syntax: *Dismount [<disc spec.>]
2.11
Å Three floppies for Arthur 1.2 desktop Ö In Archive 2.8, pages 11/12,
there is a hint which allows you to access three drives from the
desktop. However, the hint states that you must start the desktop up by
typing */Desktop instead of *Desktop. One reader says that you could of
course set up *Set Alias$Desktop Run Desktop which would then allow you
to start up using *Desktop.
2.11
Å In First Word Plus, when printing after opening more than one file,
the first file you opened will be offered for printing, not the last one
you closed!
2.11
Å Configuring your printer under the PC Emulator Ö In reply to Chris
Walkeræs question, you must use the following reserved words when
configuring your printer:
2.11
For serial printers use: AUX or COM1, COM2, COM3╔
2.11
For parallel printers use: PRN or LPT1, LPT2╔
2.11
Å Sprite Plot comments from Martin Simmons Ö The article on sprite
plotting was interesting since it is always good to see how other
programmers solve problems. However, the routines are far from being the
fastest possible, a major inefficiency being that the screen pointer is
updated after every pixel is plotted. This could be rectified by
deleting 2410, 2460, 2510, 2580 and changing the following:
2.11
2010 PROCplot_4_pixels(4*
2.11
(gjenta-1))
2.11
2050 ADD screen_pointerR,
2.11
screen_pointerR,#320
2.11
2110 DEF PROCplot_4_pixels(index)
2.11
2400 STRNEB data5R,
2.11
[screen_pointerR,#index+0]
2.11
2450 STRNEB data5R,
2.11
[screen_pointerR,#index+1]
2.11
2500 STRNEB data5R,
2.11
[screen_pointerR,#index+2]
2.11
2570 STRNEB data5R,
2.11
[screen_pointerR,#index+3]
2.11
Now the pointer is only changed at the end of each line. This improves
performance over the published routine by about 10% for a 24x24 pixel
sprite with no black pixels.
2.11
It would be quicker to use word stores instead of byte stores but this
would complicate the routine and may even slow it down overall.
2.11
Å D.I.Y. A3000 serial interface Ö Mike Harrison (Archive 2.10 p 56)
didnæt know what the chip numbers were for the A3000 serial interface
kit. You need a 6551 (which ought to be one of the ones manufactured by
CMD) and an LT1133.
2.11
Å Evaluation of Algebraic Expressions (E.D. Engelhardt) Ö Anyone who
is interested in the evaluation of valid algebraic expressions could try
to use PROCexpression in program Evalexpr as given below. The procedure
mentioned has been written using suggestions of Mr de Heus, ECD, Delft,
Holland.
2.11
Variable names in an expression are single, lower-case characters
ranging from Éaæ to Ézæ. These names are stored in Évar$æ. Each
character in the input expression Éex$æ is matched with its presence in
Évar$æ. If so, its position in Évar$æ is detected and it is replaced by
the (arbitrary) character É$æ. The position is used to assign an
appropriate value to the actual variable by means of array Évar()æ. The
value of the expression is obtained using the EVAL function.
2.11
The reason EVAL(ex$) is preceded by EVAL (öFALSEò) in PROCevalexpression
is as follows: If one enters an expression containing no variables but
numbers only, and the expression cannot be evaluated (e.g. LN0 or 3/0)
an error message appears on the screen. Thereafter, entering the same
type of expression, again not containing variables (e.g. LN9 after LN0
or 6/5 after 3/0), results in the same error message. To prevent this
from happening the instruction EVAL(ö<>ò) is included. I discovered this
Éfeatureæ by accident and found the solution by trial and error. I would
appreciate any comments from interested readers.
2.11
10 REM >Evalexpr
2.11
20 :
2.11
30 WHILE TRUE
2.11
40 PROCevalexpression
2.11
50 ENDWHILE
2.11
60 END
2.11
70 :
2.11
80:
2.11
90 DEFPROCevalexpression
2.11
100 k$=ö Press any key to continue !ò
2.11
110 LOCAL ERROR
2.11
120 ON ERROR LOCAL IF ERR=17 THEN
2.11
PRINTÉæö *** Escaped program !òÉ
2.11
:END ELSE PRINTÉö ò;REPORT$æÉk$;:
2.11
dummy=GET:ENDPROC
2.11
130 :
2.11
140 PROCinput
2.11
150 :
2.11
160 PROCexpression
2.11
170 exval=EVAL(öFALSEò) :REM
2.11
*** To prevent error message
2.11
after evaluation of a wrong
2.11
expression, e.g. LN0. Try to REM this
line !
2.11
180 exval=EVAL(ex$)
2.11
190 :
2.11
200 PROCoutput
2.11
210 ENDPROC
2.11
220 :
2.11
230 DEFPROCinput
2.11
240 CLS:PRINTÉö Choice of variables
2.11
from a to z.öÉ
2.11
250 LINE INPUTö Give expression : ò
2.11
ex$
2.11
260 ENDPROC
2.11
270 :
2.11
280 DEFPROCoutput
2.11
290 PRINTÉö Function value of ò;ex$
2.11
;ö = ò;exval
2.11
300 PRINTæk$;:dummy=GET
2.11
310 ENDPROC
2.11
320 :
2.11
330 DEFPROCexpression
2.11
340 LOCAL var$,var(),t%,i%
2.11
350 var$=öabcdefghijklmnopqrstuvw
2.11
xyzö
2.11
360 DIM var(LEN(var$))
2.11
370 :
2.11
380 FOR t%=1 TO LEN(ex$)
2.11
390 i%=INSTR(var$,MID$(ex$,t%,1))
2.11
400 IF i%>0 THEN
2.11
410 var$=LEFT$(var$,i%-1)+ö$ò
2.11
+MID$(var$,i%+1)
2.11
420 PRINTÉö Value of ò;
2.11
MID$(ex$,t%,1);ö : ò;
2.11
430 INPUTöòvar(i%)
2.11
440 :
2.11
450 CASE i% OF
2.11
460 WHEN 1:a=var(i%)
2.11
470 WHEN 2:b=var(i%)
2.11
480 WHEN 3:c=var(i%)
2.11
490 WHEN 4:d=var(i%)
2.11
500 WHEN 5:e=var(i%)
2.11
510 WHEN 6:f=var(i%)
2.11
520 WHEN 7:g=var(i%)
2.11
530 WHEN 8:h=var(i%)
2.11
540 WHEN 9:i=var(i%)
2.11
550 WHEN 10:j=var(i%)
2.11
560 WHEN 11:k=var(i%)
2.11
570 WHEN 12:l=var(i%)
2.11
580 WHEN 13:m=var(i%)
2.11
590 WHEN 14:n=var(i%)
2.11
600 WHEN 15:o=var(i%)
2.11
610 WHEN 16:p=var(i%)
2.11
620 WHEN 17:q=var(i%)
2.11
630 WHEN 18:r=var(i%)
2.11
640 WHEN 19:s=var(i%)
2.11
650 WHEN 20:t=var(i%)
2.11
660 WHEN 21:u=var(i%)
2.11
670 WHEN 22:v=var(i%)
2.11
680 WHEN 23:w=var(i%)
2.11
690 WHEN 24:x=var(i%)
2.11
700 WHEN 25:y=var(i%)
2.11
710 WHEN 26:z=var(i%)
2.11
720 ENDCASE
2.11
730 ENDIF
2.11
740 NEXT
2.11
750 :
2.11
760 ENDPROC
2.11
2.11
Å First Word Plus Ö I am sure that all users of First Word Plus have
found it considerably enhanced by the use of Steve Hoareæs Interrupt
Module (available on Shareware N╝6). The main use for this is in
mounting new discs, formatting and creating directories. I have recently
discovered that it can also be used for *EXECing files into the word
processor. This can be very useful because First Word Plus treats the
standard ASCII space character as a Éhardæ space. This means that if
straight ASCII text is read into First Word Plus in the regular way it
can not be formatted because each line is treated as an entire word. By
using the interrupt module and *EXECing the file it is as if it were
being typed in from the keyboard. Spaces between words are thus
translated into Ésoftæ spaces so that the resulting document can be
formatted in the usual way. Brian Cowan
2.11
Å Greek characters Ö (Gerald Fitton) For some time now I have been
considering converting all my old Wordwise files to PipeDream files.
The thing that has been putting me off is that, since I teach (amongst
other things) maths and statistics, I need to be able to print Greek
letters such as CDSYabc defghijklmnopqrstuvwxy. It is relatively easy
from Wordwise to define a new character on the Epson FX printer, but not
so easy to include it in PipeDreamæs Printer On string. I have got
round this by running a BASIC program from within PipeDreamæs !Run file
that sends the necessary codes for the Greek characters to the printer.
You can then have What-You-See-Is-What-You-Get Greek characters on
screen by using the sequence <Alt>+E+C. This is what you do:
2.11
Modify the !Run file to include the command
2.11
BASIC -quit ö<PipeDream$Dir>.
2.11
Printers.Greekö
2.11
My !Run file now looks like the one below.
2.11
| > !PipeDream.!Run
2.11
Set PipeDream$Dir <Obey$Dir>
2.11
WimpSlot -min 160k -max 640k
2.11
RMReInit InternationalKeyboard
2.11
RMKill InternationalKeyboard
2.11
BASIC -quit ö<PipeDream$Dir>.
2.11
Printers.Greekö
2.11
RMEnsure FPEmulator 2.60 RMLoad
2.11
<System$Path>Modules.FPEmulator
2.11
Set Alias$@RunType_DDE Run
2.11
<PipeDream$Dir>.!Run %%*0
2.11
Set File$Type_DDE PDream
2.11
IconSprites <PipeDream$Dir>
2.11
.!Sprites
2.11
Load <Obey$Dir>.piped.pd 8000
2.11
DIR <Obey$Dir>
2.11
Echo <26>
2.11
Pointer 0
2.11
Go 8000 ; %*0
2.11
DIR adfs::HardDisc4.$
2.11
Include the new program ÉGreekæ in a suitable directory; I have chosen
the ÉPrintersæ directory.
2.11
100 REM > <PipeDream$Dir>.
2.11
Printers.Greek
2.11
150 :
2.11
160 *Alphabet Greek
2.11
180 VDU 2
2.11
200 RESTORE
2.11
210 REPEAT
2.11
220 READ byte%
2.11
230 IF byte%<>-1 THEN VDU 1,byte%
2.11
240 UNTIL byte%=-1
2.11
250 :
2.11
260 VDU 3
2.11
270 :
2.11
280 END
2.11
300 :
2.11
310 DATA 27,64
2.11
320 DATA 27,58,0,0,0
2.11
330 DATA 27,37,1,0
2.11
340 DATA 27,54
2.11
350 DATA 27,38,0,108,108
2.11
360 DATA 136,0,128,0,252,2,0,2,0,0,0,0
2.11
370 DATA 27,38,0,128,128
2.11
380 DATA 138,8,4,2,4,8,16,32,64,128
2.11
,0,0
2.11
390 DATA 27,38,0,176,176
2.11
400 DATA 168,0,0,64,160,0,160,64,0,0
2.11
,0,0
2.11
410 DATA 27,38,0,177,177
2.11
420 DATA 139,18,0,18,0,126,0,18,0,18
2.11
,0,0
2.11
430 DATA 27,38,0,195,196
2.11
440 DATA 137,130,124,130,0,128,0,128,
2.11
64,0,0,0
2.11
450 DATA 139,2,4,10,16,34,64,130,96,
2.11
26,4,2
2.11
460 DATA 27,38,0,211,211
2.11
470 DATA 139,130,0,198,0,170,0,146,0,
2.11
130,0,0
2.11
480 DATA 27,38,0,217,217
2.11
490 DATA 139,58,68,130,0,128,0,130,68
2.11
,58,0,0
2.11
500 DATA 27,38,0,225,249
2.11
510 DATA 138,28,34,0,34,20,8,20,32,2
2.11
,0,0
2.11
520 DATA 138,127,128,18,128,18,128,
2.11
114,12,0,0,0
2.11
530 DATA 11,64,0,64,32,16,11,4,8,16
2.11
,96,0
2.11
540 DATA 138,12,18,64,178,0,146,0,
2.11
146,76,0,0
2.11
550 DATA 137,8,20,8,34,8,34,8,34,0
2.11
,0,0
2.11
560 DATA 8,13,144,37,192,5,130,0,0,0
2.11
,0,0
2.11
570 DATA 10,64,60,64,0,64,0,64,63,0
2.11
,0,0
2.11
580 DATA 138,56,68,16,130,16,130,16,
2.11
68,56,0,0
2.11
590 DATA 71,0,0,124,0,4,0,0,0,0,0,0
2.11
600 DATA 138,62,0,8,0,20,0,34,0,0,0,0
2.11
610 DATA 136,130,68,40,16,8,4,2,0,0
2.11
,0,0
2.11
620 DATA 10,127,0,4,0,4,0,4,120,4,0,0
2.11
630 DATA 10,64,32,16,8,4,8,16,96,0
2.11
,0,0
2.11
640 DATA 9,128,40,212,0,149,0,149,2,0
2.11
,0,0
2.11
650 DATA 139,0,0,0,0,0,0,0,0,0,0,0
2.11
660 DATA 138,32,0,62,0,32,0,62,0,32
2.11
,0,0
2.11
670 DATA 9,63,64,0,68,0,68,56,0,0,0,0
2.11
680 DATA 139,0,0,0,0,0,0,0,0,0,0,0
2.11
690 DATA 139,28,34,0,34,0,34,28,32,0
2.11
,32,0
2.11
700 DATA 10,32,64,0,64,60,64,0,64,0
2.11
,0,0
2.11
710 DATA 9,64,56,4,0,4,0,120,0,0,0,0
2.11
720 DATA 10,56,68,0,68,187,68,0,68,56
2.11
,0,0
2.11
730 DATA 9,65,34,20,8,20,34,65,0,0
2.11
,0,0
2.11
740 DATA 11,120,4,0,4,251,4,0,4,120
2.11
,0,0
2.11
750 DATA 138,28,34,0,2,12,2,0,34,28
2.11
,0,0
2.11
760 DATA -1
2.11
2.11
Incidently, this shows how you can include a BASIC program within an
Obey file and then come back to RUN the rest of the Obey file.
2.11
You have to remember to remove ESC ö@ò from the Printer On string
otherwise you will lose all the character definitions you have just
downloaded! G L Fitton.
2.11
This final section of hints and tips has been extracted from the Archive
Bulletin Board Service (BBS) by Richard Forster.
2.11
(N.B. There may be some over-lap with other H & T, but I donæt have time
to edit it out Ö Iæm just off on my Holidays. Ed.)
2.11
Å First Word Plus Margins Ö It is possible to get First Word Plus to
change its margins permanently, but it is not easy. It may also depend
on your version of the software, and this method may not work on all
versions. Make sure you try it on a backup copy!
2.11
10 wp%=OPENUP(öResources.1wp.1wpò)
2.11
20 margin%=8 : REM or whatever is
2.11
required
2.11
30 PTR#wp%=&2EF9C
2.11
40 BPUT#wp%,margin%
2.11
50 CLOSE#wp%
2.11
Å Taxan Multisync juddering Ö If you have an A400/1 or A3000 machine
and are using it with a Taxan Multisync monitor, you may experience some
juddering which can be overcome thus:
2.11
A400/1: Fit a molex shunt to link 2. If you do not have a spare shunt,
you can request one from Acorn Customer Services.
2.11
A3000 : Take your machine to your local dealer. The modification is
different from the A400/1 machines and you must not open your machine.
2.11
Å Using the Yes/No mouse icon Ö In order to use the Yes/No mouse icon,
do:
2.11
SWI öOS_Confirmò
2.11
This changes the pointer shape, flushes the mouse buffer, waits until a
key is pressed and then, on exit: R0 = (lowercased) character pressed, C
flag is set if ESCAPE, Z flag set if character is ÉYæ
2.11
Å Saving Rom Sprites Ö To save rom sprites as a standard file, do:
2.11
SYSöWimp_BaseOfSpritesò TO roms%
2.11
SYSöOS_SpriteOpò,524,roms%,öfilenameò
2.11
Save this as a BASIC program and double click it from the desktop.
2.11
Å Memory Re-allocation Ö You can re-allocate memory for spritesize,
screensize etc. by loading a module called MEMALLOC. This can be found
on Application Disc 2 in directory $.!Lander.
2.11
Å Hourglass Ö The following SYS calls affect the hourglass. Note that
the hourglass is nested, so if you have turned it on twice it must be
turned off twice.
2.11
SYSöHourGlass_Onò Ö Display Hourglass
2.11
SYSöHourGlass_Offò Ö Remove Hourglass
2.11
SYSöHourGlass_percentageò,number Ö Display Hourglass & percentage below.
2.11
SYSöHourGlass_Smashò Ö Remove all hourglasses
2.11
SYSöHourGlass-LEDsò,%AB Ö Where A is the top LED, B is the bottom LED
2.11
SYSöHourGlass_Onò has a delay of 1/3 sec before actually appearing. To
make the delay the value of r0 use:
2.11
SYSöHourGlass_Startò
2.11
Å Tiny directories Ö The adjust button on a tiny directory opens the
application and removes that tiny directory.
2.11
Å RISC-OS Speedup Ö The following calls speed up the machine ROMs from
4Mhz to 8Mhz. Try them at your own risk. (Although under Arthur they
caused crashes, they seem to work OK under RISC-OS) The first switches
to higher speed, the second resets it:
2.11
SYSöOS_UpdateMEMCò,64,64
2.11
SYSöOS_UpdateMEMCò,,64
2.11
Å Terramex Cheat Ö For infinite lives, when you first load the game,
type in öSUBJECTTOCHANGEò on the loading screen.
2.11
Å RISC-OS Bugs Ö Yes, already folk have found begun to find bugs in
RISC-OS.
2.11
1) Module files which show up for *cat as modules but are dated 2:27
1901 do not get a module icon in a filer window Ö this is a property of
unstamped files from AASM/OBJASM.
2.11
2) Edit does not work properly in modes 2,4 or 5. (But who would want to
do so?! Ed.)
2.11
3) You can drag a directory into itself creating an copy within a copy
until disc space runs out. (Could that be the answer to the Élibrary
virusæ in the Help!!! section? Ed.)
2.11
4) Resizing the interactive help window can cause the mouse pointer to
move autonomously up the screen. Try it: Hold button down and resize it,
keep holding, and it will go for a certain window size always.
2.11
Å MaxGammon under RISC-OS Ö If you have a copy of this game, the
author has a version which works in the desktop. Send your original disk
and a S.A.E. to 11 Maryland, Barkham, Wokingham, Berkshire RG11 4PB and
you can have an upgrade to the newer version.
2.11
Å Last line in program Ö To find the last line in a BASIC program
which is in memory, hold down <ctrl>+<shift> and then press <escape>
twice.
2.11
Å Hearsay Problems Ö It is still possible to select a route from the
screen when in a scrolling terminal, but it must be a Élongæ click. A
short click tries to home the cursor to where the pointer is by sending
a string of control codes. The answer is to hold the button down a bit
longer or use the keyboard.
2.11
If you have problems with Xmodem make sure that Vasscomm is turned off.
2.11
Å Filer_OpenDir Ö When using Filer_OpenDir, it is important to get the
full pathname correct. For instance, if your hard disc has the name
ÉFredæ and you want to open the directory $.Foo, you should use:
2.11
*Filer_OpenDir adfs::Fred.$.Foo
2.11
and not something like:
2.11
*File_OpenDir adfs::4.Foo
2.11
The reason is that when you click on the drive icon, the Filer checks
the list of open windows to see if the requested pathname is already
visible. Unfortunately it is not too intelligent about this, and if the
names do not match exactly, the Filer will open another window. This
will have the side effect that when Dismount is used only windows with
the first pathname will be closed.
2.11
Å Legal Text Scaling for Multisyncs Ö Richard Averillæs hint last
month (Archive 2.10 pp 19/20) to help rescale text in multisync modes
could be done more legally using:
2.11
VDU 23,17,7,flags,x;y;0,0
2.11
flags => bit 0 = not implemented
2.11
bit 1 = 1 => set size of VDU 5 characters
2.11
bit 2 = 1 => set size of VDU 5 spacing
2.11
10 REM > CharSize Demonstration
2.11
of changing character size
2.11
20 REM By Martin Simmons 10/07/89
2.11
30
2.11
40 MODE 12
2.11
50
2.11
60 VDU 5:CLS:PRINTÉæ
2.11
70 GCOL 1
2.11
80 PROCprint(8,16,öDouble heightò)
2.11
90 PRINT
2.11
100 GCOL 2
2.11
110 PROCprint(16,8,öDouble widthò)
2.11
120 PRINT
2.11
130 GCOL 3
2.11
140 PROCprint(16,16,öDouble sizeò)
2.11
150 PRINT
2.11
160 GCOL 5
2.11
170 PROCprint2(8,8,16,16,öDouble
2.11
spacedö)
2.11
180 GCOL 7
2.11
190 PROCprint(8,4,öMangled half
2.11
heightö)
2.11
200 PRINTÉæ
2.11
210 GCOL 6
2.11
220 PROCprint(120,120,öBIGò)
2.11
230 VDU 4
2.11
240 END
2.11
250
2.11
260 DEF PROCprint(X%,Y%,text$)
2.11
270 VDU 23,17,7,6,X%;Y%;0,0
2.11
280 PRINT text$
2.11
290 ENDPROC
2.11
300
2.11
310 DEF PROCprint2(X%,Y%,sx%,sy%
2.11
,text$)
2.11
320 VDU 23,17,7,2,X%;Y%;0,0
2.11
330 VDU 23,17,7,4,sx%;sy%;0,0
2.11
340 PRINT text$
2.11
350 ENDPROC
2.11
2.11
Å ARM assembler T option Ö Martyn Lovell says that although the
assembler sees the T option for the LDR mnemonic the same as the !
option (Archive 2.10 p 9), it is not used in the same way. The ! option
should be used to force write back with pre-indexed addressing while the
T option should be used with post-indexed addressing to cause the -TRAN
pin on the ARM to go low for the duration of the data transfer. This is
used by an OS in non-user modes to allow the OS to generate a user-mode
address.
2.11
Å ALTernative keys Ö The RISC-OS Inter-nationalKeyboard module
provides the facility for typing control characters by holding down
<alt> and typing the number on the numeric keypad. In addition, the
following keys produce symbols when pressed with <alt> held down:
2.11
1 gives 1 2 gives 2 3 gives 3 ~ gives ┬
2.11
9 gives ▒ 0 gives √ , gives x . gives ╓
2.11
R gives ¿ Y gives ┤ S gives ñ Z gives ╟
2.11
X gives ╚ C gives ó M gives ╡
2.11
shifted C gives ⌐
2.11
Other keys return nothing. The old Arthur effect of using
<ctrl><shift><alt> to add 128 to the code can be produced by RMKILLing
this module. Doing this will also allow the use of <alt> plus a cursor
key in the BASIC Editor which does not work with this module installed.
2.11
Å Colour cursor for the BASIC Editor Ö Here is a little program which
will alter the ArmBE module so that you can change the colour of the
cursor.
2.11
10 REM > ColourEdit Make a colour
2.11
cursor for the BASIC Editor
2.11
20 REM By Martin Simmons 11/07/89
2.11
30 REM I use yellow background,
2.11
blue foreground, red cursor
2.11
(1=6 EOR 7)
2.11
40
2.11
50 colour%=6 :REM **** CHANGE
2.11
THIS LINE TO CHANGE THE
2.11
COLOUR (EOR 7) ****
2.11
60 DIM buf% &10000
2.11
70 OSCLI öLoad :App2.Modules.
2.11
BasicEdit ö+STR$~buf%
2.11
80 P%=buf%+&81E4
2.11
90 [ SWI &100+colour% ;Change
2.11
background palette
2.11
100 ]
2.11
110 zi%=buf%+&8320:zi%+=8+4*
2.11
((!zi%<<8)>>8)
2.11
120 wind%=buf%+&8310:wind%+=8+4*
2.11
((!wind%<<8)>>8)
2.11
130 P%=buf%+&8310
2.11
140 [ SWI öOS_WriteSò
2.11
150 EQUB 17 : EQUB 128+colour%
2.11
;Set background colour
2.11
160 EQUB 12 ;Clear screen
2.11
170 EQUB 23 : EQUB 16 : EQUB 1
2.11
;Set cursor movement
2.11
180 EQUS STRING$(4-(P% AND 3)
2.11
,CHR$0)
2.11
190 BL zi%
2.11
200 BL wind%
2.11
210 ]
2.11
220 INPUTÉöEnter new file name for
2.11
the editor: öfile$
2.11
230 OSCLI öSave ò+file$+ö ò+STR$
2.11
~buf%+ö +94B4ò
2.11
240 OSCLI öSetType ò+file$+ö FFAò
2.11
2.11
Å Wild card copy for RISC-OS Ö The destination parameter of the *Copy
command now has greater freedom regarding wild cards i.e. wildcards in
the destination can be used even though they were not used for the
source
2.11
e.g. *COPY :0.Text :1.* is now valid.
2.11
Å RISC-OS disc names Ö It is possible to set a system variable which
will behave like a disc name. If you *Set <discname>$Path <filepath> you
can then access you files by :<discname>.<filename>. For example:
2.11
*Set W App1:$.
2.11
*Run W:!Edit
2.11
You can even define several paths, just like File$Path and Run$Path:
2.11
*Set W App1:$.,App2:$.
2.11
*RMLoad W:Modules.BasicEdit
2.11
*Run W:!Edit
2.11
Å Memory Usage Ö Gerald Fitton Ö Of course, the Ébestæ machine has
both hard disc and 4Mb of memory, but some hard disc machines have less
memory. If you have the Ébestæ then you will probably put all the
!(application) directories that you use in your root ($) directory for
instant access. When you click on the :4 icon in the icon bar, all your
application !Boot files will be RUN and memory will be allocated to each
application (so that it is instantly available). This is true even when
the applications are not installed on the icon bar. If you have less
memory, say 1Mb, then you may find that your dormant applications are
using up too much memory for some of the more sophisticated appli
cations. The solution is to put your applications not in the root
directory but in a (non-!) sub-directory. For example, !Patience can be
put together with !Zarch in a games directory, where Games is in the
root directory. This way, only when you open the Games directory (by
double clicking on it) will you use up memory on the dormant appli
cations !Patience and !Zarch.
2.11
Å 1st Mail solution Ö When using 1st Mail in RISC-OS, the printer
options are hidden underneath another window. Mr Burrows has solved the
problem by altering the template file:
2.11
*Load $.Resources.1wp.
2.11
1ml_templa 9000
2.11
!&9AA8=155
2.11
!&9AB0=1023
2.11
*Save $.Resources.1wp.
2.11
1ml_templa 9000+AEA
2.11
*SetType $.Resources.1wp
2.11
.1ml_templa FFF
2.11
Å RISC-OS Hints and Tips Ö S C Costin Ö When using !PrinterDM on the
Desktop to print a text file, if the printer and Archimedes are set up
where there are no ignore characters configured, i.e. can be checked as
follows:
2.11
F12 ;Press function key 12 from desktop
2.11
*status ignore ;Enter command
2.11
No ignore ;Returned after entering command
2.11
The problem is that the line feed is suppressed and therefore over-
printing occurs. This is easily overcome by clicking on the !PrinterDM
icon on the icon bar, which produces a window, and selecting CR or LF
conversion.
2.11
A more permanent solution is to edit the file PrData. To do this hold
shift key while clicking on the application directory !PrinterDM, then
drag PrData icon over Edit icon on the icon bar and release the mouse
button. At the end of the printer driver data change line: from 0 to 1
i.e. change line:
2.11
0;0/1 1=>convert CR or LF to CR,LF
2.11
to:
2.11
1;0/1 1=>convert CR or LF to CR,LF
2.11
Å Pipedream conversion to ADFS E type floppy disc by S C Costin
2.11
1) Format new disc using the new E format.
2.11
2) Name the new disc NewPd.
2.11
3) Backup your original copy to the disc NewPd, using *COPY to retain
E format.
2.11
4) Copy the !PipeDream application from the support disc to the root
directory of disc NewPd.
2.11
5) Copy the Floating Point Emulator module from directory
!System.Modules on Application Disc 1 into directory $.!PipeDream on
disc NewPd.
2.11
6) Delete $.!boot
2.11
7) Delete $.piped.fpe2
2.11
8) Delete $.rs423drive
2.11
9) Add the following obey file called $.!boot
2.11
| > $.!boot
2.11
*quit
2.11
RUN $.!pipedream.!run
2.11
10) Leave the !PipeDream.!boot file as copied from the support disc.
2.11
| > !PipeDream.!Boot
2.11
Set PipeDream$Dir <Obey$Dir>
2.11
Set Alias$@RunType_DDE Run <PipeDream$Dir>.!Run %%*0
2.11
Set File$Type_DDE PDream
2.11
IconSprites <PipeDream$Dir>
2.11
.!Sprites
2.11
11) If mouse cursor control is required insert lines 7 & 8 in the !Run
Obey file as follows:
2.11
| > !PipeDream.!Run
2.11
Set PipeDream$Dir <Obey$Dir>
2.11
WimpSlot -min 450k
2.11
||RMReInit InternationalKeyboard
2.11
RMKill InternationalKeyboard
2.11
RMEnsure FPEmulator 2.60
2.11
RMLoad <Obey$Dir>.FPEmulator
2.11
$.piped.cursorrm
2.11
mousecursor on 13 &c5 131
2.11
Set Alias$@RunType_DDE Run <PipeDream$Dir>.!Run %%*0
2.11
Set File$Type_DDE PDream
2.11
IconSprites <PipeDream$Dir>
2.11
.!Sprites
2.11
Load $.Library.pd 8000
2.11
Echo <26>
2.11
Pointer 0
2.11
Go 8000 ; %*0
2.11
Å Update for Artisan and ProArtisan Ö Clares have now produced an
application which will up-date your Artisan and ProArtisan discs for
RISC-OS. It has been put on both this monthæs and last monthæs program
discs. Many thanks to Duncan Burbridge, Kimba, Australia (age 12) who
also sent us information on updating Artisan for RISC-OS.
2.11
Å Not enough screen memory? Ö If a program expects to run in a
specific screen mode and not enough screen memory is available, it will
usually report a ÉBad Modeæ error when run from the desktop, as the
screen memory canæt be expanded dynamically once the application has
started. This can be fixed by either dragging the screen memory bar in
the task window, or by entering the appro-priate mode first. A much
more elegant way is to add the following line to the Obey file that
starts the program: Echo <22><n> Where <n> is the mode. This ensures
that the screen memory is allocated before the application starts and
should appear before the *WimpSlot command.
2.11
Å Uncluttered cataloging Ö RISC-OS has a neat way of searching a disc
without cluttering the screen. Use <adjust> to open a directory and it
closes the one you were in, leaving only the new dir-ectory on the
screen. To move back up the tree, click <adjust> on the close icon, and
the next directory up will appear, closing the current directory (unless
you are in the root directory, of course!).
2.11
Å Bye bye hard disk! Ö The RAM disc is fantastic but not much use on 1
Mbyte machines. Also, note that when RAMFS is selected *bye does not
park the head of the Winchester Ö so beware!!!
2.11
Å Archive Bulletin Board Ö This monthæs password is öARCAMò Ö which is
apparently the name of Alan Gloveræs hi-fi system!
2.12
Å Arthur 1.2 desktop Ö Nick Furniss has converted the Arthur 1.2
desktop so that it works under RISC-OS. If you are interested, you
should contact him at 87 Moordale Avenue, Bracknell, RG12 1TG.
2.12
Å Datachat Modem connections Ö These connect-ions were sent in by P
Carlson who is happily using the Datachat to connect to Prestel.
2.12
Archimedes Datachat
2.12
2 5
2.12
3 1
2.12
5 3
2.12
Pins 2 & 3 on the Datachat are linked together and pins 1, 6 and 8 are
linked on the Archimedes.
2.12
Å First Word Plus Ö Volker Eloesser of West Germany, in response to
Help needed 2.11, p.15, concerning First Word Plus:
2.12
1) This sounds as if the printer is configured to a shorter paper length
than the computer. If the computer sends a page which is one line longer
than the configured length, the printer will feed the next full page
after receiving a form-feed command. If the reconfiguration of the
printer does not work, change the FormFeed command in the printer driver
(HEX-file) to a no-operation code, such as É00æ or É*æ and compile a new
CFG-file.
2.12
2) Simply close the window by clicking on the close-symbol on the top-
left corner of the text window before printing.
2.12
Å First Word Plus word-count Ö The word count in First Word Plus does
not work properly! It counts a word which contains an apostrophe as two
words e.g. Iæm or itæs. This was very embarrassing for one Archive
reader, who insisted to his publisher, that he had written a certain
number of words.
2.12
Å Graphic Writer bug Ö If you insert a block marker at the end of a
document, it is possible to scroll past the ÉEndæ point. This is usually
remedied by scrolling back but if you continue editing it is possible to
crash the application by pressing <ctrl><down arrow> followed by <page
down> or <page up>. So be careful.
2.12
Å Home Accounts Ö Just a quick comment on Alan Highetæs Home Accounts
review in 2.10 Ö one of his criticisms is that the reporting is limited
to a whole yearæs transactions thus possibly taking up lots of paper;
whilst this is true, report output can, under RISC-OS, be dragged
directly into !EDIT and then you can print bits needed. Not ideal, but
a solution.
2.12
Also he says that transactions are deleted after a year Ö this is not
completely true Ö only the last 12 months transactions can be graphed
and edited, but all transactions are kept for viewing in the account/
header windows. Brian Debenham
2.12
Å Prolog X Ö We have a hint & tip on öRetaining facts, rules and lists
produced in Prolog Xò written by C.G.Williamson. It was fairly long and
rather technical, so we did not print it. If anyone would like a copy of
this, please send an SAE to Adrian Look at the Archive office. (We have
just received a letter from Jim Davis who says that he would like to
commend Chris for his öbrilliantly simple use of the Prolog built-in
predicates Étellæ and Étoldæ.ò He quotes several learned texts and says
that they all miss Chrisæ simple combination of Étellæ, Élisting(X,Y)æ,
Étoldæ as a method of avoiding the very contrived, but hitherto common,
use of Étellæ and Étoldæ. He believes that Chrisæ expedient will become
standard.) Should we therefore publish Chrisæ comments? Are there many
Prolog users out there? Ed.)
2.12
Å QL Reader Ö Brian Oliver points out that there is a problem with
QLreader (Shareware 12) in its drive select. Otherwise it is excellent
and it now works fine with my 5.25ö drive connected to slot :2 after the
following modification. The SYS òADFS_DiscOpö command on line 2750 is
wrong. It should be:-
2.12
SYS öXADFS_DiscOpò,,(1+List%<<6),
2.12
Start%+(drive%<<29),bf%,512 TO flags%
2.12
It is then necessary to set the default drive on line 240 and those for
selection on lines 19740 & 1950.
2.12
Å RS423 Archimedes to Beeb Ö J.O.Linton: I have been having trouble
with my RS423 port. My Beeb would listen to my Archimedes but my
Archimedes would not receive data correctly from my Beeb. I have a
fairly early Archimedes so I went to some trouble to get the field
modification done to the serial chip only to find that the fault was
exactly as before. Then my dealer sent me a leaflet from Acorn (Part No.
0476.033) called ÉUsing the serial portæ in which I found this vital
paragraph:
2.12
ÉThe Acorn BBC model B uses one stop bit by default, whereas the default
configuration of an Archimedes computer is two stop bits. You are
advised to change the DATA configuration of your Archimedes computer to
5 if you are using your serial port to pass data to or from a BBC model
B.æ
2.12
*Configure DATA 5 and Hey Presto Ö it worked!
2.12
Å Systemdevs Ö When using the System Devices to send characters to the
printer, the printer ignore character feature is not Éusedæ, and all
characters are sent to the printer Ö including the printer ignore
character. This is very useful for sending an alternative character set
to the printer (if it has a user-defined graphics option) as no
characters will be Éstrippedæ Ö rather like using VDU 1,char with the
VDU drivers. All that needs to be done is give a command similar to:
*COPY UserChars printer: ~C~V. Michael Ben-Gershon
2.12
Å Teletext Adaptors Ö Richard House has written some software which
allows the Archimedes to ögrabò teletext pages using the Acorn Teletext
adaptor. If any one is interested, we can put you in touch with him.
2.12
Herman Stevens from Belgium, says that in order to get the Morley
teletext adaptor to work with RISC-OS, you require: I/O podule, Softæs
öSupportò and öATSò saved on ADFS disc, !65Host copied on the same disc
and !boot file as follows:
2.12
CLS
2.12
*DIR !65Host
2.12
*RMLoad !RunImage
2.12
*CACHEROM 1 ADFS
2.12
*CACHEROM 3 SUPPORT
2.12
*CACHEROM 4 ATS
2.12
*EMU.
2.12
By typing öTTEXTò you can start the Support ROM and TELETEXT will start
the ATS ROM.
2.12
Å Taxan Multisync wobbles Ö The hint last month was expressed in
rather too technical language. Iæll try again.
2.12
Look at the p.c.b. from the front of the computer and near the serial
port socket you will see a couple of metal pins sticking up and on the
board alongside it, the inscription öLK2ò. Then over to the left of
that, about in line with the headphone socket is a set of five pairs of
pins inscribed as öPL2ò. It should have a couple of black plastic/metal
sleeves on it. These are spare metal shorting links. Slide one of these
links off (upwards) and put it instead on LK2. That should do the trick.
2.12
Å Compressing Text with OS_PrettyPrint Ö Under RISC-OS, the
ÉOS_PrettyPrintæ SWI (c.f. Archive 2.9 p9) has been extended to include
a Édictionaryæ facility. When an ASCII <27> code is encountered, the
next byte will be used to find (and print) a dictionary entry. For
example:
2.12
Consider the following dictionary:
2.12
1) Hello
2.12
2) this
2.12
3) is
2.12
4) Archie
2.12
If you send the codes <27><4> to the OS_Pretty Print SWI, tthe text
ÉArchieæ will be printed.
2.12
The two bytes <27><4> replace the 5 bytes <65> <114><99><104><101> which
we actually want printed. The operating system uses this feature to
compress any strings it might need to print.
2.12
The structure of a dictionary is shown below:
2.12
<entry length> }
2.12
<string> } repeat
2.12
<0> }
2.12
.
2.12
.
2.12
<0> ; end of of dictionary
2.12
Therefore to print an OS_PrettyPrint SWI, you must use the following
entry parameters:
2.12
r0 -> pointer string
2.12
r1 -> pointer dictionary (0 -> system dictionary)
2.12
r2 -> special string (printed if dictionary entry zero is accessed)
2.12
10 REM >PrettyPrt
2.12
20
2.12
30 REM ****************************
2.12
40 REM * Using the OS_PrettyPrint *
2.12
50 REM * Dictionary Facility *
2.12
60 REM * by Adrian Philip Look *
2.12
70 REM * 21st August 1989 *
2.12
80 REM ****************************
2.12
90
2.12
100 DIM dictionary% &400:REM allocate
2.12
some space for the dictionary
2.12
110 DIM buffer% 3 : REM allocate some
2.12
space for the string
2.12
120
2.12
130 PROCsetupdictionary :REM make a
2.12
user dictionary
2.12
140
2.12
150 buffer%?0=27 : REM a dictionary
2.12
entry follows
2.12
160 buffer%?2=0 : REM terminate
2.12
OS_PrettyPrint string
2.12
170 FOR x%=0 TO 5
2.12
180 buffer%?1=x% : REM dictionary
2.12
entry x%
2.12
190 PRINTæx%;ö : ò;
2.12
200 SYS öOS_PrettyPrintò,buffer%,
2.12
dictionary%,ö<special string>ò +CHR$(0)
2.12
210 NEXT x%
2.12
220 PRINTÉ
2.12
230 END
2.12
240
2.12
250 DEFPROCsetupdictionary
2.12
260 x%=dictionary%
2.12
270 READ s$
2.12
280 WHILE s$<>ö***ò
2.12
290 x%?0=LEN(s$)+2:REM entry length
2.12
300 $(x%+1)=s$+CHR$(0) :REM null
2.12
terminated string
2.12
310 x%+=LEN(s$)+2
2.12
320 READ s$
2.12
330 ENDWHILE
2.12
340 ?x%=0 : REM zero length string to
2.12
terminate dictionary
2.12
350 ENDPROC
2.12
360
2.12
370 DATA Hello,this,is,Archie,ö***ò
2.12
2.12
Å Copy Options Ö In Archive 2.10 page 15 we said that there were two
new copy options L and N. In fact there are five new options, the other
three being:
2.12
A Ö Force destination access to same as source
2.12
S Ö Restamp datestamped files after coping
2.12
T Ö Only copy the directory structure
2.12
Å Filer_OpenDir and Filer_CloseDir (contæd) Ö Gary Atkinson says that
these commands do not use system variables and so the full directory
name must be used every time. This makes life difficult for RISC-OS
applications which want to open a Filer window relative to their present
position on the disc (which may change e.g. hard disc users).
2.12
Therefore, with this context in mind, Gary has sent in the following
hint which will read the value of a system variable:
2.12
DIM buffer% 255, temp% 255
2.12
SYS öOS_CLIò,öFiler_OpenDir ò + FNread_system_variable(öObey$Dirò)
2.12
END
2.12
:
2.12
DEFFNread_system_variable(v$)
2.12
LOCAL len%,x%
2.12
$buffer%=v$
2.12
SYS öOS_ReadVarValò,buffer%,temp%
2.12
,255,0,3 TO ,,len%
2.12
v$=öò
2.12
FOR x%=0 TO len%-1
2.12
v$+=CHR$(buffer%?x%)
2.12
NEXT x%
2.12
=v$
2.12
Å Mode 16, 17 and 24 co-ordinates Ö Under RISC-OS modes 16 and 17 now
support graphics. This means that a resolution of 1056x256 can now be
obtained on a normal monitor. However, it should be noted that the
screen size, in OS co-ordinates, is not 1280x1024 (or even 2048x1024 as
Richard Averill suggested last month) but 2111x1024. In order to convert
between the two sizes you should use the following function:
2.12
DEFFNconvert2111to1280(x%)
2.12
=INT(33*(x%+0.5)/20)
2.12
Å Modifying !Calc to accept keyboard input Ö In order to modify the
calculator on the Applications Disc 2 to accept keyboard input you must:
2.12
1) Leave the desktop and type *BASIC.
2.12
2) Mount Applications Disc 2 in drive 0.
2.12
3) LOAD ö!Calc.!RunImageò and make the follow-ing modifications:
2.12
Add the following lines:
2.12
315 WHEN 8 : PROCwndkeyprssd(!q%,
2.12
q%!24)
2.12
750 DEFPROCwndkeyprssd(handle%
2.12
,key%) : IF key%>47 AND key%<5 THEN PROCdigit(CHR$(key%))
2.12
751 CASE key% OF
2.12
752 WHEN 42: PROCoperator(ö*ò)
2.12
753 WHEN 43: PROCoperator(ö+ò)
2.12
754 WHEN 47: PROCoperator(ö/ò)
2.12
755 WHEN 46: PROCpoint
2.12
756 WHEN 45: PROCoperator(ö-ò)
2.12
757 WHEN 95: PROCoperator(ö-ò)
2.12
758 WHEN 61: PROCoperator(ö=ò)
2.12
759 ENDCASE
2.12
Now renumber the program (just type RENUMBER <return>), and then
type:
2.12
855 PROCupdate(calc%,12,-28-32,10
2.12
*16+12,24):PROCcalc:ENDPROC
2.12
105 q%!60=15<<12
2.12
4) SAVE ö!Calc.!RunImageò
2.12
To use text with the modified calculator just click in the calculator
window (not on an icon) and type away. Note that a caret will not
appear.
2.12
Å New CMOS RAM settings for outline fonts Ö When using the outline
font manager (which is supplied with the Acorn DTP) you can set various
font cache thresholds. These thresholds govern which mode of caching is
used i.e. vertical & horizontal subpixeled, cached outlines, anti-
aliased outlines, non-exact font from x90y45, and Éauto-growæ cache.
2.12
The various thresholds can be set up as follows:
2.12
*Configure FontSize <n>k ; min size of cache
2.12
*Configure FontMax <n>k ; max size of Éauto-growæ cache
2.12
*Configure FontMax1 <h> ; max size of non-exact font x90y45
2.12
*Configure FontMax2 <h> ; max size of anti-aliased outlines
2.12
*Configure FontMax3 <h> ; max size of cached outlines
2.12
*Configure FontMax4 <w> ; max size of horizontally-subpixeled font
2.12
*Configure FontMax5 <h> ; max size of vertically-subpixeled font
2.12
where <h> refers to maximum font pixel height (pixel height = point
height * dpi / 72), and <w> to the maximum font pixel width.
2.12
Some programs may corrupt the CMOS RAM and soil the font cache
thresholds. This may dramatically reduce the efficiency of cached fonts.
Use the *STATUS command to view your currents threshold settings (and
make a note of them just in case the CMOS RAM gets corrupted).
2.12
Å New FPE Ö There is a new version of the floating pointer emulator
provided on the Applications Disc 2. If any of your programs use older
versions of the FPE, you should update the module. This is because the
pre 2.60 release versions of the FPE have a bug (a badly formed module
header) which happens to work under Arthur 1.2.
2.12
Å New system variable Ö There is a new system variable, called
Font$Path, which tells the Archimedes where anti-aliased fonts can be
found. It has the same syntax as Load$Path and Run$Path. This means that
fonts can be accessed from several different directories e.g. *Set
Font$Path $.Fonts1, $.Fonts2,$.Fonts3 will allow the fonts manager to
access anti-aliased fonts from three directories $.Font1, $.Font2 and
$.Font3. To remain compatible with the earlier versions of the font
manager you can *Set Font$Path <Font$Prefix>.
2.12
Å OS_ChangedBox Ö RISC-OS now offers a facility which will keep track
of the areas on the Éscreenæ which have been altered by calls to the VDU
drivers. When enabled, this feature will pro-vide a rectangle (co-
ordinates in pixels from the bottom left-hand corner) of the area on the
Éscreenæ which has been changed. The parameters are:
2.12
Entry:
2.12
R0 = 0 -> disable changed box calculations
2.12
= 1 -> enable changed box calculations
2.12
= 2 -> reset changed box to null rectangle
2.12
= -1 -> read changed box info
2.12
Exit:
2.12
R0 = old enable state
2.12
R1 points to a fixed block of 5 words
2.12
[R1, #0] = disable/enable flag
2.12
[R1, #4] = x-coordinate of left edge of box
2.12
[R1, #8] = y-coordinate of bottom edge of box
2.12
[R1, #12] = x-coordinate of right edge of box
2.12
[R1, #16] = y-coordinate of top edge of box
2.12
An example program:
2.12
10 REM >Changed
2.12
20
2.12
30 REM *************************
2.12
40 REM * Using OS_ChangedBox *
2.12
50 REM * by Adrian Philip Look *
2.12
60 REM * 22nd August 1989 *
2.12
70 REM *************************
2.12
80
2.12
90 MODE 12 : OFF
2.12
100
2.12
110 PROCenablecalulations
2.12
120 PROCresetrectangle
2.12
130
2.12
140 LINE 400,400,600,600
2.12
150 PROCreadbox
2.12
160 RECTANGLE FILL 300,300,10,10
2.12
170 PROCreadbox
2.12
180 RECTANGLE FILL 700,700,30,30
2.12
190 PROCreadbox
2.12
200 CIRCLE 250,250,200
2.12
210 PROCreadbox
2.12
220 RECTANGLE 550,450,500,300
2.12
230 PROCreadbox
2.12
240
2.12
250 PROCdisablecalulations : ON
2.12
260 PRINT
2.12
270 END
2.12
280
2.12
290 DEFPROCresetrectangle
2.12
300 SYS öOS_ChangedBoxò,2
2.12
310 ENDPROC
2.12
320
2.12
330 DEFPROCenablecalulations
2.12
340 SYS öOS_ChangedBoxò,1
2.12
350 ENDPROC
2.12
360
2.12
370 DEFPROCdisablecalulations
2.12
380 SYS öOS_ChangedBoxò,0
2.12
390 ENDPROC
2.12
400
2.12
410 DEFPROCreadbox
2.12
420 PROCdisablecalulations
2.12
430 SYS öOS_ChangedBoxò,-1 TO ,data%
2.12
440 x0%=data%!4: y0%=data%!8
2.12
450 x1%=data%!12 : y1%=data%!16
2.12
460
2.12
470 PRINTTAB(0,0);öChanged Box
2.12
Rectangle (in pixels not
2.12
OS coords)ö
2.12
480 PRINTöleft x: ò;x0%;ö ò
2.12
490 PRINTöbottom y: ò;y0%;ö ò
2.12
500 PRINTöright x: ò;x1%;ö ò
2.12
510 PRINTötop y: ò;y1%;ö ò
2.12
520
2.12
530 PRINTÉöpress any key to step
2.12
through demoö
2.12
540 QQ=GET
2.12
550 PROCenablecalulations
2.12
560 ENDPROC
2.12
Å ProArtisan & Artisan upgrades to RISC-OS Ö ProArtisan discs need to
be changed so that they work under RISC-OS. This upgrade avoids the
dreaded öFilecore in useò error, and is available from Clares Micros if
you send them a blank D-formatted disc.
2.12
Å RISC-OS printer drivers and Line Feeds Ö If your printer does not
automatically generate line feeds when it receives a carriage return you
can make the RISC printer drivers generate one for you. Once the printer
drive is installed on you must click on the printer icon with the SELECT
button. This will reveal a window which contains an option to convert
single line feeds or carriage returns into a single line feed and
carriage return i.e. CR or LF => CR,LF.
2.12
If you wish to make this option permanent just select the ÉSave Choicesæ
option on the printer driver menu.
2.12
Å RISC-OS will run old WIMP programs (i.e. it emulates the Arthur 1.2
Window Manager) but because the emulation is not complete there are some
anomalies with the sprite handling. (a) selected sprites are rendered
incorrectly (b) sprite are scaled according to the screen mode (this did
not happen before). In practice, however, this affects very few
applications.
2.12
Å The *CDIR command for the ADFS, RAMFS, and NETFS now creates
unlocked directories. This means that directories can be renamed, moved
and deleted from the desktop. However, the contents of a directory must
be deleted before the directory itself can be deleted.
2.12
Å The Window Manager (RISC-OS) no longer reserves 32k permanent memory
for window definitions, etc but acquires memory from the RMA as it is
needed. This means that some Arthur 1.2 wimp programs may fail to start,
giving a ÉNo room to create windowæ error. This can usually be solved by
increasing the memory allocated to the RMA (by dragging the RMA bar in
the Task Manager) before starting the application.
2.12
The following hints and tips were sent in by Paul Witheridge
2.12
Å Cancelling tasks from the öTask Displayò Ö If you call up the Task
Display by clicking the mouse menu button on the Task Manager Icon at
the right-hand end of the icon bar and then selecting Task Display from
the resulting menu, you will get, among other things, a one line display
for each active task, showing the name of the task and how much memory
it uses.
2.12
If you position the pointer on that display line and click menu again,
you will see a very similar menu, but this time there is a menu item for
the task in question. This menu item has a sub-menu arrow. If you move
the pointer onto it, you will be rewarded with a sub-menu with a just a
single item, öQuitò. Clicking on this will usually, but not always,
cause the task to terminate.
2.12
From the programmeræs point of view, the next time the task in question
issues a Wimp_Poll request, it will receive a reason code 18 with a
subordinate code of 8 in the fifth word of the parameter block. It
should interpret this as a directive to terminate.
2.12
Å Command files from within an Obey file Ö One of the main differences
between Command files and Obey files is that input from a Command file
can be passed to the OS Command Line Interpreter or to an application,
while input from an Obey file is only passed to the Command Line
Interpreter. This means that when an application program is started up
by a RUN command in an Obey file, the following line of the Obey file
will always be treated as a command and never as input to the appli
cation program. For example if the following is an Obey file:
2.12
Dir ADFS:$.BasPgms
2.12
BASIC
2.12
Dir ADFS:$
2.12
Then the second DIR command will be executed after quitting from BASIC.
If, instead, the file is a Command file, then as soon as BASIC starts up
it will read the öDir ADFS:$ò as input (and since it does not begin with
an asterisk, it will not understand it and treat it as a mistake).
2.12
You can use a combination of Obey and Command files to start up an
application program and provide it with an initial set of input data.
This can be very useful, but to be successful, you must know a little
more about what happens when a Command file is executed from within an
Obey file. Consider the following example:
2.12
| > ObeyFile
2.12
Echo Output 1 from ObeyFile
2.12
Exec CmndFile
2.12
Echo Output 2 from ObeyFile
2.12
| > CmndFile
2.12
Echo Output from CmndFile
2.12
When the Obey file is run, the following output is produced:
2.12
Output 1 from ObeyFile
2.12
Output 2 from ObeyFile
2.12
* | > CmndFile
2.12
* Echo Output from CmndFile
2.12
Output from CmndFile
2.12
From this output, you can see that despite the fact that the öExec
CmndFileò command came between the two öEchoò commands in the Obey file,
the contents of the Command file were not actually executed until the
Obey file was finished with. The Command Line Interpreter obviously
gives precedence to Obey files over Command files. All that the EXEC
command did was to open the Command file for input and assign the system
input stream to it. It did not actually read anything from it. This was
left to the Command Line Interpreter, but it did not resume reading from
the system input stream until it had exhausted the Obey file.
2.12
Since application programs can take input from a Command file, but not
from an Obey file, an EXEC command can be used within an Obey file to
östackò input ready for an application program. The following example of
an Obey file and a Command file can be used to create a RISC-OS
application for the Basic Editor:
2.12
| > !BasicEdit.!Run
2.12
If ö<System$Path>ò = öò then Error 0 System resources cannot be found
RMensure ARMBasicEditor 1.00 RMload System:Modules.BasicEdit
2.12
Key 2 EDIT .|M
2.12
Key 4 *QUIT|M
2.12
Wimpslot -min 100k
2.12
Exec <Obey$Dir>.!Init
2.12
Basic -load %*0
2.12
*| > !BasicEdit.!Init
2.12
EDIT
2.12
Both files should reside in a application directory called ö!BasicEditò.
An accompanying ö!spritesò file would be nice, but is not essential
since in its absence, RISC-OS will use the default sprite for an
application.
2.12
The öExec <Obey$Dir>.!Initò command in the Obey file opens the Command
file and when the following öBasic -load %*0ò command executes, BASIC
reads the contents of the Command file as if it were being entered from
the keyboard.
2.12
If you double-click on the icon for ö!BasicEditò in a directory viewer,
the Basic Editor is started up ready to create a new program. If you
install ö!BasicEditò on the icon bar using TinyDirs, you can drag the
icon for a BASIC program from a directory viewer to the ö!BasicEditò
icon on the icon bar, which will start up the Basic Editor and load the
program into it ready to edit.
2.12
The following example consists of an Obey file and a Command file to
start up Twin as an application and to change the default colours used
by twin from white on black to blue on cyan. The contents of the Obey
file, which is the !Run file in the !Twin application directory, are:
2.12
| > !Twin.!Run
2.12
WimpSlot -min 100k
2.12
Load ADFS:%%.Twin 8000
2.12
Exec <Obey$Dir>.!Init
2.12
Go 8000 ; %*0
2.12
and the contents of the Command file, which is named ö!Initò and also
resides in the !Twin directory, are (in the notation used for *BUILD
etc):
2.12
|!|A|S|@|F|@|@|@|S|A|D|@|@|@
2.12
The Obey file assumes that Twin resides in the current ADFS library,
refering to it as öADFS:%%ò. öADFSò must be specified in case the ADFS
is not the current filing system and ö%%ò will be replaced by a single
percentage sign by the argument substitution process for Obey files.
Twin is loaded at &8000 because in a RISC-OS multi-tasking environment,
the amount of storage available to start up TWIN is often not enough to
load it at its önormalò load address of &80000 (leading to the dreaded
error message: öNo writeable memory at this addressò). Note that loading
Twin at &8000 leaves no memory for starting up applications from within
Twin. Such applications would normally run at &8000 and utilise the
memory between &8000 and Twinæs normal load address at &80000).
2.12
The Command file seems to consist of unintelligible hieroglyphics. The
first character (shown as ö|!|Aò) is actually &81 and has the same
effect on Twin as pressing function key one. The remaining eight
characters (shown as ö|S|@|F|@|@|@|S|A|D|@|@|@ò) are equivalent to:
2.12
ctrl-S ctrl-@ ctrl-F ctrl-@ ctrl-@ ctrl-@
2.12
ctrl-S ctrl-A ctrl-D ctrl-@ ctrl-@ ctrl-@
2.12
which will have the same effect when read by Twin as the BASIC
statements:
2.12
VDU 19,0,5,0,0,0
2.12
VDU 19,1,4,0,0,0
2.12
mapping logical colour zero to physical colour five (cyan) and logical
colour one to physical colour four (blue).
2.12
As in the case of !BasicEdit, double clicking on the !Twin icon in a
directory viewer will start up Twin without any file loaded, while
installing !Twin on the icon bar via TinyDirs will allow dragging file
icons to the !Twin icon on the icon bar, starting up Twin and loading
the file.
2.12
Å Error signalling from within a machine code subroutine called from
BASIC ÖUnder BASIC V version 1.04, it is simple to signal an error
condition from a machine code subroutine by setting the over-flow flag
and loading register zero with a pointer to an error block before
returning to BASIC.
2.12
Consider these two, almost identical examples:
2.12
The first assembles and calls a machine code subroutine that points
register zero to an error block (see line 70) and then returns to BASIC
with the overflow flag cleared (see line 80). This program terminates
normally without an error:
2.12
10 REM > Example1
2.12
20
2.12
30 DIM code% 100
2.12
40 FOR pass% = 0 TO 3 STEP 3
2.12
50 P%=code%
2.12
60 [OPT pass%
2.12
70 ADR R0,errblk
2.12
80 BICS PC,R14,#&10000000
2.12
90 .errblk EQUD 99
2.12
100 EQUS öI am an error messageò
2.12
110 EQUB 0
2.12
120 ]:NEXT
2.12
130 ON ERROR PROCerror
2.12
140 CALL code%
2.12
150 END
2.12
160 :
2.12
170 DEF PROCerror
2.12
180 PRINT öNmbr=ò; ERR
2.12
190 PRINT öText=ò; REPORT$
2.12
200 PRINT öLine=ò; ERL
2.12
210 END
2.12
220 ENDPROC
2.12
The second example is exactly the same except that it sets the overflow
flag (see line 80) before returning to BASIC:
2.12
10 REM > Example2
2.12
20
2.12
30 DIM code% 100
2.12
40 FOR pass% = 0 TO 3 STEP 3
2.12
50 P%=code%
2.12
60 [OPT pass%
2.12
70 ADR R0,errblk
2.12
80 ORRS PC,R14,#&10000000
2.12
90 .errblk EQUD 99
2.12
100 EQUS öI am an error messageò
2.12
110 EQUB 0
2.12
120 ]:NEXT
2.12
130 ON ERROR PROCerror
2.12
140 CALL code%
2.12
150 END
2.12
160 :
2.12
170 DEF PROCerror
2.12
180 PRINT öNmbr=ò; ERR
2.12
190 PRINT öText=ò; REPORT$
2.12
200 PRINT öLine=ò; ERL
2.12
210 END
2.12
220 ENDPROC
2.12
In this second case, an error occurs, which is trapped by the ON ERROR
statement (see line 130) and results in the following lines being
printed by PROCerror:
2.12
Nmbr=99
2.12
Text=I am an error message
2.12
Line=140
2.12
This use of the overflow flag can result in unexpected behaviour from
some programs. For example, if the last SWI call in a machine code
subroutine returns with the overflow flag set, indicating an error
occurred during the execution of the SWI, and this flag is not reset
before the subroutine returns to BASIC, then BASIC will take this as an
error condition. Exactly what happens depends on the contents of
register zero. If it points to a valid error block, then BASICæs error
trapping mechanism will function properly. Otherwise unpredictable
errors (such as an address exception) will happen.
2.12
Å New SWI calls in RISC-OS Ö The following program can be used to list
all the SWI calls available in OS. It basically works by calling the
öOS_SWINumberToStringò SWI for all possible SWI numbers and displaying
the returned string. To speed things up it checks to see if the first
SWI in a each chunk of 64 is valid. If not, it ignores the rest of the
chunk. öValidò in this case means that the SWI name is neither
öOS_Undefinedò nor öUserò. SWI names beginning with öXò are also ignored
as duplicates.
2.12
10 REM > SWIlist
2.12
20 :
2.12
30 buflen%=100
2.12
40 DIM buffer% buflen%
2.12
50 :
2.12
60 SYS öOS_SWINumberFromStringò,,
2.12
öXOS_SWINumberToStringò TO S%
2.12
70 :
2.12
80 VDU 14
2.12
90 :
2.12
100 FOR chunk% = 0 TO &80000 STEP 64
2.12
110 SYS S%,chunk%,buffer%,buflen%
2.12
TO ,swi$;V%
2.12
120 IF V%AND1 ELSE IF LEFT$(swi$,1)
2.12
=öXò ELSE IF swi$ =öUserò ELSE IF swi$<>öOS_Undefinedò PROCchunk
2.12
130 NEXT
2.12
140 :
2.12
150 VDU15
2.12
160 :
2.12
170 END
2.12
180
2.12
190 DEFPROCchunk
2.12
200 FOR swi% = chunk% TO chunk%+63
2.12
210 SYS S%,swi%,buffer%,buflen% TO
2.12
,swi$;V%
2.12
220 IF V%AND1 ELSE IF LEFT$(swi$,1)
2.12
=öXò ELSE IF swi$=öUserò ELSE IF swi$<>öOS_Undefinedò PRINT öSWI number
ò;RIGHT$(ö0000ò+
2.12
STR$~swi%,5);ö is ò;swi$
2.12
230 NEXT
2.12
240 ENDPROC
2.12
If this program is run, a list of SWIs is generated. Those for the
FPemulator and ColourTrans will only be listed if the relevant Relocat
able Module is loaded when SWIlist is run. Those for RamFS will only be
listed if the RAM disc is configured.
2.12
The program was also run against Arthur 1.2 and by comparing the two
listings, it was possible to identify those SWIs which appeared in the
RISC-OS listing but not in that for Arthur. These are presumably new
SWIs and are listed below.
2.12
00049 OS_ReadArgs
2.12
0004A OS_ReadRAMFsLimits
2.12
0004B OS_ClaimDeviceVector
2.12
0004C OS_ReleaseDeviceVector
2.12
0004D OS_DelinkApplication
2.12
0004E OS_RelinkApplication
2.12
0004F OS_HeapSort
2.12
00050 OS_ExitAndDie
2.12
00051 OS_ReadMemMapInfo
2.12
00052 OS_ReadMemMapEntries
2.12
00053 OS_SetMemMapEntries
2.12
00054 OS_AddCallBack
2.12
00055 OS_ReadDefaultHandler
2.12
00056 OS_SetECFOrigin
2.12
00057 OS_SerialOp
2.12
00058 OS_ReadSysInfo
2.12
00059 OS_Confirm
2.12
0005A OS_ChangedBox
2.12
0005B OS_CRC
2.12
0005C OS_ReadDynamicArea
2.12
0005D OS_PrintChar
2.12
000EB OS_ConvertFixedFileSize
2.12
000EC OS_ConvertFileSize
2.12
00240 IIC_Control
2.12
40098 Font_ReadColourTable
2.12
400DE Wimp_StartTask
2.12
400DF Wimp_ReportError
2.12
400E0 Wimp_GetWindowOutline
2.12
400E1 Wimp_PollIdle
2.12
400E2 Wimp_PlotIcon
2.12
400E3 Wimp_SetMode
2.12
400E4 Wimp_SetPalette
2.12
400E5 Wimp_ReadPalette
2.12
400E6 Wimp_SetColour
2.12
400E7 Wimp_SendMessage
2.12
400E8 Wimp_CreateSubMenu
2.12
400E9 Wimp_SpriteOp
2.12
400EA Wimp_BaseOfSprites
2.12
400EB Wimp_BlockCopy
2.12
400EC Wimp_SlotSize
2.12
400ED Wimp_ReadPixTrans
2.12
400EE Wimp_ClaimFreeMemory
2.12
400EF Wimp_CommandWindow
2.12
400F0 Wimp_TextColour
2.12
400F1 Wimp_TransferBlock
2.12
400F2 Wimp_ReadSysInfo
2.12
400F3 Wimp_SetFontColours
2.12
401C7 Sound_QInterface
2.12
40244 ADFS_Retries
2.12
40245 ADFS_DescribeDisc
2.12
40289 Podule_HardwareAddress
2.12
40540 FileCore_DiscOp
2.12
40541 FileCore_Create
2.12
40542 FileCore_Drives
2.12
40543 FileCore_FreeSpace
2.12
40544 FileCore_FloppyStructure
2.12
40545 FileCore_DescribeDisc
2.12
405C0 Shell_Create
2.12
405C1 Shell_Destroy
2.12
406C0 Hourglass_On
2.12
406C1 Hourglass_Off
2.12
406C2 Hourglass_Smash
2.12
406C3 Hourglass_Start
2.12
406C4 Hourglass_Percentage
2.12
406C5 Hourglass_LEDs
2.12
40700 Draw_ProcessPath
2.12
40701 Draw_ProcessPathFP
2.12
40702 Draw_Fill
2.12
40703 Draw_FillFP
2.12
40704 Draw_Stroke
2.12
40705 Draw_StrokeFP
2.12
40706 Draw_StrokePath
2.12
40707 Draw_StrokePathFP
2.12
40708 Draw_FlattenPath
2.12
40709 Draw_FlattenPathFP
2.12
4070A Draw_TransformPath
2.12
4070B Draw_TransformPathFP
2.12
40780 RamFS_DiscOp
2.12
40781 RamFS_NOP
2.12
40782 RamFS_Drives
2.12
40783 RamFS_FreeSpace
2.12
40784 RamFS_NOP
2.12
40785 RamFS_DescribeDisc
2.12
40740 ColourTrans_SelectTable
2.12
40741 ColourTrans_SelectGCOLTable
2.12
40742 ColourTrans_ReturnGCOL
2.12
40743 ColourTrans_SetGCOL
2.12
40744 ColourTrans_ReturnColourNumber
2.12
40745 ColourTrans_ReturnGCOLForMode
2.12
40746 ColourTrans_ReturnColourNumber
2.12
ForMode
2.12
40747 ColourTrans_ReturnOppGCOL
2.12
40748 ColourTrans_SetOppGCOL
2.12
40749 ColourTrans_ReturnOppColour
2.12
Number
2.12
4074A ColourTrans_ReturnOppGCOLFor
2.12
Mode
2.12
4074B ColourTrans_ReturnOppColour
2.12
NumberForMode
2.12
4074C ColourTrans_GCOLToColourNumber
2.12
4074D ColourTrans_ColourNumberToGCOL
2.12
4074E ColourTrans_ReturnFontColours
2.12
4074F ColourTrans_SetFontColours
2.12
40750 ColourTrans_InvalidateCache
2.12
Å Starting up TinyDirs automatically via the Desktop initialisation
file Ö Archive 2.10 p 15, refers to the facility whereby the Desktop
can be caused to run a file of initialisation commands at start-up time.
One command that can be included in this file is a command to start up
TinyDirs and automatically install high-use directories or applications
on the icon bar.
2.12
TinyDirs accepts multiple arguments on the command, separated by blanks.
So, if you created two application directories for, say, the Basic
Editor and Twin, you could include the following command in the Desktop
startup file (assuming that the name of the disc where !TinyDirs,
!BasicEdit and !Twin all reside is öSysDiscò):
2.12
Run ADFS::SysDisc.$.!TinyDirs ADFS::SysDisc.$.!BasicEdit
ADFS::SysDisc.$.!Twin
2.12
Although two icons will be installed on the icon bar, only one copy of
the TinyDirs application is started up. If two separate commands had
been used:
2.12
Run ADFS::SysDisc.$.!TinyDirs ADFS::SysDisc.$.!BasicEdit
2.12
Run ADFS::SysDisc.$.!TinyDirs ADFS::SysDisc.$.!Twin
2.12
then, although the icon bar would look exactly the same, with the same
two icons installed, two copies of TinyDirs would have been started up,
using twice the memory.
2.12
It also seems safe to reduce the memory required by TinyDirs from 32k to
24k by altering the WimpSlot command in the !Run file for TinyDirs to
2.12
WimpSlot -min 24k -max 24k
2.12