Prev: 6ea5 Up: Map Next: 6eef
6ec2: Copy Rocket sprites for current level to the buffers.
Using the sprite lookup table, this routine calculates which Rocket sprites to copy to the buffers or the current level, then calls the copy routine. Used by the routines at 60a7, 60b7 and 6565.
Input
A Is the byte offset between the modules of the current rocket.
6ec2 ld c,a
6ec3 ld a,($5df0) A=player level. Example, if level 3:
6ec6 rrca A=10000001, C=1
6ec7 and $06 A=00000000
6ec9 or c A=00001000 (e.g. if C=$08)
6eca ld c,a BC=sprite offset value
6ecb ld b,$00
6ecd ld hl,$678c Collectible sprite lookup table
6ed0 add hl,bc Offset address
6ed1 ld de,$5ecc DE=start of buffers for all item sprites
6ed4 ld a,$02
6ed6 ld ($5dd3),a Set default for rocket module attached value
6ed9 xor a
6eda ld ($5dd2),a Set default for Jetman rocket module connected value
6edd ld c,$04 Loop counter - all 4 sprites?
6edf xor a
6ee0 push bc Backup loop counter
6ee1 ld b,a A starts at $00, then returns value from 6f0b
6ee2 ld c,$01 C=sprite count
6ee4 call $6f0b HL=pointer to sprite pixel data
6ee7 ld a,b
6ee8 pop bc Restore loop counter
6ee9 dec hl HL=previous lookup table offset
6eea dec hl
6eeb dec c Decrement loop counter
6eec jr nz,$6ee0 Repeat until counter is zero
6eee ret
Prev: 6ea5 Up: Map Next: 6eef