mirror of
https://github.com/simh/simh.git
synced 2026-01-26 12:02:14 +00:00
BuildROMs: Make sure that multiple ROM includes are each numbered _n
The first ROM included will be defined with names:
BOOT_CODE_SIZE
BOOT_CODE_CHECKSUM
BOOT_CODE_FILENAME
BOOT_CODE_FILEPATH
BOOT_CODE_ARRAY
and BOOT_CODE_URL
That first ROM will also have names:
BOOT_CODE_SIZE_1
BOOT_CODE_CHECKSUM_1
BOOT_CODE_FILENAME_1
BOOT_CODE_FILEPATH_1
BOOT_CODE_ARRAY_1
and BOOT_CODE_URL_1
Subsequent included ROM's will have names
BOOT_CODE_SIZE_n
BOOT_CODE_CHECKSUM_n
BOOT_CODE_FILENAME_n
BOOT_CODE_FILEPATH_n
BOOT_CODE_ARRAY_n
and BOOT_CODE_URL_n
where n is 2 thru the max number of supported ROM includes.
This commit is contained in:
@@ -361,7 +361,7 @@ fprintf (iFile, "#define BOOT_CODE_ARRAY %s\r\n", rom_array_name);
|
||||
fprintf (iFile, "#endif\r\n");
|
||||
fprintf (iFile, "#define BOOT_CODE_URL NULL\r\n");
|
||||
for (rom = 1; rom <= MAX_CONCURRENT_ROMS; rom++) {
|
||||
fprintf (iFile, "#elif !defined(BOOT_CODE_SIZE_%d)\r\n", rom);
|
||||
fprintf (iFile, "%s !defined(BOOT_CODE_SIZE_%d)\r\n", (rom == 1) ? "#endif\r\n#if" : "#elif", rom);
|
||||
fprintf (iFile, "#define BOOT_CODE_SIZE_%d 0x%X\r\n", rom, (int)statb.st_size);
|
||||
fprintf (iFile, "#define BOOT_CODE_CHECKSUM_%d 0x%X\r\n", rom, checksum);
|
||||
fprintf (iFile, "#define BOOT_CODE_FILENAME_%d \"%s\"\r\n", rom, load_filename);
|
||||
|
||||
Reference in New Issue
Block a user