Prev: C59A Up: Map Next: C646
C629: Clip Span
Works out how much of a span is in view. Purpose not yet known.
ClipSpan C629 LD H,$00 H is 00.
C62B LD A,L L moves into A.
C62C SUB E Subtract E.
C62D JR C,ClipSpan_Skip Jump to C63B if the carry flag is set.
C62F LD H,A A moves into H.
C630 SUB B Subtract B.
C631 RET NC Return if the carry flag is reset.
C632 LD L,E E moves into L.
C633 NEG Negate A.
C635 LD B,A A moves into B.
C636 CP C Compare A with C.
C637 RET C Return if the carry flag is set.
C638 LD B,C C moves into B.
ClipSpan_Loop C639 SCF Set the carry flag.
C63A RET Return.
ClipSpan_Skip C63B ADD A,C Plus C.
C63C RET NC Return if the carry flag is reset.
C63D JR Z,ClipSpan_Skip2 Jump to C644 if the zero flag is set.
C63F CP B Compare A with B.
C640 JR NC,ClipSpan_Loop Jump to C639 if the carry flag is reset.
C642 LD B,A A moves into B.
C643 RET Return.
ClipSpan_Skip2 C644 XOR A Set A to zero.
C645 RET Return.
Prev: C59A Up: Map Next: C646