Prev: 50612 Up: Map Next: 50638
50619: Update Random Number
Used by the routines at StartGame, ChooseStartPosition, SpawnBall and SpawnBonus.
Updates the random seed from the frame counter, the old seed and the memory refresh register.
RandomNumber 50619 LD HL,(48050) Fetch the frame counter and the random number.
50622 LD DE,(48042)
50626 LD A,R Fetch a random number from 128 to 255.
50628 ADD A,E Add the low byte of the random number, and then the low byte of the frame counter, to it.
50629 ADC A,L
50630 LD L,A Make that the low byte of the new random number.
50631 LD A,D Add the high byte of the frame counter to the high byte of the random number.
50632 ADD A,H
50633 LD H,A
50634 LD (48042),HL Store the new random number.
50637 RET Return.
Prev: 50612 Up: Map Next: 50638