Prev: C717 Up: Map Next: C76D
C72E: Draw Block Row Data
Used by the routine at DrawShortRow.
Finds the tile for a row in the table at 666E flips it with FlipBlockData when its top bit differs, and draws it with DrawBlockBytes. A row size of 10 is drawn at once. Any other size is given a limit of the column plus 10.
The column offset is four times the row, less 07. The tile index and its top bit are patched, as they are for DrawBlockRow.
TestBlockRow_Draw C72E LD A,E The column offset is four times the row, less 07.
C72F SUB $07
C731 ADD A,A
C732 ADD A,A
C733 LD C,A
C734 LD B,L Keep the column.
This entry point is used by the routine at DrawBlockSpan.
DrawBlockRowData_Tile C735 LD HL,$666E Look the tile up. The index is patched.
C738 LD E,$00
C73A LD D,$00
C73C ADD HL,DE Add the index.
C73D LD A,(HL) Read the tile address.
C73E INC HL
C73F LD H,(HL)
C740 LD L,A
C741 LD A,$00 Compare the tile with the patched top bit.
C743 XOR (HL)
C744 CALL NZ,FlipBlockData Flip the tile when they differ.
C747 LD A,L Add the column offset to the tile address.
C748 ADD A,C
C749 LD L,A
C74A JR NC,DrawBlockRowData_Draw
C74C INC H Count the carry in the high byte.
DrawBlockRowData_Draw C74D INC HL Move past the tile's flag.
C74E LD A,(IY+$05) A row size of 10 is drawn as it stands.
C751 CP $10
C753 LD A,B Bring the column back.
C754 JR Z,DrawBlockBytes Draw it now when the row size is 10.
C756 PUSH HL Remember the tile.
C757 ADD A,$10 The limit passed to the drawer is the column plus 10.
C759 LD ($C76C),A
C75C LD A,B Bring the column back.
C75D CALL DrawBlockBytes Draw the bytes.
C760 POP HL Restore the tile.
C761 LD C,(IY+$06) Step on by four times the position byte.
C764 SLA C
C766 SLA C
C768 LD B,$00 Add that step.
C76A ADD HL,BC
This entry point is used by the routine at DrawBlockSection.
DrawBlockRowData_Limit C76B LD A,$00 Use the patched limit. Drawing continues in DrawBlockBytes.
Continue on to DrawBlockBytes.
Prev: C717 Up: Map Next: C76D