I've been thinking about it, and researching the idea, but I don't really see a way that it works. I thought perhaps that if you made a feat that branched off of Spell Mastery to allow you to cast one of the selected spells spontaneously (but at a higher level) then that would work.
However, I wondered if that could overcome spell preparation. I looked into the definition of spell preparation in the Player's Handbook and found out exactly what the process involves:
It consists of a series of mental exercises, guided by the Wizard's spellbook, which
begin the casting of the spell. An interruption point is then reached, where the Wizard can stop casting, leaving the energy of the prepared spell ready to be realeased with a few final movements, and/or words, and/or materials. Thus the spell can be completed at any time by the caster quickly, and even in the harshest environments (i.e. the middle of a battlefield).
Going by this definition, it would stand to reason that no Wizard, however powerful or feat endowed, could possibly cast a spontaneous spell unless through multiclassing or plain ol' Deus Ex Machina.
But I did not stop there! No! I deliberated further, and came up with a possible solution to the problem. Perhaps a feat could be made which was linked to Spell Mastery which would allow for
spontaneous preparation...
Spontaneous Preparation [General]
Prerequisites: ability to prepare and cast arcane spells, Spell Mastery of the chosen spell, Concentration 8 ranks, Spellcraft 8 ranks.
Choose a spell for which you have Spell Mastery. You have mastered that spell to the point that you can condense it's preparation time and prepare it even in the heat of battle. Though on a limited basis.
Benefit: Once per day, you may attempt to prepare a spell for casting in an available spell slot in a reduced amount of time, under any conditions. The level of the spell may not exceed three less than the maximum level of spells you can cast. This preparation requires time equal to the level of the spell plus two rounds, as well as total concentration, which disallows movement beyond a five foot step, and prohibits taking any other actions without losing the spell, and the opportunity to spontaneously prepare any other spells that day. This ability works exactly like casting a spell in regards to attacks of opportunity, concentration checks, etc.
So let me know what you think. This is a completely rough draft of the feat in mind. I like most of the numbers involved, but I'm somewhat concerned about the prerequisites and how they balance out.
Hope this was helpful...