A89: BoulderDash PutSprite Routine


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

A89: BoulderDash PutSprite Routine




Can someone explain this putsprite routine, and how to make it be an 8x8 routine rather than 16x16?  It is from BoulderDash, a _great_ game for the ti89, so I know it works as it is below.  If someone could convert it to display 8x8 sprites, I would really appreciate it.  It seems much simpler than the routine I saw on the ACZ site.

; --------------------------------
;
;  Puts a 16x16 sprite (grayscale)
;
;  IN:  a0 - Pointer to sprite
;       d0 - x coord
;       d1 - y coord
;
;  OUT: -
;
; --------------------------------

PutSprite:
 movem.l d0-d2/a0-a2,-(a7)
 lsl.w   #1,d0
 lsl.w   #5,d1
 move.l  d1,d2
 lsl.w   #4,d2
 sub.w   d1,d2
 add.w   d0,d2
 lea     LCD_MEM,a1
 move.l  plane0,a2
 adda.w  d2,a1
 adda.l  d2,a2
 moveq   #3,d0
PS_NewRow:
 move.w  (a0)+,(a1)
 move.w  (a0)+,(a2)
 move.w  (a0)+,30(a1)
 move.w  (a0)+,30(a2)
 move.w  (a0)+,60(a1)
 move.w  (a0)+,60(a2)
 move.w  (a0)+,90(a1)
 move.w  (a0)+,90(a2)
 lea     120(a1),a1
 lea     120(a2),a2
 dbra    d0,PS_NewRow
 movem.l (a7)+,d0-d2/a0-a2
 rts


-----------------------------------------------
FREE! The World's Best Email Address @email.com
Reserve your name now at http://www.email.com


Follow-Ups: