1
0
mirror of https://github.com/open-simh/simh.git synced 2026-04-26 04:07:23 +00:00

Added support for embedded ROM images in simulators.

This allows a single simulator executable to be a completely useful component (for those simulators which dynamically load ROM or other boot code).
Meanwhile, we continues to allow the explicit use of a user's preferred ROM or other boot code as well.
A build option is provided in the makefile to not build with the included ROM functionality if desired.
This commit is contained in:
Mark Pizzolato
2011-09-23 13:07:14 -07:00
parent 312bc9a967
commit cb35f6c97b
11 changed files with 12067 additions and 602 deletions

View File

@@ -54,6 +54,10 @@
#include "vax_defs.h"
#ifndef DONT_USE_INTERNAL_ROM
#include "vax_ka655x_bin.h"
#endif
#define UNIT_V_NODELAY (UNIT_V_UF + 0) /* ROM access equal to RAM access */
#define UNIT_NODELAY (1u << UNIT_V_NODELAY)
@@ -1555,8 +1559,24 @@ if (*rom == 0) { /* no boot? */
if (sim_log)
fprintf (sim_log, "Loading boot code from ka655x.bin\n");
r = load_cmd (0, "-R ka655x.bin");
if (r != SCPE_OK)
if (r != SCPE_OK) {
#ifndef DONT_USE_INTERNAL_ROM
FILE *f;
if (f = sim_fopen ("ka655x.bin", "wb")) {
printf ("Saving boot code to ka655x.bin\n");
if (sim_log)
fprintf (sim_log, "Saving boot code to ka655x.bin\n");
sim_fwrite (vax_ka655x_bin, sizeof(vax_ka655x_bin[0]), sizeof(vax_ka655x_bin)/sizeof(vax_ka655x_bin[0]), f);
fclose (f);
printf ("Loading boot code from ka655x.bin\n");
if (sim_log)
fprintf (sim_log, "Loading boot code from ka655x.bin\n");
r = load_cmd (0, "-R ka655x.bin");
}
#endif
return r;
}
}
sysd_powerup ();
return SCPE_OK;