Actually, I copy-pasted all the Txx opcodes but failed to change one letter on one line (A = X). The A was an X, so the function became a TXX (X = X). I don't know if a C++ compiler would detect this, but I'm using the -excellent- assembler SpAsm for development, so it doesn't really matter in this case.
Anyway, this flaw became fatal when games started messing up the stack with TSX, TXA, TAX, TXS and so on... It took really long to figure out why games always crashed on RTS :-).
Well, I still haven't been directed to any testing ROMs. Perhaps there aren't any around? What do you use yourselves? I find it very time consuming debugging the CPU line by line, and I honestly don't have the energy to write a testing program of my own.