CDC1700: Retire use of sim_vm_init and invoke init logic from cpu_reset

This commit is contained in:
John Forecast 2020-01-29 15:11:34 -08:00 committed by Mark Pizzolato
parent 8a858c181d
commit a6701c1349
2 changed files with 5 additions and 9 deletions

View file

@ -171,6 +171,7 @@ extern int disassem(char *, uint16, t_bool, t_bool, t_bool);
extern enum IOstatus doIO(t_bool, DEVICE **); extern enum IOstatus doIO(t_bool, DEVICE **);
extern void fw_init(void); extern void fw_init(void);
extern void VMinit(void);
extern void rebuildPending(void); extern void rebuildPending(void);
extern void dev1Interrupts(char *); extern void dev1Interrupts(char *);
@ -401,6 +402,8 @@ t_stat cpu_reset(DEVICE *dptr)
for (i = 0; i < 16; i++) for (i = 0; i < 16; i++)
CharAddrMode[i] = 0; CharAddrMode[i] = 0;
VMinit();
return SCPE_OK; return SCPE_OK;
} }

View file

@ -145,22 +145,15 @@ static void printAddress(FILE *st, DEVICE *dptr, t_addr addr)
} }
/* /*
* Once-only VM initialization * VM initialization
*/ */
static void VMinit(void) void VMinit(void)
{ {
sim_vm_sprint_addr = &sprintAddress; sim_vm_sprint_addr = &sprintAddress;
sim_vm_fprint_addr = &printAddress; sim_vm_fprint_addr = &printAddress;
sim_vm_post = &postUpdate; sim_vm_post = &postUpdate;
sim_vm_cmd = cdc1700_cmd; sim_vm_cmd = cdc1700_cmd;
/*
* Initialize the "CPU" device to make sure the data structures are
* correctly initialized.
*/
(cpu_dev.reset)(&cpu_dev);
} }
void (*sim_vm_init)(void) = &VMinit;
/* /*
* Check for duplicate equipment addresses. * Check for duplicate equipment addresses.