Prev: 55468 Up: Map Next: 55525
55472: Routine at D8B0
On exit, holds a random number between $00 and $FF.
Random_Number 55472 PUSH BC Stashes BC and HL for later.
55473 PUSH HL
55474 LD A,(55470) Decrease 55470 by one.
55477 DEC A
55478 LD (55470),A
55481 JR NZ,Random_Number_01 If the result is not zero jump to Random_Number_01.
55483 LD HL,(55468)
55486 INC HL
55487 PUSH HL
55488 POP BC
55489 ADD HL,HL
55490 ADD HL,BC
55491 ADD HL,BC
55492 ADD HL,BC
55493 ADD HL,BC
55494 JR Random_Number_02
Random_Number_01 55496 LD HL,(55468)
55499 INC HL
55500 PUSH HL
55501 POP BC
55502 ADD HL,HL
55503 ADD HL,BC
55504 ADD HL,BC
55505 ADD HL,BC
55506 ADD HL,BC
55507 ADD HL,BC
55508 PUSH HL
55509 POP BC
55510 ADD HL,HL
Random_Number_02 55511 ADD HL,BC
55512 DEC HL
55513 LD (55468),HL
55516 LD A,L
55517 LD HL,55471
55520 INC (HL)
55521 ADD A,(HL)
55522 POP HL
55523 POP BC
55524 RET
Prev: 55468 Up: Map Next: 55525