private static int runToInputHiOrLoL(Gameboy gbL, Gameboy gbR, int limit, int joypadInputAdd) {
    int initialSteps = gbL.stepCount;
    int add = runToAddressL(limit, gbL, gbR, joypadInputAdd);
    while (true) {
      if (add == 0 || gbL.stepCount - initialSteps > limit)
        return 0;
      int lastVframe = gbL.stepCount - 1; // subtract started frame
      add = dualStepUntilL(gbL, gbR, 0, 0, gbL.rom.readJoypadAddress);
      if (add != 0)
        return lastVframe;
      add = runToAddressL(limit, gbL, gbR, joypadInputAdd, gbL.rom.readJoypadAddress);
      if (add == gbL.rom.readJoypadAddress)
        return lastVframe;
    }
  }