mc34063a lm7812
In your case, using 7805 in TO-3 or TO-220 packages is the most feasible solution, as you do not want to use the simplest and most universal MC34063 switching regulator. Do not use zener circuit, as it will heat much and give the worst efficiency.
The problem you are facing is heat from 7805, of which 7805 would die? The solution is one of the followings:
1. You use a power resistor to share the heat with 7805, with calculation for dropout on it is about 10 to 14V, the rest 9 to 5 volts for 7805 dropout. Its power dissipation capability must be at least twice the power = dropout * current.
2. You use a pre-regulator with a power transistor with the output of about 8 to 9V, and then this 7805. For this pre-regulator, you can use a power transistor and a 8.2, 9.1 or 10V zener diode in its base circuit. So you can use this complex circuit in both 24V and 12V very well. Remember to use heatsinks for both transistor and 7805.
nguyennam