home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Archive Magazine 1997
/
ARCHIVE_97.iso
/
text
/
hints
/
vol_02
/
issue_12
< prev
Wrap
Text File
|
1995-02-16
|
34KB
|
1,257 lines
Å 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