Skip to content

Commit

Permalink
rtc
Browse files Browse the repository at this point in the history
  • Loading branch information
folkertvanheusden committed Aug 31, 2023
1 parent f63e14d commit d60de75
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions XT.cs
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,20 @@ private bool InterceptInt(int nr) // TODO rename
SetFlagC(false);
return true;
}
else if (nr == 0x1a) {
if (_ah == 0x02) {
DateTime now = DateTime.Now;

// convert to BCD
_ch = (byte)(((now.Hour / 10) << 4) | (now.Hour % 10));
_cl = (byte)(((now.Minute / 10) << 4) | (now.Minute % 10));
_dh = (byte)(((now.Second / 10) << 4) | (now.Second % 10));
_dl = 0;

SetFlagC(false);
return true;
}
}
else
{
#if DEBUG
Expand Down

0 comments on commit d60de75

Please sign in to comment.