Prev: B3D3 Up: Map Next: B479
B44F: The unrolled row of a byte-aligned sprite
Entered by the JR in SPRITE_ROW, as many 8-byte units from the end as the sprite is wide. Each unit takes the next mask and image pair off the stack and does one buffer byte: cleared under the mask (CPL, OR E, CPL), the image ORed in, stored. The last unit has no INC BC, so a row leaves BC on its last byte, which is what the step patched into SPRITE_SHIFTED_RUN allows for.
Input
BC the buffer byte to start at
SP the sprite's next mask and image bytes
A' the rows left
SPRITE_ALIGNED_RUN B44F POP DE the first of five units
B450 LD A,(BC)
B451 CPL
B452 OR E
B453 CPL
B454 OR D
B455 LD (BC),A
B456 INC BC
B457 POP DE three more the same
B458 LD A,(BC)
B459 CPL
B45A OR E
B45B CPL
B45C OR D
B45D LD (BC),A
B45E INC BC
B45F POP DE
B460 LD A,(BC)
B461 CPL
B462 OR E
B463 CPL
B464 OR D
B465 LD (BC),A
B466 INC BC
B467 POP DE
B468 LD A,(BC)
B469 CPL
B46A OR E
B46B CPL
B46C OR D
B46D LD (BC),A
B46E INC BC
B46F POP DE the fifth, without the INC BC
B470 LD A,(BC)
B471 CPL
B472 OR E
B473 CPL
B474 OR D
B475 LD (BC),A
B476 JP SPRITE_NEXT_ROW on to the next row
Prev: B3D3 Up: Map Next: B479