A83: A msprite routine


[Prev][Next][Index][Thread]

A83: A msprite routine




Hi people ....
This is a routine for the 82 for drawing sprites
What should I change so it works for the 83

The sprite data is in ix and the first 4 bites are the size

Is there another sprite routine for the 83 that is faster than this one ... 
for LARGE sprites...

thanks


drw_sprw:
       	 push de
	 ld       a,d
         and      7
         ld       hl,offsets_table
         ld       c,a
         ld       b,0
         add      hl,bc
         ld       a,(hl)
         ld       (wsmc1+1),a
         ld       (wsmc2+1),a

         ld       hl,GRAPH_MEM

         ld       a,e
         add      a,a
         add      a,e
         add      a,a
         rl       b
         add      a,a
         rl       b
         srl      d
         srl      d
         srl      d
         add      a,d
         jr       nc,n1
         inc      b
n1:      ld       c,a
         add      hl,bc

         ld       d,(ix)
         ld       b,(ix+1)
woloop:  push     bc                         ;Save # of rows
         push     hl                         ;Save screen address
         ld       b,d                        ;Load width
         ld       c,(ix+2)                   ;Load one line of image
         inc      ix
wsmc1    ld       a,1                        ;Load pixel mask
wiloop:  sla      c                          ;Test leftmost pixel
         jr       nc,wnoplot                 ;See if a plot is needed
         ld       e,a                        ;OR pixel with screen
         or       (hl)
         ld       (hl),a
         ld       a,e
wnoplot: rrca
         jr       nc,wnotedge                ;Test if edge of byte
reached
         inc      hl                         ;Go to next byte
wnotedge
wsmc2:   cp       1
         jr       z,wover_1

         djnz     wiloop
         pop      hl                         ;Restore address
         ld       bc,12                      ;Go to next line
         add      hl,bc
         pop      bc                         ;Restore data
         djnz     woloop
         ret
wover_1: ld       c,(ix+2)
         inc      ix
         djnz     wiloop
         dec      ix
         pop      hl
         ld       bc,12
         add      hl,bc
         pop      bc
         djnz     woloop
	 pop de
	 ret


PS. I could help with pokemon ... mostly graphics ... and Ideas



()()()()()()()()()()()()()()()()    ()()()()()()
() www.homonerdicus.cjb.net  ()    ()visit me()
()()()()()()()()()()()()()()()    ()()()()()()


______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com