SCP: Allow unattached errors to halt with a specific unattached message

This commit is contained in:
Mark Pizzolato 2022-03-03 17:40:27 -08:00
parent 4991701ee6
commit abd756ebad

13
scp.c
View file

@ -11972,8 +11972,12 @@ do {
(bare_reason != SCPE_STOP) &&
(bare_reason != SCPE_STEP) &&
(bare_reason != SCPE_RUNTIME) &&
(bare_reason != SCPE_EXIT))
sim_messagef (reason, "\nUnexpected internal error while processing event for %s which returned %d - %s\n", sim_uname (uptr), reason, sim_error_text (reason));
(bare_reason != SCPE_EXIT)) {
if (bare_reason == SCPE_UNATT)
sim_messagef (reason, "\nUnexpected I/O error while processing event for %s - %s\n", sim_uname (uptr), sim_error_text (reason));
else
sim_messagef (reason, "\nUnexpected internal error while processing event for %s which returned %d - %s\n", sim_uname (uptr), reason, sim_error_text (reason));
}
} while ((reason == SCPE_OK) &&
((sim_interval + sim_interval_catchup) <= 0) &&
(sim_clock_queue != QUEUE_LIST_END) &&
@ -13942,10 +13946,13 @@ va_list arglist;
t_bool inhibit_message = (!sim_show_message || (stat & SCPE_NOMESSAGE));
char msg_prefix[32] = "";
size_t prefix_len;
t_bool newline_prefix = (*fmt == '\n');
if ((stat == SCPE_OK) && (sim_quiet || (sim_switches & SWMASK ('Q'))))
return stat;
sprintf (msg_prefix, "%%SIM-%s: ", (stat == SCPE_OK) ? "INFO" : "ERROR");
if (newline_prefix)
++fmt;
sprintf (msg_prefix, "%s%%SIM-%s: ", newline_prefix ? (sim_is_running ? "\r\n" : "\n") : "", (stat == SCPE_OK) ? "INFO" : "ERROR");
prefix_len = strlen (msg_prefix);
while (1) { /* format passed string, args */
va_start (arglist, fmt);