Prev: 55064 Up: Map Next: 55210
55168: 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.
The first column of a sprite that has five.
DrawAlignedColumns 55168 POP DE Take the mask and the data of the column off the stack.
55169 LD A,(BC) Fetch the byte of the buffer.
55170 CPL Clear the bits of the mask and set the bits of the data.
55171 OR E
55172 CPL
55173 OR D
55174 LD (BC),A Store the byte and move on to the next one.
55175 INC BC
The second column of a sprite that has four or five.
55176 POP DE Take the mask and the data of the column off the stack.
55177 LD A,(BC) Fetch the byte of the buffer.
55178 CPL Clear the bits of the mask and set the bits of the data.
55179 OR E
55180 CPL
55181 OR D
55182 LD (BC),A Store the byte and move on to the next one.
55183 INC BC
The third column of a sprite that has three or more.
55184 POP DE Take the mask and the data of the column off the stack.
55185 LD A,(BC) Fetch the byte of the buffer.
55186 CPL Clear the bits of the mask and set the bits of the data.
55187 OR E
55188 CPL
55189 OR D
55190 LD (BC),A Store the byte and move on to the next one.
55191 INC BC
The fourth column of a sprite that has two or more.
55192 POP DE Take the mask and the data of the column off the stack.
55193 LD A,(BC) Fetch the byte of the buffer.
55194 CPL Clear the bits of the mask and set the bits of the data.
55195 OR E
55196 CPL
55197 OR D
55198 LD (BC),A Store the byte and move on to the next one.
55199 INC BC
The last column.
55200 POP DE Take the mask and the data of the column off the stack.
55201 LD A,(BC) Fetch the byte of the buffer.
55202 CPL Clear the bits of the mask and set the bits of the data.
55203 OR E
55204 CPL
55205 OR D
55206 LD (BC),A Store the byte.
55207 JP DrawLines_Next Jump to DrawLines_Next.
View the equivalent code in;
Prev: 55064 Up: Map Next: 55210