I think I used this to generate some of the unit tests and we should really look at what this is doing to make sure we calculate the flag correctly. I suspect the main issue is when dealing with the carry flag but I could be completely wrong.
I'm closing this for now. I think the issues have been cleared up since I found out that the SBC command was using addition. The z80doc tests now pass and so do are small amount of unit tests.
We seem to have lots of issues with the overflow flag.
This article might be worth checking out: https://stackoverflow.com/questions/8034566/overflow-and-carry-flags-on-z80
I think I used this to generate some of the unit tests and we should really look at what this is doing to make sure we calculate the flag correctly. I suspect the main issue is when dealing with the carry flag but I could be completely wrong.