pit8253: Reading back the count while in the middle of a 16-bit write returns a xor'ed version of the value written. Fixes apricot error 29.

This commit is contained in:
Dirk Best 2016-12-19 18:18:13 +01:00
parent 9d7031d8b5
commit f0faed6fc6
2 changed files with 12 additions and 4 deletions

View File

@ -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;
}

View File

@ -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];
}
}