Analyser: Generic MFM - Script Merging

2008-08-13

Script merger now mostly done, but overlapping blocks are not supported yet, though at least they can be with this new system.

Possible sector length variations (such as using 2 or 3 bits for the real sector length) are marked and the data is probed for the correct length from the possible choices. Right now any segments marked as paired are collected into one block script, including relocation of areas and other subtle details. There is no limit on the number of segments that can be joined into one block.

Overlapping/interleaved blocks require a fairly complicated tree traversal algorithm to work out for sure whether the overlapping data content is supposed to be continuing in any of the next block(s) or not. It should be remembered that any of the segments might contain bad data, so each segment group node must be traversed until the expected checksums match. This is further complicated by the fact that one node can have multiple lengths, and a longer sector can overlap multiple smaller ones...

...not feeling like doing that right now. ;)

Added support for using flexible scripting parameter locations. Previously the script generator would have used predefined argument positions for passing data from format scripts to block scripts. With the new system and arbitrary parameter passing this was no longer sufficient. The new code uses the next available argument for parameter passing and if it runs out of options embeds the constants into the lower level script itself.