DFS 2.45 patches for MOS 3.50

Whilst doing the MOS patches for the Y2000 problem, I discovered that many years ago I had patched the ROMed DFS (v2.45) in Acorn's MOS v3.50.

From the depths of my memory, the patches are to fix three problem areas:

The patches I made many years ago are shown here. The Megabit ROM Offset is the offset into the 1 Megabit ROM (useful if you've used my BBC BASIC program to save the whole 1 Megabit ROM image to file). The BBC Address is the address in the BBC memory map (with ROM 9 active).
Megabit ROM OffsetBBC AddressOld byteNew ByteOld CodeNew Code
04CA18CA12920AND #&08JSR &BF82
04CA28CA20882
04CA38CA3F0BFBEQ &8CA7
04CA48CA402EANOP
04CA58CA5A0EALDY #&10NOP
04CA68CA610EANOP
Megabit ROM OffsetBBC AddressOld byteNew ByteOld CodeNew Code
051F491F4A986LDA #&FFSTX &C7
051F591F5FFC7
051F691F68D84STA &C282STY &C8
051F791F782C8
051F891F8C2A9LDA #&FF
051F991F986FFSTX &C7
051FA91FAC78DSTA &C282
051FB91FB8482STY &C8
051FC91FCC8C2
Megabit ROM OffsetBBC AddressOld byteNew ByteOld CodeNew Code
0622CA22CA6A4LDX &F0LDY &EF
0622DA22DF0EF
0622EA22E86EASTX &C7NOP
0622FA22FC7EANOP
06230A230A6A6 (No change)LDX &F1LDX &F0
06231A231F1F0
06232A2328686 (No change)STX &C8STX &C7
06233A233C8C7
06234A234C8A6INYLDX &F1
06235A23510F1BPL &A23E
06236A2360786STX &C8
06237A237A6C8LDX &C7
06238A238C7C8INY
06239A239A410LDY &C8BPL &A23E
0623AA23AC803
0623BA23B4C4C (No change)JMP &91F4JMP &91F8
0623CA23CF4F8
0623DA23D9191 (No change)
Megabit ROM OffsetBBC AddressOld byteNew ByteOld CodeNew Code
07B69BB698C8C (No change)STY &C2DESTY &C2E6
07B6ABB6ADEE6
07B6BBB6BC2C2 (No change)
07B6CBB6C6060 (No change)RTSRTS
07B6DBB6DACAC (No change)LDY &C2DELDY &C2E6
07B6EBB6EDEE6
07B6FBB6FC2C2 (No change)
Megabit ROM OffsetBBC AddressOld byteNew ByteOld CodeNew Code
07F82BF82FF29(blank)AND #&08
07F83BF83FF08(blank)
07F84BF84FFF0(blank)BEQ &BF8A
07F85BF85FF04(blank)
07F86BF86FFA9(blank)LDA #&20
07F87BF87FF20(blank)
07F88BF88FFA0(blank)LDY #&10
07F89BF89FF10(blank)
07F8ABF8AFF60(blank)RTS

The code change around &A22C is to sort out the OSWORD calls. The OSWORD call number is held in location &EF: the original code had copied it to the Y register before &A22C - and then corrupted the Y register. The code at &91F4 is reorganised to as to work with the code at &A22C.

The code around &BB69 is to do with Paged ROM Service Calls &0B (NMI released) and &0C (NMI claim) - the change is to the location where the previous NMI owner's ROM number was stored. Acorn had originally chosen a location which was also being used for holding the 'double stepping' flag for drive 0 (i.e. after the result of a *DRIVE 0 40). When double stepping is set for a drive, the DFS regards that drive as being write protected.

The code changes at &8CA1 and &BF82 fix a bug which prevented support for double density (MFM) mode. OSWORD &7F should work in double density mode (16 sectors/track rather than the 10 sectors/track in single density mode) if bit 3 of the drive number byte is set. I.e. drive numbers 0 - 3 work in single density, drive numbers 8 - 11 work in double density.
I'm not sure if this feature was ever documented. It was never present in the original Acorn DFS - simply because the 8271 FDC didn't support double density. It must have arrived in the Acorn 1770 DFS - either in the BBC B upgrade, or in the B++. When the bit allocation of the Drive Control Register was changed, the authors of the Acorn 1770 DFS perhaps didn't realise that the 'density select' bit had changed from bit 3 to bit 5 and that they needed to cope with this.
I'm presuming that some 3rd party disk software relied on this double density feature, which is why I noticed the problem. Perhaps this was the Advanced Disk Investigator ROM ?


Acorn MOS patches
Information supplied by
Andrew Benham (G8FSL), Southgate, London N14 4XD, United Kingdom