From 263e0e7ed548dfd1004d9838984ea9b2501e13f8 Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Thu, 29 Oct 2020 13:28:41 -0700 Subject: [PATCH] AltairZ80, BESM6, I7094: Adopt internal SCP internal time base --- AltairZ80/altairz80_sio.c | 4 ++-- AltairZ80/m68ksim.c | 2 +- AltairZ80/s100_ss1.c | 2 +- BESM6/besm6_cpu.c | 2 +- BESM6/besm6_tty.c | 6 +++--- I7094/i7094_clk.c | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/AltairZ80/altairz80_sio.c b/AltairZ80/altairz80_sio.c index 4bdeb45d..5b0ca681 100644 --- a/AltairZ80/altairz80_sio.c +++ b/AltairZ80/altairz80_sio.c @@ -1774,7 +1774,7 @@ static int32 simh_out(const int32 port, const int32 data) { break; case getClockZSDOSCmd: - time(&now); + sim_get_time(&now); now += ClockZSDOSDelta; currentTime = *localtime(&now); currentTimeValid = TRUE; @@ -1786,7 +1786,7 @@ static int32 simh_out(const int32 port, const int32 data) { break; case getClockCPM3Cmd: - time(&now); + sim_get_time(&now); now += ClockCPM3Delta; currentTime = *localtime(&now); currentTimeValid = TRUE; diff --git a/AltairZ80/m68ksim.c b/AltairZ80/m68ksim.c index 6e2c7af8..cfb5a04d 100644 --- a/AltairZ80/m68ksim.c +++ b/AltairZ80/m68ksim.c @@ -379,7 +379,7 @@ unsigned int m68k_cpu_read_long(unsigned int address) { case DISK_STATUS: return hdsk_getStatus(); case M68K_GET_TIME: - return (unsigned int)(time(NULL)); + return (unsigned int)(sim_get_time(NULL)); default: break; } diff --git a/AltairZ80/s100_ss1.c b/AltairZ80/s100_ss1.c index a822ba2f..171e75c2 100644 --- a/AltairZ80/s100_ss1.c +++ b/AltairZ80/s100_ss1.c @@ -378,7 +378,7 @@ static uint8 SS1_Read(const uint32 Addr) " RD: RTC Cmd=0x%02x.\n", PCX, cData); break; case SS1_RTC_DATA: - time(&now); + sim_get_time(&now); now += ss1_rtc[0].clockDelta; currentTime = *localtime(&now); diff --git a/BESM6/besm6_cpu.c b/BESM6/besm6_cpu.c index 3e197b65..ce3641bf 100644 --- a/BESM6/besm6_cpu.c +++ b/BESM6/besm6_cpu.c @@ -819,7 +819,7 @@ void check_initial_setup () /* Яч. ГОД обновляем самостоятельно */ time_t t; t_value date; - time(&t); + sim_get_time(&t); d = localtime(&t); ++d->tm_mon; date = (t_value) (d->tm_mday / 10) << 33 | diff --git a/BESM6/besm6_tty.c b/BESM6/besm6_tty.c index 87dee8e5..0efe2e89 100644 --- a/BESM6/besm6_tty.c +++ b/BESM6/besm6_tty.c @@ -239,7 +239,7 @@ t_stat vt_clk (UNIT * this) } tmxr_linemsg (t, buf); tty_idle_count[num] = 0; - tty_last_time[num] = time (0); + tty_last_time[num] = sim_get_time (0); sprintf (buf, "%.24s from %s\r\n", ctime (&tty_last_time[num]), t->ipad); @@ -1061,7 +1061,7 @@ int vt_getc (int num) /* A telnet line. */ c = tmxr_getc_ln (t); if (! (c & TMXR_VALID)) { - now = time (0); + now = sim_get_time (0); if (now > tty_last_time[num] + 5*60) { ++tty_idle_count[num]; if (tty_idle_count[num] > 3) { @@ -1075,7 +1075,7 @@ int vt_getc (int num) return -1; } tty_idle_count[num] = 0; - tty_last_time[num] = time (0); + tty_last_time[num] = sim_get_time (0); if (tty_unit[num].flags & TTY_CMDLINE_MASK) { /* Continuing CLI mode. */ diff --git a/I7094/i7094_clk.c b/I7094/i7094_clk.c index e533339f..408f43f7 100644 --- a/I7094/i7094_clk.c +++ b/I7094/i7094_clk.c @@ -90,7 +90,7 @@ struct tm *tptr; if (bufsiz < 12) return 0; -curtim = time (NULL); /* get time */ +curtim = sim_get_time (NULL); /* get time */ tptr = localtime (&curtim); /* decompose */ if (tptr == NULL) /* error? */ return 0;