SB BBC @ GBR Oldie hints/tips #164-170 Hints and tips from the archives of Wakefield BBC Micro User Group... 164. "HARD" BREAK/RESET ~~~~~~~~~~~~~~~~~~ This can be achieved in software with the statement ?&FE4E=&7F:CALL !-4 (or CALL !&FFFC). Without the ?&FE4E=&7F, it is only a soft break. 165. Date-stamping discs ~~~~~~~~~~~~~~~~~~~ It is easy to overlook the important task of regularly backing-up your discs. This is all the more important when using double-density DFSs, as so much information can be carried on just one disc, (up to 640k with Acorn ADFS). As a record of when a disc was last backed-up, you could save a dummy file of zero length, with the date as the filename, eg *SAVE !7thDec 0 0 . The form of the date doesn't really matter, but the use of a "!" prefix followed by a number as the next character, will make the file appear first in the catalogue, even before !BOOT. Users of the Master 128 can automate this procedure to some extent, as shown in the next hint. Another way of subsequently altering this dummy date file is to simply *RENAME it. 166. Date-stamping discs (for Master) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The routine below, shown as a red key definition, will automatically save the current date as a dummy file of zero length, eg "!28Nov86". The use of a red key is handy if you are going to back up several discs in one session. If using the ordinary 1770 DFS, you are limited to 7 characters per filename, so you will have to omit the "!", or perhaps the "8" from "86". The idea is to *MOUNT the source disc, *DELETE the old date file, *SAVE the new date with this routine, and then *BACKUP the disc. Alternatively, you can *RENAME an existing dummy date file. Thus, you know exactly when the disc was last backed-up, so there is no excuse for forgetting! If you have a Utility ROM with *BACKUP on it, such as the Advanced Disc Toolkit, then you can make this whole operation very simple using the red keys. If not, then you could perhaps incorporate this routine on a line of BASIC in the BACKUP program provided on the Welcome disc. Abbreviations have been used, which is why some brackets appear to be missing. When typed as a line of BASIC, (without the *K.0) the keywords will appear in full when LISTED, and all will be clear. *K.0 OS.("SA. !"+M.TI.$,5,2)+M.TI.$,8,3)+M.TI.$,14,2)+" 0 0")|M 167. Auto-date function (for Master/Archimedes) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This Function is for adding to programs which expect a date entry of the form dd.mm.yy , eg 25.05.86 . The date is automatically extracted from the internal TIME$ function, thus saving the bother of manually entering it. Eg D$=FNdate . This Function occupies much less memory, and uses far fewer variables, than a version published in a recent issue of Beebug. If you want to save even more memory, then add lines 2010 and 2020 onto the end of line 2000. Note that in line 2030, m% is the month number 1-12, and the RIGHT$ statement is to format it as a string, with a leading zero if it is less than 10. 2000 DEFFNdate:LOCALm% 2010 m%=INSTR("JanFebMarAprMayJunJulAugSepOctNovDec",MID$(TIME$,8,3)) 2020 m%=(m%-1)DIV3+1 2030 =MID$(TIME$,5,2)+"."+RIGHT$("0"+STR$(m%),2)+"."+MID$(TIME$,14,2) 168. Drawing text boxes (for Master/Compact) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This Procedure makes use of the extra characters built-in to the Master. It enables you to draw a neat box round text, without resorting to graphics commands such as MOVE and DRAW. You specify the Left, Bottom, Right and Top TAB X-Y co-ordinates of the box, just as if defining a text window. The VDU28 command in line 1040 defines a text window inside the box, and can be omitted if not required. The example shown is in Mode 0, but it works in any 32-line Mode, ie 0/1/2/4/5, but will not look very nice in Modes 3 & 6 unless you make use of the "STRIPEY BACKGROUND" hint given in the 1986 tips compilation. 10 MODE0:PROCbox(20,20,60,10):END 20 : 1000 DEFPROCbox(L%,B%,R%,T%):LOCALV% 1010 PRINTTAB(L%,T%)CHR$(163)STRING$(R%-L%-1,CHR$(166))CHR$(165) 1020 FORV%=T%+1TOB%-1:VDU31,L%,V%,169,31,R%,V%,169:NEXT 1030 PRINTTAB(L%,B%)CHR$(170)STRING$(R%-L%-1,CHR$(166))CHR$(172); 1040 VDU28,L%+1,B%-1,R%-1,T%+1:REM Omit if not required 1050 ENDPROC 169. !BOOTing convert (for Master) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ If you have some programs which will only run after you have used the CONVERT program off the Welcome disc, you can put them together on one disc, with the following !BOOT file:- IF INKEY(-256)<>-1 THEN CHAIN "CONVERT" ELSE CHAIN "MENU" . This will run the CONVERT program if necessary, so that next time you boot the disc, the main menu or other selected program will be run instead. When transferring CONVERT from the Welcome disc, use *COPY or *MOVE rather than LOAD and SAVE, as it consists of a few lines of BASIC, followed by some 'hidden' machine code to be loaded into SRAM. 170. Composite video colour (for Master) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ To get a colour signal from the CV output socket, I hear that you can solder a 470pF ceramic capacitor between the emitter (right leg) of transistor Q12 and the base (centre leg) of Q13. These are located between the CV and RGB sockets, and although it is a slightly delicate soldering job, it is nowhere near as tricky as the equivalent modification on an early BBC B. 73 Rick G4BLT @ GB7WRG