diff options
author | 2019-08-07 12:48:48 +0700 | |
---|---|---|
committer | 2019-08-07 12:48:48 +0700 | |
commit | fcd10571a16a3f5a7b5a8deb3b65f523d43a99b7 (patch) | |
tree | 0f7f42bc9c480622d38ab25054bc5ce6af679b1b | |
parent | 6d08feb711e35d055aa5c64a5e507d503fc0a865 (diff) |
timehelp: fix bcd wrap (nw)
-rw-r--r-- | src/devices/machine/timehelp.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/devices/machine/timehelp.h b/src/devices/machine/timehelp.h index 9e1e5efeefc..8716c63c450 100644 --- a/src/devices/machine/timehelp.h +++ b/src/devices/machine/timehelp.h @@ -37,17 +37,18 @@ public: *tens_carry = true; bcd &= 0xf0; bcd += 0x10; - if (bcd > max) - { - bcd = min; - carry = 1; - } } else if (tens_carry) { *tens_carry = false; } + if (bcd > max) + { + bcd = min; + carry = 1; + } + *data = (*data & ~mask) | (bcd & mask); return carry; } |