Prev: 50967 Up: Map Next: 51053
50990: Draw Block Row Data
Used by the routine at DrawShortRow.
Finds the tile for a row in the table at 26222 flips it with FlipBlockData when its top bit differs, and draws it with DrawBlockBytes. A row size of 16 is drawn at once. Any other size is given a limit of the column plus 16.
The column offset is four times the row, less 7. The tile index and its top bit are patched, as they are for DrawBlockRow.
TestBlockRow_Draw 50990 LD A,E The column offset is four times the row, less 7.
50991 SUB 7
50993 ADD A,A
50994 ADD A,A
50995 LD C,A
50996 LD B,L Keep the column.
This entry point is used by the routine at DrawBlockSpan.
DrawBlockRowData_Tile 50997 LD HL,26222 Look the tile up. The index is patched.
51000 LD E,0
51002 LD D,0
51004 ADD HL,DE Add the index.
51005 LD A,(HL) Read the tile address.
51006 INC HL
51007 LD H,(HL)
51008 LD L,A
51009 LD A,0 Compare the tile with the patched top bit.
51011 XOR (HL)
51012 CALL NZ,FlipBlockData Flip the tile when they differ.
51015 LD A,L Add the column offset to the tile address.
51016 ADD A,C
51017 LD L,A
51018 JR NC,DrawBlockRowData_Draw
51020 INC H Count the carry in the high byte.
DrawBlockRowData_Draw 51021 INC HL Move past the tile's flag.
51022 LD A,(IY+5) A row size of 16 is drawn as it stands.
51025 CP 16
51027 LD A,B Bring the column back.
51028 JR Z,DrawBlockBytes Draw it now when the row size is 16.
51030 PUSH HL Remember the tile.
51031 ADD A,16 The limit passed to the drawer is the column plus 16.
51033 LD (51052),A
51036 LD A,B Bring the column back.
51037 CALL DrawBlockBytes Draw the bytes.
51040 POP HL Restore the tile.
51041 LD C,(IY+6) Step on by four times the position byte.
51044 SLA C
51046 SLA C
51048 LD B,0 Add that step.
51050 ADD HL,BC
This entry point is used by the routine at DrawBlockSection.
DrawBlockRowData_Limit 51051 LD A,0 Use the patched limit. Drawing continues in DrawBlockBytes.
Continue on to DrawBlockBytes.
Prev: 50967 Up: Map Next: 51053