Line 28... |
Line 28... |
fprintf(stderr, "Usage: %s\n", myself);
|
fprintf(stderr, "Usage: %s\n", myself);
|
fprintf(stderr, " [-i] set interactive mode\n");
|
fprintf(stderr, " [-i] set interactive mode\n");
|
fprintf(stderr, " [-m <n>] install n MB of RAM (1-%d)\n",
|
fprintf(stderr, " [-m <n>] install n MB of RAM (1-%d)\n",
|
RAM_SIZE_MAX / M);
|
RAM_SIZE_MAX / M);
|
fprintf(stderr, " [-l <prog>] set program file name\n");
|
fprintf(stderr, " [-l <prog>] set program file name\n");
|
|
fprintf(stderr, " [-a <addr>] set program load address\n");
|
fprintf(stderr, " [-r <rom>] set ROM image file name\n");
|
fprintf(stderr, " [-r <rom>] set ROM image file name\n");
|
fprintf(stderr, " [-d <disk>] set disk image file name\n");
|
fprintf(stderr, " [-d <disk>] set disk image file name\n");
|
fprintf(stderr, " [-t <n>] connect n terminals (0-%d)\n",
|
fprintf(stderr, " [-t <n>] connect n terminals (0-%d)\n",
|
MAX_NTERMS);
|
MAX_NTERMS);
|
fprintf(stderr, " [-g] install graphics controller\n");
|
fprintf(stderr, " [-g] install graphics controller\n");
|
Line 48... |
Line 49... |
char *argp;
|
char *argp;
|
char *endp;
|
char *endp;
|
Bool interactive;
|
Bool interactive;
|
int memSize;
|
int memSize;
|
char *progName;
|
char *progName;
|
|
unsigned int loadAddr;
|
char *romName;
|
char *romName;
|
char *diskName;
|
char *diskName;
|
int numTerms;
|
int numTerms;
|
Bool graphics;
|
Bool graphics;
|
Bool console;
|
Bool console;
|
Line 61... |
Line 63... |
char *line;
|
char *line;
|
|
|
interactive = false;
|
interactive = false;
|
memSize = RAM_SIZE_DFL / M;
|
memSize = RAM_SIZE_DFL / M;
|
progName = NULL;
|
progName = NULL;
|
|
loadAddr = 0;
|
romName = NULL;
|
romName = NULL;
|
diskName = NULL;
|
diskName = NULL;
|
numTerms = 0;
|
numTerms = 0;
|
graphics = false;
|
graphics = false;
|
console = false;
|
console = false;
|
Line 94... |
Line 97... |
if (i == argc - 1 || progName != NULL || romName != NULL) {
|
if (i == argc - 1 || progName != NULL || romName != NULL) {
|
usage(argv[0]);
|
usage(argv[0]);
|
}
|
}
|
progName = argv[++i];
|
progName = argv[++i];
|
break;
|
break;
|
|
case 'a':
|
|
if (i == argc - 1) {
|
|
usage(argv[0]);
|
|
}
|
|
loadAddr = strtoul(argv[++i], &endp, 0);
|
|
if (*endp != '\0') {
|
|
usage(argv[0]);
|
|
}
|
|
break;
|
case 'r':
|
case 'r':
|
if (i == argc - 1 || romName != NULL || progName != NULL) {
|
if (i == argc - 1 || romName != NULL || progName != NULL) {
|
usage(argv[0]);
|
usage(argv[0]);
|
}
|
}
|
romName = argv[++i];
|
romName = argv[++i];
|
Line 153... |
Line 165... |
outputInit(outputName);
|
outputInit(outputName);
|
shutdownInit();
|
shutdownInit();
|
if (graphics) {
|
if (graphics) {
|
graphInit();
|
graphInit();
|
}
|
}
|
memoryInit(memSize * M, progName, romName);
|
memoryInit(memSize * M, progName, loadAddr, romName);
|
mmuInit();
|
mmuInit();
|
if (progName != NULL) {
|
if (progName != NULL) {
|
initialPC = 0xC0000000;
|
initialPC = 0xC0000000 | loadAddr;
|
} else {
|
} else {
|
initialPC = 0xC0000000 | ROM_BASE;
|
initialPC = 0xC0000000 | ROM_BASE;
|
}
|
}
|
cpuInit(initialPC);
|
cpuInit(initialPC);
|
if (!interactive) {
|
if (!interactive) {
|