From: Hugo Villeneuve Date: Wed, 27 Nov 2013 03:54:08 +0000 (-0500) Subject: Fix error with timer1 being written to timer0 X-Git-Tag: v2.0.0~46 X-Git-Url: http://gitweb.hugovil.com/?a=commitdiff_plain;h=e93543c1a14e5c5bd00f670aca86628b51e51e5b;p=emu8051.git Fix error with timer1 being written to timer0 --- diff --git a/src/cpu8051.c b/src/cpu8051.c index f9dd936..d2ceca3 100644 --- a/src/cpu8051.c +++ b/src/cpu8051.c @@ -293,8 +293,8 @@ process_timer(uint8_t tl, uint8_t th, uint8_t tf_mask, uint8_t TR, uint8_t mode, if (tmp == 0) /* If overflow set TF0 */ cpu8051_WriteD(_TCON_, cpu8051_ReadD(_TCON_) | tf_mask); - cpu8051_WriteD(_TH0_, tmp / 0x100); - cpu8051_WriteD(_TL0_, tmp & 0xFF); + cpu8051_WriteD(th, tmp / 0x100); + cpu8051_WriteD(tl, tmp & 0xFF); break; case 1: /* Mode 1, 16-bits counter */ @@ -303,8 +303,8 @@ process_timer(uint8_t tl, uint8_t th, uint8_t tf_mask, uint8_t TR, uint8_t mode, tmp &= 0xFFFF; /* We keep only 16 bits */ if (tmp == 0) /* If overflow set TF0 */ cpu8051_WriteD(_TCON_, cpu8051_ReadD(_TCON_) | tf_mask); - cpu8051_WriteD(_TH0_, (tmp / 0x100)); - cpu8051_WriteD(_TL0_, (tmp & 0xFF)); + cpu8051_WriteD(th, (tmp / 0x100)); + cpu8051_WriteD(tl, (tmp & 0xFF)); break; case 2: /* Mode 2, 8-bits counter with Auto-Reload */