Prev: 64A4 Up: Map Next: 64FD
64AA: Routine at 64AA
Used by the routine at 6500.
64AA LD HL,$9E00 HL=9E00.
64AD LD BC,$0A00 BC=0A00.
64B0 LD A,$32 A=32.
64B2 CPIR CPIR.
64B4 LD A,B Return if BC is zero.
64B5 OR C
64B6 RET Z
64B7 PUSH HL Stash HL and BC on the stack.
64B8 PUSH BC
64B9 XOR A A=00.
64BA NOP No operation.
64BB NOP
64BC LD B,$04 B=04.
64BE LD E,A E=A.
64BF DEC L Decrease L by one.
64C0 CALL GetRandomNumber Call GetRandomNumber.
64C3 AND %00000111 Keep only bits 0-2.
64C5 CP E Jump to 64F4 if A is lower than E.
64C6 JR C,$64F4
64C8 CALL $7088 Call 7088.
64CB AND %00000111 Keep only bits 0-2.
64CD ADD A,A A+=A.
64CE LD E,A E=A.
64CF ADD A,A A+=A.
64D0 ADD A,E A+=E.
64D1 ADD A,$6C A+=6C.
64D3 LD E,A E=A.
64D4 LD D,$B4 D=B4.
64D6 LD A,(DE) A=*DE.
64D7 LD (HL),A Write A to *HL.
64D8 INC E Increment E by one.
64D9 INC L Increment L by one.
64DA DJNZ $64D6 Decrease counter by one and loop back to 64D6 until counter is zero.
64DC LD A,(DE) Jump to 64F9 if *DE is zero.
64DD AND A
64DE JR Z,$64F9
64E0 DEC L Decrease L by three.
64E1 DEC L
64E2 DEC L
64E3 INC H Increment H by one.
64E4 LD B,$02 B=02.
64E6 LD A,(HL) A=*HL.
64E7 AND A Set flags.
64E8 LD A,(DE) A=*DE.
64E9 JR Z,$64ED Jump to 64ED if *HL is zero.
64EB INC A Increment A by two.
64EC INC A
64ED LD (HL),A Write A to *HL.
64EE INC L Increment L by one.
64EF INC E Increment E by one.
64F0 DJNZ $64E6 Decrease counter by one and loop back to 64E6 until counter is zero.
64F2 JR $64F9 Jump to 64F9.
64F4 LD (HL),$01 Write 01 to *HL.
64F6 INC L Increment L by one.
64F7 DJNZ $64F4 Decrease counter by one and loop back to 64F4 until counter is zero.
64F9 POP BC Restore BC and HL from the stack.
64FA POP HL
64FB JR $64B0 Jump to 64B0.
Prev: 64A4 Up: Map Next: 64FD