![]() |
Data |
| Prev: 7112 | Up: Map | Next: 728C |
|
Every sprite from here to spr_102 is two header bytes followed by its rows. Header byte 0 holds the width in bytes in bits 0 to 3; bit 6 is set while the rows are stored mirrored left to right and bit 7 while they are stored upside down. Header byte 1 is the height in rows. A row is a pair of bytes for each byte of width: a mask, then an image. print_sprite clears the pixels behind where the mask has a bit set and then ORs in the image, so each pixel is transparent, black or ink. The rows run from the bottom of the sprite upwards, because y in the screen buffer runs up the screen (calc_vram_addr turns it the right way up).
Mirroring is done to the sprite itself. Before drawing, vflip_sprite_data compares bits 6 and 7 of the header with bits 6 and 7 of the object's flags (+7); where they differ it reverses the rows, or the pairs in each row (bit-reversing each byte through reverse_bits_tbl), in place, and toggles the header bit. So one set of pixels serves both ways round, and a snapshot catches each sprite in whichever way it was last drawn: of the 103, only spr_014, the border corner, was caught upside down. The header bits are state, not part of the width.
This first one is empty: its width is 0, and flip_sprite, seeing the 0, returns from its caller without drawing anything. Types $00 and $01 use it.
|
||||
| spr_nul | 728A | DEFB $00,$00 | Width 0, height 0 | |
| Prev: 7112 | Up: Map | Next: 728C |