I've done quite a bit of work with compression schemes in the past, but this one is pretty unfamiliar to me. It appears to be some sort of binary tree compression scheme.
There's two varaibles; a down counter (always re/load with a value of $07, check looks for $ff value) and an byte bit mask.
There's also a table/block. Each entry is either 2 or 3 bytes long (though there might be an entry that is 4 bytes long, IIRC). The ending byte is always $FF. So something like $97,$ff,$07,$ff,$85,$ff. #$ff is the terminator of each entry (which means skip to the next). The mask corresponding bit determines whether to skip 1 byte or two bytes. If two bytes, then the value from the 'block' or tree is added to the tree/block pointer, helping incrementing it. When a non termination value is read, it's passed to the string build routine, and then the tree pointer is reset back to the beginning of the block.
There's also another block and pointer. When the down counter expires, this pointer is incremented and the mask is reloaded. Neither the base nor the index of the tree access system is reset at this point.
There's another layer of mechanism in place as well. At the very start of the call, there's a variable that stops the string routine from accumulating. When this variable expires (decremented; 00 = expired), then it will copy valid string data to the string build routine. Else, it just accumulates the second pointer position.
Soo... does this description sound familiar? Sound like a binary tree compression scheme? I'm on the verge of figuring it out; just need to trace back to the top layer function calls and hopefully begin test (and text) extract trials. Any advice or comments?