From 836602a4a64b2f12bdb0d3fa60c9252d9403d568 Mon Sep 17 00:00:00 2001 From: Sjoerd van der Berg Date: Sat, 22 Feb 2003 12:46:10 +0000 Subject: [PATCH] Setup for next round before ending the queue. Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@685 --- src/hardware/pic.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/hardware/pic.cpp b/src/hardware/pic.cpp index 971fd029..8620fc94 100644 --- a/src/hardware/pic.cpp +++ b/src/hardware/pic.cpp @@ -441,9 +441,6 @@ Bitu PIC_RunQueue(void) { CPU_CycleLeft+=CPU_Cycles; CPU_Cycles=0; } - if (CPU_CycleLeft<=0) { - CPU_CycleLeft=CPU_CycleMax; - } while (CPU_CycleLeft>0) { /* Check the queue for an entry */ Bitu index=PIC_Index(); @@ -482,8 +479,10 @@ Bitu PIC_RunQueue(void) { } if (ret) return ret; } - /* Go through the list of scheduled irq's and lower their index with 1000 */ + /* Prepare everything for next round */ + CPU_CycleLeft=CPU_CycleMax; PIC_Ticks++; + /* Go through the list of scheduled irq's and lower their index with 1000 */ PICEntry * entry=pic.next_entry; while (entry) { if (entry->index>1000) entry->index-=1000;