AltairZ80: Additional updates for SCP internal time base

This commit is contained in:
Peter Schorn 2020-10-30 09:52:56 +01:00
parent e1ca936ab9
commit 199adf7641
4 changed files with 4 additions and 7 deletions

View file

@ -6166,7 +6166,7 @@ static t_stat sim_instr_mmu (void) {
/* simulation halted */ /* simulation halted */
PC_S = ((reason == STOP_OPCODE) || (reason == STOP_MEM)) ? PCX : (PC & ADDRMASK); PC_S = ((reason == STOP_OPCODE) || (reason == STOP_MEM)) ? PCX : (PC & ADDRMASK);
if ((cpu_unit.flags & UNIT_CPU_BANKED) && (PC_S < common)) if ((cpu_unit.flags & UNIT_CPU_BANKED) && ((uint32)PC_S < common))
PC_S |= bankSelect << MAXBANKSIZELOG2; PC_S |= bankSelect << MAXBANKSIZELOG2;
pcq_r -> qptr = pcq_p; /* update pc q ptr */ pcq_r -> qptr = pcq_p; /* update pc q ptr */
AF_S = AF; AF_S = AF;

View file

@ -54,7 +54,6 @@
#include "altairz80_defs.h" #include "altairz80_defs.h"
#include "sim_sock.h" #include "sim_sock.h"
#include "sim_tmxr.h" #include "sim_tmxr.h"
#include <time.h>
uint8 *URLContents(const char *URL, uint32 *length); uint8 *URLContents(const char *URL, uint32 *length);
#ifndef URL_READER_SUPPORT #ifndef URL_READER_SUPPORT
@ -1366,7 +1365,7 @@ static void setClockZSDOS(void) {
newTime.tm_min = fromBCD(GetBYTEWrapper(setClockZSDOSAdr + 4)); newTime.tm_min = fromBCD(GetBYTEWrapper(setClockZSDOSAdr + 4));
newTime.tm_sec = fromBCD(GetBYTEWrapper(setClockZSDOSAdr + 5)); newTime.tm_sec = fromBCD(GetBYTEWrapper(setClockZSDOSAdr + 5));
newTime.tm_isdst = 0; newTime.tm_isdst = 0;
ClockZSDOSDelta = (int32)(mktime(&newTime) - time(NULL)); ClockZSDOSDelta = (int32)(mktime(&newTime) - sim_get_time(NULL));
} }
#define SECONDS_PER_MINUTE 60 #define SECONDS_PER_MINUTE 60
@ -1401,7 +1400,7 @@ static void setClockCPM3(void) {
targetDate.tm_hour = fromBCD(GetBYTEWrapper(setClockCPM3Adr + 2)); targetDate.tm_hour = fromBCD(GetBYTEWrapper(setClockCPM3Adr + 2));
targetDate.tm_min = fromBCD(GetBYTEWrapper(setClockCPM3Adr + 3)); targetDate.tm_min = fromBCD(GetBYTEWrapper(setClockCPM3Adr + 3));
targetDate.tm_sec = fromBCD(GetBYTEWrapper(setClockCPM3Adr + 4)); targetDate.tm_sec = fromBCD(GetBYTEWrapper(setClockCPM3Adr + 4));
ClockCPM3Delta = (int32)(mktime(&targetDate) - time(NULL)); ClockCPM3Delta = (int32)(mktime(&targetDate) - sim_get_time(NULL));
} }
static int32 simh_in(const int32 port) { static int32 simh_in(const int32 port) {

View file

@ -43,7 +43,6 @@
/*#define DBG_MSG */ /*#define DBG_MSG */
#include "altairz80_defs.h" #include "altairz80_defs.h"
#include <time.h>
#ifdef DBG_MSG #ifdef DBG_MSG
#define DBG_PRINT(args) sim_printf args #define DBG_PRINT(args) sim_printf args

View file

@ -43,7 +43,6 @@
/*#define DBG_MSG */ /*#define DBG_MSG */
#include "altairz80_defs.h" #include "altairz80_defs.h"
#include <time.h>
#ifdef DBG_MSG #ifdef DBG_MSG
#define DBG_PRINT(args) sim_printf args #define DBG_PRINT(args) sim_printf args
@ -469,7 +468,7 @@ static void setClockSS1(void) {
newTime.tm_isdst = -1; newTime.tm_isdst = -1;
newTime_t = mktime(&newTime); newTime_t = mktime(&newTime);
if (newTime_t != (time_t)-1) if (newTime_t != (time_t)-1)
ss1_rtc[0].clockDelta = (int32)(newTime_t - time(NULL)); ss1_rtc[0].clockDelta = (int32)(newTime_t - sim_get_time(NULL));
} }
static void generate_ss1_interrupt(void); static void generate_ss1_interrupt(void);