changelog shortlog tags branches files raw gz bz2 help

Mercurial > hg > plan9front / changeset: realemu: fix pit bcd mode

changeset 6246: 897d5d802e50
parent 6245: 6153167c7bd4
child 6247: 3c36e3acc368
author: cinap_lenrek@felloff.net
date: Mon, 04 Dec 2017 05:09:13 +0100
files: sys/src/cmd/aux/realemu/pit.c
description: realemu: fix pit bcd mode
     1.1--- a/sys/src/cmd/aux/realemu/pit.c
     1.2+++ b/sys/src/cmd/aux/realemu/pit.c
     1.3@@ -51,7 +51,7 @@ latchcount(Pit *ch)
     1.4 		return;
     1.5 	w = ch->count & 0xFFFF;
     1.6 	if(ch->bcd)
     1.7-		w = (w % 10) + ((w/10) % 10)<<4 + ((w/100) % 10)<<8 + ((w/1000) % 10)<<12;
     1.8+		w = (w % 10) | ((w/10) % 10)<<4 | ((w/100) % 10)<<8 | ((w/1000) % 10)<<12;
     1.9 	ch->rlatch[0] = w & 0xFF;
    1.10 	ch->rlatch[1] = (w >> 8) & 0xFF;
    1.11 	ch->rcount = 0;