For the 6502-emulation I've used source from fake6502 and miker00lz Arduino 6502 which seems to be based on fake6502 as well. They both had some small issues that I've improved as I've used the code, but one aspect I never fixed was ADC/SBC decimal mode. Today I started verifying the emulation with a test suite found at https://github.com/Klaus2m5/6502_65C02_functional_tests/tree/master
Klaus has worked very hard on testing the functionality of the op-codes, and has had some very interesting discussions with several persons on the 6502.org-forum
I have now run the full test suite and fixed the ADC/SBC errors, so now I can say with much better certainty that the 6502-emulation works.
The inner workings of ADC/SBC is not very easy to grasp, I had to search for a while before I found an implementation that was already verified and modify my code from there. Thanks to Marek Carcz VM6502: https://github.com/makarcz/vm6502 for a correct and verified ADC/SBC!