mirror of
https://github.com/simh/simh.git
synced 2026-01-11 23:52:58 +00:00
Various VAXen: Correct HELP ROM language and assure proper ROM load
- Support for built-in ROMs and dynamically loaded or fetched ROMs is supported - Dynamic loading or fetching of VCB02 ROM support added.
This commit is contained in:
parent
1316482535
commit
c540d2e3b1
@ -229,15 +229,22 @@ return SCPE_OK;
|
||||
t_stat rom_help (FILE *st, DEVICE *dptr, UNIT *uptr, int32 flag, const char *cptr)
|
||||
{
|
||||
fprintf (st, "Read-only memory (ROM)\n\n");
|
||||
fprintf (st, "The boot ROM consists of a single unit, simulating the 256KB boot ROM. It has\n");
|
||||
fprintf (st, "The boot ROM consists of a single unit, simulating the %uKB boot ROM. It has\n", ROMSIZE >> 10);
|
||||
fprintf (st, "no registers. The boot ROM is loaded with a binary byte stream using the \n");
|
||||
fprintf (st, "LOAD -r command:\n\n");
|
||||
fprintf (st, " LOAD -r KA410.BIN load ROM image KA410.BIN\n\n");
|
||||
fprintf (st, " LOAD -r %s load ROM image %s\n\n", BOOT_CODE_FILENAME, BOOT_CODE_FILENAME);
|
||||
fprintf (st, "When the simulator starts running (via the BOOT command), if the ROM has\n");
|
||||
fprintf (st, "not yet been loaded, an attempt will be made to automatically load the\n");
|
||||
fprintf (st, "ROM image from the file ka410.bin in the current working directory.\n");
|
||||
fprintf (st, "If that load attempt fails, then a copy of the missing ROM file is\n");
|
||||
fprintf (st, "written to the current directory and the load attempt is retried.\n\n");
|
||||
if (BOOT_CODE_ARRAY != NULL) {
|
||||
fprintf (st, "not yet been loaded, an internal 'built-in' copy of the %s image\n", BOOT_CODE_FILENAME);
|
||||
fprintf (st, "will be loaded into the ROM address space.\n");
|
||||
}
|
||||
else {
|
||||
fprintf (st, "not yet been loaded, an attempt will be made to automatically load the\n");
|
||||
fprintf (st, "ROM image from the file %s in the current working directory.\n", BOOT_CODE_FILENAME);
|
||||
fprintf (st, "If that load attempt fails, then a copy of the missing ROM file is\n");
|
||||
fprintf (st, "written to the current directory and the load attempt is retried.\n");
|
||||
}
|
||||
fprintf (st, "Once the ROM address space has been populated execution will be started.\n\n");
|
||||
fprintf (st, "ROM accesses a use a calibrated delay that slows ROM-based execution to\n");
|
||||
fprintf (st, "about 500K instructions per second. This delay is required to make the\n");
|
||||
fprintf (st, "power-up self-test routines run correctly on very fast hosts.\n");
|
||||
|
||||
@ -259,15 +259,22 @@ return SCPE_OK;
|
||||
t_stat rom_help (FILE *st, DEVICE *dptr, UNIT *uptr, int32 flag, const char *cptr)
|
||||
{
|
||||
fprintf (st, "Read-only memory (ROM)\n\n");
|
||||
fprintf (st, "The boot ROM consists of a single unit, simulating the 256KB boot ROM. It has\n");
|
||||
fprintf (st, "The boot ROM consists of a single unit, simulating the %uKB boot ROM. It has\n", ROMSIZE >> 10);
|
||||
fprintf (st, "no registers. The boot ROM is loaded with a binary byte stream using the \n");
|
||||
fprintf (st, "LOAD -r command:\n\n");
|
||||
fprintf (st, " LOAD -r KA410.BIN load ROM image KA410.BIN\n\n");
|
||||
fprintf (st, " LOAD -r %s load ROM image %s\n\n", BOOT_CODE_FILENAME, BOOT_CODE_FILENAME);
|
||||
fprintf (st, "When the simulator starts running (via the BOOT command), if the ROM has\n");
|
||||
fprintf (st, "not yet been loaded, an attempt will be made to automatically load the\n");
|
||||
fprintf (st, "ROM image from the file ka410.bin in the current working directory.\n");
|
||||
fprintf (st, "If that load attempt fails, then a copy of the missing ROM file is\n");
|
||||
fprintf (st, "written to the current directory and the load attempt is retried.\n\n");
|
||||
if (BOOT_CODE_ARRAY != NULL) {
|
||||
fprintf (st, "not yet been loaded, an internal 'built-in' copy of the %s image\n", BOOT_CODE_FILENAME);
|
||||
fprintf (st, "will be loaded into the ROM address space.\n");
|
||||
}
|
||||
else {
|
||||
fprintf (st, "not yet been loaded, an attempt will be made to automatically load the\n");
|
||||
fprintf (st, "ROM image from the file %s in the current working directory.\n", BOOT_CODE_FILENAME);
|
||||
fprintf (st, "If that load attempt fails, then a copy of the missing ROM file is\n");
|
||||
fprintf (st, "written to the current directory and the load attempt is retried.\n");
|
||||
}
|
||||
fprintf (st, "Once the ROM address space has been populated execution will be started.\n\n");
|
||||
fprintf (st, "ROM accesses a use a calibrated delay that slows ROM-based execution to\n");
|
||||
fprintf (st, "about 500K instructions per second. This delay is required to make the\n");
|
||||
fprintf (st, "power-up self-test routines run correctly on very fast hosts.\n");
|
||||
|
||||
@ -344,15 +344,22 @@ return SCPE_OK;
|
||||
t_stat rom_help (FILE *st, DEVICE *dptr, UNIT *uptr, int32 flag, const char *cptr)
|
||||
{
|
||||
fprintf (st, "Read-only memory (ROM)\n\n");
|
||||
fprintf (st, "The boot ROM consists of a single unit, simulating the 64KB boot ROM. It has\n");
|
||||
fprintf (st, "The boot ROM consists of a single unit, simulating the %uKB boot ROM. It has\n", ROMSIZE >> 10);
|
||||
fprintf (st, "no registers. The boot ROM is loaded with a binary byte stream using the \n");
|
||||
fprintf (st, "LOAD -r command:\n\n");
|
||||
fprintf (st, " LOAD -r KA630.BIN load ROM image KA630.BIN\n\n");
|
||||
fprintf (st, " LOAD -r %s load ROM image %s\n\n", BOOT_CODE_FILENAME, BOOT_CODE_FILENAME);
|
||||
fprintf (st, "When the simulator starts running (via the BOOT command), if the ROM has\n");
|
||||
fprintf (st, "not yet been loaded, an attempt will be made to automatically load the\n");
|
||||
fprintf (st, "ROM image from the file ka655x.bin in the current working directory.\n");
|
||||
fprintf (st, "If that load attempt fails, then a copy of the missing ROM file is\n");
|
||||
fprintf (st, "written to the current directory and the load attempt is retried.\n\n");
|
||||
if (BOOT_CODE_ARRAY != NULL) {
|
||||
fprintf (st, "not yet been loaded, an internal 'built-in' copy of the %s image\n", BOOT_CODE_FILENAME);
|
||||
fprintf (st, "will be loaded into the ROM address space.\n");
|
||||
}
|
||||
else {
|
||||
fprintf (st, "not yet been loaded, an attempt will be made to automatically load the\n");
|
||||
fprintf (st, "ROM image from the file %s in the current working directory.\n", BOOT_CODE_FILENAME);
|
||||
fprintf (st, "If that load attempt fails, then a copy of the missing ROM file is\n");
|
||||
fprintf (st, "written to the current directory and the load attempt is retried.\n");
|
||||
}
|
||||
fprintf (st, "Once the ROM address space has been populated execution will be started.\n\n");
|
||||
fprintf (st, "ROM accesses a use a calibrated delay that slows ROM-based execution to\n");
|
||||
fprintf (st, "about 500K instructions per second. This delay is required to make the\n");
|
||||
fprintf (st, "power-up self-test routines run correctly on very fast hosts.\n");
|
||||
|
||||
@ -115,6 +115,7 @@ DEVICE *sim_devices[] = {
|
||||
|
||||
-r load ROM
|
||||
-n load NVR
|
||||
-v load VCB02 ROM
|
||||
-o for memory, specify origin
|
||||
*/
|
||||
|
||||
@ -122,6 +123,7 @@ t_stat sim_load (FILE *fileref, CONST char *cptr, CONST char *fnam, int flag)
|
||||
{
|
||||
t_stat r;
|
||||
int32 i;
|
||||
extern void va_mem_wr_B (int32 pa, int32 val);
|
||||
uint32 origin, limit, step = 1;
|
||||
|
||||
if (flag) /* dump? */
|
||||
@ -130,26 +132,40 @@ if (sim_switches & SWMASK ('R')) { /* ROM? */
|
||||
origin = ROMBASE;
|
||||
limit = ROMBASE + ROMSIZE;
|
||||
}
|
||||
else if (sim_switches & SWMASK ('N')) { /* NVR? */
|
||||
origin = NVRBASE;
|
||||
limit = NVRBASE + NVRASIZE;
|
||||
step = 2;
|
||||
}
|
||||
else {
|
||||
origin = 0; /* memory */
|
||||
limit = (uint32) cpu_unit.capac;
|
||||
if (sim_switches & SWMASK ('O')) { /* origin? */
|
||||
origin = (int32) get_uint (cptr, 16, 0xFFFFFFFF, &r);
|
||||
if (r != SCPE_OK)
|
||||
return SCPE_ARG;
|
||||
if (sim_switches & SWMASK ('N')) { /* NVR? */
|
||||
origin = NVRBASE;
|
||||
limit = NVRBASE + NVRASIZE;
|
||||
step = 2;
|
||||
}
|
||||
else {
|
||||
if (sim_switches & SWMASK ('V')) { /* VCB02 ROM? */
|
||||
origin = QDMBASE;
|
||||
limit = QDMBASE + QDMSIZE;
|
||||
step = 1;
|
||||
}
|
||||
else {
|
||||
origin = 0; /* memory */
|
||||
limit = (uint32) cpu_unit.capac;
|
||||
if (sim_switches & SWMASK ('O')) { /* origin? */
|
||||
origin = (int32) get_uint (cptr, 16, 0xFFFFFFFF, &r);
|
||||
if (r != SCPE_OK)
|
||||
return SCPE_ARG;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
while ((i = Fgetc (fileref)) != EOF) { /* read byte stream */
|
||||
while ((i = Fgetc (fileref)) != EOF) { /* read byte stream */
|
||||
if (origin >= limit) /* NXM? */
|
||||
return SCPE_NXM;
|
||||
if (sim_switches & SWMASK ('R')) /* ROM? */
|
||||
rom_wr_B (origin, i); /* not writeable */
|
||||
else WriteB (origin, i); /* store byte */
|
||||
else {
|
||||
if (sim_switches & SWMASK ('V')) /* VCB02 ROM? */
|
||||
va_mem_wr_B (origin, i);
|
||||
else
|
||||
WriteB (origin, i); /* store byte */
|
||||
}
|
||||
origin = origin + step;
|
||||
}
|
||||
return SCPE_OK;
|
||||
|
||||
@ -601,13 +601,22 @@ return SCPE_OK;
|
||||
t_stat rom_help (FILE *st, DEVICE *dptr, UNIT *uptr, int32 flag, const char *cptr)
|
||||
{
|
||||
fprintf (st, "Read-only memory (ROM)\n\n");
|
||||
fprintf (st, "The boot ROM consists of a single unit, simulating the 128KB boot ROM. It\n");
|
||||
fprintf (st, "The boot ROM consists of a single unit, simulating the %uKB boot ROM. It\n", ROMSIZE >> 10);
|
||||
fprintf (st, "has no registers. The boot ROM can be loaded with a binary byte stream\n");
|
||||
fprintf (st, "using the LOAD -r command:\n\n");
|
||||
fprintf (st, " LOAD -r KA655X.BIN load ROM image KA655X.BIN\n\n");
|
||||
fprintf (st, " LOAD -r %s load ROM image %s\n\n", BOOT_CODE_FILENAME, BOOT_CODE_FILENAME);
|
||||
fprintf (st, "When the simulator starts running (via the BOOT command), if the ROM has\n");
|
||||
fprintf (st, "not yet been loaded, an internal 'buit-in' copy of the KA655X.BIN image\n");
|
||||
fprintf (st, "will be loaded into the ROM address space and execution will be started.\n\n");
|
||||
if (BOOT_CODE_ARRAY != NULL) {
|
||||
fprintf (st, "not yet been loaded, an internal 'built-in' copy of the %s image\n", BOOT_CODE_FILENAME);
|
||||
fprintf (st, "will be loaded into the ROM address space.\n");
|
||||
}
|
||||
else {
|
||||
fprintf (st, "not yet been loaded, an attempt will be made to automatically load the\n");
|
||||
fprintf (st, "ROM image from the file %s in the current working directory.\n", BOOT_CODE_FILENAME);
|
||||
fprintf (st, "If that load attempt fails, then a copy of the missing ROM file is\n");
|
||||
fprintf (st, "written to the current directory and the load attempt is retried.\n");
|
||||
}
|
||||
fprintf (st, "Once the ROM address space has been populated execution will be started.\n\n");
|
||||
fprintf (st, "ROM accesses a use a calibrated delay that slows ROM-based execution to\n");
|
||||
fprintf (st, "about 500K instructions per second. This delay is required to make the\n");
|
||||
fprintf (st, "power-up self-test routines run correctly on very fast hosts.\n");
|
||||
|
||||
21
VAX/vax_va.c
21
VAX/vax_va.c
@ -170,6 +170,7 @@ uint32 va_palette[256]; /* Colour palette */
|
||||
|
||||
uint32 va_dla = 0; /* display list addr */
|
||||
uint32 va_rom_poll = 0;
|
||||
uint8 *va_rom = (uint8 *)BOOT_CODE_ARRAY; /* VCB02 ROM */
|
||||
|
||||
/* debug variables */
|
||||
|
||||
@ -551,7 +552,7 @@ int32 va_mem_rd (int32 pa)
|
||||
{
|
||||
int32 rg = (pa >> 1) & 0x7FFF;
|
||||
int32 data;
|
||||
uint16 *qr = (uint16*) vax_vcb02_bin;
|
||||
uint16 *qr = (uint16*)va_rom;
|
||||
|
||||
if (rg >= VA_RSV_OF) {
|
||||
return 0;
|
||||
@ -610,6 +611,12 @@ sim_debug (DBG_ROM, &va_dev, "rom_rd: %X, %X from PC %08X\n", pa, data, fault_PC
|
||||
return sim_rom_read_with_delay (data);
|
||||
}
|
||||
|
||||
/* Loading ROM support */
|
||||
void va_mem_wr_B (int32 pa, int32 val)
|
||||
{
|
||||
va_rom[pa - QDMBASE] = val;
|
||||
}
|
||||
|
||||
void va_mem_wr (int32 pa, int32 val, int32 lnt)
|
||||
{
|
||||
int32 nval, i;
|
||||
@ -1106,6 +1113,18 @@ if (dptr->flags & DEV_DIS) {
|
||||
else
|
||||
return SCPE_OK;
|
||||
}
|
||||
else {
|
||||
if (va_rom == NULL) {
|
||||
int32 saved_switches = sim_switches;
|
||||
|
||||
va_rom = (uint8*)calloc (BOOT_CODE_SIZE, 1);
|
||||
sim_switches = SWMASK ('V');
|
||||
r = cpu_load_bootcode (BOOT_CODE_FILENAME, BOOT_CODE_ARRAY, BOOT_CODE_SIZE, FALSE, 0, BOOT_CODE_FILEPATH, BOOT_CODE_CHECKSUM);
|
||||
sim_switches = saved_switches;
|
||||
if (r != SCPE_OK)
|
||||
return r;
|
||||
}
|
||||
}
|
||||
|
||||
if (!vid_active) {
|
||||
r = vid_open (dptr, NULL, VA_XSIZE, VA_YSIZE, va_input_captured ? SIM_VID_INPUTCAPTURED : 0);/* display size & capture mode */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user