home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Falcon 030 Power 2
/
F030_POWER2.iso
/
ST_STE
/
MAGS
/
ICTARI07.ARJ
/
ictari.07
/
ASSEMBLY
/
SPRITES
/
S_SPRITE.DOC
< prev
next >
Wrap
Text File
|
1993-09-03
|
2KB
|
60 lines
SUB-ROUTINE NAME s_sprite
BRIEF DESCRIPTION Display stationary sprite
FILENAME SPRITE.S
OTHER RESOURCES
LANGUAGE Assembler (Devpac)
AUTHOR Peter Hibbs
ENTRY PARAMETERS d0=x co-ordinate of hot spot (0-319)
d1=y co-ordinate of hot spot (0-199)
d2=sprite number (1-nn)
(screen) holds screen start address
(sprite_tab..) holds sprite info
EXIT PARAMETERS Sprite displayed on screen.
DETAILS -
This routine is similar to the m_sprite sub-routine except that it does
not save the screen data under the sprite. It can be used to display
sprite images on screen or (in conjunction with the screen switching
techniques) can be used to display animated sprites.
Since this routine does not save the screen data, the spr_buffer is not
required, otherwise the limitations of the m_sprite routine also apply to
this one. This routine, however, is much faster because it does not have
save and restore the screen images each time. It should also be noted
that if large stationary sprites are being used, they will be drawn
faster if the x co-ordinate falls on a multiple of 16 pixel boundary,
i.e. 0, 16, 32, 48, 64, 80, etc.
Before the routine is used, the sprite_init routine should be called to
load the sprite file and initialise the table and sprite data buffers. A
typical code would be as follows -
bsr sprite_init set up table and buffers
tst.l d0 check for error
bmi error_label branch if load error
.. ..
move #10,d0 set x co-ord
move #20,d1 set y co-ord
move #30,d2 use sprite number 30
bsr s_sprite display sprite
..