A85: Put Sprite


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

A85: Put Sprite




I am having a problem with Put Sprite.  After realizing that NASR has
pretty some shitty clipping, not to say of course that it is bad
routine.  When I run the routine is puts some junk on the screen, like
it has the wrong x or y lengths.  Perhaps I have thecode messed up, but
I copied it right from Lesson 5 of Jimmy Mardell's Z-Shell School.  Someone please help me.  Here it is...


#include "TI-85.H"              
                                
.org 0                  
.db "xxx",0      

loop1:				
     ROM_CALL(CLEARLCD)			
     ld a, 4                      ; SET TO GRAPHICS MODE	
     out (5), a                   ;			
     ld b, 50           				
     ld c, 50						
     ld hl, Sprite
     CALL_(PutSprite)
loop2:
     call GET_KEY
     cp $37
     ret z
     jr loop2

PutSprite: ; Puts a sprite stored at (HL) at B,C
      push bc
      push de
      ld a, 63
      sub c
      ld c, a
      push hl
      push hl
      ROM_CALL(FIND_PIXEL)
      ld de, $FC00
      add hl, de
      ex de, hl
      pop hl
      ld b, (hl)
      inc hl
      ld c, (hl)
      inc hl
      push hl
      pop ix
      ex de,hl
PS_NewRow:
      push bc
      ld d, (ix)
      inc ix
      push af
      push hl
PS_NewCol:
      rl d
      ld e, a
      jr nc, PS_NoPixel
      or (hl)
      ld (hl), a
      jr PS_NextPixel
PS_NoPixel:
      cpl
      and (hl)
      ld (hl), a
PS_NextPixel:
      ld a, e
      rrca
      jr nc, PS_SameByte
      inc hl
PS_SameByte:
      djnz PS_NewCol
      pop hl
      pop af
      ld de, 16
      add hl, de
      pop bc
      dec c
      jr nz, PS_NewRow
      pop hl
      pop de
      pop bc
      ret

Sprite:
     .db 8, 8 
     .db %00000000
     .db %00000000
     .db %00000000
     .db %00000000
     .db %00000000
     .db %00000000
     .db %00000000
     .db %00000000


.end    


































_____________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com
Or call Juno at (800) 654-JUNO [654-5866]


Follow-Ups: References: