Prev: 9AAD Up: Map Next: 9ACB
9ABA: Find Last Row
Moves DE on to the first byte of the last row of a graphic, which is the width multiplied by one less than the height.
Input
B The width of the graphic
C The height of the graphic
DE The address of the graphic
Output
DE The address of the last row
FindLastRow 9ABA PUSH HL Stash HL on the stack.
9ABB PUSH DE Stash DE on the stack.
9ABC LD A,B Fetch the width of the graphic.
9ABD LD E,C Fetch the height of the graphic.
9ABE DEC E Decrease it by one.
9ABF LD D,$00 Clear the high byte of the height.
9AC1 PUSH BC Stash BC on the stack.
9AC2 CALL MultiplyAByDE Call MultiplyAByDE to multiply the width by one less than the height.
9AC5 POP BC Restore BC from the stack.
9AC6 POP DE Restore DE from the stack.
9AC7 ADD HL,DE Add DE to the result.
9AC8 EX DE,HL Switch DE and HL.
9AC9 POP HL Restore HL from the stack.
9ACA RET Return.
Prev: 9AAD Up: Map Next: 9ACB