I noticed that you weren't making use of LDX # and LDY # at the beginning of your latest creation, and that you made the dangerous assumption further down that the carry was clear before the ADC #1 in the first run through the loop.
I should have done both of those! Thank you having a look.