if(!wasPaused && autoFrameSkip) { if(speed >= 99) { frameskipadjust++;  if(frameskipadjust >= 3) { frameskipadjust=0; if(systemFrameSkip > 0) systemFrameSkip--; } } else { if(speed  < 80) frameskipadjust -= (90 - speed)/5; else if(systemFrameSkip < 9) frameskipadjust--;  while(frameskipadjust <= -2) { frameskipadjust += 2; if(systemFrameSkip < 9) systemFrameSkip++; } } wasPaused = FALSE; }
void systemShowSpeed(int speed){  systemSpeed = speed;  showRenderedFrames = renderedFrames;  renderedFrames = 0;  if(videoOption <= VIDEO_4X && showSpeed) {    char buffer[80];    if(showSpeed == 1)      sprintf(buffer, "VisualBoyAdvance-%3d%%", systemSpeed);    else      sprintf(buffer, "VisualBoyAdvance-%3d%%(%d, %d fps)", systemSpeed,              systemFrameSkip,              showRenderedFrames);    systemSetTitle(buffer);  }  if(!wasPaused && autoFrameSkip) {    if(speed >= 99) {      frameskipadjust++;      if(frameskipadjust >= 3) {        frameskipadjust=0;        if(systemFrameSkip > 0)          systemFrameSkip--;      }    } else {      if(speed  < 80)        frameskipadjust -= (90 - speed)/5;      else if(systemFrameSkip < 9)        frameskipadjust--;      while(frameskipadjust <= -2) {        frameskipadjust += 2;        if(systemFrameSkip < 9)          systemFrameSkip++;      }    }    wasPaused = FALSE;  }}