private <T> void updateStateAfterAction(Action<T> action) {
    switch (action.type) {
    case BGPALETTE:
    case OBJPALETTE:
    case HRAM:
    case OAM:
      return;
    case TILE:
      curVramBank = action.position / 0x180;
      return;
    case WRAM:
      curVramBank = action.position / 0x800;
      return;
    default:
      throw new RuntimeException("Unknown action type " + action.type);
    }
  }