Browse Source

Crude implementation for cmos A update-in-progress bit

Fabian 1 year ago
parent
commit
1a27b72311
1 changed files with 7 additions and 0 deletions
  1. 7 0
      src/rtc.js

+ 7 - 0
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));