Prev: D027 Up: Map Next: D0B9
D08F: Draw Aligned Columns
Unrolled code that draws the columns of a sprite that is on a byte boundary. Each column of a line takes a pair of bytes off the stack, which are the mask and the data, clears the bits of the mask in the byte of the buffer and sets the bits of the data. The code is entered at the column that gives the number of columns that the sprite has, and the last column carries on at DrawLines_Next.
Draw the five unrolled columns.
DrawAlignedColumns D08F POP DE Draw the first column of a sprite that has five.
D090 LD A,(BC)
D091 CPL
D092 OR E
D093 CPL
D094 OR D
D095 LD (BC),A
D096 INC BC
D097 POP DE Draw the second column of a sprite that has four or five.
D098 LD A,(BC)
D099 CPL
D09A OR E
D09B CPL
D09C OR D
D09D LD (BC),A
D09E INC BC
D09F POP DE Draw the third column of a sprite that has three or more.
D0A0 LD A,(BC)
D0A1 CPL
D0A2 OR E
D0A3 CPL
D0A4 OR D
D0A5 LD (BC),A
D0A6 INC BC
D0A7 POP DE Draw the fourth column of a sprite that has two or more.
D0A8 LD A,(BC)
D0A9 CPL
D0AA OR E
D0AB CPL
D0AC OR D
D0AD LD (BC),A
D0AE INC BC
D0AF POP DE Draw the last column.
D0B0 LD A,(BC)
D0B1 CPL
D0B2 OR E
D0B3 CPL
D0B4 OR D
D0B5 LD (BC),A
D0B6 JP DrawLines_Next Jump to DrawLines_Next.
View the equivalent code in;
Prev: D027 Up: Map Next: D0B9