123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201 |
- ;===========================================================
- bigtile:
- ;===========================================================
- ;Inputs:
- ; A is the method:
- ; 0=Overwrite
- ; 1=AND
- ; 2=XOR
- ; 3=OR
- ; 4=Swap
- ; 5=Erase
- ; 6=Mask
- ; 7=Gray
- ; B is the width (in bytes)
- ; C is the height (in pixels)
- ; DE points to the sprite data
- ; HL points to the output location
- ;Outputs:
- ; HL is A*12 larger (next sprite down?)
- ; DE points to the next byte after the sprite data
- ; A is 0
- ; B is not changed
- ; C is 12-B
- ;===========================================================
- push af
- ld a,c
- di
- ex af,af'
- ld a,12
- sub b
- ld c,a
- pop af
- OverwriteXxY:
- or a
- jr nz,ANDXxY
- ex af,af'
- _:
- ex de,hl
- push bc
- ldi
- inc bc
- djnz $-3
- ex de,hl
- add hl,bc
- pop bc
- dec a
- jr nz,-_
- ret
- ANDXxY:
- dec a
- jr nz,XORXxY
- ex af,af'
- _:
- push bc
- push af
- ld a,(de)
- and (hl)
- ld (hl),a
- inc de
- inc hl
- djnz $-5
- add hl,bc
- pop af
- pop bc
- dec a
- jr nz,-_
- ret
- XORXxY:
- dec a
- jr nz,ORXxY
- ex af,af'
- _:
- push bc
- push af
- ld a,(de)
- xor (hl)
- ld (hl),a
- inc de
- inc hl
- djnz $-5
- add hl,bc
- pop af
- pop bc
- dec a
- jr nz,-_
- ret
- ORXxY:
- dec a
- jr nz,SwapXxY
- ex af,af'
- _:
- push bc
- push af
- ld a,(de)
- or (hl)
- ld (hl),a
- inc de
- inc hl
- djnz $-5
- add hl,bc
- pop af
- pop bc
- dec a
- jr nz,-_
- ret
- SwapXxY:
- dec a
- jr nz,EraseXxY
- ex af,af'
- ld c,12
- _:
- push bc
- push af
- ld a,(de)
- ldi
- dec hl
- ld (hl),a
- inc hl
- djnz $-6
- add hl,bc
- pop af
- pop bc
- dec a
- jr nz,-_
- ret
- EraseXxY:
- dec a
- jr nz,MaskXxY
- ex af,af'
- push bc
- push af
- _:
- ld a,(de)
- cpl
- and (hl)
- ld (hl),a
- inc de
- inc hl
- djnz -_
- add hl,bc
- pop af
- pop bc
- dec a
- jr nz,-_-2
- ret
- MaskXxY:
- dec a
- jr nz,GrayXxY
- ex af,af'
- _:
- push bc
- push af
- ex de,hl
- ld a,(de)
- and (hl)
- inc hl
- or (hl)
- ld (de),a
- inc de
- inc hl
- djnz $-7
- ex de,hl
- add hl,bc
- pop af
- pop bc
- dec a
- jr nz,-_
- ret
- GrayXxY:
- bit grayFlag,(iy+InternalFlag)
- ld a,55h
- jr z,$+3
- rrca
- ex af,af'
- _:
- push bc
- push af
- ex af,af'
- ld (hl),a
- ex de,hl
- and (hl)
- inc hl
- or (hl)
- inc hl
- ex de,hl
- push af
- ld a,(hl)
- ex af,af'
- pop af
- ld (hl),a
- inc hl
- djnz $-14
- add hl,bc
- ex af,af'
- rlca
- ex af,af'
- pop af
- pop bc
- dec a
- jr nz,-_
- ret
|