VAX, MicroVAX1, MicroVAX2: Provide consistent messages when attempting to change CPU Model.

As discussed in issue #269
This commit is contained in:
Mark Pizzolato 2016-01-21 07:37:06 -08:00
parent 2459a4c697
commit 688416a4d7
6 changed files with 16 additions and 12 deletions

View file

@ -87,7 +87,7 @@
#define CPU_MODEL_MODIFIERS { MTAB_XTD|MTAB_VDV, 0, "LEDS", NULL, \ #define CPU_MODEL_MODIFIERS { MTAB_XTD|MTAB_VDV, 0, "LEDS", NULL, \
NULL, &cpu_show_leds, NULL, "Display the CPU LED values" }, \ NULL, &cpu_show_leds, NULL, "Display the CPU LED values" }, \
{ MTAB_XTD|MTAB_VDV, 0, "MODEL", "MODEL={MICROVAX|VAXSTATION}", \ { MTAB_XTD|MTAB_VDV, 0, "MODEL", "MODEL={MicroVAX|VAXStation}", \
&cpu_set_model, &cpu_show_model, NULL, "Set/Show the simulator CPU Model" } &cpu_set_model, &cpu_show_model, NULL, "Set/Show the simulator CPU Model" }
/* QVSS memory space */ /* QVSS memory space */

View file

@ -533,7 +533,6 @@ return "system devices";
t_stat cpu_set_model (UNIT *uptr, int32 val, char *cptr, void *desc) t_stat cpu_set_model (UNIT *uptr, int32 val, char *cptr, void *desc)
{ {
#if defined(HAVE_LIBSDL)
char gbuf[CBUFSIZE]; char gbuf[CBUFSIZE];
if ((cptr == NULL) || (!*cptr)) if ((cptr == NULL) || (!*cptr))
@ -541,26 +540,29 @@ if ((cptr == NULL) || (!*cptr))
cptr = get_glyph (cptr, gbuf, 0); cptr = get_glyph (cptr, gbuf, 0);
if (MATCH_CMD(gbuf, "MICROVAX") == 0) { if (MATCH_CMD(gbuf, "MICROVAX") == 0) {
sys_model = 0; sys_model = 0;
#if defined(USE_SIM_VIDEO) && defined(HAVE_LIBSDL)
vc_dev.flags = vc_dev.flags | DEV_DIS; /* disable QVSS */ vc_dev.flags = vc_dev.flags | DEV_DIS; /* disable QVSS */
lk_dev.flags = lk_dev.flags | DEV_DIS; /* disable keyboard */ lk_dev.flags = lk_dev.flags | DEV_DIS; /* disable keyboard */
vs_dev.flags = vs_dev.flags | DEV_DIS; /* disable mouse */ vs_dev.flags = vs_dev.flags | DEV_DIS; /* disable mouse */
#endif
strcpy (sim_name, "MicroVAX I (KA610)"); strcpy (sim_name, "MicroVAX I (KA610)");
reset_all (0); /* reset everything */ reset_all (0); /* reset everything */
} }
else if (MATCH_CMD(gbuf, "VAXSTATION") == 0) { else if (MATCH_CMD(gbuf, "VAXSTATION") == 0) {
#if defined(USE_SIM_VIDEO) && defined(HAVE_LIBSDL)
sys_model = 1; sys_model = 1;
vc_dev.flags = vc_dev.flags & ~DEV_DIS; /* enable QVSS */ vc_dev.flags = vc_dev.flags & ~DEV_DIS; /* enable QVSS */
lk_dev.flags = lk_dev.flags & ~DEV_DIS; /* enable keyboard */ lk_dev.flags = lk_dev.flags & ~DEV_DIS; /* enable keyboard */
vs_dev.flags = vs_dev.flags & ~DEV_DIS; /* enable mouse */ vs_dev.flags = vs_dev.flags & ~DEV_DIS; /* enable mouse */
strcpy (sim_name, "VAXStation I (KA610)"); strcpy (sim_name, "VAXStation I (KA610)");
reset_all (0); /* reset everything */ reset_all (0); /* reset everything */
#else
return sim_messagef(SCPE_ARG, "Simulator built without Graphic Device Support");
#endif
} }
else else
return SCPE_ARG; return SCPE_ARG;
return SCPE_OK; return SCPE_OK;
#else
return SCPE_NOFNC;
#endif
} }
t_stat cpu_print_model (FILE *st) t_stat cpu_print_model (FILE *st)

View file

@ -91,7 +91,7 @@
/* CPU */ /* CPU */
#define CPU_MODEL_MODIFIERS { MTAB_XTD|MTAB_VDV, 0, "MODEL", "MODEL={MICROVAX|VAXSTATION}", \ #define CPU_MODEL_MODIFIERS { MTAB_XTD|MTAB_VDV, 0, "MODEL", "MODEL={MicroVAX|VAXStation}", \
&cpu_set_model, &cpu_show_model, NULL, "Set/Show the simulator CPU Model" }, \ &cpu_set_model, &cpu_show_model, NULL, "Set/Show the simulator CPU Model" }, \
{ MTAB_XTD|MTAB_VDV, 0, "DIAG", "DIAG={FULL|MIN}", \ { MTAB_XTD|MTAB_VDV, 0, "DIAG", "DIAG={FULL|MIN}", \
&sysd_set_diag, &sysd_show_diag, NULL, "Set/Show boot rom diagnostic mode" }, \ &sysd_set_diag, &sysd_show_diag, NULL, "Set/Show boot rom diagnostic mode" }, \

View file

