OUTLET'S EXTRA ================= I N S T R U C T I O N S ================================ Bug Fixes for Betados and G+DOS by Miles Kinloch ------------------------------- I have found and fixed a number of bugs in Betados - some fairly minor, others more serious - plus some bugs which are also present in G+DOS. The program which follows in this issue, "BUGTESTER". demonstrates the effects of each bug, showing clearly what happens before and after they are fixed. A further two programs, GDOSFIX and BETAFIX in ADDENDERS in this issue, will make the required corrections to the respective DOS. Note that to squeeze the extra code into the +D RAM has meant the removal of the Boot message and also some of the disc-copy messages. [Also note that OUTLET has been using the bytes in the Boot message as a simple test between the DOSs. This test will be void and may cause corrupt- ions once you have installed the "Fixes" Ed.] DOS BUG FIXES & ENHANCEMENTS ---------------------------- The program "BETAFIX" cures the following bugs in Betados and also adds a couple of new features. Where the bug also affects G+DOS, it can be cured by the program "GDOSFIX". BUGS ---- 1. OPEN # command. If you omit the IN or OUT at the end, the DOS will not accept the syntax if there is another statement following in the same line, i.e. if a colon is the next character after the command. (This bug also affects G+DOS, and is fixed by "GDOSFIX"). 2. FORMAT command. There are two bugs here: a) The special form FORMAT d1,n etc,ignores the drive specified and just formats the last drive used. b) The form FORMAT d* will not pass syntax. 3. Command codes. These are perhaps the most serious of all the Betados bugs, as they affect many commercial programs which call the DOS from machine-code. Once the command codes are fixed, the great majority of such software will then run with Betados without any problems. A few examples are the +D conv- erted version of Tasword 128, Hackers Workbench(SD Software), Profile (Glensoft), Disc-Kit (in OUTLET #76) and several of Betterbytes' utilities including the disc-copier one. Six codes altogether are faulty which are: a) Codes 52 and 53. The problem here is that the alternate HL register pair is corrupted, resulting in a crash after returning to BASIC from a USR call which involves these. b) Code 56. The routine called by RST 8 DB 56 has not been changed from the one in the +D ROM which G+DOS uses. This is fine with Betados too, EXCEPT if used on a disk that has been formatted for over 80 files. Such a disk would invariably be corrupted as a result. (Code 56 is used to close a file from machine-code, i.e. create an entry for it in the directory.) c) Code 67. This is the code used to CAT a disk, and is fat- ally flawed. Any attempt to use it will almost always crash the Spectrum and possibly corrupt the DOS at the same time. d) Codes 68 and 69. The equiv- alents, in fact, of SAVE @ and LOAD @. These two always return signalling a DOS error, regard- less of whether there has actu- ally been one or not. See also No.4, below. 4. LOAD @/SAVE @ commands (and command code equivalents). If there has been an error during a LOAD @ or SAVE @, e.g. a write- protected disk etc.,this results in a wrong value being left in one of the DOS system variables. Consequently, if you then type RUN to re-boot the DOS, the pro- cess will stop prematurely with an 'END of file' message. Also, if you try to make a snapshot, it will likely be corrupted and could possibly corrupt other files on the disk too. (Typing CLEAR # resets the variable, but this is hardly the ideal way round it, i.e. if you had any streams open at the time or if the error had come about through the command codes and you could not exit to BASIC.) 5. SAVE @ command. There is a problem with the routine which spins the drive for about a second to ensure the motor is up to speed before writing the sector. It doesn't take account of the drive specified, and will just spin the last drive used. This is fine if you have a disk in both drives, but if the last drive used no longer has the disk in it, its motor will just spin indefinitely until one is inserted. 6. Use of a capital 'D' in SAVE and ERASE commands. Contrary to appearances, the auto-CAT which occurred with G+DOS when using the capital 'D' has not in fact been fully disabled in Betados. The CAT actually still takes place, it's just that you can't see it as its stream is altered to make it CAT into the BASIC workspace instead of the screen. In these circumstances no checks are made on the amount of workspace memory available etc, and this can sometimes cause problems, especially if an INPUT has been used previously as this also uses the workspace. 7. MOVE command. The form MOVE # TO d1"name" (not documented in the +D manual) has two serious bugs. The first is that the directory entry created for the new file, although it will be there, won't be visible in the catalogue. The second problem is that, when using this form of the MOVE command, if the filename has already been used and you type 'n' at the 'Overwrite' prompt, using CLEAR # or CLOSE #* after- wards will lock up the Spectrum. This is because some pointers won't have been reset, and the CLEAR # or CLOSE #* will get 'confused' about how much memory to reclaim(This bug also affects G+DOS and is cured by"GDOSFIX"). 8. Betados FN calls, e.g. DEF FN s(x)=USR 8 etc.Potentially there could be a problem with the 128K Editor if these were typed as direct commands, particularly the ones concerned with opentype files, e.g. FN e, FN l and FN p. The 128K editor is fussy about the value of the IX register pair (or rather, to be more precise, the contents of (IX+1) if non-zero) when it's in the process of editing a line. The latter three functions use IX themselves so this should really be set correctly afterwards for 100% safety. For further details about this IX problem,see the article 'Plus D Alters'in Format Magazine, March 1988 (Vol. 1, No. 8), as this was something which also affected the previous DOS (i.e. the version before G+DOS 2a). 9. The tape SAVE command. If you use a null filename or one longer than 10 characters, you get "Nonsense in BASIC" instead of "Invalid file name" when a +D is attached. A minor bug perhaps but one which is very easy to sort(This bug also affects G+DOS and is cured by "GDOSFIX"). 10. Printing to Random-access files. There are two bugs here: a) The Betados manual states if you INPUT from files opened RND any text or control characters before the input variable are ignored,eg, INPUT #4;"text";a$. However, this is only true when you are using 48K mode. In 128 BASIC such text will still be written to the file regardless, just as with files opened OUT. b) Using colours in a PRINT command which sends data to the file can cause an error. Embedded control codes are OK, but if you use the PAPER, INK etc. tokens in the PRINT state- ment,eg, PRINT #4;INK 5;"text", this can give a "Nonsense in BASIC" report. ENHANCEMENTS ------------ 1. A New Command is added to both BETADOS and G+DOS: You can now use LOAD dn (or SAVE dn) on its own which gives the opportu- nity to change the current drive without actually having to use the drive to do so. This can be very handy before LOAD Pn, for instance. 2. SAVE...TO. This command has been improved when copying between different drives. The +D system suffers from a short- coming in that it only keeps note of the track register(drive head position) for one drive. This can sometimes lead to prob- lems, especially when copying long files such as 128K snap- shots which can't be copied in a single 'pass'. The system gets confused about where the drive head is, and if the file being copied has tracks near the end of a disk, it can sometimes fail altogether, stopping with an error report. BETAFIX patches the SAVE...TO routines so that a separate record is kept for the track registers of both drives,result- ing not only in much greater reliability but also an increase in speed, typically about 15%. In practice, this problem is less serious with G+DOS than with Betados, due to the limit- ations G+DOS has in the first place, i.e. its inability to copy snapshots or opentype files, where these effects tend to be worst. THE FOLLOWING TWO ENHANCEMENTS APPLY TO G+DOS ONLY, AS THEY ARE ALREADY INCLUDED IN BETADOS... 3. SAVE @ and LOAD @. A new patch has been added to these, similar to the one in Betados, which spins the drive for about a second before reading/writing the sector.For people who suffer from this symptom,these commands will now be just as reliable as their Betados equivalents. 4. Saving to a write-protected disk.Previously the SAVE command would first check the directory etc., and if a file of the same name already existed, print the "Overwrite?" prompt etc. before realising the disk was protect- ed. This wasted a bit of time. GDOS-FIX now makes the DOS check the write-protect status first when saving, so people will be informed of this right away. COMPATIBILITY ------------- GDOSFIX is fully compatible with all G+DOS patches and mods except "THINGi", (OUTLET #77), which uses all the spare +D RAM. Finally: USING BDM TO CREATE A BETADOS SYSTEM FILE Only ever use an unmodified G+DOS 2a for this purpose, i.e. one that has been made using the CONFIG program as supplied on the original "system tape" and has had no subsequent patches etc. added since, including the ones in GDOSFIX. All necessary bug fixes for Betados will be taken care of by BETAFIX itself. [Miles Kinloch mentions that he found the "ESD Disassembler" indispensible for tracking down the various bugs detailed above, and recommends it for anyone wanting to look into the +D ROM/RAM. - Ed.]