Prev: 62956 Up: Map Next: 62986
62964: Get Random Number
Used by the routine at JumpTable_GetRandomNumber.
(((B + C) % 256 + 171) % 256) * 256 + (C + 205) % 256
Output
A The random number
Get_RandomNumber 62964 PUSH BC Stash BC on the stack.
62965 LD BC,(25778) BC=*RandomNumberSeed.
62969 LD A,C B=B+C.
62970 ADD A,B
62971 LD B,A
62972 LD A,205 C=205+C.
62974 ADD A,C
62975 LD C,A
62976 LD A,171 B+=171.
62978 ADC A,B
62979 LD B,A
62980 LD (25778),BC Write the updated BC to *RandomNumberSeed.
62984 POP BC Restore BC from the stack.
62985 RET Return.
View the equivalent code in Booty.
Prev: 62956 Up: Map Next: 62986