home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Archive Magazine 1995
/
ARCHIVE95.iso
/
text
/
hints
/
volume_03
/
issue_09
< prev
next >
Wrap
Text File
|
1995-02-16
|
31KB
|
1,065 lines
3.9
Å Clear a line Ö To clear a text input in an editable field, press
<ctrl-U>. For example, you can use this to clear the filename before
typing a new entry. Philip Armstrong
3.9
Å !Draw Ö Someone mentioned converting sprite images to object
orientated !Draw images. I have used a graph program and converted the
sprite it created to a !Draw file by zooming up and drawing over the
sprite. If you keep to, say, the bottom left of each pixel, it works OK
and gives a much better printed image.
3.9
To get vertical and horizontal lines, use the edit coordinated facility.
Get one end correct then note its x or y location and then edit the
other end to match it.
3.9
If you have typed some incorrect text into a draw file, for example ÉFig
4.5æ needs to be changed to ÉFig 4.6æ, then you would normally have to
re-type the line and be careful to locate it in the same place. If
characters are changed leaving the string length the same then you could
use !Edit to search and replace the text, once the draw file has been
dragged onto the !Edit icon. Strings could also be padded out with
spaces if a shorter replace string is required, but for a longer string
it is usually easier to re-type in !Draw. Philip Armstrong
3.9
Å DXF files Ö Inclusion of a 41 group in TEXT entities permits
characters with varying aspect ratios. A value of 0.5 matches the system
fonts. Jim Markland.
3.9
Å Elektor sound sampler Ö In Decemberæs issue of the Netherlands
edition of Elektor (November in the U.K. edition) they published a
D.I.Y. sound sampler podule. This podule has been built freq-uently but
there is one small problem. There are no commands provided to use the
sampler so it is difficult to use it in your own software. I decided
therefore to write a module.
3.9
The module makes use of a timer within the 6522 on the board. This
results in a very accurate sample-time. To make use of the module, you
need to set a jumper on the podule which connects the 6522-IRQ-line to
the FIQ-line of the Archimedes.
3.9
Holding the podule with the 64-way-connector towards you and the print
header at the right, you can place the jumper vertically at the right
bottom of the print header.
3.9
Now you can use the module. There is a SWI included:
3.9
ElektorSampler_Sample (&500)
3.9
R0 = Start address of the sample buffer
3.9
R1 = End address of the sample buffer
3.9
R2 = Sample time in ╡s
3.9
R3 = Minimum level to start sampling
3.9
R4 : bit 0: This bit defines the quality of the sample. Low quality
sampling must be used unless you are prepared to allow the screen to be
disabled. 0 = high quality sampling, 1 = low quality sampling.
3.9
bit 1: This bit defines whether the low order byte of the address
where the sample is written to, must be placed on the userport or not.
This enables you to take multi-channel samples (e.g. stereo) using an
analogue multiplexer (e.g. HEF 4051). When youære not using this option,
leave the bit É0æ. 0 = no output to the userport, 1 = output to the
userport
3.9
Leave unused bits É0æ for upward compatibility
3.9
After calling this SWI, the screen will be disabled during the sampling.
While waiting for the minimum level, the border will be coloured yellow
Ö whilst sampling, the border will be red. As long as the border is
yellow, you can quit by pressing <escape>. The buffer will be filled
with linear 8-bit signed numbers.
3.9
The minimum sample-time that can be used on a normal Archimedes is about
9 ╡s. The minimum sample-time that can be used with the ZN427 (the ADC)
is approx. 12 ╡s.
3.9
The module could be used with the Armadeus sampler if Armadeus software
were suitably modified. Since Armadeus is written in BASIC this should
be possible.
3.9
As far as Iæm concerned this module may be copied freely provided that
my name, as author, remains within the software.
3.9
Questions or suggestions? You can contact me via Archive.
3.9
To conserve space, we have stripped the comments out of this listing.
The full commented listing is available on the monthly program disc.
3.9
10 REM >SamplerSrc
3.9
20 REM Written by J.P.Hendrix
3.9
30 start=4:end=10:speed=9:ioc=8
3.9
:rd427=5:wr427=6:bs6522=7:level=11
3.9
:flags=12
3.9
40 DIM Code 1000
3.9
50 FOR Pass=4 TO 7 STEP 3
3.9
60 P%=0
3.9
70 O%=Code
3.9
80 [ OPT Pass
3.9
90 EQUD 0
3.9
100 EQUD 0
3.9
110 EQUD 0
3.9
120 EQUD 0
3.9
130 EQUD Title
3.9
140 EQUD Help
3.9
150 EQUD 0
3.9
160 EQUD &500
3.9
170 EQUD Handler
3.9
180 EQUD Table
3.9
190 EQUD 0
3.9
200
3.9
210 EQUS öElektor Sampler
3.9
Module 1.03 (c) copyright
3.9
22 Apr 1990 by J.P. Hendrixö
3.9
220
3.9
230 .YelBorder
3.9
240 EQUB 0
3.9
250 EQUB 24
3.9
260 EQUB 255
3.9
270 EQUB 255
3.9
280 EQUB 0
3.9
290 ALIGN
3.9
300
3.9
310
3.9
320 .Handler
3.9
330 STMFD R13!,{r0-r12 ,R14}
3.9
340 CMP R11,#&00
3.9
350 BNE UnknownSWI
3.9
360 MOV flags,R4
3.9
370 MOV start,R0
3.9
380 MOV end,R1
3.9
390 MOV speed,R2,LSL #1
3.9
400 SUB speed,speed,#2
3.9
410 AND level,R3,#&7F
3.9
420 STMFD R13!,*{t ,end,speed}
3.9
430 SWI öI/O_Podule_Hardwareò
3.9
440 BIC R0,R1,#&00FF0000
3.9
450 ORR wr427,R0,#%000<<11
3.9
460 ORR rd427,R0,#%010<<11
3.9
470 ORR bs6522,R1,#%101<<11
3.9
480 MOV ioc,#&3200000
3.9
490 STMFD R13!,{wr427 ,rd427,
3.9
bs6522,ioc}
3.9
500
3.9
510 MOV R0,#0
3.9
520 MOV R1,#3072
3.9
530 TST flags,#1
3.9
540 SWIEQ öXOS_UpdateMEMCò
3.9
550
3.9
560 MOV R0,#0
3.9
570 MOV R1,#24
3.9
580 SWI öOS_ReadPaletteò
3.9
590 ADR R0,OrgColour
3.9
600 MOV R2,R2,LSR #8
3.9
610 STRB R2,[R0,#2]!
3.9
620 MOV R2,R2,LSR #8
3.9
630 STRB R2,[R0,#1]!
3.9
640 MOV R2,R2,LSR #8
3.9
650 STRB R2,[R0,#1]!
3.9
660
3.9
670 MOV R0,#12
3.9
680 ADR R1,YelBorder
3.9
690 SWIEQ öOS_Wordò
3.9
700
3.9
710 MOV R1,#&0C
3.9
720 SWI öOS_ServiceCallò
3.9
730
3.9
740 LDMFD R13!,{wr427 ,rd427,
3.9
bs6522,ioc}
3.9
750
3.9
760 MOV R0,#&00
3.9
770 STRB R0,[ioc,#&38]
3.9
780
3.9
790
3.9
800 MOV R0,#SamplerEnd-
3.9
SamplerBegin
3.9
810 MOV R1,#&1C
3.9
820 ADR R2,SamplerBegin
3.9
830 .PokeLoop
3.9
840 LDR R3,[R2,R0]
3.9
850 STR R3,[R1,R0]
3.9
860 SUBS R0,R0,#4
3.9
870 BPL PokeLoop
3.9
880
3.9
890 LDMFD R13!,*{t ,end,speed}
3.9
900
3.9
910
3.9
920 TST flags,#2
3.9
930 MOV R0,#255
3.9
940 MOVEQ R0,#0
3.9
950 STRB R0,[bs6522,#02*4]
3.9
960 AND R0,speed,#&FF
3.9
970 STRB R0,[bs6522,#06*4]
3.9
980 MOV R0,speed,LSR #8
3.9
990 STRB R0,[bs6522,#07*4]
3.9
1000 MOV R0,#&40
3.9
1010 STRB R0,[bs6522,#11*4]
3.9
1020 MOV R0,#&00
3.9
1030 STRB R0,[bs6522,#13*4]
3.9
1040 MOV R0,#&C0
3.9
1050 STRB R0,[bs6522,#14*4]
3.9
1060 AND R0,speed,#&FF
3.9
1070 STRB R0,[bs6522,#04*4]
3.9
1080
3.9
1090 STRB R0,[wr427]
3.9
1100 .WaitLevel
3.9
1110 SWI öOS_ReadEscapeStateò
3.9
1120 BCS Exit
3.9
1130
3.9
1140 LDRB R0,[rd427]
3.9
1150 STRB R0,[wr427]
3.9
1160 TST R0,#&80
3.9
1170 RSBEQ R0,R0,#&100
3.9
1180 AND R0,R0,#&7F
3.9
1190 CMP level,R0
3.9
1200 BHI WaitLevel
3.9
1210 STRB R0,[wr427]
3.9
1220
3.9
1230 SWI öOS_IntOffò
3.9
1240
3.9
1250 TST flags,#1
3.9
1260 MOV R0,#12
3.9
1270 ADR R1,RedBorder
3.9
1280 SWIEQ öOS_Wordò
3.9
1290
3.9
1300 MOV R0,speed,LSR #8
3.9
1310 STRB R0,[bs6522,#05*4]
3.9
1320
3.9
1330 MOV R0,#&40
3.9
1340 STRB R0,[ioc,#&38]
3.9
1350 .SampleLoop
3.9
1360 CMP end,start
3.9
1370 BPL SampleLoop
3.9
1380
3.9
1390 MOV R0,#&00
3.9
1400 STRB R0,[ioc,#&38]
3.9
1410 .Exit
3.9
1420 MOV R0,#&7F
3.9
1430 STRB R0,[bs6522,#14*4]
3.9
1440 MOV R0,#&00
3.9
1450 STRB R0,[bs6522,#13*4]
3.9
1460
3.9
1470 MOV R1,#&0B
3.9
1480 SWI öOS_ServiceCallò
3.9
1490 SWI öOS_IntOnò
3.9
1500
3.9
1510 MOV R0,#0
3.9
1520 STRB R0,[bs6522,#02*4]
3.9
1530
3.9
1540 MOV R0,#3072
3.9
1550 MOV R1,#3072
3.9
1560 TST flags,#1
3.9
1570 SWIEQ öOS_UpdateMEMCò
3.9
1580
3.9
1590 MOV R0,#12
3.9
1600 ADR R1,OrgColour
3.9
1610 SWIEQ öOS_Wordò
3.9
1620
3.9
1630 MOV R0,#124
3.9
1640 SWI öOS_Byteò
3.9
1650
3.9
1660 LDMFD R13!,{r0-r12 ,PC}^
3.9
1670
3.9
1680 .UnknownSWI
3.9
1690 LDMFD R13!,{r0-r12 ,R14}
3.9
1700 ADR R0,Error
3.9
1710 ORRS PC,R14,#2^28
3.9
1720
3.9
1730 .SamplerBegin
3.9
1740 STRB start,[bs6522,#00*4]
3.9
1750 LDRB R0,[rd427]
3.9
1760 EOR R0,R0,#&80
3.9
1770 STRB R0,[start],#1
3.9
1780 MOV R0,#&C0
3.9
1790 STRB R0,[bs6522,#13*4]
3.9
1800 STRB R0,[wr427]
3.9
1810 SUBS PC,R14,#4
3.9
1820 .SamplerEnd
3.9
1830
3.9
1840 .OrgColour
3.9
1850 EQUB 0
3.9
1860 EQUB 24
3.9
1870 EQUB 0
3.9
1880 EQUB 0
3.9
1890 EQUB 0
3.9
1900 .RedBorder
3.9
1910 EQUB 0
3.9
1920 EQUB 24
3.9
1930 EQUB 255
3.9
1940 EQUB 0
3.9
1950 EQUB 0
3.9
1960
3.9
1970 .Table
3.9
1980 .Title EQUS öElektorSamplerò
3.9
+CHR$(0)
3.9
1990 EQUS öSampleò+CHR$(0)
3.9
+CHR$(0)
3.9
2000 .Help
3.9
2010 EQUS öElektor Samplerò+CHR$
3.9
(9)+ö1.03 (22 Apr 1990)ò+CHR$(0)
3.9
2020 .Error
3.9
2030 EQUD 1
3.9
2040 EQUS öUnknown Sampler SWIò
3.9
+CHR$(0)
3.9
2050 ]
3.9
2060 NEXT
3.9
2070
3.9
2080 SYS öOS_Fileò,10,öElektorSamò
3.9
,&FFA,,Code,O%
3.9
Å Extra Speed in high res modes Ö You can use SWI öOS_UpdateMEMCò to
deny VIDC DMA access to the video RAM, which returns to the processor
the bus bandwidth that was being used by the video system. Turning off
VIDCæs access to the memory blanks the screen but makes the machine go
faster even than in MODE 0. To kill VIDCæs access to memory: SYS
öOS_UpdateMEMCò,0, 1024 To re-enable access use SYS öOS_Update
MEMCò,1024,1024.
3.9
While the screen is thus disabled, you can still write to it as normal
and the results will be there when it is switched back on. This short
program shows the enormous speed gains possible (49% in MODE 15, 120% in
MODE 24) Ö it can reduce by a third, the time taken for a MODE 15 ray
trace. Sean Kelly
3.9
10 mode=MODE
3.9
20 MODE 0
3.9
30 I%=0: T%=TIME
3.9
40 REPEAT: I%+=1: UNTIL TIME>=T%+100
3.9
50 MODE mode
3.9
60 J%=0: T%=TIME
3.9
70 REPEAT: J%+=1: UNTIL TIME>=T%+100
3.9
80 SYS öOS_UpdateMEMCò,0,1<<10
3.9
90 K%=0: T%=TIME
3.9
100 REPEAT: K%+=1: UNTIL TIME>=T%+100
3.9
110 SYS öOS_UpdateMEMCò,1<<10,1<<10
3.9
120 PRINTÉöLoops per second:òæ
3.9
130 PRINTöNormal mode 0 ò;I%
3.9
140 PRINTöNormal mode ò;mode;ö ò;J%
3.9
150 PRINTöBlanked mode ò;mode;ö ò;K%
3.9
160 PRINTöSpeed up ò;(K%-J%)/J%*100
3.9
;ö%ò
3.9
Å FormEd Ö I was very interested to see the tip on !FormEd in the May
issue of Archive which really does make it easier to use. However, there
is a slight snag with it as published as it is possible to close the
sprite viewing window which cannot then be re-opened. Also, it is
possible to activate the ÉToolæ window which allows editing of the
sprites if the following changes are made to the !RunImage file.
3.9
1890 DATA öLoad templates>m_templates%
3.9
,Save templates>m_Savetemp%, Show Sprites, Show Toolbox#, Quitö
3.9
3090 ELSE PROCmergesprites (FNstring0
3.9
(q%+44)):PROCspriteinfo
3.9
9781 WHEN 4 : PROCspriteinfo
3.9
9782 WHEN 5 : PROCencodepal (0,15) :
3.9
PROCfront (palette%) : PROChtpal
3.9
9790 WHEN 6 : PROCfinish : END
3.9
Line 1890 adds two new options to the iconbar menu (ÉShow Spritesæ and
ÉShow Toolboxæ). Line 3090 has the REM removed which allows merging of
sprite files. Lines 9781 and 9782 are new and implement the opening of
the sprite and tool win-dows. Line 9790 needs changing as ÉQuitæ is now
the sixth item on the menu.
3.9
Some of the sprite editing routines seem to be miss-ing from the
!RunImage file (such as the Éspray canæ) so I just created a new blank
sprite and altered the template file so that the non-working options
donæt appear!
3.9
As noted in the magazine, !Paint is better for creating sprites but
these simple changes make !FormEd much more useful. One benefit is that
the sprites edited in !FormEd are displayed in the windows where they
will actually appear when the application runs. Paul Hobbs
3.9
Å Function key strips Ö In the past, many have tried to write a
program which generates one or more function key-strips. In most cases,
the graph-ics were not quite satisfying. When using MS-DOS software, the
problem arises that you really need four rows (instead of the standard
three) to cater for all possibilities: F-key, <shift-F-key>, <ctrl-F-
key> and <alt-F-key>. To solve this problem I have made two draw-files,
one for a 3-row function key-strip and one for a 4-row function key-
strip.
3.9
Both files require the presence of the font ÉHom-erton.Mediumæ.
3.9
As an example, I have made a function key-strip for the MS-DOS program
WordPerfect version 4.2. This file also requires the presence of the
font ÉCor-pus.Mediumæ.
3.9
From where I stand, I find the result of the Drawfiles better than what
Iæve seen so far. (Available on the monthly program disc.) Maurice
Hendrix
3.9
Å Hard disc and memory usage Ö I was interested to read about module
killing in your First Word Plus column. I have a 1Mb machine and need
all the memory I can get, so I have already experimented with simple
module killing routines.
3.9
Firstly, I altered all my !run files to keep track of Clib, FPE and the
other common modules and kill them if they are no longer needed. This
used a sys-tem variable for each module that stored the number of
applications using it. This worked but had several drawbacks. The
changing of all !run files did take a lot of work and each application
left open its !run file until it was quit. As a result, I decided that
man-ual module killing or Resetting is a better solution. One interest
ing point highlighted by this, is that !Edit suffers a fatal error and
all work is lost if the FPE is killed even though it does not need it!
3.9
The one thing that I have found extremely useful is the setting up of a
good hard disc structure and a !boot file. This has saved memory both on
the disc due to duplication and when loading applications due to fewer
icons needed to be loaded. It has also given me quicker and easier
access to programs via the new task option.
3.9
One thing that should be noted by hard disc users is that although
directories allow a nice structure, they do use memory and also slow the
access to certain parts of the disc, so donæt go overboard creating
directories for everything.
3.9
I will try to explain the structure of my hard disc. I have in my root
directory the following directories and a !boot file.
3.9
!fonts Outline Fonts
3.9
!system System Modules
3.9
Art Artisan, !Paint etc
3.9
Cad !Draw etc
3.9
Games !Triv etc
3.9
Library Command line programs
3.9
Misc My working directory
3.9
Text/DTP !Edit, !Impress, !PrinterDM etc
3.9
Utilities !FormEd, !Hand, !Configure etc
3.9
Others could include Sound, spreadsheets and lang-uages etc. Try to keep
associated programs together but donæt have directories with lots of
applications as all the icons are loaded and waste memory. Keep commonly
used programs one level down and others in sub directories. This is
especially true for the utilities directory.
3.9
The next stage is to move all the commonly used modules into the
!system.modules directory. This avoids duplication, ensures a module
update is used by all programs and also simplifies things. The most
common modules found are FPEmulator and Clib. Well-written programs will
already use !System but some donæt and they will need their !run files
mod-ified. The rmload commands need to load from :4.$. !system.modules.
If the !run file does not contain the rmload commands it is probably
best to leave its modules where they are unless you know what you are
doing. Finding modules can be done using simple utilities such as !hand
(helping hand) from the Data Store to search for the file type &FFA.
3.9
Probably the most important part of a good hard disc setup is its !boot
file. This gives the user an ideal chance to customise their system. My
!boot file shown below sets up various system variables that perform a
range of functions.
3.9
| !Boot file for hard disc
3.9
| Set variables for directory abbrevs
3.9
Set r adfs::BigHardNo1.$.
3.9
SetMacro u <r>Utilities.
3.9
SetMacro a <r>ART.
3.9
SetMacro d <r>Text/DTP.
3.9
SetMacro g <r>GAMES.
3.9
SetMacro System$Path <r>!System.
3.9
SetMacro sm <r>!System.Modules
3.9
| Set Alias to emulate two common
3.9
Unix commands
3.9
Set Alias$LS Cat %0
3.9
Set Alias$CD Dir %0
3.9
| Setup directories to be searched
3.9
for a run command (using abbreviations to keep line
3.9
to <255 chars )
3.9
SetMacro Run$Path ,%.,<sm>.,<r>L*.,
3.9
<d>1*.,<r>CA*.,<a>,<d>,<r>M*.,
3.9
<d>PI*.,<r>PC.,<u>,<u>CT*.,<u>F*.,
3.9
<u>A*.,<u>B*.,<u>C*.,<u>D*.,
3.9
<u>FO*.,<u>L*.,<u>T*.,<u>M*.,<r>T*.,
3.9
<r>S*.,<g>I*.,<g>B*.,<g>A*.,<d>!i*.
3.9
| Setup directories to be searched
3.9
for a load command (using abbreviations to keep line
3.9
to <255 chars )
3.9
Setmacro File$Path ,%.,<sm>.,
3.9
<r>Library.,<u>L*.,<d>!i*.
3.9
| run common applications !boot files
3.9
to emulate the system seeing the application without cluttering
3.9
the $ dir.
3.9
<a>!Draw.!Boot
3.9
<a>!Paint.!Boot
3.9
<d>!Edit.!Boot
3.9
<d>!Impress.!Boot
3.9
<u>FILES.!SPARK.!BOOT
3.9
| set any commonly used key strings
3.9
Key 1 *DESKTOP|M
3.9
Key 2 EDIT|M
3.9
| run desktop and display root directory
3.9
Desktop Filer_OpenDir adfs::BigHardNo1.$
3.9
The !boot file starts by defining a series of system variables that are
to be used throughout the file. They include abbreviated variables to
represent commonly used pathnames. System$Path is also defined here.
3.9
The next section defines two aliasæs that emulate common Unix system
commands. This is only of use if you switch operating systems commonly
and tend to accidentally type in the wrong commands. A similar set could
also be set up for PC users although a clash of the ödirò command would
occur.
3.9
The next two sections are similar and set up the vari-ables Run$Path and
File$Path. Firstly, Run$Path can be used to define all the directories
that you wish to be searched when a run program command is issued.
Similarly File$Path does the same for loading files. They both include
the first path which refers to the current directory.
3.9
The system variables defined at the start have been used extensively and
the * wildcard to keep the line shorter than the 255 character maximum.
Be careful when using wildcards because a new directory could also match
the search instead of the intended directory. As an alternative to this,
a series of paths could be placed into system variables i.e. Run1$ Path,
Run2$Path etc and then added together to give the complete Run$Path. Be
careful when using sys-tem variables to get the correct punctuation.
Each path must end with a full stop ö.ò although this can been included
at the end of the system variables.
3.9
The main reason for doing this is to allow the user to use the öNew
Taskò option of the task menu. If all the directories are correctly
listed in this section, you will be able to enter ö!Editò into the öNew
Taskò option and the program will install itself onto the icon bar. This
eliminates the need to know where in the directory structure it is. The
same goes for loading a program or module. You can now tuck away those
little used programs and still call them up as long as you know their
name. The general effect is the same as if everything is in the library
although loading commands can also be used.
3.9
I have found it useful to emulate the system seeing commonly used
applications such as !Draw, !Paint and !Edit. To do this all you must do
is run each applicationæs !boot file. This will setup all the icons and
system variables. This means that, for example, a draw file can be
loaded without the application having being seen.
3.9
A Hard disc !boot file is also the ideal place to set up any commonly
used key strings as well as loading any important modules.
3.9
Finally, the desktop can be called and I find it useful to open up the
root directory. This can be done by the Filer_OpenDir command. Alterna
tively, another obey file can be run after the desktop has been entered
by the use of the -file option. If this is the case, it may be useful to
create an application called !boot and rename the !boot file to !run.
The second obey file can then be hidden inside this directory.
3.9
To create and set up the !boot file╔ (1) Run !Edit (2) Create obey file
(icon menu) (3) Type in !boot data (See above) (4) Save as !boot (in
root directory) (5) Press <f12> and type
3.9
OPT4,2
3.9
Configure drive 4
3.9
Configure boot
3.9
Philip Armstrong
3.9
Å Hourglass Ö A quick hint for those writing a BASIC program using the
Hourglass. Often, if an error is generated from BASIC when the hourglass
is being used, it stays on the screen. This can be cured by
SYSöHourglass_Smashò or, if you have already done your error checking,
SYSöò causes a system error which has the same effect. Philip Armstrong
3.9
Å INKEY problems Ö If you have a loop which executes continuously and
rapidly, you might want to use:
3.9
key%=INKEY(0):IF key%=64
3.9
PROC_Fred ELSE IF
3.9
key%=65 PROC_Edith
3.9
to detect a keypress. However, remember that you should have only one
such INKEY statement in the loop even if you want to cater for many
different key presses because a single keypress can only be det-ected by
one INKEY(0) instruction. Steve Kirkby.
3.9
Å Keyboard cleaning (A300/400 series) Ö The keyboard that is supplied
with the computer is of the open Printed Circuit Board type. That is, a
conduc-tive film on the base of each key makes contact with large solder
plated areas called lands on the main PCB. This makes for a cheap and
reliable keyboard but it does have its problems because of its exposure
to the air in that dust can and does get in.
3.9
Iæve had my Archimedes A310 for over 2 years now and my wife lets it
live in the living room with us. I suppose I should keep the keyboard
covered with something when not in use but Iæve never got round to doing
this. Consequently, the keyboard has had to put up with me eating
biscuits, sandwiches and other unmentionables while typing. I suppose
the inevitable had to happen and one day the keyboard rebelled! I had
began to noticed over a period of several days that the space bar and
left cursor key where playing up until they refused to work at all. Of
course, this happened a week after the guarantee had run out!
3.9
Visions of massive bills loomed before me so I decided to undertake the
task of opening the keyboard case and having a look! I first switched
off the Archimedes and unplugged the keyboard cord from the computer. I
removed the mouse and turned the keyboard face down with the Reset
button towards me. I noted that eight large, long hex screws held the
back section of the keyboard case on. After removing these I just lifted
the back section away and placed it somewhere safe. The Reset button
looked slight delicate so I removed it by simply pulling it off. I made
a mental note of which way round it came off.
3.9
I had a good look and there were seven large, short hex screws holding
the top keyboard casing to the main PCB frame. I removed these screws
and lifted the PCB off, putting the top casing away to another safe
place. I was half expecting the key tops and switches to try and escape
at this point but they are firmly attached to a metal frame!
3.9
Biscuit supply Ö Turning the PCB over and looking at the top surface
between the key tops I was amazed to see a surprising amount of dust and
what looked like a secret supply of Burtons biscuits! I duly removed
this with a dry paper towel and again placed the board face down after I
had a good look at the electronics on the board, but I resisted the
temptation to touch (I suggest you do the same).
3.9
All that now remained to do was remove the twenty small hex screws
holding the PCB to the switches. I started with the black screw at S94
position (this is written on the PCB) and noted that this was the only
small screw not actually threaded on to a switch. I removed the other
nineteen screws and gently lifted the PCB off the metal frame holding
the keys on.
3.9
The contact plates of all the key switches where now exposed and they
consisted of thin silver discs which when pressed make contact with the
PCB lands and therefore closed the contacts. These plates looked
extremely fragile but clean so I left them well alone!
3.9
Cleaning Ö The PCB lands were dirty, especially around the Space and
Left Cursor key positions and, being very careful not to put any grease
from my paws onto the board, I wiped the entire PCB with a dry paper
towel. Reassembling the keyboard was easy. I just placed the PCB face
down on to the metal frame holding the keys and lined up the small
screws positions. A good tip in reassembling something like this is to
begin placing the screws in from opposite ends and not to tighten up any
of the screws until they are all in place.
3.9
Once that was done, making sure that the black screw was in the correct
position, I placed the top section face down on the work table and
positioned the assembly down onto it, again fitting the seven large
short hex screws in place. I refitted the Reset moulding into place with
a resounding click and finished off by screwing down the last eight
large long hex screws into place. I turned the complete keyboard over
and plugged it back into the Archimedes and Iæm glad to say it works a
treat! Stuart Halliday
3.9
Å OsSys module Ö Shortly after the release of the OsSys module, I was
told that one couldnæt use SWIæs that needed a pointer to a buffer
because no such facilities where made available. I argued that this was
very easily implemented and changed the module accordingly. When doing
this, I also noticed a minor bug in the module. When a string longer
than 300 characters is passed, the module is supposed to generate an
error. This works fine but, due to a problem during the development, I
mistakenly thought that the pipeline was playing up when generating this
error. (Not all of the error text was displayed: the first 4 characters
were missing). I solved this by adding 4 to the PC when generating the
error. Quite wrong of course. I discovered that not the pipeline but I
was to blame. I had forgotten to put the error number (4 bytes) in
before the error message.
3.9
To upgrade the OsSys module to version 1.8, load the source code into
BASIC V and change/add the following lines:
3.9
10 REM >OsSysSrc18
3.9
350 EQUS ö1.80 (05 Apr 1990)ò
3.9
600 MOV R3,#500
3.9
610 SWI öOS_Moduleò
3.9
611 ;By claiming a larger workarea than required by the
3.9
612 ;the module, you can use the top of the work area to
3.9
613 ;create workspace for SWI calls that require pointers to
3.9
614 ;such a workspace. Eg. calls to WIMP or VDU.
3.9
650 EQUS öOsSWICalls v1.80 by M. Hendrix => Installedò
3.9
2510 REM remove this line. Itæs incorrect
3.9
3180 EQUD &01 ;Error number
3.9
Save and run the program.
3.9
The new module will claim more workspace than it actually needs. The top
200 bytes can thus be used for SWI buffers. You can use *MEMORYA to edit
the buffer(s). If you need more space for a buffer just change the value
#500 in line 600 to your desired amount of memory. (Donæt forget to add
300 bytes for the module itself!) Maurice Hendrix
3.9
Å Random number generator Ö If you use the use the random number
generator (RND in BASIC), it must be initialised with something really
random, such as the current time. Otherwise, the same num-bers will be
produced every time the program is run. The otherwise excellent game
!Yahtzee on Care-ware 4 suffers from this problem but it can easily be
solved: insert the line 123 Junk = RND(-TIME) and then every game is
different. Jonathan Puttock
3.9
Å The Dreaded CLI! Ö One of the nicest aspects about the Archimedes is
the Configure command. This command is often forgotten about as it lies
in that terrible place called the Command Line Interpreter (CLI)
accessed by pressing the dreaded function 12 key. One of the many things
that the Configure command does and seems to get lain aside is the
WimpFlags options. This very useful command determines the action of all
the windows used by RISC-OS in as far as it controls the two types of
window movement, resizing and scrolling. What two types?, I hear you
ask.
3.9
Status Ö Well if youæve never used the WimpFlags command before then you
have probably put up with the kind of windows which, when you change
their size or move them, all you get is a large dotted outline which
turns into a solid window when you release <select> or <adjust>. Now you
have an alternative. If you first press F12 from the Desktop and type in
*STATUS <return> youæll get a large list of items and near the end is a
line Wimpflags x, this x number (it may be 0) is actually the decimal
representative of a binary pattern of this number which switches on or
off the various options under this command.
3.9
If you type in *HELP WimpFlags <return> then the following should
appear:
3.9
*HELP WimpFlags
3.9
==> Help on keyword WimpFlags
3.9
*Configure WimpFlags sets the
3.9
default actions when dragging
3.9
windows, as follows:
3.9
bit 0 set: continuous window movement
3.9
bit 1 set: continuous window resizing
3.9
bit 2 set: continuous horizontal scroll
3.9
bit 3 set: continuous vertical scroll
3.9
bit 4 set: donæt beep when error box
3.9
appears
3.9
Syntax: *Configure WimpFlags <number>
3.9
Simply put, if you where to type in say:
3.9
*CONFIGURE WimpFlags 1 <return>
3.9
and press <ctrl-break> (you need to do this each time you enter new
values to actually change the values!) youæll see that if you move any
window it will be instant! If you want to try some more Éconfiguringæ
try changing the WimpFlags to 2 to see only instant window resizing or 3
for both. (Donæt forget to press <ctrl-break> afterwards!) If you do not
like this new look, simply change Wimpflags back to 0. The next two
options concern the scroll bars and these are really useful. If you
change WimpFlags to 8 youæll see that by dragging the pointer up and
down the vertical bar youæll get a smooth scroll effect, much better
than constantly clicking the arrow icons! Try WimpFlags set to 4 for
horizontal scroll or even 12 for them both at the same time.
3.9
Error Ö The last option just stops the error box beeping at you. Try
WimpFlags set to 16 and then Select an empty disc drive. Remember you
can combine any of these together by simply adding their numbers
together and configuring the WimpFlags. Try WimpFlags set to 31, this is
my favourite! Stuart Halliday
3.9