From d6037bb2fe8cd09fc3c570fd22b7e350f31c29f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Strohh=C3=A4cker?= Date: Tue, 9 Jan 2007 18:24:50 +0000 Subject: [PATCH] Add beta2 patch: add rtc irq acknowledging (fixes Fury) Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@2743 --- src/hardware/cmos.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/hardware/cmos.cpp b/src/hardware/cmos.cpp index 706427fc..f5ff406e 100644 --- a/src/hardware/cmos.cpp +++ b/src/hardware/cmos.cpp @@ -35,6 +35,7 @@ static struct { bool enabled; Bit8u div; float delay; + bool acknowledged; } timer; struct { double timer; @@ -45,7 +46,10 @@ static struct { } cmos; static void cmos_timerevent(Bitu val) { - PIC_ActivateIRQ(8); + if (cmos.timer.acknowledged) { + cmos.timer.acknowledged=false; + PIC_ActivateIRQ(8); + } if (cmos.timer.enabled) { PIC_AddEvent(cmos_timerevent,cmos.timer.delay); cmos.regs[0xc] = 0xC0;//Contraption Zack (music) @@ -155,6 +159,7 @@ static Bitu cmos_readreg(Bitu port,Bitu iolen) { return (cmos.regs[0x0a]&0x7f); } case 0x0c: /* Status register C */ + cmos.timer.acknowledged=true; if (cmos.timer.enabled) { /* In periodic interrupt mode only care for those flags */ Bit8u val=cmos.regs[0xc]; @@ -286,6 +291,7 @@ public: WriteHandler[1].Install(0x71,cmos_writereg,IO_MB); ReadHandler[0].Install(0x71,cmos_readreg,IO_MB); cmos.timer.enabled=false; + cmos.timer.acknowledged=true; cmos.reg=0xa; cmos_writereg(0x71,0x26,1); cmos.reg=0xb;