Example #1
0
 private static HardDisk[] getHardDisks(Properties props, String propPrefix) {
   HardDisk[] rv = null;
   if (props != null) {
     for (int i = 0; i < 2; i++) {
       HardDisk disk = null;
       String prefix = String.format("%sharddisk.%d.", propPrefix, i + 1);
       String diskModel = EmuUtil.getProperty(props, prefix + "model");
       String fileName = EmuUtil.getProperty(props, prefix + "file");
       if (!diskModel.isEmpty() && !fileName.isEmpty()) {
         int c = EmuUtil.getIntProperty(props, prefix + "cylinders", 0);
         int h = EmuUtil.getIntProperty(props, prefix + "heads", 0);
         int n = EmuUtil.getIntProperty(props, prefix + "sectors_per_track", 0);
         if ((c > 0) && (h > 0) && (n > 0)) {
           disk = new HardDisk(diskModel, c, h, n, fileName);
         }
       }
       if (disk != null) {
         if (rv != null) {
           HardDisk[] a = new HardDisk[rv.length + 1];
           System.arraycopy(rv, 0, a, 0, rv.length);
           rv = a;
         } else {
           rv = new HardDisk[1];
         }
         rv[rv.length - 1] = disk;
       }
     }
   }
   return rv;
 }
Example #2
0
  private GIDE(Component owner, String propPrefix, HardDisk[] disks) {
    this.owner = owner;
    this.propPrefix = propPrefix;
    this.disks = disks;
    this.rtc = new RTC7242X();
    this.cylinders = null;
    this.heads = null;
    this.sectorsPerTrack = null;
    this.totalSectors = null;
    this.ioBuf = null;
    this.ioTaskEnabled = true;
    this.ioTaskNoWait = false;
    this.ioTaskThread = new Thread(this, "JKCEMU GIDE");
    this.debugLevel = 0;

    String text = System.getProperty("jkcemu.debug.gide");
    if (text != null) {
      try {
        this.debugLevel = Integer.parseInt(text);
      } catch (NumberFormatException ex) {
      }
    }
    this.ioTaskThread.start();
    reset();
  }