Prev: E4CD Up: Map Next: E53A
E4DF: The rest of the shifted run, and the step to the next row
The units from the fourth byte from the end, the way in for a sprite four bytes wide, then the store of the byte the last one began. SPRITE_NEXT_ROW, where the byte-aligned run joins, steps BC on to the next row up by the amount DRAW_SPRITE patched into the ADD, and goes round again from SPRITE_ROW until the rows counted in A' are done. Then the real stack pointer comes back from SAVED_SP, and the RET is the return from DRAW_SPRITE.
SPRITE_SHIFTED_FOUR E4DF CPL The fourth byte from the end: finish the byte in A, cleared under the mask's part from page H and the image's part ORed in; store it; on to the next byte
E4E0 POP DE
E4E1 LD L,E
E4E2 OR (HL)
E4E3 CPL
E4E4 LD L,D
E4E5 OR (HL)
E4E6 LD (BC),A
E4E7 INC BC
E4E8 INC H Begin the next: that buffer byte cleared under the mask's bits from page H + 1, and the image's ORed in; left in A
E4E9 LD L,E
E4EA LD A,(BC)
E4EB CPL
E4EC OR (HL)
E4ED CPL
E4EE LD L,D
E4EF OR (HL)
E4F0 DEC H
E4F1 CPL The third byte from the end
E4F2 POP DE
E4F3 LD L,E
E4F4 OR (HL)
E4F5 CPL
E4F6 LD L,D
E4F7 OR (HL)
E4F8 LD (BC),A
E4F9 INC BC
E4FA INC H
E4FB LD L,E
E4FC LD A,(BC)
E4FD CPL
E4FE OR (HL)
E4FF CPL
E500 LD L,D
E501 OR (HL)
E502 DEC H
E503 CPL The second
E504 POP DE
E505 LD L,E
E506 OR (HL)
E507 CPL
E508 LD L,D
E509 OR (HL)
E50A LD (BC),A
E50B INC BC
E50C INC H
E50D LD L,E
E50E LD A,(BC)
E50F CPL
E510 OR (HL)
E511 CPL
E512 LD L,D
E513 OR (HL)
E514 DEC H
E515 CPL The last
E516 POP DE
E517 LD L,E
E518 OR (HL)
E519 CPL
E51A LD L,D
E51B OR (HL)
E51C LD (BC),A
E51D INC BC
E51E INC H
E51F LD L,E
E520 LD A,(BC)
E521 CPL
E522 OR (HL)
E523 CPL
E524 LD L,D
E525 OR (HL)
E526 DEC H
E527 LD (BC),A Store the byte the last unit began
This entry point is used by the routine at SPRITE_ALIGNED_FOUR.
SPRITE_NEXT_ROW E528 LD A,C SPRITE_NEXT_ROW: BC on to the first byte of the row above; the ADD's operand is patched by DRAW_SPRITE
E529 ADD A,$00
E52B LD C,A
E52C LD A,B
E52D ADC A,$00
E52F LD B,A
E530 EX AF,AF' Count a row, and draw the next
E531 DEC A
E532 JP NZ,SPRITE_ROW
E535 LD SP,(SAVED_SP) Restore SP
E539 RET
Prev: E4CD Up: Map Next: E53A