示例#1
0
 public void keyTyped(KeyEvent event) {
   char chr = event.getKeyChar();
   if (chr == 'w') {
     if ((event.getModifiers() & KeyEvent.ALT_MASK) != 0) {
       scr.getAudioDriver().setFullSpeed(!scr.getAudioDriver().fullSpeed());
     }
   }
 }
示例#2
0
 public void paint(Graphics g) {
   // All the paintcode should be here!!!
   if (autoScale) {
     if (w != getWidth() || h != getHeight()) {
       w = getWidth();
       h = getHeight();
       double fac = (1.0 * w) / C64Screen.IMG_TOTWIDTH;
       if (fac > (1.0 * h) / C64Screen.IMG_TOTHEIGHT) {
         fac = (1.0 * h) / C64Screen.IMG_TOTHEIGHT;
       }
       if (integerScale && fac > 1.0) fac = (int) fac;
       scr.setDisplayFactor(fac);
       scr.setDisplayOffset(
           (int) (w - fac * C64Screen.IMG_TOTWIDTH) / 2,
           (int) (h - fac * C64Screen.IMG_TOTHEIGHT) / 2);
     }
   }
   scr.paint(g);
 }