Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;===========================================================
- DrawSpriteXxY:
- ;===========================================================
- ;Inputs:
- ; A is the method:
- ; 0=Overwrite
- ; 1=AND
- ; 2=XOR
- ; 3=OR
- ; 4=Swap
- ; 5=Erase
- ; 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 ;F5
- ld a,c ;79
- di ;F3
- ex af,af' ;08
- ld a,12 ;3E0C
- sub b ;90
- ld c,a ;4F
- pop af ;F1
- OverwriteXxY:
- or a ;B7
- jr nz,ANDXxY ;2010
- ex af,af' ;08
- ex de,hl ;EB
- push bc ;C5
- ldi ;EDA1
- inc bc ;03
- djnz $-3 ;10FB
- ex de,hl ;EB
- add hl,bc ;09
- pop bc ;C1
- dec a ;3D
- jr nz,$-11 ;20F3
- ret ;C9
- ANDXxY:
- dec a ;3D
- jr nz,XORXxY ;2011
- ex af,af' ;08
- push bc ;C5
- push af ;F5
- ld a,(de) ;1A
- and (hl) ;A6
- ld (hl),a ;77
- inc de ;13
- inc hl ;23
- djnz $-5 ;10F9
- add hl,bc ;09
- pop af ;F1
- pop bc ;C1
- dec a ;3D
- jr nz,$-13 ;20F1
- ret ;C9
- XORXxY:
- dec a ;3D
- jr nz,ORXxY ;2011
- ex af,af' ;08
- push bc ;C5
- push af ;F5
- ld a,(de) ;1A
- xor (hl) ;AE
- ld (hl),a ;77
- inc de ;13
- inc hl ;23
- djnz $-5 ;10F9
- add hl,bc ;09
- pop af ;F1
- pop bc ;C1
- dec a ;3D
- jr nz,$-13 ;20F1
- ret ;C9
- ORXxY:
- dec a ;3D
- jr nz,SwapXxY ;2011
- ex af,af' ;08
- push bc ;C5
- push af ;F5
- ld a,(de) ;1A
- or (hl) ;B6
- ld (hl),a ;77
- inc de ;13
- inc hl ;23
- djnz $-5 ;10F9
- add hl,bc ;09
- pop af ;F1
- pop bc ;C1
- dec a ;3D
- jr nz,$-13 ;20F1
- ret ;C9
- SwapXxY:
- dec a ;3D
- jr nz,EraseXxY ;2011
- ex af,af' ;08
- ld c,12 ;0E0C
- push bc ;C5
- push af ;F5
- ld a,(de) ;1A
- ldi ;EDA0
- dec hl ;2B
- ld (hl),a ;77
- inc hl ;23
- djnz $-6 ;10F8
- add hl,bc ;09
- pop af ;F1
- pop bc ;C1
- dec a ;3D
- jr nz,$-14 ;20F0
- ret ;C9
- EraseXxY:
- ex af,af' ;08
- push bc ;C5
- push af ;F5
- ld a,(de) ;1A
- cpl ;2F
- and (hl) ;A6
- ld (hl),a ;77
- inc de ;13
- inc hl ;23
- djnz $-6 ;10F8
- add hl,bc ;09
- pop af ;F1
- pop bc ;C1
- dec a ;3D
- jr nz,$-14 ;20F0
- ret ;C9
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement