Prev: 38417 Up: Map Next: 38505
38486: Set new random seed
Used by the routines at 38505 and 38795.
Output
A LSB of new random seed
38486 PUSH HL Store HL
38487 PUSH BC Store BC
38488 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
38492 LD HL,(23670) Load the current seed into HL
38495 ADD HL,BC Add these together
38496 LD A,H Add together H and L in A...
38497 ADD A,L ...
38498 LD L,A ...and load into L
38499 LD (23670),HL Store HL as the new seed
38502 POP BC Restore BC
38503 POP HL Restore HL
38504 RET Return
Prev: 38417 Up: Map Next: 38505