Prev: 49110 Up: Map Next: 49206
49115: Draw Flipped Shifted Columns
Draws the columns of a sprite which is flipped and shifted. There is a piece of code for each of up to five columns of the sprite, and the code for the width of the sprite is where the jump at SpriteJumpOpcode starts. Each piece puts a column into two bytes of the buffer, using the table for the shift to turn the mask and the pixels round and split them in two. It works from right to left.
The jump at SpriteJumpOpcode starts here for five columns.
DrawFlippedShiftedColumns 49115 CPL Invert the screen byte.
49116 POP DE Restore the mask into E and the pixels into D from the stack.
49117 LD L,E Clear the screen bits under the part of the mask which is in this byte.
49118 OR (HL)
49119 CPL
49120 LD L,D Add the part of the pixels which is in this byte.
49121 OR (HL)
49122 LD (BC),A Store the byte and move on to the byte on the left.
49123 DEC BC
49124 DEC H Point H at the table for the bits which move into the next byte, and fetch that screen byte.
49125 LD L,E
49126 LD A,(BC)
49127 CPL Clear the screen bits under the part of the mask which has moved into it.
49128 OR (HL)
49129 CPL
49130 LD L,D Add the part of the pixels which has moved into it.
49131 OR (HL)
49132 INC H Point H back at the first table.
The jump at SpriteJumpOpcode starts here for four columns.
49133 CPL Invert the screen byte.
49134 POP DE Restore the mask into E and the pixels into D from the stack.
49135 LD L,E Clear the screen bits under the part of the mask which is in this byte.
49136 OR (HL)
49137 CPL
49138 LD L,D Add the part of the pixels which is in this byte.
49139 OR (HL)
49140 LD (BC),A Store the byte and move on to the byte on the left.
49141 DEC BC
49142 DEC H Point H at the table for the bits which move into the next byte, and fetch that screen byte.
49143 LD L,E
49144 LD A,(BC)
49145 CPL Clear the screen bits under the part of the mask which has moved into it.
49146 OR (HL)
49147 CPL
49148 LD L,D Add the part of the pixels which has moved into it.
49149 OR (HL)
49150 INC H Point H back at the first table.
The jump at SpriteJumpOpcode starts here for three columns.
49151 CPL Invert the screen byte.
49152 POP DE Restore the mask into E and the pixels into D from the stack.
49153 LD L,E Clear the screen bits under the part of the mask which is in this byte.
49154 OR (HL)
49155 CPL
49156 LD L,D Add the part of the pixels which is in this byte.
49157 OR (HL)
49158 LD (BC),A Store the byte and move on to the byte on the left.
49159 DEC BC
49160 DEC H Point H at the table for the bits which move into the next byte, and fetch that screen byte.
49161 LD L,E
49162 LD A,(BC)
49163 CPL Clear the screen bits under the part of the mask which has moved into it.
49164 OR (HL)
49165 CPL
49166 LD L,D Add the part of the pixels which has moved into it.
49167 OR (HL)
49168 INC H Point H back at the first table.
The jump at SpriteJumpOpcode starts here for two columns.
49169 CPL Invert the screen byte.
49170 POP DE Restore the mask into E and the pixels into D from the stack.
49171 LD L,E Clear the screen bits under the part of the mask which is in this byte.
49172 OR (HL)
49173 CPL
49174 LD L,D Add the part of the pixels which is in this byte.
49175 OR (HL)
49176 LD (BC),A Store the byte and move on to the byte on the left.
49177 DEC BC
49178 DEC H Point H at the table for the bits which move into the next byte, and fetch that screen byte.
49179 LD L,E
49180 LD A,(BC)
49181 CPL Clear the screen bits under the part of the mask which has moved into it.
49182 OR (HL)
49183 CPL
49184 LD L,D Add the part of the pixels which has moved into it.
49185 OR (HL)
49186 INC H Point H back at the first table.
The jump at SpriteJumpOpcode starts here for one column.
49187 CPL Invert the screen byte.
49188 POP DE Restore the mask into E and the pixels into D from the stack.
49189 LD L,E Clear the screen bits under the part of the mask which is in this byte.
49190 OR (HL)
49191 CPL
49192 LD L,D Add the part of the pixels which is in this byte.
49193 OR (HL)
49194 LD (BC),A Store the byte and move on to the byte on the left.
49195 DEC BC
49196 DEC H Point H at the table for the bits which move into the next byte, and fetch that screen byte.
49197 LD L,E
49198 LD A,(BC)
49199 CPL Clear the screen bits under the part of the mask which has moved into it.
49200 OR (HL)
49201 CPL
49202 LD L,D Add the part of the pixels which has moved into it.
49203 OR (HL)
49204 INC H Point H back at the first table.
49205 LD (BC),A Store the last byte of the row.
Continue on to FinishFlippedSpriteRow.
Prev: 49110 Up: Map Next: 49206