From 13ea835d96f6b8ad2bc333b181121c2660f56526 Mon Sep 17 00:00:00 2001 From: Ralf Grillenberger Date: Sun, 4 Apr 2010 12:29:25 +0000 Subject: [PATCH] Keep the timer value during timer mode changes (undocumented behavior). Fixes Dunkle Schatten with Soundblaster and 3DMania. Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3567 --- src/hardware/timer.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/hardware/timer.cpp b/src/hardware/timer.cpp index a4a7c503..8ceb42d5 100644 --- a/src/hardware/timer.cpp +++ b/src/hardware/timer.cpp @@ -139,6 +139,7 @@ static void counter_latch(Bitu counter) { //If gate2 is disabled don't update the read_latch if(counter == 2 && !gate2 && p->mode !=1) return; + if(p->new_mode) return; double index=PIC_FullIndex()-p->start; switch (p->mode) { @@ -309,6 +310,7 @@ static void write_p43(Bitu /*port*/,Bitu val,Bitu /*iolen*/) { pit[latch].counterstatus_set=false; latched_timerstatus_locked=false; } + pit[latch].go_read_latch = true; pit[latch].update_count = false; pit[latch].counting = false; pit[latch].read_state = (val >> 4) & 0x03;