 org &4000

 ; Sprite print routine writen for The Ultimate Sprite Searcher.
 ; Sentinel Software 1993.   41 Enmore Gardens, East Sheen, London, SW14 8RF
 ; Permission is given for the purchaser to this code in his/her own programs. 
 ; Written with MAXAM in mind.


 ;On entry:
 ; HL = sprite data address
 ; DE = screen address
 ; B  = height in pixel lines
 ; C  = width in bytes (1 bytes is equal to 1 MODE 2 character)
 ; On exit
 ; IX and IY preserved
 ; all other registers and flags corrupt


.sprite 
 push de 	 	 ;preserve screen address
 push bc  		 ;preserve dimensions
 ld b,0  		 ;BC = width in bytes
 ldir  			 ;copy the bytes, advance HL
 pop bc  	  	 ;retrieve dimensions
 pop de  		 ;retrieve screen address

 ex de,hl        	 ; 
 call &BC26 		 ;move DE onto next screen line
 ex de,hl      		 ;

 djnz sprite 		 ;loop back if not all lines done
 ret  			 ;if they are return
ite driver

 ;CALL &4000,width,height,screen address,data address - print sprite
 ;CALL &4003