1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
| putSprite: ld e,l ld h,$00 ld d,h add hl,de add hl,de add hl,hl add hl,hl ;Find the Y displacement offset ld e,a and $07 ;Find the bit number ld c,a srl e srl e srl e add hl,de ;Find the X displacement offset ld de,gbuf add hl,de putSpriteLoop1: sl1: ld d,(ix) ;loads image byte into D ld e,$00 ld a,c or a jr z,putSpriteSkip1 putSpriteLoop2: srl d ;rotate to give out smooth moving rr e dec a jr nz,putSpriteLoop2 putSpriteSkip1: ld a,(hl) xor d ld (hl),a inc hl ld a,(hl) xor e ld (hl),a ;copy to buffer using XOR logic ld de,$0B add hl,de inc ix ;Set for next byte of image djnz putSpriteLoop1 ret |