Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PutEnemyExplosion: ;A=(FF[big] to FF-7[small]) count; E=Y D=X
- ;we're not going to bother with clipping as of yet
- cpl
- srl a ;expand the explosion for a bit longer
- add a,a
- add a,a
- add a,a ;x8 for sprite size
- ld hl,PutEnemyExplosionSpriteTable
- add a,L
- ld L,a
- jr nc,_
- inc h
- _:
- push hl
- ld a,e ;y position
- add a,a ;x2 within range
- add a,a ;x4 still within range, but not the next.
- ld h,0
- ld b,h
- ld L,a
- add hl,hl ;x8 Now we're cooking with propane
- ld a,d ;x position
- and 7 ;get 3 low bits for sprite rotation logic
- cpl
- add a,9 ;and inverse this thinger
- ld c,a
- ld ix,PutEnemyExplosionShifter
- add ix,bc
- ld a,d
- and 7
- add a,$08 ;getting spritemask position from LUTable.z80
- ld e,a ;putting to address LSB to complete later. We kinda still need D.
- ld a,d
- and %00111000
- rrca
- rrca
- rrca
- add a,L
- ld L,a ;not crossing any 256 byte boundaries, are we?
- set 7,h ;completing the screen address
- ld d,$40 ;completing address to sprite mask above
- ld a,(de)
- ld b,a ;mask (left side AND)
- cpl ;invert it
- ld c,a ;mask (right side AND)
- pop de
- ld (itemp2),sp
- ld sp,7 ;and now we're cooking with dragon fire~!
- ld a,8
- PutEnemyExplosionLoop: ;DE=spriteLocation, HL=screenbuf
- ex af,af'
- ld a,(de)
- jp (ix)
- PutEnemyExplosionShifter:
- rrca
- rrca
- rrca
- rrca
- rrca
- rrca
- rrca
- rrca
- ld (itemp3),a ;I don't have a better way of doing this yet.
- and c
- or (hl)
- ld (hl),a
- inc hl
- ld a,(itemp3)
- and b
- or (hl)
- ld (hl),a
- add hl,sp
- inc de
- ex af,af'
- dec a
- jr nz,PutEnemyExplosionLoop
- ld sp,(itemp2)
- ret
Advertisement
Add Comment
Please, Sign In to add comment