OpenCores
URL https://opencores.org/ocsvn/eco32/eco32/trunk

Subversion Repositories eco32

[/] [eco32/] [trunk/] [sim/] [main.c] - Diff between revs 25 and 91

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 25 Rev 91
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) {

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.