Prev: FD7B Up: Map Next: FDB9
FD9B: Generate a random time for the crusher
Used by the routines at 8751 and 8DCD.
Input
BC On return, holds new crusher time
FD9B LD DE,($5C76) Put the previous value in DE.
FD9F LD H,E Do some arithmetic to get a new value.
FDA0 LD L,$FD
FDA2 LD A,D
FDA3 OR A
FDA4 LD B,$00
FDA6 SBC HL,DE
FDA8 SBC A,B
FDA9 SBC HL,DE
FDAB SBC A,B
FDAC LD E,A
FDAD LD D,B
FDAE SBC HL,DE
FDB0 JR NC,$FDB3
FDB2 INC HL
FDB3 LD ($5C76),HL Set the new value in 5C76.
FDB6 LD B,H Copy this to BC and return.
FDB7 LD C,L
FDB8 RET
Prev: FD7B Up: Map Next: FDB9