Prev: A66F Up: Map Next: A6B2
A678: Draw Aligned Row Directly
Draws one row of a sprite that is aligned to a byte on the screen. The entry point depends on the width of the sprite in bytes, from six bytes at DrawAlignedRowDirectly to one byte at DrawAlignedRowDirectly_Sixth.
Input
DE Address of the data of the sprite
HL Screen address of the row
DrawAlignedRowDirectly A678 LD A,(DE) Fetch a byte of the sprite.
A679 OR (HL) Set the pixels of the screen.
A67A LD (HL),A Store the byte.
A67B INC L Move on to the next byte of the screen.
A67C INC DE Move on to the next byte of the sprite.
DrawAlignedRowDirectly_Second A67D LD A,(DE) Fetch a byte of the sprite.
A67E OR (HL) Set the pixels of the screen.
A67F LD (HL),A Store the byte.
A680 INC L Move on to the next byte of the screen.
A681 INC DE Move on to the next byte of the sprite.
DrawAlignedRowDirectly_Third A682 LD A,(DE) Fetch a byte of the sprite.
A683 OR (HL) Set the pixels of the screen.
A684 LD (HL),A Store the byte.
A685 INC L Move on to the next byte of the screen.
A686 INC DE Move on to the next byte of the sprite.
DrawAlignedRowDirectly_Fourth A687 LD A,(DE) Fetch a byte of the sprite.
A688 OR (HL) Set the pixels of the screen.
A689 LD (HL),A Store the byte.
A68A INC L Move on to the next byte of the screen.
A68B INC DE Move on to the next byte of the sprite.
DrawAlignedRowDirectly_Fifth A68C LD A,(DE) Fetch a byte of the sprite.
A68D OR (HL) Set the pixels of the screen.
A68E LD (HL),A Store the byte.
A68F INC L Move on to the next byte of the screen.
A690 INC DE Move on to the next byte of the sprite.
DrawAlignedRowDirectly_Sixth A691 LD A,(DE) Fetch a byte of the sprite.
A692 OR (HL) Set the pixels of the screen.
A693 LD (HL),A Store the byte.
A694 INC DE Move on to the next byte of the sprite.
This entry point is used by the routine at DrawMirroredRowDirectly.
DrawAlignedRowDirectly_Next A695 LD A,($5C29) Fetch the low byte of the screen address of the start of the row.
A698 LD L,A Restore it.
A699 DEC H Move up a pixel row.
A69A LD A,H Fetch the high byte.
A69B INC A Add one.
A69C AND %00000111 Keep the bits that give the pixel row.
A69E JP NZ,DrawSpritesDirectly_Row Jump to DrawSpritesDirectly_Row if the row is still in the same cell.
A6A1 LD A,L Fetch the low byte.
A6A2 SUB $20 Move up a row of cells.
A6A4 LD L,A Store it.
A6A5 LD ($5C29),A Store it as the start of the row.
A6A8 JP C,DrawSpritesDirectly_Row Jump to DrawSpritesDirectly_Row if that crossed a third of the screen.
A6AB LD A,H Fetch the high byte.
A6AC ADD A,$08 Add eight to correct it.
A6AE LD H,A Store it.
A6AF JP DrawSpritesDirectly_Row Jump to DrawSpritesDirectly_Row.
Prev: A66F Up: Map Next: A6B2