So, I managed to get the simulator proof test running on my simulator, and I've found several issues.
I'm down to decimal mode.
I have this sequence. This is the 'chkdad' routine for those following along at home. This shows the address, instruction, status, registers, and the top part of the stack ($1FF down to, I dunno, $1F5 or so...)
Code:
3cd3: PHP -- -O*-D--C A:a0 X:58 Y:ff S:fb 3c 7b 7a f8 ff 32 fd 30 0 0 0
3cd4: LDA $57 -- -O*-D--C A:a0 X:58 Y:ff S:fa 3c 7b 7a f8 79 32 fd 30 0 0 0
3cd6: ADC $58 -- -O*-D--C A:1 X:58 Y:ff S:fa 3c 7b 7a f8 79 32 fd 30 0 0 0
3cd8: PHP -- -O*-D--C A:1 X:58 Y:ff S:fa 3c 7b 7a f8 79 32 fd 30 0 0 0
3cd9: CMP $59 -- -O*-D--C A:1 X:58 Y:ff S:f9 3c 7b 7a f8 79 79 fd 30 0 0 0
3cdb: BNE $3cdb -- -O*-D--C A:1 X:58 Y:ff S:f9 3c 7b 7a f8 79 79 fd 30 0 0 0
Also, here's the content of the $0050-005F, which does not change in this process:
Code:
0 1 2 3 4 5 6 7 8 9 a b c d e f
0050: 59 02 59 01 5a 01 00 01 99 00 01 02 00 42 52 00
So it's LDA $57, which is 01, and then it ADC $58, which is 99, with Carry set, in Decimal mode. I have this coming out at $01 (99 + 1 + 1 = 101, mod 100 = 1), with carry set. But the test is comparing it with $59, which is a zero. Am I missing something here? Why would ADC be set to 0?