Prev: D55B Up: Map Next: D5D8
D593: Routine at D593
Used by the routine at FindScene.
D593 LD E,A E=A.
D594 CP $06 Jump to D59C if A is not equal to 06.
D596 JR NZ,$D59C
D598 LD A,$01 A=01.
D59A JR $D5A5 Jump to D5A5.
D59C CP $07 Jump to D5A4 if A is not equal to 07.
D59E JR NZ,$D5A4
D5A0 LD A,$02 A=02.
D5A2 JR $D5A5 Jump to D5A5.
D5A4 XOR A Write 00 to *Scene_Carpet.
D5A5 LD ($D3FE),A
D5A8 LD A,E A=E.
D5A9 DEC A Decrease A by one.
D5AA ADD A,A A*=04.
D5AB ADD A,A
D5AC LD E,A E=A.
D5AD ADD A,E A+=E.
D5AE ADD A,E A+=E.
D5AF LD D,$00 D=00.
D5B1 LD E,A E=A.
D5B2 LD HL,$C8BA HL=C8BA.
D5B5 ADD HL,DE HL+=DE.
D5B6 LD DE,$61A0 DE=61A0.
D5B9 LD B,$0C B=0C.
D5BB PUSH HL Stash HL and DE on the stack.
D5BC PUSH DE
D5BD LD A,(HL) A=*HL.
D5BE DEC A Decrease A by one.
D5BF ADD A,A A*=08.
D5C0 ADD A,A
D5C1 ADD A,A
D5C2 LD D,$00 D=00.
D5C4 LD E,A E=A.
D5C5 LD HL,$C91A HL=C91A.
D5C8 ADD HL,DE HL+=DE.
D5C9 POP DE Restore DE from the stack.
D5CA LD C,$08 C=08.
D5CC LD A,(HL) A=*HL.
D5CD LD (DE),A Write A to *DE.
D5CE INC HL Increment HL by one.
D5CF INC DE Increment DE by one.
D5D0 DEC C Decrease C by one.
D5D1 JR NZ,$D5CC Jump to D5CC until C is zero.
D5D3 POP HL Restore HL from the stack.
D5D4 INC HL Increment HL by one.
D5D5 DJNZ $D5BB Decrease counter by one and loop back to D5BB until counter is zero.
D5D7 RET Return.
Prev: D55B Up: Map Next: D5D8