diff --git a/src/devices/machine/pit8253.cpp b/src/devices/machine/pit8253.cpp index 1cfb5d45c3e..87f669b2b3e 100644 --- a/src/devices/machine/pit8253.cpp +++ b/src/devices/machine/pit8253.cpp @@ -724,7 +724,7 @@ void pit8253_device::update(pit8253_timer *timer) attotime elapsed_time = now - timer->last_updated; int64_t elapsed_cycles = elapsed_time.as_double() * timer->clockin; - LOG1(("update(): timer %d, %d elapsed_cycles\n", timer->index, elapsed_cycles)); + LOG2(("update(): timer %d, %d elapsed_cycles\n", timer->index, elapsed_cycles)); if (timer->clockin) timer->last_updated += elapsed_cycles * attotime::from_hz(timer->clockin); @@ -809,7 +809,15 @@ READ8_MEMBER( pit8253_device::read ) case 3: /* read bits 0-7 first, then 8-15 */ - data = (value >> (timer->rmsb ? 8 : 0)) & 0xff; + + // reading back the current count while in the middle of a + // 16-bit write returns a xor'ed version of the value written + // (apricot diagnostic timer test tests this) + if (timer->wmsb) + data = ~timer->lowcount; + else + data = value >> (timer->rmsb ? 8 : 0); + timer->rmsb = 1 - timer->rmsb; break; } diff --git a/src/mame/drivers/apricot.cpp b/src/mame/drivers/apricot.cpp index eb7d91650a4..887378c2f45 100644 --- a/src/mame/drivers/apricot.cpp +++ b/src/mame/drivers/apricot.cpp @@ -4,7 +4,7 @@ ACT Apricot PC/Xi - - Error 29 (timer failed) + - Error 31 (diagnostic keyboard failure) - Dump of the keyboard MCU ROM needed (can be dumped using test mode) ***************************************************************************/ @@ -311,7 +311,7 @@ MC6845_UPDATE_ROW( apricot_state::crtc_update_row ) for (int x = 0; x <= 10; x++) { int color = fill ? 1 : BIT(data, x); - if (BIT(code, 15)) color = !color; // reverse? + color ^= BIT(code, 15); // reverse? bitmap.pix32(y, x + i*10) = pen[color ? 1 + BIT(code, 14) : 0]; } }