Prev: C998 Up: Map Next: C9C3
C99E: Adjust View Origin
Used by the routines at BuildView and ScrollViewLeft.
Adds an amount to the origin of the view, which is held in ViewPosition, 5CE4 and ViewOriginSum, and changes the scroll position at DrawingFlags to suit.
Input
E The amount
D The high byte of the amount, which is cleared by this entry point
AdjustViewOrigin C99E LD D,$00 The amount is a single byte.
This entry point is used by the routines at BuildView and ScrollViewRight.
AdjustViewOrigin_Signed C9A0 LD HL,($5CE2) Add the amount to the first origin.
C9A3 ADD HL,DE
C9A4 LD ($5CE2),HL
C9A7 LD HL,($5CE4) Add the amount to the second origin.
C9AA ADD HL,DE
C9AB LD ($5CE4),HL
C9AE LD HL,($5CE7) Add the amount twice to the view origin.
C9B1 ADD HL,DE
C9B2 ADD HL,DE
C9B3 LD ($5CE7),HL
C9B6 LD A,($5CF0) The scroll flags move the other way, by twice the amount.
C9B9 LD B,A
C9BA LD A,E
C9BB NEG
C9BD ADD A,A
C9BE ADD A,B
C9BF LD ($5CF0),A
C9C2 RET Return.
Prev: C998 Up: Map Next: C9C3