public void init() {
      for (int i = 0; i < actions.size(); i++) {
        TimedAction action = actions.get(i);
        if (action.from == 0 && action.getNextAction().type == Type.HRAM && action.getNextAction().position == GbConstants.LCDC) {
          if (initialLcdc != -1)
            throw new RuntimeException("found multiple initial LCDC operations!");
          initialLcdc = (Integer)action.getNextAction().value;

          if (action.consumeNextAction())
            actions.remove(action);
          i--;
        }
      }
      if (initialLcdc == -1)
        throw new RuntimeException("found no initial LCDC operations!");

      actions.sort(new TimedActionFromComparator());
//      Collections.reverse(actions);
    }