public void init() {
    System.out.println("###### Applet init() #######");
    started = false;
    stopping = false;
    currentDisk = null;

    if (cpu == null) {
      SIDMixer.DL_BUFFER_SIZE = 16384;

      System.out.println("starting CPU");
      cpu = new CPU(imon, getCodeBase().toString(), new SELoader());

      System.out.println("Status: initializing");

      doubleScreen = getParameterAsInt("doubleScreen", 0);
      int freescale = getParameterAsInt("freescale", 0);

      screen = new C64Screen(imon, doubleScreen > 0);
      cpu.init(screen);
      screen.init(cpu);

      if (freescale != 0) {
    	  screen.setIntegerScaling(false);
      }

      // Not when emulating 1541!!
      //      cpu.patchROM(this);

      memory = cpu.getMemory();

      setLayout(new BorderLayout());
      setBackground(Color.black);
      setForeground(lblue);

      // Get the diskdrive reader!!!
      reader = new C64Reader();
      reader.setCPU(cpu);

      canvas = (C64Canvas) screen.getScreen();

      fullscreen(fullscreen);

      screen.registerHotKey(KeyEvent.VK_BACK_SPACE, KeyEvent.CTRL_DOWN_MASK |
			 KeyEvent.ALT_DOWN_MASK
			 , "reset()", cpu);

      screen.registerHotKey(KeyEvent.VK_F12, KeyEvent.CTRL_DOWN_MASK
			    , "toggleFullscreen()", this);


      repaint();
      validate();

      addKeyListener(canvas);
      canvas.requestFocus();

      // A test... for real 1541 emulation...
      cpu.getDrive().setReader(reader);

      AudioClip trackSound = null;
      AudioClip motorSound = null;
      URL url = getClass().getResource("sounds/track.wav");
      System.out.println("Audio URL:" + url);
      if (url != null) trackSound = Applet.newAudioClip(url);
      url = getClass().getResource("sounds/motor.wav");
      if (url != null) motorSound = Applet.newAudioClip(url);
      screen.setSounds(trackSound, motorSound);


      setColorSet(getParameterAsInt("colorset", 0));
      int rq1541 = getParameterAsInt("require1541", 0);
      require1541 = (rq1541 == 1);

      for (int i = 0, n = 12; i < n; i++) {
    	  String f1 = getParameter("hotkey-f" + (i + 1));
    	  if (f1 != null && f1.length() > 0) {
    		  // 0 - 11 => ALT-F1-12
    		  screen.registerHotKey(KeyEvent.VK_F1 + i,
    				  KeyEvent.ALT_DOWN_MASK, f1, this);
    	  }
      }
      System.out.println("*** INIT END ***");
    }
  }