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

SCP: Search for startup simh.ini in reasonable platform specific locations

This commit is contained in:
Mark Pizzolato 2025-08-10 09:10:33 -10:00
parent fe8f7e4e46
commit 9fbd3e222e
3 changed files with 24 additions and 1 deletions

View File

@ -107,6 +107,7 @@ Simulator binaries for x86 Linus, x86 macOS, and Windows for all recent changes
- EXAMINE memory commands will now produce minimal output that summarizes multiple successive locations with the same contents and may be aborted by SIGINT (Control-C).
- Ethernet enhancements on all platforms and and much simplified platform support on macOS.
- Almost all existing simulators have useful SET CONSOLE SPEED=nnn behaviors in both the bare console session as well as TELNET console sessions.
- Simh global/startup configuration commands can be contained in the first of simh.ini found in: 1) The current working directory, 2) The User login directory, 3) The directory containing the simulator executable, 4) The ~/Library/Preferences directory, 5) The /Library/Preferences directory, or 6) The /etc directory.
#### All simulators build cleanly under OpenVMS on ia64 systems.
@ -196,7 +197,7 @@ Simulator binaries for x86 Linus, x86 macOS, and Windows for all recent changes
#### CDC 1700 simulator from John Forecast
#### Hans-Åke Lund has implemented an SCELBI (SCientic-ELectronics-BIology) simulator.
#### Hans-<EFBFBD>ke Lund has implemented an SCELBI (SCientic-ELectronics-BIology) simulator.
#### IBM 650 simulator from Roberto Sancho Villa

Binary file not shown.

22
scp.c
View File

@ -3281,6 +3281,28 @@ if (docmdp) {
stat = SCPE_OPENERR;
if (SCPE_BARE_STATUS(stat) == SCPE_OPENERR)
stat = docmdp->action (-1, "simh.ini"); /* simh.ini proc cmd file */
if ((SCPE_BARE_STATUS(stat) == SCPE_OPENERR) &&
(*argv[0])) { /* sim name arg? */
char *np; /* "path.ini" */
nbuf[0] = '"'; /* starting " */
strlcpy (nbuf + 1, argv[0], PATH_MAX + 2); /* copy sim path-name */
if (((np = strrchr (nbuf, '/')) != NULL) ||
((np = strrchr (nbuf, '\\')) != NULL)) {
*(np + 1) = '\0';
strlcat (nbuf, "simh.ini\"", sizeof (nbuf));
stat = docmdp->action (-1, nbuf); /* simh.ini proc cmd file */
}
else /* No / or \, then we're looking at for simh.ini in the */
stat = stat; /* current working directory which we've already checked */
}
if (SCPE_BARE_STATUS(stat) == SCPE_OPENERR) {
snprintf(nbuf, sizeof (nbuf), "\"%s%s%sLibrary%sPreferences%ssimh.ini\"", cptr2 ? cptr2 : "", cptr, strchr (cptr, '/') ? "/" : "\\", strchr (cptr, '/') ? "/" : "\\", strchr (cptr, '/') ? "/" : "\\");
stat = docmdp->action (-1, nbuf); /* simh.ini proc cmd file */
}
if (SCPE_BARE_STATUS(stat) == SCPE_OPENERR)
stat = docmdp->action (-1, "/Library/Preferences/simh.ini");/* simh.ini proc cmd file */
if (SCPE_BARE_STATUS(stat) == SCPE_OPENERR)
stat = docmdp->action (-1, "/etc/simh.ini"); /* simh.ini proc cmd file */
if (*cbuf) /* cmd file arg? */
stat = docmdp->action (0, cbuf); /* proc cmd file */
else {