![]() |
Routines |
| Prev: D75A | Up: Map | Next: D790 |
|
Used by the routine at print_sprite.
For a sprite on a byte boundary each byte of a row is one unit of eight bytes of code: the background byte, cleared under the mask with CPL / OR E / CPL, has the image ORed in and is stored. Five units run on from the POP below, and the JR at sprite_row_jump is set to enter them as many units from the end as the sprite is wide.
|
||||
| sprite_aligned | D76F | LD A,(DE) | the width from the header, into byte $18 | |
| D770 | INC DE | |||
| D771 | AND $0F | |||
| D773 | LD (IX+$18),A | |||
| D776 | LD B,A | the JR offset: 8 bytes of code per byte of width, back from the end of the aligned run | ||
| D777 | ADD A,A | |||
| D778 | ADD A,A | |||
| D779 | ADD A,A | |||
| D77A | NEG | |||
| D77C | SUB $06 | |||
| D77E | JR patch_sprite_rows | |||
| D780 | POP DE | the first two units of the aligned run | ||
| D781 | LD A,(BC) | |||
| D782 | CPL | |||
| D783 | OR E | |||
| D784 | CPL | |||
| D785 | OR D | |||
| D786 | LD (BC),A | |||
| D787 | INC BC | |||
| D788 | POP DE | |||
| D789 | LD A,(BC) | |||
| D78A | CPL | |||
| D78B | OR E | |||
| D78C | CPL | |||
| D78D | OR D | |||
| D78E | LD (BC),A | |||
| D78F | INC BC | |||
| Prev: D75A | Up: Map | Next: D790 |