SB BBC @ GBR Oldie hints/tips #130-134 Hints and tips from the archives of Wakefield BBC Micro User Group... 130. Coloured text and backgrounds ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Changing colours using BASIC is a simple operation; the statement VDU19,1,2,0,0,0 will change the text colour to green in all modes except Mode 7. The same effect can be achieved by holding down the key and typing S12000 . When using VIEW the VDU command is not available, although the sequence will work. Neither of these methods will work in THE Watford Electronics Disc Sector Editor, for example; the only way to change colours here is by the *FX155,X operating system command which is rather complex. *FX155,X writes to register 1 (palette) of the video ULA, but in two-colour modes the command must be used 8 times with different values of X, just to change the text colour, and a further 8 times to change the background colour. (See The Advanced User Guide sections 19 and 22.) The program below calculates the values of X for each foreground and background colour and transfers them onto disc as files. Before running the program make sure there is space for 16 small files on the disc; 8 files will be named as in the DATA statement in line 30, and 8 with the same names prefixed with the letter B. You can then delete any files that you feel you will not need. When using VIEW for example, entering *EXEC BLUE followed by *EXEC WHITEB will give blue text on a white background. If you are NOT using the old BASIC-I on a BBC B, you can omit lines 500-530 and replace the PROCoscli in lines 40 and 80 with the keyword OSCLI . 10 DIM colour$(7) 20 FORI%=0 TO 7: READ colour$(I%): NEXT 30 DATA BLACK,RED,GREEN,YELLOW,BLUE,PURPLE,CYAN,WHITE 40 FORI%=0 TO 7: PROCoscli("SPOOL "+colour$(I%)) 50 FORJ%=8 TO 15: PRINT"*FX155,";16*J%+I%: NEXTJ% 60 *SPOOL 70 NEXT 80 FORI%=0 TO 7: PROCoscli("SPOOL "+colour$(I%)+"B") 90 FORJ%=0 TO 7: PRINT"*FX155,";16*J%+I%: NEXTJ% 100 *SPOOL 110 NEXT 120 END 500 DEFPROCoscli(Z$) 510 $&C00=Z$ 520 X%=0:Y%=&C:CALL&FFF7 530 ENDPROC 131. Stripey background hint ~~~~~~~~~~~~~~~~~~~~~~~ Modes 3 and 6 are text-only modes, with 25 rather than 32 lines per screen. This is achieved by leaving gaps between the lines, and is clearly illustrated by VDU19,0,4,0;0;0; which sets a coloured background. This gives a stripey appearance, which can be used to good effect. However, you are stuck with the black gaps between lines, and any user-defined characters on adjacent lines will never join up. In the case of Mode 3, you may as well use Mode 0 instead, as they both occupy 20k of memory. However, Mode 6 takes up 8k as against the 10k of Mode 4, so it might be better on some occasions, unless you have Shadow RAM. A clever chap called Cad Delworth, writing to Acorn User, has found that you can close up the gaps completely with VDU23,0,9,7,0;0;0; and to prevent any tendency for the picture to 'roll', you should follow this with VDU23,0,5,8,0;0;0; On the Master/Compact, these can be shortened to VDU23,0,9,7|23,0,5,8| The resulting screen has bigger margins at the top and bottom than normal, but this may be a small price to pay for being able to use a Mode which needs 2k less memory. 132. SPEECH! hint ~~~~~~~~~~~~ The Superior Software SPEECH! software has two main commands, *SAY and *SPEAK. The former tries to pronounce the words phonetically, whereas the latter enables you to manipulate more subtly the pronunciation and pitch by building up words from 'phonemes'. You may be very interested to know that when you use *SAY, the program translates this into *SPEAK format, and stores it in the cassette input buffer at memory location &A00. Thus, if you type *SAY HELLO FRED and then type PRINT $&A00 you will see "/HEHLOW FREHD". Now try *SPEAK /HEHLOW FREHD to prove the point. Similarly, *SAY MASTER 128 gives the result "MAA6STER WO5NTUH4WAY5T". This should help you in making up your own words, by seeing how the computer makes up similar ones. 133. ROM/RAM board 'fix' ~~~~~~~~~~~~~~~~~~~ Ever had problems with wobbly expansion boards, and that sort of thing? The effective low-technology solution is to apply a bit of the magic BLU-TACK in strategic places. With a Solidisk RAM board, try using it to stick the rear end to the UHF modulator can. It's so simple it's brilliant! 134. Writing 'legal' programs ~~~~~~~~~~~~~~~~~~~~~~~~ Now that the BBC Micro 'family' includes the Model B, the B+, Master and the new Compact, it is all the more important to use 'legal' programming techniques, in order to reduce compatibility problems. PS: There is now the Archimedes in the family of course! 73 Rick G4BLT @ GB7WRG