Prev: D7AA Up: Map Next: D7FF
D7AC: Jump into the row, then the shifted run
The JR's offset byte is patched by patch_sprite_rows: back into the aligned run for a byte-aligned sprite, into the shifted run below for any other. Each shifted unit is 16 bytes of code for one source byte. The left part of the mask and image, looked up on page H, finishes the byte in A, which is stored; the right part, on page H + 1, starts the next buffer byte, which is left in A for the next unit. The last spill is stored after the fifth unit.
sprite_row_jump D7AC JR sprite_aligned_tail offset set by patch_sprite_rows
D7AE POP DE the background byte in A, cleared under the mask shifted right and with the image shifted right put in; stored
D7AF LD L,E
D7B0 AND (HL)
D7B1 LD L,D
D7B2 XOR (HL)
D7B3 CPL
D7B4 LD (BC),A
D7B5 INC BC
D7B6 INC H the bits that fall out, into the next buffer byte, left in A
D7B7 LD L,E
D7B8 LD A,(BC)
D7B9 AND (HL)
D7BA LD L,D
D7BB XOR (HL)
D7BC CPL
D7BD DEC H
D7BE POP DE four more units the same
D7BF LD L,E
D7C0 AND (HL)
D7C1 LD L,D
D7C2 XOR (HL)
D7C3 CPL
D7C4 LD (BC),A
D7C5 INC BC
D7C6 INC H
D7C7 LD L,E
D7C8 LD A,(BC)
D7C9 AND (HL)
D7CA LD L,D
D7CB XOR (HL)
D7CC CPL
D7CD DEC H
D7CE POP DE
D7CF LD L,E
D7D0 AND (HL)
D7D1 LD L,D
D7D2 XOR (HL)
D7D3 CPL
D7D4 LD (BC),A
D7D5 INC BC
D7D6 INC H
D7D7 LD L,E
D7D8 LD A,(BC)
D7D9 AND (HL)
D7DA LD L,D
D7DB XOR (HL)
D7DC CPL
D7DD DEC H
D7DE POP DE
D7DF LD L,E
D7E0 AND (HL)
D7E1 LD L,D
D7E2 XOR (HL)
D7E3 CPL
D7E4 LD (BC),A
D7E5 INC BC
D7E6 INC H
D7E7 LD L,E
D7E8 LD A,(BC)
D7E9 AND (HL)
D7EA LD L,D
D7EB XOR (HL)
D7EC CPL
D7ED DEC H
D7EE POP DE
D7EF LD L,E
D7F0 AND (HL)
D7F1 LD L,D
D7F2 XOR (HL)
D7F3 CPL
D7F4 LD (BC),A
D7F5 INC BC
D7F6 INC H
D7F7 LD L,E
D7F8 LD A,(BC)
D7F9 AND (HL)
D7FA LD L,D
D7FB XOR (HL)
D7FC CPL
D7FD DEC H
D7FE LD (BC),A store the last spilled byte
Prev: D7AA Up: Map Next: D7FF