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 Offset | BBC Address | Old byte | New Byte | Old Code | New Code | |
---|---|---|---|---|---|---|
04CA1 | 8CA1 | 29 | 20 | AND #&08 | JSR &BF82 | |
04CA2 | 8CA2 | 08 | 82 | |||
04CA3 | 8CA3 | F0 | BF | BEQ &8CA7 | ||
04CA4 | 8CA4 | 02 | EA | NOP | ||
04CA5 | 8CA5 | A0 | EA | LDY #&10 | NOP | |
04CA6 | 8CA6 | 10 | EA | NOP | ||
Megabit ROM Offset | BBC Address | Old byte | New Byte | Old Code | New Code | |
051F4 | 91F4 | A9 | 86 | LDA #&FF | STX &C7 | |
051F5 | 91F5 | FF | C7 | |||
051F6 | 91F6 | 8D | 84 | STA &C282 | STY &C8 | |
051F7 | 91F7 | 82 | C8 | |||
051F8 | 91F8 | C2 | A9 | LDA #&FF | ||
051F9 | 91F9 | 86 | FF | STX &C7 | ||
051FA | 91FA | C7 | 8D | STA &C282 | ||
051FB | 91FB | 84 | 82 | STY &C8 | ||
051FC | 91FC | C8 | C2 | |||
Megabit ROM Offset | BBC Address | Old byte | New Byte | Old Code | New Code | |
0622C | A22C | A6 | A4 | LDX &F0 | LDY &EF | |
0622D | A22D | F0 | EF | |||
0622E | A22E | 86 | EA | STX &C7 | NOP | |
0622F | A22F | C7 | EA | NOP | ||
06230 | A230 | A6 | A6 (No change) | LDX &F1 | LDX &F0 | |
06231 | A231 | F1 | F0 | |||
06232 | A232 | 86 | 86 (No change) | STX &C8 | STX &C7 | |
06233 | A233 | C8 | C7 | |||
06234 | A234 | C8 | A6 | INY | LDX &F1 | |
06235 | A235 | 10 | F1 | BPL &A23E | ||
06236 | A236 | 07 | 86 | STX &C8 | ||
06237 | A237 | A6 | C8 | LDX &C7 | ||
06238 | A238 | C7 | C8 | INY | ||
06239 | A239 | A4 | 10 | LDY &C8 | BPL &A23E | |
0623A | A23A | C8 | 03 | |||
0623B | A23B | 4C | 4C (No change) | JMP &91F4 | JMP &91F8 | |
0623C | A23C | F4 | F8 | |||
0623D | A23D | 91 | 91 (No change) | |||
Megabit ROM Offset | BBC Address | Old byte | New Byte | Old Code | New Code | |
07B69 | BB69 | 8C | 8C (No change) | STY &C2DE | STY &C2E6 | |
07B6A | BB6A | DE | E6 | |||
07B6B | BB6B | C2 | C2 (No change) | |||
07B6C | BB6C | 60 | 60 (No change) | RTS | RTS | |
07B6D | BB6D | AC | AC (No change) | LDY &C2DE | LDY &C2E6 | |
07B6E | BB6E | DE | E6 | |||
07B6F | BB6F | C2 | C2 (No change) | |||
Megabit ROM Offset | BBC Address | Old byte | New Byte | Old Code | New Code | |
07F82 | BF82 | FF | 29 | (blank) | AND #&08 | |
07F83 | BF83 | FF | 08 | (blank) | ||
07F84 | BF84 | FF | F0 | (blank) | BEQ &BF8A | |
07F85 | BF85 | FF | 04 | (blank) | ||
07F86 | BF86 | FF | A9 | (blank) | LDA #&20 | |
07F87 | BF87 | FF | 20 | (blank) | ||
07F88 | BF88 | FF | A0 | (blank) | LDY #&10 | |
07F89 | BF89 | FF | 10 | (blank) | ||
07F8A | BF8A | FF | 60 | (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 ?