Prev: 55730 Up: Map Next: 55760
55740: Set new random seed and load A and E with a random number
Used by the routine at 36273.
Output
A LSB of new random seed
E LSB of new random seed
55740 PUSH HL Store HL
55741 PUSH BC Store BC
55742 LD BC,(23671) Load B with the least significant byte of the frame counter and C with the most significant byte of the current seed
55746 LD HL,(23670) Load the current seed into HL
55749 ADD HL,BC Add these together
55750 LD A,H Add together H and L in A...
55751 ADD A,L ...
55752 LD L,A ...and load into L
55753 LD (23670),HL Store HL as the new seed
55756 POP BC Restore BC
55757 POP HL Restore HL
55758 LD E,A Load LSB of new seed into E
55759 RET Return
Prev: 55730 Up: Map Next: 55760