LOS ANGELES, Feb. 19 — In a pre-dawn bargain, California legislators on Thursday passed a budget that closes a $42 billion hole, the worst state budget shortfall in U.S. history, after spending 45 straight hours locked in the Capitol trying to find a solution.