SB BBC @ GBR Oldie hints/tips #108-111 Hints and tips from the archives of Wakefield BBC Micro User Group... 108. Wordwise pad character snag ~~~~~~~~~~~~~~~~~~~~~~~~~~~ You cannot normally program the character "|" to appear on a red user-definable key. The "|" is taken to stand for , so "|L" is interpreted as , which is ASCII code 12 decimal and clears the screen. What you cannot do is program the keys to actually hold "|" as a separate printable character. This can be a bit of a nuisance on Wordwise, where you might want to hold a useful document heading on a red key, (or on the cursor and keys), and the "|" is needed as the default pad character to make sure a centred heading comes out correctly. You could get round this in several ways. First, you could redefine the pad character at the beginning of the document or key definition, and I often use the backslash "\", which looks like "1/2" in mode 7. Ie, you could put pc\, (pc"\" on Wordwise Plus), and then use "\" as the pad character from then on. Alternatively, you could use something like "\" on your red keys, but before you print or save the document, use Search-and-Replace to change the "\"s to "|"s. Finally, as a more permanent solution, you can define the keys(s) using "\" as the temporary pad character. When you've finished, use Disc Doctor or ADT etc. to edit the memory to change the temporary character to "|", using *MZAP B00 (or MEDIT B00 or whatever command is appropriate), and then save the definitions with *SAVE Keys B00 C00. You can reload the keys at any time with *LOAD Keys, including from the Wordwise menu, or in your disc !BOOT file. If you haven't got Disc Doctor etc., then you can achieve the same effect with the routine below, which can be typed in direct mode if you wish, rather than RUN as a program. NB: If you have a 6502 2nd Processor, then edit and save your key definitions with the Processor switched off, and put leading "F"s on the Hex addresses so that you can successfully reload them when the 2nd Processor is in use. ie. *SAVE Keys FFFF0B00 FFFF0C00. FOR m%=&B00 TO &BFF:IF ?m%=ASC("\") THEN ?m%=ASC("|"):NEXT ELSE NEXT Addendum ~~~~~~~~ The above dealt with the problem of not being able to directly program the "|" character, (which looks like two vertical parallel bars in Mode 7), onto the red keys. Normally the "|" is used to represent "Ctrl", so "|M" is equivalent to Ctrl-M, ie a CR. Dave G7FHJ has pointed out there is a very simple way round this, which I was blissfully unaware of back in 1985! All you have to do is double-up on the character. Eg if you wanted a red key to produce the actual characters "|M" instead of a CR, then try using "||M" instead. 109. Disabling ROMS ~~~~~~~~~~~~~~ There are times when it is useful to suppress a resident ROM temporarily, even if or is pressed. You can do this by Poking the ROM private workspace table with 64, ie setting bit 6. Eg., if your DFS ROM is in socket 3, then you can kill it by typing ?&DF3=64, and then pressing . If you want to kill the ROM in socket 5, then use ?&DF5, and in socket 15, (&F), you use ?&DFF. To enable the ROM again, either switch off for a few seconds, or else Poke the original value back. For example, if PRINT ?&DF3 normally gives 151, then replacing 64 with this original value will restore the ROM after a . Many thanks to Nick Davison of Calverley, Leeds, for this information. 110. Slowing down programs ~~~~~~~~~~~~~~~~~~~~~ Brian Smith points out that if you type ?&FE45=1:?&FE46=0 then all subsequent programs will run super-slow. You can try this out most easily by loading in program, typing in the slowing-down command, and then typing LIST. To restore normality, do the same again but with the original values in place of 1 and 0. (Obviously, you will have to find them out with PRINT?&FE45,?&FE46 before you start.) On my Beeb they are both 14, but I think it depends on what options are fitted. I'm not sure exactly how this works, but you are messing about with the internal 6522 VIA timer registers. This evidently fools the computer into spending too much time looking for interrupts, and not enough time getting on with processing. 111. Tube indicator ~~~~~~~~~~~~~~ This short Function will return TRUE if a 6502 2nd processor is active, and FALSE if it is not. It is a useful way of either warning the user to switch the processor off, or of making other decisions within the program. Note that X% is effectively set to zero simply by being made LOCAL; do not omit it, even though it apparently does nothing. 10 IF FNtube=TRUE THEN PRINT "2nd Processor is active" 20 END 1000 DEFFNtube:LOCAL A%,X%,Y% 1010 A%=&EA:Y%=&FF:IF USR(&FFF4)AND&FF00 THEN =TRUE ELSE =FALSE 73 Rick G4BLT @ GB7WRG