pete-gordon / oricutron

Portable Oric-1/Atmos/Telestrat and Pravetz 8D emulator
http://www.petergordon.org.uk/oricutron/
GNU General Public License v2.0
69 stars 25 forks source link

Fix decimal mode #178

Closed assinie closed 3 years ago

assinie commented 3 years ago

When D flag is set, calculation result and flags for ADC and SBC instructions are incorrect even for valid BCD values.

This patch fix SBC and ADC instructions when D flag is set. Verified with Klaus Dormann decimal test: https://github.com/Klaus2m5/6502_65C02_functional_tests/blob/master/6502_decimal_test.a65

pete-gordon commented 3 years ago

Thanks 👍