@ -1049,7 +1049,6 @@ return SCPE_OK;
t_stat cpu_set_model (UNIT *uptr, int32 val, char *cptr, void *desc) t_stat cpu_set_model (UNIT *uptr, int32 val, char *cptr, void *desc)
{ {
#if defined(USE_SIM_VIDEO) && defined(HAVE_LIBSDL)
char gbuf[CBUFSIZE]; char gbuf[CBUFSIZE];
if ((cptr == NULL) || (!*cptr)) if ((cptr == NULL) || (!*cptr))
@ -1057,26 +1056,29 @@ if ((cptr == NULL) || (!*cptr))
cptr = get_glyph (cptr, gbuf, 0); cptr = get_glyph (cptr, gbuf, 0);
if (MATCH_CMD(gbuf, "MICROVAX") == 0) { if (MATCH_CMD(gbuf, "MICROVAX") == 0) {
sys_model = 0; sys_model = 0;
#if defined(USE_SIM_VIDEO) && defined(HAVE_LIBSDL)
vc_dev.flags = vc_dev.flags | DEV_DIS; /* disable QVSS */ vc_dev.flags = vc_dev.flags | DEV_DIS; /* disable QVSS */
lk_dev.flags = lk_dev.flags | DEV_DIS; /* disable keyboard */ lk_dev.flags = lk_dev.flags | DEV_DIS; /* disable keyboard */
vs_dev.flags = vs_dev.flags | DEV_DIS; /* disable mouse */ vs_dev.flags = vs_dev.flags | DEV_DIS; /* disable mouse */
#endif
strcpy (sim_name, "MicroVAX II (KA630)"); strcpy (sim_name, "MicroVAX II (KA630)");
reset_all (0); /* reset everything */ reset_all (0); /* reset everything */
} }
else if (MATCH_CMD(gbuf, "VAXSTATION") == 0) { else if (MATCH_CMD(gbuf, "VAXSTATION") == 0) {
#if defined(USE_SIM_VIDEO) && defined(HAVE_LIBSDL)
sys_model = 1; sys_model = 1;
vc_dev.flags = vc_dev.flags & ~DEV_DIS; /* enable QVSS */ vc_dev.flags = vc_dev.flags & ~DEV_DIS; /* enable QVSS */
lk_dev.flags = lk_dev.flags & ~DEV_DIS; /* enable keyboard */ lk_dev.flags = lk_dev.flags & ~DEV_DIS; /* enable keyboard */
vs_dev.flags = vs_dev.flags & ~DEV_DIS; /* enable mouse */ vs_dev.flags = vs_dev.flags & ~DEV_DIS; /* enable mouse */
strcpy (sim_name, "VAXStation II (KA630)"); strcpy (sim_name, "VAXStation II (KA630)");
reset_all (0); /* reset everything */ reset_all (0); /* reset everything */
#else
return sim_messagef(SCPE_ARG, "Simulator built without Graphic Device Support");
#endif
} }
else else
return SCPE_ARG; return SCPE_ARG;
return SCPE_OK; return SCPE_OK;
#else
return SCPE_NOFNC;
#endif
} }
t_stat cpu_print_model (FILE *st) t_stat cpu_print_model (FILE *st)

View file

@ -1845,7 +1845,7 @@ else if (MATCH_CMD(gbuf, "VAXSTATION") == 0) {
vs_dev.flags = vs_dev.flags & ~DEV_DIS; /* enable mouse */ vs_dev.flags = vs_dev.flags & ~DEV_DIS; /* enable mouse */
reset_all (0); /* reset everything */ reset_all (0); /* reset everything */
#else #else
return SCPE_ARG; return sim_messagef(SCPE_ARG, "Simulator built without Graphic Device Support");
#endif #endif
} }
else else

View file

@ -128,7 +128,7 @@
{ UNIT_MSIZE, (1u << 29), NULL, "512M", &cpu_set_size, NULL, NULL, "Set Memory to 512M bytes" }, \ { UNIT_MSIZE, (1u << 29), NULL, "512M", &cpu_set_size, NULL, NULL, "Set Memory to 512M bytes" }, \
{ MTAB_XTD|MTAB_VDV|MTAB_NMO, 0, "MEMORY", NULL, NULL, &cpu_show_memory, NULL, "Display memory configuration" } { MTAB_XTD|MTAB_VDV|MTAB_NMO, 0, "MEMORY", NULL, NULL, &cpu_show_memory, NULL, "Display memory configuration" }
extern t_stat cpu_show_memory (FILE* st, UNIT* uptr, int32 val, void* desc); extern t_stat cpu_show_memory (FILE* st, UNIT* uptr, int32 val, void* desc);
#define CPU_MODEL_MODIFIERS { MTAB_XTD|MTAB_VDV, 0, "MODEL", "MODEL={VAXServer|MicroVAX}", \ #define CPU_MODEL_MODIFIERS { MTAB_XTD|MTAB_VDV, 0, "MODEL", "MODEL={VAXServer|MicroVAX|VAXStation}", \
&cpu_set_model, &cpu_show_model, NULL, "Set/Display processor model" }, \ &cpu_set_model, &cpu_show_model, NULL, "Set/Display processor model" }, \
{ MTAB_XTD|MTAB_VDV, 0, "AUTOBOOT", "AUTOBOOT", \ { MTAB_XTD|MTAB_VDV, 0, "AUTOBOOT", "AUTOBOOT", \
&sysd_set_halt, &sysd_show_halt, NULL, "Enable autoboot (Disable Halt)" }, \ &sysd_set_halt, &sysd_show_halt, NULL, "Enable autoboot (Disable Halt)" }, \