From c4a184e2c6716ff05f474733544586eb501285f9 Mon Sep 17 00:00:00 2001 From: Robbbert Date: Wed, 12 Aug 2020 23:28:43 +1000 Subject: [PATCH] z8: fixed bug in decimal adjust. Fixes PRINT 654 in bert. --- src/devices/cpu/z8/z8ops.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/devices/cpu/z8/z8ops.hxx b/src/devices/cpu/z8/z8ops.hxx index 51172f2d142..22934842657 100644 --- a/src/devices/cpu/z8/z8ops.hxx +++ b/src/devices/cpu/z8/z8ops.hxx @@ -325,7 +325,7 @@ void z8_device::decimal_adjust(uint8_t dst) if (flag(C) | (data>0x99)) new_data+=0x60; } - set_flag_c(new_data & 0x100); + set_flag_c(flag(C)|(new_data & 0x100)); set_flag_s(new_data & 0x80); new_data &= 0xff; set_flag_z(new_data == 0);