Ejemplo n.º 1
0
 private void updJoystickFrm(final int joyNum) {
   final JoystickFrm joyFrm = this.joyFrm;
   if ((joyFrm != null) && (joyNum >= 0) && (joyNum < this.joyThreads.length)) {
     int nJoys = 0;
     EmuSys emuSys = this.emuSys;
     if (emuSys != null) {
       nJoys = emuSys.getSupportedJoystickCount();
     }
     final boolean emulated = (joyNum < nJoys);
     final boolean connected = (this.joyThreads[joyNum] != null);
     EventQueue.invokeLater(
         new Runnable() {
           @Override
           public void run() {
             joyFrm.setJoystickState(joyNum, emulated, connected);
           }
         });
   }
 }
Ejemplo n.º 2
0
  public synchronized void applySettings(Properties props) {
    // zu emulierendes System ermitteln
    boolean done = false;
    EmuSys emuSys = this.emuSys;
    if (emuSys != null) {
      if (emuSys.canApplySettings(props)) {
        done = true;
      }
    }
    if ((emuSys != null) && done) {
      emuSys.applySettings(props);
    } else {
      if (emuSys != null) {
        emuSys.cancelPastingText();
        emuSys.die();
      }
      String sysName = EmuUtil.getProperty(props, "jkcemu.system");
      if (sysName.startsWith("AC1")) {
        emuSys = new AC1(this, props);
      } else if (sysName.startsWith("BCS3")) {
        emuSys = new BCS3(this, props);
      } else if (sysName.startsWith("C80")) {
        emuSys = new C80(this, props);
      } else if (sysName.startsWith("HueblerEvertMC")) {
        emuSys = new HueblerEvertMC(this, props);
      } else if (sysName.startsWith("HueblerGraphicsMC")) {
        emuSys = new HueblerGraphicsMC(this, props);
      } else if (sysName.startsWith("KC85/1")
          || sysName.startsWith("KC87")
          || sysName.startsWith("Z9001")) {
        emuSys = new Z9001(this, props);
      } else if (sysName.startsWith("HC900")
          || sysName.startsWith("KC85/2")
          || sysName.startsWith("KC85/3")
          || sysName.startsWith("KC85/4")
          || sysName.startsWith("KC85/5")) {
        emuSys = new KC85(this, props);
      } else if (sysName.startsWith("KCcompact")) {
        emuSys = new KCcompact(this, props);
      } else if (sysName.startsWith("KramerMC")) {
        emuSys = new KramerMC(this, props);
      } else if (sysName.startsWith("LC80")) {
        emuSys = new LC80(this, props);
      } else if (sysName.startsWith("LLC1")) {
        emuSys = new LLC1(this, props);
      } else if (sysName.startsWith("LLC2")) {
        emuSys = new LLC2(this, props);
      } else if (sysName.startsWith("PC/M")) {
        emuSys = new PCM(this, props);
      } else if (sysName.startsWith("Poly880")) {
        emuSys = new Poly880(this, props);
      } else if (sysName.startsWith("SC2")) {
        emuSys = new SC2(this, props);
      } else if (sysName.startsWith("SLC1")) {
        emuSys = new SLC1(this, props);
      } else if (sysName.startsWith("VCS80")) {
        emuSys = new VCS80(this, props);
      } else if (sysName.startsWith("Z1013")) {
        emuSys = new Z1013(this, props);
      } else if (sysName.startsWith("ZXSpectrum")) {
        emuSys = new ZXSpectrum(this, props);
      } else {
        emuSys = new A5105(this, props);
      }
      ResetLevel resetLevel = ResetLevel.POWER_ON;
      if (this.emuSys != null) {
        String s1 = this.emuSys.getTitle();
        String s2 = emuSys.getTitle();
        if ((s1 != null) && (s2 != null)) {
          if (s1.equals(s2)) {
            resetLevel = ResetLevel.COLD_RESET;
          }
        }
      }
      this.emuSys = emuSys;
      fireReset(resetLevel);
    }

    // Floppy Disks
    FloppyDiskStationFrm frm = FloppyDiskStationFrm.getSharedInstance(this.screenFrm);
    if (frm != null) {
      int n = emuSys.getSupportedFloppyDiskDriveCount();
      frm.setDriveCount(n);
      for (int i = 0; i < n; i++) {
        emuSys.setFloppyDiskDrive(i, frm.getDrive(i));
      }
    }

    // Joysticks
    int nJoys = emuSys.getSupportedJoystickCount();
    for (int i = 0; i < this.joyThreads.length; i++) {
      JoystickThread jt = null;
      synchronized (this.joyThreads) {
        jt = this.joyThreads[i];
        if (jt != null) {
          if (i >= nJoys) {
            jt.fireStop();
            this.joyThreads[i] = null;
          }
          jt = null;
        } else {
          if (i < nJoys) {
            jt = new JoystickThread(this, i, false);
            this.joyThreads[i] = jt;
          }
        }
      }
      if (jt != null) {
        jt.start();
      }
      updJoystickFrm(i);
    }

    // CPU-Geschwindigkeit
    updCPUSpeed(props);

    // sonstiges
    this.iso646de = null;
  }