Here's the current version, it's growed a bit.
My brain hurts from checking and cross checking and it's very likely that there are errors at this point. Feel free to point them out
Note the extra serial port (Serial4?), not supported as far as I can see but there none the less.
Rob