1
0
mirror of https://github.com/rcornwell/sims.git synced 2026-01-11 23:52:48 +00:00

SCP: Updated to current.

This commit is contained in:
Richard Cornwell 2020-03-25 22:29:16 -04:00
parent c3ceb57063
commit 3354d99ce5
3 changed files with 33 additions and 4 deletions

30
scp.c
View File

@ -14778,8 +14778,34 @@ else {
*buf = '\0';
}
else { /* Decimal Number */
while (isdigit (*cptr))
*buf++ = *cptr++;
int digits = 0;
int commas = 0;
const char *cp = cptr;
/* Ignore commas in decimal numbers */
while (isdigit (*cp) || (*cp == ',')) {
if (*cp == ',')
++commas;
else
++digits;
++cp;
}
if ((commas > 0) && (commas != (digits - 1)/3)) {
*stat = SCPE_INVEXPR;
return cptr;
}
while (commas--) {
cp -= 4;
if (*cp != ',') {
*stat = SCPE_INVEXPR;
return cptr;
}
}
while (isdigit (*cptr) || (*cptr == ',')) {
if (*cptr != ',')
*buf++ = *cptr;
++cptr;
}
*buf = '\0';
}
}

1
scp.h
View File

@ -429,6 +429,7 @@ extern t_bool (*sim_vm_fprint_stopped) (FILE *st, t_stat reason);
extern t_value (*sim_vm_pc_value) (void);
extern t_bool (*sim_vm_is_subroutine_call) (t_addr **ret_addrs);
extern const char **sim_clock_precalibrate_commands;
extern int32 sim_vm_initial_ips; /* base estimate of simulated instructions per second */
extern const char *sim_vm_interval_units; /* Simulator can change this - default "instructions" */
extern const char *sim_vm_step_unit; /* Simulator can change this - default "instruction" */

View File

@ -150,6 +150,8 @@ return real_sim_os_ms_sleep (msec);
t_bool sim_idle_enab = FALSE; /* global flag */
volatile t_bool sim_idle_wait = FALSE; /* global flag */
int32 sim_vm_initial_ips = SIM_INITIAL_IPS;
static int32 sim_precalibrate_ips = SIM_INITIAL_IPS;
static int32 sim_calb_tmr = -1; /* the system calibrated timer */
static int32 sim_calb_tmr_last = -1; /* shadow value when at sim> prompt */
@ -3471,7 +3473,7 @@ sim_idle_stable = 0;
double
sim_host_speed_factor (void)
{
if (sim_precalibrate_ips > SIM_INITIAL_IPS)
if (sim_precalibrate_ips > sim_vm_initial_ips)
return 1.0;
return (double)SIM_INITIAL_IPS / (double)sim_precalibrate_ips;
return (double)sim_vm_initial_ips / (double)sim_precalibrate_ips;
}