private void outputStats(StateMap stateMap) {
    System.out.println("LCDC: " + lcdc.getSize());
    
    SpriteStateRange minBefore = null;
    SpriteStateRange maxInFrame = null;
    SpriteStateRange minAfter = null;
    for (SpriteStateRange sprite : sprites) {
      if (sprite.notBeforeOrAt >= 0 && (minBefore == null || sprite.from - sprite.notBeforeOrAt < minBefore.from - minBefore.notBeforeOrAt))
        minBefore = sprite;
      if (maxInFrame == null || sprite.to - sprite.from > maxInFrame.to - maxInFrame.from)
        maxInFrame = sprite;
      if (minAfter == null || sprite.notAtOrAfter - sprite.to < minAfter.notAtOrAfter - minAfter.to)
        minAfter = sprite;
    }

    System.out.println("sprites: " + sprites.size());
    System.out.println("min before: " + minBefore);
    System.out.println("max in frame: " + maxInFrame);
    System.out.println("min after: " + minAfter);
    System.out.println("known tiles: " + stateMap.tileRegistry.getSize());
    System.out.println("known palettes: " + stateMap.objPaletteRegistry.getSize());
    System.out.println();

  }