Prev: 23847 Up: Map Next: 25620
25600: Get Random Number
Used by the routines at 25770, 25856, 28808, 28829, InitialiseNewLevel and DemoModeInput.
Output
A Random number
GetRandomNumber 25600 PUSH HL Stash HL on the stack.
25601 LD HL,(30750) HL=*RandomNumberSeed.
25604 LD A,(HL) A=*HL.
25605 INC L Increment L by one.
25606 JR NZ,GetRandomNumber_0 Jump to GetRandomNumber_0 if L is not zero.
25608 INC H Increment H by one.
25609 BIT 2,H Jump to GetRandomNumber_0 if bit 2 of H is not set.
25611 JR Z,GetRandomNumber_0
25613 LD H,121 H=121.
GetRandomNumber_0 25615 LD (30750),HL Write HL to *RandomNumberSeed.
25618 POP HL Restore HL from the stack.
25619 RET Return.
Prev: 23847 Up: Map Next: 25620