From 1a27b7231179c15d54173049597e7d18fb4acbcb Mon Sep 17 00:00:00 2001 From: Fabian Date: Wed, 7 Sep 2022 20:18:25 +0900 Subject: [PATCH] Crude implementation for cmos A update-in-progress bit --- src/rtc.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/rtc.js b/src/rtc.js index ce44c9a3..4468faf1 100644 --- a/src/rtc.js +++ b/src/rtc.js @@ -242,6 +242,13 @@ RTC.prototype.cmos_port_read = function() return this.encode_time(new Date(this.rtc_time).getUTCFullYear() % 100); case CMOS_STATUS_A: + if(v86.microtick() % 1000 >= 999) + { + // Set update-in-progress for one millisecond every second (we + // may not have precision higher than that in browser + // environments) + return this.cmos_a | 0x80; + } return this.cmos_a; case CMOS_STATUS_B: //dbg_log("cmos read from index " + h(index));