1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-06-09 01:29:44 +00:00

Explain even better.

This commit is contained in:
Thomas Harte 2023-09-02 14:45:13 -04:00
parent ecec9ff6dc
commit 43dfb729d3

View File

@ -305,8 +305,9 @@ template <Personality personality, typename T, bool uses_ready_line> void Proces
// So just test for carry (well, actually borrow, which is !carry).
// The bottom nibble is adjusted if there was borrow into the top nibble;
// on a 6502 this doesn't cause additional carry but on a 65C02 it does.
// This difference affects invalid BCD numbers only.
// on a 6502 additional borrow isn't propagated but on a 65C02 it is.
// This difference affects invalid BCD numbers only — valid numbers will
// never be less than -9 so adding 10 will always generate carry.
if(!Numeric::carried_in<4>(a_, operand_, result)) {
if constexpr (is_65c02(personality)) {
result += 0xfa;