jetpac | Routines |
Prev: 6f23 | Up: Map | Next: 6f5a |
Note the copious amounts of register swapping! These annotations need checking. Used by the routine at 6f0b.
|
||||||||||||
6f2a | push hl | |||||||||||
6f2b | ex de,hl | Swap Sprite<->Buffer addresses | ||||||||||
6f2c | exx | |||||||||||
6f2d | pop hl | HL=sprite address | ||||||||||
6f2e | pop bc | C (sprite count) is the important value | ||||||||||
6f2f | push bc | Copy the counter back on the stack | ||||||||||
6f30 | ld a,(hl) | A=sprite height value | ||||||||||
6f31 | ex af,af' | Backup "height" to A' | ||||||||||
6f32 | inc hl | HL=start of sprite pixel data | ||||||||||
6f33 | exx | HL=buffer, DE=sprite | ||||||||||
6f34 | ld (hl),$00 | Buffer: set first byte | ||||||||||
6f36 | inc hl | |||||||||||
6f37 | ld (hl),$03 | Buffer: set sprite width | ||||||||||
6f39 | inc hl | Point Buffer to height variable | ||||||||||
6f3a | ex af,af' | Restore A with height value | ||||||||||
6f3b | cp $11 | Jump if height < 17 pixels | ||||||||||
6f3d | jr c,$6f41 | |||||||||||
6f3f | ld a,$10 | else height=16 pixels | ||||||||||
6f41 | ld (hl),a | Buffer: height will be <= 16 | ||||||||||
6f42 | inc hl | Point Buffer to start of pixel data | ||||||||||
6f43 | ld b,a | B=height variable | ||||||||||
6f44 | call $6ea5 | Write pixel to a buffer | ||||||||||
6f47 | pop bc | Reset BC to be only the sprite counter? | ||||||||||
6f48 | pop hl | HL=start of buffer | ||||||||||
6f49 | ld de,$0033 | HL=start of next buffer | ||||||||||
6f4c | add hl,de | |||||||||||
6f4d | pop de | DE=lookup table address | ||||||||||
6f4e | ex de,hl | HL=sprite, DE=buffer | ||||||||||
6f4f | inc hl | HL=sprite width value | ||||||||||
6f50 | inc hl | HL=sprite height value | ||||||||||
6f51 | ld a,($5dd3) | A=Rocket build state - only $00 or $04? | ||||||||||
6f54 | add a,b | |||||||||||
6f55 | ld b,a | |||||||||||
6f56 | dec c | Decrement the sprite counter | ||||||||||
6f57 | jr nz,$6f23 | Fetch next sprite address | ||||||||||
6f59 | ret |
Prev: 6f23 | Up: Map | Next: 6f5a |