This is probably negotiated on a deal per deal basis, so there should be no "rule" as to what happens but most likely, the console hardware people would pay a certain amount up front so that the developers could more quickly recover their costs for making it, and they would probably receive a certain amount per sale, in order to encourage them to make a great product. How much in practice? Who knows, that kind of thing won't be heavily advertised b/c it could lead to hurt feelings if somebody isn't getting a big enough peice of the pie.